nielsr HF Staff commited on
Commit
0dcc5bc
Β·
verified Β·
1 Parent(s): 92f78d9

Sync paperswithcode.co frontend

Browse files
Files changed (43) hide show
  1. assets/BenchmarkDetailView-DEjvvzqE.js +2 -0
  2. assets/BenchmarkDetailView-xqwsRkXo.js +0 -2
  3. assets/{CronDashboard-BKnXsL_j.js β†’ CronDashboard-DHvNZD3_.js} +1 -1
  4. assets/{FeedView-C80x2o94.js β†’ FeedView-DkQJBDx2.js} +1 -1
  5. assets/{LatexTitle-B3XSDdDB.js β†’ LatexTitle-CcMIi9G1.js} +1 -1
  6. assets/{MarkdownText-C53MS9a3.js β†’ MarkdownText-p29EEUf7.js} +0 -0
  7. assets/MethodDetailView-B6lC_23G.js +0 -1
  8. assets/MethodDetailView-Bqs-DuBu.js +1 -0
  9. assets/{MethodsIndexView-JzCDiz_K.js β†’ MethodsIndexView-CUF6j1AK.js} +1 -1
  10. assets/{NotFound-Bb5d_WMH.js β†’ NotFound-C1sONCOd.js} +1 -1
  11. assets/PaperDetailView-BBf2E08f.js +0 -0
  12. assets/PaperDetailView-ByZIPZKo.js +0 -51
  13. assets/{PapersListView-CWOVdrmK.js β†’ PapersListView-B62Ept_9.js} +1 -1
  14. assets/{SavedPapersView-BFPe0goC.js β†’ SavedPapersView-BVm6geTt.js} +1 -1
  15. assets/{SearchOverlay-TODlHbiO.js β†’ SearchOverlay-BUaZzPoI.js} +1 -1
  16. assets/SubmissionsDashboard-CGUCxt6x.js +11 -0
  17. assets/SubmissionsDashboard-DOSmJN_y.js +0 -11
  18. assets/{SubmitView-D-PvTKkw.js β†’ SubmitView-BXVcNQUx.js} +1 -1
  19. assets/{TagBrowseView-Chlvmrkj.js β†’ TagBrowseView-BbO1OnLU.js} +1 -1
  20. assets/{TagsIndexView-CCySWJDZ.js β†’ TagsIndexView-BCN4pS2z.js} +1 -1
  21. assets/{alert-BjKDOipI.js β†’ alert-MNWNJkBv.js} +1 -1
  22. assets/api-DKZpnF8C.js +0 -1
  23. assets/api-DLAvdHPg.js +1 -0
  24. assets/{badge-Br1HYKP6.js β†’ badge-CcpUgrz3.js} +1 -1
  25. assets/components-CMH89RDy.js +1 -0
  26. assets/components-CqXuLvpo.js +0 -1
  27. assets/index-B1pEvcfa.css +0 -0
  28. assets/{index-CHlNDaV5.js β†’ index-C6O8_a1-.js} +0 -0
  29. assets/index-DB0aj1bW.css +0 -0
  30. assets/{input-DtdrXk4E.js β†’ input-BMdkOI2Z.js} +1 -1
  31. assets/{loader-circle-DCD7IUZw.js β†’ loader-circle-DK8Ui2RE.js} +1 -1
  32. assets/{refresh-cw-W_Rmqupv.js β†’ refresh-cw-CcA4286O.js} +1 -1
  33. assets/{skeleton-CIY9g4PX.js β†’ skeleton-D8Wtx_Nu.js} +1 -1
  34. assets/{transform-LfD9F8SD.js β†’ transform-D_Izdf89.js} +1 -1
  35. assets/{useDebounce-Bq-Dgz1-.js β†’ useDebounce-BhnwRhGk.js} +1 -1
  36. assets/{useInfiniteQuery-DYjz2HCv.js β†’ useInfiniteQuery-Dd12EyZd.js} +1 -1
  37. assets/{useIntersectionObserver-j3afnyyN.js β†’ useIntersectionObserver-CkOYzKe_.js} +1 -1
  38. assets/{useMutation-DBjQd2jo.js β†’ useMutation-DLRmDXLC.js} +1 -1
  39. assets/{usePapers-Dho-obLV.js β†’ usePapers-CwnyeI7c.js} +1 -1
  40. assets/{usePeriodFilter-F1Py9_Wb.js β†’ usePeriodFilter-BrbWqy5G.js} +1 -1
  41. assets/{useQueries-B_KNu0Lj.js β†’ useQueries-BhLiWt7J.js} +1 -1
  42. assets/{useQuery-qKfgFU9t.js β†’ useQuery-Cvv958Kx.js} +1 -1
  43. index.html +2 -2
