Spaces:
Running
Running
Sync paperswithcode.co frontend
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- assets/{AgentLogos-BMGxij6P.js → AgentLogos-CGEF3N8p.js} +1 -1
- assets/{AiDeadlinesView-DEHE_FTy.js → AiDeadlinesView-CaxciZEQ.js} +1 -1
- assets/{ApiDocsView-DrUCajze.js → ApiDocsView-DjDiVhPj.js} +1 -1
- assets/{ArtifactWorkspace-k9u84oat.js → ArtifactWorkspace-CFTBDPD0.js} +0 -0
- assets/{AstraForRoboticsView-BKrd7ySJ.js → AstraForRoboticsView-CFvEna35.js} +1 -1
- assets/{AuthorDetailView-DQrP7WQZ.js → AuthorDetailView-lqzMO4Sh.js} +1 -1
- assets/{AuthorizePaperEditView-CPPeM1We.js → AuthorizePaperEditView-pFFoGSH2.js} +1 -1
- assets/{AutonomousOperations-DO5hTrrr.js → AutonomousOperations-DsgAGGJc.js} +2 -2
- assets/{BenchmarkDetailView-Cjmbp3Wk.js → BenchmarkDetailView-KHgxcdOQ.js} +1 -1
- assets/{BenchmarkTrendSparkline-s0aa2t5Y.js → BenchmarkTrendSparkline-BaDbn_eF.js} +1 -1
- assets/{ChatView-Cuvu2zEE.js → ChatView-Duxpqsix.js} +0 -0
- assets/{ConferenceDetailView-C4roHSxA.js → ConferenceDetailView-C7KlB9Xf.js} +1 -1
- assets/{ConferenceTaskView-ByPAPd-g.js → ConferenceTaskView-BtsgWPzv.js} +1 -1
- assets/{ConferencesIndexView-BLiskc3i.js → ConferencesIndexView-Cp5N1BT0.js} +1 -1
- assets/CronDashboard-BkJLXbNZ.js +41 -0
- assets/CronDashboard-DEr_gWmj.js +0 -51
- assets/{ExternalSourceEvalBadge-B3wNcwqv.js → ExternalSourceEvalBadge-D1UcoJqH.js} +1 -1
- assets/FeedView-BKszJwP_.js +0 -1
- assets/FeedView-BaTbW_7f.js +1 -0
- assets/FollowingView-89_kX1Jq.js +1 -0
- assets/FollowingView-CYhGO2K_.js +0 -1
- assets/{FrameworksIndexView-Dz2LHIvD.js → FrameworksIndexView-BUcIxyBE.js} +1 -1
- assets/{LatexTitle-DzYgREOe.js → LatexTitle-lQiG5mCP.js} +1 -1
- assets/{MarkdownText-CMN2meZd.js → MarkdownText-CcUZ0t2p.js} +1 -1
- assets/{McpView-BMYYEYSl.js → McpView-C-n3RWJG.js} +1 -1
- assets/{MethodDetailView-BhKaIJvA.js → MethodDetailView-BsC3WZ-M.js} +1 -1
- assets/{MethodsIndexView-JaIiaJw-.js → MethodsIndexView-DvgVygE2.js} +1 -1
- assets/{NotFound-DlcBmZx6.js → NotFound-DWo2Md94.js} +1 -1
- assets/{OrganizationContributionGraph-BD954ze8.js → OrganizationContributionGraph-TfRSAQDx.js} +1 -1
- assets/OrganizationDetailView-D2tt6Owa.js +0 -1
- assets/OrganizationDetailView-DNHy-Auy.js +1 -0
- assets/{OrganizationPaperFeed-Cc9qvVb4.js → OrganizationPaperFeed-DV7HIdfT.js} +1 -1
- assets/OrganizationTaskView-BlT0b_Wi.js +1 -0
- assets/OrganizationTaskView-D7QVBwXF.js +0 -1
- assets/{OrganizationsIndexView-DimJabLj.js → OrganizationsIndexView-CNaFMOZi.js} +1 -1
- assets/{PaperDateFilter-BqtxoA2-.js → PaperDateFilter-Cmzg62xO.js} +1 -1
- assets/{PaperDetailView-D2LYbCQe.js → PaperDetailView-BaSC3pB1.js} +0 -0
- assets/{PaperFeedFilters-Nd8CC_7I.js → PaperFeedFilters-Hyqa1G4B.js} +1 -1
- assets/{PaperPreviewLink-Bvcg4CvY.js → PaperPreviewLink-n9bIC1vy.js} +1 -1
- assets/PaperReaderView-C9xJBDgB.js +1 -0
- assets/PaperReaderView-Co23docw.js +0 -1
- assets/{PapersListView-BMg4HpaU.js → PapersListView-CpzceHH4.js} +1 -1
- assets/{PrivacyView-fuoYet-j.js → PrivacyView-BEs7JLal.js} +1 -1
- assets/{RateLimitsView-DMM-c-28.js → RateLimitsView-Dcg2BwK4.js} +1 -1
- assets/{ResearchFollowButton-BrbOAi4p.js → ResearchFollowButton-DNrVdY8G.js} +1 -1
- assets/{SavedPapersView-CrxoA7xK.js → SavedPapersView-Rcq2cSen.js} +1 -1
- assets/{SearchOverlay-DX8gymET.js → SearchOverlay-CxQWYYv8.js} +1 -1
- assets/{SettingsView-BGSBWGPf.js → SettingsView-CTpLNdkD.js} +4 -9
- assets/SharedChatView-CDcAKAKv.js +0 -1
- assets/SharedChatView-YirSvkfJ.js +1 -0
assets/{AgentLogos-BMGxij6P.js → AgentLogos-CGEF3N8p.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e}from"./index-DuJU_D27.js";const s="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",a="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg%20fill='%23111'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",o="data:image/svg+xml,%3csvg%20fill='%23fff'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",r="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",d="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_dark__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_dark__st0{fill:%23edecec}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_dark__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",n="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23FDFCFC'/%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%23E6E5E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='%2317181C'/%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='512'%20height='512'%3e%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'%3e%3c/rect%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%235A5858'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='white'%3e%3c/path%3e%3c/svg%3e%3cstyle%3e@media%20(prefers-color-scheme:%20light)%20{%20:root%20{%20filter:%20none;%20}%20}%20@media%20(prefers-color-scheme:%20dark)%20{%20:root%20{%20filter:%20none;%20}%20}%20%3c/style%3e%3c/svg%3e",i=[{name:"Claude",light:s,dark:a},{name:"Codex",light:h,dark:o},{name:"Cursor",light:r,dark:d},{name:"OpenCode",light:n,dark:g}];function w(){return e.jsx("span",{className:"ml-1 inline-flex shrink-0 items-center gap-1.5","aria-hidden":"true",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("span",{title:l,className:"inline-flex h-[18px] w-[18px]",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-full w-full object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-full w-full object-contain dark:block"})]},l))})}function m(){return e.jsx("ul",{className:"flex flex-wrap gap-2","aria-label":"Supported coding agents",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("li",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-sm",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-[18px] w-[18px] object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-[18px] w-[18px] object-contain dark:block"}),l]},l))})}export{w as A,m as a};
|
|
|
|
| 1 |
+
import{j as e}from"./index-DAAEdKQ4.js";const s="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",a="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg%20fill='%23111'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",o="data:image/svg+xml,%3csvg%20fill='%23fff'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",r="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",d="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_dark__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_dark__st0{fill:%23edecec}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_dark__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",n="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23FDFCFC'/%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%23E6E5E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='%2317181C'/%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='512'%20height='512'%3e%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'%3e%3c/rect%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%235A5858'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='white'%3e%3c/path%3e%3c/svg%3e%3cstyle%3e@media%20(prefers-color-scheme:%20light)%20{%20:root%20{%20filter:%20none;%20}%20}%20@media%20(prefers-color-scheme:%20dark)%20{%20:root%20{%20filter:%20none;%20}%20}%20%3c/style%3e%3c/svg%3e",i=[{name:"Claude",light:s,dark:a},{name:"Codex",light:h,dark:o},{name:"Cursor",light:r,dark:d},{name:"OpenCode",light:n,dark:g}];function w(){return e.jsx("span",{className:"ml-1 inline-flex shrink-0 items-center gap-1.5","aria-hidden":"true",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("span",{title:l,className:"inline-flex h-[18px] w-[18px]",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-full w-full object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-full w-full object-contain dark:block"})]},l))})}function m(){return e.jsx("ul",{className:"flex flex-wrap gap-2","aria-label":"Supported coding agents",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("li",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-sm",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-[18px] w-[18px] object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-[18px] w-[18px] object-contain dark:block"}),l]},l))})}export{w as A,m as a};
|
assets/{AiDeadlinesView-DEHE_FTy.js → AiDeadlinesView-CaxciZEQ.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
import{r as x,j as t}from"./index-
|
| 2 |
`)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
|
| 3 |
`),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},ne=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[m&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:m})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),u!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(u,r)},children:X(u,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:h&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),g=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default};
|
|
|
|
| 1 |
+
import{r as x,j as t}from"./index-DAAEdKQ4.js";import{u as A}from"./useQuery-BALok3Po.js";import{c as B}from"./catalog-Cjgxq75q.js";import{S as U}from"./switch-Bow6oaVX.js";import{S as W}from"./skeleton-Te-nsRWB.js";import{A as O,a as V}from"./alert-B_MWtfva.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-ByQvEQks.js";import"./index-DRLEC3qz.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(`
|
| 2 |
`)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
|
| 3 |
`),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},ne=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[m&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:m})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),u!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(u,r)},children:X(u,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:h&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),g=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default};
|
assets/{ApiDocsView-DrUCajze.js → ApiDocsView-DjDiVhPj.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{a4 as m,r as o,j as e}from"./index-
|
| 2 |
|
| 3 |
response = requests.get(${JSON.stringify(s)}, timeout=30)
|
| 4 |
response.raise_for_status()
|
|
|
|
| 1 |
+
import{a4 as m,r as o,j as e}from"./index-DAAEdKQ4.js";import{u as f}from"./useQuery-BALok3Po.js";import{M as g}from"./index-D6KYmf_u.js";const y={queryKey:["public-api-schema"],queryFn:()=>m("/openapi.json",{credentials:"omit"}),staleTime:5*60*1e3};function b(s,r){const n=new URLSearchParams;for(const[a,t]of Object.entries(r["x-example-parameters"]))s.includes(`{${a}}`)?s=s.replace(`{${a}}`,encodeURIComponent(String(t))):n.append(a,String(t));return`https://paperswithcode.co${s}${n.size?`?${n}`:""}`}function w(s,r){return r==="Python"?`import requests
|
| 2 |
|
| 3 |
response = requests.get(${JSON.stringify(s)}, timeout=30)
|
| 4 |
response.raise_for_status()
|
assets/{ArtifactWorkspace-k9u84oat.js → ArtifactWorkspace-CFTBDPD0.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{AstraForRoboticsView-BKrd7ySJ.js → AstraForRoboticsView-CFvEna35.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as v,r as h,j as a,L as n}from"./index-
|
|
|
|
| 1 |
+
import{d as v,r as h,j as a,L as n}from"./index-DAAEdKQ4.js";import{P as N}from"./components-BWWnJ95m.js";import{P}from"./PaperFeedFilters-Hyqa1G4B.js";import{A as k,a as A}from"./alert-B_MWtfva.js";import{S as w}from"./skeleton-Te-nsRWB.js";import{u as S}from"./useIntersectionObserver-DFkuIFUb.js";import{u as R}from"./usePapers-BoM3UV5_.js";import{f as L,D as T}from"./latexPlainText-DI8YEXVe.js";import{t as F}from"./colors-DR110Nc2.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-lQiG5mCP.js";import"./papers-DL8dzFlM.js";import"./safeExternalHref-CkBrsh84.js";import"./useQuery-BALok3Po.js";import"./useInfiniteQuery-BJadVmaJ.js";const f="robotics",b="gpt-6-astra",I="https://x.com/YuXiang_IRVL/status/2100395131924840570",C=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],O=[{handle:"Frame_Robotics",author:"Frame Robotics",summary:"Real-arm control that fixes grip angle and carry height on the next try after a miss.",url:"https://x.com/Frame_Robotics/status/2099900836273090614"},{handle:"qineng_wang",author:"Qineng Wang",summary:"Dual-ALOHA spatial-constraint puzzles: unlocking interlocked parts and threading a rope through three rings.",url:"https://x.com/qineng_wang/status/2099893504658866561"},{handle:"__Rhodium__",author:"Lucas",summary:"In-context learning of the controls and the workspace, reaching the task goal in three tries.",url:"https://x.com/__Rhodium__/status/2099521054678925534"},{handle:"SuveenE",author:"Suveen Ellawela",summary:"Picking up a pipette and fitting a 5 mm tip on a MolmoAct2 real-world eval, using the free hand for a better view.",url:"https://x.com/SuveenE/status/2099448450341605672"},{handle:"cdngdev",author:"thijs",summary:"A robot arm with a paintbrush painting the Golden Gate Bridge, improving across attempts from camera feedback.",url:"https://x.com/cdngdev/status/2097339677128982873"},{handle:"IsaacSin12",author:"Isaac Sin",summary:"Zero-shot sorting of irregularly shaped blocks into cups by color.",url:"https://x.com/IsaacSin12/status/2096715382166098302"},{handle:"chooi_jeq",author:"Jay Chooi",summary:"Robocurve's robot-control comparison: 95% task completion versus 40% for Fable 5.1 at lower cost.",url:"https://x.com/chooi_jeq/status/2096064315115839904"}],G=[{handle:"Lingjun_Mao",author:"Lingjun Mao",summary:"Adapting to a new embodiment to put a cake into an air fryer through CuRobo motion-planning tool APIs.",url:"https://x.com/Lingjun_Mao/status/2100294902672462176"},{handle:"walterzhu8",author:"Wentao Zhu",summary:"A day-and-a-half autonomous run that builds and trains pen spinning on a Sharpa hand in Isaac Lab.",url:"https://x.com/walterzhu8/status/2100212420840989112"},{handle:"mishig25",author:"Mishig",summary:"Painting the Eiffel Tower in MuJoCo with an SO-101 and a brush, with the full experiment shared on Hugging Face.",url:"https://x.com/mishig25/status/2099611674793668676"},{handle:"RunpeiDong",author:"Runpei Dong",summary:"Getting a humanoid into a Tesla in MuJoCo: learning from feedback, then reusing that experience with egocentric perception.",url:"https://x.com/RunpeiDong/status/2099604536327614717"},{handle:"frankzydou",author:"Zhiyang (Frank) Dou",summary:"A LeRobot SO-101 real-world pickup from a third-person RGB camera, where the arm has to bend back to reach the pen.",url:"https://x.com/frankzydou/status/2099338127915512297"},{handle:"Parvkpr",author:"Parv Kapoor",summary:"Real-to-sim: building an interactive simulation environment from a single image or video.",url:"https://x.com/Parvkpr/status/2098847963867238597"},{handle:"z_code68632",author:"code_z",summary:"One demo per task: unscrewing a bottle cap, inserting a plug, clearing obstacles, and imitating a dance on a real robot.",url:"https://x.com/z_code68632/status/2098397364725895387"}],j=({posts:s,label:i})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:i}),a.jsx("ul",{children:s.map(o=>a.jsxs("li",{children:[a.jsxs("a",{href:o.url,target:"_blank",rel:"noreferrer",children:["@",o.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",o.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",o.summary]})]},o.url))})]}),E=s=>s==="date_published"||s==="citation_count"?s:"trending",W=()=>{var g,x;const[s,i]=v(),o=E(s.get("order_by")),d=s.get("has_code")==="true",m=s.get("has_hf_artifacts")==="true",t=R({task:f,method:b,page_size:12,order_by:o,order_dir:"desc",include_resources:!0,has_code:d,has_hf_artifacts:m}),{targetRef:_,isIntersecting:u}=S({rootMargin:"200px"});h.useEffect(()=>(document.title=L("GPT-6 Astra for Robotics"),()=>{document.title=T}),[]),h.useEffect(()=>{u&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[u,t.hasNextPage,t.isFetchingNextPage]);const p=h.useMemo(()=>{var e;return(((e=t.data)==null?void 0:e.pages)??[]).flatMap(r=>r.results.map(F))},[t.data]),y=((x=(g=t.data)==null?void 0:g.pages[0])==null?void 0:x.count)??0,c=(e,r)=>{const l=new URLSearchParams(s);r===null?l.delete(e):l.set(e,r),i(l)};return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(n,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"GPT-6 Astra for Robotics"})]}),a.jsx("header",{className:"feed-header",children:a.jsxs("div",{children:[a.jsx("div",{className:"astra-eyebrow",children:"Collection"}),a.jsxs("h1",{className:"feed-title",children:["GPT-6 Astra ",a.jsx("em",{children:"for Robotics"})]}),a.jsx("div",{className:"feed-subtitle",children:"Papers, technical reports, and evaluations that put OpenAI’s frontier model in control of real and simulated robots."}),a.jsxs("p",{className:"astra-lede",children:["The GPT-6 Astra launch never mentioned robots, yet within days the model was driving arms, hands, and humanoids. As"," ",a.jsx("a",{href:I,target:"_blank",rel:"noreferrer",children:"Yu Xiang"})," ","framed it, the work splits into two families: Astra acting as the robot policy itself, and Astra acting as an agent that orchestrates everything else."]})]})}),a.jsxs("section",{className:"astra-approaches","aria-label":"How GPT-6 Astra is used for robots",children:[a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"01 / Robot policy"}),a.jsx("h2",{children:"Astra as the policy, like a VLA"}),a.jsx("p",{children:"The model looks at camera frames and robot state and directly emits actions: end-effector poses, joint targets, or gripper commands, closing the control loop step by step with no task-specific training."}),a.jsx(j,{posts:O,label:"Seen on X"})]}),a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"02 / Agent"}),a.jsx("h2",{children:"Astra as the agent"}),a.jsx("p",{children:"The model reasons about the scene, writes and runs code, calls planners and tools, or delegates low-level motion to pretrained policies such as VLAs, and keeps the robot on task over long horizons."}),a.jsx(j,{posts:G,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(n,{to:`/tasks/${f}`,children:"Robotics"})," task and the"," ",a.jsx(n,{to:`/methods/${b}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(n,{to:"/submit",children:"Submit it"}),"."]}),a.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[a.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),a.jsxs("div",{className:"task-section-title",children:["Papers ",a.jsxs("span",{className:"meta",children:["[",y.toLocaleString(),"]"]})]})]}),a.jsx("div",{className:"sort-bar",children:a.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a.jsx("div",{className:"sort-options",children:C.map(([e,r])=>a.jsx("button",{type:"button",className:`sort-btn ${o===e?"active":""}`,onClick:()=>c("order_by",e==="trending"?null:e),children:r},e))}),a.jsx(P,{hasCode:d,hasHfArtifacts:m,onHasCodeChange:e=>c("has_code",e?"true":null),onHasHfArtifactsChange:e=>c("has_hf_artifacts",e?"true":null)})]})}),t.error?a.jsx(k,{variant:"destructive",children:a.jsx(A,{children:"Failed to load the collection. Please try again."})}):t.isLoading?a.jsx("div",{className:"paper-list",children:Array.from({length:3}).map((e,r)=>a.jsx(w,{className:"h-40 w-full"},r))}):p.length===0?a.jsx("div",{className:"no-results",children:"No papers match this selection yet."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"paper-list",children:p.map((e,r)=>a.jsx(N,{paper:e,rank:r+1},e.id))}),a.jsx("div",{ref:_,style:{height:1}}),t.isFetchingNextPage&&a.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{W as default};
|
assets/{AuthorDetailView-DQrP7WQZ.js → AuthorDetailView-lqzMO4Sh.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as C,j as e,d as R,r as v,L as S}from"./index-
|
|
|
|
| 1 |
+
import{u as C,j as e,d as R,r as v,L as S}from"./index-DAAEdKQ4.js";import{u as w}from"./useQuery-BALok3Po.js";import{A as H,P as k}from"./components-BWWnJ95m.js";import{a as L,P as O,b as B}from"./PaperDateFilter-Cmzg62xO.js";import{P as I}from"./PaperFeedFilters-Hyqa1G4B.js";import{R as T}from"./ResearchFollowButton-DNrVdY8G.js";import{A as $,a as E}from"./alert-B_MWtfva.js";import{S as y}from"./skeleton-Te-nsRWB.js";import{u as M}from"./useIntersectionObserver-DFkuIFUb.js";import{u as q}from"./usePapers-BoM3UV5_.js";import{p as z}from"./papers-DL8dzFlM.js";import{t as U}from"./colors-DR110Nc2.js";import A from"./NotFound-DWo2Md94.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-lQiG5mCP.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CNAIo5eI.js";import"./useMutation-D4cqMKzD.js";import"./research--raTfZxI.js";import"./plus-B07MagLg.js";import"./useInfiniteQuery-BJadVmaJ.js";const K=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Q=s=>s==="date_published"||s==="citation_count"?s:"trending",V=({authorId:s})=>{var f,x,j,_,N,b,P;const[o,h]=R(),p=Q(o.get("order_by")),m=o.get("has_code")==="true",u=o.get("has_hf_artifacts")==="true",i=L(o),t=w({queryKey:["author",s],queryFn:()=>z.getAuthor(s)}),r=q({author:s,page_size:12,order_by:p,order_dir:"desc",include_resources:!0,has_code:m,has_hf_artifacts:u,start_date:i.startDate,end_date:i.endDate}),{targetRef:F,isIntersecting:g}=M({rootMargin:"200px"}),c=v.useMemo(()=>{var a;return(((a=r.data)==null?void 0:a.pages)??[]).flatMap(n=>n.results.map(U))},[r.data]);v.useEffect(()=>{g&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[g,r.hasNextPage,r.isFetchingNextPage,c.length]);const D=((x=(f=r.data)==null?void 0:f.pages[0])==null?void 0:x.count)??0,d=(a,n)=>{const l=new URLSearchParams(o);n?l.set(a,n):l.delete(a),h(l)};return((j=t.error)==null?void 0:j.status)===404?e.jsx(A,{}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(S,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:"Authors"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:((_=t.data)==null?void 0:_.full_name)??s})]}),e.jsxs("header",{className:"author-hero",children:[e.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),e.jsxs("div",{className:"author-hero-title",children:[((N=t.data)==null?void 0:N.hf_username)&&e.jsx(H,{className:"author-avatar",url:t.data.hf_avatar_url,href:`https://huggingface.co/${t.data.hf_username}`,label:`@${t.data.hf_username} on Hugging Face`}),e.jsx("h1",{className:"feed-title",children:((b=t.data)==null?void 0:b.full_name)??e.jsx(y,{className:"h-12 w-64 inline-block"})})]}),t.data&&e.jsxs("div",{className:"feed-subtitle",children:[t.data.paper_count.toLocaleString()," ",t.data.paper_count===1?"paper":"papers",t.data.hf_username&&e.jsxs(e.Fragment,{children:[" · ",e.jsxs("a",{href:`https://huggingface.co/${t.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",t.data.hf_username," on Hugging Face ↗"]})]})]}),t.data&&e.jsx(T,{kind:"author",entityId:t.data.id})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:K.map(([a,n])=>e.jsx("button",{type:"button",className:`sort-btn ${p===a?"active":""}`,onClick:()=>d("order_by",a==="trending"?null:a),children:n},a))}),e.jsx(I,{hasCode:m,hasHfArtifacts:u,onHasCodeChange:a=>d("has_code",a?"true":null),onHasHfArtifactsChange:a=>d("has_hf_artifacts",a?"true":null)})]}),e.jsx(O,{startDate:i.startDate,endDate:i.endDate,onChange:a=>h(B(o,a))}),e.jsxs("div",{className:"results-count",children:[D.toLocaleString()," papers"]})]}),r.error?e.jsx($,{variant:"destructive",children:e.jsxs(E,{children:["Failed to load papers."," ",e.jsx("button",{type:"button",onClick:()=>void r.refetch(),children:"Try again"})]})}):r.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,n)=>e.jsx(y,{className:"h-40 w-full"},n))}):c.length===0?e.jsx("div",{className:"no-results",children:((P=t.data)==null?void 0:P.paper_count)===0?"No public papers are available.":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:c.map((a,n)=>e.jsx(k,{paper:a,rank:n+1},a.id))}),e.jsx("div",{ref:F,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})},ge=()=>{const{authorId:s}=C();return s?e.jsx(V,{authorId:s},s):e.jsx(A,{})};export{ge as default};
|
assets/{AuthorizePaperEditView-CPPeM1We.js → AuthorizePaperEditView-pFFoGSH2.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u,a as d,j as e,L as l,H as p}from"./index-
|
|
|
|
| 1 |
+
import{u,a as d,j as e,L as l,H as p}from"./index-DAAEdKQ4.js";import{u as c}from"./useQuery-BALok3Po.js";import{u as h}from"./useMutation-D4cqMKzD.js";import{B as m}from"./button-B4rpf4U2.js";import{p as n}from"./paperEdits-BSsfmAC_.js";function b(){const{authorizationId:t=""}=u(),{user:s,isLoading:o}=d(),i=c({queryKey:["paper-edit-authorization",t],queryFn:()=>n.authorization(t),retry:!1}),r=h({mutationFn:()=>n.approve(t)}),a=i.data;return e.jsxs("main",{className:"mx-auto max-w-xl space-y-5 px-6 py-12",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Authorize your agent to edit a paper"}),(i.isLoading||o)&&e.jsx("p",{children:"Loading authorization…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),a&&e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"underline",to:`/paper/${a.paper_id}`,children:a.title}),e.jsxs("p",{children:["Check that your CLI shows this code: ",e.jsx("strong",{className:"font-mono",children:a.user_code})]}),e.jsx("p",{children:"Only approve a request you started. Your agent will be able to publish changes to this paper’s links, tags, and evaluation results for one hour, without further approval."}),e.jsx("p",{children:"Edits appear publicly under your Hugging Face username. You can edit up to 20 distinct papers per UTC day. Evaluation deletion and changes to shared benchmark definitions require an administrator."}),r.isSuccess||a.approved?e.jsx("p",{role:"status",children:"Access approved. Return to your CLI to continue."}):s?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Signed in as ",e.jsxs("strong",{children:["@",s.username]})]}),e.jsx(m,{disabled:r.isPending||!s.can_directly_edit_catalog,onClick:()=>r.mutate(),children:r.isPending?"Authorizing…":"Authorize for one hour"}),!s.can_directly_edit_catalog&&e.jsx("p",{children:"Direct editing is unavailable for this session."})]}):e.jsx(p,{returnTo:`/authorize-paper-edit/${t}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{b as default};
|
assets/{AutonomousOperations-DO5hTrrr.js → AutonomousOperations-DsgAGGJc.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
import{g as R,a as B,m as q,r as m,j as e,L as H}from"./index-
|
| 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 F=R("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),p={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},S={healthy:"cron-status--healthy",degraded:"cron-status--degraded",repairing:"cron-status--running","rolled-back":"cron-status--broken",manual:"cron-status--degraded"},
|
|
|
|
| 1 |
+
import{g as R,a as B,m as q,r as m,j as e,L as H}from"./index-DAAEdKQ4.js";import{u as I}from"./useQuery-BALok3Po.js";import{u as Q}from"./useMutation-D4cqMKzD.js";import{B as P}from"./badge-D8X9-hnJ.js";import{B as x}from"./button-B4rpf4U2.js";import{C as n,d as i,a as t,b as r,f as h,o as u}from"./operations-hdrxvDEQ.js";import{I as j}from"./input-BJzP2p9f.js";import{A as D}from"./activity-BA7Fotb7.js";import{S as $}from"./shield-alert-Efk_HXHR.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 F=R("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),p={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},S={healthy:"cron-status--healthy",degraded:"cron-status--degraded",repairing:"cron-status--running","rolled-back":"cron-status--broken",manual:"cron-status--degraded"},Z=()=>{var E;const{user:o}=B(),M=q(),[f,T]=m.useState(""),[g,v]=m.useState(""),[b,N]=m.useState({}),[_,y]=m.useState(""),A=["autonomousOperations",o==null?void 0:o.username],d=I({queryKey:A,queryFn:()=>u.getAutonomousOperations(),enabled:!!(o!=null&&o.is_admin),refetchInterval:3e4,retry:!1}),l=Q({mutationFn:s=>s(),onSuccess:s=>{M.setQueryData(A,s),v(""),N({}),y("")}}),a=d.data,C=l.error instanceof Error?l.error.message:null;if(d.isLoading)return e.jsx("div",{className:"page","aria-busy":"true",children:"Loading autonomous operations…"});if(d.error||!a)return e.jsxs("div",{className:"page",children:[e.jsx("h1",{children:"Autonomous operations unavailable"}),e.jsx("p",{children:d.error instanceof Error?d.error.message:"No status was returned."})]});const k=()=>l.mutate(()=>u.setAutonomousManualMode(!a.manual_mode,a.revision,g)),L=(s,c)=>l.mutate(()=>u.setAutonomousOperator(s,c,a.revision,b[s]??"")),O=()=>{var c;const s=((c=a.baseline)==null?void 0:c.revision)??0;l.mutate(()=>u.qualifyAutonomousChatBaseline(f,s,_))};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(D,{className:"h-8 w-8"}),"Autonomous operations"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Content-free supervision, remote controls, and bounded audit history."})]}),e.jsx(x,{asChild:!0,variant:"outline",children:e.jsxs(H,{to:"/admin-dashboard",children:[e.jsx(F,{className:"h-4 w-4 mr-2"}),"Admin dashboard"]})})]}),a.manual_mode&&e.jsx(n,{className:"cron-status--degraded",role:"status",children:e.jsxs(i,{className:"pt-6 flex gap-3",children:[e.jsx($,{className:"h-5 w-5"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Manual mode is enabled."}),e.jsxs("p",{children:[a.monitoring_active?"Monitoring remains active":"Monitoring is not currently verified","; autonomous callbacks, retries, deployments, and data mutations fail closed."]})]})]})}),e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(n,{className:S[a.display_state],children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Overall state"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-2xl font-bold capitalize",children:a.display_state}),e.jsxs("p",{className:"text-sm",children:["Monitoring ",a.monitoring_active?"active":"inactive"]})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Codex cost"})}),e.jsxs(i,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["$",a.costs.total_usd]}),e.jsxs("p",{className:"text-sm",children:[a.costs.input_tokens+a.costs.output_tokens," tokens"]})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Repair lease"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-lg font-bold",children:a.active_lease?a.active_lease.owner_operator:"Available"}),e.jsx("p",{className:"text-sm",children:a.active_lease?`Expires ${h(a.active_lease.expires_at)}`:"No active source repair"})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Global control"})}),e.jsxs(i,{className:"space-y-2",children:[e.jsx(j,{"aria-label":"Manual mode confirmation",value:g,onChange:s=>v(s.target.value),placeholder:"Type SET_MANUAL_MODE"}),e.jsx(x,{disabled:l.isPending||g!=="SET_MANUAL_MODE",onClick:k,children:a.manual_mode?"Leave manual mode":"Enable manual mode"})]})]})]}),e.jsx("div",{className:"grid md:grid-cols-4 gap-4",children:a.operators.map(s=>e.jsxs(n,{className:S[s.status],children:[e.jsx(t,{children:e.jsxs(r,{className:"flex justify-between gap-2",children:[e.jsx("span",{children:p[s.operator]}),e.jsx(P,{children:s.status})]})}),e.jsxs(i,{className:"space-y-3",children:[e.jsxs("p",{children:[s.enabled?"Mutation enabled":"Mutation disabled"," · monitoring ",s.monitoring_active?"active":"unverified"]}),e.jsxs("p",{className:"text-sm",children:["Next scheduled run: ",s.next_scheduled_run?h(s.next_scheduled_run):"not scheduled"]}),e.jsx(j,{"aria-label":`${p[s.operator]} confirmation`,value:b[s.operator]??"",onChange:c=>N(w=>({...w,[s.operator]:c.target.value})),placeholder:"Type SET_OPERATOR_STATE"}),e.jsx(x,{disabled:l.isPending||a.manual_mode&&!s.enabled||b[s.operator]!=="SET_OPERATOR_STATE",onClick:()=>L(s.operator,!s.enabled),children:s.enabled?"Disable":"Enable"})]})]},s.operator))}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Qualified scalable-chat baseline"})}),e.jsxs(i,{className:"space-y-3",children:[e.jsx("p",{className:"font-mono break-all",children:((E=a.baseline)==null?void 0:E.sha)??"No baseline qualified"}),a.baseline&&e.jsxs("p",{className:"text-sm",children:["Revision ",a.baseline.revision," · ",a.baseline.qualified_by," · ",h(a.baseline.qualified_at)]}),e.jsxs("div",{className:"grid md:grid-cols-[1fr_1fr_auto] gap-2",children:[e.jsx(j,{"aria-label":"Exact baseline SHA",value:f,onChange:s=>T(s.target.value),placeholder:"40-character lowercase commit SHA"}),e.jsx(j,{"aria-label":"Baseline confirmation",value:_,onChange:s=>y(s.target.value),placeholder:"Type QUALIFY_CHAT_BASELINE"}),e.jsx(x,{disabled:l.isPending||!/^[0-9a-f]{40}$/.test(f)||_!=="QUALIFY_CHAT_BASELINE",onClick:O,children:"Qualify exact SHA"})]})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Provider and fallback state"})}),e.jsx(i,{children:a.provider_states.length?e.jsx("ul",{className:"space-y-2",children:a.provider_states.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:s.environment}),": ",s.active_provider," · ",s.reason_code," · manifest ",s.manifest_revision]},s.environment))}):e.jsx("p",{children:"No provider state recorded."})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Recent runs"})}),e.jsx(i,{children:a.recent_runs.length?e.jsx("ul",{className:"space-y-2",children:a.recent_runs.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:p[s.operator]})," · ",s.status," · ",s.exit_classification," · $",s.cost_usd," · ",h(s.created_at)]},s.run_id))}):e.jsx("p",{children:"No runs recorded."})})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Recent actions"})}),e.jsx(i,{children:a.recent_actions.length?e.jsx("ul",{className:"space-y-2",children:a.recent_actions.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:p[s.operator]})," · ",s.capability," · ",s.reason_code," · ",s.resource_kind,"/",s.resource_identifier]},s.action_id))}):e.jsx("p",{children:"No actions recorded."})})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Hard exclusions"})}),e.jsx(i,{children:e.jsx("ul",{className:"list-disc pl-5",children:a.exclusions.map(s=>e.jsx("li",{children:s},s))})})]}),C&&e.jsxs("p",{role:"alert",children:["Control update failed: ",C,". Refresh before retrying."]})]})})};export{Z as default};
|
assets/{BenchmarkDetailView-Cjmbp3Wk.js → BenchmarkDetailView-KHgxcdOQ.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
import{r as F,j as a,y as le,L as ne,b as ot,h as ct,u as dt,d as ut,k as mt}from"./index-DuJU_D27.js";import{R as ht}from"./ResearchFollowButton-BrbOAi4p.js";import{u as te}from"./useQuery-BvOlbTZD.js";import{c as re}from"./catalog-BDn3ESav.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-B3wNcwqv.js";import{L as oe}from"./LatexTitle-DzYgREOe.js";import{S as Ke}from"./switch-BjwgKZLM.js";import{I as xt}from"./components-Dw3DdUAs.js";import{S as ce}from"./skeleton-C2Fuuvyv.js";import{A as bt,a as yt}from"./alert-BEj8j9Sy.js";import{B as wt}from"./BenchmarkTrendSparkline-s0aa2t5Y.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import"./useMutation-BAvuTKgd.js";import"./research-BSQ4hKxD.js";import"./plus-CQhIPr4p.js";import"./papers-Zi3ALD1n.js";import"./hover-card-DfwM1bh1.js";import"./index-C0CsYghm.js";import"./paperQueryKeys-BP2E-0yf.js";import"./colors-CYTXFGTF.js";function _t(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],n=s.filter(l=>l.is_open===!1),i=n.reduce((l,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}function ie(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}const Ge=[{label:"All",maxParametersExclusive:void 0},{label:"<10M",maxParametersExclusive:1e7},{label:"<100M",maxParametersExclusive:1e8},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function St(e){const t=e===null?void 0:Number(e);return Ge.some(r=>r.maxParametersExclusive===t)?t:void 0}function kt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Ct(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Et(e){const t=new Map;for(const r of e){const s=Ct(r),n=t.get(s);if(!n){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}n.metrics={...n.metrics,...r.metrics||{}},n.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(n.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!n.hasParameterConflict&&(n.parameterCount===null?n.parameterCount=r.num_parameters:n.parameterCount!==r.num_parameters&&(n.parameterCount=null,n.hasParameterConflict=!0))}return Array.from(t.values())}function Le(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCount<t)}function Nt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function Ie(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Rt(e){const t=Date.parse(e);return Number.isNaN(t)?"":new Date(t).toISOString().slice(0,10)}function Pt(e){const t=new Map;for(const s of e)s.evaluated_on&&t.set(s.evaluated_on,(t.get(s.evaluated_on)??0)+1);const r=Array.from(t.values()).reduce((s,n)=>s+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function $t(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==Rt(e.updated_at)?r:e.paper_published_date||""}function Mt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Pt(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:$t(u,s)}}).filter(u=>u.value!==null&&!!u.date).sort((u,h)=>u.date.localeCompare(h.date)),i=[];let l=null;for(const u of n){const h=l==null?!0:r==="↓"?u.value<l:u.value>l;h&&(l=u.value),i.push({value:u.value,date:u.date,dateLabel:u.date.slice(0,7),modelName:u.eval.model_name||"",paperTitle:u.eval.paper_title||"",paperRouteId:u.eval.paper_arxiv_id||u.eval.paper_id||null,isSota:h})}const d=e.map(u=>{var h;return{eval:u,value:ie((h=u.metrics)==null?void 0:h[t])}}).filter(u=>u.value!==null).sort((u,h)=>r==="↓"?u.value-h.value:h.value-u.value)[0],f=(d==null?void 0:d.value)??0,x=(d==null?void 0:d.eval.model_name)||(d==null?void 0:d.eval.paper_title)||"";return{points:i,sota:f,sotaModel:x}}function Qe(e,t,r,s){const n=t.find(i=>i.id===s);if(e.length===0)return null;if(n!=null&&n.task_id&&e.some(i=>i.id===n.task_id))return n.task_id;if(r){const i=e.find(l=>l.slug===r);if(i)return i.id}if(e.length===1)return e[0].id;if(t.length>0){const i=new Map;for(const d of t)i.set(d.task_id,(i.get(d.task_id)||0)+1);let l=null,c=-1;for(const d of e){const f=i.get(d.id)||0;f>c&&(c=f,l=d.id)}if(l)return l}return e[0].id}function Tt(e){var _,X,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:c=1}=e,d=Qe(r,t,s,n),f=r.find(o=>o.id===d)||r[0]||null,x=t.find(o=>o.id===n),u=_t(t,d,e.hideClosed),h=Et(u.visible),R=Le(h,i),E=e.configuredMetrics.map(o=>o.metric_name),L=Array.from(new Set(h.flatMap(o=>[...o.best_metric?[o.best_metric]:[],...Object.keys(o.metrics||{})]))),S=E.length?E:L,g=new Map;for(const o of h){const m=o.best_metric;!m||ie(o.metrics[m])===null||E.length&&!S.includes(m)||g.set(m,(g.get(m)||0)+1)}const k=((_=[...g].sort((o,m)=>m[1]-o[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(o=>{var m;return o.toLocaleLowerCase()===((m=e.metric)==null?void 0:m.trim().toLocaleLowerCase())})||(x==null?void 0:x.best_metric)||k,D=((X=e.directions)==null?void 0:X.directions[j])==="lower_is_better"?"↓":"↑",W=j&&S.includes(j)?[j,...S.filter(o=>o!==j)]:S,w=W.length?l?W:W.slice(0,Math.max(1,c)):j?[j]:[],q=R.slice().sort((o,m)=>{const p=ie(o.metrics[j]),y=ie(m.metrics[j]);return p!==null&&y!==null?D==="↓"?p-y:y-p:p!==null?-1:y!==null?1:Ie(o,j)-Ie(m,j)});let I=null,N=0;const Q=q.map((o,m)=>{const p=ie(o.metrics[j]);return p!==null&&p!==I&&(I=p,N=m+1),{evaluation:o,rank:p===null?null:N,isHighlighted:Nt(o,n)}}),{points:z,sota:ee,sotaModel:O}=Mt(R,j,D),$=i===void 0?e.initialSummary:void 0,U=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),K={parameter_coverage_known:h.filter(o=>o.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:D,allowedMetrics:S,orderedMetrics:W,visibleMetrics:w,rows:Q,chartPoints:z,highlightedEval:((Y=Q.find(o=>o.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:u.hiddenClosed,hiddenClosedTopEval:u.topHiddenClosed,parameterBound:i,parameterCoverage:K,hasParameterMetadata:K.parameter_coverage_known>0,parameterFilters:Ge.map(o=>({...o,selected:i===o.maxParametersExclusive,disabled:i!==o.maxParametersExclusive&&Le(h,o.maxParametersExclusive).length===0})),displayedMetric:U?j:$==null?void 0:$.metric,displayedSota:U?ee:$==null?void 0:$.value,displayedSotaModel:U?O:$==null?void 0:$.model_name,isSummaryLoading:!U&&!$,isInitialFilteredViewLoading:i!==void 0&&!U}}function Ft(e,t,r,s=1,n=0){const i=e-t.fixed-(r?t.harness:0);if(t.metric<=0)return 1;const l=Math.floor(i/t.metric);if(l<s)return Math.max(1,l);const c=Math.floor((i-n)/t.metric);return Math.max(1,s,c)}function he(e,t){return parseFloat(e.getPropertyValue(t))||0}function Lt(e){const t=getComputedStyle(e);return{fixed:["--bm-rank-width","--bm-model-width","--bm-parameters-width","--bm-paper-width","--bm-year-width"].reduce((r,s)=>r+he(t,s),0),harness:he(t,"--bm-harness-width"),metric:he(t,"--bm-metric-width")}}const It=20;function Ae(e,t){return e?a.jsx(oe,{title:e}):t||"—"}function At({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:c,arrow:d}=e,[f,x]=F.useState(null);return F.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const E=f.clientWidth,L=Lt(R),S=document.documentElement,g=S.scrollHeight>S.clientHeight?0:It;n(k=>Ft(E,L,t,k,g))},h=new ResizeObserver(u);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),u(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:x,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:a.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":l.length,"--bm-harness-count":t?1:0},children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"bm-width-rank"}),a.jsx("col",{className:"bm-width-model"}),a.jsx("col",{className:"bm-width-parameters"}),t&&a.jsx("col",{className:"bm-width-harness"}),l.map(u=>a.jsx("col",{className:"bm-width-metric"},u)),a.jsx("col",{}),a.jsx("col",{className:"bm-width-year"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"col-rank",children:"Rank"}),a.jsx("th",{className:"col-model",children:"Model"}),a.jsx("th",{className:"col-parameters",children:"Parameters"}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),l.map(u=>{const h=u===c;return a.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?d==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${d}`:""]})},u)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:u,rank:h,isHighlighted:R})=>{var S;const E=u.paper_arxiv_id||u.paper_id,L=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:R?s:void 0,className:R?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[R&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?a.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&a.jsx(ft,{}),(u.external??u.is_external)&&a.jsx(pt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),a.jsx("td",{className:"col-parameters",title:u.parameterCount===null?void 0:u.parameterCount.toLocaleString("en-US"),"aria-label":u.parameterCount===null?"Parameters unknown":`${u.parameterCount.toLocaleString("en-US")} parameters`,children:u.parameterCount===null?"—":kt(u.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:u.harness||"—"}),l.map(g=>{var j;const k=g===c,B=(j=u.metrics)==null?void 0:j[g];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:B!=null&&B!==""?le(B):"—"},g)}),a.jsx("td",{className:"col-paper",children:E?a.jsx(ne,{to:`/paper/${E}`,title:u.paper_title||L||void 0,children:Ae(u.paper_title,L)}):Ae(u.paper_title,L)}),a.jsx("td",{className:"col-year",children:((S=u.evaluated_on||u.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},u.id)})})]})})}function Be(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 Bt(e,t){if(e===t){const{year:d,month:f}=pe(e);return[{timestamp:new Date(d,f,1).getTime(),key:`${d}-${f}`,label:`${fe[f]} ${d}`}]}const r=pe(e),s=pe(t);if(r.year===s.year){const d=s.month-r.month+1;let f=1;const x=12;d>x&&(f=Math.ceil(d/x));const u=[];for(let h=r.month;h<=s.month;h+=f)u.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${fe[h]} ${r.year}`:fe[h]});return u}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const c=[];for(let d=r.year;d<=s.year;d+=i)c.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return c}const Dt=({points:e,metric:t})=>{const r=ot(),[s,n]=F.useState(null),i=880,l=320,c=60,d=30,f=40,x=50,u=e.map(o=>o.value),h=Math.min(...u),E=Math.max(...u)-h||1,L=i-c-d,S=l-f-x,g=e.map(o=>Be(o.date)),k=Math.min(...g),B=Math.max(...g),j=B-k||1,D=o=>k===B?c+L/2:c+(o-k)/j*L,W=e.map((o,m)=>{const p=D(Be(o.date)),y=(o.value-h)/E,P=f+S*(1-y);return{x:p,y:P,data:o,idx:m}}),w=W.filter(o=>o.data.isSota);let q="";if(w.length>=2){q=`M${w[0].x},${w[0].y}`;for(let o=1;o<w.length;o++){const m=w[o-1],p=w[o],y=(m.x+p.x)/2;q+=` C${y},${m.y} ${y},${p.y} ${p.x},${p.y}`}}const I=5.4,N=8,Q=9,z=o=>{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const p=m.length>22?m.slice(0,21)+"…":m,y=p.length*I;let P=o.x-y/2,C=o.x+y/2,v="middle";return P<c?(P=c,C=c+y,v="start"):C>i-d&&(C=i-d,P=C-y,v="end"),{x:v==="start"?c:v==="end"?i-d:o.x,y:o.y-Q,text:p,anchor:v,left:P,right:C}},ee=[],O=w.length>0?z(w[w.length-1]):null;let $=-1/0;for(let o=0;o<w.length-1;o++){const m=z(w[o]);m&&(m.left<$+N||O&&m.right>O.left-N||($=m.right,ee.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}O&&ee.push({x:O.x,y:O.y,text:O.text,anchor:O.anchor});const U=Bt(k,B),K=5,_=o=>n(m=>m===o?null:m),X=o=>{o&&r(`/paper/${o}`)},Y=(o,m)=>{const y=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${le(o.data.value)} on ${o.data.dateLabel}`,P=!!o.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:P?"pointer":"default",outline:"none"},tabIndex:0,role:P?"link":"img","aria-label":y,onMouseEnter:()=>n(o.idx),onMouseLeave:()=>_(o.idx),onFocus:()=>n(o.idx),onBlur:()=>_(o.idx),onClick:()=>X(o.data.paperRouteId),onKeyDown:C=>{P&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),X(o.data.paperRouteId))},children:a.jsx("title",{children:y})})]},o.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:c-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${f+S/2})`,children:t}),Array.from({length:K}).map((o,m)=>{const p=m/(K-1),y=f+S*(1-p),P=h+E*p;return a.jsxs("g",{children:[a.jsx("line",{x1:c,y1:y,x2:i-d,y2:y,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:c-10,y:y+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(P)})]},m)}),U.map(o=>{const m=D(o.timestamp);return a.jsx("text",{x:m,y:l-x+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),W.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),q&&a.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((o,m)=>a.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&W[s]&&(()=>{const o=W[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",y=`${m.length>40?m.slice(0,39)+"…":m}: ${le(o.data.value)}`,C=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=o.x-C/2;H<c&&(H=c),H+C>i-d&&(H=i-d-C);const G=o.y-v-14>=f?o.y-v-12:o.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:H,y:G,width:C,height:v,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:H+12,y:G+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:y})]})})()]})};function Ht(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(n),t&&(s.href=t),n.href=e,n.href}const Vt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Z(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let ae=null;function Xe(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=Z(window.getComputedStyle(document.documentElement)),ae))}function de(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Wt(e){const t=de(e,"border-left-width"),r=de(e,"border-right-width");return e.clientWidth+t+r}function Ot(e){const t=de(e,"border-top-width"),r=de(e,"border-bottom-width");return e.clientHeight+t+r}function Ye(e,t={}){const r=t.width||Wt(e),s=t.height||Ot(e);return{width:r,height:s}}function Ut(){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 V=16384;function qt(e){(e.width>V||e.height>V)&&(e.width>V&&e.height>V?e.width>e.height?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V):e.width>V?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V))}function zt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=s.length,i=new Uint8Array(n);for(let l=0;l<n;l+=1)i[l]=s.charCodeAt(l);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ue(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Kt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Gt(e,t,r){const s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),n.appendChild(i),i.appendChild(e),Kt(n)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function Qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Xt(e,t){return Xe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Yt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?Qt(r):Xt(r,s);return document.createTextNode(`${n}{${i}}`)}function De(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=Vt();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Yt(l,r,n,s)),t.appendChild(c)}function Jt(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const He="application/font-woff",Ve="image/jpeg",Zt={woff:He,woff2:He,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ve,jpeg:Ve,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function er(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=er(e).toLowerCase();return Zt[t]||""}function tr(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function rr(e,t){return`data:${t};base64,${e}`}async function Je(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const n=await s.blob();return new Promise((i,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(n)})}const ge={};function ar(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function we(e,t,r){const s=ar(e,t,r.includeQueryParams);if(ge[s]!=null)return ge[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Je(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),tr(c)));n=rr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return ge[s]=n,n}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ue(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const c=i.toDataURL();return ue(c)}const r=e.poster,s=ye(r),n=await we(r,s,t);return ue(n)}async function ir(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await me(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function lr(e,t){return A(e,HTMLCanvasElement)?sr(e):A(e,HTMLVideoElement)?nr(e,t):A(e,HTMLIFrameElement)?ir(e,t):e.cloneNode(Ze(e))}const or=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function cr(e,t,r){var s,n;if(Ze(t))return t;let i=[];return or(e)&&e.assignedNodes?i=Z(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=Z(e.contentDocument.body.childNodes):i=Z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>me(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function dr(e,t,r){const s=t.style;if(!s)return;const n=window.getComputedStyle(e);n.cssText?(s.cssText=n.cssText,s.transformOrigin=n.transformOrigin):Xe(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,n.getPropertyPriority(i))})}function ur(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function mr(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function hr(e,t,r){return A(t,Element)&&(dr(e,t,r),Jt(e,t,r),ur(e,t),mr(e,t)),t}async function fr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const c=r[i].getAttribute("xlink:href");if(c){const d=e.querySelector(c),f=document.querySelector(c);!d&&f&&!s[c]&&(s[c]=await me(f,t,!0))}}const n=Object.values(s);if(n.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const c=document.createElementNS(i,"defs");l.appendChild(c);for(let d=0;d<n.length;d++)c.appendChild(n[d]);e.appendChild(l)}return e}async function me(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>lr(s,t)).then(s=>cr(e,s,t)).then(s=>hr(e,s,t)).then(s=>fr(s,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function xr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function br(e){const t=[];return e.replace(et,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function yr(e,t,r,s,n){try{const i=r?Ht(t,r):t,l=ye(t);let c;return n||(c=await we(i,l,s)),e.replace(xr(t),`$1${c}$3`)}catch{}return e}function wr(e,{preferredFontFormat:t}){return t?e.replace(gr,r=>{for(;;){const[s,,n]=pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function tt(e){return e.search(et)!==-1}async function rt(e,t,r){if(!tt(e))return e;const s=wr(e,r);return br(s).reduce((i,l)=>i.then(c=>yr(c,l,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const n=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(n){const i=await rt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function vr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function jr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(A(e,SVGImageElement)&&!xe(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,n=await we(s,ye(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(f){l(f)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function _r(e,t){const s=Z(e.childNodes).map(n=>at(n,t));await Promise.all(s).then(()=>e)}async function at(e,t){A(e,Element)&&(await vr(e,t),await jr(e,t),await _r(e,t))}function Sr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(n=>{r[n]=s[n]}),e}const We={};async function Oe(e){let t=We[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},We[e]=t,t}async function Ue(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),Je(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function qe(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=n.exec(s);if(d===null)break;t.push(d[0])}s=s.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=c.exec(s),d===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(d[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const d=i.href,f=Oe(d).then(x=>Ue(x,t)).then(x=>qe(x).forEach(u=>{try{n.insertRule(u,u.startsWith("@import")?c+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:u,error:h})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(f)}})}catch(i){const l=e.find(c=>c.href==null)||document.styleSheets[0];n.href!=null&&s.push(Oe(n.href).then(c=>Ue(c,t)).then(c=>qe(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function Cr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function Er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await kr(r,t);return Cr(s)}function st(e){return e.trim().replace(/["']/g,"")}function Nr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(st(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Rr(e,t){const r=await Er(e,t),s=Nr(e);return(await Promise.all(r.filter(i=>s.has(st(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return rt(i.cssText,l,t)}))).join(`
|
| 2 |
`)}async function Pr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Rr(e,t);if(r){const s=document.createElement("style"),n=document.createTextNode(r);s.appendChild(n),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function $r(e,t={}){const{width:r,height:s}=Ye(e,t),n=await me(e,t,!0);return await Pr(n,t),await at(n,t),Sr(n,t),await Gt(n,r,s)}async function Mr(e,t={}){const{width:r,height:s}=Ye(e,t),n=await $r(e,t),i=await ue(n),l=document.createElement("canvas"),c=l.getContext("2d"),d=t.pixelRatio||Ut(),f=t.canvasWidth||r,x=t.canvasHeight||s;return l.width=f*d,l.height=x*d,t.skipAutoScale||qt(l),l.style.width=`${f}`,l.style.height=`${x}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function Tr(e,t={}){const r=await Mr(e,t);return await zt(r)}const be="#ffffff";function Fr(){return typeof window>"u"?be:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||be}function Lr(e){if(typeof window>"u")return be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Fr():t}async function Ir(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Tr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Lr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const nt=({targetRef:e,label:t})=>{const{toast:r}=ct(),[s,n]=F.useState("idle"),i=F.useRef(null);F.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=F.useCallback(async()=>{const d=e.current;if(d){n("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(f=>window.requestAnimationFrame(()=>f()));try{await Ir(d),n("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>n("idle"),1500)}catch(f){n("idle"),r({title:"Copy failed",description:f instanceof Error&&f.message?f.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),c=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return a.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[a.jsx(xt,{name:"copy",size:11}),c]})};function Ar({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:n}){const i=F.useRef(null),{isInitialFilteredViewLoading:l,chartPoints:c,activeMetric:d,allowedMetrics:f,orderedMetrics:x,parameterBound:u}=e;return l||c.length===0?null:a.jsxs("div",{className:"bm-card",ref:i,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:t})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),a.jsxs("div",{className:"bm-card-actions",children:[f.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:d,onChange:h=>n(h.target.value),children:x.map(h=>a.jsx("option",{value:h,children:h},h))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!r,onCheckedChange:h=>{s(!h)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),a.jsx(nt,{targetRef:i,label:"SOTA chart"})]})]}),a.jsx("div",{className:"bm-chart-wrap",children:a.jsx(Dt,{points:c,metric:d})}),a.jsxs("div",{className:"bm-chart-foot",children:[a.jsx("span",{className:"legend-dot"}),u===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]})}function Br(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function ze(e,t){return e?a.jsx(oe,{title:e}):t||"—"}const ia=()=>{var ve,je,_e,Se,ke,Ce,Ee,Ne,Re,Pe,$e;const{datasetSlug:e}=dt(),[t,r]=ut(),s=t.get("task")||void 0,n=t.get("eval")||void 0,i=St(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:c}=mt(),d=F.useRef(null),f=F.useRef(!1),x=F.useRef(null),[u,h]=F.useState(null),R=`${e}:${s||""}`,E=u===R,[L,S]=F.useState(1),g=te({queryKey:["dataset",e,"with-paper",s,l.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:s,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),k=te({queryKey:["dataset-evals",(ve=g.data)==null?void 0:ve.id],queryFn:()=>gt.byDataset(g.data.id),enabled:!!((je=g.data)!=null&&je.id),staleTime:5*60*1e3}),B=te({queryKey:["dataset-tasks",(_e=g.data)==null?void 0:_e.id],queryFn:()=>re.datasetTasks(g.data.id),enabled:!!((Se=g.data)!=null&&Se.id),staleTime:10*60*1e3}),j=te({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),D=Qe(B.data||[],k.data||[],s,n),W=te({queryKey:["task-benchmark-trends",D,l.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(D,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!D&&!!((ke=g.data)!=null&&ke.id),staleTime:10*60*1e3}),w=F.useMemo(()=>{var b;return(((b=W.data)==null?void 0:b.results)||[]).find(M=>{var T;return M.id===((T=g.data)==null?void 0:T.id)})||null},[W.data,(Ce=g.data)==null?void 0:Ce.id]),q=te({queryKey:["leaderboard-metrics",(Ee=g.data)==null?void 0:Ee.id,D],queryFn:()=>re.leaderboardMetrics(g.data.id,D),enabled:!!((Ne=g.data)!=null&&Ne.id)&&!!D,staleTime:10*60*1e3}),I=Tt({evaluations:k.data||[],tasks:B.data||[],configuredMetrics:q.data||[],directions:j.data,initialSummary:(Re=g.data)==null?void 0:Re.leaderboard_summary,taskSlug:s,highlightEvalId:n,metric:t.get("metric")||void 0,hideClosed:l.hide_closed_source_evals,parameterBound:i,showMoreMetrics:E,fittingMetricCount:L,ready:{evaluations:k.isSuccess,tasks:B.isSuccess,directions:j.isSuccess,metrics:q.isSuccess}}),{primaryTask:N,hiddenClosedEvals:Q,hiddenClosedTopEval:z,isSummaryLoading:ee,displayedMetric:O,displayedSota:$,displayedSotaModel:U,isInitialFilteredViewLoading:K,highlightedEval:_,hasParameterMetadata:X,parameterCoverage:Y,orderedMetrics:o}=I;F.useEffect(()=>{if(f.current||!n||!k.data||k.data.length===0)return;const b=d.current;b&&(f.current=!0,b.scrollIntoView({behavior:"smooth",block:"start"}))},[n,k.data]);const m=te({queryKey:["area",N==null?void 0:N.area_id],queryFn:()=>re.getArea(N.area_id),enabled:!!(N!=null&&N.area_id),staleTime:10*60*1e3});if(g.isLoading)return a.jsxs("div",{className:"page",children:[a.jsx(ce,{className:"h-12 w-1/2 mb-6"}),a.jsx(ce,{className:"h-64 w-full"})]});if(g.error||!g.data)return a.jsx("div",{className:"page",children:a.jsx(bt,{variant:"destructive",children:a.jsx(yt,{children:"Benchmark not found."})})});const p=g.data,y=!!p.supports_harness,P=b=>{r(M=>{const T=new URLSearchParams(M);return b===void 0?T.delete("max_parameters_exclusive"):T.set("max_parameters_exclusive",String(b)),T})},C=b=>{r(M=>{const T=new URLSearchParams(M);return T.set("metric",b),T})},v=p.introducing_paper??void 0,H=(v==null?void 0:v.arxiv_id)||(v==null?void 0:v.id)||Br(p.paper_url),J=(v==null?void 0:v.title)||p.introducing_paper_title||null,G=((Pe=v==null?void 0:v.published)==null?void 0:Pe.slice(0,4))||p.introduced_year||null,it=!!H||!!p.paper_url||!!J,lt=v!=null&&v.arxiv_id||($e=p.paper_url)!=null&&$e.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${H}`:`Paper ${H}`;return a.jsx("div",{className:"page",children:a.jsxs("div",{className:"bm-page",children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(ne,{to:"/tasks",children:"Tasks"}),m.data&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks#area-${jt(m.data.name)}`,children:m.data.name})]}),N&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks/${N.slug||N.id}`,children:N.name})]}),a.jsx("span",{className:"sep",children:"/"}),a.jsx("span",{style:{color:"var(--accent-text)"},children:p.name})]}),a.jsxs("div",{className:"bm-title-row",children:[a.jsx("h1",{className:"bm-title",children:p.name}),w&&a.jsxs("div",{className:"bm-title-trend","aria-label":`${p.name} reporting trend`,children:[a.jsx(wt,{history:w.history,benchmarkName:w.name}),a.jsxs("span",{className:"bm-title-trend-summary",children:[a.jsx("strong",{children:w.recent_paper_count})," ",w.recent_paper_count===1?"paper":"papers",w.rate_change==null?w.recent_paper_count>0&&a.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):a.jsxs("span",{className:`benchmark-trend-change ${w.rate_change>=1?"is-up":"is-down"}`,children:[w.rate_change>=1?"↑":"↓"," ",w.rate_change.toFixed(1),"×"]})]})]})]}),a.jsx(ht,{kind:"benchmark",entityId:p.id}),a.jsxs("div",{className:"bm-subtitle",children:[ee?a.jsx(ce,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):a.jsxs("span",{children:[O&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"metric-tag",children:O}),a.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),U?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:le($)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:U})]}):a.jsxs("span",{children:[I.rows.length," evaluations"]})]}),p.hf_url&&a.jsxs("a",{className:"bm-action-btn",href:p.hf_url,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),p.description&&a.jsx("p",{className:"bm-description",children:p.description}),l.hide_closed_source_evals&&Q.length>0&&a.jsxs("div",{className:"bm-hidden-closed-notice",children:[a.jsxs("span",{children:[Q.length," closed-source ",Q.length===1?"row is":"rows are"," hidden",z!=null&&z.model_name?a.jsxs(a.Fragment,{children:[", including ",a.jsx("strong",{children:z.model_name})]}):null,"."]}),a.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{c(!1)},children:"Show closed-source"})]}),it&&a.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[a.jsx("span",{className:"method-source-label",children:"Source"}),H?a.jsxs(ne,{to:`/paper/${H}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(oe,{title:J}):lt}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):p.paper_url?a.jsxs("a",{href:vt(p.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(oe,{title:J}):p.paper_url}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):a.jsxs("div",{className:"method-source-link is-static",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(oe,{title:J}):null}),G&&a.jsx("span",{className:"method-source-meta",children:G})]})]}),a.jsx(Ar,{model:I,datasetName:p.name,hideClosed:l.hide_closed_source_evals,setHideClosed:c,setMetric:C}),_&&(()=>{var Te,Fe;const b=_.paper_arxiv_id||_.paper_id,M=_.paper_title||(_.paper_arxiv_id?`arXiv:${_.paper_arxiv_id}`:null),T=_.best_metric&&((Te=_.metrics)==null?void 0:Te[_.best_metric])!==void 0?_.best_metric:I.activeMetric,Me=(Fe=_.metrics)==null?void 0:Fe[T];return a.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[a.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),a.jsxs("div",{className:"bm-highlight-text",children:[a.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),a.jsxs("span",{className:"bm-highlight-paper",children:[_.model_name||M||"—",_.harness?` · ${_.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Me!==void 0&&T?a.jsxs(a.Fragment,{children:[T,": ",le(Me),M?" · ":""]}):null,b?a.jsx(ne,{to:`/paper/${b}`,children:ze(_.paper_title,M)}):ze(_.paper_title,M)]})]})]})})(),a.jsxs("div",{className:"bm-card",ref:x,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:p.name})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),a.jsxs("div",{className:"bm-card-actions",children:[I.allowedMetrics.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:I.activeMetric,onChange:b=>C(b.target.value),children:o.map(b=>a.jsx("option",{value:b,children:b},b))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:b=>{c(!b)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!K&&!X&&k.isSuccess?a.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,a.jsx(nt,{targetRef:x,label:"leaderboard"})]})]}),!K&&X&&a.jsxs("div",{className:"bm-parameter-filter-bar",children:[a.jsx("span",{className:"bm-parameter-filter-label",children:"Parameters Size"}),a.jsx("div",{className:"bm-parameter-filter-options",role:"group","aria-label":"Filter leaderboard by parameter size",children:I.parameterFilters.map(b=>{const{selected:M,disabled:T}=b;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${M?" is-active":""}`,"aria-pressed":M,disabled:T,onClick:()=>P(b.maxParametersExclusive),children:b.label},b.label)})}),a.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",Y.parameter_coverage_known," of ",Y.parameter_coverage_total," entries"]})]}),k.isLoading||K?a.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((b,M)=>a.jsx(ce,{className:"h-10 w-full mb-2"},M))}):I.rows.length===0?i?a.jsxs("div",{className:"no-results",children:["No known parameter counts match this filter. "," ",a.jsx("button",{type:"button",className:"bm-empty-filter-action",onClick:()=>P(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[o.length>L&&a.jsxs("div",{className:"bm-metric-columns-control",children:[a.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":E,"aria-controls":"benchmark-leaderboard",onClick:()=>h(E?null:R),children:E?"Show fewer metrics":`Show more metrics (${o.length-L})`}),E&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(At,{model:I,showHarness:y,setMetric:C,highlightRowRef:d,onFittingMetricCountChange:S})]})]})]})})};export{ia as default};
|
|
|
|
| 1 |
+
import{r as F,j as a,y as le,L as ne,b as ot,h as ct,u as dt,d as ut,k as mt}from"./index-DAAEdKQ4.js";import{R as ht}from"./ResearchFollowButton-DNrVdY8G.js";import{u as te}from"./useQuery-BALok3Po.js";import{c as re}from"./catalog-Cjgxq75q.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-D1UcoJqH.js";import{L as oe}from"./LatexTitle-lQiG5mCP.js";import{S as Ke}from"./switch-Bow6oaVX.js";import{I as xt}from"./components-BWWnJ95m.js";import{S as ce}from"./skeleton-Te-nsRWB.js";import{A as bt,a as yt}from"./alert-B_MWtfva.js";import{B as wt}from"./BenchmarkTrendSparkline-BaDbn_eF.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import"./useMutation-D4cqMKzD.js";import"./research--raTfZxI.js";import"./plus-B07MagLg.js";import"./papers-DL8dzFlM.js";import"./hover-card-DUYUZUhh.js";import"./index-DRLEC3qz.js";import"./paperQueryKeys-BP2E-0yf.js";import"./colors-DR110Nc2.js";function _t(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],n=s.filter(l=>l.is_open===!1),i=n.reduce((l,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}function ie(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}const Ge=[{label:"All",maxParametersExclusive:void 0},{label:"<10M",maxParametersExclusive:1e7},{label:"<100M",maxParametersExclusive:1e8},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function St(e){const t=e===null?void 0:Number(e);return Ge.some(r=>r.maxParametersExclusive===t)?t:void 0}function kt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Ct(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Et(e){const t=new Map;for(const r of e){const s=Ct(r),n=t.get(s);if(!n){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}n.metrics={...n.metrics,...r.metrics||{}},n.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(n.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!n.hasParameterConflict&&(n.parameterCount===null?n.parameterCount=r.num_parameters:n.parameterCount!==r.num_parameters&&(n.parameterCount=null,n.hasParameterConflict=!0))}return Array.from(t.values())}function Le(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCount<t)}function Nt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function Ie(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Rt(e){const t=Date.parse(e);return Number.isNaN(t)?"":new Date(t).toISOString().slice(0,10)}function Pt(e){const t=new Map;for(const s of e)s.evaluated_on&&t.set(s.evaluated_on,(t.get(s.evaluated_on)??0)+1);const r=Array.from(t.values()).reduce((s,n)=>s+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function $t(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==Rt(e.updated_at)?r:e.paper_published_date||""}function Mt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Pt(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:$t(u,s)}}).filter(u=>u.value!==null&&!!u.date).sort((u,h)=>u.date.localeCompare(h.date)),i=[];let l=null;for(const u of n){const h=l==null?!0:r==="↓"?u.value<l:u.value>l;h&&(l=u.value),i.push({value:u.value,date:u.date,dateLabel:u.date.slice(0,7),modelName:u.eval.model_name||"",paperTitle:u.eval.paper_title||"",paperRouteId:u.eval.paper_arxiv_id||u.eval.paper_id||null,isSota:h})}const d=e.map(u=>{var h;return{eval:u,value:ie((h=u.metrics)==null?void 0:h[t])}}).filter(u=>u.value!==null).sort((u,h)=>r==="↓"?u.value-h.value:h.value-u.value)[0],f=(d==null?void 0:d.value)??0,x=(d==null?void 0:d.eval.model_name)||(d==null?void 0:d.eval.paper_title)||"";return{points:i,sota:f,sotaModel:x}}function Qe(e,t,r,s){const n=t.find(i=>i.id===s);if(e.length===0)return null;if(n!=null&&n.task_id&&e.some(i=>i.id===n.task_id))return n.task_id;if(r){const i=e.find(l=>l.slug===r);if(i)return i.id}if(e.length===1)return e[0].id;if(t.length>0){const i=new Map;for(const d of t)i.set(d.task_id,(i.get(d.task_id)||0)+1);let l=null,c=-1;for(const d of e){const f=i.get(d.id)||0;f>c&&(c=f,l=d.id)}if(l)return l}return e[0].id}function Tt(e){var _,X,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:c=1}=e,d=Qe(r,t,s,n),f=r.find(o=>o.id===d)||r[0]||null,x=t.find(o=>o.id===n),u=_t(t,d,e.hideClosed),h=Et(u.visible),R=Le(h,i),E=e.configuredMetrics.map(o=>o.metric_name),L=Array.from(new Set(h.flatMap(o=>[...o.best_metric?[o.best_metric]:[],...Object.keys(o.metrics||{})]))),S=E.length?E:L,g=new Map;for(const o of h){const m=o.best_metric;!m||ie(o.metrics[m])===null||E.length&&!S.includes(m)||g.set(m,(g.get(m)||0)+1)}const k=((_=[...g].sort((o,m)=>m[1]-o[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(o=>{var m;return o.toLocaleLowerCase()===((m=e.metric)==null?void 0:m.trim().toLocaleLowerCase())})||(x==null?void 0:x.best_metric)||k,D=((X=e.directions)==null?void 0:X.directions[j])==="lower_is_better"?"↓":"↑",W=j&&S.includes(j)?[j,...S.filter(o=>o!==j)]:S,w=W.length?l?W:W.slice(0,Math.max(1,c)):j?[j]:[],q=R.slice().sort((o,m)=>{const p=ie(o.metrics[j]),y=ie(m.metrics[j]);return p!==null&&y!==null?D==="↓"?p-y:y-p:p!==null?-1:y!==null?1:Ie(o,j)-Ie(m,j)});let I=null,N=0;const Q=q.map((o,m)=>{const p=ie(o.metrics[j]);return p!==null&&p!==I&&(I=p,N=m+1),{evaluation:o,rank:p===null?null:N,isHighlighted:Nt(o,n)}}),{points:z,sota:ee,sotaModel:O}=Mt(R,j,D),$=i===void 0?e.initialSummary:void 0,U=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),K={parameter_coverage_known:h.filter(o=>o.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:D,allowedMetrics:S,orderedMetrics:W,visibleMetrics:w,rows:Q,chartPoints:z,highlightedEval:((Y=Q.find(o=>o.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:u.hiddenClosed,hiddenClosedTopEval:u.topHiddenClosed,parameterBound:i,parameterCoverage:K,hasParameterMetadata:K.parameter_coverage_known>0,parameterFilters:Ge.map(o=>({...o,selected:i===o.maxParametersExclusive,disabled:i!==o.maxParametersExclusive&&Le(h,o.maxParametersExclusive).length===0})),displayedMetric:U?j:$==null?void 0:$.metric,displayedSota:U?ee:$==null?void 0:$.value,displayedSotaModel:U?O:$==null?void 0:$.model_name,isSummaryLoading:!U&&!$,isInitialFilteredViewLoading:i!==void 0&&!U}}function Ft(e,t,r,s=1,n=0){const i=e-t.fixed-(r?t.harness:0);if(t.metric<=0)return 1;const l=Math.floor(i/t.metric);if(l<s)return Math.max(1,l);const c=Math.floor((i-n)/t.metric);return Math.max(1,s,c)}function he(e,t){return parseFloat(e.getPropertyValue(t))||0}function Lt(e){const t=getComputedStyle(e);return{fixed:["--bm-rank-width","--bm-model-width","--bm-parameters-width","--bm-paper-width","--bm-year-width"].reduce((r,s)=>r+he(t,s),0),harness:he(t,"--bm-harness-width"),metric:he(t,"--bm-metric-width")}}const It=20;function Ae(e,t){return e?a.jsx(oe,{title:e}):t||"—"}function At({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:c,arrow:d}=e,[f,x]=F.useState(null);return F.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const E=f.clientWidth,L=Lt(R),S=document.documentElement,g=S.scrollHeight>S.clientHeight?0:It;n(k=>Ft(E,L,t,k,g))},h=new ResizeObserver(u);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),u(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:x,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:a.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":l.length,"--bm-harness-count":t?1:0},children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"bm-width-rank"}),a.jsx("col",{className:"bm-width-model"}),a.jsx("col",{className:"bm-width-parameters"}),t&&a.jsx("col",{className:"bm-width-harness"}),l.map(u=>a.jsx("col",{className:"bm-width-metric"},u)),a.jsx("col",{}),a.jsx("col",{className:"bm-width-year"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"col-rank",children:"Rank"}),a.jsx("th",{className:"col-model",children:"Model"}),a.jsx("th",{className:"col-parameters",children:"Parameters"}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),l.map(u=>{const h=u===c;return a.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?d==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${d}`:""]})},u)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:u,rank:h,isHighlighted:R})=>{var S;const E=u.paper_arxiv_id||u.paper_id,L=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:R?s:void 0,className:R?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[R&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?a.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&a.jsx(ft,{}),(u.external??u.is_external)&&a.jsx(pt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),a.jsx("td",{className:"col-parameters",title:u.parameterCount===null?void 0:u.parameterCount.toLocaleString("en-US"),"aria-label":u.parameterCount===null?"Parameters unknown":`${u.parameterCount.toLocaleString("en-US")} parameters`,children:u.parameterCount===null?"—":kt(u.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:u.harness||"—"}),l.map(g=>{var j;const k=g===c,B=(j=u.metrics)==null?void 0:j[g];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:B!=null&&B!==""?le(B):"—"},g)}),a.jsx("td",{className:"col-paper",children:E?a.jsx(ne,{to:`/paper/${E}`,title:u.paper_title||L||void 0,children:Ae(u.paper_title,L)}):Ae(u.paper_title,L)}),a.jsx("td",{className:"col-year",children:((S=u.evaluated_on||u.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},u.id)})})]})})}function Be(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 Bt(e,t){if(e===t){const{year:d,month:f}=pe(e);return[{timestamp:new Date(d,f,1).getTime(),key:`${d}-${f}`,label:`${fe[f]} ${d}`}]}const r=pe(e),s=pe(t);if(r.year===s.year){const d=s.month-r.month+1;let f=1;const x=12;d>x&&(f=Math.ceil(d/x));const u=[];for(let h=r.month;h<=s.month;h+=f)u.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${fe[h]} ${r.year}`:fe[h]});return u}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const c=[];for(let d=r.year;d<=s.year;d+=i)c.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return c}const Dt=({points:e,metric:t})=>{const r=ot(),[s,n]=F.useState(null),i=880,l=320,c=60,d=30,f=40,x=50,u=e.map(o=>o.value),h=Math.min(...u),E=Math.max(...u)-h||1,L=i-c-d,S=l-f-x,g=e.map(o=>Be(o.date)),k=Math.min(...g),B=Math.max(...g),j=B-k||1,D=o=>k===B?c+L/2:c+(o-k)/j*L,W=e.map((o,m)=>{const p=D(Be(o.date)),y=(o.value-h)/E,P=f+S*(1-y);return{x:p,y:P,data:o,idx:m}}),w=W.filter(o=>o.data.isSota);let q="";if(w.length>=2){q=`M${w[0].x},${w[0].y}`;for(let o=1;o<w.length;o++){const m=w[o-1],p=w[o],y=(m.x+p.x)/2;q+=` C${y},${m.y} ${y},${p.y} ${p.x},${p.y}`}}const I=5.4,N=8,Q=9,z=o=>{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const p=m.length>22?m.slice(0,21)+"…":m,y=p.length*I;let P=o.x-y/2,C=o.x+y/2,v="middle";return P<c?(P=c,C=c+y,v="start"):C>i-d&&(C=i-d,P=C-y,v="end"),{x:v==="start"?c:v==="end"?i-d:o.x,y:o.y-Q,text:p,anchor:v,left:P,right:C}},ee=[],O=w.length>0?z(w[w.length-1]):null;let $=-1/0;for(let o=0;o<w.length-1;o++){const m=z(w[o]);m&&(m.left<$+N||O&&m.right>O.left-N||($=m.right,ee.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}O&&ee.push({x:O.x,y:O.y,text:O.text,anchor:O.anchor});const U=Bt(k,B),K=5,_=o=>n(m=>m===o?null:m),X=o=>{o&&r(`/paper/${o}`)},Y=(o,m)=>{const y=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${le(o.data.value)} on ${o.data.dateLabel}`,P=!!o.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:P?"pointer":"default",outline:"none"},tabIndex:0,role:P?"link":"img","aria-label":y,onMouseEnter:()=>n(o.idx),onMouseLeave:()=>_(o.idx),onFocus:()=>n(o.idx),onBlur:()=>_(o.idx),onClick:()=>X(o.data.paperRouteId),onKeyDown:C=>{P&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),X(o.data.paperRouteId))},children:a.jsx("title",{children:y})})]},o.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:c-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${f+S/2})`,children:t}),Array.from({length:K}).map((o,m)=>{const p=m/(K-1),y=f+S*(1-p),P=h+E*p;return a.jsxs("g",{children:[a.jsx("line",{x1:c,y1:y,x2:i-d,y2:y,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:c-10,y:y+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(P)})]},m)}),U.map(o=>{const m=D(o.timestamp);return a.jsx("text",{x:m,y:l-x+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),W.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),q&&a.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((o,m)=>a.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&W[s]&&(()=>{const o=W[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",y=`${m.length>40?m.slice(0,39)+"…":m}: ${le(o.data.value)}`,C=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=o.x-C/2;H<c&&(H=c),H+C>i-d&&(H=i-d-C);const G=o.y-v-14>=f?o.y-v-12:o.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:H,y:G,width:C,height:v,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:H+12,y:G+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:y})]})})()]})};function Ht(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(n),t&&(s.href=t),n.href=e,n.href}const Vt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Z(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let ae=null;function Xe(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=Z(window.getComputedStyle(document.documentElement)),ae))}function de(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Wt(e){const t=de(e,"border-left-width"),r=de(e,"border-right-width");return e.clientWidth+t+r}function Ot(e){const t=de(e,"border-top-width"),r=de(e,"border-bottom-width");return e.clientHeight+t+r}function Ye(e,t={}){const r=t.width||Wt(e),s=t.height||Ot(e);return{width:r,height:s}}function Ut(){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 V=16384;function qt(e){(e.width>V||e.height>V)&&(e.width>V&&e.height>V?e.width>e.height?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V):e.width>V?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V))}function zt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=s.length,i=new Uint8Array(n);for(let l=0;l<n;l+=1)i[l]=s.charCodeAt(l);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ue(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Kt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Gt(e,t,r){const s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),n.appendChild(i),i.appendChild(e),Kt(n)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function Qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Xt(e,t){return Xe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Yt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?Qt(r):Xt(r,s);return document.createTextNode(`${n}{${i}}`)}function De(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=Vt();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Yt(l,r,n,s)),t.appendChild(c)}function Jt(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const He="application/font-woff",Ve="image/jpeg",Zt={woff:He,woff2:He,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ve,jpeg:Ve,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function er(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=er(e).toLowerCase();return Zt[t]||""}function tr(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function rr(e,t){return`data:${t};base64,${e}`}async function Je(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const n=await s.blob();return new Promise((i,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(n)})}const ge={};function ar(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function we(e,t,r){const s=ar(e,t,r.includeQueryParams);if(ge[s]!=null)return ge[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Je(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),tr(c)));n=rr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return ge[s]=n,n}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ue(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const c=i.toDataURL();return ue(c)}const r=e.poster,s=ye(r),n=await we(r,s,t);return ue(n)}async function ir(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await me(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function lr(e,t){return A(e,HTMLCanvasElement)?sr(e):A(e,HTMLVideoElement)?nr(e,t):A(e,HTMLIFrameElement)?ir(e,t):e.cloneNode(Ze(e))}const or=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function cr(e,t,r){var s,n;if(Ze(t))return t;let i=[];return or(e)&&e.assignedNodes?i=Z(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=Z(e.contentDocument.body.childNodes):i=Z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>me(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function dr(e,t,r){const s=t.style;if(!s)return;const n=window.getComputedStyle(e);n.cssText?(s.cssText=n.cssText,s.transformOrigin=n.transformOrigin):Xe(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,n.getPropertyPriority(i))})}function ur(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function mr(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function hr(e,t,r){return A(t,Element)&&(dr(e,t,r),Jt(e,t,r),ur(e,t),mr(e,t)),t}async function fr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const c=r[i].getAttribute("xlink:href");if(c){const d=e.querySelector(c),f=document.querySelector(c);!d&&f&&!s[c]&&(s[c]=await me(f,t,!0))}}const n=Object.values(s);if(n.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const c=document.createElementNS(i,"defs");l.appendChild(c);for(let d=0;d<n.length;d++)c.appendChild(n[d]);e.appendChild(l)}return e}async function me(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>lr(s,t)).then(s=>cr(e,s,t)).then(s=>hr(e,s,t)).then(s=>fr(s,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function xr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function br(e){const t=[];return e.replace(et,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function yr(e,t,r,s,n){try{const i=r?Ht(t,r):t,l=ye(t);let c;return n||(c=await we(i,l,s)),e.replace(xr(t),`$1${c}$3`)}catch{}return e}function wr(e,{preferredFontFormat:t}){return t?e.replace(gr,r=>{for(;;){const[s,,n]=pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function tt(e){return e.search(et)!==-1}async function rt(e,t,r){if(!tt(e))return e;const s=wr(e,r);return br(s).reduce((i,l)=>i.then(c=>yr(c,l,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const n=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(n){const i=await rt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function vr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function jr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(A(e,SVGImageElement)&&!xe(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,n=await we(s,ye(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(f){l(f)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function _r(e,t){const s=Z(e.childNodes).map(n=>at(n,t));await Promise.all(s).then(()=>e)}async function at(e,t){A(e,Element)&&(await vr(e,t),await jr(e,t),await _r(e,t))}function Sr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(n=>{r[n]=s[n]}),e}const We={};async function Oe(e){let t=We[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},We[e]=t,t}async function Ue(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),Je(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function qe(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=n.exec(s);if(d===null)break;t.push(d[0])}s=s.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=c.exec(s),d===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(d[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const d=i.href,f=Oe(d).then(x=>Ue(x,t)).then(x=>qe(x).forEach(u=>{try{n.insertRule(u,u.startsWith("@import")?c+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:u,error:h})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(f)}})}catch(i){const l=e.find(c=>c.href==null)||document.styleSheets[0];n.href!=null&&s.push(Oe(n.href).then(c=>Ue(c,t)).then(c=>qe(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function Cr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function Er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await kr(r,t);return Cr(s)}function st(e){return e.trim().replace(/["']/g,"")}function Nr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(st(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Rr(e,t){const r=await Er(e,t),s=Nr(e);return(await Promise.all(r.filter(i=>s.has(st(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return rt(i.cssText,l,t)}))).join(`
|
| 2 |
`)}async function Pr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Rr(e,t);if(r){const s=document.createElement("style"),n=document.createTextNode(r);s.appendChild(n),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function $r(e,t={}){const{width:r,height:s}=Ye(e,t),n=await me(e,t,!0);return await Pr(n,t),await at(n,t),Sr(n,t),await Gt(n,r,s)}async function Mr(e,t={}){const{width:r,height:s}=Ye(e,t),n=await $r(e,t),i=await ue(n),l=document.createElement("canvas"),c=l.getContext("2d"),d=t.pixelRatio||Ut(),f=t.canvasWidth||r,x=t.canvasHeight||s;return l.width=f*d,l.height=x*d,t.skipAutoScale||qt(l),l.style.width=`${f}`,l.style.height=`${x}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function Tr(e,t={}){const r=await Mr(e,t);return await zt(r)}const be="#ffffff";function Fr(){return typeof window>"u"?be:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||be}function Lr(e){if(typeof window>"u")return be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Fr():t}async function Ir(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Tr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Lr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const nt=({targetRef:e,label:t})=>{const{toast:r}=ct(),[s,n]=F.useState("idle"),i=F.useRef(null);F.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=F.useCallback(async()=>{const d=e.current;if(d){n("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(f=>window.requestAnimationFrame(()=>f()));try{await Ir(d),n("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>n("idle"),1500)}catch(f){n("idle"),r({title:"Copy failed",description:f instanceof Error&&f.message?f.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),c=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return a.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[a.jsx(xt,{name:"copy",size:11}),c]})};function Ar({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:n}){const i=F.useRef(null),{isInitialFilteredViewLoading:l,chartPoints:c,activeMetric:d,allowedMetrics:f,orderedMetrics:x,parameterBound:u}=e;return l||c.length===0?null:a.jsxs("div",{className:"bm-card",ref:i,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:t})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),a.jsxs("div",{className:"bm-card-actions",children:[f.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:d,onChange:h=>n(h.target.value),children:x.map(h=>a.jsx("option",{value:h,children:h},h))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!r,onCheckedChange:h=>{s(!h)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),a.jsx(nt,{targetRef:i,label:"SOTA chart"})]})]}),a.jsx("div",{className:"bm-chart-wrap",children:a.jsx(Dt,{points:c,metric:d})}),a.jsxs("div",{className:"bm-chart-foot",children:[a.jsx("span",{className:"legend-dot"}),u===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]})}function Br(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function ze(e,t){return e?a.jsx(oe,{title:e}):t||"—"}const ia=()=>{var ve,je,_e,Se,ke,Ce,Ee,Ne,Re,Pe,$e;const{datasetSlug:e}=dt(),[t,r]=ut(),s=t.get("task")||void 0,n=t.get("eval")||void 0,i=St(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:c}=mt(),d=F.useRef(null),f=F.useRef(!1),x=F.useRef(null),[u,h]=F.useState(null),R=`${e}:${s||""}`,E=u===R,[L,S]=F.useState(1),g=te({queryKey:["dataset",e,"with-paper",s,l.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:s,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),k=te({queryKey:["dataset-evals",(ve=g.data)==null?void 0:ve.id],queryFn:()=>gt.byDataset(g.data.id),enabled:!!((je=g.data)!=null&&je.id),staleTime:5*60*1e3}),B=te({queryKey:["dataset-tasks",(_e=g.data)==null?void 0:_e.id],queryFn:()=>re.datasetTasks(g.data.id),enabled:!!((Se=g.data)!=null&&Se.id),staleTime:10*60*1e3}),j=te({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),D=Qe(B.data||[],k.data||[],s,n),W=te({queryKey:["task-benchmark-trends",D,l.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(D,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!D&&!!((ke=g.data)!=null&&ke.id),staleTime:10*60*1e3}),w=F.useMemo(()=>{var b;return(((b=W.data)==null?void 0:b.results)||[]).find(M=>{var T;return M.id===((T=g.data)==null?void 0:T.id)})||null},[W.data,(Ce=g.data)==null?void 0:Ce.id]),q=te({queryKey:["leaderboard-metrics",(Ee=g.data)==null?void 0:Ee.id,D],queryFn:()=>re.leaderboardMetrics(g.data.id,D),enabled:!!((Ne=g.data)!=null&&Ne.id)&&!!D,staleTime:10*60*1e3}),I=Tt({evaluations:k.data||[],tasks:B.data||[],configuredMetrics:q.data||[],directions:j.data,initialSummary:(Re=g.data)==null?void 0:Re.leaderboard_summary,taskSlug:s,highlightEvalId:n,metric:t.get("metric")||void 0,hideClosed:l.hide_closed_source_evals,parameterBound:i,showMoreMetrics:E,fittingMetricCount:L,ready:{evaluations:k.isSuccess,tasks:B.isSuccess,directions:j.isSuccess,metrics:q.isSuccess}}),{primaryTask:N,hiddenClosedEvals:Q,hiddenClosedTopEval:z,isSummaryLoading:ee,displayedMetric:O,displayedSota:$,displayedSotaModel:U,isInitialFilteredViewLoading:K,highlightedEval:_,hasParameterMetadata:X,parameterCoverage:Y,orderedMetrics:o}=I;F.useEffect(()=>{if(f.current||!n||!k.data||k.data.length===0)return;const b=d.current;b&&(f.current=!0,b.scrollIntoView({behavior:"smooth",block:"start"}))},[n,k.data]);const m=te({queryKey:["area",N==null?void 0:N.area_id],queryFn:()=>re.getArea(N.area_id),enabled:!!(N!=null&&N.area_id),staleTime:10*60*1e3});if(g.isLoading)return a.jsxs("div",{className:"page",children:[a.jsx(ce,{className:"h-12 w-1/2 mb-6"}),a.jsx(ce,{className:"h-64 w-full"})]});if(g.error||!g.data)return a.jsx("div",{className:"page",children:a.jsx(bt,{variant:"destructive",children:a.jsx(yt,{children:"Benchmark not found."})})});const p=g.data,y=!!p.supports_harness,P=b=>{r(M=>{const T=new URLSearchParams(M);return b===void 0?T.delete("max_parameters_exclusive"):T.set("max_parameters_exclusive",String(b)),T})},C=b=>{r(M=>{const T=new URLSearchParams(M);return T.set("metric",b),T})},v=p.introducing_paper??void 0,H=(v==null?void 0:v.arxiv_id)||(v==null?void 0:v.id)||Br(p.paper_url),J=(v==null?void 0:v.title)||p.introducing_paper_title||null,G=((Pe=v==null?void 0:v.published)==null?void 0:Pe.slice(0,4))||p.introduced_year||null,it=!!H||!!p.paper_url||!!J,lt=v!=null&&v.arxiv_id||($e=p.paper_url)!=null&&$e.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${H}`:`Paper ${H}`;return a.jsx("div",{className:"page",children:a.jsxs("div",{className:"bm-page",children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(ne,{to:"/tasks",children:"Tasks"}),m.data&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks#area-${jt(m.data.name)}`,children:m.data.name})]}),N&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks/${N.slug||N.id}`,children:N.name})]}),a.jsx("span",{className:"sep",children:"/"}),a.jsx("span",{style:{color:"var(--accent-text)"},children:p.name})]}),a.jsxs("div",{className:"bm-title-row",children:[a.jsx("h1",{className:"bm-title",children:p.name}),w&&a.jsxs("div",{className:"bm-title-trend","aria-label":`${p.name} reporting trend`,children:[a.jsx(wt,{history:w.history,benchmarkName:w.name}),a.jsxs("span",{className:"bm-title-trend-summary",children:[a.jsx("strong",{children:w.recent_paper_count})," ",w.recent_paper_count===1?"paper":"papers",w.rate_change==null?w.recent_paper_count>0&&a.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):a.jsxs("span",{className:`benchmark-trend-change ${w.rate_change>=1?"is-up":"is-down"}`,children:[w.rate_change>=1?"↑":"↓"," ",w.rate_change.toFixed(1),"×"]})]})]})]}),a.jsx(ht,{kind:"benchmark",entityId:p.id}),a.jsxs("div",{className:"bm-subtitle",children:[ee?a.jsx(ce,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):a.jsxs("span",{children:[O&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"metric-tag",children:O}),a.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),U?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:le($)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:U})]}):a.jsxs("span",{children:[I.rows.length," evaluations"]})]}),p.hf_url&&a.jsxs("a",{className:"bm-action-btn",href:p.hf_url,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),p.description&&a.jsx("p",{className:"bm-description",children:p.description}),l.hide_closed_source_evals&&Q.length>0&&a.jsxs("div",{className:"bm-hidden-closed-notice",children:[a.jsxs("span",{children:[Q.length," closed-source ",Q.length===1?"row is":"rows are"," hidden",z!=null&&z.model_name?a.jsxs(a.Fragment,{children:[", including ",a.jsx("strong",{children:z.model_name})]}):null,"."]}),a.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{c(!1)},children:"Show closed-source"})]}),it&&a.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[a.jsx("span",{className:"method-source-label",children:"Source"}),H?a.jsxs(ne,{to:`/paper/${H}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(oe,{title:J}):lt}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):p.paper_url?a.jsxs("a",{href:vt(p.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(oe,{title:J}):p.paper_url}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):a.jsxs("div",{className:"method-source-link is-static",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(oe,{title:J}):null}),G&&a.jsx("span",{className:"method-source-meta",children:G})]})]}),a.jsx(Ar,{model:I,datasetName:p.name,hideClosed:l.hide_closed_source_evals,setHideClosed:c,setMetric:C}),_&&(()=>{var Te,Fe;const b=_.paper_arxiv_id||_.paper_id,M=_.paper_title||(_.paper_arxiv_id?`arXiv:${_.paper_arxiv_id}`:null),T=_.best_metric&&((Te=_.metrics)==null?void 0:Te[_.best_metric])!==void 0?_.best_metric:I.activeMetric,Me=(Fe=_.metrics)==null?void 0:Fe[T];return a.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[a.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),a.jsxs("div",{className:"bm-highlight-text",children:[a.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),a.jsxs("span",{className:"bm-highlight-paper",children:[_.model_name||M||"—",_.harness?` · ${_.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Me!==void 0&&T?a.jsxs(a.Fragment,{children:[T,": ",le(Me),M?" · ":""]}):null,b?a.jsx(ne,{to:`/paper/${b}`,children:ze(_.paper_title,M)}):ze(_.paper_title,M)]})]})]})})(),a.jsxs("div",{className:"bm-card",ref:x,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:p.name})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),a.jsxs("div",{className:"bm-card-actions",children:[I.allowedMetrics.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:I.activeMetric,onChange:b=>C(b.target.value),children:o.map(b=>a.jsx("option",{value:b,children:b},b))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:b=>{c(!b)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!K&&!X&&k.isSuccess?a.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,a.jsx(nt,{targetRef:x,label:"leaderboard"})]})]}),!K&&X&&a.jsxs("div",{className:"bm-parameter-filter-bar",children:[a.jsx("span",{className:"bm-parameter-filter-label",children:"Parameters Size"}),a.jsx("div",{className:"bm-parameter-filter-options",role:"group","aria-label":"Filter leaderboard by parameter size",children:I.parameterFilters.map(b=>{const{selected:M,disabled:T}=b;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${M?" is-active":""}`,"aria-pressed":M,disabled:T,onClick:()=>P(b.maxParametersExclusive),children:b.label},b.label)})}),a.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",Y.parameter_coverage_known," of ",Y.parameter_coverage_total," entries"]})]}),k.isLoading||K?a.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((b,M)=>a.jsx(ce,{className:"h-10 w-full mb-2"},M))}):I.rows.length===0?i?a.jsxs("div",{className:"no-results",children:["No known parameter counts match this filter. "," ",a.jsx("button",{type:"button",className:"bm-empty-filter-action",onClick:()=>P(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[o.length>L&&a.jsxs("div",{className:"bm-metric-columns-control",children:[a.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":E,"aria-controls":"benchmark-leaderboard",onClick:()=>h(E?null:R),children:E?"Show fewer metrics":`Show more metrics (${o.length-L})`}),E&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(At,{model:I,showHarness:y,setMetric:C,highlightRowRef:d,onFittingMetricCountChange:S})]})]})]})})};export{ia as default};
|
assets/{BenchmarkTrendSparkline-s0aa2t5Y.js → BenchmarkTrendSparkline-BaDbn_eF.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as C,j as t}from"./index-
|
|
|
|
| 1 |
+
import{r as C,j as t}from"./index-DAAEdKQ4.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B};
|
assets/{ChatView-Cuvu2zEE.js → ChatView-Duxpqsix.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{ConferenceDetailView-C4roHSxA.js → ConferenceDetailView-C7KlB9Xf.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as L,r as D,j as e,L as p}from"./index-
|
|
|
|
| 1 |
+
import{u as L,r as D,j as e,L as p}from"./index-DAAEdKQ4.js";import{u as T}from"./useQuery-BALok3Po.js";import{M as F}from"./MarkdownText-CcUZ0t2p.js";import{c as A}from"./catalog-Cjgxq75q.js";import{c as B,h as C,d as E}from"./colors-DR110Nc2.js";import{S as f}from"./skeleton-Te-nsRWB.js";import{A as P,a as z}from"./alert-B_MWtfva.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";/* empty css */import"./PaperPreviewLink-n9bIC1vy.js";import"./index-D6KYmf_u.js";import"./index-UMJO-v2N.js";import"./katex-DkKDou_j.js";import"./hover-card-DUYUZUhh.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-DL8dzFlM.js";import"./useMutation-D4cqMKzD.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},re=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?O(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{re as default};
|
assets/{ConferenceTaskView-ByPAPd-g.js → ConferenceTaskView-BtsgWPzv.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as $,d as W,r as P,j as e,L as y,F as G}from"./index-
|
|
|
|
| 1 |
+
import{u as $,d as W,r as P,j as e,L as y,F as G}from"./index-DAAEdKQ4.js";import{u as M}from"./useQuery-BALok3Po.js";import{P as J}from"./components-BWWnJ95m.js";import{P as X}from"./PaperFeedFilters-Hyqa1G4B.js";import{a as Y,P as Z,b as ee}from"./PaperDateFilter-Cmzg62xO.js";import{M as h}from"./MarkdownText-CcUZ0t2p.js";import{c as z}from"./catalog-Cjgxq75q.js";import{t as se,d as ae}from"./colors-DR110Nc2.js";import{d as te}from"./usePapers-BoM3UV5_.js";import{u as re}from"./useIntersectionObserver-DFkuIFUb.js";import{S as ne}from"./skeleton-Te-nsRWB.js";import{A as ie,a as oe}from"./alert-B_MWtfva.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-lQiG5mCP.js";import"./papers-DL8dzFlM.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CNAIo5eI.js";/* empty css */import"./PaperPreviewLink-n9bIC1vy.js";import"./index-D6KYmf_u.js";import"./index-UMJO-v2N.js";import"./katex-DkKDou_j.js";import"./hover-card-DUYUZUhh.js";import"./useMutation-D4cqMKzD.js";import"./useInfiniteQuery-BJadVmaJ.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Be=()=>{var A,L,O,T,B,D;const{confSlug:t,taskSlug:n}=$(),[o,u]=W(),w=le(o.get("order_by")),S=o.get("has_code")==="true",k=o.get("has_hf_artifacts")==="true",f=Y(o),I=a=>{const s=new URLSearchParams(o);s.set("order_by",a),u(s)},q=a=>{const s=new URLSearchParams(o);a?s.set("has_code","true"):s.delete("has_code"),u(s)},Q=a=>{const s=new URLSearchParams(o);a?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),u(s)},R=n==="all",N=n==="oral",_=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",x=l||d,p=R||N||_||l||d,K=p?void 0:n,U=N?"oral":_?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",t],queryFn:()=>z.getConference(t),enabled:!!t,staleTime:10*60*1e3}),j=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=te({conferenceSlug:t||"",taskSlug:K,presentation:U,page_size:12,order_by:w,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:k,start_date:f.startDate,end_date:f.endDate,enabled:!!t}),{targetRef:V,isIntersecting:C}=re({rootMargin:"200px"});P.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),P.useEffect(()=>{window.scrollTo(0,0)},[t,n]);const v=P.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(c=>c.results)},[i.data]),b=P.useMemo(()=>v.map(se),[v]),g=R?"All papers":N?"Oral papers":_?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":ae(((A=j.data)==null?void 0:A.name)||n||"",((L=j.data)==null?void 0:L.slug)||n),F=((T=(O=i.data)==null?void 0:O.pages[0])==null?void 0:T.count)??((B=m.data)==null?void 0:B.paper_count)??0,r=j.data;return m.error||j.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(oe,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(y,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:`/conferences/${t}`,children:((D=m.data)==null?void 0:D.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&t==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&t==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&t==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:F.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:a=>{var s,c;(c=(s=a.currentTarget.parentElement)==null?void 0:s.parentElement)==null||c.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:x?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",F.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!x&&e.jsx("div",{className:"sort-options",children:ce.map(([a,s])=>e.jsx("button",{className:`sort-btn ${w===a?"active":""}`,onClick:()=>I(a),children:s},a))}),e.jsx(X,{hasCode:S,hasHfArtifacts:k,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!x})]}),e.jsx(Z,{startDate:f.startDate,endDate:f.endDate,onChange:a=>u(ee(o,a))}),!x&&e.jsxs("div",{className:"results-count",children:[b.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,s)=>e.jsx(ne,{className:"h-40 w-full"},s))}):b.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,s)=>{var E;const c=(E=v[s])==null?void 0:E.conference_award,H=c==="outstanding"?"Outstanding Paper":c==="honorable_mention"?"Honorable Mention":c==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(G.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(J,{paper:a,rank:s+1})]},a.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Be as default};
|
assets/{ConferencesIndexView-BLiskc3i.js → ConferencesIndexView-Cp5N1BT0.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as p,j as e,L as d}from"./index-
|
|
|
|
| 1 |
+
import{r as p,j as e,L as d}from"./index-DAAEdKQ4.js";import{u}from"./useQuery-BALok3Po.js";import{c as f}from"./catalog-Cjgxq75q.js";import{S as m}from"./skeleton-Te-nsRWB.js";import{A as h,a as g}from"./alert-B_MWtfva.js";import{T as x}from"./TaxonomySuggestionTile-B2PAuCb8.js";import"./SignInToEditDialog-fQUm9O4B.js";import"./button-B4rpf4U2.js";import"./input-BJzP2p9f.js";import"./textarea-BuiR0cO8.js";import"./searchable-select-CaHh11q_.js";import"./popover-CNAIo5eI.js";import"./dialog-ByQvEQks.js";import"./loader-circle-ZBvI0vdX.js";import"./useMutation-D4cqMKzD.js";import"./submissions-BhpBrY_1.js";import"./plus-B07MagLg.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},z=()=>{const r=u({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=p.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{z as default};
|
assets/CronDashboard-BkJLXbNZ.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{g as J,r as h,z as rs,q as ns,j as e,p as le,a1 as ts,R as is,I as cs,t as me,P as ls,w as os,B as Re,x as A,m as Fe,L as xe,a as ds,f as ms}from"./index-DAAEdKQ4.js";import{u as X}from"./useQuery-BALok3Po.js";import{f as _,C as v,a as b,b as y,c as q,d as f,o as ve}from"./operations-hdrxvDEQ.js";import{B as S}from"./badge-D8X9-hnJ.js";import{B as C}from"./button-B4rpf4U2.js";import{C as us}from"./chevron-down-D8dAesMf.js";import{D as fe}from"./database-nCZMlDYG.js";import{T as hs}from"./trending-up-CPIUIOMA.js";import{A as ie}from"./activity-BA7Fotb7.js";import{F as _e}from"./file-text-CflXb8l5.js";import{T as Te,I as xs}from"./triangle-alert-E8N-PGV9.js";import{S as Ae}from"./shield-alert-Efk_HXHR.js";import{E as ee}from"./external-link-n_se8QIW.js";import{C as se,R as Ne}from"./refresh-cw-C2fS4heu.js";import{L as I}from"./loader-circle-ZBvI0vdX.js";import{C as pe}from"./circle-check-BBG6bdNO.js";import{u as D}from"./useMutation-D4cqMKzD.js";import{r as ps,f as gs,h as js,j as vs,p as fs,k as _s,A as Ns,l as bs}from"./codexAddEvals-B_Cw_WS8.js";import{u as ys}from"./useInfiniteQuery-BJadVmaJ.js";import{p as Ee}from"./paperEdits-BSsfmAC_.js";import{c as ue}from"./catalog-Cjgxq75q.js";import{c as be}from"./chat-BFojJrU9.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 ye=J("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
| 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 ks=J("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
| 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 ws=J("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
| 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 Cs=J("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
| 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 Ss=J("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
|
| 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 $s=J("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
| 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 Me=J("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
| 37 |
+
* @license lucide-react v0.462.0 - ISC
|
| 38 |
+
*
|
| 39 |
+
* This source code is licensed under the ISC license.
|
| 40 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 41 |
+
*/const Ls=J("FileClock",[["path",{d:"M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"37hlfg"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var oe="Tabs",[Ps]=os(oe,[Re]),qe=Re(),[Rs,ge]=Ps(oe),Ie=h.forwardRef((s,a)=>{const{__scopeTabs:n,value:t,onValueChange:i,defaultValue:o,orientation:p="horizontal",dir:N,activationMode:k="automatic",...m}=s,c=rs(N),[u,w]=ns({prop:t,onChange:i,defaultProp:o??"",caller:oe});return e.jsx(Rs,{scope:n,baseId:ts(),value:u,onValueChange:w,orientation:p,dir:c,activationMode:k,children:e.jsx(le.div,{dir:c,"data-orientation":p,...m,ref:a})})});Ie.displayName=oe;var De="TabsList",Oe=h.forwardRef((s,a)=>{const{__scopeTabs:n,loop:t=!0,...i}=s,o=ge(De,n),p=qe(n);return e.jsx(is,{asChild:!0,...p,orientation:o.orientation,dir:o.dir,loop:t,children:e.jsx(le.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:a})})});Oe.displayName=De;var Je="TabsTrigger",Be=h.forwardRef((s,a)=>{const{__scopeTabs:n,value:t,disabled:i=!1,...o}=s,p=ge(Je,n),N=qe(n),k=We(p.baseId,t),m=ze(p.baseId,t),c=t===p.value;return e.jsx(cs,{asChild:!0,...N,focusable:!i,active:c,children:e.jsx(le.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":m,"data-state":c?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:k,...o,ref:a,onMouseDown:me(s.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?p.onValueChange(t):u.preventDefault()}),onKeyDown:me(s.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&p.onValueChange(t)}),onFocus:me(s.onFocus,()=>{const u=p.activationMode!=="manual";!c&&!i&&u&&p.onValueChange(t)})})})});Be.displayName=Je;var He="TabsContent",Ue=h.forwardRef((s,a)=>{const{__scopeTabs:n,value:t,forceMount:i,children:o,...p}=s,N=ge(He,n),k=We(N.baseId,t),m=ze(N.baseId,t),c=t===N.value,u=h.useRef(c);return h.useEffect(()=>{const w=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(w)},[]),e.jsx(ls,{present:i||c,children:({present:w})=>e.jsx(le.div,{"data-state":c?"active":"inactive","data-orientation":N.orientation,role:"tabpanel","aria-labelledby":k,hidden:!w,id:m,tabIndex:0,...p,ref:a,style:{...s.style,animationDuration:u.current?"0s":void 0},children:w&&o})})});Ue.displayName=He;function We(s,a){return`${s}-trigger-${a}`}function ze(s,a){return`${s}-content-${a}`}var Fs=Ie,Ge=Oe,Ke=Be,Qe=Ue;const Ts=Fs,Ve=h.forwardRef(({className:s,...a},n)=>e.jsx(Ge,{ref:n,className:A("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Ve.displayName=Ge.displayName;const G=h.forwardRef(({className:s,...a},n)=>e.jsx(Ke,{ref:n,className:A("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));G.displayName=Ke.displayName;const K=h.forwardRef(({className:s,...a},n)=>e.jsx(Qe,{ref:n,className:A("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));K.displayName=Qe.displayName;function ce(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function Xe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function Z(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const P=s=>`$${s.toFixed(2)}`;function ke({title:s,budget:a,profile:n}){const t=a.cost_policy==="unmetered_hf"||a.budget_enforced===!1,i=Math.min(100,a.current_exposure_usd/a.ceiling_usd*100),o=t?"Unmetered HF":a.affordable_jobs===0&&a.desired_jobs>0?"No shard fits":a.affordable_jobs<a.desired_jobs?`${a.affordable_jobs} of ${a.desired_jobs} planned shards fit`:`${a.affordable_jobs} planned ${a.affordable_jobs===1?"shard fits":"shards fit"}`;return e.jsxs("div",{className:`cron-metric-card space-y-3 ${a.can_launch_planned?"":"cron-status--broken"}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold",children:s}),e.jsx("div",{className:"text-xs cron-muted",children:a.window==="rolling_30_days"?"Rolling 30-day window":"All history · no automatic reset"})]}),e.jsx(S,{variant:"outline",className:a.can_launch_planned?"cron-status--healthy":"cron-status--broken",children:o})]}),!t&&e.jsx("div",{role:"progressbar","aria-label":`${s} current budget exposure`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(i),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${i}%`}})}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Completed-job estimate"}),e.jsx("div",{children:P(a.spent_usd)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Active reservations"}),e.jsx("div",{children:P(a.active_reserved_usd)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Current exposure"}),e.jsx("div",{children:P(a.current_exposure_usd)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Admission policy"}),e.jsx("div",{children:t?"HF-owned · no monetary gate":`${P(a.ceiling_usd)} cap · ${P(a.headroom_usd)} headroom`})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Affordable plan reserves"}),e.jsx("div",{children:P(a.planned_reserved_usd)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Projected exposure"}),e.jsx("div",{children:P(a.projected_usd)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Rate assumption"}),e.jsxs("div",{children:[P(a.hourly_rate_usd),"/hour · ",a.reservation_hours_per_job,"h"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Next admission"}),e.jsx("div",{children:t?"Now, subject to capacity":a.next_admission_at?_(a.next_admission_at):a.affordable_jobs>0?"Now":"No scheduled admission"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Unknown terminal reserve"}),e.jsxs("div",{children:[P(a.unknown_terminal_reservation_usd??0)," · ",(a.unknown_terminal_reservation_count??0).toLocaleString()," jobs"]})]})]}),n&&e.jsxs("div",{className:"text-xs cron-muted",children:["Profile ",e.jsx("strong",{children:n.profile_id})," · max ",n.max_papers.toLocaleString()," papers · hard ",ce(n.hard_timeout_seconds)," · soft ",ce(n.soft_deadline_seconds)]}),e.jsx("p",{className:"text-xs cron-muted",children:t?"HF owns this workload, so monetary admission is disabled; concurrency and timeout limits still apply. Runtime cost remains an operational estimate.":"Projected exposure is an admission-control estimate, not a provider invoice. Each launch reserves the full timeout until actual runtime is known."})]})}const As={healthy:pe,degraded:Te,broken:se,running:I,stuck:se,unknown:ws};function Es({status:s,isRunning:a}){const n=a?"running":s,t=As[n];return e.jsx(t,{className:`cron-status-icon cron-status--${n}${n==="running"?" animate-spin":""}`})}function we({label:s,axis:a}){return e.jsxs(S,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function Ce({icon:s,title:a,metrics:n}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(n).map(([t,i])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Z(t)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof i=="number"?i.toLocaleString():i})]},t))})]})}function Ms({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ie,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",Xe(s)],...s.updated_at?[["Updated",_(s.updated_at)]]:[]].map(([a,n])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:n})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(S,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,n])=>e.jsxs(S,{variant:"outline",children:[a,": ",n??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function qs(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function Se(s){return s==="success"?"cron-status--healthy":s==="partial"||s==="interrupted"?"cron-status--degraded":s==="infrastructure_failure"||s==="worker_failure"?"cron-status--broken":s==="active"?"cron-status--running":"cron-status--unknown"}function Is({job:s}){const a=s.progress,n=(a==null?void 0:a.omitted_images)??0,t=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"," · attempt ",s.provider_attempt??1]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",className:qs(s.stage),children:s.stage.toLowerCase()}),s.effective_outcome&&e.jsxs(S,{variant:"outline",className:Se(s.effective_outcome),children:["output: ",s.effective_outcome.replace(/_/g," ")]}),s.failure_cause&&e.jsxs(S,{variant:"outline",className:Se(s.effective_outcome),children:["cause: ",s.failure_cause.replace(/_/g," ")]}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(ee,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[t.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${t}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),n>0&&e.jsxs("div",{className:"text-xs cron-muted",children:[e.jsx("strong",{children:n.toLocaleString()})," unresolved image references omitted after final retry"]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",_(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(i=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:i.arxiv_id}),": ",i.error]},`${i.arxiv_id}:${i.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",_(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",ce(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function Ds({monitor:s,loading:a,error:n}){var t,i;return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(xs,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(I,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!n&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[s.budgets.live&&s.budgets.backfill&&e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 mb-3",children:[e.jsx(ke,{title:"Live paper Markdown GPU policy",budget:s.budgets.live,profile:(t=s.selected_profiles)==null?void 0:t.live}),e.jsx(ke,{title:"Full backfill GPU policy",budget:s.budgets.backfill,profile:(i=s.selected_profiles)==null?void 0:i.backfill})]}),e.jsxs("div",{className:`cron-message mb-3 ${(s.summary.unresolved_mount_failures??0)>0?"cron-message--error":""}`,children:[e.jsx("strong",{children:"Logical shard health:"})," ",(s.summary.logical_shards??0).toLocaleString()," logical shards / ",(s.summary.provider_attempts??0).toLocaleString()," provider attempts · ",(s.summary.recovered_mount_failures??0).toLocaleString()," recovered mount failures · ",(s.summary.unresolved_mount_failures??0).toLocaleString()," unresolved"]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([o,p])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Z(o)}),e.jsx("div",{className:"text-lg font-semibold",children:p.toLocaleString()})]},o))}),e.jsx("p",{className:"text-xs cron-muted mb-3",children:"Efficiency and backlog-clearance costs are admission-control estimates, not provider invoices."}),s.coverage&&Object.keys(s.coverage).length>0&&e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 mb-3",children:Object.values(s.coverage).map(o=>e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[e.jsx("div",{className:"font-semibold",children:o.scope==="full"?"Full catalog coverage":"Recent 14-day coverage"}),e.jsxs("div",{className:"text-lg font-semibold",children:[o.coverage_percentage.toFixed(2),"%"]}),e.jsxs("div",{children:[o.canonical_markdown_count.toLocaleString()," canonical / ",o.eligible_papers.toLocaleString()," eligible · ",o.missing_count.toLocaleString()," missing"]}),e.jsxs("div",{className:"cron-muted",children:["Copied from upstream this reconciliation: ",o.copied_from_upstream_count.toLocaleString()]}),e.jsxs("div",{className:"cron-muted",children:["7-day Δ eligible ",o.eligible_delta_7d??"collecting"," · canonical ",o.canonical_delta_7d??"collecting"," · missing ",o.missing_delta_7d??"collecting"]})]},o.scope))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(o=>e.jsx(Is,{job:o},o.id))})]})]})}function Os({job:s,expanded:a,onToggle:n,paperMarkdownJobs:t,paperMarkdownJobsLoading:i=!1,paperMarkdownJobsError:o=null}){const p=!!(s.work_metrics&&Object.keys(s.work_metrics).length),N=!!(s.db_metrics&&Object.keys(s.db_metrics).length),k=s.job_name==="paper_markdown_backfill",m=k?t==null?void 0:t.budgets.live:void 0,c=(m==null?void 0:m.cost_policy)==="unmetered_hf"||(m==null?void 0:m.budget_enforced)===!1;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:n,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(Es,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(S,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(S,{variant:"outline",className:"cron-status--broken",children:"Held lock"}),e.jsx(we,{label:"Execution",axis:s.execution_health}),e.jsx(we,{label:"Output",axis:s.output_health}),a?e.jsx(ks,{className:"h-4 w-4 cron-muted"}):e.jsx(us,{className:"h-4 w-4 cron-muted"})]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Me,{}),"Log: ",_(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(fe,{}),"DB: ",_(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(hs,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ie,{}),"Duration: ",ce(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(ye,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(_e,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ie,{}),"Actions: ",Xe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics}),m&&e.jsxs("div",{className:`cron-message ${m.can_launch_planned?"":"cron-message--error"}`,children:[e.jsx("strong",{children:"Live GPU policy:"})," ",c?"unmetered on HF":`${P(m.current_exposure_usd)} current / ${P(m.ceiling_usd)} cap`," · ",m.affordable_jobs," of ",m.desired_jobs," planned",c?"":` · projects ${P(m.projected_usd)} · rolling 30 days`]})]})]}),e.jsx(S,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ye,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",_(s.execution_health.last_expected_at??null)],["Last started",_(s.execution_health.last_started_at??null)],["Last completed",_(s.execution_health.last_completed_at??null)],["Next expected",_(s.execution_health.next_expected_at??null)]].map(([u,w])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:u}),e.jsx("span",{children:w})]},u))})]}),s.work_metrics&&p&&e.jsx(Ce,{icon:_e,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&N&&e.jsx(Ce,{icon:fe,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(Ms,{workflow:s.workflow_status}),k&&e.jsx(Ds,{monitor:t,loading:i,error:o}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(u=>u.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Te,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,u])=>u.length>0).map(([u,w])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:Z(u)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:w.map(E=>e.jsx("li",{children:E},E))})]},u))})]}),s.health_findings&&s.health_findings.some(u=>u.state!=="healthy")&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ae,{className:"h-4 w-4"}),e.jsx("h4",{children:"Deterministic contract findings"})]}),e.jsxs("div",{className:"cron-metric-card space-y-3 text-sm",children:[s.health_findings.filter(u=>u.state!=="healthy").map(u=>e.jsxs("div",{children:[e.jsx(S,{variant:"outline",className:`cron-status--${u.state}`,children:u.state})," ",e.jsx("strong",{children:Z(u.contract)}),": ",u.summary,Object.entries(u.evidence).length>0&&e.jsx("div",{className:"mt-1 text-xs cron-muted",children:Object.entries(u.evidence).map(([w,E])=>e.jsxs("span",{className:"mr-3",children:[Z(w),": ",String(E)]},w))})]},`${u.plane}-${u.contract}`)),e.jsxs("div",{className:"flex gap-4",children:[s.operator_url&&e.jsxs("a",{className:"cron-info-text inline-flex items-center gap-1",href:s.operator_url,children:["Open operator ",e.jsx(ee,{className:"h-3.5 w-3.5"})]}),s.run_url&&e.jsxs("a",{className:"cron-info-text inline-flex items-center gap-1",href:s.run_url,target:"_blank",rel:"noreferrer",children:["Open run ",e.jsx(ee,{className:"h-3.5 w-3.5"})]})]})]})]})]})})]})}const Ye=h.forwardRef(({className:s,...a},n)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:n,className:A("w-full caption-bottom text-sm",s),...a})}));Ye.displayName="Table";const Ze=h.forwardRef(({className:s,...a},n)=>e.jsx("thead",{ref:n,className:A("[&_tr]:border-b",s),...a}));Ze.displayName="TableHeader";const es=h.forwardRef(({className:s,...a},n)=>e.jsx("tbody",{ref:n,className:A("[&_tr:last-child]:border-0",s),...a}));es.displayName="TableBody";const Js=h.forwardRef(({className:s,...a},n)=>e.jsx("tfoot",{ref:n,className:A("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));Js.displayName="TableFooter";const he=h.forwardRef(({className:s,...a},n)=>e.jsx("tr",{ref:n,className:A("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));he.displayName="TableRow";const Q=h.forwardRef(({className:s,...a},n)=>e.jsx("th",{ref:n,className:A("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));Q.displayName="TableHead";const V=h.forwardRef(({className:s,...a},n)=>e.jsx("td",{ref:n,className:A("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));V.displayName="TableCell";const Bs=h.forwardRef(({className:s,...a},n)=>e.jsx("caption",{ref:n,className:A("mt-4 text-sm text-muted-foreground",s),...a}));Bs.displayName="TableCaption";const ss={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown",awaiting_markdown:"cron-status--unknown"},as={queued:"queued",dispatching:"dispatching",running:"running",completed:"completed",failed:"failed",canceled:"canceled",awaiting_markdown:"waiting for Markdown"},$e={"add-evals":"Add evals","enrich-paper":"Enrich paper","resolve-model-paper":"Resolve model release","review-benchmark-gaps":"Review benchmark gaps","add-benchmark":"Add benchmark"},Hs={queued:$s,dispatching:I,running:Cs,completed:pe,failed:se,canceled:Ss,awaiting_markdown:Ls};function Us({status:s}){const a=Hs[s];return e.jsxs(S,{variant:"outline",className:ss[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),as[s]]})}function Ws(s){return s.status==="awaiting_markdown"?Ns:s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function Le({mutationResult:s}){const a=s==null?void 0:s.skipped_configured_leaderboards;return!Array.isArray(a)||a.length===0?null:e.jsxs("div",{className:"mt-2 rounded border border-amber-500 bg-amber-50 p-2 text-xs text-amber-900",children:[e.jsxs("div",{className:"font-medium",children:["Skipped configured leaderboards (",a.length,")"]}),e.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:a.map((n,t)=>e.jsxs("li",{children:[n.benchmark," · ",n.disposition," · task ",n.task_id," / dataset ",n.dataset_id,n.metric?` / ${n.metric}`:"",n.value!=null?` = ${n.value}`:"",n.detail?` — ${n.detail}`:""]},t))})]})}function zs({autoRefresh:s,refreshToken:a}){var te;const n=Fe(),[t,i]=h.useState(""),[o,p]=h.useState(""),[N,k]=h.useState(""),[m,c]=h.useState(""),[u,w]=h.useState(""),[E,g]=h.useState({}),j={trigger:t,status:o,policy_version:N,cohort_date:m,review_status:u},{data:x,isLoading:R,isFetching:de,error:L}=X({queryKey:["codexPaperJobs",a,j],queryFn:()=>bs(100,j),refetchInterval:s?1e4:!1,retry:!1}),F=()=>n.invalidateQueries({queryKey:["codexPaperJobs"]}),Y=D({mutationFn:ps,onSuccess:F}),je=D({mutationFn:gs,onSuccess:F}),ae=D({mutationFn:js,onSuccess:F}),re=D({mutationFn:vs,onSuccess:F}),B=D({mutationFn:({id:r,dataset:d,task:T,metric:z})=>fs(r,{dataset_id:Number(d),task_id:Number(T),best_metric:z.trim()}),onSuccess:F}),H=D({mutationFn:_s,onSuccess:F}),ne=L&&typeof L=="object"&&"status"in L?L.status:void 0;return e.jsxs(v,{className:"mb-8",children:[e.jsx(b,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(q,{children:"Durable queue, two-stage daily workflows, traces, and benchmark-gap follow-up"})]}),de&&!R&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(I,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(f,{children:[R&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(I,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),L&&ne!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:L instanceof Error?L.message:"Could not load Codex paper jobs."}),ne===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),x&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`cron-message mb-5 ${x.scheduler.paused_at?"cron-message--error":""}`,children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("strong",{children:["Scheduled dispatch: ",x.scheduler.paused_at?"paused":x.scheduler.dispatch_enabled?"enabled":"disabled"]}),x.scheduler.pause_reason&&e.jsx("div",{className:"mt-1 text-xs",children:x.scheduler.pause_reason}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Canary ",x.scheduler.canary_released?"released":"active"," · Queue age ",x.scheduler.queue_age_level]}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Scheduled usage today ",x.scheduler.usage.current_day_tokens.toLocaleString()," tokens · ",x.scheduler.usage.mode==="enforced"?`pause threshold ${((te=x.scheduler.usage.pause_threshold_tokens)==null?void 0:te.toLocaleString())??"not established"}`:"first-week alert-only baseline"," · trailing median ",x.scheduler.usage.trailing_seven_day_median_tokens.toLocaleString()]})]}),e.jsx(C,{size:"sm",variant:x.scheduler.paused_at||!x.scheduler.dispatch_enabled?"default":"outline",disabled:re.isPending,onClick:()=>re.mutate(x.scheduler.paused_at||!x.scheduler.dispatch_enabled?"resume":"pause"),children:x.scheduler.paused_at?"Acknowledge & resume":x.scheduler.dispatch_enabled?"Pause scheduled dispatch":"Enable scheduled dispatch"})]})}),e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-8",children:[["queued","awaiting_markdown","dispatching","running","completed","failed","canceled"].map(r=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:as[r]}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:x.summary[r]})]},r)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:x.summary.total})]})]}),e.jsxs("div",{className:"mb-5 grid gap-3 sm:grid-cols-5",children:[e.jsxs("select",{"aria-label":"Trigger",className:"rounded border px-2 py-1 text-sm",value:t,onChange:r=>i(r.target.value),children:[e.jsx("option",{value:"",children:"All triggers"}),e.jsx("option",{value:"admin",children:"Admin"}),e.jsx("option",{value:"hf-daily-cron",children:"HF daily cron"}),e.jsx("option",{value:"hf-trending-cron",children:"HF trending cron"}),e.jsx("option",{value:"benchmark-gap-cron",children:"Benchmark gap cron"})]}),e.jsxs("select",{"aria-label":"Status",className:"rounded border px-2 py-1 text-sm",value:o,onChange:r=>p(r.target.value),children:[e.jsx("option",{value:"",children:"All statuses"}),Object.keys(ss).map(r=>e.jsx("option",{children:r},r))]}),e.jsx("input",{"aria-label":"Policy version",className:"rounded border px-2 py-1 text-sm",placeholder:"Policy version",value:N,onChange:r=>k(r.target.value)}),e.jsx("input",{"aria-label":"Cohort date",type:"date",className:"rounded border px-2 py-1 text-sm",value:m,onChange:r=>c(r.target.value)}),e.jsxs("select",{"aria-label":"Review status",className:"rounded border px-2 py-1 text-sm",value:u,onChange:r=>w(r.target.value),children:[e.jsx("option",{value:"",children:"All review states"}),e.jsx("option",{value:"unreviewed",children:"Unreviewed"}),e.jsx("option",{value:"approved",children:"Approved"}),e.jsx("option",{value:"corrected",children:"Corrected"})]})]}),x.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(Ye,{children:[e.jsx(Ze,{children:e.jsxs(he,{children:[e.jsx(Q,{children:"Status"}),e.jsx(Q,{children:"Paper"}),e.jsx(Q,{children:"Action"}),e.jsx(Q,{children:"Requested"}),e.jsx(Q,{children:"Execution"})]})}),e.jsx(es,{children:x.jobs.map(r=>{const d=Ws(r);return e.jsxs(he,{children:[e.jsx(V,{className:"align-top",children:e.jsx(Us,{status:r.status})}),e.jsx(V,{className:"min-w-[260px] align-top",children:r.paper_route?e.jsxs(e.Fragment,{children:[e.jsx(xe,{to:`/paper/${encodeURIComponent(r.paper_route)}`,className:"font-medium hover:underline",children:r.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",r.paper_id]})]}):r.kind==="review-benchmark-gaps"?e.jsx("span",{className:"font-medium",children:"Benchmark-gap backlog"}):r.kind==="add-benchmark"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Benchmark candidate"}),e.jsx("div",{className:"mt-1 text-xs cron-muted",children:r.benchmark_candidate_id})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Trending model discovery"}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Candidate ",r.candidate_id]})]})}),e.jsxs(V,{className:"whitespace-nowrap align-top",children:[$e[r.kind],r.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(pe,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(V,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:_(r.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",r.requested_by]})]}),e.jsxs(V,{className:"max-w-[360px] align-top",children:[r.hf_job_url?e.jsxs("a",{href:r.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(ee,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),d&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${r.error&&r.status!=="awaiting_markdown"?"text-red-700":"cron-muted"}`,title:d,children:d}),e.jsx(Le,{mutationResult:r.mutation_result}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[["failed","canceled"].includes(r.status)&&e.jsx(C,{size:"sm",variant:"outline",onClick:()=>Y.mutate(r.id),children:"Retry"}),["queued","awaiting_markdown","dispatching","running"].includes(r.status)&&e.jsx(C,{size:"sm",variant:"outline",onClick:()=>je.mutate(r.id),children:"Cancel"}),r.trace_status==="finalize_failed"&&e.jsx(C,{size:"sm",variant:"outline",onClick:()=>ae.mutate(r.id),children:"Retry trace"})]})]})]},r.id)})})]}),x.workflows.length>0&&e.jsxs("div",{className:"mt-8 space-y-3",children:[e.jsx("h3",{className:"text-base font-semibold",children:"Scheduled paper workflows"}),x.workflows.map(r=>e.jsxs("details",{className:"rounded-md border p-3",children:[e.jsxs("summary",{className:"cursor-pointer text-sm font-medium",children:["Paper #",r.paper_id," · ",r.cohort_date," · ",r.status," · ",r.policy_version]}),e.jsxs("div",{className:"mt-3 space-y-3 text-xs",children:[r.error&&e.jsx("div",{className:"text-red-700",children:r.error}),r.stages.map(d=>{var T;return e.jsxs("div",{className:"rounded border p-3",children:[e.jsxs("div",{className:"font-medium",children:[$e[d.kind]," · ",d.status," · trace ",d.trace_status," · review ",d.audit_status]}),e.jsxs("div",{className:"mt-1 cron-muted",children:["model ",d.model??"—"," · reasoning ",d.reasoning_effort??"—"," · tokens ",(d.input_tokens??0)+(d.output_tokens??0)," · duration ",d.duration_ms??0," ms · attempts ",d.attempt_count]}),d.error&&e.jsx("div",{className:"mt-2 text-red-700",children:d.error}),d.report&&e.jsx("div",{className:"mt-2 whitespace-pre-wrap rounded border p-2",children:d.report}),d.url_candidates&&e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{children:"URL candidates and provenance"}),e.jsx("pre",{className:"mt-2 max-h-52 overflow-auto whitespace-pre-wrap",children:JSON.stringify(d.url_candidates,null,2)})]}),d.validation_summary&&e.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:JSON.stringify(d.validation_summary,null,2)}),Array.isArray((T=d.validation_summary)==null?void 0:T.manual_or_legacy_evaluation_rows_affected)&&d.validation_summary.manual_or_legacy_evaluation_rows_affected.length>0&&e.jsxs("div",{className:"mt-2 rounded border border-amber-500 bg-amber-50 p-2 font-medium text-amber-900",children:["Manual or legacy evaluation rows changed: ",d.validation_summary.manual_or_legacy_evaluation_rows_affected.join(", "),". Review the evidence and before/after diff."]}),d.proposal&&e.jsx("pre",{className:"mt-2 max-h-52 overflow-auto whitespace-pre-wrap",children:JSON.stringify(d.proposal,null,2)}),e.jsx(Le,{mutationResult:d.mutation_result}),d.mutation_result&&e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{children:"Accepted callback result and before/after state"}),e.jsx("pre",{className:"mt-2 max-h-64 overflow-auto whitespace-pre-wrap",children:JSON.stringify(d.mutation_result,null,2)})]}),d.trace_status==="complete"&&e.jsxs("a",{className:"mt-2 inline-flex items-center gap-1 hover:underline",href:`/api/v1/admin/codex-curation/jobs/${d.id}/trace`,target:"_blank",rel:"noreferrer",children:["Authenticated trace manifest ",e.jsx(ee,{className:"h-3.5 w-3.5"})]})]},d.id)})]})]},r.id))]}),x.benchmark_candidates.length>0&&e.jsxs("div",{className:"mt-8 space-y-3",children:[e.jsx("h3",{className:"text-base font-semibold",children:"Benchmark-gap backlog"}),x.benchmark_candidates.map(r=>{var z,U;const d=E[r.id]??{dataset:"",task:((z=r.task_ids[0])==null?void 0:z.toString())??"",metric:""},T=Number(d.dataset)>0&&Number(d.task)>0&&d.metric.trim().length>0;return e.jsxs("div",{className:"rounded-md border p-3 text-xs",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"font-medium",children:[r.canonical_name," · ",r.gap_type," · ",r.status]}),e.jsxs("div",{className:"cron-muted",children:[r.distinct_paper_count," paper",r.distinct_paper_count===1?"":"s"," · ",r.confidence??"unknown"," confidence"]})]}),r.canonical_url&&e.jsx("a",{className:"mt-1 block hover:underline",href:r.canonical_url,target:"_blank",rel:"noreferrer",children:r.canonical_url}),e.jsxs("div",{className:"mt-1 cron-muted",children:["Task evidence: ",r.task_ids.join(", ")||"none"," · Papers: ",r.evidence_paper_ids.join(", ")]}),r.review_reason&&e.jsxs("div",{className:"mt-1",children:["Review",r.reviewed_at?` ${_(r.reviewed_at)}`:"",": ",r.review_reason,r.deferred_until&&` · deferred until ${_(r.deferred_until)}`]}),r.resolution&&e.jsxs("div",{className:"mt-1 cron-muted",children:["Dataset #",r.resolution.dataset_id," · task #",r.resolution.task_id," · ",r.resolution.primary_metric,r.resolution.rolled_back_at&&` · rolled back ${_(r.resolution.rolled_back_at)}`]}),r.status==="promoted"&&((U=r.resolution)==null?void 0:U.created)&&!r.resolution.rolled_back_at&&e.jsx(C,{className:"mt-2",size:"sm",variant:"outline",disabled:H.isPending,onClick:()=>H.mutate(r.id),children:"Roll back automatic benchmark"}),!["promoted","merged"].includes(r.status)&&e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[["dataset","task","metric"].map(O=>e.jsx("input",{"aria-label":`${r.canonical_name} ${O}`,className:"w-36 rounded border px-2 py-1",placeholder:O==="metric"?"Exact metric":`${O} ID`,value:d[O],onChange:l=>g(M=>({...M,[r.id]:{...d,[O]:l.target.value}}))},O)),e.jsx(C,{size:"sm",variant:"outline",disabled:!T||B.isPending,onClick:()=>B.mutate({id:r.id,...d}),children:"Promote & requeue evidence papers"})]})]},r.id)}),B.error&&e.jsx("div",{className:"cron-message cron-message--error",children:B.error.message}),H.error&&e.jsx("div",{className:"cron-message cron-message--error",children:H.error.message})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",_(x.timestamp)]})]})]})]})}function Gs(){const[s,a]=h.useState(()=>new Date().toISOString().slice(0,10)),[n,t]=h.useState(1),i=X({queryKey:["paper-edit-digest",s,n],queryFn:()=>Ee.digest(s,n),enabled:!!s});return e.jsxs("section",{className:"space-y-3 rounded border p-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Daily paper edits"}),e.jsxs("label",{className:"flex items-center gap-2",children:["UTC date ",e.jsx("input",{type:"date",value:s,onChange:o=>{a(o.target.value),t(1)}})]}),i.isLoading&&e.jsx("p",{children:"Loading daily summary…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),i.data&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[i.data.edits," published changes · ",i.data.papers," papers · ",i.data.contributors," contributors"]}),e.jsx("ul",{className:"space-y-1",children:i.data.rows.map((o,p)=>e.jsxs("li",{children:[e.jsxs(xe,{className:"underline",to:`/paper/${o.paper_id}#edit-history`,children:["Paper ",o.paper_id]})," · @",o.actor_username??"admin"," · ",o.edits," changes"]},p))}),e.jsxs("div",{className:"flex gap-2",children:[n>1&&e.jsx(C,{variant:"outline",onClick:()=>t(n-1),children:"Previous"}),i.data.has_more&&e.jsx(C,{variant:"outline",onClick:()=>t(n+1),children:"Next"})]})]})]})}const Ks=()=>{var p,N,k,m;const s=Fe(),a=ys({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>ue.audit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),n=((p=a.data)==null?void 0:p.pages.flatMap(c=>c.events))??[],t=D({mutationFn:()=>ue.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),i=D({mutationFn:c=>ue.rollbackEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=D({mutationFn:({subject:c,suspended:u})=>Ee.suspend(c,u),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Gs,{}),(i.error||o.error)&&e.jsx("p",{role:"alert",children:(N=i.error||o.error)==null?void 0:N.message}),e.jsxs(v,{children:[e.jsxs(b,{className:"flex-row items-center justify-between",children:[e.jsx(y,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((m=(k=a.data)==null?void 0:k.pages[0])==null?void 0:m.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(C,{variant:"outline",size:"sm",onClick:()=>t.mutate(),disabled:t.isPending,children:"Mark read"})]})]}),e.jsxs(f,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),n.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:c.before,after:c.after},null,2)})]}),c.actor_role==="contributor"&&c.actor_hf_subject&&e.jsx(C,{className:"mt-3 mr-2",variant:"outline",size:"sm",disabled:o.isPending,onClick:()=>o.mutate({subject:c.actor_hf_subject,suspended:!c.editing_suspended}),children:c.editing_suspended?"Restore editing access":"Suspend editing access"}),!c.rollback_of_event_id&&e.jsx(C,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>i.mutate(c.id),disabled:i.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(C,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})]})},Pe={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},$=s=>`$${(s/1e6).toFixed(2)}`,Qs=({data:s,loading:a,error:n})=>{const[t,i]=h.useState("staging-current"),o={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(I,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(n||!s)return e.jsx(v,{className:"cron-status--broken",children:e.jsx(f,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const p=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),N=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",k=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(v,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Circuit"})}),e.jsxs(f,{children:[e.jsx("div",{className:"text-2xl font-bold",children:N}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Month to date"})}),e.jsxs(f,{children:[e.jsx("div",{className:"text-2xl font-bold",children:$(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(p),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${p}%`}})})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Application headroom"})}),e.jsxs(f,{children:[e.jsx("div",{className:"text-2xl font-bold",children:$(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",$(s.application_cap_microusd)]})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Live compute"})}),e.jsxs(f,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(v,{children:[e.jsxs(b,{children:[e.jsx(y,{children:"Accounting and policy"}),e.jsxs(q,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(f,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:t,onChange:m=>i(m.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[o[t]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),$(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),$(s.provider_floor_microusd)," · ",e.jsx(S,{children:k})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${$(s.environment_cap_microusd)}`," · Workspace ",$(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",$(s.warning_microusd)," · trip ",$(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),_(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?_(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?_(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${_(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${_(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${$(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${_(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${$(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{children:"Live lifecycle"})}),e.jsx(f,{className:"text-sm",children:Object.entries(s.live_states).map(([m,c])=>e.jsxs("span",{className:"mr-4",children:[m,": ",c]},m))})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{children:"Daily spend"})}),e.jsx(f,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(m=>e.jsxs("li",{children:[m.date,": blank ",$(m.blank_pool_microusd)," · assigned ",$(m.assigned_microusd)]},m.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(v,{children:[e.jsxs(b,{children:[e.jsx(y,{children:"Recent circuit events"}),e.jsx(q,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(f,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(m=>e.jsxs("li",{children:[e.jsx(S,{children:m.severity})," ",m.type," · ",_(m.created_at)]},m.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Vs=({data:s,loading:a,error:n})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(I,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(n||!s)return e.jsx(v,{className:"cron-status--broken",children:e.jsx(f,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const t=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(v,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(b,{children:[e.jsx(y,{children:"Web search"}),e.jsxs(q,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(f,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(t),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${t}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",_(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${_(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(i=>e.jsxs("li",{children:[i.type," · ",_(i.created_at),i.error_class?` · ${i.error_class}`:""]},i.id))})]})]})},Xs=({data:s})=>s!=null&&s.snapshot_stale?e.jsx(v,{className:"mb-6 cron-status--degraded",role:"status",children:e.jsx(f,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx(I,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Refreshing status… Current snapshot is ",Math.ceil(s.snapshot_age_seconds)," seconds old."]})]})})}):null,Ys=(s,a)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?5e3:a?3e4:!1,Na=()=>{const s=ms(),[a,n]=h.useState(!0),[t,i]=h.useState(!1),[o,p]=h.useState(0),[N,k]=h.useState(""),[m,c]=h.useState(""),[u,w]=h.useState(new Set),E=h.useRef(!1),{user:g}=ds(),{data:j,isLoading:x,error:R,refetch:de}=X({queryKey:["cronStatus",g==null?void 0:g.username],queryFn:()=>{const l=E.current;return E.current=!1,ve.getCronStatus(l)},enabled:!!(g!=null&&g.is_admin),refetchInterval:l=>Ys(l.state.data,a),retry:!1}),L=X({queryKey:["paperMarkdownJobs",g==null?void 0:g.username],queryFn:()=>ve.getPaperMarkdownJobs(),enabled:!!(g!=null&&g.is_admin),refetchInterval:a?3e4:!1,retry:!1}),F=X({queryKey:["chatSandboxSpend",g==null?void 0:g.username,m],queryFn:()=>be.getSandboxSpend(m||void 0),enabled:!!(g!=null&&g.is_admin),refetchInterval:a?3e4:!1,retry:!1}),Y=X({queryKey:["chatWebSearchBudget",g==null?void 0:g.username],queryFn:()=>be.getWebSearchBudget(),enabled:!!(g!=null&&g.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),ae=(R&&typeof R=="object"&&"status"in R?R.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":R instanceof Error?R.message:void 0,re=l=>{w(M=>{const W=new Set(M);return W.has(l)?W.delete(l):W.add(l),W})},B=(j==null?void 0:j.jobs.filter(l=>l.dashboard_group==="leaderboard_sync"))??[],H=(j==null?void 0:j.jobs.filter(l=>l.category!=="manual"&&l.dashboard_group!=="leaderboard_sync"))??[],ne=H.filter(l=>l.critical),te=H.filter(l=>!l.critical),r=(j==null?void 0:j.manual_operations)??[],d=!!(x||t||j!=null&&j.refreshing),T=te.reduce((l,M)=>(l[M.category]||(l[M.category]=[]),l[M.category].push(M),l),{}),z=Object.keys(T).sort((l,M)=>{const W=["systemd","hourly","daily","weekly","backfill"];return W.indexOf(l)-W.indexOf(M)}),U=l=>e.jsx(Os,{job:l,expanded:u.has(l.job_name),onToggle:()=>re(l.job_name),paperMarkdownJobs:l.job_name==="paper_markdown_backfill"?L.data:void 0,paperMarkdownJobsLoading:l.job_name==="paper_markdown_backfill"?L.isLoading:!1,paperMarkdownJobsError:l.job_name==="paper_markdown_backfill"?L.error:null},l.job_name),O=async()=>{p(l=>l+1),E.current=!0,i(!0);try{await Promise.all([de(),L.refetch(),F.refetch()])}finally{i(!1)}};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(ie,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(C,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(xe,{to:"/autonomous-operations",children:"Autonomous operations"})}),e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>n(!a),className:a?"cron-status--running":"",children:[e.jsx(Ne,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>void O(),disabled:d,children:[e.jsx(Ne,{className:`h-4 w-4 mr-2 ${d?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(v,{className:"mb-6",children:e.jsx(f,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",g==null?void 0:g.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken. Expanded jobs include deterministic scheduler, log, lock, durable-data, throughput, backlog, and semantic contract evidence with direct operator and run links."]})})}),e.jsx(Xs,{data:j}),e.jsxs(Ts,{defaultValue:"critical-jobs",children:[e.jsxs(Ve,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(G,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(G,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(G,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(G,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(G,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(K,{value:"critical-jobs",className:"mt-6",children:[x&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(I,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),R&&e.jsx(v,{className:"cron-status--broken",children:e.jsx(f,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{className:"h-5 w-5"}),e.jsx("p",{children:ae??"Failed to load CRON jobs status. Please try again."})]})})}),j&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(l=>e.jsxs(v,{children:[e.jsx(b,{className:"pb-2",children:e.jsx(y,{className:"text-sm font-medium cron-muted capitalize",children:l})}),e.jsx(f,{children:e.jsx("div",{className:"text-2xl font-bold",children:j.summary[l]})})]},l))}),j.summary.critical_issues.length>0&&e.jsxs(v,{className:"mb-6 cron-status--broken",children:[e.jsx(b,{children:e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(Ae,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(f,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:j.summary.critical_issues.map(l=>e.jsx("li",{children:l},l))})})]}),e.jsxs(v,{className:"mb-8",children:[e.jsx(b,{children:e.jsx(y,{className:"text-base",children:"What to check next"})}),e.jsxs(f,{children:[e.jsx("p",{className:"text-sm cron-muted",children:j.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Me,{className:"h-4 w-4"}),"Last updated: ",_(j.timestamp)," · Health score:"," ",j.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(v,{className:`mb-8 ${j.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-base",children:"Coverage"}),e.jsx(q,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(f,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(v,{className:"mb-8",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Critical jobs"}),e.jsx(q,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(f,{className:"space-y-4",children:ne.map(U)})]}),e.jsx("div",{className:"space-y-6",children:z.map(l=>e.jsxs(v,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(S,{className:Pe[l]??Pe.hourly,children:l}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(q,{children:[T[l].length," job",T[l].length!==1?"s":""]})]})}),e.jsx(f,{className:"space-y-4",children:T[l].map(U)})]},l))}),r.length>0&&e.jsxs(v,{className:"mt-6",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Manual operations"}),e.jsx(q,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(f,{className:"space-y-4",children:r.map(U)})]})]})]}),e.jsxs(K,{value:"leaderboard-syncs",className:"mt-6",children:[x&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(I,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),R&&e.jsx(v,{className:"cron-status--broken",children:e.jsx(f,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{className:"h-5 w-5"}),e.jsx("p",{children:ae??"Failed to load leaderboard sync status. Please try again."})]})})}),j&&e.jsxs(v,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(q,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(S,{children:[B.length," jobs"]})]})}),e.jsx(f,{className:"space-y-4",children:B.map(U)})]})]}),e.jsx(K,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(zs,{autoRefresh:a,refreshToken:o})}),e.jsx(K,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ks,{})}),e.jsxs(K,{value:"chat-compute",className:"mt-6",children:[e.jsxs(v,{className:"mb-6",children:[e.jsxs(b,{children:[e.jsx(y,{children:"Environment record"}),e.jsx(q,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(f,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:N,onChange:l=>k(l.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(C,{onClick:()=>c(N.trim()),children:"Load"})]})]}),e.jsx(Qs,{data:F.data,loading:F.isLoading,error:F.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Vs,{data:Y.data,loading:Y.isLoading,error:Y.error})})]})]})]})})};export{Qs as ChatComputePanel,Xs as CronSnapshotNotice,Ys as cronStatusRefetchInterval,Na as default};
|
assets/CronDashboard-DEr_gWmj.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
| 1 |
-
import{g as D,r as h,z as rs,q as ns,j as e,p as le,a1 as ts,R as is,I as cs,t as me,P as ls,w as ds,B as Re,x as T,m as Fe,L as xe,a as os,f as ms}from"./index-DuJU_D27.js";import{u as X}from"./useQuery-BvOlbTZD.js";import{f,A as ie,C as v,a as b,b as y,c as q,d as _,o as ve}from"./operations-BFtL9_89.js";import{B as S}from"./badge-U6l4XzC5.js";import{B as C}from"./button-gR6DviOK.js";import{C as us}from"./chevron-down-B9CqRc2D.js";import{D as _e,r as hs,f as xs,h as ps,j as gs,p as js,k as vs,A as _s,l as fs}from"./codexAddEvals-CLYRUuLd.js";import{T as Ns}from"./trending-up-BFiMYi16.js";import{F as fe}from"./file-text-DhueCFXV.js";import{S as Ae}from"./shield-alert-DqAyaWBs.js";import{E as ee}from"./external-link-DWe5qf4F.js";import{C as se,R as Ne}from"./refresh-cw-DyvmmSBq.js";import{L as I}from"./loader-circle-BNnwwGUv.js";import{C as pe}from"./circle-check-DJrzNr5b.js";import{u as O}from"./useMutation-BAvuTKgd.js";import{u as bs}from"./useInfiniteQuery-D38nK1Xd.js";import{p as Te}from"./paperEdits-BKVKJPVY.js";import{c as ue}from"./catalog-BDn3ESav.js";import{c as be}from"./chat-6kLnoZFH.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 ye=D("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
| 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 ys=D("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
| 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 ks=D("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
| 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 ws=D("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
| 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 Cs=D("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
|
| 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=D("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
| 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 Ee=D("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
| 37 |
-
* @license lucide-react v0.462.0 - ISC
|
| 38 |
-
*
|
| 39 |
-
* This source code is licensed under the ISC license.
|
| 40 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 41 |
-
*/const $s=D("FileClock",[["path",{d:"M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"37hlfg"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);/**
|
| 42 |
-
* @license lucide-react v0.462.0 - ISC
|
| 43 |
-
*
|
| 44 |
-
* This source code is licensed under the ISC license.
|
| 45 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 46 |
-
*/const Ls=D("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/**
|
| 47 |
-
* @license lucide-react v0.462.0 - ISC
|
| 48 |
-
*
|
| 49 |
-
* This source code is licensed under the ISC license.
|
| 50 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 51 |
-
*/const Me=D("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var de="Tabs",[Ps]=ds(de,[Re]),qe=Re(),[Rs,ge]=Ps(de),Ie=h.forwardRef((s,a)=>{const{__scopeTabs:n,value:t,onValueChange:i,defaultValue:d,orientation:p="horizontal",dir:N,activationMode:k="automatic",...m}=s,c=rs(N),[u,w]=ns({prop:t,onChange:i,defaultProp:d??"",caller:de});return e.jsx(Rs,{scope:n,baseId:ts(),value:u,onValueChange:w,orientation:p,dir:c,activationMode:k,children:e.jsx(le.div,{dir:c,"data-orientation":p,...m,ref:a})})});Ie.displayName=de;var De="TabsList",Oe=h.forwardRef((s,a)=>{const{__scopeTabs:n,loop:t=!0,...i}=s,d=ge(De,n),p=qe(n);return e.jsx(is,{asChild:!0,...p,orientation:d.orientation,dir:d.dir,loop:t,children:e.jsx(le.div,{role:"tablist","aria-orientation":d.orientation,...i,ref:a})})});Oe.displayName=De;var Je="TabsTrigger",Be=h.forwardRef((s,a)=>{const{__scopeTabs:n,value:t,disabled:i=!1,...d}=s,p=ge(Je,n),N=qe(n),k=We(p.baseId,t),m=ze(p.baseId,t),c=t===p.value;return e.jsx(cs,{asChild:!0,...N,focusable:!i,active:c,children:e.jsx(le.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":m,"data-state":c?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:k,...d,ref:a,onMouseDown:me(s.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?p.onValueChange(t):u.preventDefault()}),onKeyDown:me(s.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&p.onValueChange(t)}),onFocus:me(s.onFocus,()=>{const u=p.activationMode!=="manual";!c&&!i&&u&&p.onValueChange(t)})})})});Be.displayName=Je;var He="TabsContent",Ue=h.forwardRef((s,a)=>{const{__scopeTabs:n,value:t,forceMount:i,children:d,...p}=s,N=ge(He,n),k=We(N.baseId,t),m=ze(N.baseId,t),c=t===N.value,u=h.useRef(c);return h.useEffect(()=>{const w=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(w)},[]),e.jsx(ls,{present:i||c,children:({present:w})=>e.jsx(le.div,{"data-state":c?"active":"inactive","data-orientation":N.orientation,role:"tabpanel","aria-labelledby":k,hidden:!w,id:m,tabIndex:0,...p,ref:a,style:{...s.style,animationDuration:u.current?"0s":void 0},children:w&&d})})});Ue.displayName=He;function We(s,a){return`${s}-trigger-${a}`}function ze(s,a){return`${s}-content-${a}`}var Fs=Ie,Ge=Oe,Ke=Be,Ve=Ue;const As=Fs,Qe=h.forwardRef(({className:s,...a},n)=>e.jsx(Ge,{ref:n,className:T("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Qe.displayName=Ge.displayName;const G=h.forwardRef(({className:s,...a},n)=>e.jsx(Ke,{ref:n,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));G.displayName=Ke.displayName;const K=h.forwardRef(({className:s,...a},n)=>e.jsx(Ve,{ref:n,className:T("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));K.displayName=Ve.displayName;function ce(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function Xe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function Z(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const P=s=>`$${s.toFixed(2)}`;function ke({title:s,budget:a,profile:n}){const t=a.cost_policy==="unmetered_hf"||a.budget_enforced===!1,i=Math.min(100,a.current_exposure_usd/a.ceiling_usd*100),d=t?"Unmetered HF":a.affordable_jobs===0&&a.desired_jobs>0?"No shard fits":a.affordable_jobs<a.desired_jobs?`${a.affordable_jobs} of ${a.desired_jobs} planned shards fit`:`${a.affordable_jobs} planned ${a.affordable_jobs===1?"shard fits":"shards fit"}`;return e.jsxs("div",{className:`cron-metric-card space-y-3 ${a.can_launch_planned?"":"cron-status--broken"}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold",children:s}),e.jsx("div",{className:"text-xs cron-muted",children:a.window==="rolling_30_days"?"Rolling 30-day window":"All history · no automatic reset"})]}),e.jsx(S,{variant:"outline",className:a.can_launch_planned?"cron-status--healthy":"cron-status--broken",children:d})]}),!t&&e.jsx("div",{role:"progressbar","aria-label":`${s} current budget exposure`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(i),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${i}%`}})}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Completed-job estimate"}),e.jsx("div",{children:P(a.spent_usd)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Active reservations"}),e.jsx("div",{children:P(a.active_reserved_usd)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Current exposure"}),e.jsx("div",{children:P(a.current_exposure_usd)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Admission policy"}),e.jsx("div",{children:t?"HF-owned · no monetary gate":`${P(a.ceiling_usd)} cap · ${P(a.headroom_usd)} headroom`})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Affordable plan reserves"}),e.jsx("div",{children:P(a.planned_reserved_usd)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Projected exposure"}),e.jsx("div",{children:P(a.projected_usd)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Rate assumption"}),e.jsxs("div",{children:[P(a.hourly_rate_usd),"/hour · ",a.reservation_hours_per_job,"h"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Next admission"}),e.jsx("div",{children:t?"Now, subject to capacity":a.next_admission_at?f(a.next_admission_at):a.affordable_jobs>0?"Now":"No scheduled admission"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Unknown terminal reserve"}),e.jsxs("div",{children:[P(a.unknown_terminal_reservation_usd??0)," · ",(a.unknown_terminal_reservation_count??0).toLocaleString()," jobs"]})]})]}),n&&e.jsxs("div",{className:"text-xs cron-muted",children:["Profile ",e.jsx("strong",{children:n.profile_id})," · max ",n.max_papers.toLocaleString()," papers · hard ",ce(n.hard_timeout_seconds)," · soft ",ce(n.soft_deadline_seconds)]}),e.jsx("p",{className:"text-xs cron-muted",children:t?"HF owns this workload, so monetary admission is disabled; concurrency and timeout limits still apply. Runtime cost remains an operational estimate.":"Projected exposure is an admission-control estimate, not a provider invoice. Each launch reserves the full timeout until actual runtime is known."})]})}const Ts={healthy:pe,degraded:Me,broken:se,running:I,stuck:se,unknown:ks};function Es({status:s,isRunning:a}){const n=a?"running":s,t=Ts[n];return e.jsx(t,{className:`cron-status-icon cron-status--${n}${n==="running"?" animate-spin":""}`})}function we({label:s,axis:a}){return e.jsxs(S,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function Ce({icon:s,title:a,metrics:n}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(n).map(([t,i])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Z(t)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof i=="number"?i.toLocaleString():i})]},t))})]})}function Ms({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ie,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",Xe(s)],...s.updated_at?[["Updated",f(s.updated_at)]]:[]].map(([a,n])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:n})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(S,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,n])=>e.jsxs(S,{variant:"outline",children:[a,": ",n??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function qs(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function Se(s){return s==="success"?"cron-status--healthy":s==="partial"||s==="interrupted"?"cron-status--degraded":s==="infrastructure_failure"||s==="worker_failure"?"cron-status--broken":s==="active"?"cron-status--running":"cron-status--unknown"}function Is({job:s}){const a=s.progress,n=(a==null?void 0:a.omitted_images)??0,t=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"," · attempt ",s.provider_attempt??1]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",className:qs(s.stage),children:s.stage.toLowerCase()}),s.effective_outcome&&e.jsxs(S,{variant:"outline",className:Se(s.effective_outcome),children:["output: ",s.effective_outcome.replace(/_/g," ")]}),s.failure_cause&&e.jsxs(S,{variant:"outline",className:Se(s.effective_outcome),children:["cause: ",s.failure_cause.replace(/_/g," ")]}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(ee,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[t.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${t}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),n>0&&e.jsxs("div",{className:"text-xs cron-muted",children:[e.jsx("strong",{children:n.toLocaleString()})," unresolved image references omitted after final retry"]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",f(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(i=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:i.arxiv_id}),": ",i.error]},`${i.arxiv_id}:${i.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",f(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",ce(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function Ds({monitor:s,loading:a,error:n}){var t,i;return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ls,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(I,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!n&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[s.budgets.live&&s.budgets.backfill&&e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 mb-3",children:[e.jsx(ke,{title:"Live paper Markdown GPU policy",budget:s.budgets.live,profile:(t=s.selected_profiles)==null?void 0:t.live}),e.jsx(ke,{title:"Full backfill GPU policy",budget:s.budgets.backfill,profile:(i=s.selected_profiles)==null?void 0:i.backfill})]}),e.jsxs("div",{className:`cron-message mb-3 ${(s.summary.unresolved_mount_failures??0)>0?"cron-message--error":""}`,children:[e.jsx("strong",{children:"Logical shard health:"})," ",(s.summary.logical_shards??0).toLocaleString()," logical shards / ",(s.summary.provider_attempts??0).toLocaleString()," provider attempts · ",(s.summary.recovered_mount_failures??0).toLocaleString()," recovered mount failures · ",(s.summary.unresolved_mount_failures??0).toLocaleString()," unresolved"]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([d,p])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Z(d)}),e.jsx("div",{className:"text-lg font-semibold",children:p.toLocaleString()})]},d))}),e.jsx("p",{className:"text-xs cron-muted mb-3",children:"Efficiency and backlog-clearance costs are admission-control estimates, not provider invoices."}),s.coverage&&Object.keys(s.coverage).length>0&&e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 mb-3",children:Object.values(s.coverage).map(d=>e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[e.jsx("div",{className:"font-semibold",children:d.scope==="full"?"Full catalog coverage":"Recent 14-day coverage"}),e.jsxs("div",{className:"text-lg font-semibold",children:[d.coverage_percentage.toFixed(2),"%"]}),e.jsxs("div",{children:[d.canonical_markdown_count.toLocaleString()," canonical / ",d.eligible_papers.toLocaleString()," eligible · ",d.missing_count.toLocaleString()," missing"]}),e.jsxs("div",{className:"cron-muted",children:["Copied from upstream this reconciliation: ",d.copied_from_upstream_count.toLocaleString()]}),e.jsxs("div",{className:"cron-muted",children:["7-day Δ eligible ",d.eligible_delta_7d??"collecting"," · canonical ",d.canonical_delta_7d??"collecting"," · missing ",d.missing_delta_7d??"collecting"]})]},d.scope))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(d=>e.jsx(Is,{job:d},d.id))})]})]})}function Os({job:s,expanded:a,onToggle:n,paperMarkdownJobs:t,paperMarkdownJobsLoading:i=!1,paperMarkdownJobsError:d=null}){const p=!!(s.work_metrics&&Object.keys(s.work_metrics).length),N=!!(s.db_metrics&&Object.keys(s.db_metrics).length),k=s.job_name==="paper_markdown_backfill",m=k?t==null?void 0:t.budgets.live:void 0,c=(m==null?void 0:m.cost_policy)==="unmetered_hf"||(m==null?void 0:m.budget_enforced)===!1;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:n,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(Es,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(S,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(S,{variant:"outline",className:"cron-status--broken",children:"Held lock"}),e.jsx(we,{label:"Execution",axis:s.execution_health}),e.jsx(we,{label:"Output",axis:s.output_health}),a?e.jsx(ys,{className:"h-4 w-4 cron-muted"}):e.jsx(us,{className:"h-4 w-4 cron-muted"})]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ee,{}),"Log: ",f(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(_e,{}),"DB: ",f(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ns,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ie,{}),"Duration: ",ce(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(ye,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(fe,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ie,{}),"Actions: ",Xe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics}),m&&e.jsxs("div",{className:`cron-message ${m.can_launch_planned?"":"cron-message--error"}`,children:[e.jsx("strong",{children:"Live GPU policy:"})," ",c?"unmetered on HF":`${P(m.current_exposure_usd)} current / ${P(m.ceiling_usd)} cap`," · ",m.affordable_jobs," of ",m.desired_jobs," planned",c?"":` · projects ${P(m.projected_usd)} · rolling 30 days`]})]})]}),e.jsx(S,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ye,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",f(s.execution_health.last_expected_at??null)],["Last started",f(s.execution_health.last_started_at??null)],["Last completed",f(s.execution_health.last_completed_at??null)],["Next expected",f(s.execution_health.next_expected_at??null)]].map(([u,w])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:u}),e.jsx("span",{children:w})]},u))})]}),s.work_metrics&&p&&e.jsx(Ce,{icon:fe,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&N&&e.jsx(Ce,{icon:_e,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(Ms,{workflow:s.workflow_status}),k&&e.jsx(Ds,{monitor:t,loading:i,error:d}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(u=>u.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Me,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,u])=>u.length>0).map(([u,w])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:Z(u)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:w.map(E=>e.jsx("li",{children:E},E))})]},u))})]}),s.health_findings&&s.health_findings.some(u=>u.state!=="healthy")&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ae,{className:"h-4 w-4"}),e.jsx("h4",{children:"Deterministic contract findings"})]}),e.jsxs("div",{className:"cron-metric-card space-y-3 text-sm",children:[s.health_findings.filter(u=>u.state!=="healthy").map(u=>e.jsxs("div",{children:[e.jsx(S,{variant:"outline",className:`cron-status--${u.state}`,children:u.state})," ",e.jsx("strong",{children:Z(u.contract)}),": ",u.summary,Object.entries(u.evidence).length>0&&e.jsx("div",{className:"mt-1 text-xs cron-muted",children:Object.entries(u.evidence).map(([w,E])=>e.jsxs("span",{className:"mr-3",children:[Z(w),": ",String(E)]},w))})]},`${u.plane}-${u.contract}`)),e.jsxs("div",{className:"flex gap-4",children:[s.operator_url&&e.jsxs("a",{className:"cron-info-text inline-flex items-center gap-1",href:s.operator_url,children:["Open operator ",e.jsx(ee,{className:"h-3.5 w-3.5"})]}),s.run_url&&e.jsxs("a",{className:"cron-info-text inline-flex items-center gap-1",href:s.run_url,target:"_blank",rel:"noreferrer",children:["Open run ",e.jsx(ee,{className:"h-3.5 w-3.5"})]})]})]})]})]})})]})}const Ye=h.forwardRef(({className:s,...a},n)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:n,className:T("w-full caption-bottom text-sm",s),...a})}));Ye.displayName="Table";const Ze=h.forwardRef(({className:s,...a},n)=>e.jsx("thead",{ref:n,className:T("[&_tr]:border-b",s),...a}));Ze.displayName="TableHeader";const es=h.forwardRef(({className:s,...a},n)=>e.jsx("tbody",{ref:n,className:T("[&_tr:last-child]:border-0",s),...a}));es.displayName="TableBody";const Js=h.forwardRef(({className:s,...a},n)=>e.jsx("tfoot",{ref:n,className:T("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));Js.displayName="TableFooter";const he=h.forwardRef(({className:s,...a},n)=>e.jsx("tr",{ref:n,className:T("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));he.displayName="TableRow";const V=h.forwardRef(({className:s,...a},n)=>e.jsx("th",{ref:n,className:T("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));V.displayName="TableHead";const Q=h.forwardRef(({className:s,...a},n)=>e.jsx("td",{ref:n,className:T("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));Q.displayName="TableCell";const Bs=h.forwardRef(({className:s,...a},n)=>e.jsx("caption",{ref:n,className:T("mt-4 text-sm text-muted-foreground",s),...a}));Bs.displayName="TableCaption";const ss={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown",awaiting_markdown:"cron-status--unknown"},as={queued:"queued",dispatching:"dispatching",running:"running",completed:"completed",failed:"failed",canceled:"canceled",awaiting_markdown:"waiting for Markdown"},$e={"add-evals":"Add evals","enrich-paper":"Enrich paper","resolve-model-paper":"Resolve model release","review-benchmark-gaps":"Review benchmark gaps","add-benchmark":"Add benchmark"},Hs={queued:Ss,dispatching:I,running:ws,completed:pe,failed:se,canceled:Cs,awaiting_markdown:$s};function Us({status:s}){const a=Hs[s];return e.jsxs(S,{variant:"outline",className:ss[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),as[s]]})}function Ws(s){return s.status==="awaiting_markdown"?_s:s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function Le({mutationResult:s}){const a=s==null?void 0:s.skipped_configured_leaderboards;return!Array.isArray(a)||a.length===0?null:e.jsxs("div",{className:"mt-2 rounded border border-amber-500 bg-amber-50 p-2 text-xs text-amber-900",children:[e.jsxs("div",{className:"font-medium",children:["Skipped configured leaderboards (",a.length,")"]}),e.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:a.map((n,t)=>e.jsxs("li",{children:[n.benchmark," · ",n.disposition," · task ",n.task_id," / dataset ",n.dataset_id,n.metric?` / ${n.metric}`:"",n.value!=null?` = ${n.value}`:"",n.detail?` — ${n.detail}`:""]},t))})]})}function zs({autoRefresh:s,refreshToken:a}){var te;const n=Fe(),[t,i]=h.useState(""),[d,p]=h.useState(""),[N,k]=h.useState(""),[m,c]=h.useState(""),[u,w]=h.useState(""),[E,g]=h.useState({}),j={trigger:t,status:d,policy_version:N,cohort_date:m,review_status:u},{data:x,isLoading:R,isFetching:oe,error:L}=X({queryKey:["codexPaperJobs",a,j],queryFn:()=>fs(100,j),refetchInterval:s?1e4:!1,retry:!1}),F=()=>n.invalidateQueries({queryKey:["codexPaperJobs"]}),Y=O({mutationFn:hs,onSuccess:F}),je=O({mutationFn:xs,onSuccess:F}),ae=O({mutationFn:ps,onSuccess:F}),re=O({mutationFn:gs,onSuccess:F}),B=O({mutationFn:({id:r,dataset:o,task:A,metric:z})=>js(r,{dataset_id:Number(o),task_id:Number(A),best_metric:z.trim()}),onSuccess:F}),H=O({mutationFn:vs,onSuccess:F}),ne=L&&typeof L=="object"&&"status"in L?L.status:void 0;return e.jsxs(v,{className:"mb-8",children:[e.jsx(b,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(q,{children:"Durable queue, two-stage daily workflows, traces, and benchmark-gap follow-up"})]}),oe&&!R&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(I,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(_,{children:[R&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(I,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),L&&ne!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:L instanceof Error?L.message:"Could not load Codex paper jobs."}),ne===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),x&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`cron-message mb-5 ${x.scheduler.paused_at?"cron-message--error":""}`,children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("strong",{children:["Scheduled dispatch: ",x.scheduler.paused_at?"paused":x.scheduler.dispatch_enabled?"enabled":"disabled"]}),x.scheduler.pause_reason&&e.jsx("div",{className:"mt-1 text-xs",children:x.scheduler.pause_reason}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Canary ",x.scheduler.canary_released?"released":"active"," · Queue age ",x.scheduler.queue_age_level]}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Scheduled usage today ",x.scheduler.usage.current_day_tokens.toLocaleString()," tokens · ",x.scheduler.usage.mode==="enforced"?`pause threshold ${((te=x.scheduler.usage.pause_threshold_tokens)==null?void 0:te.toLocaleString())??"not established"}`:"first-week alert-only baseline"," · trailing median ",x.scheduler.usage.trailing_seven_day_median_tokens.toLocaleString()]})]}),e.jsx(C,{size:"sm",variant:x.scheduler.paused_at||!x.scheduler.dispatch_enabled?"default":"outline",disabled:re.isPending,onClick:()=>re.mutate(x.scheduler.paused_at||!x.scheduler.dispatch_enabled?"resume":"pause"),children:x.scheduler.paused_at?"Acknowledge & resume":x.scheduler.dispatch_enabled?"Pause scheduled dispatch":"Enable scheduled dispatch"})]})}),e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-8",children:[["queued","awaiting_markdown","dispatching","running","completed","failed","canceled"].map(r=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:as[r]}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:x.summary[r]})]},r)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:x.summary.total})]})]}),e.jsxs("div",{className:"mb-5 grid gap-3 sm:grid-cols-5",children:[e.jsxs("select",{"aria-label":"Trigger",className:"rounded border px-2 py-1 text-sm",value:t,onChange:r=>i(r.target.value),children:[e.jsx("option",{value:"",children:"All triggers"}),e.jsx("option",{value:"admin",children:"Admin"}),e.jsx("option",{value:"hf-daily-cron",children:"HF daily cron"}),e.jsx("option",{value:"hf-trending-cron",children:"HF trending cron"}),e.jsx("option",{value:"benchmark-gap-cron",children:"Benchmark gap cron"})]}),e.jsxs("select",{"aria-label":"Status",className:"rounded border px-2 py-1 text-sm",value:d,onChange:r=>p(r.target.value),children:[e.jsx("option",{value:"",children:"All statuses"}),Object.keys(ss).map(r=>e.jsx("option",{children:r},r))]}),e.jsx("input",{"aria-label":"Policy version",className:"rounded border px-2 py-1 text-sm",placeholder:"Policy version",value:N,onChange:r=>k(r.target.value)}),e.jsx("input",{"aria-label":"Cohort date",type:"date",className:"rounded border px-2 py-1 text-sm",value:m,onChange:r=>c(r.target.value)}),e.jsxs("select",{"aria-label":"Review status",className:"rounded border px-2 py-1 text-sm",value:u,onChange:r=>w(r.target.value),children:[e.jsx("option",{value:"",children:"All review states"}),e.jsx("option",{value:"unreviewed",children:"Unreviewed"}),e.jsx("option",{value:"approved",children:"Approved"}),e.jsx("option",{value:"corrected",children:"Corrected"})]})]}),x.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(Ye,{children:[e.jsx(Ze,{children:e.jsxs(he,{children:[e.jsx(V,{children:"Status"}),e.jsx(V,{children:"Paper"}),e.jsx(V,{children:"Action"}),e.jsx(V,{children:"Requested"}),e.jsx(V,{children:"Execution"})]})}),e.jsx(es,{children:x.jobs.map(r=>{const o=Ws(r);return e.jsxs(he,{children:[e.jsx(Q,{className:"align-top",children:e.jsx(Us,{status:r.status})}),e.jsx(Q,{className:"min-w-[260px] align-top",children:r.paper_route?e.jsxs(e.Fragment,{children:[e.jsx(xe,{to:`/paper/${encodeURIComponent(r.paper_route)}`,className:"font-medium hover:underline",children:r.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",r.paper_id]})]}):r.kind==="review-benchmark-gaps"?e.jsx("span",{className:"font-medium",children:"Benchmark-gap backlog"}):r.kind==="add-benchmark"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Benchmark candidate"}),e.jsx("div",{className:"mt-1 text-xs cron-muted",children:r.benchmark_candidate_id})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Trending model discovery"}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Candidate ",r.candidate_id]})]})}),e.jsxs(Q,{className:"whitespace-nowrap align-top",children:[$e[r.kind],r.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(pe,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(Q,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:f(r.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",r.requested_by]})]}),e.jsxs(Q,{className:"max-w-[360px] align-top",children:[r.hf_job_url?e.jsxs("a",{href:r.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(ee,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),o&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${r.error&&r.status!=="awaiting_markdown"?"text-red-700":"cron-muted"}`,title:o,children:o}),e.jsx(Le,{mutationResult:r.mutation_result}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[["failed","canceled"].includes(r.status)&&e.jsx(C,{size:"sm",variant:"outline",onClick:()=>Y.mutate(r.id),children:"Retry"}),["queued","awaiting_markdown","dispatching","running"].includes(r.status)&&e.jsx(C,{size:"sm",variant:"outline",onClick:()=>je.mutate(r.id),children:"Cancel"}),r.trace_status==="finalize_failed"&&e.jsx(C,{size:"sm",variant:"outline",onClick:()=>ae.mutate(r.id),children:"Retry trace"})]})]})]},r.id)})})]}),x.workflows.length>0&&e.jsxs("div",{className:"mt-8 space-y-3",children:[e.jsx("h3",{className:"text-base font-semibold",children:"Scheduled paper workflows"}),x.workflows.map(r=>e.jsxs("details",{className:"rounded-md border p-3",children:[e.jsxs("summary",{className:"cursor-pointer text-sm font-medium",children:["Paper #",r.paper_id," · ",r.cohort_date," · ",r.status," · ",r.policy_version]}),e.jsxs("div",{className:"mt-3 space-y-3 text-xs",children:[r.error&&e.jsx("div",{className:"text-red-700",children:r.error}),r.stages.map(o=>{var A;return e.jsxs("div",{className:"rounded border p-3",children:[e.jsxs("div",{className:"font-medium",children:[$e[o.kind]," · ",o.status," · trace ",o.trace_status," · review ",o.audit_status]}),e.jsxs("div",{className:"mt-1 cron-muted",children:["model ",o.model??"—"," · reasoning ",o.reasoning_effort??"—"," · tokens ",(o.input_tokens??0)+(o.output_tokens??0)," · duration ",o.duration_ms??0," ms · attempts ",o.attempt_count]}),o.error&&e.jsx("div",{className:"mt-2 text-red-700",children:o.error}),o.report&&e.jsx("div",{className:"mt-2 whitespace-pre-wrap rounded border p-2",children:o.report}),o.url_candidates&&e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{children:"URL candidates and provenance"}),e.jsx("pre",{className:"mt-2 max-h-52 overflow-auto whitespace-pre-wrap",children:JSON.stringify(o.url_candidates,null,2)})]}),o.validation_summary&&e.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:JSON.stringify(o.validation_summary,null,2)}),Array.isArray((A=o.validation_summary)==null?void 0:A.manual_or_legacy_evaluation_rows_affected)&&o.validation_summary.manual_or_legacy_evaluation_rows_affected.length>0&&e.jsxs("div",{className:"mt-2 rounded border border-amber-500 bg-amber-50 p-2 font-medium text-amber-900",children:["Manual or legacy evaluation rows changed: ",o.validation_summary.manual_or_legacy_evaluation_rows_affected.join(", "),". Review the evidence and before/after diff."]}),o.proposal&&e.jsx("pre",{className:"mt-2 max-h-52 overflow-auto whitespace-pre-wrap",children:JSON.stringify(o.proposal,null,2)}),e.jsx(Le,{mutationResult:o.mutation_result}),o.mutation_result&&e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{children:"Accepted callback result and before/after state"}),e.jsx("pre",{className:"mt-2 max-h-64 overflow-auto whitespace-pre-wrap",children:JSON.stringify(o.mutation_result,null,2)})]}),o.trace_status==="complete"&&e.jsxs("a",{className:"mt-2 inline-flex items-center gap-1 hover:underline",href:`/api/v1/admin/codex-curation/jobs/${o.id}/trace`,target:"_blank",rel:"noreferrer",children:["Authenticated trace manifest ",e.jsx(ee,{className:"h-3.5 w-3.5"})]})]},o.id)})]})]},r.id))]}),x.benchmark_candidates.length>0&&e.jsxs("div",{className:"mt-8 space-y-3",children:[e.jsx("h3",{className:"text-base font-semibold",children:"Benchmark-gap backlog"}),x.benchmark_candidates.map(r=>{var z,U;const o=E[r.id]??{dataset:"",task:((z=r.task_ids[0])==null?void 0:z.toString())??"",metric:""},A=Number(o.dataset)>0&&Number(o.task)>0&&o.metric.trim().length>0;return e.jsxs("div",{className:"rounded-md border p-3 text-xs",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"font-medium",children:[r.canonical_name," · ",r.gap_type," · ",r.status]}),e.jsxs("div",{className:"cron-muted",children:[r.distinct_paper_count," paper",r.distinct_paper_count===1?"":"s"," · ",r.confidence??"unknown"," confidence"]})]}),r.canonical_url&&e.jsx("a",{className:"mt-1 block hover:underline",href:r.canonical_url,target:"_blank",rel:"noreferrer",children:r.canonical_url}),e.jsxs("div",{className:"mt-1 cron-muted",children:["Task evidence: ",r.task_ids.join(", ")||"none"," · Papers: ",r.evidence_paper_ids.join(", ")]}),r.review_reason&&e.jsxs("div",{className:"mt-1",children:["Review",r.reviewed_at?` ${f(r.reviewed_at)}`:"",": ",r.review_reason,r.deferred_until&&` · deferred until ${f(r.deferred_until)}`]}),r.resolution&&e.jsxs("div",{className:"mt-1 cron-muted",children:["Dataset #",r.resolution.dataset_id," · task #",r.resolution.task_id," · ",r.resolution.primary_metric,r.resolution.rolled_back_at&&` · rolled back ${f(r.resolution.rolled_back_at)}`]}),r.status==="promoted"&&((U=r.resolution)==null?void 0:U.created)&&!r.resolution.rolled_back_at&&e.jsx(C,{className:"mt-2",size:"sm",variant:"outline",disabled:H.isPending,onClick:()=>H.mutate(r.id),children:"Roll back automatic benchmark"}),!["promoted","merged"].includes(r.status)&&e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[["dataset","task","metric"].map(J=>e.jsx("input",{"aria-label":`${r.canonical_name} ${J}`,className:"w-36 rounded border px-2 py-1",placeholder:J==="metric"?"Exact metric":`${J} ID`,value:o[J],onChange:l=>g(M=>({...M,[r.id]:{...o,[J]:l.target.value}}))},J)),e.jsx(C,{size:"sm",variant:"outline",disabled:!A||B.isPending,onClick:()=>B.mutate({id:r.id,...o}),children:"Promote & requeue evidence papers"})]})]},r.id)}),B.error&&e.jsx("div",{className:"cron-message cron-message--error",children:B.error.message}),H.error&&e.jsx("div",{className:"cron-message cron-message--error",children:H.error.message})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",f(x.timestamp)]})]})]})]})}function Gs(){const[s,a]=h.useState(()=>new Date().toISOString().slice(0,10)),[n,t]=h.useState(1),i=X({queryKey:["paper-edit-digest",s,n],queryFn:()=>Te.digest(s,n),enabled:!!s});return e.jsxs("section",{className:"space-y-3 rounded border p-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Daily paper edits"}),e.jsxs("label",{className:"flex items-center gap-2",children:["UTC date ",e.jsx("input",{type:"date",value:s,onChange:d=>{a(d.target.value),t(1)}})]}),i.isLoading&&e.jsx("p",{children:"Loading daily summary…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),i.data&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[i.data.edits," published changes · ",i.data.papers," papers · ",i.data.contributors," contributors"]}),e.jsx("ul",{className:"space-y-1",children:i.data.rows.map((d,p)=>e.jsxs("li",{children:[e.jsxs(xe,{className:"underline",to:`/paper/${d.paper_id}#edit-history`,children:["Paper ",d.paper_id]})," · @",d.actor_username??"admin"," · ",d.edits," changes"]},p))}),e.jsxs("div",{className:"flex gap-2",children:[n>1&&e.jsx(C,{variant:"outline",onClick:()=>t(n-1),children:"Previous"}),i.data.has_more&&e.jsx(C,{variant:"outline",onClick:()=>t(n+1),children:"Next"})]})]})]})}const Ks=()=>{var p,N,k,m;const s=Fe(),a=bs({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>ue.audit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),n=((p=a.data)==null?void 0:p.pages.flatMap(c=>c.events))??[],t=O({mutationFn:()=>ue.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),i=O({mutationFn:c=>ue.rollbackEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),d=O({mutationFn:({subject:c,suspended:u})=>Te.suspend(c,u),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Gs,{}),(i.error||d.error)&&e.jsx("p",{role:"alert",children:(N=i.error||d.error)==null?void 0:N.message}),e.jsxs(v,{children:[e.jsxs(b,{className:"flex-row items-center justify-between",children:[e.jsx(y,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((m=(k=a.data)==null?void 0:k.pages[0])==null?void 0:m.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(C,{variant:"outline",size:"sm",onClick:()=>t.mutate(),disabled:t.isPending,children:"Mark read"})]})]}),e.jsxs(_,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),n.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:c.before,after:c.after},null,2)})]}),c.actor_role==="contributor"&&c.actor_hf_subject&&e.jsx(C,{className:"mt-3 mr-2",variant:"outline",size:"sm",disabled:d.isPending,onClick:()=>d.mutate({subject:c.actor_hf_subject,suspended:!c.editing_suspended}),children:c.editing_suspended?"Restore editing access":"Suspend editing access"}),!c.rollback_of_event_id&&e.jsx(C,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>i.mutate(c.id),disabled:i.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(C,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})]})},Pe={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},$=s=>`$${(s/1e6).toFixed(2)}`,Vs=({data:s,loading:a,error:n})=>{const[t,i]=h.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(I,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(n||!s)return e.jsx(v,{className:"cron-status--broken",children:e.jsx(_,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const p=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),N=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",k=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(v,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Circuit"})}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold",children:N}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Month to date"})}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold",children:$(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(p),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${p}%`}})})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Application headroom"})}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold",children:$(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",$(s.application_cap_microusd)]})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Live compute"})}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(v,{children:[e.jsxs(b,{children:[e.jsx(y,{children:"Accounting and policy"}),e.jsxs(q,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(_,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:t,onChange:m=>i(m.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[t]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),$(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),$(s.provider_floor_microusd)," · ",e.jsx(S,{children:k})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${$(s.environment_cap_microusd)}`," · Workspace ",$(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",$(s.warning_microusd)," · trip ",$(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),f(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?f(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?f(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${f(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${f(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${$(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${f(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${$(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{children:"Live lifecycle"})}),e.jsx(_,{className:"text-sm",children:Object.entries(s.live_states).map(([m,c])=>e.jsxs("span",{className:"mr-4",children:[m,": ",c]},m))})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{children:"Daily spend"})}),e.jsx(_,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(m=>e.jsxs("li",{children:[m.date,": blank ",$(m.blank_pool_microusd)," · assigned ",$(m.assigned_microusd)]},m.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(v,{children:[e.jsxs(b,{children:[e.jsx(y,{children:"Recent circuit events"}),e.jsx(q,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(_,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(m=>e.jsxs("li",{children:[e.jsx(S,{children:m.severity})," ",m.type," · ",f(m.created_at)]},m.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Qs=({data:s,loading:a,error:n})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(I,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(n||!s)return e.jsx(v,{className:"cron-status--broken",children:e.jsx(_,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const t=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(v,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(b,{children:[e.jsx(y,{children:"Web search"}),e.jsxs(q,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(_,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(t),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${t}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",f(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${f(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(i=>e.jsxs("li",{children:[i.type," · ",f(i.created_at),i.error_class?` · ${i.error_class}`:""]},i.id))})]})]})},Xs=({data:s})=>s!=null&&s.snapshot_stale?e.jsx(v,{className:"mb-6 cron-status--degraded",role:"status",children:e.jsx(_,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx(I,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Refreshing status… Current snapshot is ",Math.ceil(s.snapshot_age_seconds)," seconds old."]})]})})}):null,Ys=(s,a)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?5e3:a?3e4:!1,va=()=>{const s=ms(),[a,n]=h.useState(!0),[t,i]=h.useState(!1),[d,p]=h.useState(0),[N,k]=h.useState(""),[m,c]=h.useState(""),[u,w]=h.useState(new Set),E=h.useRef(!1),{user:g}=os(),{data:j,isLoading:x,error:R,refetch:oe}=X({queryKey:["cronStatus",g==null?void 0:g.username],queryFn:()=>{const l=E.current;return E.current=!1,ve.getCronStatus(l)},enabled:!!(g!=null&&g.is_admin),refetchInterval:l=>Ys(l.state.data,a),retry:!1}),L=X({queryKey:["paperMarkdownJobs",g==null?void 0:g.username],queryFn:()=>ve.getPaperMarkdownJobs(),enabled:!!(g!=null&&g.is_admin),refetchInterval:a?3e4:!1,retry:!1}),F=X({queryKey:["chatSandboxSpend",g==null?void 0:g.username,m],queryFn:()=>be.getSandboxSpend(m||void 0),enabled:!!(g!=null&&g.is_admin),refetchInterval:a?3e4:!1,retry:!1}),Y=X({queryKey:["chatWebSearchBudget",g==null?void 0:g.username],queryFn:()=>be.getWebSearchBudget(),enabled:!!(g!=null&&g.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),ae=(R&&typeof R=="object"&&"status"in R?R.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":R instanceof Error?R.message:void 0,re=l=>{w(M=>{const W=new Set(M);return W.has(l)?W.delete(l):W.add(l),W})},B=(j==null?void 0:j.jobs.filter(l=>l.dashboard_group==="leaderboard_sync"))??[],H=(j==null?void 0:j.jobs.filter(l=>l.category!=="manual"&&l.dashboard_group!=="leaderboard_sync"))??[],ne=H.filter(l=>l.critical),te=H.filter(l=>!l.critical),r=(j==null?void 0:j.manual_operations)??[],o=!!(x||t||j!=null&&j.refreshing),A=te.reduce((l,M)=>(l[M.category]||(l[M.category]=[]),l[M.category].push(M),l),{}),z=Object.keys(A).sort((l,M)=>{const W=["systemd","hourly","daily","weekly","backfill"];return W.indexOf(l)-W.indexOf(M)}),U=l=>e.jsx(Os,{job:l,expanded:u.has(l.job_name),onToggle:()=>re(l.job_name),paperMarkdownJobs:l.job_name==="paper_markdown_backfill"?L.data:void 0,paperMarkdownJobsLoading:l.job_name==="paper_markdown_backfill"?L.isLoading:!1,paperMarkdownJobsError:l.job_name==="paper_markdown_backfill"?L.error:null},l.job_name),J=async()=>{p(l=>l+1),E.current=!0,i(!0);try{await Promise.all([oe(),L.refetch(),F.refetch()])}finally{i(!1)}};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(ie,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(C,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(xe,{to:"/autonomous-operations",children:"Autonomous operations"})}),e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>n(!a),className:a?"cron-status--running":"",children:[e.jsx(Ne,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>void J(),disabled:o,children:[e.jsx(Ne,{className:`h-4 w-4 mr-2 ${o?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(v,{className:"mb-6",children:e.jsx(_,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",g==null?void 0:g.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken. Expanded jobs include deterministic scheduler, log, lock, durable-data, throughput, backlog, and semantic contract evidence with direct operator and run links."]})})}),e.jsx(Xs,{data:j}),e.jsxs(As,{defaultValue:"critical-jobs",children:[e.jsxs(Qe,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(G,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(G,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(G,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(G,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(G,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(K,{value:"critical-jobs",className:"mt-6",children:[x&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(I,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),R&&e.jsx(v,{className:"cron-status--broken",children:e.jsx(_,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{className:"h-5 w-5"}),e.jsx("p",{children:ae??"Failed to load CRON jobs status. Please try again."})]})})}),j&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(l=>e.jsxs(v,{children:[e.jsx(b,{className:"pb-2",children:e.jsx(y,{className:"text-sm font-medium cron-muted capitalize",children:l})}),e.jsx(_,{children:e.jsx("div",{className:"text-2xl font-bold",children:j.summary[l]})})]},l))}),j.summary.critical_issues.length>0&&e.jsxs(v,{className:"mb-6 cron-status--broken",children:[e.jsx(b,{children:e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(Ae,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(_,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:j.summary.critical_issues.map(l=>e.jsx("li",{children:l},l))})})]}),e.jsxs(v,{className:"mb-8",children:[e.jsx(b,{children:e.jsx(y,{className:"text-base",children:"What to check next"})}),e.jsxs(_,{children:[e.jsx("p",{className:"text-sm cron-muted",children:j.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Ee,{className:"h-4 w-4"}),"Last updated: ",f(j.timestamp)," · Health score:"," ",j.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(v,{className:`mb-8 ${j.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-base",children:"Coverage"}),e.jsx(q,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(_,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(v,{className:"mb-8",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Critical jobs"}),e.jsx(q,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(_,{className:"space-y-4",children:ne.map(U)})]}),e.jsx("div",{className:"space-y-6",children:z.map(l=>e.jsxs(v,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(S,{className:Pe[l]??Pe.hourly,children:l}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(q,{children:[A[l].length," job",A[l].length!==1?"s":""]})]})}),e.jsx(_,{className:"space-y-4",children:A[l].map(U)})]},l))}),r.length>0&&e.jsxs(v,{className:"mt-6",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Manual operations"}),e.jsx(q,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(_,{className:"space-y-4",children:r.map(U)})]})]})]}),e.jsxs(K,{value:"leaderboard-syncs",className:"mt-6",children:[x&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(I,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),R&&e.jsx(v,{className:"cron-status--broken",children:e.jsx(_,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{className:"h-5 w-5"}),e.jsx("p",{children:ae??"Failed to load leaderboard sync status. Please try again."})]})})}),j&&e.jsxs(v,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(q,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(S,{children:[B.length," jobs"]})]})}),e.jsx(_,{className:"space-y-4",children:B.map(U)})]})]}),e.jsx(K,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(zs,{autoRefresh:a,refreshToken:d})}),e.jsx(K,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ks,{})}),e.jsxs(K,{value:"chat-compute",className:"mt-6",children:[e.jsxs(v,{className:"mb-6",children:[e.jsxs(b,{children:[e.jsx(y,{children:"Environment record"}),e.jsx(q,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(_,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:N,onChange:l=>k(l.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(C,{onClick:()=>c(N.trim()),children:"Load"})]})]}),e.jsx(Vs,{data:F.data,loading:F.isLoading,error:F.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Qs,{data:Y.data,loading:Y.isLoading,error:Y.error})})]})]})]})})};export{Vs as ChatComputePanel,Xs as CronSnapshotNotice,Ys as cronStatusRefetchInterval,va as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/{ExternalSourceEvalBadge-B3wNcwqv.js → ExternalSourceEvalBadge-D1UcoJqH.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as o}from"./papers-
|
|
|
|
| 1 |
+
import{a as o}from"./papers-DL8dzFlM.js";import{a4 as g,j as a,L as l}from"./index-DAAEdKQ4.js";import{H as u,a as c,b as d}from"./hover-card-DUYUZUhh.js";import{s as m}from"./safeExternalHref-CkBrsh84.js";class b{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(r=>r[1]!==void 0).map(([r,n])=>[r,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}async byLeaderboard(e,t,r={}){return this.allPages({dataset_id:Number(e),task_id:Number(t),ordering:"best_rank",...r})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return o.primeEvaluations(e,t)}batch(e,t){return o.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const r=await this.list({...e,page_size:100});if(!r.next_page)return r.results;const n=Math.ceil(r.count/100),p=await Promise.all(Array.from({length:n-1},(i,h)=>this.list({...e,page:h+2,page_size:100})));return[r,...p].flatMap(i=>i.results)}}const w=new b(g),j=()=>a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(d,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",a.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function x(s){if(!s)return"Evaluation sourced outside this paper";const e=s.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(s,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return s}}const E=({sourceUrl:s})=>{const e=m(s),t=typeof s=="string"&&s.startsWith("/paper/")?s:null,r=x(s);return a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),a.jsxs(d,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(l,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):a.jsxs(a.Fragment,{children:[" ",r,"."]})]})]})};export{j as C,E,w as e};
|
assets/FeedView-BKszJwP_.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{j as e,H as Z,L as p,b as V,c as ee,d as se,r as m,i as $,e as X,C as ae,f as te}from"./index-DuJU_D27.js";import{d as U,t as re}from"./colors-CYTXFGTF.js";import{L as ne,F as ie,B as oe,M as le}from"./mail-D1IAj9JL.js";import{P as ce}from"./plus-CQhIPr4p.js";import{r as G}from"./research-BSQ4hKxD.js";import{P as de}from"./components-Dw3DdUAs.js";import{A as he}from"./AgentLogos-BMGxij6P.js";import{P as me}from"./PaperFeedFilters-Nd8CC_7I.js";import{r as pe,P as ue,w as ge}from"./PaperDateFilter-BqtxoA2-.js";import{D as fe,u as xe,P as je,M as be,S as we,a as ve,R as ye,W as Ne,A as _e,b as Pe,q as ke,c as Se}from"./chatLaunch-DD_4HSkV.js";import{c as Ce}from"./chat-6kLnoZFH.js";import{c as W}from"./catalog-BDn3ESav.js";import{S}from"./chatPrompts-DypmWIqx.js";import{u as Ae}from"./usePapers-DSYVjBgu.js";import{u as Le}from"./useIntersectionObserver-BoMEP06G.js";import{S as k}from"./skeleton-C2Fuuvyv.js";import{A as Te,a as Fe}from"./alert-BEj8j9Sy.js";import{u as I}from"./useQuery-BvOlbTZD.js";import{u as Me}from"./useInfiniteQuery-D38nK1Xd.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DzYgREOe.js";import"./papers-Zi3ALD1n.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Bu3nlXtK.js";import"./chevron-down-B9CqRc2D.js";function Q({signedIn:t,popularTasks:u=[]}){const l=[...t?[]:[e.jsx(e.Fragment,{children:"Sign in with your Hugging Face account. Your follows stay private."})],e.jsxs(e.Fragment,{children:["Open any task, method, benchmark, author, or organization page and click"," ",e.jsxs("span",{className:"following-intro-pill",children:[e.jsx(ce,{"aria-hidden":"true"}),"Follow"]}),"."]}),e.jsxs(e.Fragment,{children:["New papers and benchmark results from everything you follow appear here, ranked like the trending feed. You can also get them as a weekly email from ",e.jsx(p,{to:"/settings",children:"Settings"}),"."]})];return e.jsxs("section",{className:"following-intro","aria-labelledby":"following-intro-title",children:[e.jsx("h2",{id:"following-intro-title",children:"Build your personal research feed"}),e.jsx("p",{className:"following-intro-lead",children:"Follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),e.jsx("ol",{className:"following-intro-steps",children:l.map((n,o)=>e.jsxs("li",{children:[e.jsx("span",{"aria-hidden":"true",children:o+1}),e.jsx("p",{children:n})]},o))}),!t&&e.jsx("div",{className:"following-intro-signin",children:e.jsx(Z,{returnTo:"/following",label:"Sign in to start following"})}),e.jsxs("div",{className:"following-intro-browse",children:[e.jsxs(p,{to:"/tasks",children:[e.jsx(ne,{"aria-hidden":"true"}),"Browse tasks"]}),e.jsxs(p,{to:"/methods",children:[e.jsx(ie,{"aria-hidden":"true"}),"Browse methods"]}),e.jsxs(p,{to:"/organizations",children:[e.jsx(oe,{"aria-hidden":"true"}),"Browse organizations"]}),t&&e.jsxs(p,{to:"/settings",children:[e.jsx(le,{"aria-hidden":"true"}),"Weekly email"]})]}),u.length>0&&e.jsxs("div",{className:"following-intro-popular",children:[e.jsx("h3",{children:"Popular tasks to follow"}),e.jsx("div",{children:u.map(n=>e.jsx(p,{to:`/tasks/${n.slug}`,children:U(n.name,n.slug)},n.id))})]})]})}const Ee=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Y=45,He=1800,De=25,Re=350,Ie=t=>{const[u,l]=m.useState(S[0].slice(0,1));return m.useEffect(()=>{var f,w;if(!t)return;if((w=(f=window.matchMedia)==null?void 0:f.call(window,"(prefers-reduced-motion: reduce)"))!=null&&w.matches){l(S[0]);return}let n=0,o=1,c=!1,g;l(S[0].slice(0,o));const h=()=>{const v=S[n];if(!c){if(o+=1,l(v.slice(0,o)),o===v.length){c=!0,g=window.setTimeout(h,He);return}g=window.setTimeout(h,Y);return}if(o-=1,l(v.slice(0,o)),o===0){c=!1,n=(n+1)%S.length,g=window.setTimeout(h,Re);return}g=window.setTimeout(h,De)};return g=window.setTimeout(h,Y),()=>window.clearTimeout(g)},[t]),u},Oe=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",qe=()=>{var D,H;const t=V(),u=X(),l=te()?we:ve,[n,o]=m.useState({text:"",paperMentions:[]}),c=n.text,[g,h]=m.useState(0),[f,w]=m.useState(fe),[v,O]=m.useState(!0),[C,A]=m.useState("low"),[b,L]=m.useState(!1),[T,P]=m.useState(null),q=Ie(!c),F=m.useRef(null),M=I({queryKey:["chatAvailability"],queryFn:()=>Ce.getAvailability(),retry:!1,enabled:$()}),x=!!((D=M.data)!=null&&D.web_search_available),y=$()&&((H=M.data)==null?void 0:H.paper_mentions_enabled)!==!1,i=xe({draft:n,onChange:o,enabled:y,textareaRef:F});m.useLayoutEffect(()=>{const a=F.current;if(!a)return;const d=()=>{if(a.style.height="auto",c){a.style.height=`${Math.min(a.scrollHeight,160)}px`;return}const j=a.placeholder,N=S.reduce((_,R)=>(a.placeholder=R,Math.max(_,a.scrollHeight)),0);a.placeholder=j,a.style.height=`${Math.min(N,160)}px`};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[c]);const E=async(a=n)=>{const d=a.text.trim();if(!(!d||b)){if(u){const j=new URLSearchParams({q:d,model:f}),N=`${ae}?${j}`,_=window.open(N,"_blank");if(!_){P(N);return}_.opener=null,P(null),o({text:"",paperMentions:[]});return}L(!0),ke(a,f,{webSearchEnabled:v,reasoningEffort:C});try{const j=await Se(f,C);t(`/chat/${j.id}`)}catch{t("/chat")}}};return e.jsxs(e.Fragment,{children:[!u&&e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(je,{text:n.text,mentions:n.paperMentions,scrollTop:g,variant:"home"}),e.jsx("textarea",{ref:F,rows:1,value:c,placeholder:q,"aria-label":"Ask the assistant",disabled:b,onChange:a=>i.updateText(a.target.value,a.target.selectionStart),onSelect:a=>i.refresh(a.currentTarget.selectionStart),onClick:a=>i.refresh(a.currentTarget.selectionStart),onScroll:a=>h(a.currentTarget.scrollTop),onBlur:a=>{var d,j;(j=(d=a.relatedTarget)==null?void 0:d.closest)!=null&&j.call(d,".chat-paper-picker")||window.setTimeout(i.close,0)},onKeyDown:a=>{i.keyDown(a)||a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),E())},role:y?"combobox":void 0,"aria-expanded":y?i.open:void 0,"aria-controls":i.open?i.pickerId:void 0,"aria-activedescendant":i.open&&i.results.length?`${i.optionIdPrefix}-${i.activeIndex}`:void 0,"aria-autocomplete":y?"list":void 0,"aria-describedby":i.message?"ask-home-paper-mention-message":void 0})]}),T&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:T,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),i.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:i.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(be,{models:l,selectedModel:f,onModelChange:w}),!u&&e.jsx(ye,{value:C,onChange:A,disabled:b}),x&&e.jsx(Ne,{enabled:v,onChange:O,disabled:b})]}),e.jsx("button",{type:"button",className:`chat-send${c.trim()?" chat-send-on":""}`,onClick:()=>void E(),disabled:!c.trim()||b,"aria-label":"Ask the assistant",children:e.jsx(_e,{})})]}),e.jsx(Pe,{open:i.open,query:i.query,results:i.results,activeIndex:i.activeIndex,loading:i.loading,error:i.error,onSelect:i.select,id:i.pickerId,optionIdPrefix:i.optionIdPrefix})]})]})},ms=({following:t=!1})=>{var a,d,j,N,_,R,z;const u=V(),l=ee(),n=l==null?void 0:l.user,[o,c]=se(),g=Oe(o.get("order_by")),h=pe(o,void 0,t?"month":"week"),f=o.get("has_code")==="true",w=o.get("has_hf_artifacts")==="true",v=s=>{const r=new URLSearchParams(o);r.set("order_by",s),t?u(`/?${r}`):c(r)},O=s=>{const r=new URLSearchParams(o);s?r.set("has_code","true"):r.delete("has_code"),c(r)},C=s=>{const r=new URLSearchParams(o);s?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),c(r)},A=I({queryKey:["top-tasks-sidebar"],queryFn:()=>W.topTasks(8),staleTime:10*60*1e3}),b=I({queryKey:["trending-tasks-sidebar"],queryFn:()=>W.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),L=Ae({enabled:!t,page_size:30,order_by:g,order_dir:"desc",start_date:h.startDate,end_date:h.endDate,include_resources:!0,has_code:f,has_hf_artifacts:w}),T={...h,hasCode:f,hasHfArtifacts:w},P=Me({queryKey:["research-feed",n==null?void 0:n.hf_subject,T],queryFn:({pageParam:s})=>G.following(s,T),initialPageParam:0,getNextPageParam:(s,r)=>s.length===40?r.length*40:void 0,enabled:t&&!!n}),q=I({queryKey:["research-follows",n==null?void 0:n.hf_subject],queryFn:G.follows,enabled:t&&!!n}),F=t&&!!n&&((a=q.data)==null?void 0:a.length)===0,M=(d=A.data)==null?void 0:d.slice(0,8),x=t?P:L,y=m.useMemo(()=>{var r,K;return(t?((r=P.data)==null?void 0:r.pages.flatMap(B=>B.map(J=>J.paper)))??[]:((K=L.data)==null?void 0:K.pages.flatMap(B=>B.results))??[]).map(re)},[t,P.data,L.data]),{targetRef:i,isIntersecting:E}=Le({rootMargin:"400px"});m.useEffect(()=>{E&&x.hasNextPage&&!x.isFetchingNextPage&&x.fetchNextPage()},[E,x.hasNextPage,x.isFetchingNextPage]);const D=x.isLoading||t&&(l==null?void 0:l.isLoading),H=x.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(k,{className:"h-5 w-full"},r))}),(j=A.data)==null?void 0:j.map(s=>e.jsxs(p,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[U(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(p,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),b.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(k,{className:"h-5 w-full"},r))}),((_=(N=b.data)==null?void 0:N.results)==null?void 0:_.length)===0&&!b.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(z=(R=b.data)==null?void 0:R.results)==null?void 0:z.map(s=>e.jsxs(p,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[U(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]}),e.jsxs("div",{className:"sidebar-section sidebar-section-tools",children:[e.jsx("div",{className:"sidebar-label",children:"Use PwC with your agent"}),e.jsxs(p,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",children:["MCP server",e.jsx(he,{})]}),e.jsxs("p",{className:"sidebar-tools-copy",children:["Search papers, benchmarks, and leaderboards from any MCP client, or from the terminal with the"," ",e.jsxs("a",{href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:[e.jsx("code",{children:"pwc"})," CLI"]}),"."]})]})]}),e.jsxs("div",{className:"feed-main",children:[($()||X())&&e.jsx("div",{className:"feed-chat",children:e.jsx(qe,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsxs("div",{className:"sort-options",children:[Ee.map(([s,r])=>e.jsx("button",{className:`sort-btn ${!t&&g===s?"active":""}`,onClick:()=>v(s),children:r},s)),e.jsx("button",{className:`sort-btn ${t?"active":""}`,onClick:()=>{const s=new URLSearchParams(o);s.delete("order_by");const r=s.toString();u(r?`/following?${r}`:"/following")},children:"following"})]}),e.jsx(me,{hasCode:f,hasHfArtifacts:w,onHasCodeChange:O,onHasHfArtifactsChange:C})]}),e.jsx(ue,{startDate:h.startDate,endDate:h.endDate,onChange:s=>c(ge(o,s))})]}),H&&e.jsx(Te,{variant:"destructive",className:"mb-4",children:e.jsxs(Fe,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void x.refetch(),children:"Try again"})]})}),t&&!(l!=null&&l.isLoading)&&!n?e.jsx(Q,{signedIn:!1,popularTasks:M}):F?e.jsx(Q,{signedIn:!0,popularTasks:M}):D?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(k,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(k,{className:"h-6 w-3/4"}),e.jsx(k,{className:"h-4 w-1/2"}),e.jsx(k,{className:"h-12 w-full"})]})]},r))}):y.length===0?H?null:e.jsx("div",{className:"no-results",children:t?e.jsxs(e.Fragment,{children:["No papers from your follows match these filters. Widen the date range, or follow more from ",e.jsx(p,{to:"/tasks",children:"tasks"}),", ",e.jsx(p,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,r)=>e.jsx(de,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:i,style:{height:1}}),x.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{qe as AskAssistant,ms as default};
|
|
|
|
|
|
assets/FeedView-BaTbW_7f.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{j as e,H as Z,L as p,b as V,c as ee,d as se,r as m,i as $,e as X,C as ae,f as te}from"./index-DAAEdKQ4.js";import{d as U,t as re}from"./colors-DR110Nc2.js";import{L as ne,F as ie,B as oe,M as le}from"./mail-CoJDXtbW.js";import{P as ce}from"./plus-B07MagLg.js";import{r as G}from"./research--raTfZxI.js";import{P as de}from"./components-BWWnJ95m.js";import{A as he}from"./AgentLogos-CGEF3N8p.js";import{P as me}from"./PaperFeedFilters-Hyqa1G4B.js";import{r as pe,P as ue,w as ge}from"./PaperDateFilter-Cmzg62xO.js";import{D as fe,u as xe,P as je,M as be,S as we,a as ve,R as ye,W as Ne,A as _e,b as Pe,q as ke,c as Se}from"./chatLaunch-D9EyZxQg.js";import{c as Ce}from"./chat-BFojJrU9.js";import{c as W}from"./catalog-Cjgxq75q.js";import{S}from"./chatPrompts-DypmWIqx.js";import{u as Ae}from"./usePapers-BoM3UV5_.js";import{u as Le}from"./useIntersectionObserver-DFkuIFUb.js";import{S as k}from"./skeleton-Te-nsRWB.js";import{A as Te,a as Fe}from"./alert-B_MWtfva.js";import{u as I}from"./useQuery-BALok3Po.js";import{u as Me}from"./useInfiniteQuery-BJadVmaJ.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-lQiG5mCP.js";import"./papers-DL8dzFlM.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CNAIo5eI.js";import"./chevron-down-D8dAesMf.js";import"./earth-C2xqFcX3.js";function Q({signedIn:t,popularTasks:u=[]}){const l=[...t?[]:[e.jsx(e.Fragment,{children:"Sign in with your Hugging Face account. Your follows stay private."})],e.jsxs(e.Fragment,{children:["Open any task, method, benchmark, author, or organization page and click"," ",e.jsxs("span",{className:"following-intro-pill",children:[e.jsx(ce,{"aria-hidden":"true"}),"Follow"]}),"."]}),e.jsxs(e.Fragment,{children:["New papers and benchmark results from everything you follow appear here, ranked like the trending feed. You can also get them as a weekly email from ",e.jsx(p,{to:"/settings",children:"Settings"}),"."]})];return e.jsxs("section",{className:"following-intro","aria-labelledby":"following-intro-title",children:[e.jsx("h2",{id:"following-intro-title",children:"Build your personal research feed"}),e.jsx("p",{className:"following-intro-lead",children:"Follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),e.jsx("ol",{className:"following-intro-steps",children:l.map((n,o)=>e.jsxs("li",{children:[e.jsx("span",{"aria-hidden":"true",children:o+1}),e.jsx("p",{children:n})]},o))}),!t&&e.jsx("div",{className:"following-intro-signin",children:e.jsx(Z,{returnTo:"/following",label:"Sign in to start following"})}),e.jsxs("div",{className:"following-intro-browse",children:[e.jsxs(p,{to:"/tasks",children:[e.jsx(ne,{"aria-hidden":"true"}),"Browse tasks"]}),e.jsxs(p,{to:"/methods",children:[e.jsx(ie,{"aria-hidden":"true"}),"Browse methods"]}),e.jsxs(p,{to:"/organizations",children:[e.jsx(oe,{"aria-hidden":"true"}),"Browse organizations"]}),t&&e.jsxs(p,{to:"/settings",children:[e.jsx(le,{"aria-hidden":"true"}),"Weekly email"]})]}),u.length>0&&e.jsxs("div",{className:"following-intro-popular",children:[e.jsx("h3",{children:"Popular tasks to follow"}),e.jsx("div",{children:u.map(n=>e.jsx(p,{to:`/tasks/${n.slug}`,children:U(n.name,n.slug)},n.id))})]})]})}const Ee=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Y=45,He=1800,De=25,Re=350,Ie=t=>{const[u,l]=m.useState(S[0].slice(0,1));return m.useEffect(()=>{var f,w;if(!t)return;if((w=(f=window.matchMedia)==null?void 0:f.call(window,"(prefers-reduced-motion: reduce)"))!=null&&w.matches){l(S[0]);return}let n=0,o=1,c=!1,g;l(S[0].slice(0,o));const h=()=>{const v=S[n];if(!c){if(o+=1,l(v.slice(0,o)),o===v.length){c=!0,g=window.setTimeout(h,He);return}g=window.setTimeout(h,Y);return}if(o-=1,l(v.slice(0,o)),o===0){c=!1,n=(n+1)%S.length,g=window.setTimeout(h,Re);return}g=window.setTimeout(h,De)};return g=window.setTimeout(h,Y),()=>window.clearTimeout(g)},[t]),u},Oe=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",qe=()=>{var D,H;const t=V(),u=X(),l=te()?we:ve,[n,o]=m.useState({text:"",paperMentions:[]}),c=n.text,[g,h]=m.useState(0),[f,w]=m.useState(fe),[v,O]=m.useState(!0),[C,A]=m.useState("low"),[b,L]=m.useState(!1),[T,P]=m.useState(null),q=Ie(!c),F=m.useRef(null),M=I({queryKey:["chatAvailability"],queryFn:()=>Ce.getAvailability(),retry:!1,enabled:$()}),x=!!((D=M.data)!=null&&D.web_search_available),y=$()&&((H=M.data)==null?void 0:H.paper_mentions_enabled)!==!1,i=xe({draft:n,onChange:o,enabled:y,textareaRef:F});m.useLayoutEffect(()=>{const a=F.current;if(!a)return;const d=()=>{if(a.style.height="auto",c){a.style.height=`${Math.min(a.scrollHeight,160)}px`;return}const j=a.placeholder,N=S.reduce((_,R)=>(a.placeholder=R,Math.max(_,a.scrollHeight)),0);a.placeholder=j,a.style.height=`${Math.min(N,160)}px`};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[c]);const E=async(a=n)=>{const d=a.text.trim();if(!(!d||b)){if(u){const j=new URLSearchParams({q:d,model:f}),N=`${ae}?${j}`,_=window.open(N,"_blank");if(!_){P(N);return}_.opener=null,P(null),o({text:"",paperMentions:[]});return}L(!0),ke(a,f,{webSearchEnabled:v,reasoningEffort:C});try{const j=await Se(f,C);t(`/chat/${j.id}`)}catch{t("/chat")}}};return e.jsxs(e.Fragment,{children:[!u&&e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(je,{text:n.text,mentions:n.paperMentions,scrollTop:g,variant:"home"}),e.jsx("textarea",{ref:F,rows:1,value:c,placeholder:q,"aria-label":"Ask the assistant",disabled:b,onChange:a=>i.updateText(a.target.value,a.target.selectionStart),onSelect:a=>i.refresh(a.currentTarget.selectionStart),onClick:a=>i.refresh(a.currentTarget.selectionStart),onScroll:a=>h(a.currentTarget.scrollTop),onBlur:a=>{var d,j;(j=(d=a.relatedTarget)==null?void 0:d.closest)!=null&&j.call(d,".chat-paper-picker")||window.setTimeout(i.close,0)},onKeyDown:a=>{i.keyDown(a)||a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),E())},role:y?"combobox":void 0,"aria-expanded":y?i.open:void 0,"aria-controls":i.open?i.pickerId:void 0,"aria-activedescendant":i.open&&i.results.length?`${i.optionIdPrefix}-${i.activeIndex}`:void 0,"aria-autocomplete":y?"list":void 0,"aria-describedby":i.message?"ask-home-paper-mention-message":void 0})]}),T&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:T,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),i.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:i.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(be,{models:l,selectedModel:f,onModelChange:w}),!u&&e.jsx(ye,{value:C,onChange:A,disabled:b}),x&&e.jsx(Ne,{enabled:v,onChange:O,disabled:b})]}),e.jsx("button",{type:"button",className:`chat-send${c.trim()?" chat-send-on":""}`,onClick:()=>void E(),disabled:!c.trim()||b,"aria-label":"Ask the assistant",children:e.jsx(_e,{})})]}),e.jsx(Pe,{open:i.open,query:i.query,results:i.results,activeIndex:i.activeIndex,loading:i.loading,error:i.error,onSelect:i.select,id:i.pickerId,optionIdPrefix:i.optionIdPrefix})]})]})},ps=({following:t=!1})=>{var a,d,j,N,_,R,z;const u=V(),l=ee(),n=l==null?void 0:l.user,[o,c]=se(),g=Oe(o.get("order_by")),h=pe(o,void 0,t?"month":"week"),f=o.get("has_code")==="true",w=o.get("has_hf_artifacts")==="true",v=s=>{const r=new URLSearchParams(o);r.set("order_by",s),t?u(`/?${r}`):c(r)},O=s=>{const r=new URLSearchParams(o);s?r.set("has_code","true"):r.delete("has_code"),c(r)},C=s=>{const r=new URLSearchParams(o);s?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),c(r)},A=I({queryKey:["top-tasks-sidebar"],queryFn:()=>W.topTasks(8),staleTime:10*60*1e3}),b=I({queryKey:["trending-tasks-sidebar"],queryFn:()=>W.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),L=Ae({enabled:!t,page_size:30,order_by:g,order_dir:"desc",start_date:h.startDate,end_date:h.endDate,include_resources:!0,has_code:f,has_hf_artifacts:w}),T={...h,hasCode:f,hasHfArtifacts:w},P=Me({queryKey:["research-feed",n==null?void 0:n.hf_subject,T],queryFn:({pageParam:s})=>G.following(s,T),initialPageParam:0,getNextPageParam:(s,r)=>s.length===40?r.length*40:void 0,enabled:t&&!!n}),q=I({queryKey:["research-follows",n==null?void 0:n.hf_subject],queryFn:G.follows,enabled:t&&!!n}),F=t&&!!n&&((a=q.data)==null?void 0:a.length)===0,M=(d=A.data)==null?void 0:d.slice(0,8),x=t?P:L,y=m.useMemo(()=>{var r,K;return(t?((r=P.data)==null?void 0:r.pages.flatMap(B=>B.map(J=>J.paper)))??[]:((K=L.data)==null?void 0:K.pages.flatMap(B=>B.results))??[]).map(re)},[t,P.data,L.data]),{targetRef:i,isIntersecting:E}=Le({rootMargin:"400px"});m.useEffect(()=>{E&&x.hasNextPage&&!x.isFetchingNextPage&&x.fetchNextPage()},[E,x.hasNextPage,x.isFetchingNextPage]);const D=x.isLoading||t&&(l==null?void 0:l.isLoading),H=x.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(k,{className:"h-5 w-full"},r))}),(j=A.data)==null?void 0:j.map(s=>e.jsxs(p,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[U(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(p,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),b.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(k,{className:"h-5 w-full"},r))}),((_=(N=b.data)==null?void 0:N.results)==null?void 0:_.length)===0&&!b.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(z=(R=b.data)==null?void 0:R.results)==null?void 0:z.map(s=>e.jsxs(p,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[U(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]}),e.jsxs("div",{className:"sidebar-section sidebar-section-tools",children:[e.jsx("div",{className:"sidebar-label",children:"Use PwC with your agent"}),e.jsxs(p,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",children:["MCP server",e.jsx(he,{})]}),e.jsxs("p",{className:"sidebar-tools-copy",children:["Search papers, benchmarks, and leaderboards from any MCP client, or from the terminal with the"," ",e.jsxs("a",{href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:[e.jsx("code",{children:"pwc"})," CLI"]}),"."]})]})]}),e.jsxs("div",{className:"feed-main",children:[($()||X())&&e.jsx("div",{className:"feed-chat",children:e.jsx(qe,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsxs("div",{className:"sort-options",children:[Ee.map(([s,r])=>e.jsx("button",{className:`sort-btn ${!t&&g===s?"active":""}`,onClick:()=>v(s),children:r},s)),e.jsx("button",{className:`sort-btn ${t?"active":""}`,onClick:()=>{const s=new URLSearchParams(o);s.delete("order_by");const r=s.toString();u(r?`/following?${r}`:"/following")},children:"following"})]}),e.jsx(me,{hasCode:f,hasHfArtifacts:w,onHasCodeChange:O,onHasHfArtifactsChange:C})]}),e.jsx(ue,{startDate:h.startDate,endDate:h.endDate,onChange:s=>c(ge(o,s))})]}),H&&e.jsx(Te,{variant:"destructive",className:"mb-4",children:e.jsxs(Fe,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void x.refetch(),children:"Try again"})]})}),t&&!(l!=null&&l.isLoading)&&!n?e.jsx(Q,{signedIn:!1,popularTasks:M}):F?e.jsx(Q,{signedIn:!0,popularTasks:M}):D?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(k,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(k,{className:"h-6 w-3/4"}),e.jsx(k,{className:"h-4 w-1/2"}),e.jsx(k,{className:"h-12 w-full"})]})]},r))}):y.length===0?H?null:e.jsx("div",{className:"no-results",children:t?e.jsxs(e.Fragment,{children:["No papers from your follows match these filters. Widen the date range, or follow more from ",e.jsx(p,{to:"/tasks",children:"tasks"}),", ",e.jsx(p,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,r)=>e.jsx(de,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:i,style:{height:1}}),x.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{qe as AskAssistant,ps as default};
|
assets/FollowingView-89_kX1Jq.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{j as o}from"./index-DAAEdKQ4.js";import r from"./FeedView-BaTbW_7f.js";import"./colors-DR110Nc2.js";import"./mail-CoJDXtbW.js";import"./plus-B07MagLg.js";import"./research--raTfZxI.js";import"./components-BWWnJ95m.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-lQiG5mCP.js";import"./papers-DL8dzFlM.js";import"./safeExternalHref-CkBrsh84.js";import"./AgentLogos-CGEF3N8p.js";import"./PaperFeedFilters-Hyqa1G4B.js";import"./PaperDateFilter-Cmzg62xO.js";import"./popover-CNAIo5eI.js";import"./chatLaunch-D9EyZxQg.js";import"./chat-BFojJrU9.js";import"./chevron-down-D8dAesMf.js";import"./useQuery-BALok3Po.js";import"./earth-C2xqFcX3.js";import"./catalog-Cjgxq75q.js";import"./chatPrompts-DypmWIqx.js";import"./usePapers-BoM3UV5_.js";import"./useInfiniteQuery-BJadVmaJ.js";import"./useIntersectionObserver-DFkuIFUb.js";import"./skeleton-Te-nsRWB.js";import"./alert-B_MWtfva.js";function z(){return o.jsx(r,{following:!0})}export{z as default};
|
assets/FollowingView-CYhGO2K_.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{j as o}from"./index-DuJU_D27.js";import r from"./FeedView-BKszJwP_.js";import"./colors-CYTXFGTF.js";import"./mail-D1IAj9JL.js";import"./plus-CQhIPr4p.js";import"./research-BSQ4hKxD.js";import"./components-Dw3DdUAs.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DzYgREOe.js";import"./papers-Zi3ALD1n.js";import"./safeExternalHref-CkBrsh84.js";import"./AgentLogos-BMGxij6P.js";import"./PaperFeedFilters-Nd8CC_7I.js";import"./PaperDateFilter-BqtxoA2-.js";import"./popover-Bu3nlXtK.js";import"./chatLaunch-DD_4HSkV.js";import"./chat-6kLnoZFH.js";import"./chevron-down-B9CqRc2D.js";import"./useQuery-BvOlbTZD.js";import"./catalog-BDn3ESav.js";import"./chatPrompts-DypmWIqx.js";import"./usePapers-DSYVjBgu.js";import"./useInfiniteQuery-D38nK1Xd.js";import"./useIntersectionObserver-BoMEP06G.js";import"./skeleton-C2Fuuvyv.js";import"./alert-BEj8j9Sy.js";function y(){return o.jsx(r,{following:!0})}export{y as default};
|
|
|
|
|
|
assets/{FrameworksIndexView-Dz2LHIvD.js → FrameworksIndexView-BUcIxyBE.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{b as d,j as e,L as o,F as m}from"./index-
|
|
|
|
| 1 |
+
import{b as d,j as e,L as o,F as m}from"./index-DAAEdKQ4.js";import{u as p}from"./useQuery-BALok3Po.js";import{I as h}from"./components-BWWnJ95m.js";import{c as u}from"./catalog-Cjgxq75q.js";import{c as g,h as f}from"./colors-DR110Nc2.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-lQiG5mCP.js";import"./papers-DL8dzFlM.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,E as default};
|
assets/{LatexTitle-DzYgREOe.js → LatexTitle-lQiG5mCP.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-wklAmtGL.css"])))=>i.map(i=>d[i]);
|
| 2 |
-
import{j as u,r as A,_ as L}from"./index-
|
|
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-wklAmtGL.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{j as u,r as A,_ as L}from"./index-DAAEdKQ4.js";let g=null,$=null;function M(){return $??($=Promise.all([L(()=>import("./katex-DkKDou_j.js"),[]),L(()=>Promise.resolve({}),__vite__mapDeps([0]))]).then(([n])=>(g=n.default,g))),$}const O=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),S={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},b={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},w={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},k={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},N={"'":S,"`":b,"^":w,'"':k,"~":{n:"ñ",N:"Ñ"}},T={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function I(n,i){var e;return((e=N[n])==null?void 0:e[i])??null}function v(n){const i=[];let e=0,t="";const r=()=>{t&&(i.push({type:"text",content:t}),t="")};for(;e<n.length;){if(n[e]==="$"&&n[e+1]==="$"){r();const o=n.indexOf("$$",e+2);if(o===-1){t+=n.slice(e);break}i.push({type:"display",content:n.slice(e+2,o)}),e=o+2;continue}if(n[e]==="$"){r();const o=n.indexOf("$",e+1);if(o===-1){t+=n.slice(e);break}i.push({type:"inline",content:n.slice(e+1,o)}),e=o+1;continue}t+=n[e],e+=1}return r(),i}function d(n,i){if(n[i]!=="{")return null;let e=0;for(let t=i;t<n.length;t+=1)if(n[t]==="{")e+=1;else if(n[t]==="}"&&(e-=1,e===0))return{content:n.slice(i+1,t),end:t+1};return null}function j(n,i){let e=i+1;if(e>=n.length)return{name:"",end:e};if(!/[a-zA-Z]/.test(n[e]))return{name:n[e],end:e+1};const t=e;for(;e<n.length&&/[a-zA-Z]/.test(n[e]);)e+=1;return{name:n.slice(t,e),end:e}}function U(n,i){const e=n[i];if(e!=="^"&&e!=="_"||i+1>=n.length)return null;if(n[i+1]==="{"){const t=d(n,i+1);return t?{end:t.end}:null}return/[A-Za-z0-9+\-=.]/.test(n[i+1])?{end:i+2}:null}function y(n,i){let e=i;if(n[e]==="\\"){const{name:o,end:s}=j(n,e);if(!o)return null;if(e=s,n[e]==="{"){const a=d(n,e);a&&(e=a.end)}}else if(/[A-Za-z0-9]/.test(n[e])){let o=e+1;for(;o<n.length&&/[A-Za-z0-9]/.test(n[o]);)o+=1;if(n[o]!=="^"&&n[o]!=="_")return null;e=o}else return null;const t=i;let r=0;for(;e<n.length;){const o=U(n,e);if(!o)break;r+=1,e=o.end}return r===0?null:{latex:n.slice(t,e),end:e}}function z(n){return Array.from(new Set((n||"").trim().split(/\s+/).filter(Boolean))).sort((i,e)=>e.length-i.length)}function X(n,i,e){const t=z(i);if(!t.length)return[n];const r=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${r.join("|")})`,"gi");return n.split(o).filter(Boolean).map((s,a)=>t.some(p=>p.toLocaleLowerCase()===s.toLocaleLowerCase())?u.jsx("mark",{children:s},`${e}-mark-${a}`):s)}function m(n,i,e){const t=[];let r=0,o=0;const s=()=>`${i}-${o++}`,a=(p,f)=>p==="strong"?u.jsx("strong",{children:f},s()):u.jsx("em",{children:f},s());for(;r<n.length;){if(n[r]==="\\"){const{name:l,end:C}=j(n,r);if(r=C,T[l]){t.push(T[l]);continue}if(l.length===1&&r<n.length&&/[A-Za-z]/.test(n[r])){const c=I(l,n[r]);if(c){t.push(c),r+=1;continue}}if(l==="c"){const c=d(n,r);if((c==null?void 0:c.content.length)===1){const h={c:"ç",C:"Ç"}[c.content];if(h){t.push(h),r=c.end;continue}}}if(l==="textbf"||l==="mathbf"){const c=d(n,r);if(c){r=c.end,t.push(a("strong",m(c.content,s(),e)));continue}}if(l==="emph"||l==="textit"||l==="textsl"||l==="texttt"){const c=d(n,r);if(c){r=c.end,t.push(a("em",m(c.content,s(),e)));continue}}if(l==="color"||l==="textcolor"){const c=d(n,r);if(c){r=c.end;const h=d(n,r);h&&(r=h.end,t.push(...m(h.content,s(),e)));continue}}if(O.has(l)){t.push(" ");continue}if(l==="~"){t.push(" ");continue}const E=d(n,r);if(E){r=E.end,t.push(...m(E.content,s(),e));continue}t.push(`\\${l}`);continue}if(n[r]==="~"){t.push(" "),r+=1;continue}const p=y(n,r);if(p){t.push(u.jsx(_,{latex:p.latex,display:!1},s())),r=p.end;continue}let f=r;for(;f<n.length&&n[f]!=="\\"&&n[f]!=="~"&&!y(n,f);)f+=1;f>r&&t.push(...X(n.slice(r,f),e,s())),r=f}return t}function _({latex:n,display:i}){const[e,t]=A.useState(g);A.useEffect(()=>{if(e)return;let o=!0;return M().then(s=>{o&&t(()=>s)}),()=>{o=!1}},[e]);const r=A.useMemo(()=>{if(e)try{return e.renderToString(n.trim(),{displayMode:i,throwOnError:!1})}catch{return null}},[e,n,i]);return r===void 0?u.jsx(u.Fragment,{children:n}):r?u.jsx("span",{className:i?"katex-display":void 0,dangerouslySetInnerHTML:{__html:r}}):u.jsx(u.Fragment,{children:i?`$$${n}$$`:`$${n}$`})}function D(n,i){const e=v(n),t=[];return e.forEach((r,o)=>{const s=`latex-${o}`;if(r.type==="text"){const a=m(r.content,s,i);a.length===1?t.push(a[0]):a.length>1&&t.push(u.jsx(A.Fragment,{children:a},s));return}if(r.type==="display"){t.push(u.jsx(_,{latex:r.content,display:!0},s));return}t.push(u.jsx(_,{latex:r.content,display:!1},s))}),t.length===1?t[0]:u.jsx(u.Fragment,{children:t})}const P=({text:n,className:i="",highlight:e})=>{const t=A.useMemo(()=>D(n,e),[n,e]);return u.jsx("span",{className:i,children:t})},Z=({title:n,className:i="",highlight:e})=>u.jsx(P,{text:n,className:i,highlight:e});export{Z as L,P as a};
|
assets/{MarkdownText-CMN2meZd.js → MarkdownText-CcUZ0t2p.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{n as l,j as s,L as u}from"./index-
|
|
|
|
| 1 |
+
import{n as l,j as s,L as u}from"./index-DAAEdKQ4.js";/* empty css */import{r as p,a as m,P as h}from"./PaperPreviewLink-n9bIC1vy.js";import{M as d}from"./index-D6KYmf_u.js";import{r as w}from"./index-UMJO-v2N.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const e=new URL(n,o);if(!x.has(e.hostname))return null;t=`${e.pathname}${e.search}${e.hash}`}catch{return null}const r=t.split(/[?#]/,1)[0];return P.some(e=>r===e||r.startsWith(`${e}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const r=t[1],e=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(r),a=/^[1-9]\d*$/.test(r);return!e&&!a?null:l(r)}const L=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:e,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:r}):s.jsx(u,{to:i,...a,children:r})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:r})}},children:n})});export{L as M,f as r};
|
assets/{McpView-BMYYEYSl.js → McpView-C-n3RWJG.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{g as b,F as h,j as e,l as x}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{g as b,F as h,j as e,l as x}from"./index-DAAEdKQ4.js";import{u as j}from"./useQuery-BALok3Po.js";import{f,D as g}from"./latexPlainText-DI8YEXVe.js";import{q as y}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-BDSbRkJU.js";import{E as i}from"./external-link-n_se8QIW.js";import{C as w}from"./copy-D_GFD6J1.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{MethodDetailView-BhKaIJvA.js → MethodDetailView-BsC3WZ-M.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,r as A,u as Q,d as O,L,af as U}from"./index-DuJU_D27.js";import{R as G}from"./ResearchFollowButton-BrbOAi4p.js";import{p as W}from"./paperQueryKeys-BP2E-0yf.js";import{u as w}from"./useQuery-BvOlbTZD.js";import{u as Z}from"./useInfiniteQuery-D38nK1Xd.js";import{M as V,P as X}from"./components-Dw3DdUAs.js";import{P as Y}from"./PaperFeedFilters-Nd8CC_7I.js";import{a as J,P as ee,b as te}from"./PaperDateFilter-BqtxoA2-.js";import{r as se,M as R}from"./MarkdownText-CMN2meZd.js";import{c as F}from"./catalog-BDn3ESav.js";import{p as ae}from"./papers-Zi3ALD1n.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./colors-CYTXFGTF.js";import{u as ie}from"./useIntersectionObserver-BoMEP06G.js";import{S as M}from"./skeleton-C2Fuuvyv.js";import{A as le,a as oe}from"./alert-BEj8j9Sy.js";import{s as ce}from"./safeExternalHref-CkBrsh84.js";import"./useMutation-BAvuTKgd.js";import"./research-BSQ4hKxD.js";import"./plus-CQhIPr4p.js";import"./LatexTitle-DzYgREOe.js";import"./popover-Bu3nlXtK.js";/* empty css */import"./PaperPreviewLink-Bvcg4CvY.js";import"./index-BOvg3c6G.js";import"./index-DwysRPUB.js";import"./katex-DkKDou_j.js";import"./hover-card-DfwM1bh1.js";const s={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},f=({x:t,y:r,w:c,h:d,fill:g,stroke:u,label:h,fontSize:l=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:r,width:c,height:d,rx:"3",ry:"3",fill:g,stroke:u,strokeWidth:"1"}),e.jsx("text",{x:t+c/2,y:r+d/2,fontSize:l,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:h})]}),de=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(f,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(f,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(f,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(f,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(f,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(f,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(f,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(f,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),me=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),me.map(([t,r],c)=>{const d=92+c*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:d,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),r?e.jsx("text",{x:"138",y:d,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:r}):null]},t)})]}),pe={attention:de,"agent-skills":he},ue=({method:t})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(f,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(f,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(f,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),xe=({method:t})=>{const r=(t.slug||"").toLowerCase(),c=pe[r];if(c)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(c,{})});if(t.image_url){const d=r==="transformer"||r==="gpt-4"||r==="gpt-4o"||r==="multi-head-attention"?" method-figure-svg--compact":r==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${d}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(ue,{method:t})})},C=720,I=138,p={top:8,right:10,bottom:25,left:36},H=56,ge=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),fe=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),T=t=>ge.format(new Date(`${t}T00:00:00Z`)),je=(t,r)=>{if(t===0)return new Set;const c=t>48?12:t>36?6:t>18?3:2,d=Math.max(1,Math.ceil(H/r)),g=Math.max(c,d),u=t-1,h=new Set([0,u]);for(let l=g;l<u;l+=g)(u-l)*r>=H&&h.add(l);return h},q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const r=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${r}`},_e=({history:t,methodName:r})=>{const[c,d]=A.useState(null),g=Math.max(1,...t.map(o=>o.paper_count)),u=C-p.left-p.right,h=I-p.top-p.bottom,l=t.length?u/t.length:u,S=Math.max(2,l*.68),D=je(t.length,l),_=Array.from(new Set([0,Math.ceil(g/2),g])),j=c==null?null:t[c],x=j?q(j):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${C} ${I}`,role:"group","aria-label":`${r}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[r,": papers mentioning this method by publication month"]}),_.map(o=>{const i=p.top+h-o/g*h;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:p.left,x2:C-p.right,y1:i,y2:i}),e.jsx("text",{className:"method-usage-y-label",x:p.left-8,y:i+3,textAnchor:"end",children:o})]},o)}),t.map((o,i)=>{const k=o.paper_count/g*h,y=o.paper_count>0?Math.max(1,k):0,P=p.left+l*i+(l-S)/2,b=p.top+h-y,a=c===i,N=i===t.length-1,v=q(o);return e.jsxs("g",{className:`method-usage-bar${a?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${T(o.start_date)}: ${o.paper_count} ${o.paper_count===1?"paper":"papers"}${v?`. ${v}`:""}`,onMouseEnter:()=>d(i),onMouseLeave:()=>d(null),onFocus:()=>d(i),onBlur:()=>d(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:p.left+l*i,y:p.top,width:l,height:h}),e.jsx("rect",{className:"method-usage-bar-mark",x:P,y:b,width:S,height:y,rx:"1.5"})]},o.start_date)}),t.map((o,i)=>D.has(i)?e.jsx("text",{className:"method-usage-x-label",x:p.left+l*(i+.5),y:I-11,textAnchor:"middle",children:t.length>48?fe.format(new Date(`${o.start_date}T00:00:00Z`)):T(o.start_date)},o.start_date):null)]}),j&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:T(j.start_date)}),e.jsxs("span",{children:[j.paper_count," ",j.paper_count===1?"paper":"papers",c===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(j.catalog_share??0).toFixed(2),"% of"," ",(j.catalog_paper_count??0).toLocaleString()," catalog papers"]}),x&&e.jsx("span",{children:x})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Ze=()=>{var B,E,$;const{methodSlug:t}=Q(),[r,c]=O(),[d,g]=A.useState("trending"),u=r.get("has_code")==="true",h=r.get("has_hf_artifacts")==="true",l=J(r),S=n=>{const m=new URLSearchParams(r);n?m.set("has_code","true"):m.delete("has_code"),c(m)},D=n=>{const m=new URLSearchParams(r);n?m.set("has_hf_artifacts","true"):m.delete("has_hf_artifacts"),c(m)},_=w({queryKey:["method",t],queryFn:()=>F.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),j=w({queryKey:["areas-all"],queryFn:()=>F.listAreas({page_size:50,ordering:"name"}),enabled:!!((B=_.data)!=null&&B.area_id),staleTime:10*60*1e3}),x=w({queryKey:["method-trend",t],queryFn:()=>F.methodTrend(t),enabled:!!t,staleTime:10*60*1e3}),o=d==="trending"?"trending":d==="cited"?"citation_count":"date_published",i=Z({queryKey:[...W.feeds.method,t,o,u,h,l.startDate,l.endDate],queryFn:({pageParam:n=1})=>ae.forMethod(t,{page:n,page_size:20,order_by:o,order_dir:"desc",include_resources:!0,repository_limit:1,has_code:u,has_hf_artifacts:h,start_date:l.startDate,end_date:l.endDate}),getNextPageParam:n=>n.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:U}),k=w({queryKey:["related-methods",t],queryFn:()=>F.relatedMethods(t),enabled:!!t,staleTime:10*60*1e3}),y=A.useMemo(()=>{var m;return(((m=i.data)==null?void 0:m.pages.flatMap(K=>K.results))||[]).map(ne)},[i.data]),{targetRef:P,isIntersecting:b}=ie({rootMargin:"200px"});if(A.useEffect(()=>{b&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[b,i.hasNextPage,i.isFetchingNextPage]),_.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(_.error||!_.data)return e.jsx("div",{className:"page",children:e.jsx(le,{variant:"destructive",children:e.jsx(oe,{children:"Method not found."})})});const a=_.data,N=(E=j.data)==null?void 0:E.results.find(n=>n.id===a.area_id),v=se(a.source_url),z=v?null:ce(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(L,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(L,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),e.jsx(G,{kind:"method",entityId:a.id}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(R,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),v?e.jsxs(L,{className:"method-source-link",to:v,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):z?e.jsxs("a",{className:"method-source-link",href:z,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(x.data.recent_paper_count*30/x.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!x.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(_e,{history:x.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(xe,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(R,{className:"method-image-credit",text:a.image_credit})})]})]}),((($=k.data)==null?void 0:$.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),k.data.results.map(n=>e.jsx(V,{method:{slug:n.slug,name:n.name}},n.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([n,m])=>e.jsx("button",{className:`sort-btn ${d===n?"active":""}`,onClick:()=>g(n),children:m},n))}),e.jsx(Y,{hasCode:u,hasHfArtifacts:h,onHasCodeChange:S,onHasHfArtifactsChange:D})]}),e.jsx(ee,{startDate:l.startDate,endDate:l.endDate,onChange:n=>c(te(r,n))}),e.jsxs("div",{className:"results-count",children:[y.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((n,m)=>e.jsx(M,{className:"h-40 w-full"},m))}):y.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:y.map((n,m)=>e.jsx(X,{paper:n,rank:m+1},n.id))}),e.jsx("div",{ref:P,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Ze as default};
|
|
|
|
| 1 |
+
import{j as e,r as A,u as Q,d as O,L,af as U}from"./index-DAAEdKQ4.js";import{R as G}from"./ResearchFollowButton-DNrVdY8G.js";import{p as W}from"./paperQueryKeys-BP2E-0yf.js";import{u as w}from"./useQuery-BALok3Po.js";import{u as Z}from"./useInfiniteQuery-BJadVmaJ.js";import{M as V,P as X}from"./components-BWWnJ95m.js";import{P as Y}from"./PaperFeedFilters-Hyqa1G4B.js";import{a as J,P as ee,b as te}from"./PaperDateFilter-Cmzg62xO.js";import{r as se,M as R}from"./MarkdownText-CcUZ0t2p.js";import{c as F}from"./catalog-Cjgxq75q.js";import{p as ae}from"./papers-DL8dzFlM.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./colors-DR110Nc2.js";import{u as ie}from"./useIntersectionObserver-DFkuIFUb.js";import{S as M}from"./skeleton-Te-nsRWB.js";import{A as le,a as oe}from"./alert-B_MWtfva.js";import{s as ce}from"./safeExternalHref-CkBrsh84.js";import"./useMutation-D4cqMKzD.js";import"./research--raTfZxI.js";import"./plus-B07MagLg.js";import"./LatexTitle-lQiG5mCP.js";import"./popover-CNAIo5eI.js";/* empty css */import"./PaperPreviewLink-n9bIC1vy.js";import"./index-D6KYmf_u.js";import"./index-UMJO-v2N.js";import"./katex-DkKDou_j.js";import"./hover-card-DUYUZUhh.js";const s={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},f=({x:t,y:r,w:c,h:d,fill:g,stroke:u,label:h,fontSize:l=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:r,width:c,height:d,rx:"3",ry:"3",fill:g,stroke:u,strokeWidth:"1"}),e.jsx("text",{x:t+c/2,y:r+d/2,fontSize:l,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:h})]}),de=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(f,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(f,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(f,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(f,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(f,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(f,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(f,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(f,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),me=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),me.map(([t,r],c)=>{const d=92+c*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:d,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),r?e.jsx("text",{x:"138",y:d,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:r}):null]},t)})]}),pe={attention:de,"agent-skills":he},ue=({method:t})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(f,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(f,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(f,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),xe=({method:t})=>{const r=(t.slug||"").toLowerCase(),c=pe[r];if(c)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(c,{})});if(t.image_url){const d=r==="transformer"||r==="gpt-4"||r==="gpt-4o"||r==="multi-head-attention"?" method-figure-svg--compact":r==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${d}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(ue,{method:t})})},C=720,I=138,p={top:8,right:10,bottom:25,left:36},H=56,ge=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),fe=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),T=t=>ge.format(new Date(`${t}T00:00:00Z`)),je=(t,r)=>{if(t===0)return new Set;const c=t>48?12:t>36?6:t>18?3:2,d=Math.max(1,Math.ceil(H/r)),g=Math.max(c,d),u=t-1,h=new Set([0,u]);for(let l=g;l<u;l+=g)(u-l)*r>=H&&h.add(l);return h},q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const r=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${r}`},_e=({history:t,methodName:r})=>{const[c,d]=A.useState(null),g=Math.max(1,...t.map(o=>o.paper_count)),u=C-p.left-p.right,h=I-p.top-p.bottom,l=t.length?u/t.length:u,S=Math.max(2,l*.68),D=je(t.length,l),_=Array.from(new Set([0,Math.ceil(g/2),g])),j=c==null?null:t[c],x=j?q(j):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${C} ${I}`,role:"group","aria-label":`${r}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[r,": papers mentioning this method by publication month"]}),_.map(o=>{const i=p.top+h-o/g*h;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:p.left,x2:C-p.right,y1:i,y2:i}),e.jsx("text",{className:"method-usage-y-label",x:p.left-8,y:i+3,textAnchor:"end",children:o})]},o)}),t.map((o,i)=>{const k=o.paper_count/g*h,y=o.paper_count>0?Math.max(1,k):0,P=p.left+l*i+(l-S)/2,b=p.top+h-y,a=c===i,N=i===t.length-1,v=q(o);return e.jsxs("g",{className:`method-usage-bar${a?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${T(o.start_date)}: ${o.paper_count} ${o.paper_count===1?"paper":"papers"}${v?`. ${v}`:""}`,onMouseEnter:()=>d(i),onMouseLeave:()=>d(null),onFocus:()=>d(i),onBlur:()=>d(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:p.left+l*i,y:p.top,width:l,height:h}),e.jsx("rect",{className:"method-usage-bar-mark",x:P,y:b,width:S,height:y,rx:"1.5"})]},o.start_date)}),t.map((o,i)=>D.has(i)?e.jsx("text",{className:"method-usage-x-label",x:p.left+l*(i+.5),y:I-11,textAnchor:"middle",children:t.length>48?fe.format(new Date(`${o.start_date}T00:00:00Z`)):T(o.start_date)},o.start_date):null)]}),j&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:T(j.start_date)}),e.jsxs("span",{children:[j.paper_count," ",j.paper_count===1?"paper":"papers",c===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(j.catalog_share??0).toFixed(2),"% of"," ",(j.catalog_paper_count??0).toLocaleString()," catalog papers"]}),x&&e.jsx("span",{children:x})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Ze=()=>{var B,E,$;const{methodSlug:t}=Q(),[r,c]=O(),[d,g]=A.useState("trending"),u=r.get("has_code")==="true",h=r.get("has_hf_artifacts")==="true",l=J(r),S=n=>{const m=new URLSearchParams(r);n?m.set("has_code","true"):m.delete("has_code"),c(m)},D=n=>{const m=new URLSearchParams(r);n?m.set("has_hf_artifacts","true"):m.delete("has_hf_artifacts"),c(m)},_=w({queryKey:["method",t],queryFn:()=>F.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),j=w({queryKey:["areas-all"],queryFn:()=>F.listAreas({page_size:50,ordering:"name"}),enabled:!!((B=_.data)!=null&&B.area_id),staleTime:10*60*1e3}),x=w({queryKey:["method-trend",t],queryFn:()=>F.methodTrend(t),enabled:!!t,staleTime:10*60*1e3}),o=d==="trending"?"trending":d==="cited"?"citation_count":"date_published",i=Z({queryKey:[...W.feeds.method,t,o,u,h,l.startDate,l.endDate],queryFn:({pageParam:n=1})=>ae.forMethod(t,{page:n,page_size:20,order_by:o,order_dir:"desc",include_resources:!0,repository_limit:1,has_code:u,has_hf_artifacts:h,start_date:l.startDate,end_date:l.endDate}),getNextPageParam:n=>n.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:U}),k=w({queryKey:["related-methods",t],queryFn:()=>F.relatedMethods(t),enabled:!!t,staleTime:10*60*1e3}),y=A.useMemo(()=>{var m;return(((m=i.data)==null?void 0:m.pages.flatMap(K=>K.results))||[]).map(ne)},[i.data]),{targetRef:P,isIntersecting:b}=ie({rootMargin:"200px"});if(A.useEffect(()=>{b&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[b,i.hasNextPage,i.isFetchingNextPage]),_.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(_.error||!_.data)return e.jsx("div",{className:"page",children:e.jsx(le,{variant:"destructive",children:e.jsx(oe,{children:"Method not found."})})});const a=_.data,N=(E=j.data)==null?void 0:E.results.find(n=>n.id===a.area_id),v=se(a.source_url),z=v?null:ce(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(L,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(L,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),e.jsx(G,{kind:"method",entityId:a.id}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(R,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),v?e.jsxs(L,{className:"method-source-link",to:v,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):z?e.jsxs("a",{className:"method-source-link",href:z,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(x.data.recent_paper_count*30/x.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!x.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(_e,{history:x.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(xe,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(R,{className:"method-image-credit",text:a.image_credit})})]})]}),((($=k.data)==null?void 0:$.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),k.data.results.map(n=>e.jsx(V,{method:{slug:n.slug,name:n.name}},n.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([n,m])=>e.jsx("button",{className:`sort-btn ${d===n?"active":""}`,onClick:()=>g(n),children:m},n))}),e.jsx(Y,{hasCode:u,hasHfArtifacts:h,onHasCodeChange:S,onHasHfArtifactsChange:D})]}),e.jsx(ee,{startDate:l.startDate,endDate:l.endDate,onChange:n=>c(te(r,n))}),e.jsxs("div",{className:"results-count",children:[y.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((n,m)=>e.jsx(M,{className:"h-40 w-full"},m))}):y.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:y.map((n,m)=>e.jsx(X,{paper:n,rank:m+1},n.id))}),e.jsx("div",{ref:P,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Ze as default};
|
assets/{MethodsIndexView-JaIiaJw-.js → MethodsIndexView-DvgVygE2.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{g as _,r as d,j as e,L as v}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{g as _,r as d,j as e,L as v}from"./index-DAAEdKQ4.js";import{u as c}from"./useQuery-BALok3Po.js";import{c as m}from"./catalog-Cjgxq75q.js";import{s as N}from"./slug-BpH-Nkvz.js";import{S as x}from"./skeleton-Te-nsRWB.js";import{A as w,a as F}from"./alert-B_MWtfva.js";import{T as L}from"./TaxonomySuggestionTile-B2PAuCb8.js";import{T}from"./TaxonomyTrending-Dg3rGtk4.js";import"./SignInToEditDialog-fQUm9O4B.js";import"./button-B4rpf4U2.js";import"./input-BJzP2p9f.js";import"./textarea-BuiR0cO8.js";import"./searchable-select-CaHh11q_.js";import"./popover-CNAIo5eI.js";import"./dialog-ByQvEQks.js";import"./loader-circle-ZBvI0vdX.js";import"./useMutation-D4cqMKzD.js";import"./submissions-BhpBrY_1.js";import"./plus-B07MagLg.js";import"./trending-up-CPIUIOMA.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{NotFound-DlcBmZx6.js → NotFound-DWo2Md94.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{ar as o,r as a,j as t,L as s}from"./index-
|
|
|
|
| 1 |
+
import{ar as o,r as a,j as t,L as s}from"./index-DAAEdKQ4.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
|
assets/{OrganizationContributionGraph-BD954ze8.js → OrganizationContributionGraph-TfRSAQDx.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as b,j as o}from"./index-
|
|
|
|
| 1 |
+
import{r as b,j as o}from"./index-DAAEdKQ4.js";import{u as z}from"./useQuery-BALok3Po.js";import{S as T}from"./skeleton-Te-nsRWB.js";import{c as w}from"./catalog-Cjgxq75q.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;e<t;e+=1){const d=l.slice(e*7,e*7+7).find(g=>g.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O};
|
assets/OrganizationDetailView-D2tt6Owa.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as t,j as r}from"./index-DuJU_D27.js";import{O as i}from"./OrganizationPaperFeed-Cc9qvVb4.js";import m from"./NotFound-DlcBmZx6.js";import"./ResearchFollowButton-BrbOAi4p.js";import"./useQuery-BvOlbTZD.js";import"./useMutation-BAvuTKgd.js";import"./research-BSQ4hKxD.js";import"./plus-CQhIPr4p.js";import"./components-Dw3DdUAs.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DzYgREOe.js";import"./colors-CYTXFGTF.js";import"./papers-Zi3ALD1n.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-CMN2meZd.js";/* empty css */import"./PaperPreviewLink-Bvcg4CvY.js";import"./index-BOvg3c6G.js";import"./index-DwysRPUB.js";import"./katex-DkKDou_j.js";import"./hover-card-DfwM1bh1.js";import"./OrganizationContributionGraph-BD954ze8.js";import"./skeleton-C2Fuuvyv.js";import"./catalog-BDn3ESav.js";import"./PaperFeedFilters-Nd8CC_7I.js";import"./PaperDateFilter-BqtxoA2-.js";import"./popover-Bu3nlXtK.js";import"./alert-BEj8j9Sy.js";import"./searchable-select-CqBDX3aD.js";import"./button-gR6DviOK.js";import"./dialog-C4efhYvk.js";import"./loader-circle-BNnwwGUv.js";import"./useIntersectionObserver-BoMEP06G.js";import"./usePapers-DSYVjBgu.js";import"./useInfiniteQuery-D38nK1Xd.js";const I=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{I as default};
|
|
|
|
|
|
assets/OrganizationDetailView-DNHy-Auy.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as t,j as r}from"./index-DAAEdKQ4.js";import{O as i}from"./OrganizationPaperFeed-DV7HIdfT.js";import m from"./NotFound-DWo2Md94.js";import"./ResearchFollowButton-DNrVdY8G.js";import"./useQuery-BALok3Po.js";import"./useMutation-D4cqMKzD.js";import"./research--raTfZxI.js";import"./plus-B07MagLg.js";import"./components-BWWnJ95m.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-lQiG5mCP.js";import"./colors-DR110Nc2.js";import"./papers-DL8dzFlM.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-CcUZ0t2p.js";/* empty css */import"./PaperPreviewLink-n9bIC1vy.js";import"./index-D6KYmf_u.js";import"./index-UMJO-v2N.js";import"./katex-DkKDou_j.js";import"./hover-card-DUYUZUhh.js";import"./OrganizationContributionGraph-TfRSAQDx.js";import"./skeleton-Te-nsRWB.js";import"./catalog-Cjgxq75q.js";import"./PaperFeedFilters-Hyqa1G4B.js";import"./PaperDateFilter-Cmzg62xO.js";import"./popover-CNAIo5eI.js";import"./alert-B_MWtfva.js";import"./searchable-select-CaHh11q_.js";import"./button-B4rpf4U2.js";import"./dialog-ByQvEQks.js";import"./loader-circle-ZBvI0vdX.js";import"./useIntersectionObserver-DFkuIFUb.js";import"./usePapers-BoM3UV5_.js";import"./useInfiniteQuery-BJadVmaJ.js";const I=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{I as default};
|
assets/{OrganizationPaperFeed-Cc9qvVb4.js → OrganizationPaperFeed-DV7HIdfT.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{b as E,d as B,r as d,j as e,L as A}from"./index-
|
|
|
|
| 1 |
+
import{b as E,d as B,r as d,j as e,L as A}from"./index-DAAEdKQ4.js";import{R as Q}from"./ResearchFollowButton-DNrVdY8G.js";import{u as C}from"./useQuery-BALok3Po.js";import{P as U}from"./components-BWWnJ95m.js";import{M as G}from"./MarkdownText-CcUZ0t2p.js";import{O as K}from"./OrganizationContributionGraph-TfRSAQDx.js";import{P as W}from"./PaperFeedFilters-Hyqa1G4B.js";import{a as Z,P as J,b as V}from"./PaperDateFilter-Cmzg62xO.js";import{A as X,a as Y}from"./alert-B_MWtfva.js";import{S as z}from"./searchable-select-CaHh11q_.js";import{S as $}from"./skeleton-Te-nsRWB.js";import{u as ee}from"./useIntersectionObserver-DFkuIFUb.js";import{e as se}from"./usePapers-BoM3UV5_.js";import{c as R}from"./catalog-Cjgxq75q.js";import{d as D,t as ae}from"./colors-DR110Nc2.js";import re from"./NotFound-DWo2Md94.js";const te=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=n=>n==="date_published"||n==="citation_count"?n:"trending",ye=({organizationSlug:n,taskSlug:p})=>{var y,P,v,F,L,k,w,O;const T=E(),[o,h]=B(),[I,u]=d.useState(!1),g=ne(o.get("order_by")),f=o.get("has_code")==="true",_=o.get("has_hf_artifacts")==="true",m=Z(o),x=C({queryKey:["organization",n],queryFn:()=>R.getOrganization(n),staleTime:10*60*1e3}),c=C({queryKey:["organization-areas-with-tasks",n],queryFn:()=>R.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=se({organizationSlug:n,taskSlug:p,page_size:12,order_by:g,order_dir:"desc",include_resources:!0,has_code:f,has_hf_artifacts:_,start_date:m.startDate,end_date:m.endDate,enabled:!!n}),{targetRef:M,isIntersecting:j}=ee({rootMargin:"200px"});d.useEffect(()=>{j&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[j,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{u(!1)},[n,p]);const b=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:D(t.name,t.slug)})))},[c.data]),l=b.find(a=>a.slug===p),N=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(ae))},[i.data]),s=x.data??((y=c.data)==null?void 0:y.organization),H=((v=(P=i.data)==null?void 0:P.pages[0])==null?void 0:v.count)??0;if(((F=x.error)==null?void 0:F.status)===404||((L=c.error)==null?void 0:L.status)===404||((k=i.error)==null?void 0:k.status)===404)return e.jsx(re,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(X,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load organization papers. Please try again."})})});const q=a=>{const r=a.trim().toLocaleLowerCase();return b.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},S=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=o.toString();T({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(A,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:D(l.name,l.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[s!=null&&s.logo_url&&!I?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>u(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx($,{className:"h-12 w-64"})]}),s&&e.jsx(Q,{kind:"organization",entityId:s.id}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((w=s.paper_count)==null?void 0:w.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(G,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),e.jsx(K,{organizationSlug:n,organizationName:(s==null?void 0:s.name)??n})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:S,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:l?{value:l.slug,label:l.label,description:`${l.paper_count.toLocaleString()} ${l.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...q(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:te.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${g===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(o);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:f,hasHfArtifacts:_,onHasCodeChange:a=>{const r=new URLSearchParams(o);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(o);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsx(J,{startDate:m.startDate,endDate:m.endDate,onChange:a=>h(V(o,a))}),e.jsxs("div",{className:"results-count",children:[H.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx($,{className:"h-40 w-full"},r))}):N.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:M,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ye as O};
|
assets/OrganizationTaskView-BlT0b_Wi.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as i,j as t}from"./index-DAAEdKQ4.js";import{O as m}from"./OrganizationPaperFeed-DV7HIdfT.js";import p from"./NotFound-DWo2Md94.js";import"./ResearchFollowButton-DNrVdY8G.js";import"./useQuery-BALok3Po.js";import"./useMutation-D4cqMKzD.js";import"./research--raTfZxI.js";import"./plus-B07MagLg.js";import"./components-BWWnJ95m.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-lQiG5mCP.js";import"./colors-DR110Nc2.js";import"./papers-DL8dzFlM.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-CcUZ0t2p.js";/* empty css */import"./PaperPreviewLink-n9bIC1vy.js";import"./index-D6KYmf_u.js";import"./index-UMJO-v2N.js";import"./katex-DkKDou_j.js";import"./hover-card-DUYUZUhh.js";import"./OrganizationContributionGraph-TfRSAQDx.js";import"./skeleton-Te-nsRWB.js";import"./catalog-Cjgxq75q.js";import"./PaperFeedFilters-Hyqa1G4B.js";import"./PaperDateFilter-Cmzg62xO.js";import"./popover-CNAIo5eI.js";import"./alert-B_MWtfva.js";import"./searchable-select-CaHh11q_.js";import"./button-B4rpf4U2.js";import"./dialog-ByQvEQks.js";import"./loader-circle-ZBvI0vdX.js";import"./useIntersectionObserver-DFkuIFUb.js";import"./usePapers-BoM3UV5_.js";import"./useInfiniteQuery-BJadVmaJ.js";const I=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{I as default};
|
assets/OrganizationTaskView-D7QVBwXF.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as i,j as t}from"./index-DuJU_D27.js";import{O as m}from"./OrganizationPaperFeed-Cc9qvVb4.js";import p from"./NotFound-DlcBmZx6.js";import"./ResearchFollowButton-BrbOAi4p.js";import"./useQuery-BvOlbTZD.js";import"./useMutation-BAvuTKgd.js";import"./research-BSQ4hKxD.js";import"./plus-CQhIPr4p.js";import"./components-Dw3DdUAs.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DzYgREOe.js";import"./colors-CYTXFGTF.js";import"./papers-Zi3ALD1n.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-CMN2meZd.js";/* empty css */import"./PaperPreviewLink-Bvcg4CvY.js";import"./index-BOvg3c6G.js";import"./index-DwysRPUB.js";import"./katex-DkKDou_j.js";import"./hover-card-DfwM1bh1.js";import"./OrganizationContributionGraph-BD954ze8.js";import"./skeleton-C2Fuuvyv.js";import"./catalog-BDn3ESav.js";import"./PaperFeedFilters-Nd8CC_7I.js";import"./PaperDateFilter-BqtxoA2-.js";import"./popover-Bu3nlXtK.js";import"./alert-BEj8j9Sy.js";import"./searchable-select-CqBDX3aD.js";import"./button-gR6DviOK.js";import"./dialog-C4efhYvk.js";import"./loader-circle-BNnwwGUv.js";import"./useIntersectionObserver-BoMEP06G.js";import"./usePapers-DSYVjBgu.js";import"./useInfiniteQuery-D38nK1Xd.js";const I=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{I as default};
|
|
|
|
|
|
assets/{OrganizationsIndexView-DimJabLj.js → OrganizationsIndexView-CNaFMOZi.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as u,r as g,j as e,L as x}from"./index-
|
|
|
|
| 1 |
+
import{d as u,r as g,j as e,L as x}from"./index-DAAEdKQ4.js";import{u as j}from"./useQuery-BALok3Po.js";import{A as y,a as f}from"./alert-B_MWtfva.js";import{S as _}from"./skeleton-Te-nsRWB.js";import{c as N}from"./catalog-Cjgxq75q.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizationIndex(),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{A as default};
|
assets/{PaperDateFilter-BqtxoA2-.js → PaperDateFilter-Cmzg62xO.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as p,j as n}from"./index-
|
|
|
|
| 1 |
+
import{r as p,j as n}from"./index-DAAEdKQ4.js";import{P as q,a as G,b as Q}from"./popover-CNAIo5eI.js";const E=(e,t)=>{const a=new Date(t),s=new Date(a);return s.setUTCDate(a.getUTCDate()-(e==="week"?6:29)),{startDate:s.toISOString().slice(0,10),endDate:a.toISOString().slice(0,10)}},z=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),oe=(e,t=new Date,a="week")=>{const s=z(e);if(s.startDate||s.endDate||e.get("time")==="all_time")return s;const c=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));return E(a,c)},J=(e,t)=>{const a=new URLSearchParams(e);return t.startDate?a.set("start_date",t.startDate):a.delete("start_date"),t.endDate?a.set("end_date",t.endDate):a.delete("end_date"),a.delete("time"),a},ie=(e,t)=>{const a=J(e,t);return!t.startDate&&!t.endDate&&a.set("time","all_time"),a},K=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),O=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),L="(max-width: 640px)",X=()=>{const[e,t]=p.useState(()=>typeof window<"u"&&window.matchMedia(L).matches);return p.useEffect(()=>{const a=window.matchMedia(L),s=c=>t(c.matches);return t(a.matches),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e},V=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ee=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},R=(e,t)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),M=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),te=(e,t)=>new Date(Date.UTC(t,e.getUTCMonth(),1)),w=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate,ae=(e,t)=>{const a=b(e),s=b(t),c=O.format(a),l=O.format(s),g=a.getUTCDate(),d=s.getUTCDate(),o=a.getUTCFullYear(),u=s.getUTCFullYear();return e===t?`${c} ${g}, ${o}`:o===u&&a.getUTCMonth()===s.getUTCMonth()?`${c} ${g}–${d}, ${o}`:o===u?`${c} ${g}–${l} ${d}, ${o}`:`${c} ${g}, ${o}–${l} ${d}, ${u}`},ne=e=>{const t=e.getUTCFullYear(),a=e.getUTCMonth(),s=new Date(Date.UTC(t,a,1)),c=(s.getUTCDay()+6)%7,l=new Date(s);return l.setUTCDate(s.getUTCDate()-c),Array.from({length:42},(g,d)=>{const o=new Date(l);return o.setUTCDate(l.getUTCDate()+d),{iso:V(o),day:o.getUTCDate(),outsideMonth:o.getUTCMonth()!==a}})},A=({month:e,today:t,startDate:a,endDate:s,onSelect:c,yearLabel:l,yearValue:g,onYearChange:d,secondary:o=!1})=>{const u=p.useMemo(()=>ne(e),[e]);return n.jsxs("section",{className:`paper-date-calendar${o?" paper-date-calendar-secondary":""}`,children:[n.jsxs("label",{className:"paper-date-year",children:[n.jsx("span",{children:l}),n.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:t.slice(0,4),step:"1",value:g,onChange:r=>d(r.target.value)})]}),n.jsx("h3",{children:K.format(e)}),n.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(r=>n.jsx("span",{children:r},r))}),n.jsx("div",{className:"paper-date-days",children:u.map(r=>{const h=r.iso===a||r.iso===s,T=!!(a&&s&&r.iso>a&&r.iso<s),m=r.outsideMonth||r.iso>t;return n.jsx("button",{type:"button","aria-label":r.iso,"aria-selected":h,disabled:m,className:["paper-date-day",r.outsideMonth?"outside":"",h?"selected":"",T?"in-range":"",r.iso===t?"today":""].filter(Boolean).join(" "),onClick:()=>c(r.iso),children:r.day},r.iso)})})]})},I=({calendar:e,onPrevious:t,onNext:a,secondary:s=!1})=>n.jsxs("div",{className:`paper-date-navigation-group${s?" paper-date-navigation-group-secondary":""}`,children:[n.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:t,children:"←"}),n.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:a,children:"→"})]}),ce=({startDate:e,endDate:t,onChange:a,currentDate:s})=>{const c=X(),l=s?b(s):ee(),[g,d]=p.useState(!1),[o,u]=p.useState(),[r,h]=p.useState(),[T,m]=p.useState(()=>M(l)),[$,D]=p.useState(()=>R(M(l),1)),[H,y]=p.useState(()=>String(l.getUTCFullYear())),[B,U]=p.useState(()=>String(l.getUTCFullYear())),f={startDate:e,endDate:t},N=E("week",l),Y=E("month",l),P=V(l),v=!!(e&&t&&!w(f,N)&&!w(f,Y)),Z=()=>{u(e),h(t);const i=M(e?b(e):l),C=M(t?b(t):R(i,1));m(i),D(C),y(String(i.getUTCFullYear())),U(String(C.getUTCFullYear())),d(!0)},k=(i,C,F)=>{if(C(i),!/^\d{4}$/.test(i))return;const x=Number(i);x>=1900&&x<=l.getUTCFullYear()&&F(j=>te(j,x))},S=(i,C,F,x)=>{const j=R(i,C);F(j),x(String(j.getUTCFullYear()))},_=i=>{!o||r?(u(i),h(void 0)):i<o?u(i):h(i)},W=()=>{a({}),d(!1)};return n.jsxs("div",{className:`paper-date-filter${c?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,N)?" active":""}`,onClick:()=>a(N),children:"Last Week"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,Y)?" active":""}`,onClick:()=>a(Y),children:"Last Month"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!t?" active":""}`,onClick:()=>a({}),children:"All Time"}),n.jsxs(q,{open:g,onOpenChange:i=>{i?Z():d(!1)},children:[n.jsx(G,{asChild:!0,children:n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v?" active":""}`,"aria-label":v?"Change date range":"Select a range",children:v&&e&&t?ae(e,t):"Select a range"})}),n.jsxs(Q,{align:"end",className:`paper-date-popover${c?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[n.jsxs("div",{className:"paper-date-popover-header",children:[n.jsx("h2",{children:"Select a date range"}),n.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),n.jsxs("div",{className:"paper-date-navigation",children:[n.jsx(I,{calendar:"start",onPrevious:()=>S(T,-1,m,y),onNext:()=>S(T,1,m,y)}),!c&&n.jsx(I,{calendar:"end",onPrevious:()=>S($,-1,D,U),onNext:()=>S($,1,D,U),secondary:!0})]}),n.jsxs("div",{className:"paper-date-calendars",children:[n.jsx(A,{month:T,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:c?"Year":"Start year",yearValue:H,onYearChange:i=>k(i,y,m)}),!c&&n.jsx(A,{month:$,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:"End year",yearValue:B,onYearChange:i=>k(i,U,D),secondary:!0})]}),n.jsxs("div",{className:"paper-date-actions",children:[n.jsx("button",{type:"button",className:"paper-date-clear",onClick:W,children:"Clear range"}),n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:()=>d(!1),children:"Cancel"}),n.jsx("button",{type:"button",className:"paper-date-apply",disabled:!o||!r,onClick:()=>{o&&r&&a({startDate:o,endDate:r}),d(!1)},children:"Apply"})]})]})]})]})]})};export{ce as P,z as a,J as b,oe as r,ie as w};
|
assets/{PaperDetailView-D2LYbCQe.js → PaperDetailView-BaSC3pB1.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{PaperFeedFilters-Nd8CC_7I.js → PaperFeedFilters-Hyqa1G4B.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e}from"./index-
|
|
|
|
| 1 |
+
import{j as e}from"./index-DAAEdKQ4.js";import{I as n}from"./components-BWWnJ95m.js";const t=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),h=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0,showHasCode:i=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[i&&e.jsx(l,{checked:s,icon:e.jsx(n,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(t,{}),label:"Has artifacts",onChange:o})]})]});export{h as P};
|
assets/{PaperPreviewLink-Bvcg4CvY.js → PaperPreviewLink-n9bIC1vy.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{o as k,f as F,m as b,a as oe,p as L,b as O,n as z,h as le,s as ce,c as ue,v as he,S as pe}from"./index-
|
| 2 |
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(s,o,l,a){const c=s.value||"",h=l.createTracker(a),f="$".repeat(Math.max(me(c,"$")+1,2)),g=l.enter("mathFlow");let x=h.move(f);if(s.meta){const d=l.enter("mathFlowMeta");x+=h.move(l.safe(s.meta,{after:`
|
| 3 |
`,before:x,encode:["$"],...h.current()})),d()}return x+=h.move(`
|
| 4 |
`),c&&(x+=h.move(c+`
|
|
|
|
| 1 |
+
import{o as k,f as F,m as b,a as oe,p as L,b as O,n as z,h as le,s as ce,c as ue,v as he,S as pe}from"./index-D6KYmf_u.js";import{l as me}from"./index-UMJO-v2N.js";import D from"./katex-DkKDou_j.js";import{j as m,F as M,V as fe,n as j,c as de,m as ge,L as E,A as xe}from"./index-DAAEdKQ4.js";import{u as ye}from"./useQuery-BALok3Po.js";import{H as we,a as be,b as Ne}from"./hover-card-DUYUZUhh.js";import{p as ve}from"./paperQueryKeys-BP2E-0yf.js";import{p as P}from"./papers-DL8dzFlM.js";import{u as ke}from"./useMutation-D4cqMKzD.js";function Fe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:s},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:r,mathFlowValue:l,mathText:o,mathTextData:l}};function e(a){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},a)}function t(){this.buffer()}function r(){const a=this.resume(),c=this.stack[this.stack.length-1];k(c.type==="math"),c.meta=a}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];k(h.type==="math"),this.exit(a),h.value=c;const f=h.data.hChildren[0];k(f.type==="element"),k(f.tagName==="code"),f.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function o(a){const c=this.resume(),h=this.stack[this.stack.length-1];k(h.type==="inlineMath"),this.exit(a),h.value=c,h.data.hChildren.push({type:"text",value:c})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function je(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
| 2 |
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(s,o,l,a){const c=s.value||"",h=l.createTracker(a),f="$".repeat(Math.max(me(c,"$")+1,2)),g=l.enter("mathFlow");let x=h.move(f);if(s.meta){const d=l.enter("mathFlowMeta");x+=h.move(l.safe(s.meta,{after:`
|
| 3 |
`,before:x,encode:["$"],...h.current()})),d()}return x+=h.move(`
|
| 4 |
`),c&&(x+=h.move(c+`
|
assets/PaperReaderView-C9xJBDgB.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as s,j as a,A as X,u as me,b as Ee,n as Te,V as he,N as We,L as D}from"./index-DAAEdKQ4.js";import{u as ge}from"./useQuery-BALok3Po.js";import{u as ze,R as Me,A as Le,c as Fe,a as He,P as Ke}from"./ArtifactWorkspace-CFTBDPD0.js";import{M as Ue}from"./MarkdownText-CcUZ0t2p.js";import{g as qe}from"./papers-DL8dzFlM.js";import{w as Be,e as De}from"./paperReader-BIpQD5HO.js";import{b as Oe}from"./usePapers-BoM3UV5_.js";import{c as Ve}from"./chat-BFojJrU9.js";import{s as Q}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as Xe}from"./ChatView-Duxpqsix.js";import"./chatLaunch-D9EyZxQg.js";import"./chevron-down-D8dAesMf.js";import"./earth-C2xqFcX3.js";/* empty css */import"./hover-card-DUYUZUhh.js";import"./github-Dhzztpor.js";import"./github-BDSbRkJU.js";import"./catalog-Cjgxq75q.js";import"./PaperPreviewLink-n9bIC1vy.js";import"./index-D6KYmf_u.js";import"./index-UMJO-v2N.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./useMutation-D4cqMKzD.js";import"./copy-D_GFD6J1.js";import"./thumbs-up-DRuoA93Q.js";import"./file-text-CflXb8l5.js";import"./external-link-n_se8QIW.js";import"./useInfiniteQuery-BJadVmaJ.js";import"./share-2-BCaHt_Yb.js";import"./chatPrompts-DypmWIqx.js";import"./openrouter-DpGnZ_gU.js";import"./queryOptions-C9woPjwX.js";function Qe(r){return r instanceof X&&r.status===422?"This page could not be turned into a readable paper.":r instanceof X&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function Ye({paperId:r,paperKey:i,paperTitle:n,paperHref:b,sourceUrl:c,resources:t,paperVersion:u="",selectionEnabled:v=!1,onReady:g,onPaperSelection:k,onPaperSelectionError:l}){const N=s.useRef(null),p=ge({queryKey:["paperWebMarkdown",r],queryFn:()=>qe(r),staleTime:5*6e4,retry:(y,d)=>y<2&&!(d instanceof X&&d.status<500),retryDelay:3e3}),P=p.isSuccess;s.useEffect(()=>{P&&(g==null||g())},[g,P]),ze({enabled:v&&!!u&&P,pagesRoot:N,routeId:i,paperVersion:u,numPages:1,onSelect:k,onError:l});const w=p.data?Be(p.data):"";return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Me,{paperTitle:n,paperHref:b,resources:t,label:"Paper controls",children:a.jsx("div",{className:"pdf-toolbar-controls",children:a.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:"Open original"})})}),a.jsx("div",{className:"pdf-scroll-frame",children:a.jsx("div",{className:"pdf-scroll",role:"region","aria-label":"Paper web page",children:p.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):p.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:Qe(p.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void p.refetch(),children:"Retry"})," ",a.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:N,className:"reader-web-document","data-page":"1",children:[!w.startsWith("# ")&&a.jsx("h1",{children:n}),a.jsx(Ue,{text:w})]})})})]})}const be=66,Ze=240,Y="pwc:reader:split-ratio",z=r=>`pwc:reader:session:${r}`,O=r=>`pwc:reader:assistant-collapsed:${r}`,ve=r=>`pwc:reader:page:${r}`;function V(r){const i=Number(sessionStorage.getItem(ve(r)));return Number.isInteger(i)&&i>0?i:1}function Ge(){const r=Number(localStorage.getItem(Y));return Number.isFinite(r)&&r>=45&&r<=75?r:be}function Je(r){const i=Q(r);if(!i)return null;const n=new URL(i);return(n.hostname==="arxiv.org"||n.hostname==="www.arxiv.org")&&n.pathname.startsWith("/pdf/")&&n.pathname.endsWith(".pdf")&&(n.pathname=n.pathname.slice(0,-4)),n.href}const et=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function tt(r){const i=new URL(r),n=i.pathname.match(et);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&n&&!i.search?he(`/paper-assets/arxiv-pdf/${n[1]}`)??r:r}function rt(r){return new URL(r).hostname.replace(/^www\./,"")}function at(r){if(!r)return{};const i={};for(const c of r.repositories??[]){if(!c.is_official)continue;const t=Q(c.url);if(!t)continue;const u=new URL(t),v=u.pathname.split("/").filter(Boolean);if((u.hostname==="github.com"||u.hostname==="www.github.com")&&v.length>=2){i.repository={href:t,stars:c.num_stars||0};break}}const n=[...r.project_pages??[]].sort((c,t)=>Number(t.is_official)-Number(c.is_official));for(const c of n){const t=Q(c.url);if(t){i.projectPage={href:t,label:rt(t)};break}}const b=r.hf_artifact_summary?r.hf_artifact_summary.model_count+r.hf_artifact_summary.dataset_count+r.hf_artifact_summary.space_count:new Set([...r.hf_models??[],...r.hf_datasets??[],...r.hf_spaces??[]]).size;return b>0&&r.arxiv_id&&(i.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:b}),i}function st(){var de,ue,pe,fe;const r=Ee(),{paperId:i}=me(),n=Te(i??"").replace(/v\d+$/i,""),b=Oe(n,!!n),c=ge({queryKey:["chatAvailability"],queryFn:()=>Ve.getAvailability(),refetchInterval:3e4,retry:!1}),t=b.data,u=t?De(t):null,v=u?null:(t==null?void 0:t.source)==="external"?he(`/paper-assets/external/${t.id}/paper.pdf`):Je(t==null?void 0:t.url_pdf),g=v&&(t==null?void 0:t.source)!=="external"?tt(v):v,k=at(t),l=((de=t==null?void 0:t.arxiv_id)==null?void 0:de.replace(/v\d+$/i,""))||n,N=s.useCallback(()=>r(`/paper/${l}`),[l,r]),[p,P]=s.useState(()=>sessionStorage.getItem(z(n))||void 0),[w,y]=s.useState(Ge),[d,Z]=s.useState(()=>sessionStorage.getItem(O(n))==="1"),[x,$]=s.useState("paper"),[M,j]=s.useState(),[we,G]=s.useState(!1),xe=s.useCallback(()=>G(!0),[]),[Pe,R]=s.useState(""),[Re,Se]=s.useState(()=>V(n)),[C,ye]=s.useState(0),[J,ee]=s.useState(!1),[je,L]=s.useState(!1),A=s.useRef(null),F=s.useRef(null),H=s.useRef(null),te=s.useRef(null),I=s.useRef(!1),E=s.useRef(0),S=s.useRef(0),K=s.useRef(0),_=s.useRef(w),U=s.useRef(V(n)),q=s.useRef(t==null?void 0:t.version),re=Fe().reset,ae=s.useRef(`${n}:${p??"new"}`),f=C>=840;s.useEffect(()=>{const e=`${n}:${p??"new"}`;ae.current!==e&&(ae.current=e,re())},[p,re,n]),s.useEffect(()=>{t!=null&&t.version&&q.current&&t.version!==q.current&&(j(void 0),R("")),q.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(E.current),L(!1);const e=sessionStorage.getItem(z(n));P(e||void 0),Z(sessionStorage.getItem(O(n))==="1"),$("paper"),G(!1),j(void 0),R("");const o=V(n);U.current=o,Se(o)},[n]),s.useEffect(()=>()=>{window.clearTimeout(E.current),cancelAnimationFrame(S.current)},[]),s.useLayoutEffect(()=>{const e=A.current;if(!e)return;const o=()=>ye(e.clientWidth);o();const m=new ResizeObserver(o);return m.observe(e),()=>m.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const o=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const m=e.content;e.content="noindex, nofollow";let h=document.querySelector('link[rel="canonical"]');const Ae=!h;h||(h=document.createElement("link"),h.rel="canonical",document.head.appendChild(h));const Ie=h.href;return h.href=`${window.location.origin}/paper/${l}`,()=>{document.title="Papers With Code",o?e==null||e.remove():e&&(e.content=m),Ae?h==null||h.remove():h&&(h.href=Ie)}},[l,t]);const T=s.useCallback(e=>{if(!C)return Math.max(45,Math.min(75,e));const o=480/C*100,m=100-360/C*100;return Math.max(o,Math.min(m,e))},[C]);s.useEffect(()=>y(e=>{const o=T(e);return _.current=o,o}),[T]);const W=e=>{const o=T(e);_.current=o,y(o),localStorage.setItem(Y,String(o))},se=e=>{var m;const o=T(e);_.current=o,F.current&&(F.current.style.width=`${o}%`),H.current&&(H.current.style.width=`${100-o}%`),(m=te.current)==null||m.setAttribute("aria-valuenow",String(Math.round(o)))},ne=e=>{K.current=e,!S.current&&(S.current=requestAnimationFrame(()=>{var m;S.current=0;const o=(m=A.current)==null?void 0:m.getBoundingClientRect();o!=null&&o.width&&se((K.current-o.left)/o.width*100)}))},Ce=e=>{I.current=!0,ee(!0),e.currentTarget.setPointerCapture(e.pointerId),ne(e.clientX)},B=()=>{var e;if(I.current){if(S.current){cancelAnimationFrame(S.current),S.current=0;const o=(e=A.current)==null?void 0:e.getBoundingClientRect();o!=null&&o.width&&se((K.current-o.left)/o.width*100)}I.current=!1,y(_.current),localStorage.setItem(Y,String(_.current)),ee(!1)}},oe=e=>{window.clearTimeout(E.current),L(!0),Z(e),sessionStorage.setItem(O(n),e?"1":"0"),E.current=window.setTimeout(()=>L(!1),Ze+40)},_e=e=>{P(e),sessionStorage.setItem(z(n),e)},ke=()=>{P(void 0),sessionStorage.removeItem(z(n)),j(void 0),R("")},ie=((ue=c.data)==null?void 0:ue.paper_reader_selection_enabled)===!0,ce=e=>{j(e),R(`Selection from page ${e.page} added to chat`),f&&d&&oe(!1)},Ne=s.useCallback(e=>{j(e),e||R("")},[]),le=We()&&((pe=c.data)==null?void 0:pe.paper_reader_chat_enabled)!==!1,$e=t&&le&&u&&!we?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&le?a.jsx(Xe,{mode:"paper",routeSessionId:p,primaryPaper:{id:t.id,routeId:l,title:t.title},currentPage:()=>U.current,paperSelection:M,onPaperSelectionChange:Ne,onSessionId:_e,onReaderSubmit:()=>$("assistant"),onReaderNewChat:ke}):a.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return b.isLoading?a.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):b.error||!t?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Paper not found."}),a.jsx(D,{to:"/papers",children:"Browse papers"})]}):((fe=c.data)==null?void 0:fe.native_pdf_reader_enabled)===!1?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"The native reader is currently unavailable."}),a.jsx(D,{to:`/paper/${l}`,children:"Back to paper"})]}):!g&&!u?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(D,{to:`/paper/${l}`,children:"Back to paper"})]}):a.jsxs("div",{className:"paper-reader-shell",children:[!f&&a.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":x==="paper",onClick:()=>$("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":x==="assistant","aria-label":M&&x!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>$("assistant"),children:["Chat",M&&x!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(He,{variant:"reader",children:a.jsxs("div",{ref:A,className:`reader-workspace${f?" is-desktop":" is-tabs"}${d?" is-assistant-collapsed":""}${J?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:F,className:`reader-paper-pane${!f&&x!=="paper"?" is-hidden":""}`,style:f?{width:d?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!f&&x!=="paper",children:u?a.jsx(Ye,{paperId:t.id,paperKey:l,paperTitle:t.title,paperHref:`/paper/${l}`,sourceUrl:u,resources:k,paperVersion:t.version,selectionEnabled:ie,onReady:xe,onPaperSelection:ce,onPaperSelectionError:R}):g&&a.jsx(Ke,{url:g,downloadUrl:v??g,paperKey:l,paperTitle:t.title,paperHref:`/paper/${l}`,onClose:N,resources:k,initialPage:Re,resizeActive:J||je,selectionEnabled:ie,paperVersion:t.version,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:ce,onPaperSelectionError:R,onPageChange:e=>{U.current=e,sessionStorage.setItem(ve(n),String(e))}})}),f&&!d&&a.jsx("div",{ref:te,className:"reader-resize-handle",role:"separator","aria-label":"Resize paper and Chat panels","aria-orientation":"vertical","aria-valuemin":45,"aria-valuemax":75,"aria-valuenow":Math.round(w),tabIndex:0,onPointerDown:Ce,onPointerMove:e=>{I.current&&ne(e.clientX)},onPointerUp:B,onPointerCancel:B,onLostPointerCapture:B,onDoubleClick:()=>W(be),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),W(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&W(45),e.key==="End"&&W(75)}}),a.jsx("aside",{ref:H,id:"reader-chat-panel",className:`reader-assistant-pane${!f&&x!=="assistant"?" is-hidden":""}${f&&d?" is-collapsed":""}`,style:f?{width:d?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!f&&x!=="assistant"||d,children:$e}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:Pe}),f&&a.jsx("button",{type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!d,onClick:()=>oe(!d),children:d?"Open chat":"Hide chat"})]})})]})}function Ft(){const{paperId:r=""}=me();return a.jsx(Le,{workspaceKey:`reader:${r}`,children:a.jsx(st,{})})}export{Ft as default,at as readerToolbarResources};
|
assets/PaperReaderView-Co23docw.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as s,j as a,A as X,u as me,b as Ee,n as Te,V as he,N as We,L as D}from"./index-DuJU_D27.js";import{u as ge}from"./useQuery-BvOlbTZD.js";import{u as ze,R as Me,A as Le,c as Fe,a as He,P as Ke}from"./ArtifactWorkspace-k9u84oat.js";import{M as Ue}from"./MarkdownText-CMN2meZd.js";import{g as qe}from"./papers-Zi3ALD1n.js";import{w as Be,e as De}from"./paperReader-BIpQD5HO.js";import{b as Oe}from"./usePapers-DSYVjBgu.js";import{c as Ve}from"./chat-6kLnoZFH.js";import{s as Q}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as Xe}from"./ChatView-Cuvu2zEE.js";import"./chatLaunch-DD_4HSkV.js";import"./chevron-down-B9CqRc2D.js";/* empty css */import"./hover-card-DfwM1bh1.js";import"./github-Ct0GY3Xc.js";import"./github-B26APZSL.js";import"./catalog-BDn3ESav.js";import"./PaperPreviewLink-Bvcg4CvY.js";import"./index-BOvg3c6G.js";import"./index-DwysRPUB.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./useMutation-BAvuTKgd.js";import"./copy-dcyyhyIJ.js";import"./file-text-DhueCFXV.js";import"./external-link-DWe5qf4F.js";import"./useInfiniteQuery-D38nK1Xd.js";import"./chatPrompts-DypmWIqx.js";import"./openrouter-Dtmvu49Z.js";import"./queryOptions-C9woPjwX.js";function Qe(r){return r instanceof X&&r.status===422?"This page could not be turned into a readable paper.":r instanceof X&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function Ye({paperId:r,paperKey:i,paperTitle:n,paperHref:b,sourceUrl:c,resources:t,paperVersion:u="",selectionEnabled:v=!1,onReady:g,onPaperSelection:k,onPaperSelectionError:l}){const N=s.useRef(null),p=ge({queryKey:["paperWebMarkdown",r],queryFn:()=>qe(r),staleTime:5*6e4,retry:(y,d)=>y<2&&!(d instanceof X&&d.status<500),retryDelay:3e3}),P=p.isSuccess;s.useEffect(()=>{P&&(g==null||g())},[g,P]),ze({enabled:v&&!!u&&P,pagesRoot:N,routeId:i,paperVersion:u,numPages:1,onSelect:k,onError:l});const w=p.data?Be(p.data):"";return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Me,{paperTitle:n,paperHref:b,resources:t,label:"Paper controls",children:a.jsx("div",{className:"pdf-toolbar-controls",children:a.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:"Open original"})})}),a.jsx("div",{className:"pdf-scroll-frame",children:a.jsx("div",{className:"pdf-scroll",role:"region","aria-label":"Paper web page",children:p.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):p.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:Qe(p.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void p.refetch(),children:"Retry"})," ",a.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:N,className:"reader-web-document","data-page":"1",children:[!w.startsWith("# ")&&a.jsx("h1",{children:n}),a.jsx(Ue,{text:w})]})})})]})}const be=66,Ze=240,Y="pwc:reader:split-ratio",z=r=>`pwc:reader:session:${r}`,O=r=>`pwc:reader:assistant-collapsed:${r}`,ve=r=>`pwc:reader:page:${r}`;function V(r){const i=Number(sessionStorage.getItem(ve(r)));return Number.isInteger(i)&&i>0?i:1}function Ge(){const r=Number(localStorage.getItem(Y));return Number.isFinite(r)&&r>=45&&r<=75?r:be}function Je(r){const i=Q(r);if(!i)return null;const n=new URL(i);return(n.hostname==="arxiv.org"||n.hostname==="www.arxiv.org")&&n.pathname.startsWith("/pdf/")&&n.pathname.endsWith(".pdf")&&(n.pathname=n.pathname.slice(0,-4)),n.href}const et=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function tt(r){const i=new URL(r),n=i.pathname.match(et);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&n&&!i.search?he(`/paper-assets/arxiv-pdf/${n[1]}`)??r:r}function rt(r){return new URL(r).hostname.replace(/^www\./,"")}function at(r){if(!r)return{};const i={};for(const c of r.repositories??[]){if(!c.is_official)continue;const t=Q(c.url);if(!t)continue;const u=new URL(t),v=u.pathname.split("/").filter(Boolean);if((u.hostname==="github.com"||u.hostname==="www.github.com")&&v.length>=2){i.repository={href:t,stars:c.num_stars||0};break}}const n=[...r.project_pages??[]].sort((c,t)=>Number(t.is_official)-Number(c.is_official));for(const c of n){const t=Q(c.url);if(t){i.projectPage={href:t,label:rt(t)};break}}const b=r.hf_artifact_summary?r.hf_artifact_summary.model_count+r.hf_artifact_summary.dataset_count+r.hf_artifact_summary.space_count:new Set([...r.hf_models??[],...r.hf_datasets??[],...r.hf_spaces??[]]).size;return b>0&&r.arxiv_id&&(i.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:b}),i}function st(){var de,ue,pe,fe;const r=Ee(),{paperId:i}=me(),n=Te(i??"").replace(/v\d+$/i,""),b=Oe(n,!!n),c=ge({queryKey:["chatAvailability"],queryFn:()=>Ve.getAvailability(),refetchInterval:3e4,retry:!1}),t=b.data,u=t?De(t):null,v=u?null:(t==null?void 0:t.source)==="external"?he(`/paper-assets/external/${t.id}/paper.pdf`):Je(t==null?void 0:t.url_pdf),g=v&&(t==null?void 0:t.source)!=="external"?tt(v):v,k=at(t),l=((de=t==null?void 0:t.arxiv_id)==null?void 0:de.replace(/v\d+$/i,""))||n,N=s.useCallback(()=>r(`/paper/${l}`),[l,r]),[p,P]=s.useState(()=>sessionStorage.getItem(z(n))||void 0),[w,y]=s.useState(Ge),[d,Z]=s.useState(()=>sessionStorage.getItem(O(n))==="1"),[x,$]=s.useState("paper"),[M,j]=s.useState(),[we,G]=s.useState(!1),xe=s.useCallback(()=>G(!0),[]),[Pe,R]=s.useState(""),[Re,Se]=s.useState(()=>V(n)),[C,ye]=s.useState(0),[J,ee]=s.useState(!1),[je,L]=s.useState(!1),A=s.useRef(null),F=s.useRef(null),H=s.useRef(null),te=s.useRef(null),I=s.useRef(!1),E=s.useRef(0),S=s.useRef(0),K=s.useRef(0),_=s.useRef(w),U=s.useRef(V(n)),q=s.useRef(t==null?void 0:t.version),re=Fe().reset,ae=s.useRef(`${n}:${p??"new"}`),f=C>=840;s.useEffect(()=>{const e=`${n}:${p??"new"}`;ae.current!==e&&(ae.current=e,re())},[p,re,n]),s.useEffect(()=>{t!=null&&t.version&&q.current&&t.version!==q.current&&(j(void 0),R("")),q.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(E.current),L(!1);const e=sessionStorage.getItem(z(n));P(e||void 0),Z(sessionStorage.getItem(O(n))==="1"),$("paper"),G(!1),j(void 0),R("");const o=V(n);U.current=o,Se(o)},[n]),s.useEffect(()=>()=>{window.clearTimeout(E.current),cancelAnimationFrame(S.current)},[]),s.useLayoutEffect(()=>{const e=A.current;if(!e)return;const o=()=>ye(e.clientWidth);o();const m=new ResizeObserver(o);return m.observe(e),()=>m.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const o=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const m=e.content;e.content="noindex, nofollow";let h=document.querySelector('link[rel="canonical"]');const Ae=!h;h||(h=document.createElement("link"),h.rel="canonical",document.head.appendChild(h));const Ie=h.href;return h.href=`${window.location.origin}/paper/${l}`,()=>{document.title="Papers With Code",o?e==null||e.remove():e&&(e.content=m),Ae?h==null||h.remove():h&&(h.href=Ie)}},[l,t]);const T=s.useCallback(e=>{if(!C)return Math.max(45,Math.min(75,e));const o=480/C*100,m=100-360/C*100;return Math.max(o,Math.min(m,e))},[C]);s.useEffect(()=>y(e=>{const o=T(e);return _.current=o,o}),[T]);const W=e=>{const o=T(e);_.current=o,y(o),localStorage.setItem(Y,String(o))},se=e=>{var m;const o=T(e);_.current=o,F.current&&(F.current.style.width=`${o}%`),H.current&&(H.current.style.width=`${100-o}%`),(m=te.current)==null||m.setAttribute("aria-valuenow",String(Math.round(o)))},ne=e=>{K.current=e,!S.current&&(S.current=requestAnimationFrame(()=>{var m;S.current=0;const o=(m=A.current)==null?void 0:m.getBoundingClientRect();o!=null&&o.width&&se((K.current-o.left)/o.width*100)}))},Ce=e=>{I.current=!0,ee(!0),e.currentTarget.setPointerCapture(e.pointerId),ne(e.clientX)},B=()=>{var e;if(I.current){if(S.current){cancelAnimationFrame(S.current),S.current=0;const o=(e=A.current)==null?void 0:e.getBoundingClientRect();o!=null&&o.width&&se((K.current-o.left)/o.width*100)}I.current=!1,y(_.current),localStorage.setItem(Y,String(_.current)),ee(!1)}},oe=e=>{window.clearTimeout(E.current),L(!0),Z(e),sessionStorage.setItem(O(n),e?"1":"0"),E.current=window.setTimeout(()=>L(!1),Ze+40)},_e=e=>{P(e),sessionStorage.setItem(z(n),e)},ke=()=>{P(void 0),sessionStorage.removeItem(z(n)),j(void 0),R("")},ie=((ue=c.data)==null?void 0:ue.paper_reader_selection_enabled)===!0,ce=e=>{j(e),R(`Selection from page ${e.page} added to chat`),f&&d&&oe(!1)},Ne=s.useCallback(e=>{j(e),e||R("")},[]),le=We()&&((pe=c.data)==null?void 0:pe.paper_reader_chat_enabled)!==!1,$e=t&&le&&u&&!we?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&le?a.jsx(Xe,{mode:"paper",routeSessionId:p,primaryPaper:{id:t.id,routeId:l,title:t.title},currentPage:()=>U.current,paperSelection:M,onPaperSelectionChange:Ne,onSessionId:_e,onReaderSubmit:()=>$("assistant"),onReaderNewChat:ke}):a.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return b.isLoading?a.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):b.error||!t?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Paper not found."}),a.jsx(D,{to:"/papers",children:"Browse papers"})]}):((fe=c.data)==null?void 0:fe.native_pdf_reader_enabled)===!1?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"The native reader is currently unavailable."}),a.jsx(D,{to:`/paper/${l}`,children:"Back to paper"})]}):!g&&!u?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(D,{to:`/paper/${l}`,children:"Back to paper"})]}):a.jsxs("div",{className:"paper-reader-shell",children:[!f&&a.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":x==="paper",onClick:()=>$("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":x==="assistant","aria-label":M&&x!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>$("assistant"),children:["Chat",M&&x!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(He,{variant:"reader",children:a.jsxs("div",{ref:A,className:`reader-workspace${f?" is-desktop":" is-tabs"}${d?" is-assistant-collapsed":""}${J?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:F,className:`reader-paper-pane${!f&&x!=="paper"?" is-hidden":""}`,style:f?{width:d?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!f&&x!=="paper",children:u?a.jsx(Ye,{paperId:t.id,paperKey:l,paperTitle:t.title,paperHref:`/paper/${l}`,sourceUrl:u,resources:k,paperVersion:t.version,selectionEnabled:ie,onReady:xe,onPaperSelection:ce,onPaperSelectionError:R}):g&&a.jsx(Ke,{url:g,downloadUrl:v??g,paperKey:l,paperTitle:t.title,paperHref:`/paper/${l}`,onClose:N,resources:k,initialPage:Re,resizeActive:J||je,selectionEnabled:ie,paperVersion:t.version,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:ce,onPaperSelectionError:R,onPageChange:e=>{U.current=e,sessionStorage.setItem(ve(n),String(e))}})}),f&&!d&&a.jsx("div",{ref:te,className:"reader-resize-handle",role:"separator","aria-label":"Resize paper and Chat panels","aria-orientation":"vertical","aria-valuemin":45,"aria-valuemax":75,"aria-valuenow":Math.round(w),tabIndex:0,onPointerDown:Ce,onPointerMove:e=>{I.current&&ne(e.clientX)},onPointerUp:B,onPointerCancel:B,onLostPointerCapture:B,onDoubleClick:()=>W(be),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),W(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&W(45),e.key==="End"&&W(75)}}),a.jsx("aside",{ref:H,id:"reader-chat-panel",className:`reader-assistant-pane${!f&&x!=="assistant"?" is-hidden":""}${f&&d?" is-collapsed":""}`,style:f?{width:d?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!f&&x!=="assistant"||d,children:$e}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:Pe}),f&&a.jsx("button",{type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!d,onClick:()=>oe(!d),children:d?"Open chat":"Hide chat"})]})})]})}function zt(){const{paperId:r=""}=me();return a.jsx(Le,{workspaceKey:`reader:${r}`,children:a.jsx(st,{})})}export{zt as default,at as readerToolbarResources};
|
|
|
|
|
|
assets/{PapersListView-BMg4HpaU.js → PapersListView-CpzceHH4.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as X,r as x,A as J,j as e,L as j,i as W}from"./index-
|
|
|
|
| 1 |
+
import{d as X,r as x,A as J,j as e,L as j,i as W}from"./index-DAAEdKQ4.js";import{I as U,T as Y,P as Z}from"./components-BWWnJ95m.js";import{c as ee}from"./catalog-Cjgxq75q.js";import{t as se,d as ae}from"./colors-DR110Nc2.js";import{u as re,a as te}from"./usePapers-BoM3UV5_.js";import{u as ne}from"./useDebounce-DMzHAzjF.js";import{u as ie}from"./useIntersectionObserver-DFkuIFUb.js";import{S as _}from"./skeleton-Te-nsRWB.js";import{A as oe,a as ce}from"./alert-B_MWtfva.js";import{u as le}from"./useQuery-BALok3Po.js";import{P as de}from"./PaperFeedFilters-Hyqa1G4B.js";import{a as me,P as he,b as pe}from"./PaperDateFilter-Cmzg62xO.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-lQiG5mCP.js";import"./papers-DL8dzFlM.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-BJadVmaJ.js";import"./popover-CNAIo5eI.js";const v=360;function ue(a,o){const m=a.toLocaleLowerCase();return o.trim().split(/\s+/).filter(Boolean).reduce((c,t)=>{const l=m.indexOf(t.toLocaleLowerCase());return l>=0&&(c<0||l<c)?l:c},-1)}function z(a,o,m){if((a.slice(0,o).match(/\$/g)||[]).length%2===0)return o;if(m==="start")return a.lastIndexOf("$",o)+1;const t=a.indexOf("$",o);return t>=0?t+1:o}function fe(a,o){if(a.length<=v)return a;const m=ue(a,o);if(m<0||m<v*.6)return a;let c=Math.max(0,m-Math.floor(v*.35)),t=Math.min(a.length,c+v);return c=z(a,c,"start"),t=z(a,t,"end"),`${c>0?"…":""}${a.slice(c,t).trim()}${t<a.length?"…":""}`}const xe=[["trending","trending"],["new","newest"],["cited","most cited"]],ge=[["relevance","relevance"],["new","newest"],["cited","most cited"]],je=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Oe=()=>{var I,$,T,O,B,H,M,q,G;const[a,o]=X(),m=a.get("framework")||void 0,c=a.get("repository")||void 0,t=!!(m||c),l=a.get("search")||"",[F,C]=x.useState(l),p=ne(F,300),n=!t&&l.trim().length>0;x.useEffect(()=>C(l),[l]),x.useEffect(()=>{if(p===l)return;const s=new URLSearchParams(a);p?s.set("search",p):s.delete("search"),o(s,{replace:!0})},[p]),x.useEffect(()=>{const s=a.get("order_by"),i=new URLSearchParams(a);n&&!["relevance","date_published","citation_count"].includes(s||"")?(i.set("order_by","relevance"),o(i,{replace:!0})):!n&&s==="relevance"&&(i.delete("order_by"),o(i,{replace:!0}))},[n,a,o]);const L=a.get("order_by"),g=L==="citation_count"?"cited":L==="date_published"?"new":n?"relevance":"trending",u=me(a),w=a.get("has_hf_artifacts")==="true",k=!t&&a.get("has_code")==="true",y=(s,i)=>{const h=new URLSearchParams(a);i?h.set(s,i):h.delete(s),o(h)},Q=s=>{y("order_by",s==="cited"?"citation_count":s==="new"?"date_published":s)},b=re({page_size:20,order_by:g==="trending"?"trending":g==="cited"?"citation_count":"date_published",order_dir:"desc",search:t&&p||void 0,start_date:u.startDate,end_date:u.endDate,include_resources:!0,conference:a.get("conference")||void 0,latest_only:a.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:m,repository:c,enabled:!n}),R=te({q:p.trim(),order_by:g==="cited"?"citation_count":g==="new"?"date_published":"relevance",start_date:u.startDate,end_date:u.endDate,has_code:k,has_hf_artifacts:w,enabled:n}),d=n?R:b,A=le({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),enabled:!t&&!n,staleTime:10*60*1e3}),N=x.useMemo(()=>{var i;return(((i=d.data)==null?void 0:i.pages.flatMap(h=>h.results))||[]).map(h=>{const S=se(h);return n?{...S,abstract:fe(S.abstract,l)}:S})},[d.data,n,l]),{targetRef:K,isIntersecting:D}=ie({rootMargin:"200px"});x.useEffect(()=>{D&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[D,d.hasNextPage,d.isFetchingNextPage]);const f=((T=($=(I=b.data)==null?void 0:I.pages)==null?void 0:$[0])==null?void 0:T.count)??0,r=(H=(B=(O=b.data)==null?void 0:O.pages)==null?void 0:B[0])==null?void 0:H.scope,P=(q=(M=R.data)==null?void 0:M.pages)==null?void 0:q.at(-1),E=m&&d.error instanceof J&&d.error.status===404,V=(r==null?void 0:r.kind)==="framework"?r.framework_name:r==null?void 0:r.repository;return e.jsxs("div",{className:"page",children:[(r==null?void 0:r.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(j,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(j,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:r.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:t?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:V||m||c})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",l,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:t?(r==null?void 0:r.kind)==="framework"?f>0&&`${f.toLocaleString()} papers.`:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",f>0&&`${f.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${N.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",f>0&&`${f.toLocaleString()} papers indexed.`]})}),t&&r&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:r.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(U,{name:"github",size:13}),r.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r.repository||"GitHub"}),r.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",je(r.num_stars)]})]}):"GitHub"]}),r.kind==="framework"&&r.introducing_paper_arxiv_id&&e.jsx(j,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),r.kind==="framework"&&r.recommended_tasks&&r.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:r.recommended_tasks.map(s=>s.slug?e.jsx(Y,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx(he,{startDate:u.startDate,endDate:u.endDate,onChange:s=>o(pe(a,s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(U,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:F,onChange:s=>C(s.target.value)})]})}),e.jsxs("div",{className:t||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!t&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(_,{className:"h-5 w-full"},i))}),(G=A.data)==null?void 0:G.map(s=>e.jsxs(j,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ae(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:(n?ge:xe).map(([s,i])=>e.jsx("button",{className:`sort-btn ${g===s?"active":""}`,onClick:()=>Q(s),children:i},s))}),e.jsx(de,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>y("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>y("has_hf_artifacts",s?"true":void 0),showHasCode:!t})]}),e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})]}),E?e.jsx("div",{className:"no-results",children:"Framework not found."}):d.error&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsx(ce,{children:"Failed to load papers. Please try again."})}),!E&&(d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(_,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},i))}):N.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("p",{children:"No matching papers."}),n&&W()&&e.jsx(j,{to:`/chat?q=${encodeURIComponent(l.trim())}`,children:"Ask the assistant instead"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,i)=>e.jsx(Z,{paper:s,rank:i+1,highlightQuery:n?l:void 0},s.id))}),e.jsx("div",{ref:K,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),!d.hasNextPage&&!d.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:P!=null&&P.cap_reached?"End of the top 100 results":"End of results"})]}))]})]})]})};export{Oe as default};
|
assets/{PrivacyView-fuoYet-j.js → PrivacyView-BEs7JLal.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{F as s,j as e}from"./index-
|
|
|
|
| 1 |
+
import{F as s,j as e}from"./index-DAAEdKQ4.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 500 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default};
|
assets/{RateLimitsView-DMM-c-28.js → RateLimitsView-Dcg2BwK4.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,G as t}from"./index-
|
|
|
|
| 1 |
+
import{j as e,G as t}from"./index-DAAEdKQ4.js";import{u as s}from"./useQuery-BALok3Po.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default};
|
assets/{ResearchFollowButton-BrbOAi4p.js → ResearchFollowButton-DNrVdY8G.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{c as y,ar as F,m as N,r as S,J as L,j as e,Y as v,l as C,L as i}from"./index-
|
|
|
|
| 1 |
+
import{c as y,ar as F,m as N,r as S,J as L,j as e,Y as v,l as C,L as i}from"./index-DAAEdKQ4.js";import{u as G}from"./useQuery-BALok3Po.js";import{u as k}from"./useMutation-D4cqMKzD.js";import{r as m}from"./research--raTfZxI.js";import{P as p}from"./plus-B07MagLg.js";const j={task:"Get new papers on this task",method:"Get new papers using this method",benchmark:"Get new results on this benchmark",author:"Get new papers by this author",organization:"Get new papers from this organization"};function R({kind:a,entityId:n}){var f;const l=y(),s=l==null?void 0:l.user,c=F(),h=N(),[x,g]=S.useState(null),u=`${a}:${n}`,d=["research-follows",s==null?void 0:s.hf_subject],r=G({queryKey:d,queryFn:m.follows,enabled:!!s}),o=((f=r.data)==null?void 0:f.some(w=>w.kind===a&&String(w.entity_id)===String(n)))??!1,t=k({mutationFn:()=>m.setFollow(a,n,!o),onSuccess:async()=>{g(o?null:u),await h.invalidateQueries({queryKey:d}),await h.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]})}});if(!l||!s&&L())return null;if(!s)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:v(c.pathname+c.search),children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]}),e.jsxs("span",{className:"research-follow-hint",children:["Sign in to ",j[a].toLowerCase(),"."]})]});const b=t.error||r.error;return e.jsxs("div",{className:"research-follow",children:[e.jsx("button",{type:"button",className:o?"research-follow-btn is-following":"research-follow-btn",disabled:r.isLoading||!!r.error||t.isPending,"aria-pressed":o,"aria-label":o?"Unfollow":"Follow",onClick:()=>t.mutate(),children:o?e.jsxs(e.Fragment,{children:[e.jsx(C,{"aria-hidden":"true"}),e.jsx("span",{className:"research-follow-label",children:"Following"}),e.jsx("span",{className:"research-follow-label-hover",children:"Unfollow"})]}):e.jsxs(e.Fragment,{children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]})}),b?e.jsx("span",{className:"research-follow-hint is-error",role:"alert",children:"Could not update follows. Please try again."}):o?x===u&&e.jsxs("span",{className:"research-follow-hint",role:"status",children:["Added to ",e.jsx(i,{to:"/following",children:"your Following feed"})," · ",e.jsx(i,{to:"/settings",children:"Manage in Settings"})]}):e.jsxs("span",{className:"research-follow-hint",children:[j[a]," in ",e.jsx(i,{to:"/following",children:"your Following feed"}),"."]})]})}export{R};
|
assets/{SavedPapersView-CrxoA7xK.js → SavedPapersView-Rcq2cSen.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as h,A as g,j as e,H as v,L as x,G as j}from"./index-
|
|
|
|
| 1 |
+
import{a as h,A as g,j as e,H as v,L as x,G as j}from"./index-DAAEdKQ4.js";import{p as f}from"./paperQueryKeys-BP2E-0yf.js";import{u as N}from"./useQuery-BALok3Po.js";import{T as b,P as k}from"./components-BWWnJ95m.js";import{S as r}from"./skeleton-Te-nsRWB.js";import{A as y,a as w}from"./alert-B_MWtfva.js";import{t as A}from"./colors-DR110Nc2.js";import{s as B}from"./savedPapersAuth-ClyJjlu3.js";import"./LatexTitle-lQiG5mCP.js";import"./papers-DL8dzFlM.js";import"./safeExternalHref-CkBrsh84.js";const W=()=>{var c,o;const{user:t,isLoading:u}=h(),a=N({queryKey:[...f.feeds.saved],queryFn:()=>j.getBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,d=()=>{window.location.assign(B())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(c=a.data)!=null&&c.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:d,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(y,{variant:"destructive",className:"mb-4",children:e.jsx(w,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:d,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(k,{paper:A(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{W as default};
|
assets/{SearchOverlay-DX8gymET.js → SearchOverlay-CxQWYYv8.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as C,b as Q,F as S,i as D,j as e}from"./index-
|
|
|
|
| 1 |
+
import{r as C,b as Q,F as S,i as D,j as e}from"./index-DAAEdKQ4.js";import{p as K}from"./paperQueryKeys-BP2E-0yf.js";import{u}from"./useQuery-BALok3Po.js";import{L as $}from"./LatexTitle-lQiG5mCP.js";import{c as j}from"./catalog-Cjgxq75q.js";import{p as L}from"./papers-DL8dzFlM.js";import{u as M}from"./useDebounce-DMzHAzjF.js";import{c as I,h as z,d as B}from"./colors-DR110Nc2.js";const H=10,O=350,y=3,ss=({open:t,onClose:i})=>{var E,F,q,w;const v=C.useRef(null),T=Q(),[r,A]=S.useState(""),a=M(r,O),p=r.trim(),c=a.length>=y,x=D();C.useEffect(()=>{var n;if(!t)return;(n=v.current)==null||n.focus();const s=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),i())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,i]);const f=u({queryKey:[...K.feeds.searchOverlay,a],queryFn:()=>L.search(a,1,H),enabled:t&&c,staleTime:6e4,retry:!1}),k=u({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:t&&c,staleTime:6e4,retry:!1}),N=u({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:t&&c,staleTime:6e4,retry:!1}),b=u({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({q:a,page_size:6}),enabled:t&&c,staleTime:6e4,retry:!1});if(!t)return null;const o=((E=k.data)==null?void 0:E.results)||[],h=((F=N.data)==null?void 0:F.results)||[],d=((q=b.data)==null?void 0:q.results)||[],m=((w=f.data)==null?void 0:w.results)||[],P=f.isFetching||k.isFetching||N.isFetching||b.isFetching,R=o.length||m.length||h.length||d.length,l=s=>{i(),T(s)},_=()=>{const s=r.trim();s&&l(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:i,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:r,onChange:s=>A(s.target.value),onKeyDown:s=>{x&&s.key==="Enter"&&(s.preventDefault(),_())}}),e.jsxs("div",{className:"search-results",children:[x&&r.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:_,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",r.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!c&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",y," characters."]}),c&&!P&&!R&&e.jsxs("div",{className:"search-empty",children:['No matches for "',r,'"']}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(s=>{const n=I(z(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>l(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:n.dot}}),e.jsx("span",{className:"name",children:B(s.name,s.slug)}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id)})]}),h.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Methods · ",h.length]}),h.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>l(`/methods/${s.slug||s.id}`),children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:s.name}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",d.length]}),d.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>l(`/benchmark/${s.slug||s.id}`),children:[e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," entries"]})]},s.id))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",m.length]}),m.map(s=>{var n;return e.jsxs("div",{className:"search-result",onClick:()=>l(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx($,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((n=s.authors)==null?void 0:n[0])&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.authors[0],s.authors.length>1?" et al.":""]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["↑ ",s.citation_count.toLocaleString()]})]})]})]},s.id)})]}),p.length>=y&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>l(`/papers?search=${encodeURIComponent(p)}`),children:["View all paper results for “",p,"”"]})]})]})})};export{ss as default};
|
assets/{SettingsView-BGSBWGPf.js → SettingsView-CTpLNdkD.js}
RENAMED
|
@@ -1,21 +1,16 @@
|
|
| 1 |
-
import{g as
|
| 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
|
| 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
|
| 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 ke=I("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
| 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 Fe=I("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),se=[{kind:"task",label:"Tasks",icon:me,browse:"/tasks"},{kind:"method",label:"Methods",icon:pe,browse:"/methods"},{kind:"benchmark",label:"Benchmarks",icon:ue},{kind:"author",label:"Authors",icon:Fe},{kind:"organization",label:"Organizations",icon:xe,browse:"/organizations"}],y=s=>`${s.kind}:${s.entity_id}`,Ce=s=>new Date(s).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});function _e({follows:s}){const{user:r}=B(),o=Y(),[j,f]=re.useState([]),m=N({mutationFn:({follow:c,enabled:a})=>O.setFollow(c.kind,c.entity_id,a),onSuccess:(c,{follow:a,enabled:u})=>{const p=["research-follows",r==null?void 0:r.hf_subject];o.setQueryData(p,t=>u?[...t??[],a]:(t??[]).filter(i=>y(i)!==y(a))),f(t=>[...t.filter(i=>y(i)!==y(a)),...u?[]:[a]]),o.invalidateQueries({queryKey:p}),o.invalidateQueries({queryKey:["research-feed",r==null?void 0:r.hf_subject]})}}),b=new Set(s.map(y)),l=[...s,...j.filter(c=>!b.has(y(c)))];return l.length?e.jsxs(e.Fragment,{children:[se.map(({kind:c,label:a,icon:u})=>{const p=l.filter(t=>t.kind===c).sort((t,i)=>t.name.localeCompare(i.name));return p.length?e.jsxs("div",{className:"research-follow-group",children:[e.jsxs("h3",{className:"research-follow-group-title",children:[e.jsx(u,{"aria-hidden":"true"}),a]}),e.jsx("ul",{className:"research-follow-list",children:p.map(t=>{const i=b.has(y(t));return e.jsxs("li",{className:i?"research-follow-row":"research-follow-row is-unfollowed",children:[e.jsxs("div",{className:"research-follow-text",children:[e.jsx(Q,{to:t.url,children:t.name}),e.jsx("span",{children:i?`Following since ${Ce(t.created_at)}`:"Unfollowed"})]}),e.jsx("button",{type:"button",className:i?"research-follow-action":"research-follow-action is-refollow",disabled:m.isPending,"aria-label":`${i?"Unfollow":"Follow"} ${t.name}`,onClick:()=>m.mutate({follow:t,enabled:!i}),children:i?"Unfollow":"Follow again"})]},y(t))})})]},c):null}),m.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not update follows. Please try again."})]}):e.jsx(Re,{})}function Re(){return e.jsxs("div",{className:"research-follow-empty",children:[e.jsx("p",{children:e.jsx("strong",{children:"You are not following anything yet."})}),e.jsx("p",{children:"Use the Follow button on any task, method, benchmark, author, or organization page."}),e.jsx("div",{className:"research-follow-browse",children:se.filter(s=>s.browse).map(({kind:s,label:r,icon:o,browse:j})=>e.jsxs(Q,{to:j,children:[e.jsx(o,{"aria-hidden":"true"}),"Browse ",r.toLowerCase()]},s))})]})}function Ee(){var a;const{user:s}=B(),r=Y(),o=P({queryKey:["research-follows",s==null?void 0:s.hf_subject],queryFn:O.follows,enabled:!!s}),j=["research-email",s==null?void 0:s.hf_subject],f=P({queryKey:j,queryFn:O.email,enabled:!!s}),m=N({mutationFn:O.setEmail,onSuccess:u=>r.setQueryData(j,u)}),b=((a=o.data)==null?void 0:a.length)??0,l=f.data,c=!!(l!=null&&l.email)&&!l.suppressed;return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"settings-section","aria-labelledby":"research-following-heading",children:[e.jsxs("div",{className:"research-section-heading",children:[e.jsxs("h2",{className:"settings-section-title",id:"research-following-heading",children:["Following",b>0&&e.jsx("span",{className:"research-follow-count",children:b})]}),s&&e.jsxs(Q,{className:"research-feed-link",to:"/following",children:["Open Following feed ",e.jsx(he,{"aria-hidden":"true"})]})]}),e.jsx("p",{className:"settings-row-desc research-section-intro",children:"New papers and benchmark results from what you follow appear in your Following feed. Your follows are private."}),s?o.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading follows…"}):o.error?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load your follows."}):e.jsx(_e,{follows:o.data??[]}):e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"Sign in to follow research and build your personal feed."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(w,{returnTo:"/settings"})})]})]}),s&&e.jsxs("section",{className:"settings-section","aria-labelledby":"research-email-heading",children:[e.jsx("h2",{className:"settings-section-title",id:"research-email-heading",children:"Weekly research email"}),f.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading email preferences…"}):f.error||!l?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load email preferences."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"research-weekly-email",children:[e.jsx("span",{className:"settings-row-label",children:"Email me a weekly digest"}),e.jsx("span",{className:"settings-row-desc",children:"Up to 20 new papers and benchmark results matching your follows, sent Mondays at 08:00 UTC. No email is sent in weeks without new matches."})]}),e.jsx(H,{id:"research-weekly-email",checked:l.enabled,disabled:m.isPending||!l.enabled&&!c,onCheckedChange:u=>m.mutate(u)})]}),e.jsxs("div",{className:"research-email-destination",children:[e.jsx(ge,{"aria-hidden":"true"}),l.email?e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:["Sending to ",e.jsx("strong",{children:l.email})]}),e.jsx("a",{href:le("/settings",!1,!0),children:"Refresh from Hugging Face"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"To opt in, allow access to the verified email on your Hugging Face account."}),e.jsx(w,{returnTo:"/settings",collectEmail:!0,label:"Allow email access"})]})]}),l.suppressed&&e.jsx("p",{className:"research-email-status is-warning",role:"status",children:"Delivery to this address is paused after a bounce or spam complaint."}),!l.delivery_ready&&e.jsx("p",{className:"research-email-status",role:"status",children:"Weekly emails have not launched yet. Your preference is saved and applies from launch."}),m.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your preference. Refresh your email from Hugging Face and try again."})]})]})]})}const Se="https://openrouter.ai/settings/keys";function Oe(s,r){if(s instanceof ee){if(typeof s.detail=="string")return s.detail;if(typeof s.detail=="object"&&s.detail!==null&&"message"in s.detail&&typeof s.detail.message=="string")return s.detail.message}return s instanceof Error&&!s.message.startsWith("API request failed:")?s.message:r}const Qe=()=>{var X;const{user:s,isLoading:r}=B(),{preferences:o,setHideClosedSourceEvals:j,canPersist:f,isLoading:m}=oe(),{theme:b,setTheme:l}=ce(),c=b??"system",a=de(),[u,p]=k.useState(""),[t,i]=k.useState(""),[$,F]=k.useState(""),[C,K]=k.useState(""),_=Y(),R=P({queryKey:["chat","models","settings"],enabled:a&&!!s,queryFn:()=>v.getModels()}),A=new Set((((X=R.data)==null?void 0:X.items)??[]).map(n=>n.provider)),L=A.has("huggingface"),E=A.has("openrouter"),ne=A.has("openai"),S=P({queryKey:["inference-billing",s==null?void 0:s.hf_subject],enabled:a&&!!s&&L,queryFn:()=>v.getInferenceBilling()}),g=S.data??null,M=ye(a&&!!s&&E),z=fe(a&&!!s&&E),d=M.data,x=z.data,h=d?ve(d.resets_at):null,ae=a&&!!s&&(R.isLoading||!R.isError&&(L&&S.isLoading||E&&(M.isLoading||z.isLoading))),te=r||m||b===void 0||ae,W=N({mutationFn:n=>v.selectInferenceBillingAccount(n),onSuccess:n=>{_.setQueryData(["inference-billing",s==null?void 0:s.hf_subject],n),p("")},onError:n=>{p(n instanceof Error?n.message:"Could not change the billing account.")}}),ie=S.isLoading||W.isPending,q=(n,D)=>{i(Oe(n,D)),F(n instanceof ee?n.code??"":"")},T=N({mutationFn:n=>v.connectOpenRouterCredential(n),onSuccess:n=>{_.setQueryData(U,n),K(""),i(""),F("")},onError:n=>q(n,"Could not connect the OpenRouter key.")}),V=N({mutationFn:n=>v.setOpenRouterFallback(n),onSuccess:n=>{_.setQueryData(U,n),i(""),F("")},onError:n=>q(n,"Could not change paid fallback.")}),G=N({mutationFn:()=>v.disconnectOpenRouterCredential(),onSuccess:()=>{_.setQueryData(U,{connected:!1,verified_at:null,fallback_enabled:!1}),i(""),F("")},onError:n=>q(n,"Could not disconnect the OpenRouter key.")});return k.useEffect(()=>(document.title=je("Settings"),()=>{document.title=be}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Manage what you follow, your weekly email, and how papers are displayed."})]})}),te?e.jsx("div",{className:"settings-page-loading",role:"status","aria-live":"polite",children:e.jsx("span",{className:"sr-only",children:"Loading settings…"})}):e.jsxs("div",{className:"settings-page-content",children:[e.jsx(Ee,{}),s&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:s.role??"community member"}),"."," ",s.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",s.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),a&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),s?R.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Could not load the enabled chat providers."}):e.jsxs("div",{className:"settings-provider-grid",children:[L&&e.jsxs("section",{className:"settings-provider-card","aria-labelledby":"inference-providers-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"inference-providers-heading",children:"Inference Providers"}),e.jsx("p",{children:"Hugging Face-billed model usage"})]}),(g==null?void 0:g.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),S.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Hugging Face billing is currently unavailable."}):g!=null&&g.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:g.bill_to?`Organization · ${g.bill_to}`:`Personal account · @${s.username}`}),e.jsx("p",{className:"settings-row-desc",children:"Usage for Hugging Face Inference Providers is billed by Hugging Face to your selected account. Included Hugging Face usage is applied first; pay-as-you-go billing follows your Hugging Face plan and billing settings. Papers With Code does not fund, meter, or reset these credits."}),e.jsx("label",{className:"settings-token-label",htmlFor:"hf-billing-account",children:"Bill chat usage to"}),e.jsxs("select",{id:"hf-billing-account",className:"settings-billing-select",value:g.bill_to??"",onChange:n=>{p(""),W.mutate(n.target.value||null)},disabled:ie,children:[e.jsxs("option",{value:"",children:["Personal account (@",s.username,")"]}),g.organizations.map(n=>e.jsxs("option",{value:n.name,children:[n.display_name," (",n.name,")"]},n.name))]}),u&&e.jsx("div",{className:"settings-token-error",children:u}),e.jsx("div",{className:"settings-billing-actions",children:e.jsxs("a",{className:"button button-primary",href:g.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(J,{"aria-hidden":"true"})]})})]}):e.jsxs("div",{className:"settings-billing-connect",children:[e.jsx("p",{className:"settings-row-desc",children:"Reconnect with Hugging Face to authorize Inference Providers. Hugging Face bills your personal account or the organization you select."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx(w,{returnTo:"/settings",label:"Re-sign in with Hugging Face",authorizeInference:!0})})]})]}),E&&e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(x==null?void 0:x.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),d?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",h==null?void 0:h.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",h==null?void 0:h.utc,")"]})]})]}),e.jsx("strong",{children:d.available?`${d.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${d.remaining_percent}% remaining; resets ${h==null?void 0:h.local}; ${h==null?void 0:h.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":d.remaining_percent,children:e.jsx("span",{style:{width:`${d.remaining_percent}%`}})}),!d.available&&e.jsxs("p",{className:"settings-limit-note",children:[d.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${d.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:M.isError||d?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),x!=null&&x.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",x.verified_at?` · Last verified ${new Date(x.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(H,{checked:x.fallback_enabled,disabled:V.isPending,onCheckedChange:n=>V.mutate(!!n)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:G.isPending,onClick:()=>G.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:Se,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(J,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:n=>{n.preventDefault(),C.trim()&&T.mutate(C.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:C,onChange:n=>K(n.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!C.trim()||T.isPending,children:T.isPending?"Verifying…":"Connect key"})})]}),t&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:$==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":t}),$==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(w,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]}),ne&&e.jsx("div",{className:"settings-note settings-note-flush",role:"note",children:"Direct OpenAI usage is provided by Papers With Code. No OpenAI API key or billing account is required from you."})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to manage billing and credentials for the enabled chat providers."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(w,{returnTo:"/settings",authorizeInference:!0})})]})]}),a&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 500 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:we},{value:"light",label:"Light",description:"Always use light mode",icon:ke},{value:"dark",label:"Dark",description:"Always use dark mode",icon:Ne}].map(n=>{const D=n.icon,Z=c===n.value;return e.jsxs("button",{type:"button",className:`theme-option ${Z?"is-selected":""}`,"aria-pressed":Z,onClick:()=>l(n.value),children:[e.jsx(D,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:n.label}),e.jsx("span",{className:"theme-option-desc",children:n.description})]})]},n.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(H,{id:"hide-closed-source-evals",checked:o.hide_closed_source_evals,onCheckedChange:n=>{j(!!n)}})]}),!r&&!f&&!s&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(w,{returnTo:"/settings"})})]})]})]})]})};export{Qe as default};
|
|
|
|
| 1 |
+
import{g as H,a as B,m as Y,j as e,L as Q,H as w,Y as le,r as re,k as oe,as as ce,i as de,F as k,A as ee}from"./index-DAAEdKQ4.js";import{u as P}from"./useQuery-BALok3Po.js";import{u as N}from"./useMutation-D4cqMKzD.js";import{r as O}from"./research--raTfZxI.js";import{S as U}from"./switch-Bow6oaVX.js";import{A as he}from"./arrow-right-rMmdXkVV.js";import{M as ue,L as ge,F as me,B as pe}from"./mail-CoJDXtbW.js";import{T as xe}from"./trophy-Cv9NQUtE.js";import{c as v}from"./chat-BFojJrU9.js";import{f as je,D as be}from"./latexPlainText-DI8YEXVe.js";import{a as ye,u as fe,r as ve,O as D}from"./openrouter-DpGnZ_gU.js";import{E as Z}from"./external-link-n_se8QIW.js";import{M as we}from"./moon-DPGgloVg.js";import"./index-DRLEC3qz.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 Ne=H("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
| 7 |
* @license lucide-react v0.462.0 - ISC
|
| 8 |
*
|
| 9 |
* This source code is licensed under the ISC license.
|
| 10 |
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
+
*/const ke=H("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
| 12 |
* @license lucide-react v0.462.0 - ISC
|
| 13 |
*
|
| 14 |
* This source code is licensed under the ISC license.
|
| 15 |
* See the LICENSE file in the root directory of this source tree.
|
| 16 |
+
*/const Fe=H("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),se=[{kind:"task",label:"Tasks",icon:ge,browse:"/tasks"},{kind:"method",label:"Methods",icon:me,browse:"/methods"},{kind:"benchmark",label:"Benchmarks",icon:xe},{kind:"author",label:"Authors",icon:Fe},{kind:"organization",label:"Organizations",icon:pe,browse:"/organizations"}],y=s=>`${s.kind}:${s.entity_id}`,Ce=s=>new Date(s).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});function _e({follows:s}){const{user:r}=B(),o=Y(),[j,f]=re.useState([]),m=N({mutationFn:({follow:c,enabled:a})=>O.setFollow(c.kind,c.entity_id,a),onSuccess:(c,{follow:a,enabled:u})=>{const p=["research-follows",r==null?void 0:r.hf_subject];o.setQueryData(p,t=>u?[...t??[],a]:(t??[]).filter(i=>y(i)!==y(a))),f(t=>[...t.filter(i=>y(i)!==y(a)),...u?[]:[a]]),o.invalidateQueries({queryKey:p}),o.invalidateQueries({queryKey:["research-feed",r==null?void 0:r.hf_subject]})}}),b=new Set(s.map(y)),l=[...s,...j.filter(c=>!b.has(y(c)))];return l.length?e.jsxs(e.Fragment,{children:[se.map(({kind:c,label:a,icon:u})=>{const p=l.filter(t=>t.kind===c).sort((t,i)=>t.name.localeCompare(i.name));return p.length?e.jsxs("div",{className:"research-follow-group",children:[e.jsxs("h3",{className:"research-follow-group-title",children:[e.jsx(u,{"aria-hidden":"true"}),a]}),e.jsx("ul",{className:"research-follow-list",children:p.map(t=>{const i=b.has(y(t));return e.jsxs("li",{className:i?"research-follow-row":"research-follow-row is-unfollowed",children:[e.jsxs("div",{className:"research-follow-text",children:[e.jsx(Q,{to:t.url,children:t.name}),e.jsx("span",{children:i?`Following since ${Ce(t.created_at)}`:"Unfollowed"})]}),e.jsx("button",{type:"button",className:i?"research-follow-action":"research-follow-action is-refollow",disabled:m.isPending,"aria-label":`${i?"Unfollow":"Follow"} ${t.name}`,onClick:()=>m.mutate({follow:t,enabled:!i}),children:i?"Unfollow":"Follow again"})]},y(t))})})]},c):null}),m.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not update follows. Please try again."})]}):e.jsx(Re,{})}function Re(){return e.jsxs("div",{className:"research-follow-empty",children:[e.jsx("p",{children:e.jsx("strong",{children:"You are not following anything yet."})}),e.jsx("p",{children:"Use the Follow button on any task, method, benchmark, author, or organization page."}),e.jsx("div",{className:"research-follow-browse",children:se.filter(s=>s.browse).map(({kind:s,label:r,icon:o,browse:j})=>e.jsxs(Q,{to:j,children:[e.jsx(o,{"aria-hidden":"true"}),"Browse ",r.toLowerCase()]},s))})]})}function Ee(){var a;const{user:s}=B(),r=Y(),o=P({queryKey:["research-follows",s==null?void 0:s.hf_subject],queryFn:O.follows,enabled:!!s}),j=["research-email",s==null?void 0:s.hf_subject],f=P({queryKey:j,queryFn:O.email,enabled:!!s}),m=N({mutationFn:O.setEmail,onSuccess:u=>r.setQueryData(j,u)}),b=((a=o.data)==null?void 0:a.length)??0,l=f.data,c=!!(l!=null&&l.email)&&!l.suppressed;return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"settings-section","aria-labelledby":"research-following-heading",children:[e.jsxs("div",{className:"research-section-heading",children:[e.jsxs("h2",{className:"settings-section-title",id:"research-following-heading",children:["Following",b>0&&e.jsx("span",{className:"research-follow-count",children:b})]}),s&&e.jsxs(Q,{className:"research-feed-link",to:"/following",children:["Open Following feed ",e.jsx(he,{"aria-hidden":"true"})]})]}),e.jsx("p",{className:"settings-row-desc research-section-intro",children:"New papers and benchmark results from what you follow appear in your Following feed. Your follows are private."}),s?o.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading follows…"}):o.error?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load your follows."}):e.jsx(_e,{follows:o.data??[]}):e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"Sign in to follow research and build your personal feed."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(w,{returnTo:"/settings"})})]})]}),s&&e.jsxs("section",{className:"settings-section","aria-labelledby":"research-email-heading",children:[e.jsx("h2",{className:"settings-section-title",id:"research-email-heading",children:"Weekly research email"}),f.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading email preferences…"}):f.error||!l?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load email preferences."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"research-weekly-email",children:[e.jsx("span",{className:"settings-row-label",children:"Email me a weekly digest"}),e.jsx("span",{className:"settings-row-desc",children:"Up to 20 new papers and benchmark results matching your follows, sent Mondays at 08:00 UTC. No email is sent in weeks without new matches."})]}),e.jsx(U,{id:"research-weekly-email",checked:l.enabled,disabled:m.isPending||!l.enabled&&!c,onCheckedChange:u=>m.mutate(u)})]}),e.jsxs("div",{className:"research-email-destination",children:[e.jsx(ue,{"aria-hidden":"true"}),l.email?e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:["Sending to ",e.jsx("strong",{children:l.email})]}),e.jsx("a",{href:le("/settings",!1,!0),children:"Refresh from Hugging Face"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"To opt in, allow access to the verified email on your Hugging Face account."}),e.jsx(w,{returnTo:"/settings",collectEmail:!0,label:"Allow email access"})]})]}),l.suppressed&&e.jsx("p",{className:"research-email-status is-warning",role:"status",children:"Delivery to this address is paused after a bounce or spam complaint."}),!l.delivery_ready&&e.jsx("p",{className:"research-email-status",role:"status",children:"Weekly emails have not launched yet. Your preference is saved and applies from launch."}),m.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your preference. Refresh your email from Hugging Face and try again."})]})]})]})}const Se="https://openrouter.ai/settings/keys";function Oe(s,r){if(s instanceof ee){if(typeof s.detail=="string")return s.detail;if(typeof s.detail=="object"&&s.detail!==null&&"message"in s.detail&&typeof s.detail.message=="string")return s.detail.message}return s instanceof Error&&!s.message.startsWith("API request failed:")?s.message:r}const Ke=()=>{var X;const{user:s,isLoading:r}=B(),{preferences:o,setHideClosedSourceEvals:j,canPersist:f,isLoading:m}=oe(),{theme:b,setTheme:l}=ce(),c=b??"system",a=de(),[u,p]=k.useState(""),[t,i]=k.useState(""),[$,F]=k.useState(""),[C,K]=k.useState(""),_=Y(),R=P({queryKey:["chat","models","settings"],enabled:a&&!!s,queryFn:()=>v.getModels()}),I=new Set((((X=R.data)==null?void 0:X.items)??[]).map(n=>n.provider)),A=I.has("huggingface"),E=I.has("openrouter"),ne=I.has("openai"),S=P({queryKey:["inference-billing",s==null?void 0:s.hf_subject],enabled:a&&!!s&&A,queryFn:()=>v.getInferenceBilling()}),g=S.data??null,L=ye(a&&!!s&&E),z=fe(a&&!!s&&E),d=L.data,x=z.data,h=d?ve(d.resets_at):null,ae=a&&!!s&&(R.isLoading||!R.isError&&(A&&S.isLoading||E&&(L.isLoading||z.isLoading))),te=r||m||b===void 0||ae,W=N({mutationFn:n=>v.selectInferenceBillingAccount(n),onSuccess:n=>{_.setQueryData(["inference-billing",s==null?void 0:s.hf_subject],n),p("")},onError:n=>{p(n instanceof Error?n.message:"Could not change the billing account.")}}),ie=S.isLoading||W.isPending,M=(n,T)=>{i(Oe(n,T)),F(n instanceof ee?n.code??"":"")},q=N({mutationFn:n=>v.connectOpenRouterCredential(n),onSuccess:n=>{_.setQueryData(D,n),K(""),i(""),F("")},onError:n=>M(n,"Could not connect the OpenRouter key.")}),V=N({mutationFn:n=>v.setOpenRouterFallback(n),onSuccess:n=>{_.setQueryData(D,n),i(""),F("")},onError:n=>M(n,"Could not change paid fallback.")}),G=N({mutationFn:()=>v.disconnectOpenRouterCredential(),onSuccess:()=>{_.setQueryData(D,{connected:!1,verified_at:null,fallback_enabled:!1}),i(""),F("")},onError:n=>M(n,"Could not disconnect the OpenRouter key.")});return k.useEffect(()=>(document.title=je("Settings"),()=>{document.title=be}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Manage what you follow, your weekly email, and how papers are displayed."})]})}),te?e.jsx("div",{className:"settings-page-loading",role:"status","aria-live":"polite",children:e.jsx("span",{className:"sr-only",children:"Loading settings…"})}):e.jsxs("div",{className:"settings-page-content",children:[e.jsx(Ee,{}),s&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:s.role??"community member"}),"."," ",s.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",s.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),a&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),s?R.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Could not load the enabled chat providers."}):e.jsxs("div",{className:"settings-provider-grid",children:[A&&e.jsxs("section",{className:"settings-provider-card","aria-labelledby":"inference-providers-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"inference-providers-heading",children:"Inference Providers"}),e.jsx("p",{children:"Hugging Face-billed model usage"})]}),(g==null?void 0:g.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),S.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Hugging Face billing is currently unavailable."}):g!=null&&g.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:g.bill_to?`Organization · ${g.bill_to}`:`Personal account · @${s.username}`}),e.jsx("p",{className:"settings-row-desc",children:"Usage for Hugging Face Inference Providers is billed by Hugging Face to your selected account. Included Hugging Face usage is applied first; pay-as-you-go billing follows your Hugging Face plan and billing settings. Papers With Code does not fund, meter, or reset these credits."}),e.jsx("label",{className:"settings-token-label",htmlFor:"hf-billing-account",children:"Bill chat usage to"}),e.jsxs("select",{id:"hf-billing-account",className:"settings-billing-select",value:g.bill_to??"",onChange:n=>{p(""),W.mutate(n.target.value||null)},disabled:ie,children:[e.jsxs("option",{value:"",children:["Personal account (@",s.username,")"]}),g.organizations.map(n=>e.jsxs("option",{value:n.name,children:[n.display_name," (",n.name,")"]},n.name))]}),u&&e.jsx("div",{className:"settings-token-error",children:u}),e.jsx("div",{className:"settings-billing-actions",children:e.jsxs("a",{className:"button button-primary",href:g.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(Z,{"aria-hidden":"true"})]})})]}):e.jsxs("div",{className:"settings-billing-connect",children:[e.jsx("p",{className:"settings-row-desc",children:"Reconnect with Hugging Face to authorize Inference Providers. Hugging Face bills your personal account or the organization you select."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx(w,{returnTo:"/settings",label:"Re-sign in with Hugging Face",authorizeInference:!0})})]})]}),E&&e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(x==null?void 0:x.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),d?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",h==null?void 0:h.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",h==null?void 0:h.utc,")"]})]})]}),e.jsx("strong",{children:d.available?`${d.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${d.remaining_percent}% remaining; resets ${h==null?void 0:h.local}; ${h==null?void 0:h.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":d.remaining_percent,children:e.jsx("span",{style:{width:`${d.remaining_percent}%`}})}),!d.available&&e.jsxs("p",{className:"settings-limit-note",children:[d.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${d.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:L.isError||d?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),x!=null&&x.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",x.verified_at?` · Last verified ${new Date(x.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(U,{checked:x.fallback_enabled,disabled:V.isPending,onCheckedChange:n=>V.mutate(!!n)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:G.isPending,onClick:()=>G.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:Se,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(Z,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:n=>{n.preventDefault(),C.trim()&&q.mutate(C.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:C,onChange:n=>K(n.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!C.trim()||q.isPending,children:q.isPending?"Verifying…":"Connect key"})})]}),t&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:$==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":t}),$==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(w,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]}),ne&&e.jsx("div",{className:"settings-note settings-note-flush",role:"note",children:"Direct OpenAI usage is provided by Papers With Code. No OpenAI API key or billing account is required from you."})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to manage billing and credentials for the enabled chat providers."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(w,{returnTo:"/settings",authorizeInference:!0})})]})]}),a&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 500 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:Ne},{value:"light",label:"Light",description:"Always use light mode",icon:ke},{value:"dark",label:"Dark",description:"Always use dark mode",icon:we}].map(n=>{const T=n.icon,J=c===n.value;return e.jsxs("button",{type:"button",className:`theme-option ${J?"is-selected":""}`,"aria-pressed":J,onClick:()=>l(n.value),children:[e.jsx(T,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:n.label}),e.jsx("span",{className:"theme-option-desc",children:n.description})]})]},n.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(U,{id:"hide-closed-source-evals",checked:o.hide_closed_source_evals,onCheckedChange:n=>{j(!!n)}})]}),!r&&!f&&!s&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(w,{returnTo:"/settings"})})]})]})]})]})};export{Ke as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/SharedChatView-CDcAKAKv.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as f,b as x,r as h,j as e,f as g}from"./index-DuJU_D27.js";import{u as v}from"./useQuery-BvOlbTZD.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-k9u84oat.js";import{C as m,d as w,p as N,q as C,g as q}from"./chatLaunch-DD_4HSkV.js";/* empty css */import"./hover-card-DfwM1bh1.js";import"./github-Ct0GY3Xc.js";import"./github-B26APZSL.js";import"./catalog-BDn3ESav.js";import"./PaperPreviewLink-Bvcg4CvY.js";import"./index-BOvg3c6G.js";import"./index-DwysRPUB.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-Zi3ALD1n.js";import"./useMutation-BAvuTKgd.js";import"./chat-6kLnoZFH.js";import"./copy-dcyyhyIJ.js";import"./file-text-DhueCFXV.js";import"./external-link-DWe5qf4F.js";import"./chevron-down-B9CqRc2D.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},D=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):t.isError||!t.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),l&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{D as default};
|
|
|
|
|
|
assets/SharedChatView-YirSvkfJ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as f,b as x,r as h,j as e,f as g}from"./index-DAAEdKQ4.js";import{u as v}from"./useQuery-BALok3Po.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-CFTBDPD0.js";import{C as m,d as w,p as N,q as C,g as q}from"./chatLaunch-D9EyZxQg.js";/* empty css */import"./hover-card-DUYUZUhh.js";import"./github-Dhzztpor.js";import"./github-BDSbRkJU.js";import"./catalog-Cjgxq75q.js";import"./PaperPreviewLink-n9bIC1vy.js";import"./index-D6KYmf_u.js";import"./index-UMJO-v2N.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-DL8dzFlM.js";import"./useMutation-D4cqMKzD.js";import"./chat-BFojJrU9.js";import"./copy-D_GFD6J1.js";import"./thumbs-up-DRuoA93Q.js";import"./file-text-CflXb8l5.js";import"./external-link-n_se8QIW.js";import"./chevron-down-D8dAesMf.js";import"./earth-C2xqFcX3.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},X=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):t.isError||!t.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),l&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{X as default};
|