assets/BenchmarkDetailView-DEjvvzqE.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import{E as rt,u as nt,r as k,j as s,L as J,N as q,q as st,G as at}from"./index-C6O8_a1-.js";import{u as Y}from"./useQuery-Cvv958Kx.js";import{a as Z}from"./api-DLAvdHPg.js";import{S as ue}from"./skeleton-D8Wtx_Nu.js";import{A as it,a as ct}from"./alert-MNWNJkBv.js";import{L as de}from"./LatexTitle-CcMIi9G1.js";import{I as ot}from"./components-CMH89RDy.js";import"./adminAuth-PI_XkM8E.js";import"./transform-D_Izdf89.js";function lt(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 ut=(()=>{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 O=null;function Ge(e={}){return O||(e.includeStyleProperties?(O=e.includeStyleProperties,O):(O=B(window.getComputedStyle(document.documentElement)),O))}function ae(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function dt(e){const t=ae(e,"border-left-width"),r=ae(e,"border-right-width");return e.clientWidth+t+r}function mt(e){const t=ae(e,"border-top-width"),r=ae(e,"border-bottom-width");return e.clientHeight+t+r}function Ke(e,t={}){const r=t.width||dt(e),n=t.height||mt(e);return{width:r,height:n}}function ht(){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 M=16384;function ft(e){(e.width>M||e.height>M)&&(e.width>M&&e.height>M?e.width>e.height?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M):e.width>M?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M))}function pt(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 c=0;c<i;c+=1)a[c]=n.charCodeAt(c);r(new Blob([a],{type:t.type?t.type:"image/png"}))})}function ie(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 gt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function yt(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),gt(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 xt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function bt(e,t){return Ge(t).map(r=>{const n=e.getPropertyValue(r),i=e.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function wt(e,t,r,n){const i=`.${e}:${t}`,a=r.cssText?xt(r):bt(r,n);return document.createTextNode(`${i}{${a}}`)}function Ae(e,t,r,n){const i=window.getComputedStyle(e,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const c=ut();try{t.className=`${t.className} ${c}`}catch{return}const o=document.createElement("style");o.appendChild(wt(c,r,i,n)),t.appendChild(o)}function vt(e,t,r){Ae(e,t,":before",r),Ae(e,t,":after",r)}const Ie="application/font-woff",Pe="image/jpeg",jt={woff:Ie,woff2:Ie,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Pe,jpeg:Pe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function St(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=St(e).toLowerCase();return jt[t]||""}function kt(e){return e.split(/,/)[1]}function ge(e){return e.search(/^(data:)/)!==-1}function Ct(e,t){return`data:${t};base64,${e}`}async function Qe(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,c)=>{const o=new FileReader;o.onerror=c,o.onloadend=()=>{try{a(r({res:n,result:o.result}))}catch(d){c(d)}},o.readAsDataURL(i)})}const me={};function Et(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 xe(e,t,r){const n=Et(e,t,r.includeQueryParams);if(me[n]!=null)return me[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Qe(e,r.fetchRequestInit,({res:c,result:o})=>(t||(t=c.headers.get("Content-Type")||""),kt(o)));i=Ct(a,t)}catch(a){i=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;a&&(c=typeof a=="string"?a:a.message),c&&console.warn(c)}return me[n]=i,i}async function _t(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ie(t)}async function Rt(e,t){if(e.currentSrc){const a=document.createElement("canvas"),c=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,c==null||c.drawImage(e,0,0,a.width,a.height);const o=a.toDataURL();return ie(o)}const r=e.poster,n=ye(r),i=await xe(r,n,t);return ie(i)}async function $t(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await ce(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Tt(e,t){return T(e,HTMLCanvasElement)?_t(e):T(e,HTMLVideoElement)?Rt(e,t):T(e,HTMLIFrameElement)?$t(e,t):e.cloneNode(Xe(e))}const Mt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Xe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Ft(e,t,r){var n,i;if(Xe(t))return t;let a=[];return Mt(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((c,o)=>c.then(()=>ce(o,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function Nt(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):Ge(r).forEach(a=>{let c=i.getPropertyValue(a);a==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),T(e,HTMLIFrameElement)&&a==="display"&&c==="inline"&&(c="block"),a==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),n.setProperty(a,c,i.getPropertyPriority(a))})}function Lt(e,t){T(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),T(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function At(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 It(e,t,r){return T(t,Element)&&(Nt(e,t,r),vt(e,t,r),Lt(e,t),At(e,t)),t}async function Pt(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 o=r[a].getAttribute("xlink:href");if(o){const d=e.querySelector(o),p=document.querySelector(o);!d&&p&&!n[o]&&(n[o]=await ce(p,t,!0))}}const i=Object.values(n);if(i.length){const a="http://www.w3.org/1999/xhtml",c=document.createElementNS(a,"svg");c.setAttribute("xmlns",a),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const o=document.createElementNS(a,"defs");c.appendChild(o);for(let d=0;d<i.length;d++)o.appendChild(i[d]);e.appendChild(c)}return e}async function ce(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>Tt(n,t)).then(n=>Ft(e,n,t)).then(n=>It(e,n,t)).then(n=>Pt(n,t))}const Je=/url\((['"]?)([^'"]+?)\1\)/g,Dt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Bt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Ht(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Vt(e){const t=[];return e.replace(Je,(r,n,i)=>(t.push(i),r)),t.filter(r=>!ge(r))}async function Ut(e,t,r,n,i){try{const a=r?lt(t,r):t,c=ye(t);let o;return i||(o=await xe(a,c,n)),e.replace(Ht(t),`$1${o}$3`)}catch{}return e}function Ot(e,{preferredFontFormat:t}){return t?e.replace(Bt,r=>{for(;;){const[n,,i]=Dt.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function Ye(e){return e.search(Je)!==-1}async function Ze(e,t,r){if(!Ye(e))return e;const n=Ot(e,r);return Vt(n).reduce((a,c)=>a.then(o=>Ut(o,c,t,r)),Promise.resolve(n))}async function W(e,t,r){var n;const i=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(i){const a=await Ze(i,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function Wt(e,t){await W("background",e,t)||await W("background-image",e,t),await W("mask",e,t)||await W("-webkit-mask",e,t)||await W("mask-image",e,t)||await W("-webkit-mask-image",e,t)}async function qt(e,t){const r=T(e,HTMLImageElement);if(!(r&&!ge(e.src))&&!(T(e,SVGImageElement)&&!ge(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,i=await xe(n,ye(n),t);await new Promise((a,c)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...d)=>{try{a(t.onImageErrorHandler(...d))}catch(p){c(p)}}:c;const o=e;o.decode&&(o.decode=a),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function zt(e,t){const n=B(e.childNodes).map(i=>et(i,t));await Promise.all(n).then(()=>e)}async function et(e,t){T(e,Element)&&(await Wt(e,t),await qt(e,t),await zt(e,t))}function Gt(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 De={};async function Be(e){let t=De[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},De[e]=t,t}async function He(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let o=c.replace(n,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Qe(o,t.fetchRequestInit,({result:d})=>(r=r.replace(c,`url(${d})`),[c,d]))});return Promise.all(a).then(()=>r)}function Ve(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,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(c,"gi");for(;;){let d=a.exec(n);if(d===null){if(d=o.exec(n),d===null)break;a.lastIndex=o.lastIndex}else o.lastIndex=a.lastIndex;t.push(d[0])}return t}async function Kt(e,t){const r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{B(i.cssRules||[]).forEach((a,c)=>{if(a.type===CSSRule.IMPORT_RULE){let o=c+1;const d=a.href,p=Be(d).then(m=>He(m,t)).then(m=>Ve(m).forEach(g=>{try{i.insertRule(g,g.startsWith("@import")?o+=1:i.cssRules.length)}catch(C){console.error("Error inserting rule from remote css",{rule:g,error:C})}})).catch(m=>{console.error("Error loading remote css",m.toString())});n.push(p)}})}catch(a){const c=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&n.push(Be(i.href).then(o=>He(o,t)).then(o=>Ve(o).forEach(d=>{c.insertRule(d,c.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),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=>Ye(t.style.getPropertyValue("src")))}async function Xt(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=B(e.ownerDocument.styleSheets),n=await Kt(r,t);return Qt(n)}function tt(e){return e.trim().replace(/["']/g,"")}function Jt(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{t.add(tt(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function Yt(e,t){const r=await Xt(e,t),n=Jt(e);return(await Promise.all(r.filter(a=>n.has(tt(a.style.fontFamily))).map(a=>{const c=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ze(a.cssText,c,t)}))).join(`
2
+ `)}async function Zt(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Yt(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 er(e,t={}){const{width:r,height:n}=Ke(e,t),i=await ce(e,t,!0);return await Zt(i,t),await et(i,t),Gt(i,t),await yt(i,r,n)}async function tr(e,t={}){const{width:r,height:n}=Ke(e,t),i=await er(e,t),a=await ie(i),c=document.createElement("canvas"),o=c.getContext("2d"),d=t.pixelRatio||ht(),p=t.canvasWidth||r,m=t.canvasHeight||n;return c.width=p*d,c.height=m*d,t.skipAutoScale||ft(c),c.style.width=`${p}`,c.style.height=`${m}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,c.width,c.height)),o.drawImage(a,0,0,c.width,c.height),c}async function rr(e,t={}){const r=await tr(e,t);return await pt(r)}const Ue="#ffffff";function nr(e){if(typeof window>"u")return Ue;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Ue:t}async function sr(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 rr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:nr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const he=5;function ar(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}function Oe(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const fe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function ir(e,t){if(e===t){const{year:d,month:p}=pe(e);return[{timestamp:new Date(d,p,1).getTime(),key:`${d}-${p}`,label:`${fe[p]} ${d}`}]}const r=pe(e),n=pe(t);if(r.year===n.year){const d=n.month-r.month+1;let p=1;const m=12;d>m&&(p=Math.ceil(d/m));const g=[];for(let C=r.month;C<=n.month;C+=p)g.push({timestamp:new Date(r.year,C,1).getTime(),key:`${r.year}-${C}`,label:d<=3?`${fe[C]} ${r.year}`:fe[C]});return g}const i=n.year-r.year+1;let a=1;const c=12;i>c&&(a=Math.ceil(i/c));const o=[];for(let d=r.year;d<=n.year;d+=a)o.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return o}const cr=({points:e,metric:t})=>{const r=at(),[n,i]=k.useState(null),a=880,c=320,o=60,d=30,p=24,m=50,g=e.map(l=>l.value),C=Math.min(...g),F=Math.max(...g)-C||1,G=a-o-d,H=c-p-m,N=e.map(l=>Oe(l.date)),U=Math.min(...N),P=Math.max(...N),E=P-U||1,te=l=>U===P?o+G/2:o+(l-U)/E*G,y=e.map((l,x)=>{const _=te(Oe(l.date)),b=(l.value-C)/F,w=p+H*(1-b);return{x:_,y:w,data:l,idx:x}}),D=y.filter(l=>l.data.isSota);let A="";if(D.length>=2){A=`M${D[0].x},${D[0].y}`;for(let l=1;l<D.length;l++){const x=D[l-1],_=D[l],b=(x.x+_.x)/2;A+=` C${b},${x.y} ${b},${_.y} ${_.x},${_.y}`}}const re=ir(U,P),K=5,ne=l=>i(x=>x===l?null:x),Q=l=>{l&&r(`/paper/${l}`)},V=(l,x)=>{const b=`${l.data.modelName||l.data.paperTitle||"Unknown model"}: ${q(l.data.value)} on ${l.data.dateLabel}`,w=!!l.data.paperRouteId;return s.jsxs("g",{children:[x,s.jsx("circle",{cx:l.x,cy:l.y,r:"10",fill:"transparent",style:{cursor:w?"pointer":"default",outline:"none"},tabIndex:0,role:w?"link":"img","aria-label":b,onMouseEnter:()=>i(l.idx),onMouseLeave:()=>ne(l.idx),onFocus:()=>i(l.idx),onBlur:()=>ne(l.idx),onClick:()=>Q(l.data.paperRouteId),onKeyDown:R=>{w&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),Q(l.data.paperRouteId))},children:s.jsx("title",{children:b})})]},l.idx)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${a} ${c}`,style:{display:"block"},children:[s.jsx("text",{x:o-38,y:p+H/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${p+H/2})`,children:t}),Array.from({length:K}).map((l,x)=>{const _=x/(K-1),b=p+H*(1-_),w=C+F*_;return s.jsxs("g",{children:[s.jsx("line",{x1:o,y1:b,x2:a-d,y2:b,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:o-10,y:b+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:q(w)})]},x)}),re.map(l=>{const x=te(l.timestamp);return s.jsx("text",{x,y:c-m+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:l.label},l.key)}),y.filter(l=>!l.data.isSota).map(l=>{const x=n===l.idx;return V(l,s.jsx("circle",{cx:l.x,cy:l.y,r:x?4:2.5,fill:"var(--ink-faint)",opacity:x?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),A&&s.jsx("path",{d:A,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),D.map(l=>{const x=n===l.idx;return V(l,s.jsx("circle",{cx:l.x,cy:l.y,r:x?6:4.5,fill:x?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),n!==null&&y[n]&&(()=>{const l=y[n],x=l.data.modelName||l.data.paperTitle||"Unknown model",_=x.length>40?x.slice(0,39)+"…":x,b=`${q(l.data.value)} Β· ${l.data.dateLabel}`,R=Math.max(140,Math.min(320,Math.max(_.length,b.length)*6.6+24)),L=46;let $=l.x-R/2;$<o&&($=o),$+R>a-d&&($=a-d-R);const X=l.y-L-14>=p?l.y-L-12:l.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:$,y:X,width:R,height:L,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:$+12,y:X+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:_}),s.jsx("text",{x:$+12,y:X+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:b})]})})()]})};function ee(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 or(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function lr(e){const t=new Map;for(const r of e){const n=or(r),i=t.get(n);if(!i){t.set(n,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}i.metrics={...i.metrics,...r.metrics||{}},i.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(i.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function We(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function qe(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function ur(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const n=e.map(m=>{var z;const g=ee((z=m.metrics)==null?void 0:z[t]),C=m.paper_published_date||"";return{eval:m,value:g,date:C}}).filter(m=>m.value!==null&&!!m.date).sort((m,g)=>m.date.localeCompare(g.date)),i=[];let a=null;for(const m of n){const g=a==null?!0:r==="↓"?m.value<a:m.value>a;g&&(a=m.value),i.push({value:m.value,date:m.date,dateLabel:m.date.slice(0,7),modelName:m.eval.model_name||"",paperTitle:m.eval.paper_title||"",paperRouteId:m.eval.paper_arxiv_id||m.eval.paper_id||null,isSota:g})}const o=e.map(m=>{var g;return{eval:m,value:ee((g=m.metrics)==null?void 0:g[t])}}).filter(m=>m.value!==null).sort((m,g)=>r==="↓"?m.value-g.value:g.value-m.value)[0],d=(o==null?void 0:o.value)??0,p=(o==null?void 0:o.eval.model_name)||(o==null?void 0:o.eval.paper_title)||"";return{points:i,sota:d,sotaModel:p}}const ze=({targetRef:e,label:t})=>{const{toast:r}=st(),[n,i]=k.useState("idle"),a=k.useRef(null);k.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]);const c=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 sr(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]),o=n==="copied"?"Copied":n==="copying"?"Copying…":"Copy image";return s.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:n==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[s.jsx(ot,{name:"copy",size:11}),o]})},wr=()=>{var we,ve,je,Se,ke,Ce,Ee,_e,Re,$e;const{datasetSlug:e}=rt(),[t]=nt(),r=t.get("task")||void 0,n=t.get("eval")||void 0,[i,a]=k.useState(void 0),c=k.useRef(null),o=k.useRef(!1),d=k.useRef(null),p=k.useRef(null),m=Y({queryKey:["dataset",e,"with-paper"],queryFn:()=>Z.getDatasetBySlug(e,{include_paper:!0}),enabled:!!e,staleTime:10*60*1e3}),g=Y({queryKey:["dataset-evals",(we=m.data)==null?void 0:we.id],queryFn:()=>Z.getEvaluationsByDataset(m.data.id),enabled:!!((ve=m.data)!=null&&ve.id),staleTime:5*60*1e3}),C=Y({queryKey:["dataset-tasks",(je=m.data)==null?void 0:je.id],queryFn:()=>Z.getDatasetTasks(m.data.id),enabled:!!((Se=m.data)!=null&&Se.id),staleTime:10*60*1e3}),z=Y({queryKey:["metric-directions"],queryFn:()=>Z.getMetricDirections(),staleTime:60*60*1e3}),F=k.useMemo(()=>{const u=C.data||[];if(u.length===0)return null;if(r){const f=u.find(j=>j.slug===r);if(f)return f.id}if(u.length===1)return u[0].id;const h=g.data||[];if(h.length>0){const f=new Map;for(const v of h)f.set(v.task_id,(f.get(v.task_id)||0)+1);let j=null,S=-1;for(const v of u){const I=f.get(v.id)||0;I>S&&(S=I,j=v.id)}if(j)return j}return u[0].id},[C.data,g.data,r]),G=Y({queryKey:["leaderboard-metrics",(ke=m.data)==null?void 0:ke.id,F],queryFn:()=>Z.getLeaderboardMetrics(m.data.id,F),enabled:!!((Ce=m.data)!=null&&Ce.id)&&!!F,staleTime:10*60*1e3}),H=k.useMemo(()=>{const u=g.data||[];return F?u.filter(h=>h.task_id===F):u},[g.data,F]),N=k.useMemo(()=>lr(H),[H]),U=k.useMemo(()=>{const u=new Set;return N.forEach(h=>{h.best_metric&&u.add(h.best_metric),Object.keys(h.metrics||{}).forEach(f=>u.add(f))}),Array.from(u)},[N]),P=k.useMemo(()=>(G.data||[]).map(u=>u.metric_name),[G.data]),E=P.length?P:U,te=k.useMemo(()=>{var j;if(N.length===0)return E[0]||"";const u=new Map;for(const S of N)for(const v of Object.keys(S.metrics||{}))P.length&&!E.includes(v)||u.set(v,(u.get(v)||0)+1);let h=null,f=0;for(const[S,v]of u)v>f&&(f=v,h=S);return h||E[0]||((j=N[0])==null?void 0:j.best_metric)||""},[N,E,P]),y=i||te,A=(((_e=(Ee=z.data)==null?void 0:Ee.directions)==null?void 0:_e[y])||"higher_is_better")==="lower_is_better"?"↓":"↑",re=k.useMemo(()=>{if(E.length===0)return y?[y]:[];if(E.length<=he)return E;const u=[],h=y&&E.includes(y),f=h?he-1:he;let j=0;for(const S of E)S!==y&&(j>=f||(u.push(S),j++));if(h){const S=E.findIndex(I=>I===y),v=E.slice(0,S).filter(I=>u.includes(I)).length;u.splice(v,0,y)}return u},[E,y]),{points:K,sota:ne,sotaModel:Q}=k.useMemo(()=>ur(N,y,A),[N,y,A]);k.useEffect(()=>{if(o.current||!n||!g.data||g.data.length===0)return;const u=c.current;u&&(o.current=!0,u.scrollIntoView({behavior:"smooth",block:"start"}))},[n,g.data]);const V=k.useMemo(()=>{const u=C.data||[];return F?u.find(h=>h.id===F)||u[0]||null:u[0]||null},[C.data,F]);if(m.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(ue,{className:"h-12 w-1/2 mb-6"}),s.jsx(ue,{className:"h-64 w-full"})]});if(m.error||!m.data)return s.jsx("div",{className:"page",children:s.jsx(it,{variant:"destructive",children:s.jsx(ct,{children:"Benchmark not found."})})});const l=m.data,x=N.slice().sort((u,h)=>{var S,v;const f=ee((S=u.metrics)==null?void 0:S[y]),j=ee((v=h.metrics)==null?void 0:v[y]);return f!==null&&j!==null?A==="↓"?f-j:j-f:f!==null?-1:j!==null?1:qe(u,y)-qe(h,y)}),_=!!l.supports_harness,b=n&&x.find(u=>We(u,n))||null,w=l.introducing_paper??void 0,R=(w==null?void 0:w.arxiv_id)||(w==null?void 0:w.id)||ar(l.paper_url),L=(w==null?void 0:w.title)||l.introducing_paper_title||null,$=((Re=w==null?void 0:w.published)==null?void 0:Re.slice(0,4))||l.introduced_year||null,be=!!R||!!l.paper_url||!!L,X=w!=null&&w.arxiv_id||($e=l.paper_url)!=null&&$e.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${R}`:`Paper ${R}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(J,{to:"/tasks",children:"Tasks"}),V&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(J,{to:`/tasks/${V.slug||V.id}`,children:V.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:l.name})]}),s.jsx("h1",{className:"bm-title",children:l.name}),s.jsxs("div",{className:"bm-subtitle",style:{display:"flex",alignItems:"center",gap:16,flexWrap:"wrap"},children:[s.jsxs("span",{children:[y&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:y}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"Β·"})]}),Q?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:q(ne)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:Q})]}):s.jsxs("span",{children:[x.length," evaluations"]})]}),l.hf_url&&s.jsxs("a",{className:"bm-action-btn",href:l.hf_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx("span",{"aria-hidden":"true",children:"πŸ€—"})," View on Hugging Face"]})]}),l.description&&s.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:l.description}),be&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),R?s.jsxs(J,{to:`/paper/${R}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:L?s.jsx(de,{title:L}):X}),$&&s.jsx("span",{className:"method-source-meta",children:$})]}):l.paper_url?s.jsxs("a",{href:l.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:L?s.jsx(de,{title:L}):l.paper_url}),$&&s.jsx("span",{className:"method-source-meta",children:$})]}):s.jsxs("div",{className:"method-source-link is-static",children:[s.jsx("span",{className:"method-source-title",children:L?s.jsx(de,{title:L}):null}),$&&s.jsx("span",{className:"method-source-meta",children:$})]})]}),K.filter(u=>u.isSota).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:l.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:[E.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:y,onChange:u=>a(u.target.value),children:E.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(ze,{targetRef:d,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(cr,{points:K,metric:y})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),"All models over time Β· highlighted dots track the running best Β· hover for the model Β· click to open the paper"]})]}),b&&(()=>{var S,v;const u=b.paper_arxiv_id||b.paper_id,h=b.paper_title||(b.paper_arxiv_id?`arXiv:${b.paper_arxiv_id}`:null),f=b.best_metric&&((S=b.metrics)==null?void 0:S[b.best_metric])!==void 0?b.best_metric:y,j=(v=b.metrics)==null?void 0:v[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:[b.model_name||h||"β€”",b.harness?` Β· ${b.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[j!==void 0&&f?s.jsxs(s.Fragment,{children:[f,": ",q(j),h?" Β· ":""]}):null,h&&u?s.jsx(J,{to:`/paper/${u}`,children:h}):h||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:l.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:[E.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:y,onChange:u=>a(u.target.value),children:E.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(ze,{targetRef:p,label:"leaderboard"})]})]}),g.isLoading?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((u,h)=>s.jsx(ue,{className:"h-10 w-full mb-2"},h))}):x.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"}),_&&s.jsx("th",{className:"col-harness",children:"Harness"}),re.map(u=>{const h=u===y;return s.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?A==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>a(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${A}`:""]})},u)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let u=null,h=0;return x.map((f,j)=>{var Me,Fe;const S=ee((Me=f.metrics)==null?void 0:Me[y]);let v=null;S!==null&&((u===null||S!==u)&&(h=j+1,u=S),v=h);const I=f.paper_arxiv_id||f.paper_id,Te=f.paper_title||(f.paper_arxiv_id?`arXiv:${f.paper_arxiv_id}`:null),oe=We(f,n);return s.jsxs("tr",{ref:oe?c:void 0,className:oe?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:v??"β€”"}),s.jsxs("td",{className:"col-model",children:[oe&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),f.model_name||"β€”"]}),_&&s.jsx("td",{className:"col-harness",children:f.harness||"β€”"}),re.map(le=>{var Le;const Ne=le===y,se=(Le=f.metrics)==null?void 0:Le[le];return s.jsx("td",{className:`col-value${Ne?" is-active":""}${Ne&&v===1?" is-best":""}`,children:se!=null&&se!==""?q(se):"β€”"},le)}),s.jsx("td",{className:"col-paper",children:I?s.jsx(J,{to:`/paper/${I}`,children:Te||"β€”"}):Te||"β€”"}),s.jsx("td",{className:"col-year",children:((Fe=f.paper_published_date)==null?void 0:Fe.slice(0,4))||"β€”"})]},f.id)})})()})]})]})]})})};export{wr as default};
assets/BenchmarkDetailView-xqwsRkXo.js DELETED
@@ -1,2 +0,0 @@
1
- import{E as Ye,u as Je,r as E,j as s,L as ee,N as K,q as Ze,G as et}from"./index-CHlNDaV5.js";import{u as te}from"./useQuery-qKfgFU9t.js";import{a as re}from"./api-DKZpnF8C.js";import{S as fe}from"./skeleton-CIY9g4PX.js";import{A as tt,a as rt}from"./alert-BjKDOipI.js";import{L as pe}from"./LatexTitle-B3XSDdDB.js";import{I as nt}from"./components-CqXuLvpo.js";import"./adminAuth-PI_XkM8E.js";import"./transform-LfD9F8SD.js";function st(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 at=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function H(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let z=null;function Ue(e={}){return z||(e.includeStyleProperties?(z=e.includeStyleProperties,z):(z=H(window.getComputedStyle(document.documentElement)),z))}function le(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function it(e){const t=le(e,"border-left-width"),r=le(e,"border-right-width");return e.clientWidth+t+r}function lt(e){const t=le(e,"border-top-width"),r=le(e,"border-bottom-width");return e.clientHeight+t+r}function qe(e,t={}){const r=t.width||it(e),n=t.height||lt(e);return{width:r,height:n}}function ct(){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 F=16384;function ot(e){(e.width>F||e.height>F)&&(e.width>F&&e.height>F?e.width>e.height?(e.height*=F/e.width,e.width=F):(e.width*=F/e.height,e.height=F):e.width>F?(e.height*=F/e.width,e.width=F):(e.width*=F/e.height,e.height=F))}function ut(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 ce(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 dt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ht(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),dt(i)}const $=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||$(r,t)};function mt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function ft(e,t){return Ue(t).map(r=>{const n=e.getPropertyValue(r),i=e.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function pt(e,t,r,n){const i=`.${e}:${t}`,a=r.cssText?mt(r):ft(r,n);return document.createTextNode(`${i}{${a}}`)}function Me(e,t,r,n){const i=window.getComputedStyle(e,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const l=at();try{t.className=`${t.className} ${l}`}catch{return}const o=document.createElement("style");o.appendChild(pt(l,r,i,n)),t.appendChild(o)}function gt(e,t,r){Me(e,t,":before",r),Me(e,t,":after",r)}const Ne="application/font-woff",Le="image/jpeg",xt={woff:Ne,woff2:Ne,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Le,jpeg:Le,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 be(e){const t=yt(e).toLowerCase();return xt[t]||""}function bt(e){return e.split(/,/)[1]}function ye(e){return e.search(/^(data:)/)!==-1}function wt(e,t){return`data:${t};base64,${e}`}async function We(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 o=new FileReader;o.onerror=l,o.onloadend=()=>{try{a(r({res:n,result:o.result}))}catch(h){l(h)}},o.readAsDataURL(i)})}const ge={};function vt(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 we(e,t,r){const n=vt(e,t,r.includeQueryParams);if(ge[n]!=null)return ge[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await We(e,r.fetchRequestInit,({res:l,result:o})=>(t||(t=l.headers.get("Content-Type")||""),bt(o)));i=wt(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 ge[n]=i,i}async function jt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ce(t)}async function St(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 o=a.toDataURL();return ce(o)}const r=e.poster,n=be(r),i=await we(r,n,t);return ce(i)}async function kt(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await oe(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Ct(e,t){return $(e,HTMLCanvasElement)?jt(e):$(e,HTMLVideoElement)?St(e,t):$(e,HTMLIFrameElement)?kt(e,t):e.cloneNode(Oe(e))}const Et=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Oe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Rt(e,t,r){var n,i;if(Oe(t))return t;let a=[];return Et(e)&&e.assignedNodes?a=H(e.assignedNodes()):$(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?a=H(e.contentDocument.body.childNodes):a=H(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||$(e,HTMLVideoElement)||await a.reduce((l,o)=>l.then(()=>oe(o,r)).then(h=>{h&&t.appendChild(h)}),Promise.resolve()),t}function _t(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):Ue(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`),$(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){$(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),$(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Tt(e,t){if($(e,HTMLSelectElement)){const r=t,n=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Ft(e,t,r){return $(t,Element)&&(_t(e,t,r),gt(e,t,r),$t(e,t),Tt(e,t)),t}async function Mt(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 o=r[a].getAttribute("xlink:href");if(o){const h=e.querySelector(o),x=document.querySelector(o);!h&&x&&!n[o]&&(n[o]=await oe(x,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 o=document.createElementNS(a,"defs");l.appendChild(o);for(let h=0;h<i.length;h++)o.appendChild(i[h]);e.appendChild(l)}return e}async function oe(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>Ct(n,t)).then(n=>Rt(e,n,t)).then(n=>Ft(e,n,t)).then(n=>Mt(n,t))}const ze=/url\((['"]?)([^'"]+?)\1\)/g,Nt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Lt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function It(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function At(e){const t=[];return e.replace(ze,(r,n,i)=>(t.push(i),r)),t.filter(r=>!ye(r))}async function Pt(e,t,r,n,i){try{const a=r?st(t,r):t,l=be(t);let o;return i||(o=await we(a,l,n)),e.replace(It(t),`$1${o}$3`)}catch{}return e}function Dt(e,{preferredFontFormat:t}){return t?e.replace(Lt,r=>{for(;;){const[n,,i]=Nt.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function Ge(e){return e.search(ze)!==-1}async function Ke(e,t,r){if(!Ge(e))return e;const n=Dt(e,r);return At(n).reduce((a,l)=>a.then(o=>Pt(o,l,t,r)),Promise.resolve(n))}async function G(e,t,r){var n;const i=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(i){const a=await Ke(i,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function Bt(e,t){await G("background",e,t)||await G("background-image",e,t),await G("mask",e,t)||await G("-webkit-mask",e,t)||await G("mask-image",e,t)||await G("-webkit-mask-image",e,t)}async function Ht(e,t){const r=$(e,HTMLImageElement);if(!(r&&!ye(e.src))&&!($(e,SVGImageElement)&&!ye(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,i=await we(n,be(n),t);await new Promise((a,l)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...h)=>{try{a(t.onImageErrorHandler(...h))}catch(x){l(x)}}:l;const o=e;o.decode&&(o.decode=a),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function Vt(e,t){const n=H(e.childNodes).map(i=>Qe(i,t));await Promise.all(n).then(()=>e)}async function Qe(e,t){$(e,Element)&&(await Bt(e,t),await Ht(e,t),await Vt(e,t))}function Ut(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 Ie={};async function Ae(e){let t=Ie[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Ie[e]=t,t}async function Pe(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let o=l.replace(n,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),We(o,t.fetchRequestInit,({result:h})=>(r=r.replace(l,`url(${h})`),[l,h]))});return Promise.all(a).then(()=>r)}function De(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 h=i.exec(n);if(h===null)break;t.push(h[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]*?)})",o=new RegExp(l,"gi");for(;;){let h=a.exec(n);if(h===null){if(h=o.exec(n),h===null)break;a.lastIndex=o.lastIndex}else o.lastIndex=a.lastIndex;t.push(h[0])}return t}async function qt(e,t){const r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{H(i.cssRules||[]).forEach((a,l)=>{if(a.type===CSSRule.IMPORT_RULE){let o=l+1;const h=a.href,x=Ae(h).then(d=>Pe(d,t)).then(d=>De(d).forEach(g=>{try{i.insertRule(g,g.startsWith("@import")?o+=1:i.cssRules.length)}catch(M){console.error("Error inserting rule from remote css",{rule:g,error:M})}})).catch(d=>{console.error("Error loading remote css",d.toString())});n.push(x)}})}catch(a){const l=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&n.push(Ae(i.href).then(o=>Pe(o,t)).then(o=>De(o).forEach(h=>{l.insertRule(h,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(e.forEach(i=>{if("cssRules"in i)try{H(i.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),r))}function Wt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ge(t.style.getPropertyValue("src")))}async function Ot(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=H(e.ownerDocument.styleSheets),n=await qt(r,t);return Wt(n)}function Xe(e){return e.trim().replace(/["']/g,"")}function zt(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{t.add(Xe(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function Gt(e,t){const r=await Ot(e,t),n=zt(e);return(await Promise.all(r.filter(a=>n.has(Xe(a.style.fontFamily))).map(a=>{const l=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ke(a.cssText,l,t)}))).join(`
2
- `)}async function Kt(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Gt(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 Qt(e,t={}){const{width:r,height:n}=qe(e,t),i=await oe(e,t,!0);return await Kt(i,t),await Qe(i,t),Ut(i,t),await ht(i,r,n)}async function Xt(e,t={}){const{width:r,height:n}=qe(e,t),i=await Qt(e,t),a=await ce(i),l=document.createElement("canvas"),o=l.getContext("2d"),h=t.pixelRatio||ct(),x=t.canvasWidth||r,d=t.canvasHeight||n;return l.width=x*h,l.height=d*h,t.skipAutoScale||ot(l),l.style.width=`${x}`,l.style.height=`${d}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,l.width,l.height)),o.drawImage(a,0,0,l.width,l.height),l}async function Yt(e,t={}){const r=await Xt(e,t);return await ut(r)}const Be="#ffffff";function Jt(e){if(typeof window>"u")return Be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Be:t}async function Zt(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 Yt(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Jt(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const xe=5;function er(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}function He(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const tr=({points:e,metric:t})=>{const r=et(),[n,i]=E.useState(null),a=880,l=320,o=60,h=30,x=24,d=50,g=e.map(c=>c.value),M=Math.min(...g),N=Math.max(...g)-M||1,X=a-o-h,_=l-x-d,se=e.map(c=>He(c.date)),P=Math.min(...se),S=Math.max(...se),ue=S-P||1,y=c=>P===S?o+X/2:o+(c-P)/ue*X,Y=e.map((c,p)=>{const w=y(He(c.date)),v=(c.value-M)/N,L=x+_*(1-v);return{x:w,y:L,data:c,idx:p}}),T=Y.filter(c=>c.data.isSota);let V="";if(T.length>=2){V=`M${T[0].x},${T[0].y}`;for(let c=1;c<T.length;c++){const p=T[c-1],w=T[c],v=(p.x+w.x)/2;V+=` C${v},${p.y} ${v},${w.y} ${w.x},${w.y}`}}const U=new Date(P).getFullYear(),ae=new Date(S).getFullYear(),J=5,B=[];if(U===ae)B.push(U);else for(let c=0;c<J;c++)B.push(Math.round(U+(ae-U)*c/(J-1)));const C=5,q=c=>i(p=>p===c?null:p),Z=c=>{c&&r(`/paper/${c}`)},R=(c,p)=>{const v=`${c.data.modelName||c.data.paperTitle||"Unknown model"}: ${K(c.data.value)} on ${c.data.dateLabel}`,L=!!c.data.paperRouteId;return s.jsxs("g",{children:[p,s.jsx("circle",{cx:c.x,cy:c.y,r:"10",fill:"transparent",style:{cursor:L?"pointer":"default",outline:"none"},tabIndex:0,role:L?"link":"img","aria-label":v,onMouseEnter:()=>i(c.idx),onMouseLeave:()=>q(c.idx),onFocus:()=>i(c.idx),onBlur:()=>q(c.idx),onClick:()=>Z(c.data.paperRouteId),onKeyDown:I=>{L&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),Z(c.data.paperRouteId))},children:s.jsx("title",{children:v})})]},c.idx)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,style:{display:"block"},children:[s.jsx("text",{x:o-38,y:x+_/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${x+_/2})`,children:t}),Array.from({length:C}).map((c,p)=>{const w=p/(C-1),v=x+_*(1-w),L=M+N*w;return s.jsxs("g",{children:[s.jsx("line",{x1:o,y1:v,x2:a-h,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:o-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:K(L)})]},p)}),B.map(c=>{const p=y(new Date(c,0,1).getTime());return s.jsx("text",{x:p,y:l-d+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:c},c)}),Y.filter(c=>!c.data.isSota).map(c=>{const p=n===c.idx;return R(c,s.jsx("circle",{cx:c.x,cy:c.y,r:p?4:2.5,fill:"var(--ink-faint)",opacity:p?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),V&&s.jsx("path",{d:V,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),T.map(c=>{const p=n===c.idx;return R(c,s.jsx("circle",{cx:c.x,cy:c.y,r:p?6:4.5,fill:p?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),n!==null&&Y[n]&&(()=>{const c=Y[n],p=c.data.modelName||c.data.paperTitle||"Unknown model",w=p.length>40?p.slice(0,39)+"…":p,v=`${K(c.data.value)} Β· ${c.data.dateLabel}`,I=Math.max(140,Math.min(320,Math.max(w.length,v.length)*6.6+24)),W=46;let A=c.x-I/2;A<o&&(A=o),A+I>a-h&&(A=a-h-I);const O=c.y-W-14>=x?c.y-W-12:c.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:A,y:O,width:I,height:W,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:O+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:w}),s.jsx("text",{x:A+12,y:O+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:v})]})})()]})};function ne(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 rr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const n=e.map(d=>{var Q;const g=ne((Q=d.metrics)==null?void 0:Q[t]),M=d.paper_published_date||"";return{eval:d,value:g,date:M}}).filter(d=>d.value!==null&&!!d.date).sort((d,g)=>d.date.localeCompare(g.date)),i=[];let a=null;for(const d of n){const g=a==null?!0:r==="↓"?d.value<a:d.value>a;g&&(a=d.value),i.push({value:d.value,date:d.date,dateLabel:d.date.slice(0,7),modelName:d.eval.model_name||"",paperTitle:d.eval.paper_title||"",paperRouteId:d.eval.paper_arxiv_id||d.eval.paper_id||null,isSota:g})}const o=e.map(d=>{var g;return{eval:d,value:ne((g=d.metrics)==null?void 0:g[t])}}).filter(d=>d.value!==null).sort((d,g)=>r==="↓"?d.value-g.value:g.value-d.value)[0],h=(o==null?void 0:o.value)??0,x=(o==null?void 0:o.eval.model_name)||(o==null?void 0:o.eval.paper_title)||"";return{points:i,sota:h,sotaModel:x}}const Ve=({targetRef:e,label:t})=>{const{toast:r}=Ze(),[n,i]=E.useState("idle"),a=E.useRef(null);E.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]);const l=E.useCallback(async()=>{const h=e.current;if(h){i("copying"),h.classList.add("is-capturing"),h.offsetHeight,await new Promise(x=>window.requestAnimationFrame(()=>x()));try{await Zt(h),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(x){i("idle"),r({title:"Copy failed",description:x instanceof Error&&x.message?x.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{h.classList.remove("is-capturing")}}},[e,t,r]),o=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(nt,{name:"copy",size:11}),o]})},hr=()=>{var W,A,de,O,ve,je,Se,ke,Ce,Ee;const{datasetSlug:e}=Ye(),[t]=Je(),r=t.get("task")||void 0,n=t.get("eval")||void 0,[i,a]=E.useState(void 0),l=E.useRef(null),o=E.useRef(!1),h=E.useRef(null),x=E.useRef(null),d=te({queryKey:["dataset",e,"with-paper"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0}),enabled:!!e,staleTime:10*60*1e3}),g=te({queryKey:["dataset-evals",(W=d.data)==null?void 0:W.id],queryFn:()=>re.getEvaluationsByDataset(d.data.id),enabled:!!((A=d.data)!=null&&A.id),staleTime:5*60*1e3}),M=te({queryKey:["dataset-tasks",(de=d.data)==null?void 0:de.id],queryFn:()=>re.getDatasetTasks(d.data.id),enabled:!!((O=d.data)!=null&&O.id),staleTime:10*60*1e3}),Q=te({queryKey:["metric-directions"],queryFn:()=>re.getMetricDirections(),staleTime:60*60*1e3}),N=E.useMemo(()=>{const u=M.data||[];if(u.length===0)return null;if(r){const f=u.find(j=>j.slug===r);if(f)return f.id}if(u.length===1)return u[0].id;const m=g.data||[];if(m.length>0){const f=new Map;for(const k of m)f.set(k.task_id,(f.get(k.task_id)||0)+1);let j=null,b=-1;for(const k of u){const D=f.get(k.id)||0;D>b&&(b=D,j=k.id)}if(j)return j}return u[0].id},[M.data,g.data,r]),X=te({queryKey:["leaderboard-metrics",(ve=d.data)==null?void 0:ve.id,N],queryFn:()=>re.getLeaderboardMetrics(d.data.id,N),enabled:!!((je=d.data)!=null&&je.id)&&!!N,staleTime:10*60*1e3}),_=E.useMemo(()=>{const u=g.data||[];return N?u.filter(m=>m.task_id===N):u},[g.data,N]),se=E.useMemo(()=>{const u=new Set;return _.forEach(m=>{m.best_metric&&u.add(m.best_metric),Object.keys(m.metrics||{}).forEach(f=>u.add(f))}),Array.from(u)},[_]),P=E.useMemo(()=>(X.data||[]).map(u=>u.metric_name),[X.data]),S=P.length?P:se,ue=E.useMemo(()=>{var j;if(_.length===0)return S[0]||"";const u=new Map;for(const b of _)b.best_metric&&(P.length&&!S.includes(b.best_metric)||u.set(b.best_metric,(u.get(b.best_metric)||0)+1));let m=null,f=0;for(const[b,k]of u)k>f&&(f=k,m=b);return m||S[0]||((j=_[0])==null?void 0:j.best_metric)||""},[_,S,P]),y=i||ue,T=(((ke=(Se=Q.data)==null?void 0:Se.directions)==null?void 0:ke[y])||"higher_is_better")==="lower_is_better"?"↓":"↑",V=E.useMemo(()=>{if(S.length===0)return y?[y]:[];if(S.length<=xe)return S;const u=[],m=y&&S.includes(y),f=m?xe-1:xe;let j=0;for(const b of S)b!==y&&(j>=f||(u.push(b),j++));if(m){const b=S.findIndex(D=>D===y),k=S.slice(0,b).filter(D=>u.includes(D)).length;u.splice(k,0,y)}return u},[S,y]),{points:U,sota:ae,sotaModel:J}=E.useMemo(()=>rr(_,y,T),[_,y,T]);E.useEffect(()=>{if(o.current||!n||!g.data||g.data.length===0)return;const u=l.current;u&&(o.current=!0,u.scrollIntoView({behavior:"smooth",block:"start"}))},[n,g.data]);const B=E.useMemo(()=>{const u=M.data||[];return N?u.find(m=>m.id===N)||u[0]||null:u[0]||null},[M.data,N]);if(d.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(fe,{className:"h-12 w-1/2 mb-6"}),s.jsx(fe,{className:"h-64 w-full"})]});if(d.error||!d.data)return s.jsx("div",{className:"page",children:s.jsx(tt,{variant:"destructive",children:s.jsx(rt,{children:"Benchmark not found."})})});const C=d.data,q=_.slice().sort((u,m)=>{var b,k;const f=ne((b=u.metrics)==null?void 0:b[y]),j=ne((k=m.metrics)==null?void 0:k[y]);return f!==null&&j!==null?T==="↓"?f-j:j-f:f!==null?-1:j!==null?1:(u.best_rank??9999)-(m.best_rank??9999)}),Z=!!C.supports_harness,R=n&&q.find(u=>u.id===n)||null,c=C.introducing_paper??void 0,p=(c==null?void 0:c.arxiv_id)||(c==null?void 0:c.id)||er(C.paper_url),w=(c==null?void 0:c.title)||C.introducing_paper_title||null,v=((Ce=c==null?void 0:c.published)==null?void 0:Ce.slice(0,4))||C.introduced_year||null,L=!!p||!!C.paper_url||!!w,I=c!=null&&c.arxiv_id||(Ee=C.paper_url)!=null&&Ee.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${p}`:`Paper ${p}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(ee,{to:"/tasks",children:"Tasks"}),B&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(ee,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:C.name})]}),s.jsx("h1",{className:"bm-title",children:C.name}),s.jsxs("div",{className:"bm-subtitle",children:[y&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:y}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"Β·"})]}),J?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:K(ae)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:J})]}):s.jsxs("span",{children:[q.length," evaluations"]})]}),C.description&&s.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:C.description}),L&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),p?s.jsxs(ee,{to:`/paper/${p}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:w?s.jsx(pe,{title:w}):I}),v&&s.jsx("span",{className:"method-source-meta",children:v})]}):C.paper_url?s.jsxs("a",{href:C.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:w?s.jsx(pe,{title:w}):C.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:w?s.jsx(pe,{title:w}):null}),v&&s.jsx("span",{className:"method-source-meta",children:v})]})]}),U.filter(u=>u.isSota).length>=2&&s.jsxs("div",{className:"bm-card",ref:h,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:C.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:y,onChange:u=>a(u.target.value),children:S.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(Ve,{targetRef:h,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(tr,{points:U,metric:y})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),"All models over time Β· highlighted dots track the running best Β· hover for the model Β· click to open the paper"]})]}),R&&(()=>{var b,k;const u=R.paper_arxiv_id||R.paper_id,m=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),f=R.best_metric&&((b=R.metrics)==null?void 0:b[R.best_metric])!==void 0?R.best_metric:y,j=(k=R.metrics)==null?void 0:k[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:[R.model_name||m||"β€”",R.harness?` Β· ${R.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[j!==void 0&&f?s.jsxs(s.Fragment,{children:[f,": ",K(j),m?" Β· ":""]}):null,m&&u?s.jsx(ee,{to:`/paper/${u}`,children:m}):m||null]})]})]})})(),s.jsxs("div",{className:"bm-card",ref:x,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:C.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:y,onChange:u=>a(u.target.value),children:S.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(Ve,{targetRef:x,label:"leaderboard"})]})]}),g.isLoading?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((u,m)=>s.jsx(fe,{className:"h-10 w-full mb-2"},m))}):q.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"}),Z&&s.jsx("th",{className:"col-harness",children:"Harness"}),V.map(u=>{const m=u===y;return s.jsx("th",{className:`col-value ${m?"is-active":""}`,"aria-sort":m?T==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>a(u),"aria-pressed":m,title:`Sort by ${u}`,children:[u,m?` ${T}`:""]})},u)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let u=null,m=0;return q.map((f,j)=>{var _e,$e;const b=ne((_e=f.metrics)==null?void 0:_e[y]);let k=null;b!==null&&((u===null||b!==u)&&(m=j+1,u=b),k=m);const D=f.paper_arxiv_id||f.paper_id,Re=f.paper_title||(f.paper_arxiv_id?`arXiv:${f.paper_arxiv_id}`:null),he=n===f.id;return s.jsxs("tr",{ref:he?l:void 0,className:he?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:k??"β€”"}),s.jsxs("td",{className:"col-model",children:[he&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),f.model_name||"β€”"]}),Z&&s.jsx("td",{className:"col-harness",children:f.harness||"β€”"}),V.map(me=>{var Fe;const Te=me===y,ie=(Fe=f.metrics)==null?void 0:Fe[me];return s.jsx("td",{className:`col-value${Te?" is-active":""}${Te&&k===1?" is-best":""}`,children:ie!=null&&ie!==""?K(ie):"β€”"},me)}),s.jsx("td",{className:"col-paper",children:D?s.jsx(ee,{to:`/paper/${D}`,children:Re||"β€”"}):Re||"β€”"}),s.jsx("td",{className:"col-year",children:(($e=f.paper_published_date)==null?void 0:$e.slice(0,4))||"β€”"})]},f.id)})})()})]})]})]})})};export{hr as default};
 
 
 
assets/{CronDashboard-BKnXsL_j.js β†’ CronDashboard-DHvNZD3_.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as p,r as l,j as e,h as w,x as Y,B as Z}from"./index-CHlNDaV5.js";import{u as G}from"./useQuery-qKfgFU9t.js";import{B as N,D as ee}from"./badge-Br1HYKP6.js";import{B as b,I as se}from"./input-DtdrXk4E.js";import{s as te,g as ae}from"./adminAuth-PI_XkM8E.js";import{R as L,C as B,a as U}from"./refresh-cw-W_Rmqupv.js";import{L as M}from"./loader-circle-DCD7IUZw.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as p,r as l,j as e,h as w,x as Y,B as Z}from"./index-C6O8_a1-.js";import{u as G}from"./useQuery-Cvv958Kx.js";import{B as N,D as ee}from"./badge-CcpUgrz3.js";import{B as b,I as se}from"./input-BMdkOI2Z.js";import{s as te,g as ae}from"./adminAuth-PI_XkM8E.js";import{R as L,C as B,a as U}from"./refresh-cw-CcA4286O.js";import{L as M}from"./loader-circle-DK8Ui2RE.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{FeedView-C80x2o94.js β†’ FeedView-DkQJBDx2.js} RENAMED
@@ -1 +1 @@
1
- import{u as S,r as y,j as e,L as m}from"./index-CHlNDaV5.js";import{P as I}from"./components-CqXuLvpo.js";import{a as T}from"./api-DKZpnF8C.js";import{t as L,a as E,d as _}from"./transform-LfD9F8SD.js";import{u as R,a as D}from"./usePapers-Dho-obLV.js";import{u as M}from"./useIntersectionObserver-j3afnyyN.js";import{P as C}from"./usePeriodFilter-F1Py9_Wb.js";import{S as n}from"./skeleton-CIY9g4PX.js";import{A as W,a as q}from"./alert-BjKDOipI.js";import{u as b}from"./useQuery-qKfgFU9t.js";import"./LatexTitle-B3XSDdDB.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DYjz2HCv.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-C6O8_a1-.js";import{P as I}from"./components-CMH89RDy.js";import{a as T}from"./api-DLAvdHPg.js";import{t as L,a as E,d as _}from"./transform-D_Izdf89.js";import{u as R,a as D}from"./usePapers-CwnyeI7c.js";import{u as M}from"./useIntersectionObserver-CkOYzKe_.js";import{P as C}from"./usePeriodFilter-BrbWqy5G.js";import{S as n}from"./skeleton-D8Wtx_Nu.js";import{A as W,a as q}from"./alert-MNWNJkBv.js";import{u as b}from"./useQuery-Cvv958Kx.js";import"./LatexTitle-CcMIi9G1.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-Dd12EyZd.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-B3XSDdDB.js β†’ LatexTitle-CcMIi9G1.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{j as Er,r as Qt}from"./index-CHlNDaV5.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-C6O8_a1-.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/{MarkdownText-C53MS9a3.js β†’ MarkdownText-p29EEUf7.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/MethodDetailView-B6lC_23G.js DELETED
@@ -1 +0,0 @@
1
- import{j as e,E as L,r as p,L as B,O as D}from"./index-CHlNDaV5.js";import{u as F}from"./useQuery-qKfgFU9t.js";import{u as C}from"./useInfiniteQuery-DYjz2HCv.js";import{M as P,P as T}from"./components-CqXuLvpo.js";import{M as b}from"./MarkdownText-C53MS9a3.js";import{a as y}from"./api-DKZpnF8C.js";import{a as O}from"./transform-LfD9F8SD.js";import{u as R}from"./useIntersectionObserver-j3afnyyN.js";import{S as j}from"./skeleton-CIY9g4PX.js";import{A as I,a as W}from"./alert-BjKDOipI.js";import"./LatexTitle-B3XSDdDB.js";import"./adminAuth-PI_XkM8E.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},l=({x:i,y:s,w:n,h:r,fill:c,stroke:d,label:m,fontSize:h=10,multiline:f})=>e.jsxs("g",{children:[e.jsx("rect",{x:i,y:s,width:n,height:r,rx:"3",ry:"3",fill:c,stroke:d,strokeWidth:"1"}),f?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:i+n/2,y:s+r/2-2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[0]}),e.jsx("text",{x:i+n/2,y:s+r/2+h-1,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[1]})]}):e.jsx("text",{x:i+n/2,y:s+r/2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:m})]}),$=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"14",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Output Probabilities"}),e.jsx("path",{d:"M180 22 L180 32",stroke:t.ink,strokeWidth:"1.2"}),e.jsx(l,{x:150,y:32,w:60,h:20,fill:t.green,stroke:t.greenS,label:"Softmax"}),e.jsx("path",{d:"M180 52 L180 62",stroke:t.ink,strokeWidth:"1.2"}),e.jsx(l,{x:150,y:62,w:60,h:20,fill:t.purple,stroke:t.purpleS,label:"Linear"}),e.jsx("path",{d:"M180 82 L180 92",stroke:t.ink,strokeWidth:"1.2"}),e.jsx("rect",{x:"50",y:"170",width:"120",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeWidth:"1",strokeDasharray:"3 2"}),e.jsx("text",{x:"20",y:"232",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,children:"NΓ—"}),e.jsx(l,{x:70,y:180,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:70,y:200,w:80,h:28,fill:t.blue,stroke:t.blueS,multiline:["Feed","Forward"]}),e.jsx(l,{x:70,y:236,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:70,y:256,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Multi-Head","Attention"]}),e.jsx("rect",{x:"190",y:"92",width:"120",height:"200",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeWidth:"1",strokeDasharray:"3 2"}),e.jsx("text",{x:"320",y:"195",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,children:"NΓ—"}),e.jsx(l,{x:210,y:102,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:122,w:80,h:28,fill:t.blue,stroke:t.blueS,multiline:["Feed","Forward"]}),e.jsx(l,{x:210,y:158,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:178,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Multi-Head","Attention"]}),e.jsx(l,{x:210,y:216,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:236,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Masked MH","Attention"]}),e.jsx("path",{d:"M150 220 L195 192",stroke:t.ink,strokeWidth:"1.2",fill:"none"}),e.jsx("path",{d:"M150 220 L195 200",stroke:t.ink,strokeWidth:"1.2",fill:"none"}),e.jsx(l,{x:70,y:340,w:80,h:26,fill:t.pink,stroke:t.pinkS,multiline:["Input","Embedding"]}),e.jsx(l,{x:210,y:340,w:80,h:26,fill:t.pink,stroke:t.pinkS,multiline:["Output","Embedding"]}),e.jsx("text",{x:"110",y:"395",fontSize:"11",fontFamily:"var(--serif)",fill:t.ink,textAnchor:"middle",children:"Inputs"}),e.jsx("text",{x:"250",y:"395",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Outputs (shifted right)"})]}),N=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(l,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(l,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(l,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(l,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dβ‚–",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(l,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(l,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(l,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(l,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊀"})," / √d) V"]})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const s=30+i*75,n=60-i*8,r=240-i*30;return e.jsx("g",{children:e.jsx("rect",{x:s,y:(420-r)/2,width:n,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][i],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][i],strokeWidth:"1"})},i)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),A=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const n=60+i*80,r=100-i*12,c=50-i*6;return e.jsx("rect",{x:50,y:n,width:r,height:c,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${i}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(i=>{const n=60+i*80,r=100-i*12,c=50-i*6;return e.jsx("rect",{x:210,y:n,width:r,height:c,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${i}`)}),[0,1,2,3].map(i=>{const s=60+i*80+(50-i*6)/2,n=50+(100-i*12);return e.jsx("path",{d:`M${n} ${s} L210 ${s}`,stroke:t.faint,strokeDasharray:"4 3"},`s${i}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),z=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(i=>[0,1,2].map(s=>e.jsx("rect",{x:20+s*40,y:40+i*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][i*3+s],stroke:t.faint},`${i}-${s}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(l,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(l,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(l,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(l,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder Β· LΓ—"})]}),E=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Sparse routing of tokens to k of N experts"}),e.jsx(l,{x:140,y:40,w:80,h:28,fill:t.pink,stroke:t.pinkS,label:"Token x",fontSize:11}),e.jsx(l,{x:120,y:90,w:120,h:30,fill:t.yellow,stroke:t.yellowS,label:"Router (softmax)",fontSize:11}),[0,1,2,3,4].map(i=>{const s=50+i*65,n=i===1||i===3;return e.jsxs("g",{children:[e.jsx("rect",{x:s,y:185,width:"50",height:"60",rx:"3",fill:n?t.green:"#F2EFE8",stroke:n?t.greenS:t.faint,strokeWidth:"1"}),e.jsx("text",{x:s+25,y:210,fontSize:"10",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"FFN"}),e.jsxs("text",{x:s+25,y:228,fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:["E",i+1]})]},i)}),e.jsx(l,{x:140,y:325,w:80,h:28,fill:t.purple,stroke:t.purpleS,label:"Output y",fontSize:11})]}),M=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise β†’ sample"}),[0,1,2,3,4,5].map(i=>{const s=25+i*56,n=(5-i)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:s,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-n*.1} 0.04 250)`,stroke:t.faint}),n<.4&&e.jsx("circle",{cx:s+25,cy:115,r:12-n*16,fill:t.orange,opacity:1-n*1.5})]},i)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[β€–Ξ΅ βˆ’ Ξ΅_ΞΈ(x_t, t)β€–Β²]"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),H=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),K=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Three-stage post-training pipeline"}),e.jsx(l,{x:40,y:45,w:280,h:36,fill:t.green,stroke:t.greenS,label:"Supervised fine-tuning on demonstrations",fontSize:11}),e.jsx(l,{x:40,y:105,w:120,h:36,fill:t.blue,stroke:t.blueS,label:"Pairwise preferences",fontSize:10}),e.jsx(l,{x:200,y:105,w:120,h:36,fill:t.yellow,stroke:t.yellowS,label:"Reward model rΞΈ",fontSize:11}),e.jsx(l,{x:40,y:165,w:100,h:40,fill:t.pink,stroke:t.pinkS,label:"Policy πφ (LLM)",fontSize:11}),e.jsx(l,{x:180,y:165,w:70,h:40,fill:t.orange,stroke:t.orangeS,label:"Sample y",fontSize:10}),e.jsx(l,{x:250,y:220,w:70,h:40,fill:t.yellow,stroke:t.yellowS,label:"rΞΈ(y)",fontSize:11})]}),Q=[["my-skill/",""],["β”œβ”€β”€ SKILL.md","# Required: metadata + instructions"],["β”œβ”€β”€ scripts/","# Optional: executable code"],["β”œβ”€β”€ references/","# Optional: documentation"],["β”œβ”€β”€ assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],V=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),Q.map(([i,s],n)=>{const r=92+n*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:i}),s?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:s}):null]},i)})]}),U={transformer:$,attention:N,"self-attention":N,cnn:G,"u-net":A,unet:A,vit:z,"vision-transformer":z,"mixture-of-experts":E,moe:E,diffusion:M,ddpm:M,gan:q,vae:H,rlhf:K,"agent-skills":V},Y=({method:i})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:i.name||"method"}),e.jsx(l,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(l,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:i.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(l,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),J=({method:i})=>{const s=(i.slug||"").toLowerCase(),n=U[s];return n?e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(n,{})}):i.image_url?e.jsx("div",{className:"method-figure-svg method-figure-svg--image",children:e.jsx("img",{className:"method-figure-img",src:i.image_url,alt:`${i.name} schematic`})}):e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(Y,{method:i})})},X=[["trending","trending"],["new","newest"],["cited","most cited"]],_={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},ce=()=>{var k,S,w,v;const{methodSlug:i}=L(),[s,n]=p.useState("trending"),r=F({queryKey:["method",i],queryFn:()=>y.getMethod(i),enabled:!!i,staleTime:10*60*1e3}),c=s==="trending"?"trending":s==="cited"?"citation_count":"date_published",d=C({queryKey:["method-papers-infinite",i,c],queryFn:({pageParam:a=1})=>y.getMethodPapers(i,{page:a,page_size:20,order_by:c,order_dir:"desc",include_resources:!0}),getNextPageParam:a=>a.next_page,initialPageParam:1,enabled:!!i,staleTime:5*60*1e3,placeholderData:D}),m=F({queryKey:["related-methods",(k=r.data)==null?void 0:k.slug,(S=r.data)==null?void 0:S.area_id,(w=r.data)==null?void 0:w.id],queryFn:async()=>{const a=_[r.data.slug];return a?Promise.all(a.map(g=>y.getMethod(g))):(await y.getMethods({area_id:r.data.area_id,exclude_id:r.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!r.data&&(!!_[r.data.slug]||!!r.data.area_id),staleTime:10*60*1e3}),h=p.useMemo(()=>{var x;return(((x=d.data)==null?void 0:x.pages.flatMap(g=>g.results))||[]).map(O)},[d.data]),{targetRef:f,isIntersecting:u}=R({rootMargin:"200px"});if(p.useEffect(()=>{u&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[u,d.hasNextPage,d.isFetchingNextPage]),r.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(j,{className:"h-12 w-1/2 mb-4"}),e.jsx(j,{className:"h-64 w-full"})]});if(r.error||!r.data)return e.jsx("div",{className:"page",children:e.jsx(I,{variant:"destructive",children:e.jsx(W,{children:"Method not found."})})});const o=r.data;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(B,{to:"/methods",children:"Methods"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:o.name})]}),e.jsxs("div",{className:"tag-hero method-hero-grid",children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title",style:{fontFamily:"var(--mono)",fontSize:48,letterSpacing:"-0.01em"},children:o.name}),o.full_name&&o.full_name!==o.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:o.full_name}),o.description&&e.jsx(b,{className:"method-description",text:o.description}),o.source_url&&o.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:o.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:o.source_title}),o.introduced_year&&e.jsx("span",{className:"method-source-meta",children:o.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers using"}),e.jsx("span",{className:"value",children:(o.paper_count??0).toLocaleString()})]}),o.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:o.introduced_year})]})]})]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(J,{method:o}),e.jsxs("figcaption",{children:["Figure Β· schematic of ",o.name,o.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(b,{className:"method-image-credit",text:o.image_credit})]})]})]})]}),(((v=m.data)==null?void 0:v.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(a=>e.jsx(P,{method:{slug:a.slug,name:a.name}},a.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:X.map(([a,x])=>e.jsx("button",{className:`sort-btn ${s===a?"active":""}`,onClick:()=>n(a),children:x},a))}),e.jsxs("div",{className:"results-count",children:[h.length," papers using ",o.name]})]}),d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,x)=>e.jsx(j,{className:"h-40 w-full"},x))}):h.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:h.map((a,x)=>e.jsx(T,{paper:a,rank:x+1},a.id))}),e.jsx("div",{ref:f,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ce as default};
 
 
assets/MethodDetailView-Bqs-DuBu.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as e,E as _,r as p,L,O as D}from"./index-C6O8_a1-.js";import{u as F}from"./useQuery-Cvv958Kx.js";import{u as B}from"./useInfiniteQuery-Dd12EyZd.js";import{M as C,P}from"./components-CMH89RDy.js";import{M as b}from"./MarkdownText-p29EEUf7.js";import{a as y}from"./api-DLAvdHPg.js";import{a as T}from"./transform-D_Izdf89.js";import{u as I}from"./useIntersectionObserver-CkOYzKe_.js";import{S as j}from"./skeleton-D8Wtx_Nu.js";import{A as O,a as R}from"./alert-MNWNJkBv.js";import"./LatexTitle-CcMIi9G1.js";import"./adminAuth-PI_XkM8E.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},l=({x:i,y:r,w:n,h:s,fill:c,stroke:d,label:m,fontSize:h=10,multiline:f})=>e.jsxs("g",{children:[e.jsx("rect",{x:i,y:r,width:n,height:s,rx:"3",ry:"3",fill:c,stroke:d,strokeWidth:"1"}),f?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:i+n/2,y:r+s/2-2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[0]}),e.jsx("text",{x:i+n/2,y:r+s/2+h-1,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[1]})]}):e.jsx("text",{x:i+n/2,y:r+s/2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:m})]}),W=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"14",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Output Probabilities"}),e.jsx("path",{d:"M180 22 L180 32",stroke:t.ink,strokeWidth:"1.2"}),e.jsx(l,{x:150,y:32,w:60,h:20,fill:t.green,stroke:t.greenS,label:"Softmax"}),e.jsx("path",{d:"M180 52 L180 62",stroke:t.ink,strokeWidth:"1.2"}),e.jsx(l,{x:150,y:62,w:60,h:20,fill:t.purple,stroke:t.purpleS,label:"Linear"}),e.jsx("path",{d:"M180 82 L180 92",stroke:t.ink,strokeWidth:"1.2"}),e.jsx("rect",{x:"50",y:"170",width:"120",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeWidth:"1",strokeDasharray:"3 2"}),e.jsx("text",{x:"20",y:"232",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,children:"NΓ—"}),e.jsx(l,{x:70,y:180,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:70,y:200,w:80,h:28,fill:t.blue,stroke:t.blueS,multiline:["Feed","Forward"]}),e.jsx(l,{x:70,y:236,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:70,y:256,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Multi-Head","Attention"]}),e.jsx("rect",{x:"190",y:"92",width:"120",height:"200",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeWidth:"1",strokeDasharray:"3 2"}),e.jsx("text",{x:"320",y:"195",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,children:"NΓ—"}),e.jsx(l,{x:210,y:102,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:122,w:80,h:28,fill:t.blue,stroke:t.blueS,multiline:["Feed","Forward"]}),e.jsx(l,{x:210,y:158,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:178,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Multi-Head","Attention"]}),e.jsx(l,{x:210,y:216,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:236,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Masked MH","Attention"]}),e.jsx("path",{d:"M150 220 L195 192",stroke:t.ink,strokeWidth:"1.2",fill:"none"}),e.jsx("path",{d:"M150 220 L195 200",stroke:t.ink,strokeWidth:"1.2",fill:"none"}),e.jsx(l,{x:70,y:340,w:80,h:26,fill:t.pink,stroke:t.pinkS,multiline:["Input","Embedding"]}),e.jsx(l,{x:210,y:340,w:80,h:26,fill:t.pink,stroke:t.pinkS,multiline:["Output","Embedding"]}),e.jsx("text",{x:"110",y:"395",fontSize:"11",fontFamily:"var(--serif)",fill:t.ink,textAnchor:"middle",children:"Inputs"}),e.jsx("text",{x:"250",y:"395",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Outputs (shifted right)"})]}),N=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(l,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(l,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(l,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(l,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dβ‚–",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(l,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(l,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(l,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(l,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊀"})," / √d) V"]})]}),$=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const r=30+i*75,n=60-i*8,s=240-i*30;return e.jsx("g",{children:e.jsx("rect",{x:r,y:(420-s)/2,width:n,height:s,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][i],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][i],strokeWidth:"1"})},i)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),A=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const n=60+i*80,s=100-i*12,c=50-i*6;return e.jsx("rect",{x:50,y:n,width:s,height:c,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${i}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(i=>{const n=60+i*80,s=100-i*12,c=50-i*6;return e.jsx("rect",{x:210,y:n,width:s,height:c,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${i}`)}),[0,1,2,3].map(i=>{const r=60+i*80+(50-i*6)/2,n=50+(100-i*12);return e.jsx("path",{d:`M${n} ${r} L210 ${r}`,stroke:t.faint,strokeDasharray:"4 3"},`s${i}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),z=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(i=>[0,1,2].map(r=>e.jsx("rect",{x:20+r*40,y:40+i*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][i*3+r],stroke:t.faint},`${i}-${r}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(l,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(l,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(l,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(l,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder Β· LΓ—"})]}),E=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise β†’ sample"}),[0,1,2,3,4,5].map(i=>{const r=25+i*56,n=(5-i)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:r,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-n*.1} 0.04 250)`,stroke:t.faint}),n<.4&&e.jsx("circle",{cx:r+25,cy:115,r:12-n*16,fill:t.orange,opacity:1-n*1.5})]},i)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[β€–Ξ΅ βˆ’ Ξ΅_ΞΈ(x_t, t)β€–Β²]"})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),H=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Three-stage post-training pipeline"}),e.jsx(l,{x:40,y:45,w:280,h:36,fill:t.green,stroke:t.greenS,label:"Supervised fine-tuning on demonstrations",fontSize:11}),e.jsx(l,{x:40,y:105,w:120,h:36,fill:t.blue,stroke:t.blueS,label:"Pairwise preferences",fontSize:10}),e.jsx(l,{x:200,y:105,w:120,h:36,fill:t.yellow,stroke:t.yellowS,label:"Reward model rΞΈ",fontSize:11}),e.jsx(l,{x:40,y:165,w:100,h:40,fill:t.pink,stroke:t.pinkS,label:"Policy πφ (LLM)",fontSize:11}),e.jsx(l,{x:180,y:165,w:70,h:40,fill:t.orange,stroke:t.orangeS,label:"Sample y",fontSize:10}),e.jsx(l,{x:250,y:220,w:70,h:40,fill:t.yellow,stroke:t.yellowS,label:"rΞΈ(y)",fontSize:11})]}),K=[["my-skill/",""],["β”œβ”€β”€ SKILL.md","# Required: metadata + instructions"],["β”œβ”€β”€ scripts/","# Optional: executable code"],["β”œβ”€β”€ references/","# Optional: documentation"],["β”œβ”€β”€ assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],Q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),K.map(([i,r],n)=>{const s=92+n*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:s,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:i}),r?e.jsx("text",{x:"138",y:s,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},i)})]}),V={transformer:W,attention:N,"self-attention":N,cnn:$,"u-net":A,unet:A,vit:z,"vision-transformer":z,diffusion:E,ddpm:E,gan:G,vae:q,rlhf:H,"agent-skills":Q},U=({method:i})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:i.name||"method"}),e.jsx(l,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(l,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:i.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(l,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),Y=({method:i})=>{const r=(i.slug||"").toLowerCase(),n=V[r];return n?e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(n,{})}):i.image_url?e.jsx("div",{className:"method-figure-svg method-figure-svg--image",children:e.jsx("img",{className:"method-figure-img",src:i.image_url,alt:`${i.name} schematic`})}):e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(U,{method:i})})},J=[["trending","trending"],["new","newest"],["cited","most cited"]],M={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},xe=()=>{var k,S,w,v;const{methodSlug:i}=_(),[r,n]=p.useState("trending"),s=F({queryKey:["method",i],queryFn:()=>y.getMethod(i),enabled:!!i,staleTime:10*60*1e3}),c=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",d=B({queryKey:["method-papers-infinite",i,c],queryFn:({pageParam:a=1})=>y.getMethodPapers(i,{page:a,page_size:20,order_by:c,order_dir:"desc",include_resources:!0}),getNextPageParam:a=>a.next_page,initialPageParam:1,enabled:!!i,staleTime:5*60*1e3,placeholderData:D}),m=F({queryKey:["related-methods",(k=s.data)==null?void 0:k.slug,(S=s.data)==null?void 0:S.area_id,(w=s.data)==null?void 0:w.id],queryFn:async()=>{const a=M[s.data.slug];return a?Promise.all(a.map(g=>y.getMethod(g))):(await y.getMethods({area_id:s.data.area_id,exclude_id:s.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!s.data&&(!!M[s.data.slug]||!!s.data.area_id),staleTime:10*60*1e3}),h=p.useMemo(()=>{var x;return(((x=d.data)==null?void 0:x.pages.flatMap(g=>g.results))||[]).map(T)},[d.data]),{targetRef:f,isIntersecting:u}=I({rootMargin:"200px"});if(p.useEffect(()=>{u&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[u,d.hasNextPage,d.isFetchingNextPage]),s.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(j,{className:"h-12 w-1/2 mb-4"}),e.jsx(j,{className:"h-64 w-full"})]});if(s.error||!s.data)return e.jsx("div",{className:"page",children:e.jsx(O,{variant:"destructive",children:e.jsx(R,{children:"Method not found."})})});const o=s.data;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(L,{to:"/methods",children:"Methods"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:o.name})]}),e.jsxs("div",{className:"tag-hero method-hero-grid",children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title",style:{fontFamily:"var(--mono)",fontSize:48,letterSpacing:"-0.01em"},children:o.name}),o.full_name&&o.full_name!==o.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:o.full_name}),o.description&&e.jsx(b,{className:"method-description",text:o.description}),o.source_url&&o.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:o.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:o.source_title}),o.introduced_year&&e.jsx("span",{className:"method-source-meta",children:o.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers using"}),e.jsx("span",{className:"value",children:(o.paper_count??0).toLocaleString()})]}),o.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:o.introduced_year})]})]})]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(Y,{method:o}),e.jsxs("figcaption",{children:["Figure Β· schematic of ",o.name,o.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(b,{className:"method-image-credit",text:o.image_credit})]})]})]})]}),(((v=m.data)==null?void 0:v.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(a=>e.jsx(C,{method:{slug:a.slug,name:a.name}},a.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:J.map(([a,x])=>e.jsx("button",{className:`sort-btn ${r===a?"active":""}`,onClick:()=>n(a),children:x},a))}),e.jsxs("div",{className:"results-count",children:[h.length," papers using ",o.name]})]}),d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,x)=>e.jsx(j,{className:"h-40 w-full"},x))}):h.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:h.map((a,x)=>e.jsx(P,{paper:a,rank:x+1},a.id))}),e.jsx("div",{ref:f,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{xe as default};
assets/{MethodsIndexView-JzCDiz_K.js β†’ MethodsIndexView-CUF6j1AK.js} RENAMED
@@ -1 +1 @@
1
- import{r as u,j as e,L as x}from"./index-CHlNDaV5.js";import{u as c}from"./useQuery-qKfgFU9t.js";import{a as m}from"./api-DKZpnF8C.js";import{S as h}from"./skeleton-CIY9g4PX.js";import{A as g,a as j}from"./alert-BjKDOipI.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-C6O8_a1-.js";import{u as c}from"./useQuery-Cvv958Kx.js";import{a as m}from"./api-DLAvdHPg.js";import{S as h}from"./skeleton-D8Wtx_Nu.js";import{A as g,a as j}from"./alert-MNWNJkBv.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-Bb5d_WMH.js β†’ NotFound-C1sONCOd.js} RENAMED
@@ -1 +1 @@
1
- import{a7 as o,r as a,j as t,L as s}from"./index-CHlNDaV5.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{a7 as o,r as a,j as t,L as s}from"./index-C6O8_a1-.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-BBf2E08f.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/PaperDetailView-ByZIPZKo.js DELETED
@@ -1,51 +0,0 @@
1
- import{c as _e,r as i,j as e,P as Te,a as X,b as vt,d as Ne,e as ee,f as qr,g as yt,C as me,h as J,i as ye,k as ne,l as gs,m as xs,R as vs,n as ys,F as bs,D as js,o as Br,X as bt,p as ke,q as we,s as Ur,A as _s,t as Ns,v as Kr,w as Hr,H as zr,x as rt,y as jt,z as ks,B as ws,E as Qr,G as Vr,L as Re,I as Wr,J as Gr,K as Xr,M as Jr,N as Yr}from"./index-CHlNDaV5.js";import{u as ie}from"./useQuery-qKfgFU9t.js";import{I as re,T as Zr,M as ea}from"./components-CqXuLvpo.js";import{L as ns,a as ta}from"./LatexTitle-B3XSDdDB.js";import{g as sa,s as $e,u as ra,b as Cs,c as aa,d as na,e as ia,f as oa,h as la,i as is,j as ca,k as da,l as ua,m as ma,a as tt,n as pa}from"./api-DKZpnF8C.js";import{e as fa}from"./transform-LfD9F8SD.js";import{b as ha}from"./usePapers-Dho-obLV.js";import{S as qe}from"./skeleton-CIY9g4PX.js";import{A as ga,a as xa}from"./alert-BjKDOipI.js";import{I as le,B as V}from"./input-DtdrXk4E.js";import{u as Ce}from"./useMutation-DBjQd2jo.js";import{L as oe}from"./loader-circle-DCD7IUZw.js";import{B as Es,D as va}from"./badge-Br1HYKP6.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DYjz2HCv.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 ya=_e("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
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 os=_e("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"}]]);/**
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 ls=_e("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"}]]);/**
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 _t=_e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 Be=_e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 Ss=_e("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"}]]);/**
32
- * @license lucide-react v0.462.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const Nt=_e("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 ba(t,s=!0){return ie({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return sa(t)},enabled:s&&!!t,staleTime:5*60*1e3})}const ct=async(t,s)=>{try{const r=await fetch(`https://huggingface.co/api/arxiv/${s}/repos`);if(!r.ok)return console.warn(`Failed to fetch repos for arXiv:${s}, status: ${r.status}`),{count:0,isLimited:!1};const n=((await r.json())[t]||[]).length;return console.log(`${t} count for arXiv:${s}: ${n}`),n<100?{count:n,isLimited:!1}:{count:n,isLimited:!0}}catch(r){return console.warn(`Failed to fetch ${t} count for arXiv:${s}:`,r),{count:0,isLimited:!1}}},ja=async t=>{const[s,r,c]=await Promise.all([ct("models",t),ct("datasets",t),ct("spaces",t)]);return{models:s.count,datasets:r.count,spaces:c.count,isLimited:s.isLimited||r.isLimited||c.isLimited}},_a=t=>ie({queryKey:["huggingface-repos",t],queryFn:()=>ja(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function Na(){const[t,s]=i.useState(!1),[r,c]=i.useState(!1),[n,o]=i.useState(!1),[l,a]=i.useState(!1),[f,d]=i.useState(!1),[j,x]=i.useState(!1);return{isEditingTasks:t,openTasksDialog:()=>s(!0),closeTasksDialog:()=>s(!1),setIsEditingTasks:s,isEditingMethods:r,openMethodsDialog:()=>c(!0),closeMethodsDialog:()=>c(!1),setIsEditingMethods:c,isEditingRepositories:n,openRepositoriesDialog:()=>o(!0),closeRepositoriesDialog:()=>o(!1),setIsEditingRepositories:o,isEditingProjectPages:l,openProjectPagesDialog:()=>a(!0),closeProjectPagesDialog:()=>a(!1),setIsEditingProjectPages:a,isEditingEvaluations:f,openEvaluationsDialog:()=>d(!0),closeEvaluationsDialog:()=>d(!1),setIsEditingEvaluations:d,isEditingSourceUrl:j,openSourceUrlDialog:()=>x(!0),closeSourceUrlDialog:()=>x(!1),setIsEditingSourceUrl:x}}function ka(t){const s=i.useRef({value:t,previous:t});return i.useMemo(()=>(s.current.value!==t&&(s.current.previous=s.current.value,s.current.value=t),s.current.previous),[t])}var at="Checkbox",[wa]=yt(at),[Ca,kt]=wa(at);function Ea(t){const{__scopeCheckbox:s,checked:r,children:c,defaultChecked:n,disabled:o,form:l,name:a,onCheckedChange:f,required:d,value:j="on",internal_do_not_use_render:x}=t,[P,_]=vt({prop:r,defaultProp:n??!1,onChange:f,caller:at}),[T,I]=i.useState(null),[L,C]=i.useState(null),R=i.useRef(!1),O=T?!!l||!!T.closest("form"):!0,D={checked:P,disabled:o,setChecked:_,control:T,setControl:I,name:a,form:l,value:j,hasConsumerStoppedPropagationRef:R,required:d,defaultChecked:de(n)?!1:n,isFormControl:O,bubbleInput:L,setBubbleInput:C};return e.jsx(Ca,{scope:s,...D,children:Sa(x)?x(D):c})}var Ps="CheckboxTrigger",Rs=i.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:r,...c},n)=>{const{control:o,value:l,disabled:a,checked:f,required:d,setControl:j,setChecked:x,hasConsumerStoppedPropagationRef:P,isFormControl:_,bubbleInput:T}=kt(Ps,t),I=Ne(n,j),L=i.useRef(f);return i.useEffect(()=>{const C=o==null?void 0:o.form;if(C){const R=()=>x(L.current);return C.addEventListener("reset",R),()=>C.removeEventListener("reset",R)}},[o,x]),e.jsx(X.button,{type:"button",role:"checkbox","aria-checked":de(f)?"mixed":f,"aria-required":d,"data-state":Ts(f),"data-disabled":a?"":void 0,disabled:a,value:l,...c,ref:I,onKeyDown:ee(s,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:ee(r,C=>{x(R=>de(R)?!0:!R),T&&_&&(P.current=C.isPropagationStopped(),P.current||C.stopPropagation())})})});Rs.displayName=Ps;var wt=i.forwardRef((t,s)=>{const{__scopeCheckbox:r,name:c,checked:n,defaultChecked:o,required:l,disabled:a,value:f,onCheckedChange:d,form:j,...x}=t;return e.jsx(Ea,{__scopeCheckbox:r,checked:n,defaultChecked:o,disabled:a,required:l,onCheckedChange:d,name:c,form:j,value:f,internal_do_not_use_render:({isFormControl:P})=>e.jsxs(e.Fragment,{children:[e.jsx(Rs,{...x,ref:s,__scopeCheckbox:r}),P&&e.jsx(Fs,{__scopeCheckbox:r})]})})});wt.displayName=at;var As="CheckboxIndicator",Is=i.forwardRef((t,s)=>{const{__scopeCheckbox:r,forceMount:c,...n}=t,o=kt(As,r);return e.jsx(Te,{present:c||de(o.checked)||o.checked===!0,children:e.jsx(X.span,{"data-state":Ts(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...t.style}})})});Is.displayName=As;var Ds="CheckboxBubbleInput",Fs=i.forwardRef(({__scopeCheckbox:t,...s},r)=>{const{control:c,hasConsumerStoppedPropagationRef:n,checked:o,defaultChecked:l,required:a,disabled:f,name:d,value:j,form:x,bubbleInput:P,setBubbleInput:_}=kt(Ds,t),T=Ne(r,_),I=ka(o),L=qr(c);i.useEffect(()=>{const R=P;if(!R)return;const O=window.HTMLInputElement.prototype,$=Object.getOwnPropertyDescriptor(O,"checked").set,m=!n.current;if(I!==o&&$){const N=new Event("click",{bubbles:m});R.indeterminate=de(o),$.call(R,de(o)?!1:o),R.dispatchEvent(N)}},[P,I,o,n]);const C=i.useRef(de(o)?!1:o);return e.jsx(X.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??C.current,required:a,disabled:f,name:d,value:j,form:x,...s,tabIndex:-1,ref:T,style:{...s.style,...L,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Fs.displayName=Ds;function Sa(t){return typeof t=="function"}function de(t){return t==="indeterminate"}function Ts(t){return de(t)?"indeterminate":t?"checked":"unchecked"}const Ct=i.forwardRef(({className:t,style:s,...r},c)=>e.jsx(wt,{ref:c,className:J("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",t),style:{border:"1px solid #000",...s},...r,children:e.jsx(Is,{className:J("flex items-center justify-center text-current"),children:e.jsx(me,{className:"h-4 w-4"})})}));Ct.displayName=wt.displayName;function Pa(t){const s=Ra(t),r=i.forwardRef((c,n)=>{const{children:o,...l}=c,a=i.Children.toArray(o),f=a.find(Ia);if(f){const d=f.props.children,j=a.map(x=>x===f?i.Children.count(d)>1?i.Children.only(null):i.isValidElement(d)?d.props.children:null:x);return e.jsx(s,{...l,ref:n,children:i.isValidElement(d)?i.cloneElement(d,void 0,j):null})}return e.jsx(s,{...l,ref:n,children:o})});return r.displayName=`${t}.Slot`,r}function Ra(t){const s=i.forwardRef((r,c)=>{const{children:n,...o}=r;if(i.isValidElement(n)){const l=Fa(n),a=Da(o,n.props);return n.type!==i.Fragment&&(a.ref=c?ye(c,l):l),i.cloneElement(n,a)}return i.Children.count(n)>1?i.Children.only(null):null});return s.displayName=`${t}.SlotClone`,s}var Aa=Symbol("radix.slottable");function Ia(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Aa}function Da(t,s){const r={...s};for(const c in s){const n=t[c],o=s[c];/^on[A-Z]/.test(c)?n&&o?r[c]=(...a)=>{const f=o(...a);return n(...a),f}:n&&(r[c]=n):c==="style"?r[c]={...n,...o}:c==="className"&&(r[c]=[n,o].filter(Boolean).join(" "))}return{...t,...r}}function Fa(t){var c,n;let s=(c=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:c.get,r=s&&"isReactWarning"in s&&s.isReactWarning;return r?t.ref:(s=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=s&&"isReactWarning"in s&&s.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var nt="Dialog",[$s]=yt(nt),[Ta,ae]=$s(nt),Ms=t=>{const{__scopeDialog:s,children:r,open:c,defaultOpen:n,onOpenChange:o,modal:l=!0}=t,a=i.useRef(null),f=i.useRef(null),[d,j]=vt({prop:c,defaultProp:n??!1,onChange:o,caller:nt});return e.jsx(Ta,{scope:s,triggerRef:a,contentRef:f,contentId:ne(),titleId:ne(),descriptionId:ne(),open:d,onOpenChange:j,onOpenToggle:i.useCallback(()=>j(x=>!x),[j]),modal:l,children:r})};Ms.displayName=nt;var Ls="DialogTrigger",$a=i.forwardRef((t,s)=>{const{__scopeDialog:r,...c}=t,n=ae(Ls,r),o=Ne(s,n.triggerRef);return e.jsx(X.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Pt(n.open),...c,ref:o,onClick:ee(t.onClick,n.onOpenToggle)})});$a.displayName=Ls;var Et="DialogPortal",[Ma,Os]=$s(Et,{forceMount:void 0}),qs=t=>{const{__scopeDialog:s,forceMount:r,children:c,container:n}=t,o=ae(Et,s);return e.jsx(Ma,{scope:s,forceMount:r,children:i.Children.map(c,l=>e.jsx(Te,{present:r||o.open,children:e.jsx(gs,{asChild:!0,container:n,children:l})}))})};qs.displayName=Et;var st="DialogOverlay",Bs=i.forwardRef((t,s)=>{const r=Os(st,t.__scopeDialog),{forceMount:c=r.forceMount,...n}=t,o=ae(st,t.__scopeDialog);return o.modal?e.jsx(Te,{present:c||o.open,children:e.jsx(Oa,{...n,ref:s})}):null});Bs.displayName=st;var La=Pa("DialogOverlay.RemoveScroll"),Oa=i.forwardRef((t,s)=>{const{__scopeDialog:r,...c}=t,n=ae(st,r);return e.jsx(vs,{as:La,allowPinchZoom:!0,shards:[n.contentRef],children:e.jsx(X.div,{"data-state":Pt(n.open),...c,ref:s,style:{pointerEvents:"auto",...c.style}})})}),be="DialogContent",Us=i.forwardRef((t,s)=>{const r=Os(be,t.__scopeDialog),{forceMount:c=r.forceMount,...n}=t,o=ae(be,t.__scopeDialog);return e.jsx(Te,{present:c||o.open,children:o.modal?e.jsx(qa,{...n,ref:s}):e.jsx(Ba,{...n,ref:s})})});Us.displayName=be;var qa=i.forwardRef((t,s)=>{const r=ae(be,t.__scopeDialog),c=i.useRef(null),n=Ne(s,r.contentRef,c);return i.useEffect(()=>{const o=c.current;if(o)return xs(o)},[]),e.jsx(Ks,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(t.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(t.onPointerDownOutside,o=>{const l=o.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&o.preventDefault()}),onFocusOutside:ee(t.onFocusOutside,o=>o.preventDefault())})}),Ba=i.forwardRef((t,s)=>{const r=ae(be,t.__scopeDialog),c=i.useRef(!1),n=i.useRef(!1);return e.jsx(Ks,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,a;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(c.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),c.current=!1,n.current=!1},onInteractOutside:o=>{var f,d;(f=t.onInteractOutside)==null||f.call(t,o),o.defaultPrevented||(c.current=!0,o.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=o.target;((d=r.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&n.current&&o.preventDefault()}})}),Ks=i.forwardRef((t,s)=>{const{__scopeDialog:r,trapFocus:c,onOpenAutoFocus:n,onCloseAutoFocus:o,...l}=t,a=ae(be,r),f=i.useRef(null),d=Ne(s,f);return ys(),e.jsxs(e.Fragment,{children:[e.jsx(bs,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:n,onUnmountAutoFocus:o,children:e.jsx(js,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Pt(a.open),...l,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Ua,{titleId:a.titleId}),e.jsx(Ha,{contentRef:f,descriptionId:a.descriptionId})]})]})}),St="DialogTitle",Hs=i.forwardRef((t,s)=>{const{__scopeDialog:r,...c}=t,n=ae(St,r);return e.jsx(X.h2,{id:n.titleId,...c,ref:s})});Hs.displayName=St;var zs="DialogDescription",Qs=i.forwardRef((t,s)=>{const{__scopeDialog:r,...c}=t,n=ae(zs,r);return e.jsx(X.p,{id:n.descriptionId,...c,ref:s})});Qs.displayName=zs;var Vs="DialogClose",Ws=i.forwardRef((t,s)=>{const{__scopeDialog:r,...c}=t,n=ae(Vs,r);return e.jsx(X.button,{type:"button",...c,ref:s,onClick:ee(t.onClick,()=>n.onOpenChange(!1))})});Ws.displayName=Vs;function Pt(t){return t?"open":"closed"}var Gs="DialogTitleWarning",[Ni,Xs]=Br(Gs,{contentName:be,titleName:St,docsSlug:"dialog"}),Ua=({titleId:t})=>{const s=Xs(Gs),r=`\`${s.contentName}\` requires a \`${s.titleName}\` for the component to be accessible for screen reader users.
37
-
38
- If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component.
39
-
40
- For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return i.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},Ka="DialogDescriptionWarning",Ha=({contentRef:t,descriptionId:s})=>{const c=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xs(Ka).contentName}}.`;return i.useEffect(()=>{var o;const n=(o=t.current)==null?void 0:o.getAttribute("aria-describedby");s&&n&&(document.getElementById(s)||console.warn(c))},[c,t,s]),null},Js=Ms,Ys=qs,Rt=Bs,At=Us,Zs=Hs,er=Qs,za=Ws;const Ee=Js,Qa=Ys,tr=i.forwardRef(({className:t,...s},r)=>e.jsx(Rt,{ref:r,className:J("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",t),...s}));tr.displayName=Rt.displayName;const pe=i.forwardRef(({className:t,children:s,...r},c)=>e.jsxs(Qa,{children:[e.jsx(tr,{}),e.jsxs(At,{ref:c,className:J("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",t),...r,children:[s,e.jsxs(za,{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(bt,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pe.displayName=At.displayName;const fe=({className:t,...s})=>e.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left",t),...s});fe.displayName="DialogHeader";const Se=({className:t,...s})=>e.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s});Se.displayName="DialogFooter";const he=i.forwardRef(({className:t,...s},r)=>e.jsx(Zs,{ref:r,className:J("text-lg font-semibold leading-none tracking-tight",t),...s}));he.displayName=Zs.displayName;const ge=i.forwardRef(({className:t,...s},r)=>e.jsx(er,{ref:r,className:J("text-sm text-muted-foreground",t),...s}));ge.displayName=er.displayName;function Va(t,s,r){if(!t)return t;const c=n=>n.paper_id!==s||n.paper_title===r?n:{...n,paper_title:r};if(Array.isArray(t)){const n=t.map(c);return n.some((l,a)=>l!==t[a])?n:t}if(Array.isArray(t.results)){const n=t.results.map(c);return n.some((l,a)=>l!==t.results[a])?{...t,results:n}:t}return t}function Ue(t,s,r){new Set([...r,s.id,s.arxiv_id].filter(l=>!!l)).forEach(l=>{t.setQueryData(["paper",l],s),t.setQueryData(["paper-arxiv",l],s)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const n=String(s.id),o=l=>Va(l,n,s.title);t.setQueriesData({queryKey:["evaluations"]},o),t.setQueriesData({queryKey:["dataset-evals"]},o),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}function Me({isAuthor:t=!1}){return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:t?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}const Wa=250,Ga=100;function Xa({open:t,onOpenChange:s,paperId:r,arxivId:c,initialTaskIds:n,initialTasks:o,onSuccess:l,submitMode:a="direct",isAuthor:f=!1}){const[d,j]=i.useState(n),[x,P]=i.useState(""),[_,T]=i.useState(""),[I,L]=i.useState(new Map),C=ke(),{toast:R}=we(),O=i.useRef(!1);i.useEffect(()=>{if(!t){O.current=!1;return}if(O.current)return;O.current=!0,j(n),P(""),T("");const y=new Map;(o||[]).forEach(k=>{const E=parseInt(k.id);Number.isNaN(E)||y.set(E,k)}),L(y)},[t,n,o]),i.useEffect(()=>{const y=window.setTimeout(()=>{T(x.trim())},Wa);return()=>window.clearTimeout(y)},[x]);const{data:D,isFetching:$}=ie({queryKey:["tasks-search",_],queryFn:()=>Cs({page_size:Ga,visible_only:!0,..._?{q:_}:{}}),enabled:t});i.useEffect(()=>{var y;(y=D==null?void 0:D.results)!=null&&y.length&&L(k=>{const E=new Map(k);return D.results.forEach(p=>{const h=parseInt(p.id);Number.isNaN(h)||E.set(h,p)}),E})},[D]);const m=i.useMemo(()=>{const y=(D==null?void 0:D.results)||[],k=new Set,E=[];return d.forEach(p=>{if(k.has(p))return;const h=I.get(p);h&&(E.push(h),k.add(p))}),y.forEach(p=>{const h=parseInt(p.id);Number.isNaN(h)||k.has(h)||(E.push(p),k.add(h))}),E},[D,d,I]),N=Ce({mutationFn:async({paperId:y,taskIds:k})=>a==="pending"?(await $e({paper_id:parseInt(y),edit_type:"tasks",proposed_payload:{task_ids:k}}),null):ra(y,k),onMutate:async({taskIds:y})=>{if(a==="pending")return{snapshots:[]};const k=y.map(h=>I.get(h)).filter(h=>!!h).map(h=>({id:h.id,name:h.name,slug:h.slug})).sort((h,w)=>h.name.localeCompare(w.name)),E=Array.from(new Set([r,c].filter(h=>!!h)));await Promise.all(E.flatMap(h=>[C.cancelQueries({queryKey:["paper",h]}),C.cancelQueries({queryKey:["paper-arxiv",h]})]));const p=[];return E.forEach(h=>{["paper","paper-arxiv"].forEach(w=>{const b=[w,h],v=C.getQueryData(b);p.push({key:b,data:v}),v&&C.setQueryData(b,{...v,tasks:k})})}),R({title:"Tasks updated",description:`Saved ${y.length} task${y.length===1?"":"s"} for this paper.`}),l==null||l(),s(!1),{snapshots:p}},onSuccess:y=>{if(a==="pending"){R({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),l==null||l(),s(!1);return}y&&Ue(C,y,[r,c])},onError:(y,k,E)=>{var w,b;(w=E==null?void 0:E.snapshots)==null||w.forEach(({key:v,data:H})=>{C.setQueryData(v,H)});const p=y;let h=p.message||(a==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(p.response)try{const v=JSON.parse(p.response);typeof(v==null?void 0:v.detail)=="string"?h=v.detail:Array.isArray(v==null?void 0:v.detail)&&((b=v.detail[0])!=null&&b.msg)&&(h=v.detail[0].msg)}catch{h=p.response}R({title:a==="pending"?"Could not submit edit":"Could not save tasks",description:h,variant:"destructive"})}}),z=()=>{N.mutate({paperId:r,taskIds:d})},Q=i.useMemo(()=>{if(d.length!==n.length)return!0;const y=new Set(n);return d.some(k=>!y.has(k))},[d,n]),M=(y,k)=>{j(E=>k?E.includes(y)?E:[...E,y]:E.filter(p=>p!==y))},te=()=>P("");return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Paper Tasks"}),e.jsx(ge,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),a==="pending"&&e.jsx(Me,{isAuthor:f}),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(le,{type:"text",placeholder:"Search tasks...",value:x,onChange:y=>P(y.target.value),className:"pl-9 pr-9"}),x&&e.jsx("button",{type:"button",onClick:te,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(bt,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:m.length>0?e.jsx("div",{className:"space-y-2",children:m.map(y=>{const k=parseInt(y.id),E=d.includes(k);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ct,{id:`task-${y.id}`,checked:E,onCheckedChange:p=>M(k,p===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${y.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[y.name,y.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[y.description.substring(0,100),y.description.length>100?"...":""]})]})]},y.id)})}):$?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{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:_?`No tasks found matching "${_}"`:"No tasks available"})]})}),e.jsxs(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:z,disabled:N.isPending||!Q,children:N.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),a==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),a==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const Ja=250,Ya=100;function Za({open:t,onOpenChange:s,paperId:r,arxivId:c,initialMethodIds:n,initialMethods:o,onSuccess:l,submitMode:a="direct",isAuthor:f=!1}){const[d,j]=i.useState(n),[x,P]=i.useState(""),[_,T]=i.useState(""),[I,L]=i.useState(new Map),C=ke(),{toast:R}=we(),O=i.useRef(!1);i.useEffect(()=>{if(!t){O.current=!1;return}if(O.current)return;O.current=!0,j(n),P(""),T("");const y=new Map;(o||[]).forEach(k=>{const E=parseInt(k.id);Number.isNaN(E)||y.set(E,k)}),L(y)},[t,n,o]),i.useEffect(()=>{const y=window.setTimeout(()=>{T(x.trim())},Ja);return()=>window.clearTimeout(y)},[x]);const{data:D,isFetching:$}=ie({queryKey:["methods-search",_],queryFn:()=>na({page_size:Ya,..._?{q:_}:{}}),enabled:t});i.useEffect(()=>{var y;(y=D==null?void 0:D.results)!=null&&y.length&&L(k=>{const E=new Map(k);return D.results.forEach(p=>{const h=parseInt(p.id);Number.isNaN(h)||E.set(h,p)}),E})},[D]);const m=i.useMemo(()=>{const y=(D==null?void 0:D.results)||[],k=new Set,E=[];return d.forEach(p=>{if(k.has(p))return;const h=I.get(p);h&&(E.push(h),k.add(p))}),y.forEach(p=>{const h=parseInt(p.id);Number.isNaN(h)||k.has(h)||(E.push(p),k.add(h))}),E},[D,d,I]),N=Ce({mutationFn:async({paperId:y,methodIds:k})=>a==="pending"?(await $e({paper_id:parseInt(y),edit_type:"methods",proposed_payload:{method_ids:k}}),null):aa(y,k),onSuccess:y=>{if(a==="pending"){R({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),l==null||l(),s(!1);return}y&&Ue(C,y,[r,c]),R({title:"Methods updated",description:`Saved ${d.length} method${d.length===1?"":"s"} for this paper.`}),l==null||l(),s(!1)},onError:y=>{var p;const k=y;let E=k.message||(a==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(k.response)try{const h=JSON.parse(k.response);typeof(h==null?void 0:h.detail)=="string"?E=h.detail:Array.isArray(h==null?void 0:h.detail)&&((p=h.detail[0])!=null&&p.msg)&&(E=h.detail[0].msg)}catch{E=k.response}R({title:a==="pending"?"Could not submit edit":"Could not save methods",description:E,variant:"destructive"})}}),z=()=>{N.mutate({paperId:r,methodIds:d})},Q=i.useMemo(()=>{if(d.length!==n.length)return!0;const y=new Set(n);return d.some(k=>!y.has(k))},[d,n]),M=(y,k)=>{j(E=>k?E.includes(y)?E:[...E,y]:E.filter(p=>p!==y))},te=()=>P("");return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Paper Methods"}),e.jsx(ge,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),a==="pending"&&e.jsx(Me,{isAuthor:f}),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(le,{type:"text",placeholder:"Search methods...",value:x,onChange:y=>P(y.target.value),className:"pl-9 pr-9"}),x&&e.jsx("button",{type:"button",onClick:te,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(bt,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:m.length>0?e.jsx("div",{className:"space-y-2",children:m.map(y=>{const k=parseInt(y.id),E=d.includes(k);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ct,{id:`method-${y.id}`,checked:E,onCheckedChange:p=>M(k,p===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${y.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[y.name,y.full_name&&y.full_name!==y.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:y.full_name}),y.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[y.description.substring(0,100),y.description.length>100?"...":""]})]})]},y.id)})}):$?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{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:_?`No methods found matching "${_}"`:"No methods available"})]})}),e.jsxs(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:z,disabled:N.isPending||!Q,children:N.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),a==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),a==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function en({open:t,onOpenChange:s,paperId:r,arxivId:c,initialRepositories:n,onSuccess:o,submitMode:l="direct",isAuthor:a=!1}){const[f,d]=i.useState(n),[j,x]=i.useState(""),P=ke(),{toast:_}=we(),T=i.useRef(!1);i.useEffect(()=>{if(!t){T.current=!1;return}T.current||(T.current=!0,d(n),x(""))},[t,n]);const I=Ce({mutationFn:async({paperId:m,repositories:N})=>l==="pending"?(await $e({paper_id:parseInt(m),edit_type:"repositories",proposed_payload:{repositories:N}}),null):ia(m,N),onSuccess:m=>{if(l==="pending"){_({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),o==null||o(),s(!1),x("");return}m&&Ue(P,m,[r,c]),o==null||o(),s(!1),x("")},onError:m=>{var Q;const N=m;let z=N.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(N.response)try{const M=JSON.parse(N.response);typeof(M==null?void 0:M.detail)=="string"?z=M.detail:Array.isArray(M==null?void 0:M.detail)&&((Q=M.detail[0])!=null&&Q.msg)&&(z=M.detail[0].msg)}catch{z=N.response}_({title:l==="pending"?"Could not submit edit":"Could not save repositories",description:z,variant:"destructive"})}}),L=()=>{const m=j.trim();return m?f.some(N=>N.url===m)?(alert("This repository URL is already added"),null):[...f,{url:m,is_official:!1}]:f},C=()=>{const m=L();m!==null&&m.length!==f.length&&(d(m),x(""))},R=m=>{d(f.filter(N=>N.url!==m))},O=m=>{d(f.map(N=>N.url===m?{...N,is_official:!N.is_official}:N))},D=()=>{const m=L();m!==null&&I.mutate({paperId:r,repositories:m})},$=i.useMemo(()=>{const m=j.trim(),N=m?[...f,{url:m,is_official:!1}]:f;if(N.length!==n.length)return!0;const z=new Map(n.map(Q=>[Q.url.trim(),!!Q.is_official]));return N.some(Q=>{const M=z.get(Q.url.trim());return M===void 0||M!==!!Q.is_official})},[f,j,n]);return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Paper Repositories"}),e.jsx(ge,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),l==="pending"&&e.jsx(Me,{isAuthor:a}),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(le,{type:"url",placeholder:"https://github.com/owner/repo",value:j,onChange:m=>x(m.target.value),onKeyPress:m=>{m.key==="Enter"&&(m.preventDefault(),C())},className:"flex-1"}),e.jsxs(V,{onClick:C,size:"sm",disabled:!j.trim(),children:[e.jsx(_t,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:f.length>0?e.jsx("div",{className:"space-y-2",children:f.map((m,N)=>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(os,{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:m.url}),m.is_official&&e.jsx(Es,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(V,{variant:m.is_official?"default":"outline",size:"sm",onClick:()=>O(m.url),className:"h-8 px-2 text-xs",title:m.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(Ss,{className:`w-3.5 h-3.5 mr-1 ${m.is_official?"fill-current":""}`}),m.is_official?"Official":"Mark official"]}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>R(m.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Nt,{className:"w-4 h-4"})})]})]},N))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(os,{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(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:D,disabled:I.isPending||!$,children:I.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function tn({open:t,onOpenChange:s,paperId:r,arxivId:c,initialProjectPages:n,onSuccess:o,submitMode:l="direct",isAuthor:a=!1}){const[f,d]=i.useState(n),[j,x]=i.useState(""),P=ke(),{toast:_}=we(),T=i.useRef(!1);i.useEffect(()=>{if(!t){T.current=!1;return}T.current||(T.current=!0,d(n),x(""))},[t,n]);const I=Ce({mutationFn:async({paperId:m,projectPages:N})=>l==="pending"?(await $e({paper_id:parseInt(m),edit_type:"project_pages",proposed_payload:{project_pages:N}}),null):oa(m,N),onSuccess:m=>{if(l==="pending"){_({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),o==null||o(),s(!1),x("");return}m&&Ue(P,m,[r,c]),o==null||o(),s(!1),x("")},onError:m=>{var Q;const N=m;let z=N.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(N.response)try{const M=JSON.parse(N.response);typeof(M==null?void 0:M.detail)=="string"?z=M.detail:Array.isArray(M==null?void 0:M.detail)&&((Q=M.detail[0])!=null&&Q.msg)&&(z=M.detail[0].msg)}catch{z=N.response}_({title:l==="pending"?"Could not submit edit":"Could not save project pages",description:z,variant:"destructive"})}}),L=()=>{const m=j.trim();return m?f.some(N=>N.url===m)?(alert("This project page URL is already added"),null):[...f,{url:m,is_official:!1}]:f},C=()=>{const m=L();m!==null&&m.length!==f.length&&(d(m),x(""))},R=m=>{d(f.filter(N=>N.url!==m))},O=m=>{d(f.map(N=>N.url===m?{...N,is_official:!N.is_official}:N))},D=()=>{const m=L();m!==null&&I.mutate({paperId:r,projectPages:m})},$=i.useMemo(()=>{const m=j.trim(),N=m?[...f,{url:m,is_official:!1}]:f;if(N.length!==n.length)return!0;const z=new Map(n.map(Q=>[Q.url.trim(),!!Q.is_official]));return N.some(Q=>{const M=z.get(Q.url.trim());return M===void 0||M!==!!Q.is_official})},[f,j,n]);return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Paper Project Pages"}),e.jsx(ge,{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."})]}),l==="pending"&&e.jsx(Me,{isAuthor:a}),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(le,{type:"url",placeholder:"https://example.com/project",value:j,onChange:m=>x(m.target.value),onKeyPress:m=>{m.key==="Enter"&&(m.preventDefault(),C())},className:"flex-1"}),e.jsxs(V,{onClick:C,size:"sm",disabled:!j.trim(),children:[e.jsx(_t,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:f.length>0?e.jsx("div",{className:"space-y-2",children:f.map((m,N)=>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(ls,{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:m.url}),m.is_official&&e.jsx(Es,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(V,{variant:m.is_official?"default":"outline",size:"sm",onClick:()=>O(m.url),className:"h-8 px-2 text-xs",title:m.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(Ss,{className:`w-3.5 h-3.5 mr-1 ${m.is_official?"fill-current":""}`}),m.is_official?"Official":"Mark official"]}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>R(m.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Nt,{className:"w-4 h-4"})})]})]},N))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ls,{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(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:D,disabled:I.isPending||!$,children:I.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function sn({open:t,onOpenChange:s,paperId:r,arxivId:c,initialUrl:n,onSuccess:o,submitMode:l="direct",isAuthor:a=!1}){const[f,d]=i.useState(n),j=ke(),{toast:x}=we(),P=i.useRef(!1);i.useEffect(()=>{if(!t){P.current=!1;return}P.current||(P.current=!0,d(n))},[t,n]);const _=Ce({mutationFn:async({paperId:R,sourceUrl:O})=>l==="pending"?(await $e({paper_id:parseInt(R),edit_type:"source_url",proposed_payload:{source_url:O}}),null):la(R,O),onSuccess:R=>{if(l==="pending"){x({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),o==null||o(),s(!1);return}R&&Ue(j,R,[r,c]),o==null||o(),s(!1)},onError:R=>{var $;const O=R;let D=O.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(O.response)try{const m=JSON.parse(O.response);typeof(m==null?void 0:m.detail)=="string"?D=m.detail:Array.isArray(m==null?void 0:m.detail)&&(($=m.detail[0])!=null&&$.msg)&&(D=m.detail[0].msg)}catch{D=O.response}x({title:l==="pending"?"Could not submit edit":"Could not save source URL",description:D,variant:"destructive"})}}),T=f.trim(),I=/^https?:\/\//i.test(T),L=T!==(n||"").trim(),C=()=>{I&&_.mutate({paperId:r,sourceUrl:T})};return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-2xl",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Source URL"}),e.jsxs(ge,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),l==="pending"&&e.jsx(Me,{isAuthor:a}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(le,{type:"url",placeholder:"https://example.com/paper",value:f,onChange:R=>d(R.target.value),onKeyPress:R=>{R.key==="Enter"&&I&&L&&(R.preventDefault(),C())}}),!I&&T.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:C,disabled:_.isPending||!I||!L,children:_.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function rn(t){const s=an(t),r=i.forwardRef((c,n)=>{const{children:o,...l}=c,a=i.Children.toArray(o),f=a.find(on);if(f){const d=f.props.children,j=a.map(x=>x===f?i.Children.count(d)>1?i.Children.only(null):i.isValidElement(d)?d.props.children:null:x);return e.jsx(s,{...l,ref:n,children:i.isValidElement(d)?i.cloneElement(d,void 0,j):null})}return e.jsx(s,{...l,ref:n,children:o})});return r.displayName=`${t}.Slot`,r}function an(t){const s=i.forwardRef((r,c)=>{const{children:n,...o}=r;if(i.isValidElement(n)){const l=cn(n),a=ln(o,n.props);return n.type!==i.Fragment&&(a.ref=c?ye(c,l):l),i.cloneElement(n,a)}return i.Children.count(n)>1?i.Children.only(null):null});return s.displayName=`${t}.SlotClone`,s}var nn=Symbol("radix.slottable");function on(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===nn}function ln(t,s){const r={...s};for(const c in s){const n=t[c],o=s[c];/^on[A-Z]/.test(c)?n&&o?r[c]=(...a)=>{const f=o(...a);return n(...a),f}:n&&(r[c]=n):c==="style"?r[c]={...n,...o}:c==="className"&&(r[c]=[n,o].filter(Boolean).join(" "))}return{...t,...r}}function cn(t){var c,n;let s=(c=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:c.get,r=s&&"isReactWarning"in s&&s.isReactWarning;return r?t.ref:(s=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=s&&"isReactWarning"in s&&s.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var it="Popover",[sr]=yt(it,[Ns]),Ke=Ns(),[dn,xe]=sr(it),rr=t=>{const{__scopePopover:s,children:r,open:c,defaultOpen:n,onOpenChange:o,modal:l=!1}=t,a=Ke(s),f=i.useRef(null),[d,j]=i.useState(!1),[x,P]=vt({prop:c,defaultProp:n??!1,onChange:o,caller:it});return e.jsx(Ur,{...a,children:e.jsx(dn,{scope:s,contentId:ne(),triggerRef:f,open:x,onOpenChange:P,onOpenToggle:i.useCallback(()=>P(_=>!_),[P]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>j(!0),[]),onCustomAnchorRemove:i.useCallback(()=>j(!1),[]),modal:l,children:r})})};rr.displayName=it;var ar="PopoverAnchor",un=i.forwardRef((t,s)=>{const{__scopePopover:r,...c}=t,n=xe(ar,r),o=Ke(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:a}=n;return i.useEffect(()=>(l(),()=>a()),[l,a]),e.jsx(_s,{...o,...c,ref:s})});un.displayName=ar;var nr="PopoverTrigger",ir=i.forwardRef((t,s)=>{const{__scopePopover:r,...c}=t,n=xe(nr,r),o=Ke(r),l=Ne(s,n.triggerRef),a=e.jsx(X.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":ur(n.open),...c,ref:l,onClick:ee(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?a:e.jsx(_s,{asChild:!0,...o,children:a})});ir.displayName=nr;var It="PopoverPortal",[mn,pn]=sr(It,{forceMount:void 0}),or=t=>{const{__scopePopover:s,forceMount:r,children:c,container:n}=t,o=xe(It,s);return e.jsx(mn,{scope:s,forceMount:r,children:e.jsx(Te,{present:r||o.open,children:e.jsx(gs,{asChild:!0,container:n,children:c})})})};or.displayName=It;var Fe="PopoverContent",lr=i.forwardRef((t,s)=>{const r=pn(Fe,t.__scopePopover),{forceMount:c=r.forceMount,...n}=t,o=xe(Fe,t.__scopePopover);return e.jsx(Te,{present:c||o.open,children:o.modal?e.jsx(hn,{...n,ref:s}):e.jsx(gn,{...n,ref:s})})});lr.displayName=Fe;var fn=rn("PopoverContent.RemoveScroll"),hn=i.forwardRef((t,s)=>{const r=xe(Fe,t.__scopePopover),c=i.useRef(null),n=Ne(s,c),o=i.useRef(!1);return i.useEffect(()=>{const l=c.current;if(l)return xs(l)},[]),e.jsx(vs,{as:fn,allowPinchZoom:!0,children:e.jsx(cr,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(t.onCloseAutoFocus,l=>{var a;l.preventDefault(),o.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ee(t.onPointerDownOutside,l=>{const a=l.detail.originalEvent,f=a.button===0&&a.ctrlKey===!0,d=a.button===2||f;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ee(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),gn=i.forwardRef((t,s)=>{const r=xe(Fe,t.__scopePopover),c=i.useRef(!1),n=i.useRef(!1);return e.jsx(cr,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,a;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(c.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),c.current=!1,n.current=!1},onInteractOutside:o=>{var f,d;(f=t.onInteractOutside)==null||f.call(t,o),o.defaultPrevented||(c.current=!0,o.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=o.target;((d=r.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&n.current&&o.preventDefault()}})}),cr=i.forwardRef((t,s)=>{const{__scopePopover:r,trapFocus:c,onOpenAutoFocus:n,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:a,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:j,...x}=t,P=xe(Fe,r),_=Ke(r);return ys(),e.jsx(bs,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:n,onUnmountAutoFocus:o,children:e.jsx(js,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:j,onEscapeKeyDown:a,onPointerDownOutside:f,onFocusOutside:d,onDismiss:()=>P.onOpenChange(!1),children:e.jsx(Kr,{"data-state":ur(P.open),role:"dialog",id:P.contentId,..._,...x,ref:s,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),dr="PopoverClose",xn=i.forwardRef((t,s)=>{const{__scopePopover:r,...c}=t,n=xe(dr,r);return e.jsx(X.button,{type:"button",...c,ref:s,onClick:ee(t.onClick,()=>n.onOpenChange(!1))})});xn.displayName=dr;var vn="PopoverArrow",yn=i.forwardRef((t,s)=>{const{__scopePopover:r,...c}=t,n=Ke(r);return e.jsx(Hr,{...n,...c,ref:s})});yn.displayName=vn;function ur(t){return t?"open":"closed"}var bn=rr,jn=ir,_n=or,mr=lr;const Nn=bn,kn=jn,pr=i.forwardRef(({className:t,align:s="center",sideOffset:r=4,...c},n)=>e.jsx(_n,{children:e.jsx(mr,{ref:n,align:s,sideOffset:r,className:J("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...c})}));pr.displayName=mr.displayName;var cs=1,wn=.9,Cn=.8,En=.17,dt=.1,ut=.999,Sn=.9999,Pn=.99,Rn=/[\\\/_+.#"@\[\(\{&]/,An=/[\\\/_+.#"@\[\(\{&]/g,In=/[\s-]/,fr=/[\s-]/g;function gt(t,s,r,c,n,o,l){if(o===s.length)return n===t.length?cs:Pn;var a=`${n},${o}`;if(l[a]!==void 0)return l[a];for(var f=c.charAt(o),d=r.indexOf(f,n),j=0,x,P,_,T;d>=0;)x=gt(t,s,r,c,d+1,o+1,l),x>j&&(d===n?x*=cs:Rn.test(t.charAt(d-1))?(x*=Cn,_=t.slice(n,d-1).match(An),_&&n>0&&(x*=Math.pow(ut,_.length))):In.test(t.charAt(d-1))?(x*=wn,T=t.slice(n,d-1).match(fr),T&&n>0&&(x*=Math.pow(ut,T.length))):(x*=En,n>0&&(x*=Math.pow(ut,d-n))),t.charAt(d)!==s.charAt(o)&&(x*=Sn)),(x<dt&&r.charAt(d-1)===c.charAt(o+1)||c.charAt(o+1)===c.charAt(o)&&r.charAt(d-1)!==c.charAt(o))&&(P=gt(t,s,r,c,d+1,o+2,l),P*dt>x&&(x=P*dt)),x>j&&(j=x),d=r.indexOf(f,d+1);return l[a]=j,j}function ds(t){return t.toLowerCase().replace(fr," ")}function Dn(t,s,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,gt(t,s,ds(t),ds(s),0,0,{})}var Oe='[cmdk-group=""]',mt='[cmdk-group-items=""]',Fn='[cmdk-group-heading=""]',hr='[cmdk-item=""]',us=`${hr}:not([aria-disabled="true"])`,xt="cmdk-item-select",Ae="data-value",Tn=(t,s,r)=>Dn(t,s,r),gr=i.createContext(void 0),He=()=>i.useContext(gr),xr=i.createContext(void 0),Dt=()=>i.useContext(xr),vr=i.createContext(void 0),yr=i.forwardRef((t,s)=>{let r=Ie(()=>{var g,F;return{search:"",value:(F=(g=t.value)!=null?g:t.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),c=Ie(()=>new Set),n=Ie(()=>new Map),o=Ie(()=>new Map),l=Ie(()=>new Set),a=br(t),{label:f,children:d,value:j,onValueChange:x,filter:P,shouldFilter:_,loop:T,disablePointerSelection:I=!1,vimBindings:L=!0,...C}=t,R=ne(),O=ne(),D=ne(),$=i.useRef(null),m=Qn();je(()=>{if(j!==void 0){let g=j.trim();r.current.value=g,N.emit()}},[j]),je(()=>{m(6,k)},[]);let N=i.useMemo(()=>({subscribe:g=>(l.current.add(g),()=>l.current.delete(g)),snapshot:()=>r.current,setState:(g,F,q)=>{var S,B,K,Y;if(!Object.is(r.current[g],F)){if(r.current[g]=F,g==="search")y(),M(),m(1,te);else if(g==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let W=document.getElementById(D);W?W.focus():(S=document.getElementById(R))==null||S.focus()}if(m(7,()=>{var W;r.current.selectedItemId=(W=E())==null?void 0:W.id,N.emit()}),q||m(5,k),((B=a.current)==null?void 0:B.value)!==void 0){let W=F??"";(Y=(K=a.current).onValueChange)==null||Y.call(K,W);return}}N.emit()}},emit:()=>{l.current.forEach(g=>g())}}),[]),z=i.useMemo(()=>({value:(g,F,q)=>{var S;F!==((S=o.current.get(g))==null?void 0:S.value)&&(o.current.set(g,{value:F,keywords:q}),r.current.filtered.items.set(g,Q(F,q)),m(2,()=>{M(),N.emit()}))},item:(g,F)=>(c.current.add(g),F&&(n.current.has(F)?n.current.get(F).add(g):n.current.set(F,new Set([g]))),m(3,()=>{y(),M(),r.current.value||te(),N.emit()}),()=>{o.current.delete(g),c.current.delete(g),r.current.filtered.items.delete(g);let q=E();m(4,()=>{y(),(q==null?void 0:q.getAttribute("id"))===g&&te(),N.emit()})}),group:g=>(n.current.has(g)||n.current.set(g,new Set),()=>{o.current.delete(g),n.current.delete(g)}),filter:()=>a.current.shouldFilter,label:f||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:R,inputId:D,labelId:O,listInnerRef:$}),[]);function Q(g,F){var q,S;let B=(S=(q=a.current)==null?void 0:q.filter)!=null?S:Tn;return g?B(g,r.current.search,F):0}function M(){if(!r.current.search||a.current.shouldFilter===!1)return;let g=r.current.filtered.items,F=[];r.current.filtered.groups.forEach(S=>{let B=n.current.get(S),K=0;B.forEach(Y=>{let W=g.get(Y);K=Math.max(W,K)}),F.push([S,K])});let q=$.current;p().sort((S,B)=>{var K,Y;let W=S.getAttribute("id"),ve=B.getAttribute("id");return((K=g.get(ve))!=null?K:0)-((Y=g.get(W))!=null?Y:0)}).forEach(S=>{let B=S.closest(mt);B?B.appendChild(S.parentElement===B?S:S.closest(`${mt} > *`)):q.appendChild(S.parentElement===q?S:S.closest(`${mt} > *`))}),F.sort((S,B)=>B[1]-S[1]).forEach(S=>{var B;let K=(B=$.current)==null?void 0:B.querySelector(`${Oe}[${Ae}="${encodeURIComponent(S[0])}"]`);K==null||K.parentElement.appendChild(K)})}function te(){let g=p().find(q=>q.getAttribute("aria-disabled")!=="true"),F=g==null?void 0:g.getAttribute(Ae);N.setState("value",F||void 0)}function y(){var g,F,q,S;if(!r.current.search||a.current.shouldFilter===!1){r.current.filtered.count=c.current.size;return}r.current.filtered.groups=new Set;let B=0;for(let K of c.current){let Y=(F=(g=o.current.get(K))==null?void 0:g.value)!=null?F:"",W=(S=(q=o.current.get(K))==null?void 0:q.keywords)!=null?S:[],ve=Q(Y,W);r.current.filtered.items.set(K,ve),ve>0&&B++}for(let[K,Y]of n.current)for(let W of Y)if(r.current.filtered.items.get(W)>0){r.current.filtered.groups.add(K);break}r.current.filtered.count=B}function k(){var g,F,q;let S=E();S&&(((g=S.parentElement)==null?void 0:g.firstChild)===S&&((q=(F=S.closest(Oe))==null?void 0:F.querySelector(Fn))==null||q.scrollIntoView({block:"nearest"})),S.scrollIntoView({block:"nearest"}))}function E(){var g;return(g=$.current)==null?void 0:g.querySelector(`${hr}[aria-selected="true"]`)}function p(){var g;return Array.from(((g=$.current)==null?void 0:g.querySelectorAll(us))||[])}function h(g){let F=p()[g];F&&N.setState("value",F.getAttribute(Ae))}function w(g){var F;let q=E(),S=p(),B=S.findIndex(Y=>Y===q),K=S[B+g];(F=a.current)!=null&&F.loop&&(K=B+g<0?S[S.length-1]:B+g===S.length?S[0]:S[B+g]),K&&N.setState("value",K.getAttribute(Ae))}function b(g){let F=E(),q=F==null?void 0:F.closest(Oe),S;for(;q&&!S;)q=g>0?Hn(q,Oe):zn(q,Oe),S=q==null?void 0:q.querySelector(us);S?N.setState("value",S.getAttribute(Ae)):w(g)}let v=()=>h(p().length-1),H=g=>{g.preventDefault(),g.metaKey?v():g.altKey?b(1):w(1)},U=g=>{g.preventDefault(),g.metaKey?h(0):g.altKey?b(-1):w(-1)};return i.createElement(X.div,{ref:s,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:g=>{var F;(F=C.onKeyDown)==null||F.call(C,g);let q=g.nativeEvent.isComposing||g.keyCode===229;if(!(g.defaultPrevented||q))switch(g.key){case"n":case"j":{L&&g.ctrlKey&&H(g);break}case"ArrowDown":{H(g);break}case"p":case"k":{L&&g.ctrlKey&&U(g);break}case"ArrowUp":{U(g);break}case"Home":{g.preventDefault(),h(0);break}case"End":{g.preventDefault(),v();break}case"Enter":{g.preventDefault();let S=E();if(S){let B=new Event(xt);S.dispatchEvent(B)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:z.inputId,id:z.labelId,style:Wn},f),ot(t,g=>i.createElement(xr.Provider,{value:N},i.createElement(gr.Provider,{value:z},g))))}),$n=i.forwardRef((t,s)=>{var r,c;let n=ne(),o=i.useRef(null),l=i.useContext(vr),a=He(),f=br(t),d=(c=(r=f.current)==null?void 0:r.forceMount)!=null?c:l==null?void 0:l.forceMount;je(()=>{if(!d)return a.item(n,l==null?void 0:l.id)},[d]);let j=jr(n,o,[t.value,t.children,o],t.keywords),x=Dt(),P=ue(m=>m.value&&m.value===j.current),_=ue(m=>d||a.filter()===!1?!0:m.search?m.filtered.items.get(n)>0:!0);i.useEffect(()=>{let m=o.current;if(!(!m||t.disabled))return m.addEventListener(xt,T),()=>m.removeEventListener(xt,T)},[_,t.onSelect,t.disabled]);function T(){var m,N;I(),(N=(m=f.current).onSelect)==null||N.call(m,j.current)}function I(){x.setState("value",j.current,!0)}if(!_)return null;let{disabled:L,value:C,onSelect:R,forceMount:O,keywords:D,...$}=t;return i.createElement(X.div,{ref:ye(o,s),...$,id:n,"cmdk-item":"",role:"option","aria-disabled":!!L,"aria-selected":!!P,"data-disabled":!!L,"data-selected":!!P,onPointerMove:L||a.getDisablePointerSelection()?void 0:I,onClick:L?void 0:T},t.children)}),Mn=i.forwardRef((t,s)=>{let{heading:r,children:c,forceMount:n,...o}=t,l=ne(),a=i.useRef(null),f=i.useRef(null),d=ne(),j=He(),x=ue(_=>n||j.filter()===!1?!0:_.search?_.filtered.groups.has(l):!0);je(()=>j.group(l),[]),jr(l,a,[t.value,t.heading,f]);let P=i.useMemo(()=>({id:l,forceMount:n}),[n]);return i.createElement(X.div,{ref:ye(a,s),...o,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},r&&i.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),ot(t,_=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},i.createElement(vr.Provider,{value:P},_))))}),Ln=i.forwardRef((t,s)=>{let{alwaysRender:r,...c}=t,n=i.useRef(null),o=ue(l=>!l.search);return!r&&!o?null:i.createElement(X.div,{ref:ye(n,s),...c,"cmdk-separator":"",role:"separator"})}),On=i.forwardRef((t,s)=>{let{onValueChange:r,...c}=t,n=t.value!=null,o=Dt(),l=ue(d=>d.search),a=ue(d=>d.selectedItemId),f=He();return i.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),i.createElement(X.input,{ref:s,...c,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":a,id:f.inputId,type:"text",value:n?t.value:l,onChange:d=>{n||o.setState("search",d.target.value),r==null||r(d.target.value)}})}),qn=i.forwardRef((t,s)=>{let{children:r,label:c="Suggestions",...n}=t,o=i.useRef(null),l=i.useRef(null),a=ue(d=>d.selectedItemId),f=He();return i.useEffect(()=>{if(l.current&&o.current){let d=l.current,j=o.current,x,P=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let _=d.offsetHeight;j.style.setProperty("--cmdk-list-height",_.toFixed(1)+"px")})});return P.observe(d),()=>{cancelAnimationFrame(x),P.unobserve(d)}}},[]),i.createElement(X.div,{ref:ye(o,s),...n,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":c,id:f.listId},ot(t,d=>i.createElement("div",{ref:ye(l,f.listInnerRef),"cmdk-list-sizer":""},d)))}),Bn=i.forwardRef((t,s)=>{let{open:r,onOpenChange:c,overlayClassName:n,contentClassName:o,container:l,...a}=t;return i.createElement(Js,{open:r,onOpenChange:c},i.createElement(Ys,{container:l},i.createElement(Rt,{"cmdk-overlay":"",className:n}),i.createElement(At,{"aria-label":t.label,"cmdk-dialog":"",className:o},i.createElement(yr,{ref:s,...a}))))}),Un=i.forwardRef((t,s)=>ue(r=>r.filtered.count===0)?i.createElement(X.div,{ref:s,...t,"cmdk-empty":"",role:"presentation"}):null),Kn=i.forwardRef((t,s)=>{let{progress:r,children:c,label:n="Loading...",...o}=t;return i.createElement(X.div,{ref:s,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},ot(t,l=>i.createElement("div",{"aria-hidden":!0},l)))}),Z=Object.assign(yr,{List:qn,Item:$n,Input:On,Group:Mn,Separator:Ln,Dialog:Bn,Empty:Un,Loading:Kn});function Hn(t,s){let r=t.nextElementSibling;for(;r;){if(r.matches(s))return r;r=r.nextElementSibling}}function zn(t,s){let r=t.previousElementSibling;for(;r;){if(r.matches(s))return r;r=r.previousElementSibling}}function br(t){let s=i.useRef(t);return je(()=>{s.current=t}),s}var je=typeof window>"u"?i.useEffect:i.useLayoutEffect;function Ie(t){let s=i.useRef();return s.current===void 0&&(s.current=t()),s}function ue(t){let s=Dt(),r=()=>t(s.snapshot());return i.useSyncExternalStore(s.subscribe,r,r)}function jr(t,s,r,c=[]){let n=i.useRef(),o=He();return je(()=>{var l;let a=(()=>{var d;for(let j of r){if(typeof j=="string")return j.trim();if(typeof j=="object"&&"current"in j)return j.current?(d=j.current.textContent)==null?void 0:d.trim():n.current}})(),f=c.map(d=>d.trim());o.value(t,a,f),(l=s.current)==null||l.setAttribute(Ae,a),n.current=a}),n}var Qn=()=>{let[t,s]=i.useState(),r=Ie(()=>new Map);return je(()=>{r.current.forEach(c=>c()),r.current=new Map},[t]),(c,n)=>{r.current.set(c,n),s({})}};function Vn(t){let s=t.type;return typeof s=="function"?s(t.props):"render"in s?s.render(t.props):t}function ot({asChild:t,children:s},r){return t&&i.isValidElement(s)?i.cloneElement(Vn(s),{ref:s.ref},r(s.props.children)):r(s)}var Wn={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const _r=i.forwardRef(({className:t,...s},r)=>e.jsx(Z,{ref:r,className:J("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...s}));_r.displayName=Z.displayName;const Nr=i.forwardRef(({className:t,...s},r)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Be,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Z.Input,{ref:r,className:J("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...s})]}));Nr.displayName=Z.Input.displayName;const kr=i.forwardRef(({className:t,...s},r)=>e.jsx(Z.List,{ref:r,className:J("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...s}));kr.displayName=Z.List.displayName;const wr=i.forwardRef((t,s)=>e.jsx(Z.Empty,{ref:s,className:"py-6 text-center text-sm",...t}));wr.displayName=Z.Empty.displayName;const Cr=i.forwardRef(({className:t,...s},r)=>e.jsx(Z.Group,{ref:r,className:J("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...s}));Cr.displayName=Z.Group.displayName;const Gn=i.forwardRef(({className:t,...s},r)=>e.jsx(Z.Separator,{ref:r,className:J("-mx-1 h-px bg-border",t),...s}));Gn.displayName=Z.Separator.displayName;const Er=i.forwardRef(({className:t,...s},r)=>e.jsx(Z.Item,{ref:r,className:J("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...s}));Er.displayName=Z.Item.displayName;const Xn=250;function ms({value:t,onChange:s,placeholder:r="Select...",searchPlaceholder:c="Search...",emptyMessage:n="No results found.",disabled:o=!1,selectedOption:l,queryKey:a,queryFn:f,enabled:d=!0,className:j}){const[x,P]=i.useState(!1),[_,T]=i.useState(""),[I,L]=i.useState("");i.useEffect(()=>{const $=window.setTimeout(()=>{L(_.trim())},Xn);return()=>window.clearTimeout($)},[_]),i.useEffect(()=>{x||(T(""),L(""))},[x]);const{data:C=[],isFetching:R}=ie({queryKey:[...a,I],queryFn:()=>f(I),enabled:d&&x}),O=i.useMemo(()=>!t||C.some($=>$.value===t)?C:(l==null?void 0:l.value)===t?[l,...C]:C,[C,l,t]),D=i.useMemo(()=>{if(!t)return r;const $=O.find(m=>m.value===t)??((l==null?void 0:l.value)===t?l:null);return($==null?void 0:$.label)??r},[O,r,l,t]);return e.jsxs(Nn,{open:x,onOpenChange:P,children:[e.jsx(kn,{asChild:!0,children:e.jsxs(V,{type:"button",variant:"outline",role:"combobox","aria-expanded":x,disabled:o,className:J("h-8 w-full justify-between px-2 text-sm font-normal",!t&&"text-muted-foreground",j),children:[e.jsx("span",{className:"truncate",children:D}),e.jsx(ya,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(pr,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:e.jsxs(_r,{shouldFilter:!1,children:[e.jsx(Nr,{placeholder:c,value:_,onValueChange:T}),e.jsx(kr,{children:R?e.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[e.jsx(oe,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):O.length===0?e.jsx(wr,{children:n}):e.jsx(Cr,{children:O.map($=>e.jsxs(Er,{value:$.value,onSelect:()=>{s($.value),P(!1)},children:[e.jsx(me,{className:J("mr-2 h-4 w-4",t===$.value?"opacity-100":"opacity-0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate",children:$.label}),$.description?e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:$.description}):null]})]},$.value))})})]})})]})}const pt=100;function Jn(t){return t.map(s=>{const r=s.best_metric||Object.keys(s.metrics)[0],c=s.metrics[r];return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:r||"",metric_value:String(c||""),best_rank:s.best_rank?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",operation:"unchanged"}})}function Yn(t){const s=new Map;return t.forEach(r=>{r.task_id&&r.task_name&&s.set(r.task_id,{id:r.task_id,name:r.task_name,slug:r.task_slug,level:0})}),s}function Zn(t){const s=new Map;return t.forEach(r=>{r.dataset_id&&r.dataset_name&&s.set(r.dataset_id,{id:r.dataset_id,name:r.dataset_name,slug:r.dataset_slug})}),s}function ps(t,s){return`${t}:${s}`}function Je(t){const s=t.trim();if(s==="")return null;const r=Number(s);return!Number.isFinite(r)||r<0?null:Math.trunc(r)}function ei({open:t,onOpenChange:s,paperId:r,arxivId:c,initialEvaluations:n,onSuccess:o,submitMode:l="direct",isAuthor:a=!1}){const[f,d]=i.useState([]),[j,x]=i.useState(new Map),[P,_]=i.useState(new Map),T=ke(),{toast:I}=we(),L=i.useRef(!1),C=i.useRef(!1);i.useEffect(()=>{if(!t){L.current=!1,C.current=!1;return}L.current||C.current||n.length!==0&&(L.current=!0,d(Jn(n)),x(Yn(n)),_(Zn(n)))},[t,n]);const R=i.useMemo(()=>Array.from(new Set(f.map(p=>p.task_id).filter(p=>p&&p!==""))),[f]),O=i.useMemo(()=>{const p=new Set;return f.forEach(h=>{h.task_id&&h.dataset_id&&p.add(ps(h.task_id,h.dataset_id))}),Array.from(p)},[f]),D=ie({queryKey:["datasets-by-tasks-for-eval-edit",R,t],queryFn:async()=>{const p={};return await Promise.all(R.map(async h=>{try{const w=await is({task_id:parseInt(h),page_size:pt});p[h]=w.results}catch(w){console.error(`Error fetching datasets for task ${h}:`,w),p[h]=[]}})),p},enabled:t&&R.length>0});i.useEffect(()=>{D.data&&_(p=>{const h=new Map(p);return Object.values(D.data).forEach(w=>{w.forEach(b=>{h.set(b.id,b)})}),h})},[D.data]);const $=ie({queryKey:["leaderboard-metrics-for-eval-edit",O,t],queryFn:async()=>{const p={};return await Promise.all(O.map(async h=>{const[w,b]=h.split(":");try{p[h]=await ma(b,w)}catch(v){console.error(`Error fetching metrics for leaderboard ${h}:`,v),p[h]=[]}})),p},enabled:t&&O.length>0}),m=async p=>{const h=await Cs({page_size:pt,visible_only:!0,...p?{q:p}:{}});return x(w=>{const b=new Map(w);return h.results.forEach(v=>b.set(v.id,v)),b}),h.results.map(w=>{var b;return{value:w.id,label:w.name,description:(b=w.description)==null?void 0:b.slice(0,100)}})},N=p=>async h=>{const w=await is({task_id:parseInt(p),page_size:pt,...h?{q:h}:{}});return _(b=>{const v=new Map(b);return w.results.forEach(H=>v.set(H.id,H)),v}),w.results.map(b=>({value:b.id,label:b.name,description:b.full_name}))},z=(p,h)=>{if(!p||!h)return!1;const w=P.get(h);return!!(w!=null&&w.supports_harness)},Q=(p,h,w)=>{var H;if(!p||!h)return[];const v=(((H=$.data)==null?void 0:H[ps(p,h)])||[]).map(U=>({value:U.metric_name,label:U.metric_name,description:U.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return w&&!v.some(U=>U.value===w)&&v.unshift({value:w,label:`${w} (legacy)`,description:void 0}),v},M=Ce({mutationFn:async({paperId:p,evaluations:h})=>{if(l==="pending"){const b=[];for(const v of h){if(v.operation==="delete"&&v.id){b.push({op:"delete",evaluation_id:parseInt(v.id)});continue}const H=z(v.task_id,v.dataset_id);if(v.operation==="create"){const U=Je(v.num_parameters),g={task_id:parseInt(v.task_id),dataset_id:parseInt(v.dataset_id),metrics:{[v.metric_name]:v.metric_value},best_metric:v.metric_name};v.model_name&&(g.model_name=v.model_name),H&&v.harness&&(g.harness=v.harness),v.best_rank&&(g.best_rank=parseInt(v.best_rank)),U!=null&&(g.num_parameters=U),b.push({op:"create",data:g})}else if(v.operation==="update"&&v.id){const U={task_id:parseInt(v.task_id),dataset_id:parseInt(v.dataset_id),model_name:v.model_name||void 0,harness:H&&v.harness||null,metrics:{[v.metric_name]:v.metric_value},best_metric:v.metric_name,best_rank:v.best_rank?parseInt(v.best_rank):void 0,num_parameters:Je(v.num_parameters)};b.push({op:"update",evaluation_id:parseInt(v.id),data:U})}}return b.length===0?{submitted:!1}:(await $e({paper_id:parseInt(p),edit_type:"evaluations",proposed_payload:{operations:b}}),{submitted:!0})}let w=!1;for(const b of h)if(b.operation==="delete"&&b.id){w=!0;try{await ca(b.id)}catch(v){if((typeof v=="object"&&v!==null&&"status"in v?v.status:void 0)!==404)throw v;console.log(`Evaluation ${b.id} already deleted or not found`)}}else if(b.operation==="create"){w=!0;const v=z(b.task_id,b.dataset_id),H=Je(b.num_parameters);await da({paper_id:parseInt(p),task_id:parseInt(b.task_id),dataset_id:parseInt(b.dataset_id),model_name:b.model_name||void 0,harness:v&&b.harness||void 0,metrics:{[b.metric_name]:b.metric_value},best_metric:b.metric_name,best_rank:b.best_rank?parseInt(b.best_rank):void 0,num_parameters:H??void 0})}else if(b.operation==="update"&&b.id){w=!0;const v=z(b.task_id,b.dataset_id);await ua(b.id,{task_id:parseInt(b.task_id),dataset_id:parseInt(b.dataset_id),model_name:b.model_name||void 0,harness:v&&b.harness||null,metrics:{[b.metric_name]:b.metric_value},best_metric:b.metric_name,best_rank:b.best_rank?parseInt(b.best_rank):void 0,num_parameters:Je(b.num_parameters)})}return{submitted:w}},onSuccess:p=>{if(l==="pending"){p!=null&&p.submitted?I({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):I({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),o==null||o(),s(!1);return}T.invalidateQueries({queryKey:["paper-arxiv",c]}),T.invalidateQueries({queryKey:["evaluations","paper",r]}),o==null||o(),s(!1)},onError:p=>{var b;const h=p;let w=h.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(h.response)try{const v=JSON.parse(h.response);typeof(v==null?void 0:v.detail)=="string"?w=v.detail:Array.isArray(v==null?void 0:v.detail)&&((b=v.detail[0])!=null&&b.msg)&&(w=v.detail[0].msg)}catch{w=h.response}I({title:l==="pending"?"Could not submit edit":"Could not save evaluations",description:w,variant:"destructive"})}}),te=()=>{C.current=!0,d([...f,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",operation:"create"}])},y=p=>{C.current=!0,f[p].id?d(f.map((w,b)=>b===p?{...w,operation:"delete"}:w)):d(f.filter((w,b)=>b!==p))},k=(p,h,w)=>{C.current=!0,d(f.map((b,v)=>{if(v!==p)return b;const H={...b,[h]:w};return h==="task_id"&&(H.dataset_id="",H.metric_name="",H.harness=""),h==="dataset_id"&&(H.metric_name="",w&&!z(H.task_id,w)&&(H.harness="")),b.operation==="unchanged"&&(H.operation="update"),H}))},E=()=>{const p=f.filter(h=>h.operation!=="delete"||h.id);M.mutate({paperId:r,evaluations:p})};return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Evaluation Results"}),e.jsx(ge,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),l==="pending"&&e.jsx(Me,{isAuthor:a}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[f.filter(p=>p.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 min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",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 min-w-[140px]",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:f.map((p,h)=>{if(p.operation==="delete")return null;const w=j.get(p.task_id),b=P.get(p.dataset_id),v=Q(p.task_id,p.dataset_id,p.metric_name),H=!!(p.task_id&&p.dataset_id)&&$.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(ms,{value:p.task_id,onChange:U=>k(h,"task_id",U),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:w?{value:w.id,label:w.name}:null,queryKey:["eval-edit-task-search"],queryFn:m,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ms,{value:p.dataset_id,onChange:U=>k(h,"dataset_id",U),placeholder:p.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:p.task_id?"No datasets found for this task.":"Select a task first.",disabled:!p.task_id,selectedOption:b?{value:b.id,label:b.name}:null,queryKey:["eval-edit-dataset-search",p.task_id],queryFn:N(p.task_id),enabled:t&&!!p.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(le,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:p.model_name,onChange:U=>k(h,"model_name",U.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:z(p.task_id,p.dataset_id)?e.jsx(le,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:p.harness,onChange:U=>k(h,"harness",U.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!p.task_id||!p.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):H?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(oe,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):v.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:p.metric_name,onChange:U=>k(h,"metric_name",U.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),v.map(U=>e.jsx("option",{value:U.value,children:U.label},U.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(le,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:p.metric_value,onChange:U=>k(h,"metric_value",U.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(le,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:p.num_parameters,onChange:U=>k(h,"num_parameters",U.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(V,{variant:"ghost",size:"sm",onClick:()=>y(h),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(Nt,{className:"w-4 h-4"})})})]},h)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(va,{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(V,{variant:"outline",size:"sm",onClick:te,className:"flex items-center space-x-2",children:[e.jsx(_t,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:E,disabled:M.isPending,children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function ti({open:t,onOpenChange:s,sectionLabel:r,returnTo:c}){return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-md",children:[e.jsxs(fe,{children:[e.jsxs(he,{children:["Sign in to edit ",r]}),e.jsx(ge,{children:"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(zr,{returnTo:c})})]})})}const De=["my-bookmark-ids"];function si(){var c,n;const{user:t}=rt(),s=ie({queryKey:De,queryFn:()=>tt.getMyBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),r=jt.useMemo(()=>{var o;return new Set(((o=s.data)==null?void 0:o.paper_ids)??[])},[(c=s.data)==null?void 0:c.paper_ids]);return{ids:((n=s.data)==null?void 0:n.paper_ids)??[],idSet:r,isLoading:s.isLoading,isError:s.isError}}function ri(){const{user:t}=rt(),s=ke(),r=Ce({mutationFn:async({paperId:n,isBookmarked:o})=>{o?await tt.removeBookmark(n):await tt.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:o})=>{await s.cancelQueries({queryKey:De});const l=s.getQueryData(De),a=typeof n=="string"?Number(n):n,f=(l==null?void 0:l.paper_ids)??[],d=o?f.filter(j=>j!==a):[a,...f.filter(j=>j!==a)];return s.setQueryData(De,{paper_ids:d}),{previous:l}},onError:(n,o,l)=>{l!=null&&l.previous&&s.setQueryData(De,l.previous)},onSettled:()=>{s.invalidateQueries({queryKey:De}),s.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:jt.useCallback((n,o)=>{if(!t){if(ks())return;const l=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=ws(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(l)}`);return}r.mutate({paperId:n,isBookmarked:o})},[r,t]),isPending:r.isPending}}const ai=({paperId:t})=>{const{user:s}=rt(),{idSet:r}=si(),{toggle:c,isPending:n}=ri();if(ks())return null;const o=Number(t),l=!!s&&r.has(o),a=()=>{Number.isFinite(o)&&c(o,l)},f=s&&l?"Saved":"Save",d=s?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:a,disabled:n,"aria-pressed":l,"aria-label":d,title:d,children:[e.jsx(re,{name:"bookmark",size:12}),f]})};function Ye({children:t,showEdit:s=!1,onEdit:r,editAriaLabel:c}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:r,"aria-label":c,children:"edit"})]}):t}const ni={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","source-url":"source URL"},Ze=360,ft=3;function fs(t){if(!t)return"β€”";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"β€”"}}function hs(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function et(t,s){try{const r=new URL(t),n=r.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):r.hostname.replace(/^www\./,"")}catch{return s}}const ki=()=>{var Ht,zt,Qt,Vt,Wt,Gt,Xt,Jt,Yt,Zt,es,ts;const{arxivId:t}=Qr(),s=Vr(),{toast:r}=we(),{user:c}=rt(),n=(c==null?void 0:c.is_admin)??!1,o=!!c,l=!0,{data:a,isLoading:f,error:d,refetch:j}=ha(t||"",!!t),[x,P]=i.useState(!1);i.useEffect(()=>{if(P(!1),!(a!=null&&a.id))return;const u=window.setTimeout(()=>P(!0),0);return()=>window.clearTimeout(u)},[a==null?void 0:a.id]);const{data:_,isLoading:T}=_a(x?a==null?void 0:a.arxiv_id:void 0),{data:I,isLoading:L}=ba(a==null?void 0:a.id,x&&!!(a!=null&&a.id)),C=i.useMemo(()=>({models:(a==null?void 0:a.hf_models)??[],datasets:(a==null?void 0:a.hf_datasets)??[],spaces:(a==null?void 0:a.hf_spaces)??[]}),[a==null?void 0:a.hf_models,a==null?void 0:a.hf_datasets,a==null?void 0:a.hf_spaces]),R=i.useMemo(()=>{if(!I)return[];const u=new Map;for(const A of I){const G=A.task_id,se=u.get(G);se?se.rows.push(A):u.set(G,{taskId:G,taskName:A.task_name||"β€”",taskSlug:A.task_slug,rows:[A]})}return Array.from(u.values())},[I]),O=ie({queryKey:["paper-versions",a==null?void 0:a.arxiv_id],queryFn:async()=>{const u=a.arxiv_id.replace(/v\d+$/,""),A=await fetch(ws(`/api/v1/papers/arxiv/${u}/versions`));return A.ok?await A.json():[]},enabled:x&&!!(a!=null&&a.arxiv_id),staleTime:10*60*1e3}),D=ie({queryKey:["related-papers",(zt=(Ht=a==null?void 0:a.tasks)==null?void 0:Ht[0])==null?void 0:zt.id],queryFn:()=>tt.getTaskPapers(a.tasks[0].id,{page:1,page_size:5,order_by:"citation_count",order_dir:"desc",include_resources:!1}),enabled:x&&!!((Vt=(Qt=a==null?void 0:a.tasks)==null?void 0:Qt[0])!=null&&Vt.id),staleTime:10*60*1e3,select:u=>u.results.filter(A=>A.id!==(a==null?void 0:a.id)).slice(0,4)}),[$,m]=i.useState(!1),[N,z]=i.useState(!1),[Q,M]=i.useState(!1),{isEditingTasks:te,setIsEditingTasks:y,isEditingMethods:k,setIsEditingMethods:E,isEditingRepositories:p,setIsEditingRepositories:h,isEditingProjectPages:w,setIsEditingProjectPages:b,isEditingEvaluations:v,setIsEditingEvaluations:H,isEditingSourceUrl:U,setIsEditingSourceUrl:g}=Na(),[F,q]=i.useState(null),S=i.useMemo(()=>{if(!c||!(a!=null&&a.author_links))return!1;const u=c.username.toLowerCase();return a.author_links.some(A=>!!A.hf_username&&A.hf_username.toLowerCase()===u)},[c,a==null?void 0:a.author_links]),B=n?"direct":"pending",K=u=>{if(!o){q(u);return}switch(u){case"tasks":y(!0);return;case"methods":E(!0);return;case"results":H(!0);return;case"repositories":h(!0);return;case"project-pages":b(!0);return;case"source-url":g(!0);return}},[Y,W]=i.useState("idle"),[ve,Ft]=i.useState(null),[Tt,$t]=i.useState(null),Sr=async()=>{if(t){W("indexing"),Ft(null),$t(null);try{await pa(t),r({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>j(),1200),W("idle")}catch(u){const A=u;let G=A.message||"Failed to index paper";if(A.response)try{G=JSON.parse(A.response).detail||G}catch{G=A.response}Ft(G),(A.status===429||A.status===503)&&$t("Try again later after arXiv has lifted the temporary limit."),W("idle")}}},{citationDisplay:Pr,citationCopy:Mt}=i.useMemo(()=>{if(!a)return{citationDisplay:"",citationCopy:""};const u=`${a.title.slice(0,60)}${a.title.length>60?"…":""}`,A=`${a.authors[0]||""}${a.authors.length>1?" et al.":""}`,G=a.authors.join(" and "),se=(a.published||"").slice(0,4)||"β€”",ss=(rs,as)=>a.arxiv_id?`@article{${a.arxiv_id.replace(".","")},
41
- title={{${rs}}},
42
- author=${as},
43
- year={{${se}}},
44
- eprint={{${a.arxiv_id}}},
45
- archivePrefix={{arXiv}}
46
- }`:`@misc{paper${a.id},
47
- title={{${rs}}},
48
- author=${as},
49
- year={{${se}}},
50
- url={{${a.source_url||a.url_abs||""}}}
51
- }`;return{citationDisplay:ss(u,`{{${A}}}`),citationCopy:ss(a.title,`{${G}}`)}},[a]),[Rr,Lt]=i.useState(!1),Ar=async()=>{if(Mt)try{await navigator.clipboard.writeText(Mt),Lt(!0),r({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Lt(!1),1500)}catch{r({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}};if(f)return e.jsxs("div",{className:"page",children:[e.jsx(qe,{className:"h-12 w-3/4 mb-4"}),e.jsx(qe,{className:"h-6 w-1/3 mb-8"}),e.jsx(qe,{className:"h-64 w-full"})]});if(d||!a)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(Re,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",t]})]}),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:",t]})," in the database. You can index it from arXiv right now."]}),ve&&e.jsx(ga,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(xa,{children:[e.jsx("div",{children:ve}),Tt&&e.jsx("div",{className:"mt-2",children:Tt})]})}),e.jsxs("div",{className:"action-row",children:[n&&e.jsxs("button",{className:"action-btn",onClick:Sr,disabled:Y==="indexing",children:[e.jsx(re,{name:"sparkle",size:12}),Y==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(V,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});const Ot=O.data||[],ze=fa(a.repositories),ce=[...a.repositories??[]].sort((u,A)=>{const G=u.is_official?1:0,se=A.is_official?1:0;return G!==se?se-G:(A.num_stars||0)-(u.num_stars||0)}),Ir=Q?ce:ce.slice(0,ft),Dr=a.arxiv_id?{isLoading:T,paperHref:`https://huggingface.co/papers/${a.arxiv_id.replace(/v\d+$/,"")}`,rows:[{label:"Models",href:`https://huggingface.co/models?other=arxiv:${a.arxiv_id}`,count:_==null?void 0:_.models,isLimited:_==null?void 0:_.isLimited},{label:"Datasets",href:`https://huggingface.co/datasets?other=arxiv:${a.arxiv_id}`,count:_==null?void 0:_.datasets,isLimited:_==null?void 0:_.isLimited},{label:"Spaces",href:`https://huggingface.co/spaces?other=arxiv:${a.arxiv_id}`,count:_==null?void 0:_.spaces,isLimited:_==null?void 0:_.isLimited}],footer:`Cite arxiv.org/abs/${a.arxiv_id} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:ht(C.models),count:C.models.length,links:C.models.map(u=>({href:u,label:et(u,"Model")}))},{label:"Datasets",href:ht(C.datasets),count:C.datasets.length,links:C.datasets.map(u=>({href:u,label:et(u,"Dataset")}))},{label:"Spaces",href:ht(C.spaces),count:C.spaces.length,links:C.spaces.map(u=>({href:u,label:et(u,"Space")}))}],footer:null},qt=a.tldr||null,Bt=a.num_pages||null,Pe=a.abstract||"",Fr=Pe.length>Ze?Pe.slice(0,Ze)+"…":Pe,Tr=$||Pe.length<=Ze?Pe:Fr,Qe=(a.methods||[]).filter(u=>u.source_paper_id===a.id),Ve=a.introduced_benchmarks||[],$r=Qe.length>0||Ve.length>0,Ut=a.arxiv_id?`arXiv:${a.arxiv_id}`:"External resource",Mr=a.source==="external"?"Source page":"arXiv page",Le=((Wt=a.project_pages)==null?void 0:Wt.filter(u=>u.url))??[],Lr=(()=>{const u=[];return Qe.length>0&&u.push(Qe.length===1?"this method":"these methods"),Ve.length>0&&u.push(Ve.length===1?"this benchmark":"these benchmarks"),u.length===0?"":u.length===1?u[0]:u.join(" and ")})(),We=a.predecessor_papers||[],Ge=a.successor_papers||[],Or=We.length>0||Ge.length>0,Xe=12,lt=a.authors.map((u,A)=>{var G,se;return{name:u,hf_username:((se=(G=a.author_links)==null?void 0:G[A])==null?void 0:se.hf_username)??null}}),Kt=N||lt.length<=Xe?lt:lt.slice(0,Xe);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(Re,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:Ut})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"detail-title",children:e.jsx(ns,{title:a.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:Ut}),e.jsx("span",{children:"Β·"}),e.jsxs("span",{children:["Submitted ",fs(a.published)]}),Bt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Β·"}),e.jsxs("span",{children:[Bt," pages"]})]}),a.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Β·"}),e.jsxs("span",{children:[a.citation_count.toLocaleString()," citations"]})]}),a.proceeding&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Β·"}),e.jsx("span",{children:a.proceeding.replace(/\s+\d{1,2}$/,"")})]}),Ot.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Β·"}),e.jsx("select",{className:"version-select",value:a.version,onChange:u=>{const A=u.target.value;a.arxiv_id&&s(`/paper/${a.arxiv_id.replace(/v\d+$/,"")}${A?`?version=${A}`:""}`)},children:Ot.map(u=>e.jsxs("option",{value:u.version,children:[u.version," β€” ",fs(u.published)]},u.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Kt.map((u,A)=>e.jsxs(jt.Fragment,{children:[u.hf_username?e.jsx("a",{href:`https://huggingface.co/${u.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${u.hf_username} on Hugging Face`,children:u.name}):e.jsx("a",{children:u.name}),A<Kt.length-1?", ":""]},A)),a.authors.length>Xe&&e.jsx("button",{className:"show-more-authors",onClick:()=>z(u=>!u),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:N?"show fewer":`+${a.authors.length-Xe} more`})]}),e.jsxs("div",{className:"action-row",children:[a.url_pdf&&e.jsxs("a",{className:"action-btn",href:a.url_pdf,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(re,{name:"pdf",size:12})," View PDF"]}),a.url_abs&&e.jsx(Ye,{showEdit:a.source==="external"&&l,onEdit:()=>K("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:a.source==="external"&&l?"action-btn-segment action-btn-main":"action-btn",href:a.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(re,{name:"external",size:12})," ",Mr]})}),ze.githubUrl&&e.jsx(Ye,{showEdit:l,onEdit:()=>K("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:ze.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(re,{name:"github",size:12})," Code",ze.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["Β· ",hs(ze.github)," β˜…"]})]})}),Le.length===1?e.jsx(Ye,{showEdit:l,onEdit:()=>K("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Le[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(re,{name:"globe",size:12})," Project page"]})}):null,Le.length>1?e.jsx(Ye,{showEdit:l,onEdit:()=>K("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(Wr,{children:[e.jsx(Gr,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(re,{name:"globe",size:12})," Project page"]})}),e.jsx(Xr,{align:"start",className:"project-page-menu",children:Le.map((u,A)=>e.jsx(Jr,{asChild:!0,children:e.jsx("a",{href:u.url,target:"_blank",rel:"noopener noreferrer",children:et(u.url,`Project page ${A+1}`)})},u.url))})]})}):null,Le.length===0&&o?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>K("project-pages"),title:"Add project page",children:[e.jsx(re,{name:"globe",size:12})," Add project page"]}):null,a.conference_url_abs&&e.jsxs("a",{className:"action-btn",href:a.conference_url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(re,{name:"external",size:12})," Conference"]}),e.jsx(ai,{paperId:a.id})]}),$r&&e.jsxs("div",{className:"introduced-banner",children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Qe.map(u=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${u.slug||u.id}`),children:[u.name,e.jsx("span",{className:"introduced-arrow",children:"β†’"})]},`method-${u.id}`)),Ve.map(u=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${u.slug||u.id}`),children:[u.name,e.jsx("span",{className:"introduced-arrow",children:"β†’"})]},`benchmark-${u.id}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Lr,"."]})]}),Or&&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(u=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${u.route_identifier}`),children:[u.title,e.jsx("span",{className:"introduced-arrow",children:"β†’"})]},`successor-${u.id}`))})]}),We.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:We.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:We.map(u=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${u.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),u.title]},`predecessor-${u.id}`))})]})]}),qt&&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:qt})]}),e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"Abstract"})}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(ta,{text:Tr})}),Pe.length>Ze&&e.jsx("div",{className:"read-full",onClick:()=>m(u=>!u),children:$?"βˆ’ collapse abstract":"+ read full abstract"}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Tasks"}),e.jsxs("span",{className:"accent",children:[((Gt=a.tasks)==null?void 0:Gt.length)||0," tagged",e.jsx("button",{type:"button",onClick:()=>K("tasks"),className:"edit-link",children:"edit"})]})]}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(a.tasks||[]).map(u=>e.jsx(Zr,{slug:u.slug||"",label:u.name},u.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Methods"}),e.jsxs("span",{className:"accent",children:[((Xt=a.methods)==null?void 0:Xt.length)||0," used",e.jsx("button",{type:"button",onClick:()=>K("methods"),className:"edit-link",children:"edit"})]})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(a.methods||[]).map(u=>e.jsx(ea,{method:u},u.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Results"}),e.jsxs("span",{className:"accent",children:[(I==null?void 0:I.length)||0," benchmarks",e.jsx("button",{type:"button",onClick:()=>K("results"),className:"edit-link",children:"edit"})]})]}),L?e.jsx(qe,{className:"h-32 w-full"}):R.length>0?R.map(u=>e.jsxs("div",{children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:u.taskSlug?e.jsx(Re,{to:`/tasks/${u.taskSlug}`,children:u.taskName}):u.taskName}),e.jsxs("span",{className:"accent",children:[u.rows.length," ",u.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:u.rows.map(A=>{var G;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:A.dataset_slug?e.jsx(Re,{to:`/benchmark/${A.dataset_slug}`,children:A.dataset_name||"β€”"}):A.dataset_name||"β€”"}),e.jsx("td",{className:"model",title:A.model_name||void 0,children:A.model_name||"β€”"}),e.jsx("td",{className:"metric",children:A.best_metric}),e.jsx("td",{className:"value",children:Yr((G=A.metrics)==null?void 0:G[A.best_metric||""])}),e.jsx("td",{className:"compare",children:A.dataset_slug&&e.jsx(Re,{to:`/benchmark/${A.dataset_slug}?eval=${encodeURIComponent(A.id)}`,children:"Compare β†’"})})]},A.id)})})]})]},u.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:[(ce.length>0||o)&&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:[ce.length," repo",ce.length===1?"":"s",e.jsx("button",{type:"button",onClick:()=>K("repositories"),className:"edit-link",children:"edit"})]})]}),Ir.map(u=>e.jsxs("a",{href:u.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(re,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[u.owner,"/",u.name]}),u.is_official&&e.jsx("span",{className:"code-line-official",children:"Β· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["β˜… ",hs(u.num_stars)]})]},u.id)),ce.length===0&&o&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),ce.length>ft&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>M(u=>!u),children:Q?"βˆ’ show top 3":`+ show ${ce.length-ft} more repos`})]}),e.jsx(ii,{viewer:Dr}),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:Ar,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(re,{name:"copy",size:11}),Rr?"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:Pr})]}),(((Jt=D.data)==null?void 0:Jt.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),D.data.map(u=>e.jsxs(Re,{to:`/paper/${u.arxiv_id||u.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(ns,{title:u.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:u.arxiv_id?`arXiv:${u.arxiv_id}`:"External resource"}),u.citation_count!=null&&e.jsxs("span",{children:[u.citation_count.toLocaleString()," cites"]})]})]},u.id))]})]})]}),e.jsx(Xa,{open:te,onOpenChange:y,paperId:a.id,arxivId:t,initialTaskIds:((Yt=a.tasks)==null?void 0:Yt.map(u=>parseInt(u.id)))||[],initialTasks:a.tasks||[],submitMode:B,isAuthor:S}),e.jsx(Za,{open:k,onOpenChange:E,paperId:a.id,arxivId:t,initialMethodIds:((Zt=a.methods)==null?void 0:Zt.map(u=>parseInt(u.id)))||[],initialMethods:a.methods||[],submitMode:B,isAuthor:S}),e.jsx(en,{open:p,onOpenChange:h,paperId:a.id,arxivId:t,initialRepositories:((es=a.repositories)==null?void 0:es.map(u=>({url:u.url,is_official:u.is_official||!1})))||[],submitMode:B,isAuthor:S}),e.jsx(tn,{open:w,onOpenChange:b,paperId:a.id,arxivId:t,initialProjectPages:((ts=a.project_pages)==null?void 0:ts.map(u=>({url:u.url,is_official:u.is_official||!1})))||[],submitMode:B,isAuthor:S}),e.jsx(ei,{open:v,onOpenChange:H,paperId:a.id,arxivId:t,initialEvaluations:I||[],submitMode:B,isAuthor:S}),e.jsx(sn,{open:U,onOpenChange:g,paperId:a.id,arxivId:t,initialUrl:a.source_url??a.url_abs??"",submitMode:B,isAuthor:S}),e.jsx(ti,{open:F!==null,onOpenChange:u=>{u||q(null)},sectionLabel:F?ni[F]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})},ii=({viewer:t})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:t.paperHref?e.jsx("a",{href:t.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"πŸ€— Hugging Face"}):e.jsx("span",{children:"πŸ€— Hugging Face"})}),t.isLoading?e.jsx(qe,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[t.rows.map(s=>e.jsx(oi,{...s},s.label)),t.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:t.footer})]})]}),oi=({label:t,href:s,count:r,isLimited:c,links:n})=>{const o=((n==null?void 0:n.length)??0)>0,l=e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:t}),e.jsx("span",{style:{fontWeight:600,color:r?"var(--ink)":"var(--ink-faint)"},children:r!=null?`${r}${c?"+":""}`:"β€”"})]});return o?e.jsxs("div",{className:"hf-artifact-row",children:[l,e.jsx("div",{className:"hf-artifact-links",children:n.map(a=>e.jsx("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",children:a.label},a.href))})]}):e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-row",children:l})};function ht(t){return t[0]??"https://huggingface.co"}export{ki as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/{PapersListView-CWOVdrmK.js β†’ PapersListView-B62Ept_9.js} RENAMED
@@ -1 +1 @@
1
- import{u as I,r as i,j as e,L as F}from"./index-CHlNDaV5.js";import{I as L,P as T}from"./components-CqXuLvpo.js";import{a as C}from"./api-DKZpnF8C.js";import{a as R,d as k}from"./transform-LfD9F8SD.js";import{u as D}from"./usePapers-Dho-obLV.js";import{u as E}from"./useDebounce-Bq-Dgz1-.js";import{u as O,P as B}from"./usePeriodFilter-F1Py9_Wb.js";import{u as $}from"./useIntersectionObserver-j3afnyyN.js";import{S as c}from"./skeleton-CIY9g4PX.js";import{A as z,a as M}from"./alert-BjKDOipI.js";import{u as q}from"./useQuery-qKfgFU9t.js";import"./LatexTitle-B3XSDdDB.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DYjz2HCv.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-C6O8_a1-.js";import{I as L,P as T}from"./components-CMH89RDy.js";import{a as C}from"./api-DLAvdHPg.js";import{a as R,d as k}from"./transform-D_Izdf89.js";import{u as D}from"./usePapers-CwnyeI7c.js";import{u as E}from"./useDebounce-BhnwRhGk.js";import{u as O,P as B}from"./usePeriodFilter-BrbWqy5G.js";import{u as $}from"./useIntersectionObserver-CkOYzKe_.js";import{S as c}from"./skeleton-D8Wtx_Nu.js";import{A as z,a as M}from"./alert-MNWNJkBv.js";import{u as q}from"./useQuery-Cvv958Kx.js";import"./LatexTitle-CcMIi9G1.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-Dd12EyZd.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-BFPe0goC.js β†’ SavedPapersView-BVm6geTt.js} RENAMED
@@ -1 +1 @@
1
- import{x as o,j as s,H as m,L as p}from"./index-CHlNDaV5.js";import{u as h}from"./useQuery-qKfgFU9t.js";import{T as x,P as u}from"./components-CqXuLvpo.js";import{S as r}from"./skeleton-CIY9g4PX.js";import{A as j,a as v}from"./alert-BjKDOipI.js";import{a as N}from"./api-DKZpnF8C.js";import{a as g}from"./transform-LfD9F8SD.js";import"./LatexTitle-B3XSDdDB.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{x as o,j as s,H as m,L as p}from"./index-C6O8_a1-.js";import{u as h}from"./useQuery-Cvv958Kx.js";import{T as x,P as u}from"./components-CMH89RDy.js";import{S as r}from"./skeleton-D8Wtx_Nu.js";import{A as j,a as v}from"./alert-MNWNJkBv.js";import{a as N}from"./api-DLAvdHPg.js";import{a as g}from"./transform-D_Izdf89.js";import"./LatexTitle-CcMIi9G1.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-TODlHbiO.js β†’ SearchOverlay-BUaZzPoI.js} RENAMED
@@ -1 +1 @@
1
- import{r as f,G as w,y as E,j as s}from"./index-CHlNDaV5.js";import{u as d}from"./useQuery-qKfgFU9t.js";import{L as Q}from"./LatexTitle-B3XSDdDB.js";import{a as u}from"./api-DKZpnF8C.js";import{u as C}from"./useDebounce-Bq-Dgz1-.js";import{f as L,h as R,d as K}from"./transform-LfD9F8SD.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};
 
1
+ import{r as f,G as w,y as E,j as s}from"./index-C6O8_a1-.js";import{u as d}from"./useQuery-Cvv958Kx.js";import{L as Q}from"./LatexTitle-CcMIi9G1.js";import{a as u}from"./api-DLAvdHPg.js";import{u as C}from"./useDebounce-BhnwRhGk.js";import{f as L,h as R,d as K}from"./transform-D_Izdf89.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/SubmissionsDashboard-CGUCxt6x.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as Z,j as e,y as x,h as v,x as ee,q as G,p as se,Y as ie,Z as te,_ as ne}from"./index-C6O8_a1-.js";import{u as F}from"./useQueries-BhLiWt7J.js";import{u as O}from"./useQuery-Cvv958Kx.js";import{u as B}from"./useMutation-DLRmDXLC.js";import{q as W,r as re,t as ae,v as oe,w as le,x as ce,y as P}from"./api-DLAvdHPg.js";import{R as de,C as ue,a as me}from"./refresh-cw-CcA4286O.js";import{L as A}from"./loader-circle-DK8Ui2RE.js";import"./adminAuth-PI_XkM8E.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 fe=Z("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
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 pe=Z("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),y=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},H=s=>Array.isArray(s)?s.map(i=>{const n=y(i),o=Number(n.id);return Number.isFinite(o)?{id:o,name:typeof n.name=="string"?n.name:`#${o}`,slug:typeof n.slug=="string"?n.slug:void 0}:null}).filter(i=>!!i):[],J=s=>Array.isArray(s)?s.map(Number).filter(i=>Number.isFinite(i)):[],C=s=>Array.isArray(s)?s.map(i=>{const n=y(i);return typeof n.url!="string"?null:{url:n.url,is_official:!!n.is_official}}).filter(i=>!!i):[],he=s=>Array.isArray(s)?s.map(i=>y(i)):[],je=s=>Array.isArray(s)?s.map(i=>y(i)):[],xe=s=>s.replace(/_/g," ");function ge({currentPayload:s,proposedPayload:i}){const[n,o]=x.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>o(r=>!r),children:n?"Hide raw JSON":"Show raw JSON"}),n&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(T,{title:"Current payload",value:s??{}}),e.jsx(T,{title:"Proposed payload",value:i})]})]})}function T({title:s,value:i}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(i,null,2)})]})}function V({currentItems:s,proposedIds:i,queryPrefix:n,fetchEntity:o}){const r=x.useMemo(()=>Array.from(new Set([...s.map(a=>a.id),...i])).sort((a,l)=>a-l),[s,i]),c=F({queries:r.map(a=>({queryKey:[n,String(a)],queryFn:()=>o(String(a)),staleTime:5*60*1e3}))}),u=x.useMemo(()=>{const a=new Map;return s.forEach(l=>a.set(l.id,l.name)),c.forEach(l=>{const h=l.data;if(!h)return;const f=Number(h.id);Number.isFinite(f)&&a.set(f,h.name)}),a},[s,c]),p=new Set(s.map(a=>a.id)),m=new Set(i),b=r.filter(a=>p.has(a)&&!m.has(a)),g=r.filter(a=>!p.has(a)&&m.has(a)),t=(a,l)=>{const h=l==="current"&&b.includes(a),f=l==="proposed"&&g.includes(a);return e.jsx("span",{className:v("submission-diff-pill",h&&"removed",f&&"added"),children:u.get(a)??`#${a}`},a)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Currently tagged",children:s.length>0?s.map(a=>t(a.id,"current")):e.jsx(k,{children:"No current tags"})}),e.jsx(R,{title:"Will be tagged",children:i.length>0?i.map(a=>t(a,"proposed")):e.jsx(k,{children:"No proposed tags"})})]})}function U({label:s,currentItems:i,proposedItems:n}){const o=new Map(i.map(u=>[u.url,u])),r=new Map(n.map(u=>[u.url,u])),c=Array.from(new Set([...o.keys(),...r.keys()])).sort();return c.length===0?e.jsxs(k,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:c.map(u=>{var a;const p=o.get(u),m=r.get(u),b=!p&&m,g=p&&!m,t=p&&m&&p.is_official!==m.is_official;return e.jsx("div",{className:v("submission-url-row",b&&"added",g&&"removed",t&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:v("submission-url-link",g&&"removed"),children:u}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),g&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),t&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(p.is_official)," ","->"," ",String(m.is_official)]}),((a=m??p)==null?void 0:a.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},u)})})}function be({currentPayload:s,proposedPayload:i}){const n=he(y(s).evaluations),o=je(i.operations),r=x.useMemo(()=>{const t=new Set;return n.forEach(a=>{a.task_id&&t.add(Number(a.task_id))}),o.forEach(a=>{const l=a.data;l!=null&&l.task_id&&t.add(Number(l.task_id))}),Array.from(t).filter(a=>Number.isFinite(a))},[n,o]),c=x.useMemo(()=>{const t=new Set;return n.forEach(a=>{a.dataset_id&&t.add(Number(a.dataset_id))}),o.forEach(a=>{const l=a.data;l!=null&&l.dataset_id&&t.add(Number(l.dataset_id))}),Array.from(t).filter(a=>Number.isFinite(a))},[n,o]),u=F({queries:r.map(t=>({queryKey:["task",String(t)],queryFn:()=>W(String(t)),staleTime:5*60*1e3}))}),p=F({queries:c.map(t=>({queryKey:["dataset",String(t)],queryFn:()=>ae(String(t)),staleTime:5*60*1e3}))}),m=x.useMemo(()=>{const t=new Map;return u.forEach(a=>{const l=a.data;if(!l)return;const h=Number(l.id);Number.isFinite(h)&&t.set(h,l.name)}),t},[u]),b=x.useMemo(()=>{const t=new Map;return p.forEach(a=>{const l=a.data;if(!l)return;const h=Number(l.id);Number.isFinite(h)&&t.set(h,l.name)}),t},[p]),g=new Map(n.filter(t=>t.id!=null).map(t=>[Number(t.id),t]));return o.length===0?e.jsx(k,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:o.map((t,a)=>{const l=t.evaluation_id?g.get(t.evaluation_id):void 0,f=(t.op==="update"?{...l,...t.data}:t.data??l)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:v("submission-pill status",t.op==="create"&&"approved",t.op==="update"&&"changed",t.op==="delete"&&"rejected"),children:t.op??"unknown"}),t.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",t.evaluation_id]})]}),t.op&&["create","update","delete"].includes(t.op)?e.jsx(Ne,{evaluation:f,taskNames:m,datasetNames:b}):e.jsx(T,{title:"Unsupported operation",value:t})]},`${t.op}-${t.evaluation_id??a}`)})})}function Ne({evaluation:s,taskNames:i,datasetNames:n}){const o=s.task_id?Number(s.task_id):void 0,r=s.dataset_id?Number(s.dataset_id):void 0,c=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(S,{label:"Task",value:o?i.get(o)??`#${o}`:null}),e.jsx(S,{label:"Dataset",value:r?n.get(r)??`#${r}`:null}),e.jsx(S,{label:"Model",value:s.model_name||null}),e.jsx(S,{label:"Harness",value:s.harness||null}),e.jsx(S,{label:"Best rank",value:s.best_rank??null}),e.jsx(S,{label:"Parameters",value:s.num_parameters??null}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(c).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(c).map(([u,p])=>e.jsxs("span",{className:"submission-metric-pill",children:[u,": ",String(p)]},u))}):e.jsx(k,{children:"No metrics"})]})]})}function S({label:s,value:i}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:i??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ve({currentPayload:s,proposedPayload:i}){const n=y(s).source_url,o=i.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Current source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(k,{children:"No current URL"})}),e.jsx(R,{title:"Proposed source URL",children:typeof o=="string"&&o?e.jsx("a",{className:"submission-url-link",href:o,target:"_blank",rel:"noopener noreferrer",children:o}):e.jsx(k,{children:"No proposed URL"})})]})}function R({title:s,children:i}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:i})]})}function k({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ye({currentPayload:s,proposedPayload:i}){const n=y(s),o=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:o.map(({key:r,label:c})=>{const u=Array.isArray(n[r])?n[r].filter(m=>typeof m=="string"):[],p=Array.isArray(i[r])?i[r].filter(m=>typeof m=="string"):[];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:c}),e.jsx(U,{label:c.toLowerCase(),currentItems:u.map(m=>({url:m,is_official:!1})),proposedItems:p.map(m=>({url:m,is_official:!1}))})]},r)})})}function _e({editType:s,currentPayload:i,proposedPayload:n}){const o=y(i);let r;return s==="tasks"?r=e.jsx(V,{currentItems:H(o.tasks),proposedIds:J(n.task_ids),queryPrefix:"task",fetchEntity:W}):s==="methods"?r=e.jsx(V,{currentItems:H(o.methods),proposedIds:J(n.method_ids),queryPrefix:"method",fetchEntity:re}):s==="repositories"?r=e.jsx(U,{label:"repositories",currentItems:C(o.repositories),proposedItems:C(n.repositories)}):s==="project_pages"?r=e.jsx(U,{label:"project pages",currentItems:C(o.project_pages),proposedItems:C(n.project_pages)}):s==="evaluations"?r=e.jsx(be,{currentPayload:i,proposedPayload:n}):s==="source_url"?r=e.jsx(ve,{currentPayload:i,proposedPayload:n}):s==="hf_artifacts"?r=e.jsx(ye,{currentPayload:i,proposedPayload:n}):r=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",xe(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[r,e.jsx(ge,{currentPayload:i,proposedPayload:n})]})}const I=25,ke=["pending","approved","rejected","all"],Se=["all","tasks","methods","evaluations","repositories","project_pages","source_url"],D=["pending","approved","rejected"];function we(s){return s.slice(0,2).toUpperCase()}function M(s){return s.replace(/_/g," ")}function Y(s){if(!s)return"unknown time";const i=new Date(s);if(Number.isNaN(i.getTime()))return s;const n=Date.now()-i.getTime(),o=Math.floor(n/6e4),r=Math.floor(n/36e5),c=Math.floor(n/864e5);return o<1?"just now":o<60?`${o}m ago`:r<24?`${r}h ago`:c<14?`${c}d ago`:i.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function L(s,i){var o;const n=s;if(n.response)try{const r=JSON.parse(n.response);if(typeof(r==null?void 0:r.detail)=="string")return r.detail;if(Array.isArray(r==null?void 0:r.detail)&&((o=r.detail[0])!=null&&o.msg))return r.detail[0].msg}catch{return n.response}return n.message||i}function Ae(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function Ee(s,i){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(i)}function Ce(s){return[...s].sort((i,n)=>new Date(n.created_at).getTime()-new Date(i.created_at).getTime())}async function Me(s,i,n){const o=i==="all"?void 0:i;if(s!=="all")return P({status:s,edit_type:o,limit:n,offset:0});const r=await Promise.all(D.map(c=>P({status:c,edit_type:o,limit:n,offset:0})));return{count:r.reduce((c,u)=>c+u.count,0),results:Ce(r.flatMap(c=>c.results)).slice(0,n)}}function Fe(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(pe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function Re(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(A,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function qe({submission:s,paper:i}){const[n,o]=x.useState(s.admin_note??""),r=se(),{toast:c}=G(),u=Ee(i,s.paper_id),p=(i==null?void 0:i.title)||`Paper #${s.paper_id}`,m=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,b=s.status==="pending";x.useEffect(()=>{o(s.admin_note??"")},[s.admin_note,s.id]);const g=x.useCallback(j=>{r.invalidateQueries({queryKey:["pendingPaperEdits"]}),r.invalidateQueries({queryKey:["pendingPaperEdit",j.id]}),r.invalidateQueries({queryKey:["paper",String(j.paper_id)]}),r.invalidateQueries({queryKey:["paper-summary",String(j.paper_id)]}),i!=null&&i.arxiv_id&&r.invalidateQueries({queryKey:["paper-arxiv",i.arxiv_id]}),j.edit_type==="evaluations"&&r.invalidateQueries({queryKey:["evaluations","paper",String(j.paper_id)]})},[i==null?void 0:i.arxiv_id,r]),t=B({mutationFn:()=>le(s.id,{admin_note:n.trim()||void 0}),onSuccess:j=>{g(j),c({title:"Submission approved",description:`Applied ${M(s.edit_type)} changes for ${p}.`})},onError:j=>{c({title:"Could not approve submission",description:L(j,"Approval failed. Please try again."),variant:"destructive"})}}),a=B({mutationFn:()=>ce(s.id,{admin_note:n.trim()||void 0}),onSuccess:j=>{g(j),c({title:"Submission rejected",description:`Rejected ${M(s.edit_type)} changes for ${p}.`})},onError:j=>{c({title:"Could not reject submission",description:L(j,"Rejection failed. Please try again."),variant:"destructive"})}}),l=t.isPending,h=a.isPending,f=l||h;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[e.jsx("a",{href:`/paper/${encodeURIComponent(u)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsxs("span",{children:["Paper #",s.paper_id]}),e.jsx("span",{children:Y(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:M(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:v("submission-pill status",Ae(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(ie,{className:"h-6 w-6",children:[e.jsx(te,{src:m,alt:s.hf_username}),e.jsx(ne,{className:"text-[10px]",children:we(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(_e,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:b?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:n,onChange:j=>o(j.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:f}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>a.mutate(),disabled:f,className:"submission-action-btn reject",children:[h?e.jsx(A,{className:"spin",size:14}):e.jsx(ue,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>t.mutate(),disabled:f,className:"submission-action-btn approve",children:[l?e.jsx(A,{className:"spin",size:14}):e.jsx(me,{size:14}),"Approve"]})]})]}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${Y(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]})]})})]})}function ze(){var Q,z,K;const{user:s,isLoading:i}=ee(),{toast:n}=G(),[o,r]=x.useState("pending"),[c,u]=x.useState("all"),[p,m]=x.useState(I),b=!!(s!=null&&s.is_admin);x.useEffect(()=>{m(I)},[o,c]);const g=O({queryKey:["pendingPaperEdits","counts",c],queryFn:async()=>{const d=c==="all"?void 0:c,_=await Promise.all(D.map(N=>P({status:N,edit_type:d,limit:1,offset:0})));return Object.fromEntries(_.map((N,E)=>[D[E],N.count]))},enabled:b,staleTime:30*1e3}),t=O({queryKey:["pendingPaperEdits",{status:o,editType:c,visibleLimit:p}],queryFn:()=>Me(o,c,p),enabled:b,retry:!1}),a=x.useMemo(()=>{var d;return Array.from(new Set((((d=t.data)==null?void 0:d.results)??[]).map(_=>_.paper_id))).sort((_,N)=>_-N)},[(Q=t.data)==null?void 0:Q.results]),l=F({queries:a.map(d=>({queryKey:["paper-summary",String(d)],queryFn:()=>oe(String(d),!1),enabled:b,staleTime:5*60*1e3}))}),h=x.useMemo(()=>{const d=new Map;return l.forEach(_=>{const N=_.data;if(!N)return;const E=Number(N.id);Number.isFinite(E)&&d.set(E,N)}),d},[l]);if(x.useEffect(()=>{t.error&&n({title:"Could not load submissions",description:L(t.error,"Failed to load pending paper edits."),variant:"destructive"})},[t.error,n]),i)return e.jsx(Re,{});if(!b)return e.jsx(Fe,{});const f=g.data,j=f?f.pending+f.approved+f.rejected:void 0,$={pending:f==null?void 0:f.pending,approved:f==null?void 0:f.approved,rejected:f==null?void 0:f.rejected,all:j},w=((z=t.data)==null?void 0:z.results)??[],q=((K=t.data)==null?void 0:K.count)??0,X=w.length<q;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{g.refetch(),t.refetch()},disabled:t.isFetching||g.isFetching,children:[e.jsx(de,{className:v((t.isFetching||g.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:ke.map(d=>e.jsxs("button",{type:"button",className:v("period-btn",o===d&&"active"),onClick:()=>r(d),children:[d,$[d]!=null&&e.jsx("span",{className:"submission-count",children:$[d]})]},d))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:Se.map(d=>e.jsx("button",{type:"button",className:v("sort-btn",c===d&&"active"),onClick:()=>u(d),children:M(d)},d))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:t.isFetching?"refreshing":`${q} submissions`})})})}),t.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(A,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):w.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(fe,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:w.map(d=>e.jsx(qe,{submission:d,paper:h.get(d.paper_id)},d.id))}),w.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",w.length," of ",q," submissions"]}),X&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(d=>d+I),disabled:t.isFetching,children:[t.isFetching&&e.jsx(A,{className:"spin",size:14}),"Load more"]})]})]})]})}export{ze as default};
assets/SubmissionsDashboard-DOSmJN_y.js DELETED
@@ -1,11 +0,0 @@
1
- import{c as Z,j as e,y as j,h as v,x as ee,q as G,p as se,Y as ie,Z as te,_ as ne}from"./index-CHlNDaV5.js";import{u as F}from"./useQueries-B_KNu0Lj.js";import{u as K}from"./useQuery-qKfgFU9t.js";import{u as O}from"./useMutation-DBjQd2jo.js";import{p as W,q as re,r as ae,t as oe,v as le,w as ce,x as P}from"./api-DKZpnF8C.js";import{R as de,C as ue,a as me}from"./refresh-cw-W_Rmqupv.js";import{L as E}from"./loader-circle-DCD7IUZw.js";import"./adminAuth-PI_XkM8E.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 pe=Z("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
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 fe=Z("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),k=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},B=s=>Array.isArray(s)?s.map(i=>{const n=k(i),a=Number(n.id);return Number.isFinite(a)?{id:a,name:typeof n.name=="string"?n.name:`#${a}`,slug:typeof n.slug=="string"?n.slug:void 0}:null}).filter(i=>!!i):[],J=s=>Array.isArray(s)?s.map(Number).filter(i=>Number.isFinite(i)):[],C=s=>Array.isArray(s)?s.map(i=>{const n=k(i);return typeof n.url!="string"?null:{url:n.url,is_official:!!n.is_official}}).filter(i=>!!i):[],he=s=>Array.isArray(s)?s.map(i=>k(i)):[],je=s=>Array.isArray(s)?s.map(i=>k(i)):[],xe=s=>s.replace(/_/g," ");function ge({currentPayload:s,proposedPayload:i}){const[n,a]=j.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>a(o=>!o),children:n?"Hide raw JSON":"Show raw JSON"}),n&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(T,{title:"Current payload",value:s??{}}),e.jsx(T,{title:"Proposed payload",value:i})]})]})}function T({title:s,value:i}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(i,null,2)})]})}function H({currentItems:s,proposedIds:i,queryPrefix:n,fetchEntity:a}){const o=j.useMemo(()=>Array.from(new Set([...s.map(r=>r.id),...i])).sort((r,l)=>r-l),[s,i]),c=F({queries:o.map(r=>({queryKey:[n,String(r)],queryFn:()=>a(String(r)),staleTime:5*60*1e3}))}),u=j.useMemo(()=>{const r=new Map;return s.forEach(l=>r.set(l.id,l.name)),c.forEach(l=>{const f=l.data;if(!f)return;const m=Number(f.id);Number.isFinite(m)&&r.set(m,f.name)}),r},[s,c]),p=new Set(s.map(r=>r.id)),x=new Set(i),b=o.filter(r=>p.has(r)&&!x.has(r)),g=o.filter(r=>!p.has(r)&&x.has(r)),t=(r,l)=>{const f=l==="current"&&b.includes(r),m=l==="proposed"&&g.includes(r);return e.jsx("span",{className:v("submission-diff-pill",f&&"removed",m&&"added"),children:u.get(r)??`#${r}`},r)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Currently tagged",children:s.length>0?s.map(r=>t(r.id,"current")):e.jsx(_,{children:"No current tags"})}),e.jsx(R,{title:"Will be tagged",children:i.length>0?i.map(r=>t(r,"proposed")):e.jsx(_,{children:"No proposed tags"})})]})}function V({label:s,currentItems:i,proposedItems:n}){const a=new Map(i.map(u=>[u.url,u])),o=new Map(n.map(u=>[u.url,u])),c=Array.from(new Set([...a.keys(),...o.keys()])).sort();return c.length===0?e.jsxs(_,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:c.map(u=>{var r;const p=a.get(u),x=o.get(u),b=!p&&x,g=p&&!x,t=p&&x&&p.is_official!==x.is_official;return e.jsx("div",{className:v("submission-url-row",b&&"added",g&&"removed",t&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:v("submission-url-link",g&&"removed"),children:u}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),g&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),t&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(p.is_official)," ","->"," ",String(x.is_official)]}),((r=x??p)==null?void 0:r.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},u)})})}function be({currentPayload:s,proposedPayload:i}){const n=he(k(s).evaluations),a=je(i.operations),o=j.useMemo(()=>{const t=new Set;return n.forEach(r=>{r.task_id&&t.add(Number(r.task_id))}),a.forEach(r=>{const l=r.data;l!=null&&l.task_id&&t.add(Number(l.task_id))}),Array.from(t).filter(r=>Number.isFinite(r))},[n,a]),c=j.useMemo(()=>{const t=new Set;return n.forEach(r=>{r.dataset_id&&t.add(Number(r.dataset_id))}),a.forEach(r=>{const l=r.data;l!=null&&l.dataset_id&&t.add(Number(l.dataset_id))}),Array.from(t).filter(r=>Number.isFinite(r))},[n,a]),u=F({queries:o.map(t=>({queryKey:["task",String(t)],queryFn:()=>W(String(t)),staleTime:5*60*1e3}))}),p=F({queries:c.map(t=>({queryKey:["dataset",String(t)],queryFn:()=>ae(String(t)),staleTime:5*60*1e3}))}),x=j.useMemo(()=>{const t=new Map;return u.forEach(r=>{const l=r.data;if(!l)return;const f=Number(l.id);Number.isFinite(f)&&t.set(f,l.name)}),t},[u]),b=j.useMemo(()=>{const t=new Map;return p.forEach(r=>{const l=r.data;if(!l)return;const f=Number(l.id);Number.isFinite(f)&&t.set(f,l.name)}),t},[p]),g=new Map(n.filter(t=>t.id!=null).map(t=>[Number(t.id),t]));return a.length===0?e.jsx(_,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:a.map((t,r)=>{const l=t.evaluation_id?g.get(t.evaluation_id):void 0,m=(t.op==="update"?{...l,...t.data}:t.data??l)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:v("submission-pill status",t.op==="create"&&"approved",t.op==="update"&&"changed",t.op==="delete"&&"rejected"),children:t.op??"unknown"}),t.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",t.evaluation_id]})]}),t.op&&["create","update","delete"].includes(t.op)?e.jsx(Ne,{evaluation:m,taskNames:x,datasetNames:b}):e.jsx(T,{title:"Unsupported operation",value:t})]},`${t.op}-${t.evaluation_id??r}`)})})}function Ne({evaluation:s,taskNames:i,datasetNames:n}){const a=s.task_id?Number(s.task_id):void 0,o=s.dataset_id?Number(s.dataset_id):void 0,c=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(S,{label:"Task",value:a?i.get(a)??`#${a}`:null}),e.jsx(S,{label:"Dataset",value:o?n.get(o)??`#${o}`:null}),e.jsx(S,{label:"Model",value:s.model_name||null}),e.jsx(S,{label:"Harness",value:s.harness||null}),e.jsx(S,{label:"Best rank",value:s.best_rank??null}),e.jsx(S,{label:"Parameters",value:s.num_parameters??null}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(c).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(c).map(([u,p])=>e.jsxs("span",{className:"submission-metric-pill",children:[u,": ",String(p)]},u))}):e.jsx(_,{children:"No metrics"})]})]})}function S({label:s,value:i}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:i??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ve({currentPayload:s,proposedPayload:i}){const n=k(s).source_url,a=i.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Current source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(_,{children:"No current URL"})}),e.jsx(R,{title:"Proposed source URL",children:typeof a=="string"&&a?e.jsx("a",{className:"submission-url-link",href:a,target:"_blank",rel:"noopener noreferrer",children:a}):e.jsx(_,{children:"No proposed URL"})})]})}function R({title:s,children:i}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:i})]})}function _({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ye({editType:s,currentPayload:i,proposedPayload:n}){const a=k(i);let o;return s==="tasks"?o=e.jsx(H,{currentItems:B(a.tasks),proposedIds:J(n.task_ids),queryPrefix:"task",fetchEntity:W}):s==="methods"?o=e.jsx(H,{currentItems:B(a.methods),proposedIds:J(n.method_ids),queryPrefix:"method",fetchEntity:re}):s==="repositories"?o=e.jsx(V,{label:"repositories",currentItems:C(a.repositories),proposedItems:C(n.repositories)}):s==="project_pages"?o=e.jsx(V,{label:"project pages",currentItems:C(a.project_pages),proposedItems:C(n.project_pages)}):s==="evaluations"?o=e.jsx(be,{currentPayload:i,proposedPayload:n}):s==="source_url"?o=e.jsx(ve,{currentPayload:i,proposedPayload:n}):o=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",xe(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[o,e.jsx(ge,{currentPayload:i,proposedPayload:n})]})}const I=25,_e=["pending","approved","rejected","all"],ke=["all","tasks","methods","evaluations","repositories","project_pages","source_url"],U=["pending","approved","rejected"];function Se(s){return s.slice(0,2).toUpperCase()}function M(s){return s.replace(/_/g," ")}function Y(s){if(!s)return"unknown time";const i=new Date(s);if(Number.isNaN(i.getTime()))return s;const n=Date.now()-i.getTime(),a=Math.floor(n/6e4),o=Math.floor(n/36e5),c=Math.floor(n/864e5);return a<1?"just now":a<60?`${a}m ago`:o<24?`${o}h ago`:c<14?`${c}d ago`:i.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function $(s,i){var a;const n=s;if(n.response)try{const o=JSON.parse(n.response);if(typeof(o==null?void 0:o.detail)=="string")return o.detail;if(Array.isArray(o==null?void 0:o.detail)&&((a=o.detail[0])!=null&&a.msg))return o.detail[0].msg}catch{return n.response}return n.message||i}function we(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function Ee(s,i){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(i)}function Ae(s){return[...s].sort((i,n)=>new Date(n.created_at).getTime()-new Date(i.created_at).getTime())}async function Ce(s,i,n){const a=i==="all"?void 0:i;if(s!=="all")return P({status:s,edit_type:a,limit:n,offset:0});const o=await Promise.all(U.map(c=>P({status:c,edit_type:a,limit:n,offset:0})));return{count:o.reduce((c,u)=>c+u.count,0),results:Ae(o.flatMap(c=>c.results)).slice(0,n)}}function Me(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(fe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function Fe(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(E,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function Re({submission:s,paper:i}){const[n,a]=j.useState(s.admin_note??""),o=se(),{toast:c}=G(),u=Ee(i,s.paper_id),p=(i==null?void 0:i.title)||`Paper #${s.paper_id}`,x=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,b=s.status==="pending";j.useEffect(()=>{a(s.admin_note??"")},[s.admin_note,s.id]);const g=j.useCallback(h=>{o.invalidateQueries({queryKey:["pendingPaperEdits"]}),o.invalidateQueries({queryKey:["pendingPaperEdit",h.id]}),o.invalidateQueries({queryKey:["paper",String(h.paper_id)]}),o.invalidateQueries({queryKey:["paper-summary",String(h.paper_id)]}),i!=null&&i.arxiv_id&&o.invalidateQueries({queryKey:["paper-arxiv",i.arxiv_id]}),h.edit_type==="evaluations"&&o.invalidateQueries({queryKey:["evaluations","paper",String(h.paper_id)]})},[i==null?void 0:i.arxiv_id,o]),t=O({mutationFn:()=>le(s.id,{admin_note:n.trim()||void 0}),onSuccess:h=>{g(h),c({title:"Submission approved",description:`Applied ${M(s.edit_type)} changes for ${p}.`})},onError:h=>{c({title:"Could not approve submission",description:$(h,"Approval failed. Please try again."),variant:"destructive"})}}),r=O({mutationFn:()=>ce(s.id,{admin_note:n.trim()||void 0}),onSuccess:h=>{g(h),c({title:"Submission rejected",description:`Rejected ${M(s.edit_type)} changes for ${p}.`})},onError:h=>{c({title:"Could not reject submission",description:$(h,"Rejection failed. Please try again."),variant:"destructive"})}}),l=t.isPending,f=r.isPending,m=l||f;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[e.jsx("a",{href:`/paper/${encodeURIComponent(u)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsxs("span",{children:["Paper #",s.paper_id]}),e.jsx("span",{children:Y(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:M(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:v("submission-pill status",we(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(ie,{className:"h-6 w-6",children:[e.jsx(te,{src:x,alt:s.hf_username}),e.jsx(ne,{className:"text-[10px]",children:Se(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(ye,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:b?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:n,onChange:h=>a(h.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:m}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>r.mutate(),disabled:m,className:"submission-action-btn reject",children:[f?e.jsx(E,{className:"spin",size:14}):e.jsx(ue,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>t.mutate(),disabled:m,className:"submission-action-btn approve",children:[l?e.jsx(E,{className:"spin",size:14}):e.jsx(me,{size:14}),"Approve"]})]})]}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${Y(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]})]})})]})}function Qe(){var D,Q,z;const{user:s,isLoading:i}=ee(),{toast:n}=G(),[a,o]=j.useState("pending"),[c,u]=j.useState("all"),[p,x]=j.useState(I),b=!!(s!=null&&s.is_admin);j.useEffect(()=>{x(I)},[a,c]);const g=K({queryKey:["pendingPaperEdits","counts",c],queryFn:async()=>{const d=c==="all"?void 0:c,y=await Promise.all(U.map(N=>P({status:N,edit_type:d,limit:1,offset:0})));return Object.fromEntries(y.map((N,A)=>[U[A],N.count]))},enabled:b,staleTime:30*1e3}),t=K({queryKey:["pendingPaperEdits",{status:a,editType:c,visibleLimit:p}],queryFn:()=>Ce(a,c,p),enabled:b,retry:!1}),r=j.useMemo(()=>{var d;return Array.from(new Set((((d=t.data)==null?void 0:d.results)??[]).map(y=>y.paper_id))).sort((y,N)=>y-N)},[(D=t.data)==null?void 0:D.results]),l=F({queries:r.map(d=>({queryKey:["paper-summary",String(d)],queryFn:()=>oe(String(d),!1),enabled:b,staleTime:5*60*1e3}))}),f=j.useMemo(()=>{const d=new Map;return l.forEach(y=>{const N=y.data;if(!N)return;const A=Number(N.id);Number.isFinite(A)&&d.set(A,N)}),d},[l]);if(j.useEffect(()=>{t.error&&n({title:"Could not load submissions",description:$(t.error,"Failed to load pending paper edits."),variant:"destructive"})},[t.error,n]),i)return e.jsx(Fe,{});if(!b)return e.jsx(Me,{});const m=g.data,h=m?m.pending+m.approved+m.rejected:void 0,L={pending:m==null?void 0:m.pending,approved:m==null?void 0:m.approved,rejected:m==null?void 0:m.rejected,all:h},w=((Q=t.data)==null?void 0:Q.results)??[],q=((z=t.data)==null?void 0:z.count)??0,X=w.length<q;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{g.refetch(),t.refetch()},disabled:t.isFetching||g.isFetching,children:[e.jsx(de,{className:v((t.isFetching||g.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:_e.map(d=>e.jsxs("button",{type:"button",className:v("period-btn",a===d&&"active"),onClick:()=>o(d),children:[d,L[d]!=null&&e.jsx("span",{className:"submission-count",children:L[d]})]},d))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:ke.map(d=>e.jsx("button",{type:"button",className:v("sort-btn",c===d&&"active"),onClick:()=>u(d),children:M(d)},d))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:t.isFetching?"refreshing":`${q} submissions`})})})}),t.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(E,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):w.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(pe,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:w.map(d=>e.jsx(Re,{submission:d,paper:f.get(d.paper_id)},d.id))}),w.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",w.length," of ",q," submissions"]}),X&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>x(d=>d+I),disabled:t.isFetching,children:[t.isFetching&&e.jsx(E,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Qe as default};
 
 
 
 
 
 
 
 
 
 
 
 
assets/{SubmitView-D-PvTKkw.js β†’ SubmitView-BXVcNQUx.js} RENAMED
@@ -1 +1 @@
1
- import{r as P,j as e,h as T,G as w,p as D,q as _,y as n}from"./index-CHlNDaV5.js";import{u as C}from"./useMutation-DBjQd2jo.js";import{A as E,a as z}from"./alert-BjKDOipI.js";import{I as m,B as v}from"./input-DtdrXk4E.js";import{o as F}from"./api-DKZpnF8C.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,G as w,p as D,q as _,y as n}from"./index-C6O8_a1-.js";import{u as C}from"./useMutation-DLRmDXLC.js";import{A as E,a as z}from"./alert-MNWNJkBv.js";import{I as m,B as v}from"./input-BMdkOI2Z.js";import{p as F}from"./api-DLAvdHPg.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-Chlvmrkj.js β†’ TagBrowseView-BbO1OnLU.js} RENAMED
@@ -1 +1 @@
1
- import{E as ds,G as os,u as ms,r as h,j as s,L as x,y as hs}from"./index-CHlNDaV5.js";import{u as us}from"./useQueries-B_KNu0Lj.js";import{u as g}from"./useQuery-qKfgFU9t.js";import{P as ps,M as xs}from"./components-CqXuLvpo.js";import{M as J}from"./MarkdownText-C53MS9a3.js";import{a as u}from"./api-DKZpnF8C.js";import{a as gs,d as f}from"./transform-LfD9F8SD.js";import{c as js}from"./usePapers-Dho-obLV.js";import{u as Ns}from"./useIntersectionObserver-j3afnyyN.js";import{S as _}from"./skeleton-CIY9g4PX.js";import{A as ks,a as bs}from"./alert-BjKDOipI.js";import"./LatexTitle-B3XSDdDB.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DYjz2HCv.js";const vs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ys=d=>d==="trending"||d==="date_published"||d==="citation_count"?d:"trending",C=3,w=2,fs=d=>[...d].sort((j,N)=>{const k=j.slug==="classic-language-modeling",b=N.slug==="classic-language-modeling";return k!==b?k?1:-1:0}),$s=()=>{var D,R,$,A,I,K,O,Q,z,U,H,V,G;const{taskSlug:d}=ds(),j=os(),[N,k]=ms(),b=ys(N.get("order_by")),X=e=>{const a=new URLSearchParams(N);a.set("order_by",e),k(a)},[F,Y]=h.useState(!1),[Z,ss]=h.useState(()=>new Set),n=g({queryKey:["task",d],queryFn:()=>u.getTask(d),enabled:!!d,staleTime:10*60*1e3}),es=g({queryKey:["task-parents",(D=n.data)==null?void 0:D.id],queryFn:()=>u.getTaskParents(n.data.id),enabled:!!((R=n.data)!=null&&R.id),staleTime:10*60*1e3}),as=g({queryKey:["task-sisters",($=n.data)==null?void 0:$.area_id,(A=n.data)==null?void 0:A.id],queryFn:()=>u.getTasks({area_id:Number(n.data.area_id),page_size:50,visible_only:!0}),enabled:!!((I=n.data)!=null&&I.area_id),staleTime:10*60*1e3}),B=g({queryKey:["task-children",(K=n.data)==null?void 0:K.id],queryFn:()=>u.getTaskChildren(n.data.id,{page_size:50,visible_only:!0}),enabled:!!((O=n.data)!=null&&O.id),staleTime:10*60*1e3}),v=h.useMemo(()=>{var e;return fs(((e=B.data)==null?void 0:e.results)||[])},[B.data]),ts=g({queryKey:["task-datasets",(Q=n.data)==null?void 0:Q.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(n.data.id),page_size:100,ordering:"-paper_count",min_eval_count:w}),enabled:!!((z=n.data)!=null&&z.id),staleTime:10*60*1e3}),S=us({queries:v.map(e=>({queryKey:["task-datasets",e.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(e.id),page_size:20,ordering:"-paper_count",min_eval_count:w}),staleTime:10*60*1e3}))}),c=js({taskId:((U=n.data)==null?void 0:U.id)||"",page_size:12,order_by:b,order_dir:"desc",include_resources:!0,enabled:!!((H=n.data)!=null&&H.id)}),E=h.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(t=>t.results))||[]).map(gs)},[c.data]),T=h.useMemo(()=>{var a;const e={};return(a=c.data)==null||a.pages.forEach(t=>t.results.forEach(r=>(r.methods||[]).forEach(l=>{const p=l.slug||l.id;e[p]||(e[p]={id:l.id,name:l.name,slug:l.slug||"",count:0}),e[p].count++}))),Object.values(e).sort((t,r)=>r.count-t.count).slice(0,8)},[c.data]),{targetRef:ns,isIntersecting:M}=Ns({rootMargin:"200px"});if(h.useEffect(()=>{M&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[M,c.hasNextPage,c.isFetchingNextPage]),n.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(_,{className:"h-12 w-1/2 mb-4"}),s.jsx(_,{className:"h-6 w-1/3 mb-8"}),s.jsx(_,{className:"h-64 w-full"})]});if(n.error||!n.data)return s.jsx("div",{className:"page",children:s.jsx(ks,{variant:"destructive",children:s.jsx(bs,{children:"Task not found."})})});const i=n.data,y=f(i.name,i.slug),q=(((V=as.data)==null?void 0:V.results)||[]).filter(e=>e.id!==i.id),o=((G=ts.data)==null?void 0:G.results)||[],rs=v.some((e,a)=>{var r,l;return(((l=(r=S[a])==null?void 0:r.data)==null?void 0:l.results)||[]).length>0}),L=o.length>0,is=(()=>{const e=new Set;return o.forEach(a=>e.add(a.id)),S.forEach(a=>{var t;return(((t=a.data)==null?void 0:t.results)||[]).forEach(r=>e.add(r.id))}),e.size})(),cs=e=>{ss(a=>{const t=new Set(a);return t.has(e)?t.delete(e):t.add(e),t})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(x,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(x,{to:"/tasks",children:"Tasks"}),[...es.data||[]].reverse().map(e=>s.jsxs(hs.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(x,{to:`/tasks/${e.slug||e.id}`,children:f(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:i.name.toUpperCase()})]}),s.jsxs("div",{className:i.image_url?"task-hero-grid":void 0,children:[s.jsxs("div",{children:[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:y}),i.description&&s.jsx(J,{className:"task-explainer",text:i.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(i.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:is}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[T.length,"+"]}),"METHODS USED"]})]})]}),i.image_url&&s.jsxs("figure",{className:"task-figure-card",children:[s.jsx("div",{className:"task-figure-img-wrap",children:s.jsx("img",{className:"task-figure-img",src:i.image_url,alt:`${y} schematic`,onError:e=>{var a,t;(t=(a=e.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),s.jsxs("figcaption",{children:["Figure Β· ",y,i.image_credit&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),s.jsx(J,{className:"task-image-credit",text:i.image_credit})]})]})]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[L&&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:["[",o.length,"]"]})]})]}),(F?o:o.slice(0,5)).map((e,a)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(`/benchmark/${e.slug||e.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(a+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)),o.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Y(e=>!e),children:F?"βˆ’ show top 5":`+ show ${o.length-5} more benchmarks`})]}),rs&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:L?{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:["[",v.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:v.map((e,a)=>{var W;const t=S[a],r=((W=t==null?void 0:t.data)==null?void 0:W.results)||[];if(r.length===0)return null;const l=Z.has(e.id),p=l?r:r.slice(0,C),P=r.length-C;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(x,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:f(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",r.length," benchmark",r.length===1?"":"s","]"]})]}),p.map((m,ls)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(`/benchmark/${m.slug||m.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(ls+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:m.name}),s.jsx("div",{className:"bench-row-sub",children:m.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:m.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"β†’"})]},m.id)),P>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>cs(e.id),children:l?`βˆ’ show top ${C}`:`+ show ${P} more benchmark${P===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:["[",(i.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:vs.map(([e,a])=>s.jsx("button",{className:`sort-btn ${b===e?"active":""}`,onClick:()=>X(e),children:a},e))}),s.jsxs("div",{className:"results-count",children:[E.length," loaded in ",s.jsx("span",{children:y})]})]}),c.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,a)=>s.jsx(_,{className:"h-40 w-full"},a))}):E.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:E.map((e,a)=>s.jsx(ps,{paper:e,rank:a+1},e.id))}),s.jsx("div",{ref:ns,style:{height:1}}),c.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),s.jsxs("aside",{className:"task-side",children:[q.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"}),q.slice(0,8).map(e=>s.jsxs(x,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:f(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),T.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"}),T.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(xs,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["Β·",e.count]})]},e.id))]})]})]})]})};export{$s as default};
 
1
+ import{E as ds,G as os,u as ms,r as h,j as s,L as x,y as hs}from"./index-C6O8_a1-.js";import{u as us}from"./useQueries-BhLiWt7J.js";import{u as g}from"./useQuery-Cvv958Kx.js";import{P as ps,M as xs}from"./components-CMH89RDy.js";import{M as J}from"./MarkdownText-p29EEUf7.js";import{a as u}from"./api-DLAvdHPg.js";import{a as gs,d as f}from"./transform-D_Izdf89.js";import{c as js}from"./usePapers-CwnyeI7c.js";import{u as Ns}from"./useIntersectionObserver-CkOYzKe_.js";import{S as _}from"./skeleton-D8Wtx_Nu.js";import{A as ks,a as bs}from"./alert-MNWNJkBv.js";import"./LatexTitle-CcMIi9G1.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-Dd12EyZd.js";const vs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ys=d=>d==="trending"||d==="date_published"||d==="citation_count"?d:"trending",C=3,w=2,fs=d=>[...d].sort((j,N)=>{const k=j.slug==="classic-language-modeling",b=N.slug==="classic-language-modeling";return k!==b?k?1:-1:0}),$s=()=>{var D,R,$,A,I,K,O,Q,z,U,H,V,G;const{taskSlug:d}=ds(),j=os(),[N,k]=ms(),b=ys(N.get("order_by")),X=e=>{const a=new URLSearchParams(N);a.set("order_by",e),k(a)},[F,Y]=h.useState(!1),[Z,ss]=h.useState(()=>new Set),n=g({queryKey:["task",d],queryFn:()=>u.getTask(d),enabled:!!d,staleTime:10*60*1e3}),es=g({queryKey:["task-parents",(D=n.data)==null?void 0:D.id],queryFn:()=>u.getTaskParents(n.data.id),enabled:!!((R=n.data)!=null&&R.id),staleTime:10*60*1e3}),as=g({queryKey:["task-sisters",($=n.data)==null?void 0:$.area_id,(A=n.data)==null?void 0:A.id],queryFn:()=>u.getTasks({area_id:Number(n.data.area_id),page_size:50,visible_only:!0}),enabled:!!((I=n.data)!=null&&I.area_id),staleTime:10*60*1e3}),B=g({queryKey:["task-children",(K=n.data)==null?void 0:K.id],queryFn:()=>u.getTaskChildren(n.data.id,{page_size:50,visible_only:!0}),enabled:!!((O=n.data)!=null&&O.id),staleTime:10*60*1e3}),v=h.useMemo(()=>{var e;return fs(((e=B.data)==null?void 0:e.results)||[])},[B.data]),ts=g({queryKey:["task-datasets",(Q=n.data)==null?void 0:Q.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(n.data.id),page_size:100,ordering:"-paper_count",min_eval_count:w}),enabled:!!((z=n.data)!=null&&z.id),staleTime:10*60*1e3}),S=us({queries:v.map(e=>({queryKey:["task-datasets",e.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(e.id),page_size:20,ordering:"-paper_count",min_eval_count:w}),staleTime:10*60*1e3}))}),c=js({taskId:((U=n.data)==null?void 0:U.id)||"",page_size:12,order_by:b,order_dir:"desc",include_resources:!0,enabled:!!((H=n.data)!=null&&H.id)}),E=h.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(t=>t.results))||[]).map(gs)},[c.data]),T=h.useMemo(()=>{var a;const e={};return(a=c.data)==null||a.pages.forEach(t=>t.results.forEach(r=>(r.methods||[]).forEach(l=>{const p=l.slug||l.id;e[p]||(e[p]={id:l.id,name:l.name,slug:l.slug||"",count:0}),e[p].count++}))),Object.values(e).sort((t,r)=>r.count-t.count).slice(0,8)},[c.data]),{targetRef:ns,isIntersecting:M}=Ns({rootMargin:"200px"});if(h.useEffect(()=>{M&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[M,c.hasNextPage,c.isFetchingNextPage]),n.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(_,{className:"h-12 w-1/2 mb-4"}),s.jsx(_,{className:"h-6 w-1/3 mb-8"}),s.jsx(_,{className:"h-64 w-full"})]});if(n.error||!n.data)return s.jsx("div",{className:"page",children:s.jsx(ks,{variant:"destructive",children:s.jsx(bs,{children:"Task not found."})})});const i=n.data,y=f(i.name,i.slug),q=(((V=as.data)==null?void 0:V.results)||[]).filter(e=>e.id!==i.id),o=((G=ts.data)==null?void 0:G.results)||[],rs=v.some((e,a)=>{var r,l;return(((l=(r=S[a])==null?void 0:r.data)==null?void 0:l.results)||[]).length>0}),L=o.length>0,is=(()=>{const e=new Set;return o.forEach(a=>e.add(a.id)),S.forEach(a=>{var t;return(((t=a.data)==null?void 0:t.results)||[]).forEach(r=>e.add(r.id))}),e.size})(),cs=e=>{ss(a=>{const t=new Set(a);return t.has(e)?t.delete(e):t.add(e),t})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(x,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(x,{to:"/tasks",children:"Tasks"}),[...es.data||[]].reverse().map(e=>s.jsxs(hs.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(x,{to:`/tasks/${e.slug||e.id}`,children:f(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:i.name.toUpperCase()})]}),s.jsxs("div",{className:i.image_url?"task-hero-grid":void 0,children:[s.jsxs("div",{children:[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:y}),i.description&&s.jsx(J,{className:"task-explainer",text:i.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(i.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:is}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[T.length,"+"]}),"METHODS USED"]})]})]}),i.image_url&&s.jsxs("figure",{className:"task-figure-card",children:[s.jsx("div",{className:"task-figure-img-wrap",children:s.jsx("img",{className:"task-figure-img",src:i.image_url,alt:`${y} schematic`,onError:e=>{var a,t;(t=(a=e.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),s.jsxs("figcaption",{children:["Figure Β· ",y,i.image_credit&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),s.jsx(J,{className:"task-image-credit",text:i.image_credit})]})]})]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[L&&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:["[",o.length,"]"]})]})]}),(F?o:o.slice(0,5)).map((e,a)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(`/benchmark/${e.slug||e.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(a+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)),o.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Y(e=>!e),children:F?"βˆ’ show top 5":`+ show ${o.length-5} more benchmarks`})]}),rs&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:L?{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:["[",v.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:v.map((e,a)=>{var W;const t=S[a],r=((W=t==null?void 0:t.data)==null?void 0:W.results)||[];if(r.length===0)return null;const l=Z.has(e.id),p=l?r:r.slice(0,C),P=r.length-C;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(x,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:f(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",r.length," benchmark",r.length===1?"":"s","]"]})]}),p.map((m,ls)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(`/benchmark/${m.slug||m.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(ls+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:m.name}),s.jsx("div",{className:"bench-row-sub",children:m.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:m.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"β†’"})]},m.id)),P>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>cs(e.id),children:l?`βˆ’ show top ${C}`:`+ show ${P} more benchmark${P===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:["[",(i.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:vs.map(([e,a])=>s.jsx("button",{className:`sort-btn ${b===e?"active":""}`,onClick:()=>X(e),children:a},e))}),s.jsxs("div",{className:"results-count",children:[E.length," loaded in ",s.jsx("span",{children:y})]})]}),c.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,a)=>s.jsx(_,{className:"h-40 w-full"},a))}):E.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:E.map((e,a)=>s.jsx(ps,{paper:e,rank:a+1},e.id))}),s.jsx("div",{ref:ns,style:{height:1}}),c.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),s.jsxs("aside",{className:"task-side",children:[q.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"}),q.slice(0,8).map(e=>s.jsxs(x,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:f(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),T.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"}),T.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(xs,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["Β·",e.count]})]},e.id))]})]})]})]})};export{$s as default};
assets/{TagsIndexView-CCySWJDZ.js β†’ TagsIndexView-BCN4pS2z.js} RENAMED
@@ -1 +1 @@
1
- import{r as d,j as e,L as h}from"./index-CHlNDaV5.js";import{u as p}from"./useQuery-qKfgFU9t.js";import{a as g}from"./api-DKZpnF8C.js";import{f as x,h as f,d as u}from"./transform-LfD9F8SD.js";import{S as m}from"./skeleton-CIY9g4PX.js";import{A as j,a as y}from"./alert-BjKDOipI.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-C6O8_a1-.js";import{u as p}from"./useQuery-Cvv958Kx.js";import{a as g}from"./api-DLAvdHPg.js";import{f as x,h as f,d as u}from"./transform-D_Izdf89.js";import{S as m}from"./skeleton-D8Wtx_Nu.js";import{A as j,a as y}from"./alert-MNWNJkBv.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-BjKDOipI.js β†’ alert-MNWNJkBv.js} RENAMED
@@ -1 +1 @@
1
- import{r as a,j as s,h as l,V as i}from"./index-CHlNDaV5.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,V as i}from"./index-C6O8_a1-.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-DKZpnF8C.js DELETED
@@ -1 +0,0 @@
1
- var y=Object.defineProperty;var P=(g,e,t)=>e in g?y(g,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[e]=t;var h=(g,e,t)=>P(g,typeof e!="symbol"?e+"":e,t);import{g as b}from"./adminAuth-PI_XkM8E.js";import{B as _,a9 as k}from"./index-CHlNDaV5.js";const $=`${k()}/api/v1`,f=!1;class q{constructor(e=$){h(this,"baseUrl");this.baseUrl=e}async request(e,t){const i=`${this.baseUrl}${e}`;try{const{headers:o,...d}=t??{},u=b(),S=(d.method??"GET").toUpperCase()==="GET"?"default":"no-store",c=await fetch(i,{...d,cache:d.cache??S,credentials:d.credentials??"include",headers:{"Content-Type":"application/json",...u?{"X-Admin-Token":u}:{},...o}});if(!c.ok){const l=await c.text();console.error("[API] Error response:",l),c.status===401&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"));const r=new Error(`API request failed: ${c.status} ${c.statusText}`);throw r.status=c.status,r.statusText=c.statusText,r.response=l,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 updatePaperSourceUrl(e,t){const i=`/papers/${e}/source-url`;return this.request(i,{method:"PUT",body:JSON.stringify({source_url: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 s=await this.getEvaluations({paper_id:i,page:u,page_size:100,ordering:"-benchmark_popularity"});d.push(...s.results),u=s.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=_(`/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=_(`/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=_("/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 submitPendingPaperEdit(e){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)})}async listPendingPaperEdits(e){const t=new URLSearchParams;e!=null&&e.status&&t.append("status",e.status),e!=null&&e.edit_type&&t.append("edit_type",e.edit_type),e!=null&&e.paper_id&&t.append("paper_id",e.paper_id.toString()),e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.offset&&t.append("offset",e.offset.toString());const i=`/admin/paper-edits${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getPendingPaperEdit(e){return this.request(`/admin/paper-edits/${e}`)}async approvePendingPaperEdit(e,t){return this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t??{})})}async rejectPendingPaperEdit(e,t){return this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t??{})})}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);const z=n.getPaper.bind(n);n.getPaperByArxivId.bind(n);const U=n.indexPaperFromArxiv.bind(n),R=n.submitPaper.bind(n),L=n.updatePaperTasks.bind(n),A=n.updatePaperMethods.bind(n),x=n.updatePaperRepositories.bind(n),M=n.updatePaperProjectPages.bind(n),j=n.updatePaperSourceUrl.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 O=n.getTasks.bind(n),B=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 D=n.getMethods.bind(n),C=n.getMethod.bind(n);n.getMethodPapers.bind(n);const I=n.getDatasets.bind(n),J=n.getDataset.bind(n);n.getDatasetBySlug.bind(n);n.getDatasetTasks.bind(n);const N=n.getLeaderboardMetrics.bind(n);n.getEvaluations.bind(n);n.getEvaluation.bind(n);const F=n.getEvaluationsByPaper.bind(n);n.getEvaluationsByDataset.bind(n);const G=n.createEvaluation.bind(n),W=n.updateEvaluation.bind(n),H=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);const Q=n.submitPendingPaperEdit.bind(n),X=n.listPendingPaperEdits.bind(n);n.getPendingPaperEdit.bind(n);const K=n.approvePendingPaperEdit.bind(n),V=n.rejectPendingPaperEdit.bind(n);n.removeBookmark.bind(n);export{n as a,O as b,A as c,D as d,x as e,M as f,F as g,j as h,I as i,H as j,G as k,W as l,N as m,U as n,R as o,B as p,C as q,J as r,Q as s,z as t,L as u,K as v,V as w,X as x};
 
 
assets/api-DLAvdHPg.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var S=Object.defineProperty;var P=(g,e,t)=>e in g?S(g,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[e]=t;var l=(g,e,t)=>P(g,typeof e!="symbol"?e+"":e,t);import{g as b}from"./adminAuth-PI_XkM8E.js";import{B as _,a9 as k}from"./index-C6O8_a1-.js";const $=`${k()}/api/v1`,f=!1;class q{constructor(e=$){l(this,"baseUrl");this.baseUrl=e}async request(e,t){const i=`${this.baseUrl}${e}`;try{const{headers:o,...d}=t??{},u=b(),y=(d.method??"GET").toUpperCase()==="GET"?"default":"no-store",c=await fetch(i,{...d,cache:d.cache??y,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 updatePaperSourceUrl(e,t){const i=`/papers/${e}/source-url`;return this.request(i,{method:"PUT",body:JSON.stringify({source_url:t})})}async updatePaperHfArtifacts(e,t){const i=`/papers/${e}/hf-artifacts`;return this.request(i,{method:"PUT",body:JSON.stringify(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 s=await this.getEvaluations({paper_id:i,page:u,page_size:100,ordering:"-benchmark_popularity"});d.push(...s.results),u=s.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=_(`/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=_(`/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=_("/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 submitPendingPaperEdit(e){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)})}async listPendingPaperEdits(e){const t=new URLSearchParams;e!=null&&e.status&&t.append("status",e.status),e!=null&&e.edit_type&&t.append("edit_type",e.edit_type),e!=null&&e.paper_id&&t.append("paper_id",e.paper_id.toString()),e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.offset&&t.append("offset",e.offset.toString());const i=`/admin/paper-edits${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getPendingPaperEdit(e){return this.request(`/admin/paper-edits/${e}`)}async approvePendingPaperEdit(e,t){return this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t??{})})}async rejectPendingPaperEdit(e,t){return this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t??{})})}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);const z=n.getPaper.bind(n);n.getPaperByArxivId.bind(n);const U=n.indexPaperFromArxiv.bind(n),R=n.submitPaper.bind(n),A=n.updatePaperTasks.bind(n),L=n.updatePaperMethods.bind(n),x=n.updatePaperRepositories.bind(n),M=n.updatePaperProjectPages.bind(n),j=n.updatePaperSourceUrl.bind(n),O=n.updatePaperHfArtifacts.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 B=n.getTasks.bind(n),D=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 C=n.getMethods.bind(n),I=n.getMethod.bind(n);n.getMethodPapers.bind(n);const J=n.getDatasets.bind(n),N=n.getDataset.bind(n);n.getDatasetBySlug.bind(n);n.getDatasetTasks.bind(n);const F=n.getLeaderboardMetrics.bind(n);n.getEvaluations.bind(n);n.getEvaluation.bind(n);const H=n.getEvaluationsByPaper.bind(n);n.getEvaluationsByDataset.bind(n);const G=n.createEvaluation.bind(n),W=n.updateEvaluation.bind(n),Q=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);const X=n.submitPendingPaperEdit.bind(n),K=n.listPendingPaperEdits.bind(n);n.getPendingPaperEdit.bind(n);const V=n.approvePendingPaperEdit.bind(n),Y=n.rejectPendingPaperEdit.bind(n);n.removeBookmark.bind(n);export{n as a,B as b,L as c,C as d,x as e,M as f,H as g,j as h,J as i,Q as j,G as k,W as l,F as m,O as n,U as o,R as p,D as q,I as r,X as s,N as t,A as u,z as v,V as w,Y as x,K as y};
assets/{badge-Br1HYKP6.js β†’ badge-CcpUgrz3.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as a,j as n,h as s,V as o}from"./index-CHlNDaV5.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as a,j as n,h as s,V as o}from"./index-C6O8_a1-.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/components-CMH89RDy.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{p as z,y as v,j as t,L as C,G as w}from"./index-C6O8_a1-.js";import{L as S}from"./LatexTitle-CcMIi9G1.js";import{h as P,d as H,g as E,f as R}from"./transform-D_Izdf89.js";import{a as T}from"./api-DLAvdHPg.js";const A=({slug:e,label:s,onClick:r})=>{const o=w(),d=P(e),n=R(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||E(e),e)]})},Q=({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)},V=({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 b="#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:b,opacity:.7,rx:.2}),t.jsx("rect",{x:i,y:F,width:6,height:1,fill:m,opacity:.6}),u.map((c,p)=>{const y=l+p*2.1;return y>o-i-1?null:t.jsx("rect",{x:N,y,width:j*c,height:.8,fill:b,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:b,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:b})]}),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 y=l+(h?16:0)+p*2.1;return y>o-i-1?null:t.jsx("rect",{x:a,y,width:j*c,height:.8,fill:b,opacity:.55,rx:.2},`r${p}`)})]})})},q=({paperId:e,title:s,thumbnailUrl:r,priority:o=!1})=>{const[d,n]=v.useState(!1),[u,x]=v.useState(o),h=v.useRef(null);return v.useEffect(()=>{n(!1)},[r]),v.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(V,{paperId:e})},K=({paper:e,rank:s,onClickTag:r})=>{const o=z(),d=`/paper/${e.id}`,n=v.useCallback(()=>{o.prefetchQuery({queryKey:["paper-arxiv",e.id],queryFn:()=>T.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(q,{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:D(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 D(e){return e.toFixed(1)}export{I,Q as M,K as P,A as T};
assets/components-CqXuLvpo.js DELETED
@@ -1 +0,0 @@
1
- import{p as z,y,j as t,L as C,G as w}from"./index-CHlNDaV5.js";import{L as S}from"./LatexTitle-B3XSDdDB.js";import{h as P,d as H,g as R,f as T}from"./transform-LfD9F8SD.js";import{a as E}from"./api-DKZpnF8C.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)]})},Q=({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,Q as M,K as P,A as T};
 
 
assets/index-B1pEvcfa.css ADDED
The diff for this file is too large to render. See raw diff
 
assets/{index-CHlNDaV5.js β†’ index-C6O8_a1-.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/index-DB0aj1bW.css DELETED
The diff for this file is too large to render. See raw diff
 
assets/{input-DtdrXk4E.js β†’ input-BMdkOI2Z.js} RENAMED
@@ -1 +1 @@
1
- import{r as n,j as s,W as f,h as i,V as c}from"./index-CHlNDaV5.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,W as f,h as i,V as c}from"./index-C6O8_a1-.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/{loader-circle-DCD7IUZw.js β†’ loader-circle-DK8Ui2RE.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-CHlNDaV5.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}from"./index-C6O8_a1-.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{refresh-cw-W_Rmqupv.js β†’ refresh-cw-CcA4286O.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-CHlNDaV5.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}from"./index-C6O8_a1-.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{skeleton-CIY9g4PX.js β†’ skeleton-D8Wtx_Nu.js} RENAMED
@@ -1 +1 @@
1
- import{j as t,h as n}from"./index-CHlNDaV5.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-C6O8_a1-.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-LfD9F8SD.js β†’ transform-D_Izdf89.js} RENAMED
@@ -1 +1 @@
1
- import{a8 as H}from"./index-CHlNDaV5.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{a8 as H}from"./index-C6O8_a1-.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-Bq-Dgz1-.js β†’ useDebounce-BhnwRhGk.js} RENAMED
@@ -1 +1 @@
1
- import{r as o}from"./index-CHlNDaV5.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-C6O8_a1-.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-DYjz2HCv.js β†’ useInfiniteQuery-Dd12EyZd.js} RENAMED
@@ -1 +1 @@
1
- import{Q as v,a as p}from"./useQuery-qKfgFU9t.js";import{T as x,U as b}from"./index-CHlNDaV5.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,a as p}from"./useQuery-Cvv958Kx.js";import{T as x,U as b}from"./index-C6O8_a1-.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-j3afnyyN.js β†’ useIntersectionObserver-CkOYzKe_.js} RENAMED
@@ -1 +1 @@
1
- import{r}from"./index-CHlNDaV5.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-C6O8_a1-.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-DBjQd2jo.js β†’ useMutation-DLRmDXLC.js} RENAMED
@@ -1 +1 @@
1
- var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(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)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{$ as U,a1 as k,a4 as j,a5 as q,a0 as P,p as L,r as v,a3 as A,a6 as D}from"./index-CHlNDaV5.js";var h,c,o,a,n,C,S,w,I=(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,S).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,S).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})},S=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 $(i,t){const s=L(),[r]=v.useState(()=>new I(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(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{$ as u};
 
1
+ var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(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)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{$ as U,a1 as k,a4 as j,a5 as q,a0 as P,p as L,r as v,a3 as A,a6 as D}from"./index-C6O8_a1-.js";var h,c,o,a,n,C,S,w,I=(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,S).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,S).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})},S=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 $(i,t){const s=L(),[r]=v.useState(()=>new I(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(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{$ as u};
assets/{usePapers-Dho-obLV.js β†’ usePapers-CwnyeI7c.js} RENAMED
@@ -1 +1 @@
1
- import{O as f}from"./index-CHlNDaV5.js";import{u as g}from"./useQuery-qKfgFU9t.js";import{u as m}from"./useInfiniteQuery-DYjz2HCv.js";import{a as p}from"./api-DKZpnF8C.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{O as f}from"./index-C6O8_a1-.js";import{u as g}from"./useQuery-Cvv958Kx.js";import{u as m}from"./useInfiniteQuery-Dd12EyZd.js";import{a as p}from"./api-DLAvdHPg.js";function q(r,e=!0){return g({queryKey:["paper",r],queryFn:()=>p.getPaper(r),enabled:e&&!!r,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function F(r={}){const{page_size:e=20,search:a,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}=r;return m({queryKey:["papers-infinite",{page_size:e,search:a,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:a,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(r){const{taskId:e,page_size:a=20,order_by:t="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:u=!0,enabled:o=!0}=r;return m({queryKey:["task-papers-infinite",e,{page_size:a,order_by:t,order_dir:n,latest_only:i,include_resources:u}],queryFn:({pageParam:s=1})=>p.getTaskPapers(e,{page:s,page_size:a,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(r={}){const{limit:e=20,max_age_days:a=180,min_velocity:t,enabled:n=!0}=r;return g({queryKey:["trending-papers",{limit:e,max_age_days:a,min_velocity:t}],queryFn:()=>p.getTrendingPapers({limit:e,max_age_days:a,min_velocity:t}),enabled:n,staleTime:30*1e3,refetchOnWindowFocus:!0})}export{x as a,q as b,T as c,F as u};
assets/{usePeriodFilter-F1Py9_Wb.js β†’ usePeriodFilter-BrbWqy5G.js} RENAMED
@@ -1 +1 @@
1
- import{r}from"./index-CHlNDaV5.js";import{b as a,s as f,c as u}from"./transform-LfD9F8SD.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-C6O8_a1-.js";import{b as a,s as f,c as u}from"./transform-D_Izdf89.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/{useQueries-B_KNu0Lj.js β†’ useQueries-BhLiWt7J.js} RENAMED
@@ -1 +1 @@
1
- var T=u=>{throw TypeError(u)};var B=(u,e,t)=>e.has(u)||T("Cannot "+t);var r=(u,e,t)=>(B(u,e,"read from private field"),t?t.call(u):e.get(u)),b=(u,e,t)=>e.has(u)?T("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,t),c=(u,e,t,s)=>(B(u,e,"write to private field"),s?s.call(u,t):e.set(u,t),t),g=(u,e,t)=>(B(u,e,"access private method"),t);import{$ as N,a0 as A,a1 as V,a2 as X,p as Y,r as k,a3 as Z}from"./index-CHlNDaV5.js";import{Q as G,b as W,c as ee,e as se,d as te,f as re,s as _,g as ie,h as ne}from"./useQuery-qKfgFU9t.js";function $(u,e){const t=new Set(e);return u.filter(s=>!t.has(s))}function oe(u,e,t){const s=u.slice(0);return s[e]=t,s}var E,f,w,R,p,O,q,x,M,H,a,z,I,J,U,j,D,F,ue=(F=class extends N{constructor(e,t,s){super();b(this,a);b(this,E);b(this,f);b(this,w);b(this,R);b(this,p);b(this,O);b(this,q);b(this,x);b(this,M);b(this,H,[]);c(this,E,e),c(this,R,s),c(this,w,[]),c(this,p,[]),c(this,f,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&r(this,p).forEach(e=>{e.subscribe(t=>{g(this,a,j).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,r(this,p).forEach(e=>{e.destroy()})}setQueries(e,t){c(this,w,e),c(this,R,t),A.batch(()=>{const s=r(this,p),i=g(this,a,U).call(this,r(this,w));i.forEach(h=>h.observer.setOptions(h.defaultedQueryOptions));const n=i.map(h=>h.observer),o=n.map(h=>h.getCurrentResult()),l=s.length!==n.length,v=n.some((h,Q)=>h!==s[Q]),C=l||v,P=C?!0:o.some((h,Q)=>{const S=r(this,f)[Q];return!S||!V(h,S)});!C&&!P||(C&&(c(this,H,i),c(this,p,n)),c(this,f,o),this.hasListeners()&&(C&&($(s,n).forEach(h=>{h.destroy()}),$(n,s).forEach(h=>{h.subscribe(Q=>{g(this,a,j).call(this,h,Q)})})),g(this,a,D).call(this)))})}getCurrentResult(){return r(this,f)}getQueries(){return r(this,p).map(e=>e.getCurrentQuery())}getObservers(){return r(this,p)}getOptimisticResult(e,t){const s=g(this,a,U).call(this,e),i=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),n=s.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>g(this,a,I).call(this,o??i,t,n),()=>g(this,a,z).call(this,i,s)]}},E=new WeakMap,f=new WeakMap,w=new WeakMap,R=new WeakMap,p=new WeakMap,O=new WeakMap,q=new WeakMap,x=new WeakMap,M=new WeakMap,H=new WeakMap,a=new WeakSet,z=function(e,t){return t.map((s,i)=>{const n=e[i];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,o=>{t.forEach(l=>{l.observer.trackProp(o)})})})},I=function(e,t,s){if(t){const i=r(this,M),n=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((o,l)=>o!==i[l]));return(!r(this,O)||r(this,f)!==r(this,x)||n||t!==r(this,q))&&(c(this,q,t),c(this,x,r(this,f)),s!==void 0&&c(this,M,s),c(this,O,X(r(this,O),t(e)))),r(this,O)}return e},J=function(){var e;return((e=r(this,R))==null?void 0:e.combine)!==void 0&&r(this,p).some((t,s)=>{var i;return t.options.suspense&&((i=r(this,f)[s])==null?void 0:i.data)===void 0})},U=function(e){const t=new Map;r(this,p).forEach(i=>{const n=i.options.queryHash;if(!n)return;const o=t.get(n);o?o.push(i):t.set(n,[i])});const s=[];return e.forEach(i=>{var v;const n=r(this,E).defaultQueryOptions(i),l=((v=t.get(n.queryHash))==null?void 0:v.shift())??new G(r(this,E),n);s.push({defaultedQueryOptions:n,observer:l})}),s},j=function(e,t){const s=r(this,p).indexOf(e);s!==-1&&(c(this,f,oe(r(this,f),s,t)),g(this,a,D).call(this))},D=function(){var e;if(this.hasListeners()){const t=g(this,a,z).call(this,r(this,f),r(this,H)),s=g(this,a,J).call(this),i=r(this,O),n=s?i:g(this,a,I).call(this,t,(e=r(this,R))==null?void 0:e.combine);(s||i!==n)&&A.batch(()=>{this.listeners.forEach(o=>{o(r(this,f))})})}},F);function le({queries:u,...e},t){const s=Y(),i=W(),n=ee(),o=k.useMemo(()=>u.map(d=>{const y=s.defaultQueryOptions(d);return y._optimisticResults=i?"isRestoring":"optimistic",y}),[u,s,i]);o.forEach(d=>{se(d);const y=s.getQueryCache().get(d.queryHash);te(d,n,y)}),re(n);const[l]=k.useState(()=>new ue(s,o,e)),[v,C,P]=l.getOptimisticResult(o,e.combine),h=!i&&e.subscribed!==!1;k.useSyncExternalStore(k.useCallback(d=>h?l.subscribe(A.batchCalls(d)):Z,[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),k.useEffect(()=>{l.setQueries(o,e)},[o,e,l]);const S=v.some((d,y)=>_(o[y],d))?v.flatMap((d,y)=>{const m=o[y];if(m&&_(m,d)){const K=new G(s,m);return ie(m,K,n)}return[]}):[];if(S.length>0)throw Promise.all(S);const L=v.find((d,y)=>{const m=o[y];return m&&ne({result:d,errorResetBoundary:n,throwOnError:m.throwOnError,query:s.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(L!=null&&L.error)throw L.error;return C(P())}export{le as u};
 
1
+ var T=u=>{throw TypeError(u)};var B=(u,e,t)=>e.has(u)||T("Cannot "+t);var r=(u,e,t)=>(B(u,e,"read from private field"),t?t.call(u):e.get(u)),b=(u,e,t)=>e.has(u)?T("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,t),c=(u,e,t,s)=>(B(u,e,"write to private field"),s?s.call(u,t):e.set(u,t),t),g=(u,e,t)=>(B(u,e,"access private method"),t);import{$ as N,a0 as A,a1 as V,a2 as X,p as Y,r as k,a3 as Z}from"./index-C6O8_a1-.js";import{Q as G,b as W,c as ee,e as se,d as te,f as re,s as _,g as ie,h as ne}from"./useQuery-Cvv958Kx.js";function $(u,e){const t=new Set(e);return u.filter(s=>!t.has(s))}function oe(u,e,t){const s=u.slice(0);return s[e]=t,s}var E,f,w,R,p,O,q,x,M,H,a,z,I,J,U,j,D,F,ue=(F=class extends N{constructor(e,t,s){super();b(this,a);b(this,E);b(this,f);b(this,w);b(this,R);b(this,p);b(this,O);b(this,q);b(this,x);b(this,M);b(this,H,[]);c(this,E,e),c(this,R,s),c(this,w,[]),c(this,p,[]),c(this,f,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&r(this,p).forEach(e=>{e.subscribe(t=>{g(this,a,j).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,r(this,p).forEach(e=>{e.destroy()})}setQueries(e,t){c(this,w,e),c(this,R,t),A.batch(()=>{const s=r(this,p),i=g(this,a,U).call(this,r(this,w));i.forEach(h=>h.observer.setOptions(h.defaultedQueryOptions));const n=i.map(h=>h.observer),o=n.map(h=>h.getCurrentResult()),l=s.length!==n.length,v=n.some((h,Q)=>h!==s[Q]),C=l||v,P=C?!0:o.some((h,Q)=>{const S=r(this,f)[Q];return!S||!V(h,S)});!C&&!P||(C&&(c(this,H,i),c(this,p,n)),c(this,f,o),this.hasListeners()&&(C&&($(s,n).forEach(h=>{h.destroy()}),$(n,s).forEach(h=>{h.subscribe(Q=>{g(this,a,j).call(this,h,Q)})})),g(this,a,D).call(this)))})}getCurrentResult(){return r(this,f)}getQueries(){return r(this,p).map(e=>e.getCurrentQuery())}getObservers(){return r(this,p)}getOptimisticResult(e,t){const s=g(this,a,U).call(this,e),i=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),n=s.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>g(this,a,I).call(this,o??i,t,n),()=>g(this,a,z).call(this,i,s)]}},E=new WeakMap,f=new WeakMap,w=new WeakMap,R=new WeakMap,p=new WeakMap,O=new WeakMap,q=new WeakMap,x=new WeakMap,M=new WeakMap,H=new WeakMap,a=new WeakSet,z=function(e,t){return t.map((s,i)=>{const n=e[i];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,o=>{t.forEach(l=>{l.observer.trackProp(o)})})})},I=function(e,t,s){if(t){const i=r(this,M),n=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((o,l)=>o!==i[l]));return(!r(this,O)||r(this,f)!==r(this,x)||n||t!==r(this,q))&&(c(this,q,t),c(this,x,r(this,f)),s!==void 0&&c(this,M,s),c(this,O,X(r(this,O),t(e)))),r(this,O)}return e},J=function(){var e;return((e=r(this,R))==null?void 0:e.combine)!==void 0&&r(this,p).some((t,s)=>{var i;return t.options.suspense&&((i=r(this,f)[s])==null?void 0:i.data)===void 0})},U=function(e){const t=new Map;r(this,p).forEach(i=>{const n=i.options.queryHash;if(!n)return;const o=t.get(n);o?o.push(i):t.set(n,[i])});const s=[];return e.forEach(i=>{var v;const n=r(this,E).defaultQueryOptions(i),l=((v=t.get(n.queryHash))==null?void 0:v.shift())??new G(r(this,E),n);s.push({defaultedQueryOptions:n,observer:l})}),s},j=function(e,t){const s=r(this,p).indexOf(e);s!==-1&&(c(this,f,oe(r(this,f),s,t)),g(this,a,D).call(this))},D=function(){var e;if(this.hasListeners()){const t=g(this,a,z).call(this,r(this,f),r(this,H)),s=g(this,a,J).call(this),i=r(this,O),n=s?i:g(this,a,I).call(this,t,(e=r(this,R))==null?void 0:e.combine);(s||i!==n)&&A.batch(()=>{this.listeners.forEach(o=>{o(r(this,f))})})}},F);function le({queries:u,...e},t){const s=Y(),i=W(),n=ee(),o=k.useMemo(()=>u.map(d=>{const y=s.defaultQueryOptions(d);return y._optimisticResults=i?"isRestoring":"optimistic",y}),[u,s,i]);o.forEach(d=>{se(d);const y=s.getQueryCache().get(d.queryHash);te(d,n,y)}),re(n);const[l]=k.useState(()=>new ue(s,o,e)),[v,C,P]=l.getOptimisticResult(o,e.combine),h=!i&&e.subscribed!==!1;k.useSyncExternalStore(k.useCallback(d=>h?l.subscribe(A.batchCalls(d)):Z,[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),k.useEffect(()=>{l.setQueries(o,e)},[o,e,l]);const S=v.some((d,y)=>_(o[y],d))?v.flatMap((d,y)=>{const m=o[y];if(m&&_(m,d)){const K=new G(s,m);return ie(m,K,n)}return[]}):[];if(S.length>0)throw Promise.all(S);const L=v.find((d,y)=>{const m=o[y];return m&&ne({result:d,errorResetBoundary:n,throwOnError:m.throwOnError,query:s.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(L!=null&&L.error)throw L.error;return C(P())}export{le as u};
assets/{useQuery-qKfgFU9t.js β†’ useQuery-Cvv958Kx.js} RENAMED
@@ -1 +1 @@
1
- var bt=s=>{throw TypeError(s)};var Z=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>(Z(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)=>(Z(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>(Z(s,t,"access private method"),e);import{$ as Tt,aa as gt,ab as S,a1 as q,ac as A,a3 as tt,ad as et,ae as vt,af as Mt,ag as G,ah as Qt,ai as xt,aj as mt,a0 as Ct,r as O,a6 as Ot,p as _t}from"./index-CHlNDaV5.js";var v,a,H,g,x,D,C,w,W,P,L,_,F,T,N,n,j,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{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,T);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,j).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,j).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||A(this.options.staleTime,i(this,a))!==A(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,T))&&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,j).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},M=!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),M=!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 J=d.fetchStatus==="fetching",X=m==="pending",Y=m==="error",lt=X&&J,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:J,isRefetching:J&&!X,isLoadingError:Y&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:M,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?$.reject(I.error):R&&$.resolve(I.data)},pt=()=>{const $=u(this,C,I.promise=gt());V($)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.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,T=new WeakMap,N=new WeakMap,n=new WeakSet,j=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=A(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,G.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,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,F,G.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,j).call(this)},i(this,T)))},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&&(G.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(G.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&&A(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(A(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))},jt=s=>{O.useEffect(()=>{s.clearReset()},[s])},At=({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 M,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),kt(c,h,y),jt(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(At({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 Jt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Pt as b,Bt as c,kt as d,Ht as e,jt as f,yt as g,At as h,zt as s,Jt as u};
 
1
+ var bt=s=>{throw TypeError(s)};var Z=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>(Z(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)=>(Z(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>(Z(s,t,"access private method"),e);import{$ as Tt,aa as gt,ab as S,a1 as q,ac as A,a3 as tt,ad as et,ae as vt,af as Mt,ag as G,ah as Qt,ai as xt,aj as mt,a0 as Ct,r as O,a6 as Ot,p as _t}from"./index-C6O8_a1-.js";var v,a,H,g,x,D,C,w,W,P,L,_,F,T,N,n,j,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{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,T);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,j).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,j).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||A(this.options.staleTime,i(this,a))!==A(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,T))&&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,j).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},M=!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),M=!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 J=d.fetchStatus==="fetching",X=m==="pending",Y=m==="error",lt=X&&J,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:J,isRefetching:J&&!X,isLoadingError:Y&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:M,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?$.reject(I.error):R&&$.resolve(I.data)},pt=()=>{const $=u(this,C,I.promise=gt());V($)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.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,T=new WeakMap,N=new WeakMap,n=new WeakSet,j=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=A(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,G.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,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,F,G.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,j).call(this)},i(this,T)))},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&&(G.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(G.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&&A(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(A(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))},jt=s=>{O.useEffect(()=>{s.clearReset()},[s])},At=({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 M,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),kt(c,h,y),jt(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(At({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 Jt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Pt as b,Bt as c,kt as d,Ht as e,jt as f,yt as g,At as h,zt as s,Jt as u};
index.html CHANGED
@@ -49,8 +49,8 @@
49
  plausible.init();
50
  })();
51
  </script>
52
- <script type="module" crossorigin src="/assets/index-CHlNDaV5.js"></script>
53
- <link rel="stylesheet" crossorigin href="/assets/index-DB0aj1bW.css">
54
  </head>
55
  <body>
56
  <div id="root"></div>
 
49
  plausible.init();
50
  })();
51
  </script>
52
+ <script type="module" crossorigin src="/assets/index-C6O8_a1-.js"></script>
53
+ <link rel="stylesheet" crossorigin href="/assets/index-B1pEvcfa.css">
54
  </head>
55
  <body>
56
  <div id="root"></div>