diff --git a/assets/AgentLogos-DhD8p5ds.js b/assets/AgentLogos-BBl9UNVD.js similarity index 99% rename from assets/AgentLogos-DhD8p5ds.js rename to assets/AgentLogos-BBl9UNVD.js index 916c8e71876782be0f2ca13114fdf4f91c25b1be..08fcbca3ea64b65ff90dfe39f3c42c0968d79722 100644 --- a/assets/AgentLogos-DhD8p5ds.js +++ b/assets/AgentLogos-BBl9UNVD.js @@ -1 +1 @@ -import{j as e}from"./index-YwiKC6Po.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}; +import{j as e}from"./index-CbgxfyGU.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}; diff --git a/assets/AiDeadlinesView-BWqSvLms.js b/assets/AiDeadlinesView-BhXjtcbF.js similarity index 96% rename from assets/AiDeadlinesView-BWqSvLms.js rename to assets/AiDeadlinesView-BhXjtcbF.js index 731e0d63e3b0e901bee59bf8ec943bfc278bc232..2b0309900eb1acce8dd883729bc6dede6d552323 100644 --- a/assets/AiDeadlinesView-BWqSvLms.js +++ b/assets/AiDeadlinesView-BhXjtcbF.js @@ -1,3 +1,3 @@ -import{r as g,j as t}from"./index-YwiKC6Po.js";import{u as R}from"./useQuery-DPH6Mb2w.js";import{c as A}from"./catalog-B15Yh5dN.js";import{S as L}from"./switch-Crqp0RkL.js";import{S as B}from"./skeleton-CXR1qouH.js";import{A as W,a as U}from"./alert-Cx5luC5D.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{D as M,a as O,c as V,b as P,d as G}from"./dialog-foxx0Wu6.js";import{s as H,n as S,f as _,p as K,u as N,l as k,a as I,c as b,D as Y,b as E,d as q}from"./deadlines-BH32v7D1.js";import"./index-BaDZKp6X.js";const w={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Q=(e,l)=>{const s=Math.ceil((e-l)/Y);return s<=0?"passed":`${s} ${s===1?"day":"days"}`},F=(e,l)=>{const s=_(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${l.label||l.type||"Deadline"} for ${e.name}`,s?`Dates: ${s}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` +import{r as g,j as t}from"./index-CbgxfyGU.js";import{u as R}from"./useQuery-Bx9s5-D2.js";import{c as A}from"./catalog-DhK7_9-6.js";import{S as L}from"./switch-BSZohE4x.js";import{S as B}from"./skeleton-HwvdxvSN.js";import{A as W,a as U}from"./alert-CFDDvdIM.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{D as M,a as O,c as V,b as P,d as G}from"./dialog-Cfp_d3CC.js";import{s as H,n as S,f as _,p as K,u as N,l as k,a as I,c as b,D as Y,b as E,d as q}from"./deadlines-BH32v7D1.js";import"./index-CxPKwmVQ.js";const w={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Q=(e,l)=>{const s=Math.ceil((e-l)/Y);return s<=0?"passed":`${s} ${s===1?"day":"days"}`},F=(e,l)=>{const s=_(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${l.label||l.type||"Deadline"} for ${e.name}`,s?`Dates: ${s}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),J=(e,l)=>{const s=new Date(l.deadline_at),r=new Date(s.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${l.label||l.type||"deadline"}`,h=e.venue||[e.city,e.country].filter(Boolean).join(", "),n=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(s)}/${C(r)}&details=${encodeURIComponent(F(e,l))}&location=${encodeURIComponent(h)}`,p=$(n);p&&window.open(p,"_blank","noopener,noreferrer")},X=(e,l)=>{const s=new Date(l.deadline_at),r=new Date(s.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${l.label||l.type||"deadline"}`,h=e.venue||[e.city,e.country].filter(Boolean).join(", "),n=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(s)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${F(e,l).replace(/\n/g,"\\n")}`,h?`LOCATION:${h}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(` `),p=new Blob([n],{type:"text/calendar;charset=utf-8"}),d=document.createElement("a");d.href=URL.createObjectURL(p),d.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(d.href)},Z=({conf:e,open:l,onOpenChange:s})=>{const[r,o]=g.useState(()=>Date.now());g.useEffect(()=>{if(!l)return;o(Date.now());const i=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(i)},[l]);const h=g.useMemo(()=>e?H(e):[],[e]),n=g.useMemo(()=>e?S(e,r):null,[e,r]),p=e?_(e.start_date,e.end_date):null,d=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,m=n?new Date(n.deadline_at).getTime():null;return t.jsx(M,{open:l,onOpenChange:s,children:t.jsx(O,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(V,{children:[t.jsx(P,{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(G,{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:[p&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:w,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:p})]}),d&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:w,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:d})]})]}),m!=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:w,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:N(m,r)},children:K(m,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:w,children:"Important deadlines"}),h.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):h.map((i,c)=>{const y=new Date(i.deadline_at).getTime(),a=n!=null&&i.deadline_at===n.deadline_at&&i.type===n.type,u=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:a?"var(--accent-soft)":"transparent",border:a?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!a?.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:a?600:400},children:[i.label||k(i.type||"deadline"),a&&t.jsx("span",{style:{...w,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[I(i.deadline_at),i.timezone?` · ${i.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:N(u?null:y,r)},children:Q(y,r)})]},`${i.type??"deadline"}-${c}`)})]}),b(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:b(e).map(i=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(i)},i))}),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:$(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),n&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>J(e,n),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>X(e,n),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},z=({id:e,label:l,checked:s,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(L,{id:e,checked:s,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:l})]}),ee=({conf:e,now:l,selectedDomains:s,onToggleDomain:r,onOpen:o})=>{const h=S(e,l),n=h??E(e),p=n?new Date(n.deadline_at).getTime():null,d=N(h?p:null,l),m=_(e.start_date,e.end_date),i=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.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:$(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:c=>c.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:(n==null?void 0:n.label)||(n==null?void 0:n.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:n?`${I(n.deadline_at)}${n.timezone?` · ${n.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:d,whiteSpace:"nowrap"},children:p!=null?q(p,l):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[m&&t.jsx("span",{children:m}),i&&t.jsx("span",{children:i})]}),b(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:b(e).map(c=>{const y=s.has(c);return t.jsx("button",{className:"tag-chip",onClick:a=>{a.stopPropagation(),r(c)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(c)},c)})})]})},pe=()=>{const[e,l]=g.useState(!0),[s,r]=g.useState(!1),[o,h]=g.useState(new Set),[n,p]=g.useState(null),d=g.useMemo(()=>Date.now(),[]),m=R({queryKey:["conference-deadlines"],queryFn:()=>A.conferenceDeadlines(),staleTime:10*60*1e3}),i=a=>{h(u=>{const x=new Set(u);return x.has(a)?x.delete(a):x.add(a),x})},c=g.useMemo(()=>{var u;const a=new Map;return(u=m.data)==null||u.results.forEach(x=>{b(x).forEach(j=>a.set(j,(a.get(j)??0)+1))}),Array.from(a.entries()).sort((x,j)=>j[1]-x[1]).map(([x])=>x)},[m.data]),y=g.useMemo(()=>{var j;const u=(((j=m.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!b(f).some(v=>o.has(v))||!s&&!S(f,d))),x=f=>{const D=S(f,d);if(D)return{group:0,time:new Date(D.deadline_at).getTime()};const v=E(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,D)=>{const v=x(f),T=x(D);return v.group!==T.group?v.group-T.group:v.time-T.time})},[m.data,e,s,o,d]);return m.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(U,{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(z,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:l}),t.jsx(z,{id:"show-past",label:"Show past conferences",checked:s,onChange:r})]}),c.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[c.map(a=>{const u=o.has(a);return t.jsx("button",{className:"tag-chip",onClick:()=>i(a),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(a)},a)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>h(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:m.isLoading?"…":`${y.length} conferences`})}),m.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((a,u)=>t.jsx(B,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",s?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(a=>t.jsx(ee,{conf:a,now:d,selectedDomains:o,onToggleDomain:i,onOpen:p},a.id))}),t.jsx(Z,{conf:n,open:n!==null,onOpenChange:a=>{a||p(null)}})]})};export{pe as default}; diff --git a/assets/ApiDocsView-Bb326kAF.js b/assets/ApiDocsView-hjoHKqpf.js similarity index 98% rename from assets/ApiDocsView-Bb326kAF.js rename to assets/ApiDocsView-hjoHKqpf.js index a8986acd81e6c933b3e47feaf6fef779ba52e9f4..9dc09cf59e1b496eb783915f9fee75ce2adb0016 100644 --- a/assets/ApiDocsView-Bb326kAF.js +++ b/assets/ApiDocsView-hjoHKqpf.js @@ -1,4 +1,4 @@ -import{a5 as m,r as o,j as e}from"./index-YwiKC6Po.js";import{u as f}from"./useQuery-DPH6Mb2w.js";import{M as g}from"./index-CoRCN2p0.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 +import{a6 as m,r as o,j as e}from"./index-CbgxfyGU.js";import{u as f}from"./useQuery-Bx9s5-D2.js";import{M as g}from"./index-ZkEATkOr.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 response = requests.get(${JSON.stringify(s)}, timeout=30) response.raise_for_status() diff --git a/assets/AreaSection-CfCNkiTd.js b/assets/AreaSection-NWvfO4Sb.js similarity index 88% rename from assets/AreaSection-CfCNkiTd.js rename to assets/AreaSection-NWvfO4Sb.js index a6cdaab15e1077351f85a6de76dcb4e973a66b04..ef4caf1c5902ae9a8cf7cba0455c80491410790f 100644 --- a/assets/AreaSection-CfCNkiTd.js +++ b/assets/AreaSection-NWvfO4Sb.js @@ -1 +1 @@ -import{j as s}from"./index-YwiKC6Po.js";import{S as l}from"./skeleton-CXR1qouH.js";const m=({id:t,title:a,description:e,meta:r,style:c,children:i})=>s.jsxs("section",{id:t,className:"area-section",style:c,children:[s.jsxs("div",{className:"area-section-head",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"area-section-title",children:a}),e&&s.jsx("div",{className:"area-section-description",children:e})]}),s.jsx("div",{className:"area-section-meta",children:r})]}),s.jsx("div",{className:"tag-grid",children:i})]}),h=({sections:t=4,tiles:a,tileClassName:e})=>s.jsx("div",{className:"area-directory-skeleton",children:Array.from({length:t}).map((r,c)=>s.jsxs("div",{children:[s.jsx(l,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:a}).map((i,n)=>s.jsx(l,{className:e},n))})]},c))}),x=({areas:t})=>{const a=t.filter(r=>r.tasks.length>0),e=a.reduce((r,c)=>r+c.tasks.length,0);return e===0?null:s.jsxs("div",{className:"area-directory-footer",children:[e," tasks across ",a.length," areas."]})};export{h as A,m as a,x as b}; +import{j as s}from"./index-CbgxfyGU.js";import{S as l}from"./skeleton-HwvdxvSN.js";const m=({id:t,title:a,description:e,meta:r,style:c,children:i})=>s.jsxs("section",{id:t,className:"area-section",style:c,children:[s.jsxs("div",{className:"area-section-head",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"area-section-title",children:a}),e&&s.jsx("div",{className:"area-section-description",children:e})]}),s.jsx("div",{className:"area-section-meta",children:r})]}),s.jsx("div",{className:"tag-grid",children:i})]}),h=({sections:t=4,tiles:a,tileClassName:e})=>s.jsx("div",{className:"area-directory-skeleton",children:Array.from({length:t}).map((r,c)=>s.jsxs("div",{children:[s.jsx(l,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:a}).map((i,n)=>s.jsx(l,{className:e},n))})]},c))}),x=({areas:t})=>{const a=t.filter(r=>r.tasks.length>0),e=a.reduce((r,c)=>r+c.tasks.length,0);return e===0?null:s.jsxs("div",{className:"area-directory-footer",children:[e," tasks across ",a.length," areas."]})};export{h as A,m as a,x as b}; diff --git a/assets/ArtifactWorkspace-BxDA6yNF.js b/assets/ArtifactWorkspace-Cwix1Wp6.js similarity index 99% rename from assets/ArtifactWorkspace-BxDA6yNF.js rename to assets/ArtifactWorkspace-Cwix1Wp6.js index 7be0ca560ef22d5dcf4aa3094e837e10a2ad2af0..0726f72a6e3e8fb5744316124b60aff17453f7ce 100644 --- a/assets/ArtifactWorkspace-BxDA6yNF.js +++ b/assets/ArtifactWorkspace-Cwix1Wp6.js @@ -1,4 +1,4 @@ -var TL=Object.defineProperty;var yA=n=>{throw TypeError(n)};var PL=(n,e,t)=>e in n?TL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var oe=(n,e,t)=>PL(n,typeof e!="symbol"?e+"":e,t),av=(n,e,t)=>e.has(n)||yA("Cannot "+t);var f=(n,e,t)=>(av(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?yA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),$=(n,e,t,s)=>(av(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),P=(n,e,t)=>(av(n,e,"access private method"),t);var hs=(n,e,t,s)=>({set _(i){$(n,e,i,t)},get _(){return f(n,e,s)}});import{n as Mo,r as q,j as S,K as ee,_ as eS,$ as rn,a0 as gm,a1 as l0,L as Nd,a2 as RL,X as c0,a3 as ML,f as ZC,C as IL}from"./index-YwiKC6Po.js";import{u as XC,a as OL,c as NL,P as YC,i as LL,b as JC,e as tS,A as DL,v as jL,Z as FL,_ as zL,$ as HL,a0 as QC,a1 as BL}from"./chatSessions-CdNQ1toA.js";/* empty css */import{H as Np,a as Lp,b as Dp}from"./hover-card-BY9tUGxy.js";import{u as wo}from"./useQuery-DPH6Mb2w.js";import{f as UL,i as e$,p as qL,C as VL,a as WL,T as GL}from"./CatalogEntityPreviewLink-Cv_oezOz.js";import{G as h0}from"./github-BZMCt7Ub.js";import{F as t$}from"./file-text-Cijxx2XD.js";import{r as KL,a as ZL,P as u0,c as XL}from"./PaperPreviewLink-CKfmgBjs.js";import{M as YL,d as JL}from"./index-CoRCN2p0.js";import{r as QL}from"./index-BM_xSDJM.js";import{c as vA}from"./chat-DHGOonJg.js";import{C as eD}from"./copy-YHg6twss.js";import{T as tD}from"./thumbs-up-D9G2aLNB.js";import{u as ym}from"./useMutation-f6iDkf3w.js";import{A as nD}from"./arrow-left-B08fyfNi.js";import{E as n$}from"./external-link-4bBJT0yO.js";import{P as sD}from"./plus-Cfz0QbT1.js";import{S as iD}from"./search-wcEXdf1i.js";import{C as s$,a as i$}from"./chevron-up-BXtxbTfV.js";import{A as rD}from"./AuthorAvatar-CoTET6B3.js";import{a as oD}from"./paperQueryKeys-C5FMa4Oj.js";/** +var TL=Object.defineProperty;var yA=n=>{throw TypeError(n)};var PL=(n,e,t)=>e in n?TL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var oe=(n,e,t)=>PL(n,typeof e!="symbol"?e+"":e,t),av=(n,e,t)=>e.has(n)||yA("Cannot "+t);var f=(n,e,t)=>(av(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?yA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),$=(n,e,t,s)=>(av(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),P=(n,e,t)=>(av(n,e,"access private method"),t);var hs=(n,e,t,s)=>({set _(i){$(n,e,i,t)},get _(){return f(n,e,s)}});import{n as Mo,r as q,j as S,M as ee,$ as eS,a0 as rn,a1 as gm,a2 as l0,L as Nd,a3 as RL,X as c0,a4 as ML,f as ZC,C as IL}from"./index-CbgxfyGU.js";import{u as XC,a as OL,c as NL,P as YC,i as LL,b as JC,e as tS,A as DL,v as jL,Z as FL,_ as zL,$ as HL,a0 as QC,a1 as BL}from"./chatSessions-DwLUbLRo.js";/* empty css */import{H as Np,a as Lp,b as Dp}from"./hover-card-ufez2uMo.js";import{u as wo}from"./useQuery-Bx9s5-D2.js";import{f as UL,i as e$,p as qL,C as VL,a as WL,T as GL}from"./CatalogEntityPreviewLink-Cvehtzvn.js";import{G as h0}from"./github-BYklgHDz.js";import{F as t$}from"./file-text-BK_7Q2rV.js";import{r as KL,a as ZL,P as u0,c as XL}from"./PaperPreviewLink-DZDNIh1g.js";import{M as YL,d as JL}from"./index-ZkEATkOr.js";import{r as QL}from"./index-BH3yOoza.js";import{c as vA}from"./chat-DzTo2WUO.js";import{C as eD}from"./copy-bzw7JVus.js";import{T as tD}from"./thumbs-up-CDCzGuPd.js";import{u as ym}from"./useMutation-P_trTy9i.js";import{A as nD}from"./arrow-left-Czeu3VzJ.js";import{E as n$}from"./external-link-DZIH4GGr.js";import{P as sD}from"./plus-UK0TEjgd.js";import{S as iD}from"./search-CLtAJGOp.js";import{C as s$,a as i$}from"./chevron-up-Cpt5JLeI.js";import{A as rD}from"./AuthorAvatar-CUJMmp_z.js";import{a as oD}from"./paperQueryKeys-B8u1BWlI.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/AstraForRoboticsView-CqbM4y2W.js b/assets/AstraForRoboticsView-pQ4cp5_V.js similarity index 89% rename from assets/AstraForRoboticsView-CqbM4y2W.js rename to assets/AstraForRoboticsView-pQ4cp5_V.js index aca0138d6444af12d56ecf088dfcec05eafe8d69..e43cf048a9c8c4af47d1324ac0eae2ed004ccfbb 100644 --- a/assets/AstraForRoboticsView-CqbM4y2W.js +++ b/assets/AstraForRoboticsView-pQ4cp5_V.js @@ -1 +1 @@ -import{r as h,j as a,L as o}from"./index-YwiKC6Po.js";import{u,b as g,a as x}from"./PaperFeed-kaLm5US2.js";import{A as f,a as b}from"./alert-Cx5luC5D.js";import{u as j}from"./usePapers-C1deOZKl.js";import{p as y,a as v}from"./paperQueryKeys-C5FMa4Oj.js";import{f as k,D as w}from"./latexPlainText-DI8YEXVe.js";import{t as A}from"./transform-CNg3rvXk.js";import"./PaperCard-FG-bEpJk.js";import"./AuthorAvatar-CoTET6B3.js";import"./SotaBadges-DiQuEzfo.js";import"./colors-BkWRhvFI.js";import"./Icon-DXQ4sjQk.js";import"./LatexTitle-DI6voLfI.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D7ygxg37.js";import"./skeleton-CXR1qouH.js";import"./useIntersectionObserver-Dt36kyjs.js";import"./useQuery-DPH6Mb2w.js";import"./useInfiniteQuery-BEbL80ez.js";import"./curation-CkzNFTMJ.js";const n="robotics",i="gpt-6-astra",_="https://x.com/YuXiang_IRVL/status/2100395131924840570",P=[{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"}],R=[{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"}],m=({posts:s,label:e})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:e}),a.jsx("ul",{children:s.map(t=>a.jsxs("li",{children:[a.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",children:["@",t.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",t.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",t.summary]})]},t.url))})]}),J=()=>{var l,c;const s=u(),e=j([...y.feeds.infinite,{task:n,method:i,...s.filters}],r=>v.list({...s.filters,task:n,method:i,page:r,page_size:12}));h.useEffect(()=>(document.title=k("GPT-6 Astra for Robotics"),()=>{document.title=w}),[]);const t=h.useMemo(()=>{var r;return(((r=e.data)==null?void 0:r.pages)??[]).flatMap(p=>p.results.map(A))},[e.data]),d=((c=(l=e.data)==null?void 0:l.pages[0])==null?void 0:c.count)??0;return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(o,{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:_,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(m,{posts:P,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(m,{posts:R,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(o,{to:`/tasks/${n}`,children:"Robotics"})," task and the"," ",a.jsx(o,{to:`/methods/${i}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(o,{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:["[",d.toLocaleString(),"]"]})]})]}),a.jsx(g,{feed:s,showDateFilter:!1}),e.error?a.jsx(f,{variant:"destructive",children:a.jsx(b,{children:"Failed to load the collection. Please try again."})}):a.jsx(x,{query:e,cards:t,empty:"No papers match this selection yet."})]})};export{J as default}; +import{r as h,j as a,L as o}from"./index-CbgxfyGU.js";import{u,b as g,a as x}from"./PaperFeed-DMvUfA47.js";import{A as f,a as b}from"./alert-CFDDvdIM.js";import{u as j}from"./usePapers-CJaWLZ3y.js";import{p as y,a as v}from"./paperQueryKeys-B8u1BWlI.js";import{f as k,D as w}from"./latexPlainText-DI8YEXVe.js";import{t as A}from"./transform-0Udg2p6b.js";import"./PaperCard-tdTC_dRN.js";import"./AuthorAvatar-CUJMmp_z.js";import"./SotaBadges-C-sTR-EF.js";import"./colors-BkWRhvFI.js";import"./Icon-D-kA0Owz.js";import"./LatexTitle-Z-HGmZ-H.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DKJYnYjk.js";import"./skeleton-HwvdxvSN.js";import"./useIntersectionObserver-CID9Kkak.js";import"./useQuery-Bx9s5-D2.js";import"./useInfiniteQuery-BAc_4HO5.js";import"./curation-C7Gmmp4z.js";const n="robotics",i="gpt-6-astra",_="https://x.com/YuXiang_IRVL/status/2100395131924840570",P=[{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"}],R=[{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"}],m=({posts:s,label:e})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:e}),a.jsx("ul",{children:s.map(t=>a.jsxs("li",{children:[a.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",children:["@",t.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",t.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",t.summary]})]},t.url))})]}),J=()=>{var l,c;const s=u(),e=j([...y.feeds.infinite,{task:n,method:i,...s.filters}],r=>v.list({...s.filters,task:n,method:i,page:r,page_size:12}));h.useEffect(()=>(document.title=k("GPT-6 Astra for Robotics"),()=>{document.title=w}),[]);const t=h.useMemo(()=>{var r;return(((r=e.data)==null?void 0:r.pages)??[]).flatMap(p=>p.results.map(A))},[e.data]),d=((c=(l=e.data)==null?void 0:l.pages[0])==null?void 0:c.count)??0;return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(o,{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:_,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(m,{posts:P,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(m,{posts:R,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(o,{to:`/tasks/${n}`,children:"Robotics"})," task and the"," ",a.jsx(o,{to:`/methods/${i}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(o,{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:["[",d.toLocaleString(),"]"]})]})]}),a.jsx(g,{feed:s,showDateFilter:!1}),e.error?a.jsx(f,{variant:"destructive",children:a.jsx(b,{children:"Failed to load the collection. Please try again."})}):a.jsx(x,{query:e,cards:t,empty:"No papers match this selection yet."})]})};export{J as default}; diff --git a/assets/AuthorAvatar-CoTET6B3.js b/assets/AuthorAvatar-CUJMmp_z.js similarity index 86% rename from assets/AuthorAvatar-CoTET6B3.js rename to assets/AuthorAvatar-CUJMmp_z.js index 76e60178bda8b356fbe1cfe884e7e3fbcaf4f82c..a71255e1cdf6aea201a6f74be436ede4272d4d36 100644 --- a/assets/AuthorAvatar-CoTET6B3.js +++ b/assets/AuthorAvatar-CUJMmp_z.js @@ -1 +1 @@ -import{r as c,j as e}from"./index-YwiKC6Po.js";const p=a=>a!=null&&a.startsWith("https://")&&!a.startsWith("https://huggingface.co/avatars/")?a:null,h=({url:a,className:o,href:t,label:n})=>{const[i,l]=c.useState(!1),s=i?null:p(a);if(!s)return null;const r=e.jsx("img",{className:`author-avatar-base ${o}`,src:s,alt:"",loading:"lazy",onError:()=>l(!0)});return t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:r}):r};export{h as A}; +import{r as c,j as e}from"./index-CbgxfyGU.js";const p=a=>a!=null&&a.startsWith("https://")&&!a.startsWith("https://huggingface.co/avatars/")?a:null,h=({url:a,className:o,href:t,label:n})=>{const[i,l]=c.useState(!1),s=i?null:p(a);if(!s)return null;const r=e.jsx("img",{className:`author-avatar-base ${o}`,src:s,alt:"",loading:"lazy",onError:()=>l(!0)});return t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:r}):r};export{h as A}; diff --git a/assets/AuthorDetailView-ETu8URv_.js b/assets/AuthorDetailView-BpcSKHs1.js similarity index 75% rename from assets/AuthorDetailView-ETu8URv_.js rename to assets/AuthorDetailView-BpcSKHs1.js index 19e6d5a1a93a5f260e04e042fd207ac7ecce25ce..60e8604602f037c36bee2f91d9e19c8fa7a25a9a 100644 --- a/assets/AuthorDetailView-ETu8URv_.js +++ b/assets/AuthorDetailView-BpcSKHs1.js @@ -1 +1 @@ -import{u as b,j as a,r as N,ah as v,L as F}from"./index-YwiKC6Po.js";import{u as y}from"./useQuery-DPH6Mb2w.js";import{A}from"./AuthorAvatar-CoTET6B3.js";import{u as k,b as P,a as $}from"./PaperFeed-kaLm5US2.js";import{R as S}from"./ResearchFollowButton-BFXC8E3t.js";import{A as L,a as R}from"./alert-Cx5luC5D.js";import{S as w}from"./skeleton-CXR1qouH.js";import{u as z}from"./usePapers-C1deOZKl.js";import{p as C,a as m}from"./paperQueryKeys-C5FMa4Oj.js";import{i as H}from"./apiErrors-DBfE_SVR.js";import{t as q}from"./transform-CNg3rvXk.js";import f from"./NotFound-D8hwuoEl.js";import"./PaperCard-FG-bEpJk.js";import"./SotaBadges-DiQuEzfo.js";import"./colors-BkWRhvFI.js";import"./Icon-DXQ4sjQk.js";import"./LatexTitle-DI6voLfI.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D7ygxg37.js";import"./useIntersectionObserver-Dt36kyjs.js";import"./useMutation-f6iDkf3w.js";import"./research-5UpiU-ea.js";import"./plus-Cfz0QbT1.js";import"./useInfiniteQuery-BEbL80ez.js";import"./curation-CkzNFTMJ.js";const Q=({authorId:r})=>{var n,i,l,p,c,d,h,u;const o=k(),{searchParams:g}=o,e=y({queryKey:["author",r],queryFn:()=>m.getAuthor(r)}),s=z([...C.feeds.infinite,{author:r,...o.filters}],t=>m.list({...o.filters,author:r,page:t,page_size:12})),x=N.useMemo(()=>{var t;return(((t=s.data)==null?void 0:t.pages)??[]).flatMap(_=>_.results.map(q))},[s.data]),j=((i=(n=s.data)==null?void 0:n.pages[0])==null?void 0:i.count)??0;if(H(e.error))return a.jsx(f,{});if((l=e.data)!=null&&l.organization_slug){const t=g.toString();return a.jsx(v,{to:`/orgs/${e.data.organization_slug}${t?`?${t}`:""}`,replace:!0})}return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(F,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"Authors"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:((p=e.data)==null?void 0:p.full_name)??r})]}),a.jsxs("header",{className:"author-hero",children:[a.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),a.jsxs("div",{className:"author-hero-title",children:[(c=e.data)!=null&&c.photo?a.jsxs("figure",{className:"author-photo",children:[a.jsx("img",{className:"author-avatar-base author-avatar",src:e.data.photo.url,alt:""}),a.jsxs("figcaption",{children:["Photo:"," ",a.jsx("a",{href:e.data.photo.source_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.credit}),", ",e.data.photo.license_url?a.jsx("a",{href:e.data.photo.license_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.license}):e.data.photo.license]})]}):((d=e.data)==null?void 0:d.hf_username)&&a.jsx(A,{className:"author-avatar",url:e.data.hf_avatar_url,href:`https://huggingface.co/${e.data.hf_username}`,label:`@${e.data.hf_username} on Hugging Face`}),a.jsx("h1",{className:"feed-title",children:((h=e.data)==null?void 0:h.full_name)??a.jsx(w,{className:"h-12 w-64 inline-block"})})]}),e.data&&a.jsxs("div",{className:"feed-subtitle",children:[e.data.paper_count.toLocaleString()," ",e.data.paper_count===1?"paper":"papers",e.data.hf_username&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("a",{href:`https://huggingface.co/${e.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",e.data.hf_username," on Hugging Face ↗"]})]}),e.data.google_scholar_id&&a.jsxs(a.Fragment,{children:[" · ",a.jsx("a",{href:`https://scholar.google.com/citations?user=${encodeURIComponent(e.data.google_scholar_id)}`,target:"_blank",rel:"noopener noreferrer",children:"Google Scholar ↗"})]})]}),e.data&&a.jsx(S,{kind:"author",entityId:e.data.id})]}),a.jsx(P,{feed:o,style:{alignItems:"center",gap:16},children:a.jsxs("div",{className:"results-count",children:[j.toLocaleString()," papers"]})}),s.error?a.jsx(L,{variant:"destructive",children:a.jsxs(R,{children:["Failed to load papers."," ",a.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]})}):a.jsx($,{query:s,cards:x,empty:((u=e.data)==null?void 0:u.paper_count)===0?"No public papers are available.":"No papers found for this selection."})]})},pa=()=>{const{authorId:r}=b();return r?a.jsx(Q,{authorId:r},r):a.jsx(f,{})};export{pa as default}; +import{u as b,j as a,r as N,ai as v,L as F}from"./index-CbgxfyGU.js";import{u as y}from"./useQuery-Bx9s5-D2.js";import{A}from"./AuthorAvatar-CUJMmp_z.js";import{u as k,b as P,a as $}from"./PaperFeed-DMvUfA47.js";import{R as S}from"./ResearchFollowButton-D2BXlDtQ.js";import{A as L,a as R}from"./alert-CFDDvdIM.js";import{S as w}from"./skeleton-HwvdxvSN.js";import{u as z}from"./usePapers-CJaWLZ3y.js";import{p as C,a as m}from"./paperQueryKeys-B8u1BWlI.js";import{i as H}from"./apiErrors-BZ5h1Kmb.js";import{t as q}from"./transform-0Udg2p6b.js";import f from"./NotFound-DtzwOULp.js";import"./PaperCard-tdTC_dRN.js";import"./SotaBadges-C-sTR-EF.js";import"./colors-BkWRhvFI.js";import"./Icon-D-kA0Owz.js";import"./LatexTitle-Z-HGmZ-H.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DKJYnYjk.js";import"./useIntersectionObserver-CID9Kkak.js";import"./useMutation-P_trTy9i.js";import"./research-DgpyzSy_.js";import"./plus-UK0TEjgd.js";import"./useInfiniteQuery-BAc_4HO5.js";import"./curation-C7Gmmp4z.js";const Q=({authorId:r})=>{var n,i,l,p,c,d,h,u;const o=k(),{searchParams:g}=o,e=y({queryKey:["author",r],queryFn:()=>m.getAuthor(r)}),s=z([...C.feeds.infinite,{author:r,...o.filters}],t=>m.list({...o.filters,author:r,page:t,page_size:12})),x=N.useMemo(()=>{var t;return(((t=s.data)==null?void 0:t.pages)??[]).flatMap(_=>_.results.map(q))},[s.data]),j=((i=(n=s.data)==null?void 0:n.pages[0])==null?void 0:i.count)??0;if(H(e.error))return a.jsx(f,{});if((l=e.data)!=null&&l.organization_slug){const t=g.toString();return a.jsx(v,{to:`/orgs/${e.data.organization_slug}${t?`?${t}`:""}`,replace:!0})}return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(F,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"Authors"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:((p=e.data)==null?void 0:p.full_name)??r})]}),a.jsxs("header",{className:"author-hero",children:[a.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),a.jsxs("div",{className:"author-hero-title",children:[(c=e.data)!=null&&c.photo?a.jsxs("figure",{className:"author-photo",children:[a.jsx("img",{className:"author-avatar-base author-avatar",src:e.data.photo.url,alt:""}),a.jsxs("figcaption",{children:["Photo:"," ",a.jsx("a",{href:e.data.photo.source_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.credit}),", ",e.data.photo.license_url?a.jsx("a",{href:e.data.photo.license_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.license}):e.data.photo.license]})]}):((d=e.data)==null?void 0:d.hf_username)&&a.jsx(A,{className:"author-avatar",url:e.data.hf_avatar_url,href:`https://huggingface.co/${e.data.hf_username}`,label:`@${e.data.hf_username} on Hugging Face`}),a.jsx("h1",{className:"feed-title",children:((h=e.data)==null?void 0:h.full_name)??a.jsx(w,{className:"h-12 w-64 inline-block"})})]}),e.data&&a.jsxs("div",{className:"feed-subtitle",children:[e.data.paper_count.toLocaleString()," ",e.data.paper_count===1?"paper":"papers",e.data.hf_username&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("a",{href:`https://huggingface.co/${e.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",e.data.hf_username," on Hugging Face ↗"]})]}),e.data.google_scholar_id&&a.jsxs(a.Fragment,{children:[" · ",a.jsx("a",{href:`https://scholar.google.com/citations?user=${encodeURIComponent(e.data.google_scholar_id)}`,target:"_blank",rel:"noopener noreferrer",children:"Google Scholar ↗"})]})]}),e.data&&a.jsx(S,{kind:"author",entityId:e.data.id})]}),a.jsx(P,{feed:o,style:{alignItems:"center",gap:16},children:a.jsxs("div",{className:"results-count",children:[j.toLocaleString()," papers"]})}),s.error?a.jsx(L,{variant:"destructive",children:a.jsxs(R,{children:["Failed to load papers."," ",a.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]})}):a.jsx($,{query:s,cards:x,empty:((u=e.data)==null?void 0:u.paper_count)===0?"No public papers are available.":"No papers found for this selection."})]})},pa=()=>{const{authorId:r}=b();return r?a.jsx(Q,{authorId:r},r):a.jsx(f,{})};export{pa as default}; diff --git a/assets/AuthorizePaperEditView-BxV6NPKV.js b/assets/AuthorizePaperEditView-D0e1jji8.js similarity index 87% rename from assets/AuthorizePaperEditView-BxV6NPKV.js rename to assets/AuthorizePaperEditView-D0e1jji8.js index 100940af1aabd572d4d49dfd6c49fa14db50e506..28eb749a83409e1b88f67b54f60db082a8153251 100644 --- a/assets/AuthorizePaperEditView-BxV6NPKV.js +++ b/assets/AuthorizePaperEditView-D0e1jji8.js @@ -1 +1 @@ -import{u,a as d,j as e,L as l,H as p}from"./index-YwiKC6Po.js";import{u as c}from"./useQuery-DPH6Mb2w.js";import{u as h}from"./useMutation-f6iDkf3w.js";import{B as m}from"./button-B90pJJiy.js";import{p as n}from"./paperEdits-B8a9u4Tx.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}; +import{u,a as d,j as e,L as l,H as p}from"./index-CbgxfyGU.js";import{u as c}from"./useQuery-Bx9s5-D2.js";import{u as h}from"./useMutation-P_trTy9i.js";import{B as m}from"./button-Bv9oZ-QU.js";import{p as n}from"./paperEdits-C5GTaRR8.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}; diff --git a/assets/AutonomousOperations-epH5w9S2.js b/assets/AutonomousOperations-CzJGtkdV.js similarity index 93% rename from assets/AutonomousOperations-epH5w9S2.js rename to assets/AutonomousOperations-CzJGtkdV.js index 5aa11e92bbe75efbb321ae897bbb16956f35f6e4..2534b55cea77389c3ee80e88cb6906fee9768172 100644 --- a/assets/AutonomousOperations-epH5w9S2.js +++ b/assets/AutonomousOperations-CzJGtkdV.js @@ -1 +1 @@ -import{f as R,r as d,j as e,L as B}from"./index-YwiKC6Po.js";import{u as q}from"./useQuery-DPH6Mb2w.js";import{u as H}from"./useMutation-f6iDkf3w.js";import{C as n,e as i,S as I,b as l,c as r,t as C,f as m,o as x}from"./CronDashboard-DcLcBHdd.js";import{B as Q}from"./badge-CFf6CiSg.js";import{B as h}from"./button-B90pJJiy.js";import{I as u}from"./input-DEeEc0bH.js";import{A as P}from"./activity-95309hog.js";import{A as D}from"./arrow-left-B08fyfNi.js";const j={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},E={healthy:"healthy",degraded:"degraded",repairing:"running","rolled-back":"broken",manual:"degraded"},S=["admin","autonomousOperations"],W=()=>{var A;const M=R(),[p,T]=d.useState(""),[f,_]=d.useState(""),[g,v]=d.useState({}),[b,N]=d.useState(""),c=q({queryKey:S,queryFn:()=>x.getAutonomousOperations(),refetchInterval:3e4,retry:!1}),t=H({mutationFn:s=>s(),onSuccess:s=>{M.setQueryData(S,s),_(""),v({}),N("")}}),a=c.data,y=t.error instanceof Error?t.error.message:null;if(c.isLoading)return e.jsx("div",{className:"page","aria-busy":"true",children:"Loading autonomous operations…"});if(c.error||!a)return e.jsxs("div",{className:"page",children:[e.jsx("h1",{children:"Autonomous operations unavailable"}),e.jsx("p",{children:c.error instanceof Error?c.error.message:"No status was returned."})]});const O=()=>t.mutate(()=>x.setAutonomousManualMode(!a.manual_mode,a.revision,f)),k=(s,o)=>t.mutate(()=>x.setAutonomousOperator(s,o,a.revision,g[s]??"")),w=()=>{var o;const s=((o=a.baseline)==null?void 0:o.revision)??0;t.mutate(()=>x.qualifyAutonomousChatBaseline(p,s,b))};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(P,{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(h,{asChild:!0,variant:"outline",children:e.jsxs(B,{to:"/admin-dashboard",children:[e.jsx(D,{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(I,{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:C(E[a.display_state]),children:[e.jsx(l,{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(l,{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(l,{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 ${m(a.active_lease.expires_at)}`:"No active source repair"})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Global control"})}),e.jsxs(i,{className:"space-y-2",children:[e.jsx(u,{"aria-label":"Manual mode confirmation",value:f,onChange:s=>_(s.target.value),placeholder:"Type SET_MANUAL_MODE"}),e.jsx(h,{disabled:t.isPending||f!=="SET_MANUAL_MODE",onClick:O,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:C(E[s.status]),children:[e.jsx(l,{children:e.jsxs(r,{className:"flex justify-between gap-2",children:[e.jsx("span",{children:j[s.operator]}),e.jsx(Q,{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?m(s.next_scheduled_run):"not scheduled"]}),e.jsx(u,{"aria-label":`${j[s.operator]} confirmation`,value:g[s.operator]??"",onChange:o=>v(L=>({...L,[s.operator]:o.target.value})),placeholder:"Type SET_OPERATOR_STATE"}),e.jsx(h,{disabled:t.isPending||a.manual_mode&&!s.enabled||g[s.operator]!=="SET_OPERATOR_STATE",onClick:()=>k(s.operator,!s.enabled),children:s.enabled?"Disable":"Enable"})]})]},s.operator))}),e.jsxs(n,{children:[e.jsx(l,{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:((A=a.baseline)==null?void 0:A.sha)??"No baseline qualified"}),a.baseline&&e.jsxs("p",{className:"text-sm",children:["Revision ",a.baseline.revision," · ",a.baseline.qualified_by," · ",m(a.baseline.qualified_at)]}),e.jsxs("div",{className:"grid md:grid-cols-[1fr_1fr_auto] gap-2",children:[e.jsx(u,{"aria-label":"Exact baseline SHA",value:p,onChange:s=>T(s.target.value),placeholder:"40-character lowercase commit SHA"}),e.jsx(u,{"aria-label":"Baseline confirmation",value:b,onChange:s=>N(s.target.value),placeholder:"Type QUALIFY_CHAT_BASELINE"}),e.jsx(h,{disabled:t.isPending||!/^[0-9a-f]{40}$/.test(p)||b!=="QUALIFY_CHAT_BASELINE",onClick:w,children:"Qualify exact SHA"})]})]})]}),e.jsxs(n,{children:[e.jsx(l,{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(l,{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:j[s.operator]})," · ",s.status," · ",s.exit_classification," · $",s.cost_usd," · ",m(s.created_at)]},s.run_id))}):e.jsx("p",{children:"No runs recorded."})})]}),e.jsxs(n,{children:[e.jsx(l,{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:j[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(l,{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))})})]}),y&&e.jsxs("p",{role:"alert",children:["Control update failed: ",y,". Refresh before retrying."]})]})})};export{W as default}; +import{f as R,r as d,j as e,L as B}from"./index-CbgxfyGU.js";import{u as q}from"./useQuery-Bx9s5-D2.js";import{u as H}from"./useMutation-P_trTy9i.js";import{C as n,e as i,S as I,b as l,c as r,t as C,f as m,o as x}from"./CronDashboard-B3Xofwvu.js";import{B as Q}from"./badge-Klg-RRGs.js";import{B as h}from"./button-Bv9oZ-QU.js";import{I as u}from"./input-B6pxtfPe.js";import{A as P}from"./activity-dcKMRXBy.js";import{A as D}from"./arrow-left-Czeu3VzJ.js";const j={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},E={healthy:"healthy",degraded:"degraded",repairing:"running","rolled-back":"broken",manual:"degraded"},S=["admin","autonomousOperations"],W=()=>{var A;const M=R(),[p,T]=d.useState(""),[f,_]=d.useState(""),[g,v]=d.useState({}),[b,N]=d.useState(""),c=q({queryKey:S,queryFn:()=>x.getAutonomousOperations(),refetchInterval:3e4,retry:!1}),t=H({mutationFn:s=>s(),onSuccess:s=>{M.setQueryData(S,s),_(""),v({}),N("")}}),a=c.data,y=t.error instanceof Error?t.error.message:null;if(c.isLoading)return e.jsx("div",{className:"page","aria-busy":"true",children:"Loading autonomous operations…"});if(c.error||!a)return e.jsxs("div",{className:"page",children:[e.jsx("h1",{children:"Autonomous operations unavailable"}),e.jsx("p",{children:c.error instanceof Error?c.error.message:"No status was returned."})]});const O=()=>t.mutate(()=>x.setAutonomousManualMode(!a.manual_mode,a.revision,f)),k=(s,o)=>t.mutate(()=>x.setAutonomousOperator(s,o,a.revision,g[s]??"")),w=()=>{var o;const s=((o=a.baseline)==null?void 0:o.revision)??0;t.mutate(()=>x.qualifyAutonomousChatBaseline(p,s,b))};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(P,{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(h,{asChild:!0,variant:"outline",children:e.jsxs(B,{to:"/admin-dashboard",children:[e.jsx(D,{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(I,{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:C(E[a.display_state]),children:[e.jsx(l,{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(l,{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(l,{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 ${m(a.active_lease.expires_at)}`:"No active source repair"})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Global control"})}),e.jsxs(i,{className:"space-y-2",children:[e.jsx(u,{"aria-label":"Manual mode confirmation",value:f,onChange:s=>_(s.target.value),placeholder:"Type SET_MANUAL_MODE"}),e.jsx(h,{disabled:t.isPending||f!=="SET_MANUAL_MODE",onClick:O,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:C(E[s.status]),children:[e.jsx(l,{children:e.jsxs(r,{className:"flex justify-between gap-2",children:[e.jsx("span",{children:j[s.operator]}),e.jsx(Q,{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?m(s.next_scheduled_run):"not scheduled"]}),e.jsx(u,{"aria-label":`${j[s.operator]} confirmation`,value:g[s.operator]??"",onChange:o=>v(L=>({...L,[s.operator]:o.target.value})),placeholder:"Type SET_OPERATOR_STATE"}),e.jsx(h,{disabled:t.isPending||a.manual_mode&&!s.enabled||g[s.operator]!=="SET_OPERATOR_STATE",onClick:()=>k(s.operator,!s.enabled),children:s.enabled?"Disable":"Enable"})]})]},s.operator))}),e.jsxs(n,{children:[e.jsx(l,{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:((A=a.baseline)==null?void 0:A.sha)??"No baseline qualified"}),a.baseline&&e.jsxs("p",{className:"text-sm",children:["Revision ",a.baseline.revision," · ",a.baseline.qualified_by," · ",m(a.baseline.qualified_at)]}),e.jsxs("div",{className:"grid md:grid-cols-[1fr_1fr_auto] gap-2",children:[e.jsx(u,{"aria-label":"Exact baseline SHA",value:p,onChange:s=>T(s.target.value),placeholder:"40-character lowercase commit SHA"}),e.jsx(u,{"aria-label":"Baseline confirmation",value:b,onChange:s=>N(s.target.value),placeholder:"Type QUALIFY_CHAT_BASELINE"}),e.jsx(h,{disabled:t.isPending||!/^[0-9a-f]{40}$/.test(p)||b!=="QUALIFY_CHAT_BASELINE",onClick:w,children:"Qualify exact SHA"})]})]})]}),e.jsxs(n,{children:[e.jsx(l,{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(l,{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:j[s.operator]})," · ",s.status," · ",s.exit_classification," · $",s.cost_usd," · ",m(s.created_at)]},s.run_id))}):e.jsx("p",{children:"No runs recorded."})})]}),e.jsxs(n,{children:[e.jsx(l,{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:j[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(l,{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))})})]}),y&&e.jsxs("p",{role:"alert",children:["Control update failed: ",y,". Refresh before retrying."]})]})})};export{W as default}; diff --git a/assets/BenchmarkDetailView-CzOCvqTF.js b/assets/BenchmarkDetailView-BGwBE1Ld.js similarity index 98% rename from assets/BenchmarkDetailView-CzOCvqTF.js rename to assets/BenchmarkDetailView-BGwBE1Ld.js index fb7c35416cd87f828006535a0767b0c57d83841a..9ad977462eccb13d104ec133d1898391c16df783 100644 --- a/assets/BenchmarkDetailView-CzOCvqTF.js +++ b/assets/BenchmarkDetailView-BGwBE1Ld.js @@ -1,2 +1,2 @@ -import{r as L,j as a,D as le,L as ne,c as ot,p as ct,u as dt,e as ut,q as mt}from"./index-YwiKC6Po.js";import{R as ht}from"./ResearchFollowButton-BFXC8E3t.js";import{u as te}from"./useQuery-DPH6Mb2w.js";import{c as re}from"./catalog-B15Yh5dN.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-CimjRPVg.js";import{L as oe}from"./LatexTitle-DI6voLfI.js";import{S as Ke}from"./switch-Crqp0RkL.js";import{I as xt}from"./Icon-DXQ4sjQk.js";import{S as ce}from"./skeleton-CXR1qouH.js";import{A as bt,a as yt}from"./alert-Cx5luC5D.js";import{B as wt}from"./BenchmarkTrendSparkline-BBLKxMdW.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import{i as _t}from"./apiErrors-DBfE_SVR.js";import St from"./NotFound-D8hwuoEl.js";import"./useMutation-f6iDkf3w.js";import"./research-5UpiU-ea.js";import"./plus-Cfz0QbT1.js";import"./curation-CkzNFTMJ.js";import"./hover-card-BY9tUGxy.js";import"./index-BaDZKp6X.js";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 kt(e){const t=e===null?void 0:Number(e);return Ge.some(r=>r.maxParametersExclusive===t)?t:void 0}function Ct(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Et(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Nt(e){const t=new Map;for(const r of e){const s=Et(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.parameterCounts+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function Mt(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==Pt(e.updated_at)?r:e.paper_published_date||""}function Tt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=$t(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:Mt(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.valuel;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 Ft(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 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 Lt(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=Ft(t,d,e.hideClosed),h=Nt(u.visible),R=Le(h,i),C=e.configuredMetrics.map(o=>o.metric_name),P=Array.from(new Set(h.flatMap(o=>[...o.best_metric?[o.best_metric]:[],...Object.keys(o.metrics||{})]))),S=C.length?C:P,g=new Map;for(const o of h){const m=o.best_metric;!m||ie(o.metrics[m])===null||C.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]:[],U=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=U.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:Rt(o,n)}}),{points:z,sota:ee,sotaModel:O}=Tt(R,j,D),M=i===void 0?e.initialSummary:void 0,q=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:q?j:M==null?void 0:M.metric,displayedSota:q?ee:M==null?void 0:M.value,displayedSotaModel:q?O:M==null?void 0:M.model_name,isSummaryLoading:!q&&!M,isInitialFilteredViewLoading:i!==void 0&&!q}}function It(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(lr+he(t,s),0),harness:he(t,"--bm-harness-width"),metric:he(t,"--bm-metric-width")}}const Bt=20;function Ae(e,t){return e?a.jsx(oe,{title:e}):t||"—"}function Dt({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:c,arrow:d}=e,[f,x]=L.useState(null);return L.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const C=f.clientWidth,P=At(R);f.classList.toggle("unpins-trailing-columns",CS.clientHeight?0:Bt;n(k=>It(C,P,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.jsxs("th",{className:"col-parameters",children:[a.jsx("span",{className:"bm-label-full",children:"Parameters"}),a.jsx("span",{className:"bm-label-short",children:"Params"})]}),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 C=u.paper_arxiv_id||u.paper_id,P=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?"—":Ct(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:C?a.jsx(ne,{to:`/paper/${C}`,title:u.paper_title||P||void 0,children:Ae(u.paper_title,P)}):Ae(u.paper_title,P)}),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 Ht(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 Vt=({points:e,metric:t})=>{const r=ot(),[s,n]=L.useState(null),i=880,l=320,c=60,d=30,f=40,x=50,u=e.map(o=>o.value),h=Math.min(...u),C=Math.max(...u)-h||1,P=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+P/2:c+(o-k)/j*P,W=e.map((o,m)=>{const p=D(Be(o.date)),y=(o.value-h)/C,$=f+S*(1-y);return{x:p,y:$,data:o,idx:m}}),w=W.filter(o=>o.data.isSota);let U="";if(w.length>=2){U=`M${w[0].x},${w[0].y}`;for(let o=1;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 $=o.x-y/2,E=o.x+y/2,v="middle";return $i-d&&(E=i-d,$=E-y,v="end"),{x:v==="start"?c:v==="end"?i-d:o.x,y:o.y-Q,text:p,anchor:v,left:$,right:E}},ee=[],O=w.length>0?z(w[w.length-1]):null;let M=-1/0;for(let o=0;oO.left-N||(M=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 q=Ht(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}`,$=!!o.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:$?"pointer":"default",outline:"none"},tabIndex:0,role:$?"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:E=>{$&&(E.key==="Enter"||E.key===" ")&&(E.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),$=h+C*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($)})]},m)}),q.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"}}))}),U&&a.jsx("path",{d:U,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)}`,E=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=o.x-E/2;Hi-d&&(H=i-d-E);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:E,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 Wt(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 Ot=(()=>{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;rV||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 Gt(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{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 Qt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Xt(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),Qt(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 Yt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Jt(e,t){return Xe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Zt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?Yt(r):Jt(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=Ot();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Zt(l,r,n,s)),t.appendChild(c)}function er(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const He="application/font-woff",Ve="image/jpeg",tr={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 rr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=rr(e).toLowerCase();return tr[t]||""}function ar(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function sr(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 nr(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=nr(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")||""),ar(c)));n=sr(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 ir(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ue(t)}async function lr(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 or(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 cr(e,t){return A(e,HTMLCanvasElement)?ir(e):A(e,HTMLVideoElement)?lr(e,t):A(e,HTMLIFrameElement)?or(e,t):e.cloneNode(Ze(e))}const dr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ur(e,t,r){var s,n;if(Ze(t))return t;let i=[];return dr(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 mr(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 hr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function fr(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 pr(e,t,r){return A(t,Element)&&(mr(e,t,r),er(e,t,r),hr(e,t),fr(e,t)),t}async function gr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;icr(s,t)).then(s=>ur(e,s,t)).then(s=>pr(e,s,t)).then(s=>gr(s,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,xr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,br=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function yr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function wr(e){const t=[];return e.replace(et,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function vr(e,t,r,s,n){try{const i=r?Wt(t,r):t,l=ye(t);let c;return n||(c=await we(i,l,s)),e.replace(yr(t),`$1${c}$3`)}catch{}return e}function jr(e,{preferredFontFormat:t}){return t?e.replace(br,r=>{for(;;){const[s,,n]=xr.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=jr(e,r);return wr(s).reduce((i,l)=>i.then(c=>vr(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 _r(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 Sr(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 kr(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 _r(e,t),await Sr(e,t),await kr(e,t))}function Cr(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 qe(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 Ue(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 Er(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=>qe(x,t)).then(x=>Ue(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=>qe(c,t)).then(c=>Ue(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 Nr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function Rr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await Er(r,t);return Nr(s)}function st(e){return e.trim().replace(/["']/g,"")}function Pr(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 $r(e,t){const r=await Rr(e,t),s=Pr(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(` +import{r as L,j as a,E as le,L as ne,c as ot,p as ct,u as dt,e as ut,q as mt}from"./index-CbgxfyGU.js";import{R as ht}from"./ResearchFollowButton-D2BXlDtQ.js";import{u as te}from"./useQuery-Bx9s5-D2.js";import{c as re}from"./catalog-DhK7_9-6.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-npO6bZ8N.js";import{L as oe}from"./LatexTitle-Z-HGmZ-H.js";import{S as Ke}from"./switch-BSZohE4x.js";import{I as xt}from"./Icon-D-kA0Owz.js";import{S as ce}from"./skeleton-HwvdxvSN.js";import{A as bt,a as yt}from"./alert-CFDDvdIM.js";import{B as wt}from"./BenchmarkTrendSparkline-C135_NtS.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import{i as _t}from"./apiErrors-BZ5h1Kmb.js";import St from"./NotFound-DtzwOULp.js";import"./useMutation-P_trTy9i.js";import"./research-DgpyzSy_.js";import"./plus-UK0TEjgd.js";import"./curation-C7Gmmp4z.js";import"./hover-card-ufez2uMo.js";import"./index-CxPKwmVQ.js";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 kt(e){const t=e===null?void 0:Number(e);return Ge.some(r=>r.maxParametersExclusive===t)?t:void 0}function Ct(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Et(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Nt(e){const t=new Map;for(const r of e){const s=Et(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.parameterCounts+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function Mt(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==Pt(e.updated_at)?r:e.paper_published_date||""}function Tt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=$t(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:Mt(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.valuel;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 Ft(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 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 Lt(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=Ft(t,d,e.hideClosed),h=Nt(u.visible),R=Le(h,i),C=e.configuredMetrics.map(o=>o.metric_name),P=Array.from(new Set(h.flatMap(o=>[...o.best_metric?[o.best_metric]:[],...Object.keys(o.metrics||{})]))),S=C.length?C:P,g=new Map;for(const o of h){const m=o.best_metric;!m||ie(o.metrics[m])===null||C.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]:[],U=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=U.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:Rt(o,n)}}),{points:z,sota:ee,sotaModel:O}=Tt(R,j,D),M=i===void 0?e.initialSummary:void 0,q=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:q?j:M==null?void 0:M.metric,displayedSota:q?ee:M==null?void 0:M.value,displayedSotaModel:q?O:M==null?void 0:M.model_name,isSummaryLoading:!q&&!M,isInitialFilteredViewLoading:i!==void 0&&!q}}function It(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(lr+he(t,s),0),harness:he(t,"--bm-harness-width"),metric:he(t,"--bm-metric-width")}}const Bt=20;function Ae(e,t){return e?a.jsx(oe,{title:e}):t||"—"}function Dt({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:c,arrow:d}=e,[f,x]=L.useState(null);return L.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const C=f.clientWidth,P=At(R);f.classList.toggle("unpins-trailing-columns",CS.clientHeight?0:Bt;n(k=>It(C,P,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.jsxs("th",{className:"col-parameters",children:[a.jsx("span",{className:"bm-label-full",children:"Parameters"}),a.jsx("span",{className:"bm-label-short",children:"Params"})]}),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 C=u.paper_arxiv_id||u.paper_id,P=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?"—":Ct(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:C?a.jsx(ne,{to:`/paper/${C}`,title:u.paper_title||P||void 0,children:Ae(u.paper_title,P)}):Ae(u.paper_title,P)}),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 Ht(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 Vt=({points:e,metric:t})=>{const r=ot(),[s,n]=L.useState(null),i=880,l=320,c=60,d=30,f=40,x=50,u=e.map(o=>o.value),h=Math.min(...u),C=Math.max(...u)-h||1,P=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+P/2:c+(o-k)/j*P,W=e.map((o,m)=>{const p=D(Be(o.date)),y=(o.value-h)/C,$=f+S*(1-y);return{x:p,y:$,data:o,idx:m}}),w=W.filter(o=>o.data.isSota);let U="";if(w.length>=2){U=`M${w[0].x},${w[0].y}`;for(let o=1;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 $=o.x-y/2,E=o.x+y/2,v="middle";return $i-d&&(E=i-d,$=E-y,v="end"),{x:v==="start"?c:v==="end"?i-d:o.x,y:o.y-Q,text:p,anchor:v,left:$,right:E}},ee=[],O=w.length>0?z(w[w.length-1]):null;let M=-1/0;for(let o=0;oO.left-N||(M=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 q=Ht(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}`,$=!!o.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:$?"pointer":"default",outline:"none"},tabIndex:0,role:$?"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:E=>{$&&(E.key==="Enter"||E.key===" ")&&(E.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),$=h+C*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($)})]},m)}),q.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"}}))}),U&&a.jsx("path",{d:U,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)}`,E=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=o.x-E/2;Hi-d&&(H=i-d-E);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:E,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 Wt(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 Ot=(()=>{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;rV||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 Gt(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{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 Qt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Xt(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),Qt(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 Yt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Jt(e,t){return Xe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Zt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?Yt(r):Jt(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=Ot();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Zt(l,r,n,s)),t.appendChild(c)}function er(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const He="application/font-woff",Ve="image/jpeg",tr={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 rr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=rr(e).toLowerCase();return tr[t]||""}function ar(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function sr(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 nr(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=nr(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")||""),ar(c)));n=sr(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 ir(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ue(t)}async function lr(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 or(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 cr(e,t){return A(e,HTMLCanvasElement)?ir(e):A(e,HTMLVideoElement)?lr(e,t):A(e,HTMLIFrameElement)?or(e,t):e.cloneNode(Ze(e))}const dr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ur(e,t,r){var s,n;if(Ze(t))return t;let i=[];return dr(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 mr(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 hr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function fr(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 pr(e,t,r){return A(t,Element)&&(mr(e,t,r),er(e,t,r),hr(e,t),fr(e,t)),t}async function gr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;icr(s,t)).then(s=>ur(e,s,t)).then(s=>pr(e,s,t)).then(s=>gr(s,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,xr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,br=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function yr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function wr(e){const t=[];return e.replace(et,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function vr(e,t,r,s,n){try{const i=r?Wt(t,r):t,l=ye(t);let c;return n||(c=await we(i,l,s)),e.replace(yr(t),`$1${c}$3`)}catch{}return e}function jr(e,{preferredFontFormat:t}){return t?e.replace(br,r=>{for(;;){const[s,,n]=xr.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=jr(e,r);return wr(s).reduce((i,l)=>i.then(c=>vr(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 _r(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 Sr(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 kr(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 _r(e,t),await Sr(e,t),await kr(e,t))}function Cr(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 qe(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 Ue(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 Er(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=>qe(x,t)).then(x=>Ue(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=>qe(c,t)).then(c=>Ue(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 Nr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function Rr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await Er(r,t);return Nr(s)}function st(e){return e.trim().replace(/["']/g,"")}function Pr(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 $r(e,t){const r=await Rr(e,t),s=Pr(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(` `)}async function Mr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await $r(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 Tr(e,t={}){const{width:r,height:s}=Ye(e,t),n=await me(e,t,!0);return await Mr(n,t),await at(n,t),Cr(n,t),await Xt(n,r,s)}async function Fr(e,t={}){const{width:r,height:s}=Ye(e,t),n=await Tr(e,t),i=await ue(n),l=document.createElement("canvas"),c=l.getContext("2d"),d=t.pixelRatio||zt(),f=t.canvasWidth||r,x=t.canvasHeight||s;return l.width=f*d,l.height=x*d,t.skipAutoScale||Kt(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 Lr(e,t={}){const r=await Fr(e,t);return await Gt(r)}const be="#ffffff";function Ir(){return typeof window>"u"?be:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||be}function Ar(e){if(typeof window>"u")return be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Ir():t}async function Br(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 Lr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Ar(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]=L.useState("idle"),i=L.useRef(null);L.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=L.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 Br(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 Dr({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:n}){const i=L.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(Vt,{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 Hr(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function ze(e,t){return e?a.jsx(oe,{title:e}):t||"—"}const oa=()=>{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=kt(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:c}=mt(),d=L.useRef(null),f=L.useRef(!1),x=L.useRef(null),[u,h]=L.useState(null),R=`${e}:${s||""}`,C=u===R,[P,S]=L.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=L.useMemo(()=>{var b;return(((b=W.data)==null?void 0:b.results)||[]).find(T=>{var F;return T.id===((F=g.data)==null?void 0:F.id)})||null},[W.data,(Ce=g.data)==null?void 0:Ce.id]),U=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=Lt({evaluations:k.data||[],tasks:B.data||[],configuredMetrics:U.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:C,fittingMetricCount:P,ready:{evaluations:k.isSuccess,tasks:B.isSuccess,directions:j.isSuccess,metrics:U.isSuccess}}),{primaryTask:N,hiddenClosedEvals:Q,hiddenClosedTopEval:z,isSummaryLoading:ee,displayedMetric:O,displayedSota:M,displayedSotaModel:q,isInitialFilteredViewLoading:K,highlightedEval:_,hasParameterMetadata:X,parameterCoverage:Y,orderedMetrics:o}=I;L.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(_t(g.error))return a.jsx(St,{});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,$=b=>{r(T=>{const F=new URLSearchParams(T);return b===void 0?F.delete("max_parameters_exclusive"):F.set("max_parameters_exclusive",String(b)),F})},E=b=>{r(T=>{const F=new URLSearchParams(T);return F.set("metric",b),F})},v=p.introducing_paper??void 0,H=(v==null?void 0:v.arxiv_id)||(v==null?void 0:v.id)||Hr(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:"·"})]}),q?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:le(M)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:q})]}):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(Dr,{model:I,datasetName:p.name,hideClosed:l.hide_closed_source_evals,setHideClosed:c,setMetric:E}),_&&(()=>{var Te,Fe;const b=_.paper_arxiv_id||_.paper_id,T=_.paper_title||(_.paper_arxiv_id?`arXiv:${_.paper_arxiv_id}`:null),F=_.best_metric&&((Te=_.metrics)==null?void 0:Te[_.best_metric])!==void 0?_.best_metric:I.activeMetric,Me=(Fe=_.metrics)==null?void 0:Fe[F];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||T||"—",_.harness?` · ${_.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Me!==void 0&&F?a.jsxs(a.Fragment,{children:[F,": ",le(Me),T?" · ":""]}):null,b?a.jsx(ne,{to:`/paper/${b}`,children:ze(_.paper_title,T)}):ze(_.paper_title,T)]})]})]})})(),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=>E(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:T,disabled:F}=b;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${T?" is-active":""}`,"aria-pressed":T,disabled:F,onClick:()=>$(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,T)=>a.jsx(ce,{className:"h-10 w-full mb-2"},T))}):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:()=>$(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[o.length>P&&a.jsxs("div",{className:"bm-metric-columns-control",children:[a.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":C,"aria-controls":"benchmark-leaderboard",onClick:()=>h(C?null:R),children:C?"Show fewer metrics":`Show more metrics (${o.length-P})`}),C&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(Dt,{model:I,showHarness:y,setMetric:E,highlightRowRef:d,onFittingMetricCountChange:S})]})]})]})})};export{oa as default}; diff --git a/assets/BenchmarkTrendSparkline-BBLKxMdW.js b/assets/BenchmarkTrendSparkline-C135_NtS.js similarity index 97% rename from assets/BenchmarkTrendSparkline-BBLKxMdW.js rename to assets/BenchmarkTrendSparkline-C135_NtS.js index e978850945206aadb4bee62954287bc821ced0bb..45cea8dfa4df404fa18a5d06097346abb83f380b 100644 --- a/assets/BenchmarkTrendSparkline-BBLKxMdW.js +++ b/assets/BenchmarkTrendSparkline-C135_NtS.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-YwiKC6Po.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}; +import{r as C,j as t}from"./index-CbgxfyGU.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}; diff --git a/assets/CatalogEntityPreviewLink-Cv_oezOz.js b/assets/CatalogEntityPreviewLink-Cvehtzvn.js similarity index 95% rename from assets/CatalogEntityPreviewLink-Cv_oezOz.js rename to assets/CatalogEntityPreviewLink-Cvehtzvn.js index 019e3afbb835aec0e3de9a2eefd6b6ec5ae4b2de..ef2103253e54272309b1a52573af49e794c58d8c 100644 --- a/assets/CatalogEntityPreviewLink-Cv_oezOz.js +++ b/assets/CatalogEntityPreviewLink-Cvehtzvn.js @@ -1,4 +1,4 @@ -import{n as m,$ as h,K as d,j as s,L as g,Y as f}from"./index-YwiKC6Po.js";import{u as k}from"./useQuery-DPH6Mb2w.js";import{H as w,a as y,b as v}from"./hover-card-BY9tUGxy.js";import{c as l}from"./catalog-B15Yh5dN.js";/** +import{n as m,a0 as h,M as d,j as s,L as g,Z as f}from"./index-CbgxfyGU.js";import{u as k}from"./useQuery-Bx9s5-D2.js";import{H as w,a as y,b as v}from"./hover-card-ufez2uMo.js";import{c as l}from"./catalog-DhK7_9-6.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatView-DsnEMREv.js b/assets/ChatView-DlSbJMKT.js similarity index 97% rename from assets/ChatView-DsnEMREv.js rename to assets/ChatView-DlSbJMKT.js index 77f523fe62bb1195d638254801f321a183d32e8a..84ac564bedd2170111c4c14bf9cb56170283e8fe 100644 --- a/assets/ChatView-DsnEMREv.js +++ b/assets/ChatView-DlSbJMKT.js @@ -1,4 +1,4 @@ -var ir=Object.defineProperty;var or=(e,r,t)=>r in e?ir(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var ee=(e,r,t)=>or(e,typeof r!="symbol"?r+"":r,t);import{n as cr,r as d,j as n,X as Pt,p as Ht,K as rt,a as Ut,u as lr,c as ur,e as dr,f as pr,Z as fr,J as hr,L as Ct,Q as mr,S as gr,U as yr,V as At,m as _r}from"./index-YwiKC6Po.js";import{u as Pe}from"./useQuery-DPH6Mb2w.js";import{C as br,U as jt,b as wr,f as De,c as xr,g as vr,A as Sr,a as Er}from"./ArtifactWorkspace-BxDA6yNF.js";import{f as Ue,h as Rr,j as Kt,k as Ir,T as kr,e as Wt,l as Cr,m as Ar,n as jr,r as Tr,o as Tt,s as Yt,t as nt,v as He,w as Le,x as Mr,y as Mt,z as Nr,B as Dr,E as ut,F as $t,G as Lr,H as Fr,I as Or,J as qr,D as st,K as Br,L as Pr,M as Je,N as Qe,O as Hr,Q as ze,R as Ge,U as Ur,V as Kr,S as Wr,W as Yr,X as Nt,Y as $r}from"./chatSessions-CdNQ1toA.js";import{M as Vr}from"./McpShowcase-Fj71TTNl.js";import{S as Qr}from"./share-2-m8aPY8Vq.js";import{c as Xe}from"./chat-DHGOonJg.js";import{u as zr,O as Gr}from"./openrouter-BT3NQ0bL.js";import{q as Vt}from"./queryOptions-C9woPjwX.js";/* empty css */import"./hover-card-BY9tUGxy.js";import"./CatalogEntityPreviewLink-Cv_oezOz.js";import"./catalog-B15Yh5dN.js";import"./github-BZMCt7Ub.js";import"./file-text-Cijxx2XD.js";import"./PaperPreviewLink-CKfmgBjs.js";import"./index-CoRCN2p0.js";import"./index-BM_xSDJM.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-C5FMa4Oj.js";import"./curation-CkzNFTMJ.js";import"./useMutation-f6iDkf3w.js";import"./copy-YHg6twss.js";import"./thumbs-up-D9G2aLNB.js";import"./arrow-left-B08fyfNi.js";import"./external-link-4bBJT0yO.js";import"./plus-Cfz0QbT1.js";import"./search-wcEXdf1i.js";import"./chevron-up-BXtxbTfV.js";import"./AuthorAvatar-CoTET6B3.js";import"./AgentLogos-DhD8p5ds.js";/** +var ir=Object.defineProperty;var or=(e,r,t)=>r in e?ir(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var ee=(e,r,t)=>or(e,typeof r!="symbol"?r+"":r,t);import{n as cr,r as d,j as n,X as Pt,p as Ht,M as rt,a as Ut,u as lr,c as ur,e as dr,f as pr,_ as fr,K as hr,L as Ct,S as mr,U as gr,V as yr,W as At,m as _r}from"./index-CbgxfyGU.js";import{u as Pe}from"./useQuery-Bx9s5-D2.js";import{C as br,U as jt,b as wr,f as De,c as xr,g as vr,A as Sr,a as Er}from"./ArtifactWorkspace-Cwix1Wp6.js";import{f as Ue,h as Rr,j as Kt,k as Ir,T as kr,e as Wt,l as Cr,m as Ar,n as jr,r as Tr,o as Tt,s as Yt,t as nt,v as He,w as Le,x as Mr,y as Mt,z as Nr,B as Dr,E as ut,F as $t,G as Lr,H as Fr,I as Or,J as qr,D as st,K as Br,L as Pr,M as Je,N as Qe,O as Hr,Q as ze,R as Ge,U as Ur,V as Kr,S as Wr,W as Yr,X as Nt,Y as $r}from"./chatSessions-DwLUbLRo.js";import{M as Vr}from"./McpShowcase-CMLfdJM2.js";import{S as Qr}from"./share-2-hXe4dX_y.js";import{c as Xe}from"./chat-DzTo2WUO.js";import{u as zr,O as Gr}from"./openrouter-DiuY1sPP.js";import{q as Vt}from"./queryOptions-C9woPjwX.js";/* empty css */import"./hover-card-ufez2uMo.js";import"./CatalogEntityPreviewLink-Cvehtzvn.js";import"./catalog-DhK7_9-6.js";import"./github-BYklgHDz.js";import"./file-text-BK_7Q2rV.js";import"./PaperPreviewLink-DZDNIh1g.js";import"./index-ZkEATkOr.js";import"./index-BH3yOoza.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-B8u1BWlI.js";import"./curation-C7Gmmp4z.js";import"./useMutation-P_trTy9i.js";import"./copy-bzw7JVus.js";import"./thumbs-up-CDCzGuPd.js";import"./arrow-left-Czeu3VzJ.js";import"./external-link-DZIH4GGr.js";import"./plus-UK0TEjgd.js";import"./search-CLtAJGOp.js";import"./chevron-up-Cpt5JLeI.js";import"./AuthorAvatar-CUJMmp_z.js";import"./AgentLogos-BBl9UNVD.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ConferenceDetailView-CX4S54m2.js b/assets/ConferenceDetailView-i-HB-ysc.js similarity index 80% rename from assets/ConferenceDetailView-CX4S54m2.js rename to assets/ConferenceDetailView-i-HB-ysc.js index 349e79d3206dbd4fdcc7d517cd095c2643ec781a..fabd70380fa4a6e12007883e6328d17024637d5a 100644 --- a/assets/ConferenceDetailView-CX4S54m2.js +++ b/assets/ConferenceDetailView-i-HB-ysc.js @@ -1 +1 @@ -import{u as y,r as k,j as e,L as h}from"./index-YwiKC6Po.js";import{u as _}from"./useQuery-DPH6Mb2w.js";import{a as f,A as S,b}from"./AreaSection-CfCNkiTd.js";import{M as j}from"./MarkdownText-C-8yLDus.js";import{c as A}from"./catalog-B15Yh5dN.js";import{i as C}from"./apiErrors-DBfE_SVR.js";import{s as E}from"./areas-Dvi8w2dp.js";import{c as F,h as L}from"./colors-BkWRhvFI.js";import{C as $}from"./conferenceListings-BnmhBx-_.js";import{f as T}from"./deadlines-BH32v7D1.js";import{d as w}from"./transform-CNg3rvXk.js";import{S as D}from"./skeleton-CXR1qouH.js";import{A as P,a as R}from"./alert-Cx5luC5D.js";import{s as B}from"./safeExternalHref-CkBrsh84.js";import K from"./NotFound-D8hwuoEl.js";/* empty css */import"./PaperPreviewLink-CKfmgBjs.js";import"./index-CoRCN2p0.js";import"./index-BM_xSDJM.js";import"./katex-DkKDou_j.js";import"./hover-card-BY9tUGxy.js";import"./paperQueryKeys-C5FMa4Oj.js";import"./curation-CkzNFTMJ.js";import"./useMutation-f6iDkf3w.js";const ce=()=>{var g,x;const{confSlug:o}=y(),t=_({queryKey:["conference-areas-with-tasks",o],queryFn:()=>A.conferenceAreasWithTasks(o),enabled:!!o,staleTime:10*60*1e3}),m=k.useMemo(()=>{var a;return E(((a=t.data)==null?void 0:a.results)??[])},[t.data]),s=(g=t.data)==null?void 0:g.conference,d=((x=t.data)==null?void 0:x.total_paper_count)??0,N=$.filter(a=>{var r;return(((r=t.data)==null?void 0:r[a.countKey])??0)>0});if(C(t.error))return e.jsx(K,{});if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(R,{children:"Failed to load conference. Please try again."})})});const p=s?T(s.start_date,s.end_date):null,u=s?[s.venue,s.location].filter(Boolean).join(", "):null,n=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:n??e.jsx(D,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[p&&e.jsx("span",{children:p}),u&&e.jsx("span",{children:u}),(s==null?void 0:s.url)&&e.jsx("a",{href:B(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(j,{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:n?`${n} visual`:"Conference visual",onError:a=>{var r,c;(c=(r=a.currentTarget.parentElement)==null?void 0:r.parentElement)==null||c.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",n??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(j,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&d>0&&e.jsx(f,{title:"Browse papers",description:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists.",meta:`${d.toLocaleString()} papers`,style:{marginTop:48},children:N.map(a=>{var r;return e.jsxs(h,{to:`/conferences/${o}/${a.slug}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:a.dotColor}}),a.label]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(((r=t.data)==null?void 0:r[a.countKey])??0).toLocaleString()," papers"]})})]},a.slug)})}),t.isLoading?e.jsx(S,{tiles:6,tileClassName:"h-24"}):m.map(a=>{const r=a.tasks;if(r.length===0)return null;const c=r.reduce((i,l)=>i+(l.paper_count||0),0);return e.jsx(f,{title:a.name,description:a.description,meta:`${r.length} ${r.length===1?"task":"tasks"} · ${c.toLocaleString()} papers`,children:r.map(i=>{const l=i.slug||"",v=F(L(l));return e.jsxs(h,{to:`/conferences/${o}/${l}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:v.dot}}),w(i.name,l)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(i.paper_count??0).toLocaleString()," papers"]})})]},i.id)})},a.id)}),e.jsx(b,{areas:m})]})};export{ce as default}; +import{u as y,r as k,j as e,L as h}from"./index-CbgxfyGU.js";import{u as _}from"./useQuery-Bx9s5-D2.js";import{a as f,A as S,b}from"./AreaSection-NWvfO4Sb.js";import{M as j}from"./MarkdownText-Bj-G_S-B.js";import{c as A}from"./catalog-DhK7_9-6.js";import{i as C}from"./apiErrors-BZ5h1Kmb.js";import{s as E}from"./areas-Dvi8w2dp.js";import{c as F,h as L}from"./colors-BkWRhvFI.js";import{C as $}from"./conferenceListings-BnmhBx-_.js";import{f as T}from"./deadlines-BH32v7D1.js";import{d as w}from"./transform-0Udg2p6b.js";import{S as D}from"./skeleton-HwvdxvSN.js";import{A as P,a as R}from"./alert-CFDDvdIM.js";import{s as B}from"./safeExternalHref-CkBrsh84.js";import K from"./NotFound-DtzwOULp.js";/* empty css */import"./PaperPreviewLink-DZDNIh1g.js";import"./index-ZkEATkOr.js";import"./index-BH3yOoza.js";import"./katex-DkKDou_j.js";import"./hover-card-ufez2uMo.js";import"./paperQueryKeys-B8u1BWlI.js";import"./curation-C7Gmmp4z.js";import"./useMutation-P_trTy9i.js";const ce=()=>{var g,x;const{confSlug:o}=y(),t=_({queryKey:["conference-areas-with-tasks",o],queryFn:()=>A.conferenceAreasWithTasks(o),enabled:!!o,staleTime:10*60*1e3}),m=k.useMemo(()=>{var a;return E(((a=t.data)==null?void 0:a.results)??[])},[t.data]),s=(g=t.data)==null?void 0:g.conference,d=((x=t.data)==null?void 0:x.total_paper_count)??0,N=$.filter(a=>{var r;return(((r=t.data)==null?void 0:r[a.countKey])??0)>0});if(C(t.error))return e.jsx(K,{});if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(R,{children:"Failed to load conference. Please try again."})})});const p=s?T(s.start_date,s.end_date):null,u=s?[s.venue,s.location].filter(Boolean).join(", "):null,n=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:n??e.jsx(D,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[p&&e.jsx("span",{children:p}),u&&e.jsx("span",{children:u}),(s==null?void 0:s.url)&&e.jsx("a",{href:B(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(j,{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:n?`${n} visual`:"Conference visual",onError:a=>{var r,c;(c=(r=a.currentTarget.parentElement)==null?void 0:r.parentElement)==null||c.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",n??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(j,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&d>0&&e.jsx(f,{title:"Browse papers",description:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists.",meta:`${d.toLocaleString()} papers`,style:{marginTop:48},children:N.map(a=>{var r;return e.jsxs(h,{to:`/conferences/${o}/${a.slug}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:a.dotColor}}),a.label]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(((r=t.data)==null?void 0:r[a.countKey])??0).toLocaleString()," papers"]})})]},a.slug)})}),t.isLoading?e.jsx(S,{tiles:6,tileClassName:"h-24"}):m.map(a=>{const r=a.tasks;if(r.length===0)return null;const c=r.reduce((i,l)=>i+(l.paper_count||0),0);return e.jsx(f,{title:a.name,description:a.description,meta:`${r.length} ${r.length===1?"task":"tasks"} · ${c.toLocaleString()} papers`,children:r.map(i=>{const l=i.slug||"",v=F(L(l));return e.jsxs(h,{to:`/conferences/${o}/${l}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:v.dot}}),w(i.name,l)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(i.paper_count??0).toLocaleString()," papers"]})})]},i.id)})},a.id)}),e.jsx(b,{areas:m})]})};export{ce as default}; diff --git a/assets/ConferenceTaskView-DvbWh5_R.js b/assets/ConferenceTaskView-BZBMXZD8.js similarity index 77% rename from assets/ConferenceTaskView-DvbWh5_R.js rename to assets/ConferenceTaskView-BZBMXZD8.js index 3dc53fd9a6e4e1d49e1faf71dabe0bd1017b271e..20ca92e588d01ea059ece60559d12cdda3dec3a1 100644 --- a/assets/ConferenceTaskView-DvbWh5_R.js +++ b/assets/ConferenceTaskView-BZBMXZD8.js @@ -1 +1 @@ -import{u as S,r as F,j as e,L as x}from"./index-YwiKC6Po.js";import{u as _}from"./useQuery-DPH6Mb2w.js";import{u as T,b as R,a as L}from"./PaperFeed-kaLm5US2.js";import{M as g}from"./MarkdownText-C-8yLDus.js";import{c as A}from"./catalog-B15Yh5dN.js";import{p as M,a as q}from"./paperQueryKeys-C5FMa4Oj.js";import{i as E}from"./apiErrors-DBfE_SVR.js";import{C as B}from"./conferenceListings-BnmhBx-_.js";import{t as O,d as Q}from"./transform-CNg3rvXk.js";import{u as z}from"./usePapers-C1deOZKl.js";import{A as H,a as I}from"./alert-Cx5luC5D.js";import K from"./NotFound-D8hwuoEl.js";import"./PaperCard-FG-bEpJk.js";import"./AuthorAvatar-CoTET6B3.js";import"./SotaBadges-DiQuEzfo.js";import"./colors-BkWRhvFI.js";import"./Icon-DXQ4sjQk.js";import"./LatexTitle-DI6voLfI.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D7ygxg37.js";import"./skeleton-CXR1qouH.js";import"./useIntersectionObserver-Dt36kyjs.js";/* empty css */import"./PaperPreviewLink-CKfmgBjs.js";import"./index-CoRCN2p0.js";import"./index-BM_xSDJM.js";import"./katex-DkKDou_j.js";import"./hover-card-BY9tUGxy.js";import"./useMutation-f6iDkf3w.js";import"./curation-CkzNFTMJ.js";import"./useInfiniteQuery-BEbL80ez.js";const $={"iclr-2026/outstanding":"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/).","icml-2026/outstanding":"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/).","cvpr-2026/best-paper-finalists":"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."},ye=()=>{var b,v,y,P,k,w;const{confSlug:t,taskSlug:n}=S(),p=T(),a=B.find(s=>s.slug===n),u=!!(a!=null&&a.award),i=_({queryKey:["conference",t],queryFn:()=>A.getConference(t),enabled:!!t,staleTime:10*60*1e3}),c=_({queryKey:["task",n],queryFn:()=>A.getTask(n),enabled:!!n&&!a,staleTime:10*60*1e3}),l=z([...M.feeds.conference,t,n,p.filters],s=>q.forConference(t,{...p.filters,task:a?void 0:n,presentation:a==null?void 0:a.presentation,page:s,page_size:12}),{enabled:!!t}),f=F.useMemo(()=>{var s;return((s=l.data)==null?void 0:s.pages.flatMap(o=>o.results))??[]},[l.data]),h=F.useMemo(()=>f.map(O),[f]),d=(a==null?void 0:a.label)??Q(((b=c.data)==null?void 0:b.name)||n||"",((v=c.data)==null?void 0:v.slug)||n),j=$[`${t}/${n}`],N=((P=(y=l.data)==null?void 0:y.pages[0])==null?void 0:P.count)??((k=i.data)==null?void 0:k.paper_count)??0,r=c.data;return E(i.error)||E(c.error)?e.jsx(K,{}):i.error||c.error||l.error?e.jsx("div",{className:"page",children:e.jsx(H,{variant:"destructive",children:e.jsx(I,{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(x,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:`/conferences/${t}`,children:((w=i.data)==null?void 0:w.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:d})]}),e.jsxs("div",{className:!a&&(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:a?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:d}),j&&e.jsx(g,{className:"task-explainer",text:j}),!a&&(r==null?void 0:r.description)&&e.jsx(g,{className:"task-explainer",text:r.description}),i.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:N.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:i.data.name})]})]}),!a&&(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:`${d} schematic`,onError:s=>{var o,m;(m=(o=s.currentTarget.parentElement)==null?void 0:o.parentElement)==null||m.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",d,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(g,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",N.toLocaleString(),"]"]})]})]}),e.jsx(R,{feed:p,sorts:u?null:void 0,children:!u&&e.jsxs("div",{className:"results-count",children:[h.length," loaded in ",e.jsx("span",{children:d})]})}),e.jsx(L,{query:l,cards:h,empty:"No papers found for this selection.",cardHeader:s=>{var C;const o=(C=f[s])==null?void 0:C.conference_award,m=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&(a==null?void 0:a.presentation)!=="best_paper_finalist"?"Best Paper Finalist":null;return m&&e.jsx("div",{className:"conference-award-label",children:m})}})]})};export{ye as default}; +import{u as S,r as F,j as e,L as x}from"./index-CbgxfyGU.js";import{u as _}from"./useQuery-Bx9s5-D2.js";import{u as T,b as R,a as L}from"./PaperFeed-DMvUfA47.js";import{M as g}from"./MarkdownText-Bj-G_S-B.js";import{c as A}from"./catalog-DhK7_9-6.js";import{p as M,a as q}from"./paperQueryKeys-B8u1BWlI.js";import{i as E}from"./apiErrors-BZ5h1Kmb.js";import{C as B}from"./conferenceListings-BnmhBx-_.js";import{t as O,d as Q}from"./transform-0Udg2p6b.js";import{u as z}from"./usePapers-CJaWLZ3y.js";import{A as H,a as I}from"./alert-CFDDvdIM.js";import K from"./NotFound-DtzwOULp.js";import"./PaperCard-tdTC_dRN.js";import"./AuthorAvatar-CUJMmp_z.js";import"./SotaBadges-C-sTR-EF.js";import"./colors-BkWRhvFI.js";import"./Icon-D-kA0Owz.js";import"./LatexTitle-Z-HGmZ-H.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DKJYnYjk.js";import"./skeleton-HwvdxvSN.js";import"./useIntersectionObserver-CID9Kkak.js";/* empty css */import"./PaperPreviewLink-DZDNIh1g.js";import"./index-ZkEATkOr.js";import"./index-BH3yOoza.js";import"./katex-DkKDou_j.js";import"./hover-card-ufez2uMo.js";import"./useMutation-P_trTy9i.js";import"./curation-C7Gmmp4z.js";import"./useInfiniteQuery-BAc_4HO5.js";const $={"iclr-2026/outstanding":"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/).","icml-2026/outstanding":"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/).","cvpr-2026/best-paper-finalists":"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."},ye=()=>{var b,v,y,P,k,w;const{confSlug:t,taskSlug:n}=S(),p=T(),a=B.find(s=>s.slug===n),u=!!(a!=null&&a.award),i=_({queryKey:["conference",t],queryFn:()=>A.getConference(t),enabled:!!t,staleTime:10*60*1e3}),c=_({queryKey:["task",n],queryFn:()=>A.getTask(n),enabled:!!n&&!a,staleTime:10*60*1e3}),l=z([...M.feeds.conference,t,n,p.filters],s=>q.forConference(t,{...p.filters,task:a?void 0:n,presentation:a==null?void 0:a.presentation,page:s,page_size:12}),{enabled:!!t}),f=F.useMemo(()=>{var s;return((s=l.data)==null?void 0:s.pages.flatMap(o=>o.results))??[]},[l.data]),h=F.useMemo(()=>f.map(O),[f]),d=(a==null?void 0:a.label)??Q(((b=c.data)==null?void 0:b.name)||n||"",((v=c.data)==null?void 0:v.slug)||n),j=$[`${t}/${n}`],N=((P=(y=l.data)==null?void 0:y.pages[0])==null?void 0:P.count)??((k=i.data)==null?void 0:k.paper_count)??0,r=c.data;return E(i.error)||E(c.error)?e.jsx(K,{}):i.error||c.error||l.error?e.jsx("div",{className:"page",children:e.jsx(H,{variant:"destructive",children:e.jsx(I,{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(x,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:`/conferences/${t}`,children:((w=i.data)==null?void 0:w.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:d})]}),e.jsxs("div",{className:!a&&(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:a?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:d}),j&&e.jsx(g,{className:"task-explainer",text:j}),!a&&(r==null?void 0:r.description)&&e.jsx(g,{className:"task-explainer",text:r.description}),i.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:N.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:i.data.name})]})]}),!a&&(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:`${d} schematic`,onError:s=>{var o,m;(m=(o=s.currentTarget.parentElement)==null?void 0:o.parentElement)==null||m.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",d,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(g,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",N.toLocaleString(),"]"]})]})]}),e.jsx(R,{feed:p,sorts:u?null:void 0,children:!u&&e.jsxs("div",{className:"results-count",children:[h.length," loaded in ",e.jsx("span",{children:d})]})}),e.jsx(L,{query:l,cards:h,empty:"No papers found for this selection.",cardHeader:s=>{var C;const o=(C=f[s])==null?void 0:C.conference_award,m=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&(a==null?void 0:a.presentation)!=="best_paper_finalist"?"Best Paper Finalist":null;return m&&e.jsx("div",{className:"conference-award-label",children:m})}})]})};export{ye as default}; diff --git a/assets/ConferencesIndexView-DUaazjEx.js b/assets/ConferencesIndexView-Cw6IrAk5.js similarity index 76% rename from assets/ConferencesIndexView-DUaazjEx.js rename to assets/ConferencesIndexView-Cw6IrAk5.js index 5097cd9c81d3350984554488a4851cadee35a6b3..971bf643e6e5104ac35603940c30fb9b75c3db76 100644 --- a/assets/ConferencesIndexView-DUaazjEx.js +++ b/assets/ConferencesIndexView-Cw6IrAk5.js @@ -1 +1 @@ -import{r as d,j as e,L as c}from"./index-YwiKC6Po.js";import{u as m}from"./useQuery-DPH6Mb2w.js";import{c as p}from"./catalog-B15Yh5dN.js";import{f as u}from"./deadlines-BH32v7D1.js";import{A as f,a as h}from"./alert-Cx5luC5D.js";import{A as x,a as g}from"./AreaSection-CfCNkiTd.js";import{T as j}from"./TaxonomySuggestionTile-4WqZSJGN.js";import"./skeleton-CXR1qouH.js";import"./SignInToEditDialog-DpqyyHCb.js";import"./button-B90pJJiy.js";import"./input-DEeEc0bH.js";import"./textarea-BPIMGf5w.js";import"./searchable-select-Bqfyxu17.js";import"./popover-D7ygxg37.js";import"./dialog-foxx0Wu6.js";import"./search-wcEXdf1i.js";import"./loader-circle-B0KtDERb.js";import"./useMutation-f6iDkf3w.js";import"./submissions-BJgYjF7O.js";import"./plus-Cfz0QbT1.js";const 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},N=(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)},R=()=>{const r=m({queryKey:["conferences"],queryFn:()=>p.conferences(),staleTime:6e5}),a=d.useMemo(()=>{var i;if(!((i=r.data)!=null&&i.results))return null;const t={};return r.data.results.forEach(n=>{const s=v(n);(t[s]||(t[s]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(N)),Object.keys(t).map(Number).sort((n,s)=>s-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(h,{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(c,{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(x,{sections:2,tiles:3,tileClassName:"h-32"}):a==null?void 0:a.map(({year:t,conferences:i})=>{const n=i.reduce((s,o)=>s+(o.paper_count??0),0);return e.jsxs(g,{title:t>0?String(t):"Unknown year",meta:`${i.length} ${i.length===1?"conference":"conferences"} · ${n.toLocaleString()} papers`,children:[i.map(s=>{const o=u(s.start_date,s.end_date),l=[s.venue,s.location].filter(Boolean).join(", ");return e.jsxs(c,{to:`/conferences/${s.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:s.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),l&&e.jsx("span",{children:l}),e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]})]})]},s.id)}),e.jsx(j,{kind:"conference"})]},t)})]})};export{R as default}; +import{r as d,j as e,L as c}from"./index-CbgxfyGU.js";import{u as m}from"./useQuery-Bx9s5-D2.js";import{c as p}from"./catalog-DhK7_9-6.js";import{f as u}from"./deadlines-BH32v7D1.js";import{A as f,a as h}from"./alert-CFDDvdIM.js";import{A as x,a as g}from"./AreaSection-NWvfO4Sb.js";import{T as j}from"./TaxonomySuggestionTile-DIw_GKfA.js";import"./skeleton-HwvdxvSN.js";import"./SignInToEditDialog-CNIcNqbK.js";import"./button-Bv9oZ-QU.js";import"./input-B6pxtfPe.js";import"./textarea-Bf06GTSH.js";import"./searchable-select-DNdBIahG.js";import"./popover-DKJYnYjk.js";import"./dialog-Cfp_d3CC.js";import"./search-CLtAJGOp.js";import"./loader-circle-CWMja8Zn.js";import"./useMutation-P_trTy9i.js";import"./submissions-aWj7YtuZ.js";import"./plus-UK0TEjgd.js";const 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},N=(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)},R=()=>{const r=m({queryKey:["conferences"],queryFn:()=>p.conferences(),staleTime:6e5}),a=d.useMemo(()=>{var i;if(!((i=r.data)!=null&&i.results))return null;const t={};return r.data.results.forEach(n=>{const s=v(n);(t[s]||(t[s]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(N)),Object.keys(t).map(Number).sort((n,s)=>s-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(h,{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(c,{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(x,{sections:2,tiles:3,tileClassName:"h-32"}):a==null?void 0:a.map(({year:t,conferences:i})=>{const n=i.reduce((s,o)=>s+(o.paper_count??0),0);return e.jsxs(g,{title:t>0?String(t):"Unknown year",meta:`${i.length} ${i.length===1?"conference":"conferences"} · ${n.toLocaleString()} papers`,children:[i.map(s=>{const o=u(s.start_date,s.end_date),l=[s.venue,s.location].filter(Boolean).join(", ");return e.jsxs(c,{to:`/conferences/${s.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:s.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),l&&e.jsx("span",{children:l}),e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]})]})]},s.id)}),e.jsx(j,{kind:"conference"})]},t)})]})};export{R as default}; diff --git a/assets/CronDashboard-DcLcBHdd.js b/assets/CronDashboard-B3Xofwvu.js similarity index 94% rename from assets/CronDashboard-DcLcBHdd.js rename to assets/CronDashboard-B3Xofwvu.js index aec96f2981e30752ef7bee568130e66f0773642f..16b19497670c57706b9e026e9ae43beaa5adfcf9 100644 --- a/assets/CronDashboard-DcLcBHdd.js +++ b/assets/CronDashboard-B3Xofwvu.js @@ -1,6 +1,6 @@ -import{n as c,r,j as a,A as n,a5 as u}from"./index-YwiKC6Po.js";/** +import{n as c,r,j as a,B as n,a6 as u}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const N=c("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),f=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("rounded-lg border bg-card text-card-foreground shadow-sm",o),...e}));f.displayName="Card";const m=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex flex-col space-y-1.5 p-6",o),...e}));m.displayName="CardHeader";const p=r.forwardRef(({className:o,...e},t)=>a.jsx("h3",{ref:t,className:n("text-2xl font-semibold leading-none tracking-tight",o),...e}));p.displayName="CardTitle";const l=r.forwardRef(({className:o,...e},t)=>a.jsx("p",{ref:t,className:n("text-sm text-muted-foreground",o),...e}));l.displayName="CardDescription";const h=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("p-6 pt-0",o),...e}));h.displayName="CardContent";const C=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex items-center p-6 pt-0",o),...e}));C.displayName="CardFooter";const b=o=>`cron-status--${o}`,x=o=>`$${o.toFixed(2)}`,w=o=>x(o/1e6);function M(o){if(!o)return"Never";const e=new Date(o);if(Number.isNaN(e.getTime()))return o;const t=Date.now()-e.getTime(),s=Math.floor(t/6e4),i=Math.floor(t/36e5),d=Math.floor(t/864e5);return s<1?"Just now":s<60?`${s}m ago`:i<24?`${i}h ago`:d<7?`${d}d ago`:e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}class g{constructor(e){this.request=e}getCronStatus(e=!1){const t=e?"?force_refresh=true":"";return this.request(`/cron/status${t}`,{cache:"no-store"})}getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}getAutonomousOperations(){return this.request("/admin/autonomous-operations",{cache:"no-store"})}setAutonomousManualMode(e,t,s){return this.request("/admin/autonomous-operations/manual-mode",{method:"PATCH",body:JSON.stringify({enabled:e,expected_revision:t,confirmation:s})})}setAutonomousOperator(e,t,s,i){return this.request(`/admin/autonomous-operations/operators/${e}`,{method:"PATCH",body:JSON.stringify({enabled:t,expected_revision:s,confirmation:i})})}qualifyAutonomousChatBaseline(e,t,s){return this.request("/admin/autonomous-operations/chat-baseline",{method:"POST",body:JSON.stringify({sha:e,expected_revision:t,confirmation:s})})}}const A=new g(u);export{f as C,N as S,x as a,m as b,p as c,l as d,h as e,M as f,w as g,A as o,b as t}; + */const N=c("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),f=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("rounded-lg border bg-card text-card-foreground shadow-sm",o),...e}));f.displayName="Card";const m=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex flex-col space-y-1.5 p-6",o),...e}));m.displayName="CardHeader";const p=r.forwardRef(({className:o,...e},t)=>a.jsx("h3",{ref:t,className:n("text-2xl font-semibold leading-none tracking-tight",o),...e}));p.displayName="CardTitle";const l=r.forwardRef(({className:o,...e},t)=>a.jsx("p",{ref:t,className:n("text-sm text-muted-foreground",o),...e}));l.displayName="CardDescription";const h=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("p-6 pt-0",o),...e}));h.displayName="CardContent";const C=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex items-center p-6 pt-0",o),...e}));C.displayName="CardFooter";const b=o=>`cron-status--${o}`,x=o=>`$${o.toFixed(2)}`,w=o=>x(o/1e6);function M(o){if(!o)return"Never";const e=new Date(o);if(Number.isNaN(e.getTime()))return o;const t=Date.now()-e.getTime(),s=Math.floor(t/6e4),i=Math.floor(t/36e5),d=Math.floor(t/864e5);return s<1?"Just now":s<60?`${s}m ago`:i<24?`${i}h ago`:d<7?`${d}d ago`:e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}class g{constructor(e){this.request=e}getCronStatus(e=!1){const t=e?"?force_refresh=true":"";return this.request(`/cron/status${t}`,{cache:"no-store"})}getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}getAutonomousOperations(){return this.request("/admin/autonomous-operations",{cache:"no-store"})}setAutonomousManualMode(e,t,s){return this.request("/admin/autonomous-operations/manual-mode",{method:"PATCH",body:JSON.stringify({enabled:e,expected_revision:t,confirmation:s})})}setAutonomousOperator(e,t,s,i){return this.request(`/admin/autonomous-operations/operators/${e}`,{method:"PATCH",body:JSON.stringify({enabled:t,expected_revision:s,confirmation:i})})}qualifyAutonomousChatBaseline(e,t,s){return this.request("/admin/autonomous-operations/chat-baseline",{method:"POST",body:JSON.stringify({sha:e,expected_revision:t,confirmation:s})})}}const q=new g(u);export{f as C,N as S,x as a,m as b,p as c,l as d,h as e,M as f,w as g,q as o,b as t}; diff --git a/assets/CronDashboard-DMMdAs4p.js b/assets/CronDashboard-CC1lPV3k.js similarity index 98% rename from assets/CronDashboard-DMMdAs4p.js rename to assets/CronDashboard-CC1lPV3k.js index b5207eed1063825b4fbf3ae84801d0e80aa97e88..53d58ee9b0bdff4ecf74ccc20cfe193cced6bc93 100644 --- a/assets/CronDashboard-DMMdAs4p.js +++ b/assets/CronDashboard-CC1lPV3k.js @@ -1,4 +1,4 @@ -import{n as D,r as x,E as is,v as cs,j as e,t as ie,a8 as ls,R as ds,I as os,x as oe,P as ms,z as us,F as Re,A as $,f as xe,J as Te,L as pe,a as hs,m as xs}from"./index-YwiKC6Po.js";import{u as z}from"./useQuery-DPH6Mb2w.js";import{u as L}from"./useMutation-f6iDkf3w.js";import{t as ge,f as v,a as S,S as Ae,o as ue,C as g,b as f,c as N,d as P,e as j,g as C}from"./CronDashboard-DcLcBHdd.js";import{B as I}from"./badge-CFf6CiSg.js";import{B as y}from"./button-B90pJJiy.js";import{C as ps,a as gs}from"./chevron-up-BXtxbTfV.js";import{D as fe}from"./database-2w-JFZSG.js";import{T as js}from"./trending-up-Sm0tkX5g.js";import{A as ne}from"./activity-95309hog.js";import{F as Ne}from"./file-text-Cijxx2XD.js";import{T as Ee,I as vs}from"./triangle-alert-BWObrJc7.js";import{E as X}from"./external-link-4bBJT0yO.js";import{C as Y,R as be}from"./refresh-cw-4AZFTXDl.js";import{L as R}from"./loader-circle-B0KtDERb.js";import{C as je}from"./circle-check-BPcHPjjB.js";import{c as E,A as _s}from"./codex-C9BvAdr-.js";import{u as fs}from"./useInfiniteQuery-BEbL80ez.js";import{p as Me}from"./paperEdits-B8a9u4Tx.js";import{c as me}from"./catalog-B15Yh5dN.js";import{c as ye}from"./chat-DHGOonJg.js";/** +import{n as D,r as x,F as is,w as cs,j as e,v as ie,a9 as ls,R as ds,I as os,y as oe,P as ms,A as us,G as Re,B as $,f as xe,K as Te,L as pe,a as hs,m as xs}from"./index-CbgxfyGU.js";import{u as z}from"./useQuery-Bx9s5-D2.js";import{u as L}from"./useMutation-P_trTy9i.js";import{t as ge,f as v,a as S,S as Ae,o as ue,C as g,b as f,c as N,d as P,e as j,g as C}from"./CronDashboard-B3Xofwvu.js";import{B as I}from"./badge-Klg-RRGs.js";import{B as y}from"./button-Bv9oZ-QU.js";import{C as ps,a as gs}from"./chevron-up-Cpt5JLeI.js";import{D as fe}from"./database-CTvEb5JG.js";import{T as js}from"./trending-up-B3K5RlyX.js";import{A as ne}from"./activity-dcKMRXBy.js";import{F as Ne}from"./file-text-BK_7Q2rV.js";import{T as Ee,I as vs}from"./triangle-alert-U7T_j3JE.js";import{E as X}from"./external-link-DZIH4GGr.js";import{C as Y,R as be}from"./refresh-cw-Cps6nypW.js";import{L as R}from"./loader-circle-CWMja8Zn.js";import{C as je}from"./circle-check-Bci9ZTu9.js";import{c as E,A as _s}from"./codex-Bl7j51l-.js";import{u as fs}from"./useInfiniteQuery-BAc_4HO5.js";import{p as Me}from"./paperEdits-C5GTaRR8.js";import{c as me}from"./catalog-DhK7_9-6.js";import{c as ye}from"./chat-DzTo2WUO.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ExternalSourceEvalBadge-CimjRPVg.js b/assets/ExternalSourceEvalBadge-npO6bZ8N.js similarity index 94% rename from assets/ExternalSourceEvalBadge-CimjRPVg.js rename to assets/ExternalSourceEvalBadge-npO6bZ8N.js index 00e98660f9afbcb8119144994396069369195c45..efffe319411c80208a7d56027279e25fc5d4b0f2 100644 --- a/assets/ExternalSourceEvalBadge-CimjRPVg.js +++ b/assets/ExternalSourceEvalBadge-npO6bZ8N.js @@ -1 +1 @@ -import{p as o}from"./curation-CkzNFTMJ.js";import{a5 as g,j as a,L as l}from"./index-YwiKC6Po.js";import{H as u,a as c,b as d}from"./hover-card-BY9tUGxy.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}; +import{p as o}from"./curation-C7Gmmp4z.js";import{a6 as g,j as a,L as l}from"./index-CbgxfyGU.js";import{H as u,a as c,b as d}from"./hover-card-ufez2uMo.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}; diff --git a/assets/FeedView-CFzlAcol.js b/assets/FeedView-BR2dQQ-K.js similarity index 93% rename from assets/FeedView-CFzlAcol.js rename to assets/FeedView-BR2dQQ-K.js index a4d4118c086153bc0aaefdea196db6f98ac52afc..701a3955cfa934f16c365679e7a2edf3fda02d98 100644 --- a/assets/FeedView-CFzlAcol.js +++ b/assets/FeedView-BR2dQQ-K.js @@ -1 +1 @@ -import{j as e,L as E,a as Se,b as Te,r as h,h as _e,C as Pe,c as be,d as Ce,e as Fe,f as Ee,i as Le,g as ne,k as ye,l as Ae}from"./index-YwiKC6Po.js";import{S as De}from"./sparkles-C3L7JDLC.js";import{u as R}from"./useQuery-DPH6Mb2w.js";import{D as Re,a as qe,b as Me}from"./dialog-foxx0Wu6.js";import{c as ee}from"./catalog-B15Yh5dN.js";import{T as pe,r as B}from"./research-5UpiU-ea.js";import{d as ie,t as Ie}from"./transform-CNg3rvXk.js";import{u as je,a as ve,s as Oe,b as He,r as he,c as me,d as $e}from"./researchTopic-CAL_T-Y-.js";import{P as ze}from"./plus-Cfz0QbT1.js";import{A as Ke}from"./arrow-right-CSx7rJG4.js";import{r as Be,P as Ue,w as Ge,a as Qe}from"./PaperFeed-kaLm5US2.js";import{M as We}from"./McpShowcase-Fj71TTNl.js";import{u as Xe,a as Ye,P as Ze,i as Ve,A as Je,b as es,S as $,c as ss,D as se,q as ts,d as as}from"./chatSessions-CdNQ1toA.js";import{c as os}from"./chat-DHGOonJg.js";import{u as ns}from"./usePapers-C1deOZKl.js";import{p as J,a as ge}from"./paperQueryKeys-C5FMa4Oj.js";import{S as te}from"./skeleton-CXR1qouH.js";import{A as ae,a as oe}from"./alert-Cx5luC5D.js";import"./useMutation-f6iDkf3w.js";import"./PaperCard-FG-bEpJk.js";import"./AuthorAvatar-CoTET6B3.js";import"./SotaBadges-DiQuEzfo.js";import"./colors-BkWRhvFI.js";import"./Icon-DXQ4sjQk.js";import"./LatexTitle-DI6voLfI.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D7ygxg37.js";import"./useIntersectionObserver-Dt36kyjs.js";import"./AgentLogos-DhD8p5ds.js";import"./useInfiniteQuery-BEbL80ez.js";import"./curation-CkzNFTMJ.js";function is({onBuild:r}){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:"Describe a topic in your own words, or follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),r&&e.jsxs("button",{type:"button",className:"research-topic-save following-intro-topic",onClick:r,children:[e.jsx(De,{"aria-hidden":"true"}),"Build your feed"]}),e.jsxs("p",{className:"following-intro-note",children:["Matching papers also arrive as a weekly email, which you can turn off in"," ",e.jsx(E,{to:"/settings",children:"Settings"}),"."]})]})}const fe=16;function rs({open:r,onOpenChange:a}){return e.jsx(Re,{open:r,onOpenChange:a,children:e.jsx(qe,{className:"topic-dialog","aria-describedby":void 0,children:e.jsx(ls,{onDone:()=>a(!1)})})})}function ls({onDone:r}){var W,X,Y,Z,H,z,U;const{user:a}=Se(),m=Te(),l=R({queryKey:["research-topic",a==null?void 0:a.hf_subject],queryFn:B.topic,enabled:!!a}),s=R({queryKey:["research-follows",a==null?void 0:a.hf_subject],queryFn:B.follows,enabled:!!a}),w=R({queryKey:["trending-tasks-follow"],queryFn:()=>ee.trendingTasks({limit:fe,level:0}),staleTime:10*60*1e3}),y=R({queryKey:["trending-methods-follow"],queryFn:()=>ee.trendingMethods({limit:fe}),staleTime:10*60*1e3}),c=R({queryKey:["research-follow-suggestions"],queryFn:B.followSuggestions,staleTime:10*60*1e3}),j=(i=[])=>i.map(p=>({id:String(p.entity_id),name:p.name,image:p.image_url})),[k,L]=h.useState(null),[_,v]=h.useState([]),P=je(),M=ve(),b=((W=l.data)==null?void 0:W.text)??"",n=k??b,d=n.trim().replace(/\s+/g," "),C=((X=l.data)==null?void 0:X.status)==="failed"&&d===b,A=d.length>=3&&(d!==b||C),D=P.isPending||M.isPending,o=(i,p)=>{var N;return((N=s.data)==null?void 0:N.some(S=>S.kind===i&&String(S.entity_id)===p))??!1},g=(i,p)=>{var N;return((N=_.find(S=>S.kind===i&&S.id===p))==null?void 0:N.follow)??o(i,p)},f=_.filter(i=>i.follow!==o(i.kind,i.id)),F=!D&&(A||f.length>0),q=(i,p,N)=>v(S=>[...S.filter(G=>G.kind!==i||G.id!==p),{kind:i,id:p,name:N,follow:!g(i,p)}]),I=()=>{if(!F)return;if(!a){A&&Oe(d),f.length&&He(f),window.location.href=_e(`${m.pathname}${m.search}`);return}const i=[...f.length?[M.mutateAsync(f)]:[],...A?[P.mutateAsync(d)]:[]];Promise.allSettled(i).then(p=>{p.every(N=>N.status==="fulfilled")&&r()})},O=(i,p,N,S)=>{const V=[...(s.data??[]).filter(x=>x.kind===p).map(x=>({id:String(x.entity_id),name:x.name,slug:x.url.split("/").pop(),image:x.image_url})),...N.filter(x=>!o(p,x.id)).map(x=>({...x,suggested:!0}))];return V.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:i}),e.jsxs(cs,{children:[V.map(x=>{const Q=g(p,x.id),K=p==="task"?ie(x.name,x.slug??void 0):x.name;return e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":Q,disabled:D,"data-suggested":"suggested"in x||void 0,onClick:()=>q(p,x.id,K),children:[Q?e.jsx(Pe,{"aria-hidden":"true"}):e.jsx(ze,{"aria-hidden":"true"}),(p==="author"||p==="organization")&&e.jsx(ds,{kind:p,name:K,src:x.image}),K]},x.id)}),S&&e.jsxs(E,{to:S.to,className:"topic-dialog-browse",children:[S.label,e.jsx(Ke,{"aria-hidden":"true"})]})]})]})};return e.jsxs("form",{className:"topic-dialog-form",onSubmit:i=>{i.preventDefault(),I()},children:[e.jsx(Me,{className:"topic-dialog-title",children:b||(Y=s.data)!=null&&Y.length?"Edit your research feed":"Build your research feed"}),e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:e.jsx("label",{htmlFor:"topic-dialog-input",children:"Describe a topic in your own words"})}),e.jsx("p",{className:"topic-dialog-hint",children:"A model reads every new paper and adds the ones that match to your Following feed."}),e.jsx("textarea",{id:"topic-dialog-input",className:"research-topic-input",rows:4,maxLength:pe,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation, or speculative decoding for LLM inference",value:n,onChange:i=>L(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&(i.preventDefault(),I())}}),e.jsxs("span",{className:"research-topic-count",children:[n.length,"/",pe]})]}),O("Trending tasks","task",((Z=w.data)==null?void 0:Z.results)??[],{to:"/tasks",label:"Browse tasks"}),O("Trending methods","method",((H=y.data)==null?void 0:H.results)??[],{to:"/methods",label:"Browse methods"}),O("Benchmarks","benchmark",[],{to:"/tasks",label:"Browse benchmarks"}),O("Popular authors","author",j((z=c.data)==null?void 0:z.authors)),O("Popular organizations","organization",j((U=c.data)==null?void 0:U.organizations),{to:"/organizations",label:"Browse organizations"}),(P.error||M.error)&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your feed. Please try again."}),e.jsxs("div",{className:"topic-dialog-actions",children:[b&&e.jsx("button",{type:"button",className:"research-follow-action topic-dialog-remove",disabled:D,onClick:()=>P.mutate(null,{onSuccess:r}),children:"Remove topic"}),e.jsx("button",{type:"button",className:"research-follow-action",disabled:D,onClick:r,children:"Cancel"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:!F,children:f.some(i=>i.follow===!1)?"Save":f.length?"Follow":C?"Retry":b?"Update topic":"Follow"})]})]})}function cs({children:r}){const a=h.useRef(null);return h.useLayoutEffect(()=>{const m=a.current;if(!m)return;const l=()=>{const s=[...m.children],w=s.filter(c=>c.dataset.suggested);w.forEach(c=>{c.hidden=!1});const y=()=>new Set(s.filter(c=>!c.hidden).map(c=>c.offsetTop)).size;for(let c=w.length-1;c>=0&&y()>2;c--)w[c].hidden=!0};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}),e.jsx("div",{ref:a,className:"topic-dialog-chips",children:r})}function ds({kind:r,name:a,src:m}){const[l,s]=h.useState(!1);if(m&&!l)return e.jsx("img",{className:`topic-dialog-chip-image is-${r}`,src:m,alt:"",loading:"lazy",onError:()=>s(!0)});if(r!=="author")return null;const w=a.split(/\s+/).filter(Boolean).map(y=>y[0]).slice(0,2).join("").toUpperCase();return e.jsx("span",{className:"topic-dialog-chip-image is-author is-initials","aria-hidden":"true",children:w})}const xe=45,us=1800,ps=25,hs=350,ms=r=>{const[a,m]=h.useState($[0].slice(0,1)),[l,s]=h.useState(0);return h.useEffect(()=>{var L,_;if(!r)return;if((_=(L=window.matchMedia)==null?void 0:L.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){m($[0]),s(0);return}let w=0,y=1,c=!1,j;m($[0].slice(0,y)),s(0);const k=()=>{const v=$[w];if(!c){if(y+=1,m(v.slice(0,y)),y===v.length){c=!0,j=window.setTimeout(k,us);return}j=window.setTimeout(k,xe);return}if(y-=1,m(v.slice(0,y)),y===0){c=!1,w=(w+1)%$.length,s(w),j=window.setTimeout(k,hs);return}j=window.setTimeout(k,ps)};return j=window.setTimeout(k,xe),()=>window.clearTimeout(j)},[r]),{placeholder:a,prompt:$[l]}},gs=()=>{var D;const r=be(),a=ye(),[m,l]=h.useState({text:"",paperMentions:[]}),s=m.text,[w,y]=h.useState(0),[c,j]=h.useState(!1),[k,L]=h.useState(null),{placeholder:_,prompt:v}=ms(!s),P=h.useRef(null),M=R({queryKey:["chatAvailability"],queryFn:()=>os.getAvailability(),retry:!1,enabled:ne()}),b=ne()&&((D=M.data)==null?void 0:D.paper_mentions_enabled)!==!1,n=Xe({draft:m,onChange:l,enabled:b,textareaRef:P}),d=Ye(m,n.open),C=s?d.completion:v;h.useLayoutEffect(()=>{const o=P.current;if(!o)return;const g=()=>{if(o.style.height="auto",s){o.style.height=`${Math.min(ss(o),160)}px`;return}const f=o.placeholder,F=$.reduce((q,I)=>(o.placeholder=I,Math.max(q,o.scrollHeight)),0);o.placeholder=f,o.style.height=`${Math.min(F,160)}px`};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[s,C]);const A=async(o=m)=>{const g=o.text.trim();if(!(!g||c)){if(a){const f=new URLSearchParams({q:g,model:se}),F=`${Ae}?${f}`,q=window.open(F,"_blank");if(!q){L(F);return}q.opener=null,L(null),l({text:"",paperMentions:[]});return}j(!0),ts(o,se);try{const f=await as(se);r(`/chat/${f.id}`)}catch{r("/chat")}}};return e.jsxs(e.Fragment,{children:[!a&&e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context, or press Tab to use a suggestion"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-row",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(Ze,{text:m.text,mentions:m.paperMentions,scrollTop:w,variant:"home",completion:s?C:""}),e.jsx("textarea",{ref:P,rows:1,value:s,placeholder:_,"aria-label":"Ask the assistant",disabled:c,onChange:o=>{n.updateText(o.target.value,o.target.selectionStart),d.trackCaret(o.target)},onSelect:o=>{n.refresh(o.currentTarget.selectionStart),d.trackCaret(o.currentTarget)},onClick:o=>{n.refresh(o.currentTarget.selectionStart),d.trackCaret(o.currentTarget)},onScroll:o=>y(o.currentTarget.scrollTop),onBlur:o=>{var g,f;(f=(g=o.relatedTarget)==null?void 0:g.closest)!=null&&f.call(g,".chat-paper-picker")||window.setTimeout(n.close,0)},onKeyDown:o=>{if(!n.keyDown(o)){if(Ve(o)&&C){o.preventDefault();const g=s+C;n.updateText(g,g.length),window.requestAnimationFrame(()=>{var f;return(f=P.current)==null?void 0:f.setSelectionRange(g.length,g.length)});return}o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),A())}},role:b?"combobox":void 0,"aria-expanded":b?n.open:void 0,"aria-controls":n.open?n.pickerId:void 0,"aria-activedescendant":n.open&&n.results.length?`${n.optionIdPrefix}-${n.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":n.message?"ask-home-paper-mention-message":void 0})]}),e.jsx("button",{type:"button",className:`chat-send${s.trim()?" chat-send-on":""}`,onClick:()=>void A(),disabled:!s.trim()||c,"aria-label":"Ask the assistant",children:e.jsx(Je,{})})]}),k&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:k,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),n.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:n.message}),e.jsx(es,{open:n.open,query:n.query,results:n.results,activeIndex:n.activeIndex,loading:n.loading,error:n.error,onSelect:n.select,id:n.pickerId,optionIdPrefix:n.optionIdPrefix})]})]})},Ne={task:"Tasks",method:"Methods",benchmark:"Benchmarks",author:"Authors",organization:"Orgs"},fs=Object.keys(Ne),xs=30,we=40,ws=async r=>{const a=await r;return{results:a.results.map(m=>({paper:m})),next_page:a.next_page}},bs=({mode:r})=>{var Q,K,re,le,ce,de,ue;const a=r==="following",m=be(),l=Ce(),s=l==null?void 0:l.user,[w,y]=Fe(),c=Be(w,void 0,a?"month":"week"),j=t=>{const u=new URLSearchParams(w);u.delete("order_by"),u.delete("only");const T=u.toString();m(T?`${t}?${T}`:t)},k=t=>{const u=new URLSearchParams(w);t?u.set("only","topic"):u.delete("only");const T=u.toString();return T?`/following?${T}`:"/following"},L=R({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),staleTime:10*60*1e3}),_=R({queryKey:["trending-tasks-sidebar"],queryFn:()=>ee.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),v=a&&w.get("only")==="topic",P={start_date:c.startDate,end_date:c.endDate},M={...c,topicOnly:v},b=ns(a?[...J.feeds.following,s==null?void 0:s.hf_subject,M]:[...r==="x"?J.feeds.xTrending:J.feeds.trending,P],async t=>{if(a){const T=await B.following(t,M),ke=T.length===we?t+we:null;return{results:T,next_page:ke}}const u={...P,page:t,page_size:xs,include_resources:!0};return ws(r==="x"?ge.xTrending(u):ge.list({...u,order_by:"trending",order_dir:"desc",latest_only:!0}))},{enabled:!a||!!s,initialPage:a?0:1}),n=R({queryKey:["research-follows",s==null?void 0:s.hf_subject],queryFn:B.follows,enabled:a&&!!s}),d=R({queryKey:["research-topic",s==null?void 0:s.hf_subject],queryFn:B.topic,enabled:a&&!!s,refetchInterval:t=>t.state.data&&["pending","running"].includes(t.state.data.status)?1e4:!1}),C=!!d.data&&["pending","running"].includes(d.data.status),A=d.data?d.data.label??d.data.text:"",[D,o]=h.useState(!1),g=Ee(),f=h.useRef(!1);h.useEffect(()=>{f.current&&!C&&g.invalidateQueries({queryKey:[...J.feeds.following,s==null?void 0:s.hf_subject]}),f.current=C},[C,g,s==null?void 0:s.hf_subject]);const F=a&&!!s&&((Q=n.data)==null?void 0:Q.length)===0&&d.isSuccess&&!d.data,q=a&&!(l!=null&&l.isLoading)&&!s||F,I=!!s||!Le(),[O,W]=h.useState(!1),[X]=h.useState(()=>!!he()||me().length>0),[Y,Z]=h.useState(!1);!O&&(d.data||(K=n.data)!=null&&K.length)&&W(!0),q&&!Y&&(Z(!0),I&&!O&&!X&&o(!0));const H=je(),{mutate:z}=H,U=h.useRef(!1);h.useEffect(()=>{var u;const t=he();!s||!d.isSuccess||!t||U.current||(U.current=!0,t===((u=d.data)==null?void 0:u.text)?$e():z(t))},[s,d.isSuccess,d.data,z]);const i=ve(),{mutate:p}=i,N=h.useRef(!1);h.useEffect(()=>{const t=me();!s||!t.length||N.current||(N.current=!0,p(t))},[s,p]);const S=h.useMemo(()=>fs.map(t=>{var u;return{kind:t,follows:a?((u=n.data)==null?void 0:u.filter(T=>T.kind===t))??[]:[]}}).filter(t=>t.follows.length>0),[a,n.data]),G=a&&(!!(l!=null&&l.isLoading)||!!s&&!F),V=h.useMemo(()=>{var t;return((t=b.data)==null?void 0:t.pages.flatMap(u=>u.results.map(T=>({...Ie(T.paper),followReasons:T.reasons}))))??[]},[b.data]),x=b.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:r==="x"?"Papers people share most on X, picked daily":"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar feed-sidebar",children:[G?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((l==null?void 0:l.isLoading)||n.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((t,u)=>e.jsx(te,{className:"h-5 w-full"},u))}),n.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[d.data&&e.jsxs("div",{className:`sidebar-follow-topic ${v?"active":""}`,children:[e.jsxs(E,{to:k(!v),className:"sidebar-link sidebar-follow-link",title:v?"Show papers from everything you follow":`Show only papers about “${d.data.text}”`,"aria-current":v?"true":void 0,children:[e.jsx("span",{className:"sidebar-follow-kind",children:"Topic"}),e.jsx("span",{className:"sidebar-follow-name",children:A})]}),e.jsx("button",{type:"button",className:"sidebar-follow-edit","aria-label":"Edit topic","aria-expanded":D,onClick:()=>o(!0),children:"edit"})]}),S.map(t=>e.jsxs("div",{className:"sidebar-follow-group",children:[e.jsx("span",{className:"sidebar-follow-kind",children:Ne[t.kind]}),t.follows.map(u=>e.jsx(E,{to:u.url,className:"sidebar-link sidebar-follow-link",children:e.jsx("span",{className:"sidebar-follow-name",children:u.name})},u.entity_id))]},t.kind))]}),e.jsx(E,{to:"/settings",className:"sidebar-follow-manage",children:"Manage in Settings"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-section sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),L.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((t,u)=>e.jsx(te,{className:"h-5 w-full"},u))}),e.jsxs("div",{className:"sidebar-links",children:[(re=L.data)==null?void 0:re.map(t=>e.jsxs(E,{to:`/tasks/${t.slug}`,className:"sidebar-link",children:[ie(t.name,t.slug),t.paper_count!=null&&e.jsx("span",{className:"count",children:t.paper_count})]},t.id)),e.jsx(E,{to:"/tasks",className:"sidebar-link sidebar-link-more",children:"all domains →"})]})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),_.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((t,u)=>e.jsx(te,{className:"h-5 w-full"},u))}),((ce=(le=_.data)==null?void 0:le.results)==null?void 0:ce.length)===0&&!_.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),e.jsx("div",{className:"sidebar-links",children:(ue=(de=_.data)==null?void 0:de.results)==null?void 0:ue.map(t=>e.jsxs(E,{to:`/tasks/${t.slug}`,className:"sidebar-link",children:[ie(t.name,t.slug),e.jsxs("span",{className:"count",children:[t.share_lift.toFixed(1),"x"]})]},t.id))})]})]}),e.jsx(We,{})]}),e.jsxs("div",{className:"feed-main",children:[(ne()||ye())&&e.jsx("div",{className:"feed-chat",children:e.jsx(gs,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsx("div",{className:"paper-feed-toolbar-controls",children:e.jsxs("div",{className:"sort-options",children:[e.jsx("button",{className:`sort-btn ${r==="trending"?"active":""}`,onClick:()=>j("/"),children:"trending"}),e.jsx("button",{className:`sort-btn ${r==="x"?"active":""}`,onClick:()=>j("/x-trending"),children:"trending (X)"}),e.jsx("button",{className:`sort-btn ${a?"active":""}`,onClick:()=>j("/following"),children:"following"})]})}),e.jsx(Ue,{startDate:c.startDate,endDate:c.endDate,onChange:t=>y(Ge(w,t))})]}),x&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(oe,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void b.refetch(),children:"Try again"})]})}),H.isError&&H.variables&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(oe,{children:["Could not follow “",H.variables,"”. ",e.jsx("button",{type:"button",onClick:()=>z(H.variables),children:"Try again"})]})}),i.isError&&i.variables&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(oe,{children:["Could not follow ",i.variables.map(t=>t.name).join(", "),". ",e.jsx("button",{type:"button",onClick:()=>p(i.variables),children:"Try again"})]})}),a&&!!s&&d.isSuccess&&!n.isPending&&!F&&(d.data?C?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Showing the closest papers about “",A,"” now. A model is reading papers to refine these matches, which takes a few minutes."]}):null:e.jsxs("div",{className:"following-topic-note",role:"status",children:["Describe a topic in your own words, and a model adds matching new papers to this feed."," ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>o(!0),children:"Follow a topic"})]})),a&&I&&e.jsx(rs,{open:D,onOpenChange:o}),v&&d.data&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about “",A,"”."," ",e.jsx(E,{to:k(!1),children:"Show everything you follow"})]}),q?e.jsx(is,{onBuild:I?()=>o(!0):void 0}):e.jsx(Qe,{query:b,isLoading:b.isLoading||a&&!!(l!=null&&l.isLoading),cards:V,skeleton:"card",rootMargin:"400px",empty:x?null:v?e.jsxs(e.Fragment,{children:["No papers about your topic match these filters. Widen the date range or ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>o(!0),children:"edit your topic"}),"."]}):a?e.jsxs(e.Fragment,{children:["No papers from your topic or follows match these filters. Widen the date range, or follow more from ",e.jsx(E,{to:"/tasks",children:"tasks"}),", ",e.jsx(E,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):r==="x"?"No papers shared on X in this window.":"No papers in this window."})]})]})]})]})},Zs=({xTrending:r=!1})=>e.jsx(bs,{mode:r?"x":"trending"});export{gs as AskAssistant,bs as HomeFeed,Zs as default}; +import{j as e,L as E,a as Se,b as Te,r as h,h as _e,C as Pe,c as be,d as Ce,e as Fe,f as Ee,i as Le,g as ne,k as ye,l as Ae}from"./index-CbgxfyGU.js";import{S as De}from"./sparkles-BqBXJPmy.js";import{u as R}from"./useQuery-Bx9s5-D2.js";import{D as Re,a as qe,b as Me}from"./dialog-Cfp_d3CC.js";import{c as ee}from"./catalog-DhK7_9-6.js";import{T as pe,r as B}from"./research-DgpyzSy_.js";import{d as ie,t as Ie}from"./transform-0Udg2p6b.js";import{u as je,a as ve,s as Oe,b as He,r as he,c as me,d as $e}from"./researchTopic-CteUev4M.js";import{P as ze}from"./plus-UK0TEjgd.js";import{A as Ke}from"./arrow-right-DotD9yNb.js";import{r as Be,P as Ue,w as Ge,a as Qe}from"./PaperFeed-DMvUfA47.js";import{M as We}from"./McpShowcase-CMLfdJM2.js";import{u as Xe,a as Ye,P as Ze,i as Ve,A as Je,b as es,S as $,c as ss,D as se,q as ts,d as as}from"./chatSessions-DwLUbLRo.js";import{c as os}from"./chat-DzTo2WUO.js";import{u as ns}from"./usePapers-CJaWLZ3y.js";import{p as J,a as ge}from"./paperQueryKeys-B8u1BWlI.js";import{S as te}from"./skeleton-HwvdxvSN.js";import{A as ae,a as oe}from"./alert-CFDDvdIM.js";import"./useMutation-P_trTy9i.js";import"./PaperCard-tdTC_dRN.js";import"./AuthorAvatar-CUJMmp_z.js";import"./SotaBadges-C-sTR-EF.js";import"./colors-BkWRhvFI.js";import"./Icon-D-kA0Owz.js";import"./LatexTitle-Z-HGmZ-H.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DKJYnYjk.js";import"./useIntersectionObserver-CID9Kkak.js";import"./AgentLogos-BBl9UNVD.js";import"./useInfiniteQuery-BAc_4HO5.js";import"./curation-C7Gmmp4z.js";function is({onBuild:r}){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:"Describe a topic in your own words, or follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),r&&e.jsxs("button",{type:"button",className:"research-topic-save following-intro-topic",onClick:r,children:[e.jsx(De,{"aria-hidden":"true"}),"Build your feed"]}),e.jsxs("p",{className:"following-intro-note",children:["Matching papers also arrive as a weekly email, which you can turn off in"," ",e.jsx(E,{to:"/settings",children:"Settings"}),"."]})]})}const fe=16;function rs({open:r,onOpenChange:a}){return e.jsx(Re,{open:r,onOpenChange:a,children:e.jsx(qe,{className:"topic-dialog","aria-describedby":void 0,children:e.jsx(ls,{onDone:()=>a(!1)})})})}function ls({onDone:r}){var W,X,Y,Z,H,z,U;const{user:a}=Se(),m=Te(),l=R({queryKey:["research-topic",a==null?void 0:a.hf_subject],queryFn:B.topic,enabled:!!a}),s=R({queryKey:["research-follows",a==null?void 0:a.hf_subject],queryFn:B.follows,enabled:!!a}),w=R({queryKey:["trending-tasks-follow"],queryFn:()=>ee.trendingTasks({limit:fe,level:0}),staleTime:10*60*1e3}),y=R({queryKey:["trending-methods-follow"],queryFn:()=>ee.trendingMethods({limit:fe}),staleTime:10*60*1e3}),c=R({queryKey:["research-follow-suggestions"],queryFn:B.followSuggestions,staleTime:10*60*1e3}),j=(i=[])=>i.map(p=>({id:String(p.entity_id),name:p.name,image:p.image_url})),[k,L]=h.useState(null),[_,v]=h.useState([]),P=je(),M=ve(),b=((W=l.data)==null?void 0:W.text)??"",n=k??b,d=n.trim().replace(/\s+/g," "),C=((X=l.data)==null?void 0:X.status)==="failed"&&d===b,A=d.length>=3&&(d!==b||C),D=P.isPending||M.isPending,o=(i,p)=>{var N;return((N=s.data)==null?void 0:N.some(S=>S.kind===i&&String(S.entity_id)===p))??!1},g=(i,p)=>{var N;return((N=_.find(S=>S.kind===i&&S.id===p))==null?void 0:N.follow)??o(i,p)},f=_.filter(i=>i.follow!==o(i.kind,i.id)),F=!D&&(A||f.length>0),q=(i,p,N)=>v(S=>[...S.filter(G=>G.kind!==i||G.id!==p),{kind:i,id:p,name:N,follow:!g(i,p)}]),I=()=>{if(!F)return;if(!a){A&&Oe(d),f.length&&He(f),window.location.href=_e(`${m.pathname}${m.search}`);return}const i=[...f.length?[M.mutateAsync(f)]:[],...A?[P.mutateAsync(d)]:[]];Promise.allSettled(i).then(p=>{p.every(N=>N.status==="fulfilled")&&r()})},O=(i,p,N,S)=>{const V=[...(s.data??[]).filter(x=>x.kind===p).map(x=>({id:String(x.entity_id),name:x.name,slug:x.url.split("/").pop(),image:x.image_url})),...N.filter(x=>!o(p,x.id)).map(x=>({...x,suggested:!0}))];return V.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:i}),e.jsxs(cs,{children:[V.map(x=>{const Q=g(p,x.id),K=p==="task"?ie(x.name,x.slug??void 0):x.name;return e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":Q,disabled:D,"data-suggested":"suggested"in x||void 0,onClick:()=>q(p,x.id,K),children:[Q?e.jsx(Pe,{"aria-hidden":"true"}):e.jsx(ze,{"aria-hidden":"true"}),(p==="author"||p==="organization")&&e.jsx(ds,{kind:p,name:K,src:x.image}),K]},x.id)}),S&&e.jsxs(E,{to:S.to,className:"topic-dialog-browse",children:[S.label,e.jsx(Ke,{"aria-hidden":"true"})]})]})]})};return e.jsxs("form",{className:"topic-dialog-form",onSubmit:i=>{i.preventDefault(),I()},children:[e.jsx(Me,{className:"topic-dialog-title",children:b||(Y=s.data)!=null&&Y.length?"Edit your research feed":"Build your research feed"}),e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:e.jsx("label",{htmlFor:"topic-dialog-input",children:"Describe a topic in your own words"})}),e.jsx("p",{className:"topic-dialog-hint",children:"A model reads every new paper and adds the ones that match to your Following feed."}),e.jsx("textarea",{id:"topic-dialog-input",className:"research-topic-input",rows:4,maxLength:pe,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation, or speculative decoding for LLM inference",value:n,onChange:i=>L(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&(i.preventDefault(),I())}}),e.jsxs("span",{className:"research-topic-count",children:[n.length,"/",pe]})]}),O("Trending tasks","task",((Z=w.data)==null?void 0:Z.results)??[],{to:"/tasks",label:"Browse tasks"}),O("Trending methods","method",((H=y.data)==null?void 0:H.results)??[],{to:"/methods",label:"Browse methods"}),O("Benchmarks","benchmark",[],{to:"/tasks",label:"Browse benchmarks"}),O("Popular authors","author",j((z=c.data)==null?void 0:z.authors)),O("Popular organizations","organization",j((U=c.data)==null?void 0:U.organizations),{to:"/organizations",label:"Browse organizations"}),(P.error||M.error)&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your feed. Please try again."}),e.jsxs("div",{className:"topic-dialog-actions",children:[b&&e.jsx("button",{type:"button",className:"research-follow-action topic-dialog-remove",disabled:D,onClick:()=>P.mutate(null,{onSuccess:r}),children:"Remove topic"}),e.jsx("button",{type:"button",className:"research-follow-action",disabled:D,onClick:r,children:"Cancel"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:!F,children:f.some(i=>i.follow===!1)?"Save":f.length?"Follow":C?"Retry":b?"Update topic":"Follow"})]})]})}function cs({children:r}){const a=h.useRef(null);return h.useLayoutEffect(()=>{const m=a.current;if(!m)return;const l=()=>{const s=[...m.children],w=s.filter(c=>c.dataset.suggested);w.forEach(c=>{c.hidden=!1});const y=()=>new Set(s.filter(c=>!c.hidden).map(c=>c.offsetTop)).size;for(let c=w.length-1;c>=0&&y()>2;c--)w[c].hidden=!0};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}),e.jsx("div",{ref:a,className:"topic-dialog-chips",children:r})}function ds({kind:r,name:a,src:m}){const[l,s]=h.useState(!1);if(m&&!l)return e.jsx("img",{className:`topic-dialog-chip-image is-${r}`,src:m,alt:"",loading:"lazy",onError:()=>s(!0)});if(r!=="author")return null;const w=a.split(/\s+/).filter(Boolean).map(y=>y[0]).slice(0,2).join("").toUpperCase();return e.jsx("span",{className:"topic-dialog-chip-image is-author is-initials","aria-hidden":"true",children:w})}const xe=45,us=1800,ps=25,hs=350,ms=r=>{const[a,m]=h.useState($[0].slice(0,1)),[l,s]=h.useState(0);return h.useEffect(()=>{var L,_;if(!r)return;if((_=(L=window.matchMedia)==null?void 0:L.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){m($[0]),s(0);return}let w=0,y=1,c=!1,j;m($[0].slice(0,y)),s(0);const k=()=>{const v=$[w];if(!c){if(y+=1,m(v.slice(0,y)),y===v.length){c=!0,j=window.setTimeout(k,us);return}j=window.setTimeout(k,xe);return}if(y-=1,m(v.slice(0,y)),y===0){c=!1,w=(w+1)%$.length,s(w),j=window.setTimeout(k,hs);return}j=window.setTimeout(k,ps)};return j=window.setTimeout(k,xe),()=>window.clearTimeout(j)},[r]),{placeholder:a,prompt:$[l]}},gs=()=>{var D;const r=be(),a=ye(),[m,l]=h.useState({text:"",paperMentions:[]}),s=m.text,[w,y]=h.useState(0),[c,j]=h.useState(!1),[k,L]=h.useState(null),{placeholder:_,prompt:v}=ms(!s),P=h.useRef(null),M=R({queryKey:["chatAvailability"],queryFn:()=>os.getAvailability(),retry:!1,enabled:ne()}),b=ne()&&((D=M.data)==null?void 0:D.paper_mentions_enabled)!==!1,n=Xe({draft:m,onChange:l,enabled:b,textareaRef:P}),d=Ye(m,n.open),C=s?d.completion:v;h.useLayoutEffect(()=>{const o=P.current;if(!o)return;const g=()=>{if(o.style.height="auto",s){o.style.height=`${Math.min(ss(o),160)}px`;return}const f=o.placeholder,F=$.reduce((q,I)=>(o.placeholder=I,Math.max(q,o.scrollHeight)),0);o.placeholder=f,o.style.height=`${Math.min(F,160)}px`};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[s,C]);const A=async(o=m)=>{const g=o.text.trim();if(!(!g||c)){if(a){const f=new URLSearchParams({q:g,model:se}),F=`${Ae}?${f}`,q=window.open(F,"_blank");if(!q){L(F);return}q.opener=null,L(null),l({text:"",paperMentions:[]});return}j(!0),ts(o,se);try{const f=await as(se);r(`/chat/${f.id}`)}catch{r("/chat")}}};return e.jsxs(e.Fragment,{children:[!a&&e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context, or press Tab to use a suggestion"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-row",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(Ze,{text:m.text,mentions:m.paperMentions,scrollTop:w,variant:"home",completion:s?C:""}),e.jsx("textarea",{ref:P,rows:1,value:s,placeholder:_,"aria-label":"Ask the assistant",disabled:c,onChange:o=>{n.updateText(o.target.value,o.target.selectionStart),d.trackCaret(o.target)},onSelect:o=>{n.refresh(o.currentTarget.selectionStart),d.trackCaret(o.currentTarget)},onClick:o=>{n.refresh(o.currentTarget.selectionStart),d.trackCaret(o.currentTarget)},onScroll:o=>y(o.currentTarget.scrollTop),onBlur:o=>{var g,f;(f=(g=o.relatedTarget)==null?void 0:g.closest)!=null&&f.call(g,".chat-paper-picker")||window.setTimeout(n.close,0)},onKeyDown:o=>{if(!n.keyDown(o)){if(Ve(o)&&C){o.preventDefault();const g=s+C;n.updateText(g,g.length),window.requestAnimationFrame(()=>{var f;return(f=P.current)==null?void 0:f.setSelectionRange(g.length,g.length)});return}o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),A())}},role:b?"combobox":void 0,"aria-expanded":b?n.open:void 0,"aria-controls":n.open?n.pickerId:void 0,"aria-activedescendant":n.open&&n.results.length?`${n.optionIdPrefix}-${n.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":n.message?"ask-home-paper-mention-message":void 0})]}),e.jsx("button",{type:"button",className:`chat-send${s.trim()?" chat-send-on":""}`,onClick:()=>void A(),disabled:!s.trim()||c,"aria-label":"Ask the assistant",children:e.jsx(Je,{})})]}),k&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:k,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),n.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:n.message}),e.jsx(es,{open:n.open,query:n.query,results:n.results,activeIndex:n.activeIndex,loading:n.loading,error:n.error,onSelect:n.select,id:n.pickerId,optionIdPrefix:n.optionIdPrefix})]})]})},Ne={task:"Tasks",method:"Methods",benchmark:"Benchmarks",author:"Authors",organization:"Orgs"},fs=Object.keys(Ne),xs=30,we=40,ws=async r=>{const a=await r;return{results:a.results.map(m=>({paper:m})),next_page:a.next_page}},bs=({mode:r})=>{var Q,K,re,le,ce,de,ue;const a=r==="following",m=be(),l=Ce(),s=l==null?void 0:l.user,[w,y]=Fe(),c=Be(w,void 0,a?"month":"week"),j=t=>{const u=new URLSearchParams(w);u.delete("order_by"),u.delete("only");const T=u.toString();m(T?`${t}?${T}`:t)},k=t=>{const u=new URLSearchParams(w);t?u.set("only","topic"):u.delete("only");const T=u.toString();return T?`/following?${T}`:"/following"},L=R({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),staleTime:10*60*1e3}),_=R({queryKey:["trending-tasks-sidebar"],queryFn:()=>ee.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),v=a&&w.get("only")==="topic",P={start_date:c.startDate,end_date:c.endDate},M={...c,topicOnly:v},b=ns(a?[...J.feeds.following,s==null?void 0:s.hf_subject,M]:[...r==="x"?J.feeds.xTrending:J.feeds.trending,P],async t=>{if(a){const T=await B.following(t,M),ke=T.length===we?t+we:null;return{results:T,next_page:ke}}const u={...P,page:t,page_size:xs,include_resources:!0};return ws(r==="x"?ge.xTrending(u):ge.list({...u,order_by:"trending",order_dir:"desc",latest_only:!0}))},{enabled:!a||!!s,initialPage:a?0:1}),n=R({queryKey:["research-follows",s==null?void 0:s.hf_subject],queryFn:B.follows,enabled:a&&!!s}),d=R({queryKey:["research-topic",s==null?void 0:s.hf_subject],queryFn:B.topic,enabled:a&&!!s,refetchInterval:t=>t.state.data&&["pending","running"].includes(t.state.data.status)?1e4:!1}),C=!!d.data&&["pending","running"].includes(d.data.status),A=d.data?d.data.label??d.data.text:"",[D,o]=h.useState(!1),g=Ee(),f=h.useRef(!1);h.useEffect(()=>{f.current&&!C&&g.invalidateQueries({queryKey:[...J.feeds.following,s==null?void 0:s.hf_subject]}),f.current=C},[C,g,s==null?void 0:s.hf_subject]);const F=a&&!!s&&((Q=n.data)==null?void 0:Q.length)===0&&d.isSuccess&&!d.data,q=a&&!(l!=null&&l.isLoading)&&!s||F,I=!!s||!Le(),[O,W]=h.useState(!1),[X]=h.useState(()=>!!he()||me().length>0),[Y,Z]=h.useState(!1);!O&&(d.data||(K=n.data)!=null&&K.length)&&W(!0),q&&!Y&&(Z(!0),I&&!O&&!X&&o(!0));const H=je(),{mutate:z}=H,U=h.useRef(!1);h.useEffect(()=>{var u;const t=he();!s||!d.isSuccess||!t||U.current||(U.current=!0,t===((u=d.data)==null?void 0:u.text)?$e():z(t))},[s,d.isSuccess,d.data,z]);const i=ve(),{mutate:p}=i,N=h.useRef(!1);h.useEffect(()=>{const t=me();!s||!t.length||N.current||(N.current=!0,p(t))},[s,p]);const S=h.useMemo(()=>fs.map(t=>{var u;return{kind:t,follows:a?((u=n.data)==null?void 0:u.filter(T=>T.kind===t))??[]:[]}}).filter(t=>t.follows.length>0),[a,n.data]),G=a&&(!!(l!=null&&l.isLoading)||!!s&&!F),V=h.useMemo(()=>{var t;return((t=b.data)==null?void 0:t.pages.flatMap(u=>u.results.map(T=>({...Ie(T.paper),followReasons:T.reasons}))))??[]},[b.data]),x=b.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:r==="x"?"Papers people share most on X, picked daily":"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar feed-sidebar",children:[G?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((l==null?void 0:l.isLoading)||n.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((t,u)=>e.jsx(te,{className:"h-5 w-full"},u))}),n.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[d.data&&e.jsxs("div",{className:`sidebar-follow-topic ${v?"active":""}`,children:[e.jsxs(E,{to:k(!v),className:"sidebar-link sidebar-follow-link",title:v?"Show papers from everything you follow":`Show only papers about “${d.data.text}”`,"aria-current":v?"true":void 0,children:[e.jsx("span",{className:"sidebar-follow-kind",children:"Topic"}),e.jsx("span",{className:"sidebar-follow-name",children:A})]}),e.jsx("button",{type:"button",className:"sidebar-follow-edit","aria-label":"Edit topic","aria-expanded":D,onClick:()=>o(!0),children:"edit"})]}),S.map(t=>e.jsxs("div",{className:"sidebar-follow-group",children:[e.jsx("span",{className:"sidebar-follow-kind",children:Ne[t.kind]}),t.follows.map(u=>e.jsx(E,{to:u.url,className:"sidebar-link sidebar-follow-link",children:e.jsx("span",{className:"sidebar-follow-name",children:u.name})},u.entity_id))]},t.kind))]}),e.jsx(E,{to:"/settings",className:"sidebar-follow-manage",children:"Manage in Settings"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-section sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),L.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((t,u)=>e.jsx(te,{className:"h-5 w-full"},u))}),e.jsxs("div",{className:"sidebar-links",children:[(re=L.data)==null?void 0:re.map(t=>e.jsxs(E,{to:`/tasks/${t.slug}`,className:"sidebar-link",children:[ie(t.name,t.slug),t.paper_count!=null&&e.jsx("span",{className:"count",children:t.paper_count})]},t.id)),e.jsx(E,{to:"/tasks",className:"sidebar-link sidebar-link-more",children:"all domains →"})]})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),_.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((t,u)=>e.jsx(te,{className:"h-5 w-full"},u))}),((ce=(le=_.data)==null?void 0:le.results)==null?void 0:ce.length)===0&&!_.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),e.jsx("div",{className:"sidebar-links",children:(ue=(de=_.data)==null?void 0:de.results)==null?void 0:ue.map(t=>e.jsxs(E,{to:`/tasks/${t.slug}`,className:"sidebar-link",children:[ie(t.name,t.slug),e.jsxs("span",{className:"count",children:[t.share_lift.toFixed(1),"x"]})]},t.id))})]})]}),e.jsx(We,{})]}),e.jsxs("div",{className:"feed-main",children:[(ne()||ye())&&e.jsx("div",{className:"feed-chat",children:e.jsx(gs,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsx("div",{className:"paper-feed-toolbar-controls",children:e.jsxs("div",{className:"sort-options",children:[e.jsx("button",{className:`sort-btn ${r==="trending"?"active":""}`,onClick:()=>j("/"),children:"trending"}),e.jsx("button",{className:`sort-btn ${r==="x"?"active":""}`,onClick:()=>j("/x-trending"),children:"trending (X)"}),e.jsx("button",{className:`sort-btn ${a?"active":""}`,onClick:()=>j("/following"),children:"following"})]})}),e.jsx(Ue,{startDate:c.startDate,endDate:c.endDate,onChange:t=>y(Ge(w,t))})]}),x&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(oe,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void b.refetch(),children:"Try again"})]})}),H.isError&&H.variables&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(oe,{children:["Could not follow “",H.variables,"”. ",e.jsx("button",{type:"button",onClick:()=>z(H.variables),children:"Try again"})]})}),i.isError&&i.variables&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(oe,{children:["Could not follow ",i.variables.map(t=>t.name).join(", "),". ",e.jsx("button",{type:"button",onClick:()=>p(i.variables),children:"Try again"})]})}),a&&!!s&&d.isSuccess&&!n.isPending&&!F&&(d.data?C?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Showing the closest papers about “",A,"” now. A model is reading papers to refine these matches, which takes a few minutes."]}):null:e.jsxs("div",{className:"following-topic-note",role:"status",children:["Describe a topic in your own words, and a model adds matching new papers to this feed."," ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>o(!0),children:"Follow a topic"})]})),a&&I&&e.jsx(rs,{open:D,onOpenChange:o}),v&&d.data&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about “",A,"”."," ",e.jsx(E,{to:k(!1),children:"Show everything you follow"})]}),q?e.jsx(is,{onBuild:I?()=>o(!0):void 0}):e.jsx(Qe,{query:b,isLoading:b.isLoading||a&&!!(l!=null&&l.isLoading),cards:V,skeleton:"card",rootMargin:"400px",empty:x?null:v?e.jsxs(e.Fragment,{children:["No papers about your topic match these filters. Widen the date range or ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>o(!0),children:"edit your topic"}),"."]}):a?e.jsxs(e.Fragment,{children:["No papers from your topic or follows match these filters. Widen the date range, or follow more from ",e.jsx(E,{to:"/tasks",children:"tasks"}),", ",e.jsx(E,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):r==="x"?"No papers shared on X in this window.":"No papers in this window."})]})]})]})]})},Zs=({xTrending:r=!1})=>e.jsx(bs,{mode:r?"x":"trending"});export{gs as AskAssistant,bs as HomeFeed,Zs as default}; diff --git a/assets/FollowingView-BYs2N-nq.js b/assets/FollowingView-BYs2N-nq.js deleted file mode 100644 index fae284ce5c69a9723c163a9bdf5470e89480b77e..0000000000000000000000000000000000000000 --- a/assets/FollowingView-BYs2N-nq.js +++ /dev/null @@ -1 +0,0 @@ -import{j as o}from"./index-YwiKC6Po.js";import{HomeFeed as r}from"./FeedView-CFzlAcol.js";import"./sparkles-C3L7JDLC.js";import"./useQuery-DPH6Mb2w.js";import"./dialog-foxx0Wu6.js";import"./catalog-B15Yh5dN.js";import"./research-5UpiU-ea.js";import"./transform-CNg3rvXk.js";import"./researchTopic-CAL_T-Y-.js";import"./useMutation-f6iDkf3w.js";import"./plus-Cfz0QbT1.js";import"./arrow-right-CSx7rJG4.js";import"./PaperFeed-kaLm5US2.js";import"./PaperCard-FG-bEpJk.js";import"./AuthorAvatar-CoTET6B3.js";import"./SotaBadges-DiQuEzfo.js";import"./colors-BkWRhvFI.js";import"./Icon-DXQ4sjQk.js";import"./LatexTitle-DI6voLfI.js";import"./paperQueryKeys-C5FMa4Oj.js";import"./curation-CkzNFTMJ.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D7ygxg37.js";import"./skeleton-CXR1qouH.js";import"./useIntersectionObserver-Dt36kyjs.js";import"./McpShowcase-Fj71TTNl.js";import"./AgentLogos-DhD8p5ds.js";import"./chatSessions-CdNQ1toA.js";import"./chat-DHGOonJg.js";import"./usePapers-C1deOZKl.js";import"./useInfiniteQuery-BEbL80ez.js";import"./alert-Cx5luC5D.js";function D(){return o.jsx(r,{mode:"following"})}export{D as default}; diff --git a/assets/FollowingView-nVVViEvV.js b/assets/FollowingView-nVVViEvV.js new file mode 100644 index 0000000000000000000000000000000000000000..a99bc7dfd2b9ee90ee4636195d5470f104fa05ee --- /dev/null +++ b/assets/FollowingView-nVVViEvV.js @@ -0,0 +1 @@ +import{j as o}from"./index-CbgxfyGU.js";import{HomeFeed as r}from"./FeedView-BR2dQQ-K.js";import"./sparkles-BqBXJPmy.js";import"./useQuery-Bx9s5-D2.js";import"./dialog-Cfp_d3CC.js";import"./catalog-DhK7_9-6.js";import"./research-DgpyzSy_.js";import"./transform-0Udg2p6b.js";import"./researchTopic-CteUev4M.js";import"./useMutation-P_trTy9i.js";import"./plus-UK0TEjgd.js";import"./arrow-right-DotD9yNb.js";import"./PaperFeed-DMvUfA47.js";import"./PaperCard-tdTC_dRN.js";import"./AuthorAvatar-CUJMmp_z.js";import"./SotaBadges-C-sTR-EF.js";import"./colors-BkWRhvFI.js";import"./Icon-D-kA0Owz.js";import"./LatexTitle-Z-HGmZ-H.js";import"./paperQueryKeys-B8u1BWlI.js";import"./curation-C7Gmmp4z.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DKJYnYjk.js";import"./skeleton-HwvdxvSN.js";import"./useIntersectionObserver-CID9Kkak.js";import"./McpShowcase-CMLfdJM2.js";import"./AgentLogos-BBl9UNVD.js";import"./chatSessions-DwLUbLRo.js";import"./chat-DzTo2WUO.js";import"./usePapers-CJaWLZ3y.js";import"./useInfiniteQuery-BAc_4HO5.js";import"./alert-CFDDvdIM.js";function D(){return o.jsx(r,{mode:"following"})}export{D as default}; diff --git a/assets/FrameworksIndexView-CqtIM7jE.js b/assets/FrameworksIndexView-CQtYg5mA.js similarity index 96% rename from assets/FrameworksIndexView-CqtIM7jE.js rename to assets/FrameworksIndexView-CQtYg5mA.js index 15f6f40d43137025b30df0662e742184b1c453cc..0da3935b15b1b8f84c09ee5f37b8a7543bcb63ee 100644 --- a/assets/FrameworksIndexView-CqtIM7jE.js +++ b/assets/FrameworksIndexView-CQtYg5mA.js @@ -1 +1 @@ -import{c as d,j as e,L as c,K as m}from"./index-YwiKC6Po.js";import{u as h}from"./useQuery-DPH6Mb2w.js";import{I as p}from"./Icon-DXQ4sjQk.js";import{c as u}from"./catalog-B15Yh5dN.js";import{c as g,h as x}from"./colors-BkWRhvFI.js";import{P as f}from"./frameworks-DDA0P4Tf.js";const j={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},k=({platform:s})=>{const n=g(x(s));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:f[s]})},_=({framework:s})=>{const n=d(),t=`/papers?framework=${encodeURIComponent(s.slug)}`;return e.jsxs("article",{id:`framework-${s.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${s.name}`,onClick:a=>{a.target.closest("a, button")||n(t)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(t))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:s.name}),s.organization_name&&e.jsx("div",{className:"framework-card-org",children:s.organization_name})]}),s.platforms&&s.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:s.platforms.map(a=>e.jsx(k,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:s.description}),s.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),s.when_to_use]}),(s.github_url||s.docs_url||s.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[s.introducing_paper_arxiv_id&&e.jsx(c,{to:`/paper/${s.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),s.github_url&&s.paper_count>0&&e.jsxs(c,{to:t,className:"framework-link",children:["Implements ",s.paper_count," ",s.paper_count===1?"paper":"papers"]}),s.github_url&&s.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),s.github_url&&e.jsxs("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(p,{name:"github",size:13}),"GitHub"]}),s.docs_url&&s.docs_url!==s.github_url&&e.jsx("a",{href:s.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},F=()=>{var a;const s=h({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=s.data)==null?void 0:a.domains)??[],t=n.reduce((i,r)=>i+r.categories.reduce((l,o)=>l+o.frameworks.length,0),0);return m.useEffect(()=>{var r;const i=window.location.hash.slice(1);i&&((r=document.getElementById(i))==null||r.scrollIntoView())},[s.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."})]})}),s.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),s.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{className:"area-section-head",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"area-section-title",children:i.name}),e.jsx("div",{className:"area-section-description",children:i.description})]}),e.jsxs("div",{className:"area-section-meta",children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((r,l)=>r+l.frameworks.length,0)," frameworks"]})]}),i.categories.map(r=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:j,children:r.name}),r.description&&e.jsx("p",{className:"framework-category-blurb",children:r.description}),r.guide_url&&e.jsxs("a",{href:r.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[r.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[r.frameworks.length," ",r.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:r.frameworks.map(l=>e.jsx(_,{framework:l},l.slug))})]},r.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[t," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{_ as FrameworkCard,F as default}; +import{c as d,j as e,L as c,M as m}from"./index-CbgxfyGU.js";import{u as h}from"./useQuery-Bx9s5-D2.js";import{I as p}from"./Icon-D-kA0Owz.js";import{c as u}from"./catalog-DhK7_9-6.js";import{c as g,h as x}from"./colors-BkWRhvFI.js";import{P as f}from"./frameworks-DDA0P4Tf.js";const j={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},k=({platform:s})=>{const n=g(x(s));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:f[s]})},_=({framework:s})=>{const n=d(),t=`/papers?framework=${encodeURIComponent(s.slug)}`;return e.jsxs("article",{id:`framework-${s.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${s.name}`,onClick:a=>{a.target.closest("a, button")||n(t)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(t))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:s.name}),s.organization_name&&e.jsx("div",{className:"framework-card-org",children:s.organization_name})]}),s.platforms&&s.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:s.platforms.map(a=>e.jsx(k,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:s.description}),s.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),s.when_to_use]}),(s.github_url||s.docs_url||s.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[s.introducing_paper_arxiv_id&&e.jsx(c,{to:`/paper/${s.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),s.github_url&&s.paper_count>0&&e.jsxs(c,{to:t,className:"framework-link",children:["Implements ",s.paper_count," ",s.paper_count===1?"paper":"papers"]}),s.github_url&&s.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),s.github_url&&e.jsxs("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(p,{name:"github",size:13}),"GitHub"]}),s.docs_url&&s.docs_url!==s.github_url&&e.jsx("a",{href:s.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},F=()=>{var a;const s=h({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=s.data)==null?void 0:a.domains)??[],t=n.reduce((i,r)=>i+r.categories.reduce((l,o)=>l+o.frameworks.length,0),0);return m.useEffect(()=>{var r;const i=window.location.hash.slice(1);i&&((r=document.getElementById(i))==null||r.scrollIntoView())},[s.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."})]})}),s.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),s.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{className:"area-section-head",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"area-section-title",children:i.name}),e.jsx("div",{className:"area-section-description",children:i.description})]}),e.jsxs("div",{className:"area-section-meta",children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((r,l)=>r+l.frameworks.length,0)," frameworks"]})]}),i.categories.map(r=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:j,children:r.name}),r.description&&e.jsx("p",{className:"framework-category-blurb",children:r.description}),r.guide_url&&e.jsxs("a",{href:r.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[r.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[r.frameworks.length," ",r.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:r.frameworks.map(l=>e.jsx(_,{framework:l},l.slug))})]},r.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[t," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{_ as FrameworkCard,F as default}; diff --git a/assets/Icon-DXQ4sjQk.js b/assets/Icon-D-kA0Owz.js similarity index 97% rename from assets/Icon-DXQ4sjQk.js rename to assets/Icon-D-kA0Owz.js index 28e17a4b4ae5a1748ab0753adda73812b092fbe1..61ff91d89dc72f52ffedff413ad0cb975ff5033b 100644 --- a/assets/Icon-DXQ4sjQk.js +++ b/assets/Icon-D-kA0Owz.js @@ -1 +1 @@ -import{j as o}from"./index-YwiKC6Po.js";const s=({name:t,size:r=14})=>{const e={search:o.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:o.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:o.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:o.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:o.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:o.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:o.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:o.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:o.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:o.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:o.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:o.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:o.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:o.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:o.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:o.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:o.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),pencil:o.jsx("path",{d:"M10.5 2.5l3 3L6 13H3v-3l7.5-7.5zM9 4l3 3",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})};return o.jsx("svg",{className:r===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:r,height:r,children:e[t]})};export{s as I}; +import{j as o}from"./index-CbgxfyGU.js";const s=({name:t,size:r=14})=>{const e={search:o.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:o.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:o.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:o.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:o.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:o.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:o.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:o.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:o.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:o.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:o.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:o.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:o.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:o.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:o.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:o.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:o.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),pencil:o.jsx("path",{d:"M10.5 2.5l3 3L6 13H3v-3l7.5-7.5zM9 4l3 3",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})};return o.jsx("svg",{className:r===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:r,height:r,children:e[t]})};export{s as I}; diff --git a/assets/LatexTitle-DI6voLfI.js b/assets/LatexTitle-Z-HGmZ-H.js similarity index 98% rename from assets/LatexTitle-DI6voLfI.js rename to assets/LatexTitle-Z-HGmZ-H.js index f62e876fc6cae52b5a6276d0f89654d83cf3d8e3..ad7abde39989cd7cacfd60fab8aa956cf5ab9e3f 100644 --- a/assets/LatexTitle-DI6voLfI.js +++ b/assets/LatexTitle-Z-HGmZ-H.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-wklAmtGL.css"])))=>i.map(i=>d[i]); -import{j as u,r as A,a0 as L}from"./index-YwiKC6Po.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)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)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(;oe.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(;rr&&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}; +import{j as u,r as A,a1 as L}from"./index-CbgxfyGU.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)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)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(;oe.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(;rr&&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}; diff --git a/assets/MarkdownText-C-8yLDus.js b/assets/MarkdownText-Bj-G_S-B.js similarity index 86% rename from assets/MarkdownText-C-8yLDus.js rename to assets/MarkdownText-Bj-G_S-B.js index 992d5765bb3e8fe48f680646974d45cf52969a22..efb45890922d4bcd4897aa24f93336f022306504 100644 --- a/assets/MarkdownText-C-8yLDus.js +++ b/assets/MarkdownText-Bj-G_S-B.js @@ -1 +1 @@ -import{o as c,j as s,L as u}from"./index-YwiKC6Po.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-CKfmgBjs.js";import{M as h}from"./index-CoRCN2p0.js";import{r as f}from"./index-BM_xSDJM.js";function w(e){return(e??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean)}const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1",...w(void 0)]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function k(e,a=window.location.origin){if(!e)return null;let t;if(e.startsWith("/"))t=e;else try{const n=new URL(e,a);if(!x.has(n.hostname))return null;t=`${n.pathname}${n.search}${n.hash}`}catch{return null}const r=t.split(/[?#]/,1)[0];return P.some(n=>r===n||r.startsWith(`${n}/`))?t:null}function I(e){const t=e.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const r=t[1],n=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(r),o=/^[1-9]\d*$/.test(r);return!n&&!o?null:c(r)}const M=({text:e,className:a=""})=>s.jsx("div",{className:a,children:s.jsx(h,{remarkPlugins:[f,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:n,...o})=>{const i=k(t);if(i){const l=I(i);return l?s.jsx(d,{routeId:l,to:i,...o,children:r}):s.jsx(u,{to:i,...o,children:r})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...o,children:r})}},children:e})});export{M,k as r}; +import{o as c,j as s,L as u}from"./index-CbgxfyGU.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-DZDNIh1g.js";import{M as h}from"./index-ZkEATkOr.js";import{r as f}from"./index-BH3yOoza.js";function w(e){return(e??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean)}const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1",...w(void 0)]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function k(e,a=window.location.origin){if(!e)return null;let t;if(e.startsWith("/"))t=e;else try{const n=new URL(e,a);if(!x.has(n.hostname))return null;t=`${n.pathname}${n.search}${n.hash}`}catch{return null}const r=t.split(/[?#]/,1)[0];return P.some(n=>r===n||r.startsWith(`${n}/`))?t:null}function I(e){const t=e.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const r=t[1],n=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(r),o=/^[1-9]\d*$/.test(r);return!n&&!o?null:c(r)}const M=({text:e,className:a=""})=>s.jsx("div",{className:a,children:s.jsx(h,{remarkPlugins:[f,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:n,...o})=>{const i=k(t);if(i){const l=I(i);return l?s.jsx(d,{routeId:l,to:i,...o,children:r}):s.jsx(u,{to:i,...o,children:r})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...o,children:r})}},children:e})});export{M,k as r}; diff --git a/assets/McpShowcase-Fj71TTNl.js b/assets/McpShowcase-CMLfdJM2.js similarity index 84% rename from assets/McpShowcase-Fj71TTNl.js rename to assets/McpShowcase-CMLfdJM2.js index 071c5dca16f19457635bda3a39991acaf85bb2a1..917c6d35fe03a65897717b9bdb8cccba0228d05c 100644 --- a/assets/McpShowcase-Fj71TTNl.js +++ b/assets/McpShowcase-CMLfdJM2.js @@ -1 +1 @@ -import{j as e,L as t}from"./index-YwiKC6Po.js";import{A as a}from"./AgentLogos-DhD8p5ds.js";function n({className:s="",canNavigate:r}){return e.jsxs("div",{className:`sidebar-section sidebar-section-tools ${s}`.trim(),children:[e.jsx("div",{className:"sidebar-label",children:"Use PwC with your agent"}),e.jsxs(t,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",onClick:o=>{r&&!r()&&o.preventDefault()},children:["MCP server",e.jsx(a,{})]}),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"]}),"."]})]})}export{n as M}; +import{j as e,L as t}from"./index-CbgxfyGU.js";import{A as a}from"./AgentLogos-BBl9UNVD.js";function n({className:s="",canNavigate:r}){return e.jsxs("div",{className:`sidebar-section sidebar-section-tools ${s}`.trim(),children:[e.jsx("div",{className:"sidebar-label",children:"Use PwC with your agent"}),e.jsxs(t,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",onClick:o=>{r&&!r()&&o.preventDefault()},children:["MCP server",e.jsx(a,{})]}),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"]}),"."]})]})}export{n as M}; diff --git a/assets/McpView-CMm_vOrt.js b/assets/McpView-BrXaRo4V.js similarity index 97% rename from assets/McpView-CMm_vOrt.js rename to assets/McpView-BrXaRo4V.js index 032b56d61a354ca66e06256f8120c6b72f4a6249..5acc979e3494ecbf5e96b921509f4fecb6b5dc78 100644 --- a/assets/McpView-CMm_vOrt.js +++ b/assets/McpView-BrXaRo4V.js @@ -1,4 +1,4 @@ -import{n as b,K as h,j as e,C as x}from"./index-YwiKC6Po.js";import{u as j}from"./useQuery-DPH6Mb2w.js";import{f,D as g}from"./latexPlainText-DI8YEXVe.js";import{q as y}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-BZMCt7Ub.js";import{E as i}from"./external-link-4bBJT0yO.js";import{C as w}from"./copy-YHg6twss.js";/** +import{n as b,M as h,j as e,C as x}from"./index-CbgxfyGU.js";import{u as j}from"./useQuery-Bx9s5-D2.js";import{f,D as g}from"./latexPlainText-DI8YEXVe.js";import{q as y}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-BYklgHDz.js";import{E as i}from"./external-link-DZIH4GGr.js";import{C as w}from"./copy-bzw7JVus.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/MethodDetailView-CU5sbo2E.js b/assets/MethodDetailView-CEUGGyVV.js similarity index 91% rename from assets/MethodDetailView-CU5sbo2E.js rename to assets/MethodDetailView-CEUGGyVV.js index a56a055833d9ee690a9b7b3ec35c91955e004f88..fe7e4e0176a730101650113bd6033ff18344e1f3 100644 --- a/assets/MethodDetailView-CU5sbo2E.js +++ b/assets/MethodDetailView-CEUGGyVV.js @@ -1 +1 @@ -import{j as e,r as E,u as $,L as b}from"./index-YwiKC6Po.js";import{R as B}from"./ResearchFollowButton-BFXC8E3t.js";import{p as P,a as V}from"./paperQueryKeys-C5FMa4Oj.js";import{u as k}from"./useQuery-DPH6Mb2w.js";import{M as H}from"./SotaBadges-DiQuEzfo.js";import{u as q,b as Q,a as K}from"./PaperFeed-kaLm5US2.js";import{r as R,M as z}from"./MarkdownText-C-8yLDus.js";import{c as v}from"./catalog-B15Yh5dN.js";import{i as G}from"./apiErrors-DBfE_SVR.js";import{s as O}from"./slug-BpH-Nkvz.js";import{t as U}from"./transform-CNg3rvXk.js";import{u as W}from"./usePapers-C1deOZKl.js";import{S as _}from"./skeleton-CXR1qouH.js";import{A as Z,a as X}from"./alert-Cx5luC5D.js";import{s as Y}from"./safeExternalHref-CkBrsh84.js";import J from"./NotFound-D8hwuoEl.js";import"./useMutation-f6iDkf3w.js";import"./research-5UpiU-ea.js";import"./plus-Cfz0QbT1.js";import"./curation-CkzNFTMJ.js";import"./colors-BkWRhvFI.js";import"./PaperCard-FG-bEpJk.js";import"./AuthorAvatar-CoTET6B3.js";import"./Icon-DXQ4sjQk.js";import"./LatexTitle-DI6voLfI.js";import"./popover-D7ygxg37.js";import"./useIntersectionObserver-Dt36kyjs.js";/* empty css */import"./PaperPreviewLink-CKfmgBjs.js";import"./index-CoRCN2p0.js";import"./index-BM_xSDJM.js";import"./katex-DkKDou_j.js";import"./hover-card-BY9tUGxy.js";import"./useInfiniteQuery-BEbL80ez.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},n=({x:s,y:r,w:l,h:d,fill:o,stroke:p,label:h,fontSize:c=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:r,width:l,height:d,rx:"3",ry:"3",fill:o,stroke:p,strokeWidth:"1"}),e.jsx("text",{x:s+l/2,y:r+d/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:h})]}),ee=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(n,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(n,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(n,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(n,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(n,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(n,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(n,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(n,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),te=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Contrastive learning"}),e.jsx(n,{x:120,y:40,w:120,h:26,fill:t.blue,stroke:t.blueS,label:"Input x",fontSize:11}),e.jsx("path",{d:"M180 66 V76 M90 76 H270 M90 76 V88 M270 76 V88",stroke:t.ink}),e.jsx(n,{x:35,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₁",fontSize:11}),e.jsx(n,{x:215,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₂",fontSize:11}),e.jsx("path",{d:"M90 114 V138 M270 114 V138",stroke:t.ink}),e.jsx(n,{x:35,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx(n,{x:215,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx("text",{x:"180",y:"155",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"shared weights"}),e.jsx("path",{d:"M90 164 V188 M270 164 V188",stroke:t.ink}),e.jsx(n,{x:35,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx(n,{x:215,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx("path",{d:"M90 214 V238 M270 214 V238",stroke:t.ink}),e.jsx(n,{x:35,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₁",fontSize:13}),e.jsx(n,{x:215,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₂",fontSize:13}),e.jsx("path",{d:"M145 251 H215",stroke:t.greenS,strokeWidth:"1.5",strokeDasharray:"4 3"}),e.jsx("text",{x:"180",y:"244",fontSize:"9",fontFamily:"var(--sans)",fill:t.greenS,textAnchor:"middle",children:"attract"}),e.jsx("text",{x:"180",y:"318",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Positive pair: pull together"}),e.jsx("text",{x:"180",y:"336",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Other samples: push apart"}),e.jsx("text",{x:"180",y:"370",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,textAnchor:"middle",children:"InfoNCE: maximize sim(z₁, z₂) / τ"})]}),se=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],ae=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),se.map(([s,r],l)=>{const d=92+l*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:d,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),r?e.jsx("text",{x:"138",y:d,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},s)})]}),re={attention:ee,"contrastive-learning":te,"agent-skills":ae},le=({method:s})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(n,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(n,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(n,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),ie=({method:s})=>{const r=(s.slug||"").toLowerCase(),l=re[r];if(l)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(l,{})});if(s.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:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(le,{method:s})})},N=720,w=138,x={top:8,right:10,bottom:25,left:36},A=56,ne=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),oe=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),M=s=>ne.format(new Date(`${s}T00:00:00Z`)),ce=(s,r)=>{if(s===0)return new Set;const l=s>48?12:s>36?6:s>18?3:2,d=Math.max(1,Math.ceil(A/r)),o=Math.max(l,d),p=s-1,h=new Set([0,p]);for(let c=o;c=A&&h.add(c);return h},L=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const r=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${r}`},de=({history:s,methodName:r})=>{const[l,d]=E.useState(null),o=Math.max(1,...s.map(i=>i.paper_count)),p=N-x.left-x.right,h=w-x.top-x.bottom,c=s.length?p/s.length:p,a=Math.max(2,c*.68),g=ce(s.length,c),j=Array.from(new Set([0,Math.ceil(o/2),o])),f=l==null?null:s[l],y=f?L(f):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${N} ${w}`,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"]}),j.map(i=>{const m=x.top+h-i/o*h;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:N-x.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:m+3,textAnchor:"end",children:i})]},i)}),s.map((i,m)=>{const u=i.paper_count/o*h,S=i.paper_count>0?Math.max(1,u):0,I=x.left+c*m+(c-a)/2,C=x.top+h-S,D=l===m,T=m===s.length-1,F=L(i);return e.jsxs("g",{className:`method-usage-bar${D?" is-active":""}${T?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${M(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${F?`. ${F}`:""}`,onMouseEnter:()=>d(m),onMouseLeave:()=>d(null),onFocus:()=>d(m),onBlur:()=>d(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*m,y:x.top,width:c,height:h}),e.jsx("rect",{className:"method-usage-bar-mark",x:I,y:C,width:a,height:S,rx:"1.5"})]},i.start_date)}),s.map((i,m)=>g.has(m)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(m+.5),y:w-11,textAnchor:"middle",children:s.length>48?oe.format(new Date(`${i.start_date}T00:00:00Z`)):M(i.start_date)},i.start_date):null)]}),f&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:M(f.start_date)}),e.jsxs("span",{children:[f.paper_count," ",f.paper_count===1?"paper":"papers",l===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(f.catalog_share??0).toFixed(2),"% of"," ",(f.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},Re=()=>{var y,i,m;const{methodSlug:s}=$(),r=q(),l=k({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),d=k({queryKey:["areas-all"],queryFn:()=>v.listAreas({page_size:50,ordering:"name"}),enabled:!!((y=l.data)!=null&&y.area_id),staleTime:10*60*1e3}),o=k({queryKey:["method-trend",s],queryFn:()=>v.methodTrend(s),enabled:!!s,staleTime:10*60*1e3}),p=W([...P.feeds.method,s,r.filters],u=>V.forMethod(s,{...r.filters,page:u,page_size:20,repository_limit:1}),{enabled:!!s}),h=k({queryKey:["related-methods",s],queryFn:()=>v.relatedMethods(s),enabled:!!s,staleTime:10*60*1e3}),c=E.useMemo(()=>{var u;return((u=p.data)==null?void 0:u.pages.flatMap(S=>S.results.map(U)))??[]},[p.data]);if(l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(_,{className:"h-12 w-1/2 mb-4"}),e.jsx(_,{className:"h-64 w-full"})]});if(G(l.error))return e.jsx(J,{});if(l.error||!l.data)return e.jsx("div",{className:"page",children:e.jsx(Z,{variant:"destructive",children:e.jsx(X,{children:"Method not found."})})});const a=l.data,g=(i=d.data)==null?void 0:i.results.find(u=>u.id===a.area_id),j=R(a.source_url),f=j?null:Y(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(b,{to:"/methods",children:"Methods"}),g&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(b,{to:`/methods#area-${O(g.name)}`,children:g.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(B,{kind:"method",entityId:a.id}),a.full_name&&!a.name.includes(a.full_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(z,{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"}),j?e.jsxs(b,{className:"method-source-link",to:j,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})]}):f?e.jsxs("a",{className:"method-source-link",href:f,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()})]}),o.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(o.data.recent_paper_count*30/o.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!o.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})]})]}),o.isLoading?e.jsx(_,{className:"h-36 w-full method-trend-skeleton"}):o.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:o.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",o.data.recent_days,"d"]})]})]}),e.jsx(de,{history:o.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ie,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(z,{className:"method-image-credit",text:a.image_credit})})]})]}),(((m=h.data)==null?void 0:m.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),h.data.results.map(u=>e.jsx(H,{method:{slug:u.slug,name:u.name}},u.id))]}),e.jsx(Q,{feed:r,children:e.jsxs("div",{className:"results-count",children:[c.length," papers mentioning ",a.name]})}),e.jsx(K,{query:p,cards:c,empty:"No papers tagged with this method yet."})]})};export{Re as default}; +import{j as e,r as E,u as $,L as b}from"./index-CbgxfyGU.js";import{R as B}from"./ResearchFollowButton-D2BXlDtQ.js";import{p as P,a as V}from"./paperQueryKeys-B8u1BWlI.js";import{u as k}from"./useQuery-Bx9s5-D2.js";import{M as H}from"./SotaBadges-C-sTR-EF.js";import{u as q,b as Q,a as K}from"./PaperFeed-DMvUfA47.js";import{r as R,M as z}from"./MarkdownText-Bj-G_S-B.js";import{c as v}from"./catalog-DhK7_9-6.js";import{i as G}from"./apiErrors-BZ5h1Kmb.js";import{s as O}from"./slug-BpH-Nkvz.js";import{t as U}from"./transform-0Udg2p6b.js";import{u as W}from"./usePapers-CJaWLZ3y.js";import{S as _}from"./skeleton-HwvdxvSN.js";import{A as Z,a as X}from"./alert-CFDDvdIM.js";import{s as Y}from"./safeExternalHref-CkBrsh84.js";import J from"./NotFound-DtzwOULp.js";import"./useMutation-P_trTy9i.js";import"./research-DgpyzSy_.js";import"./plus-UK0TEjgd.js";import"./curation-C7Gmmp4z.js";import"./colors-BkWRhvFI.js";import"./PaperCard-tdTC_dRN.js";import"./AuthorAvatar-CUJMmp_z.js";import"./Icon-D-kA0Owz.js";import"./LatexTitle-Z-HGmZ-H.js";import"./popover-DKJYnYjk.js";import"./useIntersectionObserver-CID9Kkak.js";/* empty css */import"./PaperPreviewLink-DZDNIh1g.js";import"./index-ZkEATkOr.js";import"./index-BH3yOoza.js";import"./katex-DkKDou_j.js";import"./hover-card-ufez2uMo.js";import"./useInfiniteQuery-BAc_4HO5.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},n=({x:s,y:r,w:l,h:d,fill:o,stroke:p,label:h,fontSize:c=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:r,width:l,height:d,rx:"3",ry:"3",fill:o,stroke:p,strokeWidth:"1"}),e.jsx("text",{x:s+l/2,y:r+d/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:h})]}),ee=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(n,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(n,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(n,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(n,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(n,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(n,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(n,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(n,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),te=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Contrastive learning"}),e.jsx(n,{x:120,y:40,w:120,h:26,fill:t.blue,stroke:t.blueS,label:"Input x",fontSize:11}),e.jsx("path",{d:"M180 66 V76 M90 76 H270 M90 76 V88 M270 76 V88",stroke:t.ink}),e.jsx(n,{x:35,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₁",fontSize:11}),e.jsx(n,{x:215,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₂",fontSize:11}),e.jsx("path",{d:"M90 114 V138 M270 114 V138",stroke:t.ink}),e.jsx(n,{x:35,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx(n,{x:215,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx("text",{x:"180",y:"155",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"shared weights"}),e.jsx("path",{d:"M90 164 V188 M270 164 V188",stroke:t.ink}),e.jsx(n,{x:35,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx(n,{x:215,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx("path",{d:"M90 214 V238 M270 214 V238",stroke:t.ink}),e.jsx(n,{x:35,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₁",fontSize:13}),e.jsx(n,{x:215,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₂",fontSize:13}),e.jsx("path",{d:"M145 251 H215",stroke:t.greenS,strokeWidth:"1.5",strokeDasharray:"4 3"}),e.jsx("text",{x:"180",y:"244",fontSize:"9",fontFamily:"var(--sans)",fill:t.greenS,textAnchor:"middle",children:"attract"}),e.jsx("text",{x:"180",y:"318",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Positive pair: pull together"}),e.jsx("text",{x:"180",y:"336",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Other samples: push apart"}),e.jsx("text",{x:"180",y:"370",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,textAnchor:"middle",children:"InfoNCE: maximize sim(z₁, z₂) / τ"})]}),se=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],ae=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),se.map(([s,r],l)=>{const d=92+l*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:d,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),r?e.jsx("text",{x:"138",y:d,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},s)})]}),re={attention:ee,"contrastive-learning":te,"agent-skills":ae},le=({method:s})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(n,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(n,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(n,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),ie=({method:s})=>{const r=(s.slug||"").toLowerCase(),l=re[r];if(l)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(l,{})});if(s.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:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(le,{method:s})})},N=720,w=138,x={top:8,right:10,bottom:25,left:36},A=56,ne=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),oe=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),M=s=>ne.format(new Date(`${s}T00:00:00Z`)),ce=(s,r)=>{if(s===0)return new Set;const l=s>48?12:s>36?6:s>18?3:2,d=Math.max(1,Math.ceil(A/r)),o=Math.max(l,d),p=s-1,h=new Set([0,p]);for(let c=o;c=A&&h.add(c);return h},L=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const r=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${r}`},de=({history:s,methodName:r})=>{const[l,d]=E.useState(null),o=Math.max(1,...s.map(i=>i.paper_count)),p=N-x.left-x.right,h=w-x.top-x.bottom,c=s.length?p/s.length:p,a=Math.max(2,c*.68),g=ce(s.length,c),j=Array.from(new Set([0,Math.ceil(o/2),o])),f=l==null?null:s[l],y=f?L(f):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${N} ${w}`,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"]}),j.map(i=>{const m=x.top+h-i/o*h;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:N-x.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:m+3,textAnchor:"end",children:i})]},i)}),s.map((i,m)=>{const u=i.paper_count/o*h,S=i.paper_count>0?Math.max(1,u):0,I=x.left+c*m+(c-a)/2,C=x.top+h-S,D=l===m,T=m===s.length-1,F=L(i);return e.jsxs("g",{className:`method-usage-bar${D?" is-active":""}${T?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${M(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${F?`. ${F}`:""}`,onMouseEnter:()=>d(m),onMouseLeave:()=>d(null),onFocus:()=>d(m),onBlur:()=>d(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*m,y:x.top,width:c,height:h}),e.jsx("rect",{className:"method-usage-bar-mark",x:I,y:C,width:a,height:S,rx:"1.5"})]},i.start_date)}),s.map((i,m)=>g.has(m)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(m+.5),y:w-11,textAnchor:"middle",children:s.length>48?oe.format(new Date(`${i.start_date}T00:00:00Z`)):M(i.start_date)},i.start_date):null)]}),f&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:M(f.start_date)}),e.jsxs("span",{children:[f.paper_count," ",f.paper_count===1?"paper":"papers",l===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(f.catalog_share??0).toFixed(2),"% of"," ",(f.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},Re=()=>{var y,i,m;const{methodSlug:s}=$(),r=q(),l=k({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),d=k({queryKey:["areas-all"],queryFn:()=>v.listAreas({page_size:50,ordering:"name"}),enabled:!!((y=l.data)!=null&&y.area_id),staleTime:10*60*1e3}),o=k({queryKey:["method-trend",s],queryFn:()=>v.methodTrend(s),enabled:!!s,staleTime:10*60*1e3}),p=W([...P.feeds.method,s,r.filters],u=>V.forMethod(s,{...r.filters,page:u,page_size:20,repository_limit:1}),{enabled:!!s}),h=k({queryKey:["related-methods",s],queryFn:()=>v.relatedMethods(s),enabled:!!s,staleTime:10*60*1e3}),c=E.useMemo(()=>{var u;return((u=p.data)==null?void 0:u.pages.flatMap(S=>S.results.map(U)))??[]},[p.data]);if(l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(_,{className:"h-12 w-1/2 mb-4"}),e.jsx(_,{className:"h-64 w-full"})]});if(G(l.error))return e.jsx(J,{});if(l.error||!l.data)return e.jsx("div",{className:"page",children:e.jsx(Z,{variant:"destructive",children:e.jsx(X,{children:"Method not found."})})});const a=l.data,g=(i=d.data)==null?void 0:i.results.find(u=>u.id===a.area_id),j=R(a.source_url),f=j?null:Y(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(b,{to:"/methods",children:"Methods"}),g&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(b,{to:`/methods#area-${O(g.name)}`,children:g.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(B,{kind:"method",entityId:a.id}),a.full_name&&!a.name.includes(a.full_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(z,{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"}),j?e.jsxs(b,{className:"method-source-link",to:j,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})]}):f?e.jsxs("a",{className:"method-source-link",href:f,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()})]}),o.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(o.data.recent_paper_count*30/o.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!o.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})]})]}),o.isLoading?e.jsx(_,{className:"h-36 w-full method-trend-skeleton"}):o.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:o.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",o.data.recent_days,"d"]})]})]}),e.jsx(de,{history:o.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ie,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(z,{className:"method-image-credit",text:a.image_credit})})]})]}),(((m=h.data)==null?void 0:m.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),h.data.results.map(u=>e.jsx(H,{method:{slug:u.slug,name:u.name}},u.id))]}),e.jsx(Q,{feed:r,children:e.jsxs("div",{className:"results-count",children:[c.length," papers mentioning ",a.name]})}),e.jsx(K,{query:p,cards:c,empty:"No papers tagged with this method yet."})]})};export{Re as default}; diff --git a/assets/MethodsIndexView-CS3VxsBJ.js b/assets/MethodsIndexView-DYp0dUSa.js similarity index 81% rename from assets/MethodsIndexView-CS3VxsBJ.js rename to assets/MethodsIndexView-DYp0dUSa.js index 6420a617a2ff4d2051ae88c5c0705fc2550c5066..21f5f2e1d6cf552052158f8c35fd128c0faa1ae6 100644 --- a/assets/MethodsIndexView-CS3VxsBJ.js +++ b/assets/MethodsIndexView-DYp0dUSa.js @@ -1,4 +1,4 @@ -import{n as y,r as c,j as s,L as f}from"./index-YwiKC6Po.js";import{u as l}from"./useQuery-DPH6Mb2w.js";import{c as m}from"./catalog-B15Yh5dN.js";import{s as _}from"./areas-Dvi8w2dp.js";import{s as v}from"./slug-BpH-Nkvz.js";import{A as N,a as L}from"./alert-Cx5luC5D.js";import{A as T,a as A}from"./AreaSection-CfCNkiTd.js";import{T as F}from"./TaxonomySuggestionTile-4WqZSJGN.js";import{u as M,T as q}from"./useHashScrollOnReady-BKkkyVVX.js";import"./skeleton-CXR1qouH.js";import"./SignInToEditDialog-DpqyyHCb.js";import"./button-B90pJJiy.js";import"./input-DEeEc0bH.js";import"./textarea-BPIMGf5w.js";import"./searchable-select-Bqfyxu17.js";import"./popover-D7ygxg37.js";import"./dialog-foxx0Wu6.js";import"./search-wcEXdf1i.js";import"./loader-circle-B0KtDERb.js";import"./useMutation-f6iDkf3w.js";import"./submissions-BJgYjF7O.js";import"./plus-Cfz0QbT1.js";import"./trending-up-Sm0tkX5g.js";/** +import{n as y,r as c,j as s,L as f}from"./index-CbgxfyGU.js";import{u as l}from"./useQuery-Bx9s5-D2.js";import{c as m}from"./catalog-DhK7_9-6.js";import{s as _}from"./areas-Dvi8w2dp.js";import{s as v}from"./slug-BpH-Nkvz.js";import{A as N,a as L}from"./alert-CFDDvdIM.js";import{A as T,a as A}from"./AreaSection-NWvfO4Sb.js";import{T as F}from"./TaxonomySuggestionTile-DIw_GKfA.js";import{u as M,T as q}from"./useHashScrollOnReady-DgB3XFQL.js";import"./skeleton-HwvdxvSN.js";import"./SignInToEditDialog-CNIcNqbK.js";import"./button-Bv9oZ-QU.js";import"./input-B6pxtfPe.js";import"./textarea-Bf06GTSH.js";import"./searchable-select-DNdBIahG.js";import"./popover-DKJYnYjk.js";import"./dialog-Cfp_d3CC.js";import"./search-CLtAJGOp.js";import"./loader-circle-CWMja8Zn.js";import"./useMutation-P_trTy9i.js";import"./submissions-aWj7YtuZ.js";import"./plus-UK0TEjgd.js";import"./trending-up-B3K5RlyX.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-D8hwuoEl.js b/assets/NotFound-DtzwOULp.js similarity index 89% rename from assets/NotFound-D8hwuoEl.js rename to assets/NotFound-DtzwOULp.js index cb4e073d90645f4c62e1ffe0c19acb0f9b3b917a..779339efcedbc228eb963921b656846c57af9f95 100644 --- a/assets/NotFound-D8hwuoEl.js +++ b/assets/NotFound-DtzwOULp.js @@ -1 +1 @@ -import{b as o,r as s,j as t,L as a}from"./index-YwiKC6Po.js";const r=()=>{const e=o();return s.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(a,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; +import{b as o,r as s,j as t,L as a}from"./index-CbgxfyGU.js";const r=()=>{const e=o();return s.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(a,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; diff --git a/assets/OrganizationContributionGraph-BZyCpVX4.js b/assets/OrganizationContributionGraph-ah6EPb13.js similarity index 94% rename from assets/OrganizationContributionGraph-BZyCpVX4.js rename to assets/OrganizationContributionGraph-ah6EPb13.js index b9d1ae32fc7f0a0c37d45d5c71c4a9b68016c31a..5f18cd97911f739bbd2f1ce626a725e85c949580 100644 --- a/assets/OrganizationContributionGraph-BZyCpVX4.js +++ b/assets/OrganizationContributionGraph-ah6EPb13.js @@ -1 +1 @@ -import{r as b,j as o}from"./index-YwiKC6Po.js";import{u as z}from"./useQuery-DPH6Mb2w.js";import{S as T}from"./skeleton-CXR1qouH.js";import{c as w}from"./catalog-B15Yh5dN.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;eg.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}; +import{r as b,j as o}from"./index-CbgxfyGU.js";import{u as z}from"./useQuery-Bx9s5-D2.js";import{S as T}from"./skeleton-HwvdxvSN.js";import{c as w}from"./catalog-DhK7_9-6.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;eg.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}; diff --git a/assets/OrganizationDetailView-C69MBUc4.js b/assets/OrganizationDetailView-BD-vOirQ.js similarity index 74% rename from assets/OrganizationDetailView-C69MBUc4.js rename to assets/OrganizationDetailView-BD-vOirQ.js index 455a505cef3362a8b508e81124ac6dbd6bdd9bfe..de5aee45506d67912188b3641036aa76968b0ce3 100644 --- a/assets/OrganizationDetailView-C69MBUc4.js +++ b/assets/OrganizationDetailView-BD-vOirQ.js @@ -1 +1 @@ -import{c as q,r as d,j as r,L as N,u as C}from"./index-YwiKC6Po.js";import{R as M}from"./ResearchFollowButton-BFXC8E3t.js";import{u as y}from"./useQuery-DPH6Mb2w.js";import{M as z}from"./MarkdownText-C-8yLDus.js";import{O as Q}from"./OrganizationContributionGraph-BZyCpVX4.js";import{u as I,b as E,a as K}from"./PaperFeed-kaLm5US2.js";import{A as R,a as G}from"./alert-Cx5luC5D.js";import{S as H}from"./searchable-select-Bqfyxu17.js";import{S as W}from"./skeleton-CXR1qouH.js";import{u as B}from"./usePapers-C1deOZKl.js";import{c as F}from"./catalog-B15Yh5dN.js";import{a as D,p as S}from"./paperQueryKeys-C5FMa4Oj.js";import{i as U}from"./apiErrors-DBfE_SVR.js";import{d as v,t as V}from"./transform-CNg3rvXk.js";import{o as Z,i as J}from"./organizationNames-BVKzYEBp.js";import L from"./NotFound-D8hwuoEl.js";import"./useMutation-f6iDkf3w.js";import"./research-5UpiU-ea.js";import"./plus-Cfz0QbT1.js";/* empty css */import"./PaperPreviewLink-CKfmgBjs.js";import"./index-CoRCN2p0.js";import"./index-BM_xSDJM.js";import"./katex-DkKDou_j.js";import"./hover-card-BY9tUGxy.js";import"./PaperCard-FG-bEpJk.js";import"./AuthorAvatar-CoTET6B3.js";import"./SotaBadges-DiQuEzfo.js";import"./colors-BkWRhvFI.js";import"./Icon-DXQ4sjQk.js";import"./LatexTitle-DI6voLfI.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D7ygxg37.js";import"./useIntersectionObserver-Dt36kyjs.js";import"./button-B90pJJiy.js";import"./dialog-foxx0Wu6.js";import"./search-wcEXdf1i.js";import"./loader-circle-B0KtDERb.js";import"./useInfiniteQuery-BEbL80ez.js";import"./curation-CkzNFTMJ.js";const X=({organizationSlug:a,taskSlug:n})=>{var f,x,j,_,b;const k=q(),c=I(),{searchParams:$}=c,[w,h]=d.useState(!1),u=y({queryKey:["organization",a],queryFn:()=>F.getOrganization(a),staleTime:10*60*1e3}),l=y({queryKey:["organization-areas-with-tasks",a],queryFn:()=>F.organizationAreasWithTasks(a),staleTime:10*60*1e3}),p=B([...S.feeds.organization,a,n,c.filters],t=>D.forOrganization(a,{...c.filters,task:n,page:t,page_size:12}),{enabled:!!a});d.useEffect(()=>{h(!1)},[a,n]);const g=d.useMemo(()=>{var t;return(((t=l.data)==null?void 0:t.results)??[]).flatMap(o=>o.tasks.filter(s=>!!s.slug).map(s=>({...s,slug:s.slug,label:v(s.name,s.slug)})))},[l.data]),i=g.find(t=>t.slug===n),O=d.useMemo(()=>{var t;return(((t=p.data)==null?void 0:t.pages)??[]).flatMap(o=>o.results.map(V))},[p.data]),e=u.data??((f=l.data)==null?void 0:f.organization),m=e?Z(e):null,A=((j=(x=p.data)==null?void 0:x.pages[0])==null?void 0:j.count)??0;if([u.error,l.error,p.error].some(U))return r.jsx(L,{});if(l.error||p.error)return r.jsx("div",{className:"page",children:r.jsx(R,{variant:"destructive",children:r.jsx(G,{children:"Failed to load organization papers. Please try again."})})});const P=t=>{const o=t.trim().toLocaleLowerCase();return g.filter(s=>`${s.label} ${s.slug}`.toLocaleLowerCase().includes(o)).map(s=>({value:s.slug,label:s.label,description:`${s.paper_count.toLocaleString()} ${s.paper_count===1?"paper":"papers"}`}))},T=t=>{const o=t==="__all__"?`/orgs/${a}`:`/orgs/${a}/${t}`,s=$.toString();k({pathname:o,search:s?`?${s}`:""})};return r.jsxs("div",{className:"page",children:[r.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[r.jsx(N,{to:"/",children:"Home"}),r.jsx("span",{children:" / "}),r.jsx(N,{to:"/organizations",children:"Organizations"}),r.jsx("span",{children:" / "}),r.jsx("span",{children:(e==null?void 0:e.name)??a}),i&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:" / "}),r.jsx("span",{children:v(i.name,i.slug)})]})]}),r.jsxs("header",{className:"organization-hero",children:[r.jsxs("div",{className:"organization-hero-profile",children:[r.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),r.jsxs("h1",{className:`feed-title organization-hero-title${e&&!m&&J(e.name)?" organization-hero-title--long":""}`,children:[e!=null&&e.logo_url&&!w?r.jsx("img",{src:e.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):e?r.jsx("span",{className:"organization-hero-monogram","aria-hidden":"true",children:(m??e.name).slice(0,1).toUpperCase()}):null,e?r.jsxs("span",{className:"organization-hero-name",children:[m??e.name,m&&r.jsx("span",{className:"organization-hero-full-name",children:e.name})]}):r.jsx(W,{className:"h-12 w-64"})]}),e&&r.jsx(M,{kind:"organization",entityId:e.id}),e&&r.jsxs("div",{className:"feed-subtitle",children:[((_=e.paper_count)==null?void 0:_.toLocaleString())??0," papers",(e.organization_trending_score??0)>0&&e.trending_rank&&r.jsxs(r.Fragment,{children:[" · #",e.trending_rank," trending this month"]})]}),(e==null?void 0:e.description)&&r.jsx(z,{className:"method-description",text:e.description}),e&&r.jsxs("div",{className:"organization-hero-links",children:[e.website_url&&r.jsx("a",{href:e.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),e.hf_url&&r.jsx("a",{href:e.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),e.github_url&&r.jsx("a",{href:e.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),r.jsx(Q,{organizationSlug:a,organizationName:(e==null?void 0:e.name)??a})]}),r.jsx(E,{feed:c,style:{alignItems:"center",gap:16},leading:r.jsx("div",{style:{minWidth:260},children:r.jsx(H,{value:n??"__all__",onChange:T,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:i?{value:i.slug,label:i.label,description:`${i.paper_count.toLocaleString()} ${i.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((b=e==null?void 0:e.paper_count)==null?void 0:b.toLocaleString())??0} papers`},queryKey:["organization-task-options",a],queryFn:async t=>{var o;return[{value:"__all__",label:"All tasks",description:`${((o=e==null?void 0:e.paper_count)==null?void 0:o.toLocaleString())??0} papers`},...P(t)]},enabled:!l.isLoading,className:"h-[38px]"})}),children:r.jsxs("div",{className:"results-count",children:[A.toLocaleString()," papers"]})}),r.jsx(K,{query:p,cards:O,showInstitution:!1,empty:(e==null?void 0:e.paper_count)===0?"No papers indexed yet":"No papers found for this selection."})]})},Ee=()=>{const{orgSlug:a,taskSlug:n}=C();return a?r.jsx(X,{organizationSlug:a,taskSlug:n}):r.jsx(L,{})};export{Ee as default}; +import{c as q,r as d,j as r,L as N,u as C}from"./index-CbgxfyGU.js";import{R as M}from"./ResearchFollowButton-D2BXlDtQ.js";import{u as y}from"./useQuery-Bx9s5-D2.js";import{M as z}from"./MarkdownText-Bj-G_S-B.js";import{O as Q}from"./OrganizationContributionGraph-ah6EPb13.js";import{u as I,b as E,a as K}from"./PaperFeed-DMvUfA47.js";import{A as R,a as G}from"./alert-CFDDvdIM.js";import{S as H}from"./searchable-select-DNdBIahG.js";import{S as W}from"./skeleton-HwvdxvSN.js";import{u as B}from"./usePapers-CJaWLZ3y.js";import{c as F}from"./catalog-DhK7_9-6.js";import{a as D,p as S}from"./paperQueryKeys-B8u1BWlI.js";import{i as U}from"./apiErrors-BZ5h1Kmb.js";import{d as v,t as V}from"./transform-0Udg2p6b.js";import{o as Z,i as J}from"./organizationNames-BVKzYEBp.js";import L from"./NotFound-DtzwOULp.js";import"./useMutation-P_trTy9i.js";import"./research-DgpyzSy_.js";import"./plus-UK0TEjgd.js";/* empty css */import"./PaperPreviewLink-DZDNIh1g.js";import"./index-ZkEATkOr.js";import"./index-BH3yOoza.js";import"./katex-DkKDou_j.js";import"./hover-card-ufez2uMo.js";import"./PaperCard-tdTC_dRN.js";import"./AuthorAvatar-CUJMmp_z.js";import"./SotaBadges-C-sTR-EF.js";import"./colors-BkWRhvFI.js";import"./Icon-D-kA0Owz.js";import"./LatexTitle-Z-HGmZ-H.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DKJYnYjk.js";import"./useIntersectionObserver-CID9Kkak.js";import"./button-Bv9oZ-QU.js";import"./dialog-Cfp_d3CC.js";import"./search-CLtAJGOp.js";import"./loader-circle-CWMja8Zn.js";import"./useInfiniteQuery-BAc_4HO5.js";import"./curation-C7Gmmp4z.js";const X=({organizationSlug:a,taskSlug:n})=>{var f,x,j,_,b;const k=q(),c=I(),{searchParams:$}=c,[w,h]=d.useState(!1),u=y({queryKey:["organization",a],queryFn:()=>F.getOrganization(a),staleTime:10*60*1e3}),l=y({queryKey:["organization-areas-with-tasks",a],queryFn:()=>F.organizationAreasWithTasks(a),staleTime:10*60*1e3}),p=B([...S.feeds.organization,a,n,c.filters],t=>D.forOrganization(a,{...c.filters,task:n,page:t,page_size:12}),{enabled:!!a});d.useEffect(()=>{h(!1)},[a,n]);const g=d.useMemo(()=>{var t;return(((t=l.data)==null?void 0:t.results)??[]).flatMap(o=>o.tasks.filter(s=>!!s.slug).map(s=>({...s,slug:s.slug,label:v(s.name,s.slug)})))},[l.data]),i=g.find(t=>t.slug===n),O=d.useMemo(()=>{var t;return(((t=p.data)==null?void 0:t.pages)??[]).flatMap(o=>o.results.map(V))},[p.data]),e=u.data??((f=l.data)==null?void 0:f.organization),m=e?Z(e):null,A=((j=(x=p.data)==null?void 0:x.pages[0])==null?void 0:j.count)??0;if([u.error,l.error,p.error].some(U))return r.jsx(L,{});if(l.error||p.error)return r.jsx("div",{className:"page",children:r.jsx(R,{variant:"destructive",children:r.jsx(G,{children:"Failed to load organization papers. Please try again."})})});const P=t=>{const o=t.trim().toLocaleLowerCase();return g.filter(s=>`${s.label} ${s.slug}`.toLocaleLowerCase().includes(o)).map(s=>({value:s.slug,label:s.label,description:`${s.paper_count.toLocaleString()} ${s.paper_count===1?"paper":"papers"}`}))},T=t=>{const o=t==="__all__"?`/orgs/${a}`:`/orgs/${a}/${t}`,s=$.toString();k({pathname:o,search:s?`?${s}`:""})};return r.jsxs("div",{className:"page",children:[r.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[r.jsx(N,{to:"/",children:"Home"}),r.jsx("span",{children:" / "}),r.jsx(N,{to:"/organizations",children:"Organizations"}),r.jsx("span",{children:" / "}),r.jsx("span",{children:(e==null?void 0:e.name)??a}),i&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:" / "}),r.jsx("span",{children:v(i.name,i.slug)})]})]}),r.jsxs("header",{className:"organization-hero",children:[r.jsxs("div",{className:"organization-hero-profile",children:[r.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),r.jsxs("h1",{className:`feed-title organization-hero-title${e&&!m&&J(e.name)?" organization-hero-title--long":""}`,children:[e!=null&&e.logo_url&&!w?r.jsx("img",{src:e.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):e?r.jsx("span",{className:"organization-hero-monogram","aria-hidden":"true",children:(m??e.name).slice(0,1).toUpperCase()}):null,e?r.jsxs("span",{className:"organization-hero-name",children:[m??e.name,m&&r.jsx("span",{className:"organization-hero-full-name",children:e.name})]}):r.jsx(W,{className:"h-12 w-64"})]}),e&&r.jsx(M,{kind:"organization",entityId:e.id}),e&&r.jsxs("div",{className:"feed-subtitle",children:[((_=e.paper_count)==null?void 0:_.toLocaleString())??0," papers",(e.organization_trending_score??0)>0&&e.trending_rank&&r.jsxs(r.Fragment,{children:[" · #",e.trending_rank," trending this month"]})]}),(e==null?void 0:e.description)&&r.jsx(z,{className:"method-description",text:e.description}),e&&r.jsxs("div",{className:"organization-hero-links",children:[e.website_url&&r.jsx("a",{href:e.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),e.hf_url&&r.jsx("a",{href:e.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),e.github_url&&r.jsx("a",{href:e.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),r.jsx(Q,{organizationSlug:a,organizationName:(e==null?void 0:e.name)??a})]}),r.jsx(E,{feed:c,style:{alignItems:"center",gap:16},leading:r.jsx("div",{style:{minWidth:260},children:r.jsx(H,{value:n??"__all__",onChange:T,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:i?{value:i.slug,label:i.label,description:`${i.paper_count.toLocaleString()} ${i.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((b=e==null?void 0:e.paper_count)==null?void 0:b.toLocaleString())??0} papers`},queryKey:["organization-task-options",a],queryFn:async t=>{var o;return[{value:"__all__",label:"All tasks",description:`${((o=e==null?void 0:e.paper_count)==null?void 0:o.toLocaleString())??0} papers`},...P(t)]},enabled:!l.isLoading,className:"h-[38px]"})}),children:r.jsxs("div",{className:"results-count",children:[A.toLocaleString()," papers"]})}),r.jsx(K,{query:p,cards:O,showInstitution:!1,empty:(e==null?void 0:e.paper_count)===0?"No papers indexed yet":"No papers found for this selection."})]})},Ee=()=>{const{orgSlug:a,taskSlug:n}=C();return a?r.jsx(X,{organizationSlug:a,taskSlug:n}):r.jsx(L,{})};export{Ee as default}; diff --git a/assets/OrganizationsIndexView-CbWS3zNq.js b/assets/OrganizationsIndexView-Bd4D8teF.js similarity index 96% rename from assets/OrganizationsIndexView-CbWS3zNq.js rename to assets/OrganizationsIndexView-Bd4D8teF.js index c646f9c02c55b753d0877f8dbcd39f622ed14fab..50438ea4ae6b4a4dda775b79240065c1ddad632d 100644 --- a/assets/OrganizationsIndexView-CbWS3zNq.js +++ b/assets/OrganizationsIndexView-Bd4D8teF.js @@ -1 +1 @@ -import{e as g,r as h,j as e,L as x}from"./index-YwiKC6Po.js";import{u}from"./useQuery-DPH6Mb2w.js";import{A as j,a as y}from"./alert-Cx5luC5D.js";import{c as N}from"./catalog-B15Yh5dN.js";const f=n=>n==="papers"||n==="name"?n:"trending",_=({organization:n})=>{const[d,i]=h.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:()=>i(!0)})})},S=()=>{const[n,d]=g(),i=f(n.get("sort")),c=n.get("q")??"",o=u({queryKey:["organizations","featured"],queryFn:()=>N.organizationIndex(),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),t=s.sort??i,r=s.query??c;t==="trending"?a.delete("sort"):a.set("sort",t),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=h.useMemo(()=>{var t;const s=c.trim().toLocaleLowerCase(),a=(((t=o.data)==null?void 0:t.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return i==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):i==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,i]);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.jsx("h2",{id:"organizations-heading",children:o.data?`${o.data.count.toLocaleString()} organizations`:"Organizations"}),e.jsx("span",{children:i==="trending"?"Ranked by 30-day momentum":i==="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:i===s?"active":"","aria-pressed":i===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true","aria-label":"Loading organizations",children:Array.from({length:12}).map((s,a)=>e.jsxs("div",{className:"organization-card organization-card-skeleton",children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx("span",{className:"organization-logo"}),e.jsxs("div",{children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line short"})]})]}),e.jsx("div",{className:"organization-card-metrics",children:e.jsx("span",{className:"organization-skeleton-line short"})}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line"})]})]},a))}):o.error?e.jsx(j,{variant:"destructive",children:e.jsxs(y,{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,t=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(_,{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"}),i==="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:[t?`Publishing ${t}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{S as default}; +import{e as g,r as h,j as e,L as x}from"./index-CbgxfyGU.js";import{u}from"./useQuery-Bx9s5-D2.js";import{A as j,a as y}from"./alert-CFDDvdIM.js";import{c as N}from"./catalog-DhK7_9-6.js";const f=n=>n==="papers"||n==="name"?n:"trending",_=({organization:n})=>{const[d,i]=h.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:()=>i(!0)})})},S=()=>{const[n,d]=g(),i=f(n.get("sort")),c=n.get("q")??"",o=u({queryKey:["organizations","featured"],queryFn:()=>N.organizationIndex(),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),t=s.sort??i,r=s.query??c;t==="trending"?a.delete("sort"):a.set("sort",t),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=h.useMemo(()=>{var t;const s=c.trim().toLocaleLowerCase(),a=(((t=o.data)==null?void 0:t.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return i==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):i==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,i]);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.jsx("h2",{id:"organizations-heading",children:o.data?`${o.data.count.toLocaleString()} organizations`:"Organizations"}),e.jsx("span",{children:i==="trending"?"Ranked by 30-day momentum":i==="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:i===s?"active":"","aria-pressed":i===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true","aria-label":"Loading organizations",children:Array.from({length:12}).map((s,a)=>e.jsxs("div",{className:"organization-card organization-card-skeleton",children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx("span",{className:"organization-logo"}),e.jsxs("div",{children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line short"})]})]}),e.jsx("div",{className:"organization-card-metrics",children:e.jsx("span",{className:"organization-skeleton-line short"})}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line"})]})]},a))}):o.error?e.jsx(j,{variant:"destructive",children:e.jsxs(y,{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,t=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(_,{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"}),i==="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:[t?`Publishing ${t}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{S as default}; diff --git a/assets/PaperCard-FG-bEpJk.js b/assets/PaperCard-tdTC_dRN.js similarity index 96% rename from assets/PaperCard-FG-bEpJk.js rename to assets/PaperCard-tdTC_dRN.js index 13fbd6a0c25339f32d619abd6a76db24ca58089c..f5954c6cfca7c4fe2ff35f0ba8b1db2a6e920903 100644 --- a/assets/PaperCard-FG-bEpJk.js +++ b/assets/PaperCard-tdTC_dRN.js @@ -1 +1 @@ -import{f as v,K as g,j as a,L as d}from"./index-YwiKC6Po.js";import{A as M}from"./AuthorAvatar-CoTET6B3.js";import{P as y,S as L,T as Z,M as A}from"./SotaBadges-DiQuEzfo.js";import{I as k}from"./Icon-DXQ4sjQk.js";import{L as P,a as w}from"./LatexTitle-DI6voLfI.js";import{a as C,p as E}from"./paperQueryKeys-C5FMa4Oj.js";import{s as h}from"./safeExternalHref-CkBrsh84.js";const U=({size:s=16})=>a.jsxs("svg",{className:"hf-logo",width:s,height:s,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),a.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),a.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),a.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),a.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),a.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]});function $(s){const t=[...new Set(s.map(r=>r.replace(/ \(subtask\)$/,"")))],l=t.length>3?[...t.slice(0,2),`${t.length-2} more`]:t;return l.length>1?`${l.slice(0,-1).join(", ")} and ${l[l.length-1]}`:l[0]}const z="language-modeling";function p(s){return s?s.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function B(s){return p(s.slug)==="large language model"||p(s.name)==="large language model"}function D(s){return s.tags.includes(z)?s.methods.filter(t=>!B(t)):s.methods}const K=({name:s,slug:t,logoUrl:l})=>{const[r,i]=g.useState(!1);return!l||r?null:a.jsx(d,{to:`/orgs/${t}`,className:"paper-organization-logo","aria-label":`View ${s} organization`,title:s,children:a.jsx("img",{src:l,alt:"",onError:()=>i(!0)})})},O=({paper:s,priority:t=!1,showInstitution:l=!0,highlightQuery:r,followReasons:i})=>{const m=v(),u=`/paper/${s.id}`,n=g.useCallback(()=>{m.prefetchQuery({queryKey:E.detail(s.id),queryFn:()=>C.get(s.id,!0),staleTime:10*60*1e3})},[s.id,m]),N=s.authors.slice(0,3).map((e,o)=>{var b,F;const f=(b=s.authorIds)==null?void 0:b[o],j=(F=s.authorHfProfiles)==null?void 0:F[o];return a.jsxs(g.Fragment,{children:[o>0&&", ",j&&a.jsx(M,{className:"paper-card-author-avatar",url:j.avatarUrl}),f?a.jsx(d,{to:`/authors/${f}`,children:e}):e]},o)}),c=s.authors.length,x=D(s);return a.jsxs("article",{className:"paper-card",children:[a.jsx(d,{to:u,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:a.jsx(y,{paperId:s.id,title:s.title,thumbnailUrl:s.thumbnailUrl,priority:t})}),a.jsxs("div",{className:"paper-body",children:[a.jsxs("div",{className:"paper-body-main",children:[i&&i.length>0&&a.jsxs("div",{className:"paper-follow-reason",children:["Because you follow ",$(i)]}),a.jsxs("h3",{className:"paper-title",children:[a.jsx(d,{to:u,onFocus:n,onMouseEnter:n,children:a.jsx(P,{title:s.title,highlight:r})}),l&&s.organizations.length>0&&a.jsx("span",{className:"paper-organization-logos",children:s.organizations.map(e=>a.jsx(K,{...e},e.slug))})]}),a.jsxs("div",{className:"paper-authors",children:[N,c>3&&a.jsxs("span",{children:[", ","+",c-3," authors"]}),s.date&&a.jsxs(a.Fragment,{children:[c>0?" · ":"",a.jsx("span",{children:s.date})]}),s.citations>0&&a.jsxs(a.Fragment,{children:[c>0||s.date?" · ":"",a.jsxs("span",{children:[s.citations.toLocaleString()," citations"]})]})]}),s.abstract&&a.jsx("p",{className:"paper-abstract",children:a.jsx(w,{text:s.abstract,highlight:r})}),s.sotaRanks.length>0&&a.jsx(L,{ranks:s.sotaRanks,paperHref:u}),(s.tags.length>0||x.length>0)&&a.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[s.tags.map(e=>a.jsx(Z,{slug:e},e)),x.map(e=>a.jsx(A,{method:e},e.id||e.slug||e.name))]})]}),(s.githubUrl||s.hfUrl)&&a.jsxs("div",{className:"paper-resources",children:[h(s.githubUrl)&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:e=>e.stopPropagation(),children:[a.jsx(k,{name:"github",size:20}),s.velocity24h!=null&&s.velocity24h>0&&a.jsxs("span",{className:"resource-stat",children:[a.jsxs("span",{className:"resource-value",children:[a.jsx("span",{className:"gh-rate-arrow",children:"↑"}),s.velocity24h.toFixed(1)]}),a.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),h(s.hfUrl)&&s.hfKind&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${s.hfKind}`,onClick:e=>e.stopPropagation(),children:[a.jsx(U,{size:20}),a.jsxs("span",{className:"resource-stat",children:[a.jsx("span",{className:"resource-value",children:s.hfCount}),a.jsx("span",{className:"resource-label",children:s.hfKind})]})]})]})]})]})};export{O as P}; +import{f as v,M as g,j as a,L as d}from"./index-CbgxfyGU.js";import{A as M}from"./AuthorAvatar-CUJMmp_z.js";import{P as y,S as L,T as Z,M as A}from"./SotaBadges-C-sTR-EF.js";import{I as k}from"./Icon-D-kA0Owz.js";import{L as P,a as w}from"./LatexTitle-Z-HGmZ-H.js";import{a as C,p as E}from"./paperQueryKeys-B8u1BWlI.js";import{s as h}from"./safeExternalHref-CkBrsh84.js";const U=({size:s=16})=>a.jsxs("svg",{className:"hf-logo",width:s,height:s,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),a.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),a.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),a.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),a.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),a.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]});function $(s){const t=[...new Set(s.map(r=>r.replace(/ \(subtask\)$/,"")))],l=t.length>3?[...t.slice(0,2),`${t.length-2} more`]:t;return l.length>1?`${l.slice(0,-1).join(", ")} and ${l[l.length-1]}`:l[0]}const z="language-modeling";function p(s){return s?s.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function B(s){return p(s.slug)==="large language model"||p(s.name)==="large language model"}function D(s){return s.tags.includes(z)?s.methods.filter(t=>!B(t)):s.methods}const K=({name:s,slug:t,logoUrl:l})=>{const[r,i]=g.useState(!1);return!l||r?null:a.jsx(d,{to:`/orgs/${t}`,className:"paper-organization-logo","aria-label":`View ${s} organization`,title:s,children:a.jsx("img",{src:l,alt:"",onError:()=>i(!0)})})},O=({paper:s,priority:t=!1,showInstitution:l=!0,highlightQuery:r,followReasons:i})=>{const m=v(),u=`/paper/${s.id}`,n=g.useCallback(()=>{m.prefetchQuery({queryKey:E.detail(s.id),queryFn:()=>C.get(s.id,!0),staleTime:10*60*1e3})},[s.id,m]),N=s.authors.slice(0,3).map((e,o)=>{var b,F;const f=(b=s.authorIds)==null?void 0:b[o],j=(F=s.authorHfProfiles)==null?void 0:F[o];return a.jsxs(g.Fragment,{children:[o>0&&", ",j&&a.jsx(M,{className:"paper-card-author-avatar",url:j.avatarUrl}),f?a.jsx(d,{to:`/authors/${f}`,children:e}):e]},o)}),c=s.authors.length,x=D(s);return a.jsxs("article",{className:"paper-card",children:[a.jsx(d,{to:u,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:a.jsx(y,{paperId:s.id,title:s.title,thumbnailUrl:s.thumbnailUrl,priority:t})}),a.jsxs("div",{className:"paper-body",children:[a.jsxs("div",{className:"paper-body-main",children:[i&&i.length>0&&a.jsxs("div",{className:"paper-follow-reason",children:["Because you follow ",$(i)]}),a.jsxs("h3",{className:"paper-title",children:[a.jsx(d,{to:u,onFocus:n,onMouseEnter:n,children:a.jsx(P,{title:s.title,highlight:r})}),l&&s.organizations.length>0&&a.jsx("span",{className:"paper-organization-logos",children:s.organizations.map(e=>a.jsx(K,{...e},e.slug))})]}),a.jsxs("div",{className:"paper-authors",children:[N,c>3&&a.jsxs("span",{children:[", ","+",c-3," authors"]}),s.date&&a.jsxs(a.Fragment,{children:[c>0?" · ":"",a.jsx("span",{children:s.date})]}),s.citations>0&&a.jsxs(a.Fragment,{children:[c>0||s.date?" · ":"",a.jsxs("span",{children:[s.citations.toLocaleString()," citations"]})]})]}),s.abstract&&a.jsx("p",{className:"paper-abstract",children:a.jsx(w,{text:s.abstract,highlight:r})}),s.sotaRanks.length>0&&a.jsx(L,{ranks:s.sotaRanks,paperHref:u}),(s.tags.length>0||x.length>0)&&a.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[s.tags.map(e=>a.jsx(Z,{slug:e},e)),x.map(e=>a.jsx(A,{method:e},e.id||e.slug||e.name))]})]}),(s.githubUrl||s.hfUrl)&&a.jsxs("div",{className:"paper-resources",children:[h(s.githubUrl)&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:e=>e.stopPropagation(),children:[a.jsx(k,{name:"github",size:20}),s.velocity24h!=null&&s.velocity24h>0&&a.jsxs("span",{className:"resource-stat",children:[a.jsxs("span",{className:"resource-value",children:[a.jsx("span",{className:"gh-rate-arrow",children:"↑"}),s.velocity24h.toFixed(1)]}),a.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),h(s.hfUrl)&&s.hfKind&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${s.hfKind}`,onClick:e=>e.stopPropagation(),children:[a.jsx(U,{size:20}),a.jsxs("span",{className:"resource-stat",children:[a.jsx("span",{className:"resource-value",children:s.hfCount}),a.jsx("span",{className:"resource-label",children:s.hfKind})]})]})]})]})]})};export{O as P}; diff --git a/assets/PaperDetailView-F3D4F2PU.js b/assets/PaperDetailView-F3D4F2PU.js new file mode 100644 index 0000000000000000000000000000000000000000..bb5bfe980a08be82cce36b9a95f5bc5ad6d93b5a --- /dev/null +++ b/assets/PaperDetailView-F3D4F2PU.js @@ -0,0 +1,29 @@ +import{n as pt,s as Ee,o as Js,c as ts,p as J,q as Zs,r as x,j as e,C as ft,f as Z,t as gt,X as ss,P as as,v as ee,w as rs,x as he,y as ue,z as ns,A as xt,B as we,D as ea,L as K,E as ta,F as sa,R as aa,I as ra,G as is,J as na,h as ia,T as oa,K as Ce,g as la,a as Pe,M as Se,N as it,i as os,u as ca,O as At,Q as da,m as Lt,S as ua,U as ma,V as ha,W as pa,Y as fa,Z as ga}from"./index-CbgxfyGU.js";import{u as ae}from"./useMutation-P_trTy9i.js";import{I as U}from"./Icon-D-kA0Owz.js";import{T as xa,M as ba,S as ja,P as va}from"./SotaBadges-C-sTR-EF.js";import{L as ke,a as ot}from"./LatexTitle-Z-HGmZ-H.js";import{e as $e,C as ya,E as _a}from"./ExternalSourceEvalBadge-npO6bZ8N.js";import{p as me,a as B}from"./paperQueryKeys-B8u1BWlI.js";import{s as ka,a as Na}from"./transform-0Udg2p6b.js";import{r as ls,p as wa}from"./paperReader-BIpQD5HO.js";import{u as X}from"./useQuery-Bx9s5-D2.js";import{a as Ca}from"./usePapers-CJaWLZ3y.js";import{f as Sa,D as Ea}from"./latexPlainText-DI8YEXVe.js";import{s as Y}from"./safeExternalHref-CkBrsh84.js";import{F as Tt,i as Pa,P as $a}from"./curation-C7Gmmp4z.js";import{S as de}from"./skeleton-HwvdxvSN.js";import{A as Ia,a as Ra}from"./alert-CFDDvdIM.js";import{B as A}from"./button-Bv9oZ-QU.js";import{D as Ie,a as Re,c as Ae,b as Le,d as Te,e as bt}from"./dialog-Cfp_d3CC.js";import{A as Aa,a as La}from"./AgentLogos-BBl9UNVD.js";import{C as Ta}from"./copy-bzw7JVus.js";import{u as ve,r as Da,e as Fa}from"./evaluationQueryInvalidation-BogLM1gw.js";import{I as z}from"./input-B6pxtfPe.js";import{S as Dt}from"./searchable-select-DNdBIahG.js";import{L as jt}from"./loader-circle-CWMja8Zn.js";import{T as pe,n as He,g as Ft,C as Ua}from"./CatalogEntityPreviewLink-Cvehtzvn.js";import{S as cs,L as O,a as Ba}from"./SignInToEditDialog-CNIcNqbK.js";import{c as G}from"./catalog-DhK7_9-6.js";import{s as ds,p as us}from"./submissions-aWj7YtuZ.js";import{i as ms,a as hs,r as za}from"./queryInvalidation-Chlw4DEx.js";import{D as Ma}from"./database-CTvEb5JG.js";import{P as fe}from"./plus-UK0TEjgd.js";import{S as lt}from"./search-CLtAJGOp.js";import{B as ps}from"./badge-Klg-RRGs.js";import{G as Ut}from"./globe-B_laOt9Z.js";import{G as Bt}from"./github-BYklgHDz.js";import{u as fs}from"./index-CxPKwmVQ.js";import{c as Oe,A as Ha}from"./codex-Bl7j51l-.js";import{M as Oa}from"./index-ZkEATkOr.js";import{r as qa}from"./index-BH3yOoza.js";import{u as Ka}from"./useIntersectionObserver-CID9Kkak.js";import{S as zt,s as Ga}from"./savedPapersAuth-DsQUuWa_.js";import{o as Xa}from"./organizationNames-BVKzYEBp.js";import{A as Qa}from"./AuthorAvatar-CUJMmp_z.js";import"./colors-BkWRhvFI.js";import"./hover-card-ufez2uMo.js";import"./useInfiniteQuery-BAc_4HO5.js";import"./popover-DKJYnYjk.js";import"./textarea-Bf06GTSH.js";/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Va=pt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wa=pt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gs=pt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);function Ya(t){return t!=null&&t.can_directly_edit_catalog?"direct":"pending"}function Ja(t){return(t??[]).filter(s=>!!(s.dataset_slug&&s.task_slug))}function Za(t,s,r="https://paperswithcode.co"){return s.map(a=>{const i=encodeURIComponent(a.evaluation_id),d=`${r}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge.svg?eval=${i}&live=1`,o=`${r}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge-link?eval=${i}`;return`[![${`Papers with Code: ${a.best_rank===1?"SOTA":`#${a.best_rank}`} on ${a.dataset_name}`}](${d})](${o})`}).join(` +`)}function er(t,s=!0){return X({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return $e.byPaper(t)},enabled:s&&!!t,staleTime:0,refetchOnMount:"always"})}const xs=t=>t.replace(/v\d+$/,""),tr={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},qe=(t,s)=>{const r=(t[s]||[]).length;return r<100?{count:r,isLimited:!1}:{count:r,isLimited:!0}},Ke=(t,s)=>{const r=t[s];return Array.isArray(r)?r.map(a=>{if(typeof a=="string")return a;if(a&&typeof a=="object"){const i=a;return i.id||i.repoId||null}return null}).filter(a=>!!a).map(a=>`${tr[s]}${a}`):[]},sr=async t=>{try{return(await fetch(`https://huggingface.co/api/papers/${xs(t)}`)).ok}catch{return!1}},ar=async t=>{const s=xs(t),[r,a]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${s}/repos`).then(async l=>l.ok?l.json():(console.warn(`Failed to fetch repos for arXiv:${s}, status: ${l.status}`),null)).catch(l=>(console.warn(`Failed to fetch repos for arXiv:${s}:`,l),null)),sr(s)]);if(!r)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:a};const i=qe(r,"models"),d=qe(r,"datasets"),o=qe(r,"spaces");return{models:i.count,datasets:d.count,spaces:o.count,modelUrls:Ke(r,"models"),datasetUrls:Ke(r,"datasets"),spaceUrls:Ke(r,"spaces"),isLimited:i.isLimited||d.isLimited||o.isLimited,paperExists:a}},rr=t=>X({queryKey:["huggingface-repos",t],queryFn:()=>ar(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function nr(t,s){try{const r=new URL(t),a=r.pathname.split("/").filter(Boolean);return(a[0]==="datasets"||a[0]==="spaces")&&a.shift(),a.slice(0,2).join("/")||r.hostname.replace(/^www\./,"")}catch{return s}}function Ge(t,s,r){return[...new Set([...t,...s??[]])].map(a=>({href:a,label:nr(a,r)}))}function Xe(t,s,r){if(r==null&&t.length===0&&!(s!=null&&s.length))return;const a=new Set([...t,...s??[]]);return Math.max(a.size,r??0)}function Qe(t,s){if(!(t==null&&s==null))return Math.max(t??0,s??0)}function Ve(t){return t[0]??"https://huggingface.co"}function We(t,s){return s[0]??t}function ir(t){const s=`${t.title.slice(0,60)}${t.title.length>60?"…":""}`,r=`${t.authors[0]||""}${t.authors.length>1?" et al.":""}`,a=t.authors.join(" and "),i=(t.published||"").slice(0,4)||"—",d=(o,l)=>t.arxiv_id?`@article{${t.arxiv_id.replace(".","")}, + title={{${o}}}, + author=${l}, + year={{${i}}}, + eprint={{${t.arxiv_id}}}, + archivePrefix={{arXiv}} +}`:`@misc{paper${t.id}, + title={{${o}}}, + author=${l}, + year={{${i}}}, + url={{${t.source_url||t.url_abs||""}}} +}`;return{citationDisplay:d(s,`{{${r}}}`),citationCopy:d(t.title,`{${a}}`)}}function or(t,s,r){var b,h,n;const a={models:t.hf_models??[],datasets:t.hf_datasets??[],spaces:t.hf_spaces??[]},i=t.linked_hf_artifacts,d=t.hf_artifact_summary,o={models:[...(s==null?void 0:s.modelUrls)??[],...(i==null?void 0:i.models)??[]],datasets:[...(s==null?void 0:s.datasetUrls)??[],...(i==null?void 0:i.datasets)??[]],spaces:[...(s==null?void 0:s.spaceUrls)??[],...(i==null?void 0:i.spaces)??[]]},l={models:Qe(s==null?void 0:s.models,d==null?void 0:d.model_count),datasets:Qe(s==null?void 0:s.datasets,d==null?void 0:d.dataset_count),spaces:Qe(s==null?void 0:s.spaces,d==null?void 0:d.space_count)},u={models:Ge(a.models,o.models,"Model"),datasets:Ge(a.datasets,o.datasets,"Dataset"),spaces:Ge(a.spaces,o.spaces,"Space")},v={models:u.models.map(({href:m})=>m),datasets:u.datasets.map(({href:m})=>m),spaces:u.spaces.map(({href:m})=>m)},p=t.arxiv_id!=null?Ee(t.arxiv_id):null,c=t.arxiv_id?{isLoading:r,paperHref:`https://huggingface.co/papers/${p}`,rows:[{label:"Models",href:We(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,a.models),count:Xe(a.models,o.models,l.models),isLimited:s==null?void 0:s.isLimited,links:u.models},{label:"Datasets",href:We(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,a.datasets),count:Xe(a.datasets,o.datasets,l.datasets),isLimited:s==null?void 0:s.isLimited,links:u.datasets},{label:"Spaces",href:We(`https://huggingface.co/papers/${p}`,a.spaces),count:Xe(a.spaces,o.spaces,l.spaces),isLimited:s==null?void 0:s.isLimited,links:u.spaces}],footer:`Cite arxiv.org/abs/${p} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:Ve(a.models),count:a.models.length,links:u.models},{label:"Datasets",href:Ve(a.datasets),count:a.datasets.length,links:u.datasets},{label:"Spaces",href:Ve(a.spaces),count:a.spaces.length,links:u.spaces}],footer:null},g=(t.methods??[]).filter(({source_paper_id:m})=>m===t.id),f=t.introduced_benchmarks??[],y=t.introduced_frameworks??[],k=[g.length&&(g.length===1?"this method":"these methods"),f.length&&(f.length===1?"this benchmark":"these benchmarks"),y.length&&(y.length===1?"this framework":"these frameworks")].filter(m=>!!m);return{...ir(t),allHfArtifactUrls:v,authorEntries:t.authors.map((m,j)=>{var S,E,C,I,L,T;return{name:m,id:((E=(S=t.author_links)==null?void 0:S[j])==null?void 0:E.id)??null,hf_username:((I=(C=t.author_links)==null?void 0:C[j])==null?void 0:I.hf_username)??null,hf_avatar_url:((T=(L=t.author_links)==null?void 0:L[j])==null?void 0:T.hf_avatar_url)??null}}),copyableRanks:Ja(t.leaderboard_ranks),hasIntroducedItems:k.length>0,hasLineageItems:!!((b=t.predecessor_papers)!=null&&b.length||(h=t.successor_papers)!=null&&h.length),hfArtifactViewer:c,hfPaperExists:!!(s!=null&&s.paperExists),introducedBenchmarks:f,introducedFrameworks:y,introducedMethods:g,introducedSummary:k.join(" and "),numPages:t.num_pages||null,paperSourceLabel:t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",predecessorPapers:t.predecessor_papers??[],projectPages:((n=t.project_pages)==null?void 0:n.filter(({url:m})=>m).map(m=>({...m,safeHref:Y(m.url)})))??[],repoSummary:ka(t.repositories),safeAbstractUrl:Y(t.url_abs),safeConferenceUrl:Y(t.conference_url_abs),safePdfUrl:Y(t.url_pdf),successorPapers:t.successor_papers??[]}}const lr=["tldr","abstract","tasks","methods","results"];function cr(t){if(!t)return{section:null,resultsTaskSlug:null};const[s,r]=t.split("?",2);if(!lr.includes(s))return{section:null,resultsTaskSlug:null};const a=s;return a!=="results"||!r?{section:a,resultsTaskSlug:null}:{section:a,resultsTaskSlug:new URLSearchParams(r).get("task")}}const bs=t=>`results-task-${t}`,dr=t=>`#results?task=${encodeURIComponent(t)}`;function ur({direct:t,paperId:s,refetchEvaluations:r,refetchPaper:a}){a(),r(),!(!t||!s)&&(B.primeCurationState(s,!0).catch(()=>{}),$e.primeCurationState(s,!0).catch(()=>{}))}function mr(t,s){const r=t?Js(t):"",a=ts(),{toast:i}=J(),{preferences:d}=Zs(),o=Ca(r,!!r),l=o.data,[u,v]=x.useState(!1);x.useEffect(()=>{!t||t===r||a(`/paper/${r}${window.location.search}${window.location.hash}`,{replace:!0})},[r,a,t]),x.useEffect(()=>{if(l!=null&&l.title)return document.title=l.page_title||Sa(l.title),()=>{document.title=Ea}},[l==null?void 0:l.page_title,l==null?void 0:l.title]),x.useEffect(()=>{if(v(!1),!(l!=null&&l.id))return;const m=window.setTimeout(()=>v(!0),0);return()=>window.clearTimeout(m)},[l==null?void 0:l.id]);const p=u&&!!(l!=null&&l.id),c=rr(u?l==null?void 0:l.arxiv_id:void 0),g=er(l==null?void 0:l.id,p),f=X({queryKey:[...me.feeds.versions,l==null?void 0:l.arxiv_id],queryFn:()=>B.versions(Ee(l.arxiv_id)),enabled:p&&!!(l!=null&&l.arxiv_id),staleTime:10*60*1e3}),y=X({queryKey:[...me.feeds.related,l==null?void 0:l.id],queryFn:()=>B.related(l.arxiv_id||l.id,4),enabled:p,staleTime:10*60*1e3});x.useEffect(()=>{const m=()=>{ur({direct:s==="direct",paperId:l==null?void 0:l.id,refetchEvaluations:g.refetch,refetchPaper:o.refetch}),i({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",m),()=>window.removeEventListener("pwc:catalog-conflict",m)},[s,g.refetch,l==null?void 0:l.id,o.refetch,i]);const k=x.useMemo(()=>{const m=g.data;return!m||!d.hide_closed_source_evals?m:m.filter(j=>j.is_open!==!1)},[g.data,d.hide_closed_source_evals]),b=x.useMemo(()=>{if(!k)return[];const m=new Map;for(const j of k){const S=m.get(j.task_id);S?S.rows.push(j):m.set(j.task_id,{taskId:j.task_id,taskName:j.task_name||"—",taskSlug:j.task_slug,rows:[j]})}return[...m.values()]},[k]),h=x.useMemo(()=>l?or(l,c.data,c.isLoading):null,[c.data,c.isLoading,l]),n=x.useRef(!1);return x.useEffect(()=>{n.current=!1},[r]),x.useEffect(()=>{let m=0;const j=(E=!1,C=!1)=>{const{section:I,resultsTaskSlug:L}=cr(window.location.hash.slice(1));if(!I||!l||I==="tldr"&&!l.tldr||I==="results"&&(!p||g.isLoading)||!E&&n.current)return;let T=I==="results"&&L?document.getElementById(bs(L)):document.getElementById(I);if(!T&&I==="results"&&L){if(b.some(({taskSlug:H})=>H===L))return;T=document.getElementById("results")}T&&(m=window.requestAnimationFrame(()=>{n.current=!0,T.scrollIntoView({block:"start",behavior:C?"smooth":"auto"})}))};j();const S=()=>{n.current=!1,j(!0,!0)};return window.addEventListener("hashchange",S),()=>{window.removeEventListener("hashchange",S),m&&window.cancelAnimationFrame(m)}},[b,g.isLoading,l,p]),{arxivId:r,evaluations:g.data,evaluationsByTask:b,evaluationsLoading:g.isLoading,paper:l,paperError:o.error,paperLoading:o.isLoading,presentation:h,refetchEvaluations:g.refetch,refetchPaper:o.refetch,relatedQuery:y,versions:f.data??[],visibleEvaluations:k}}function hr(){const[t,s]=x.useState(null),r=x.useCallback(i=>{s(i)},[]),a=x.useCallback((i,d)=>{s(o=>d?i:o===i?null:o)},[]);return{activeEditor:t,openEditor:r,setEditorOpen:a}}function pr({paperId:t}){const[s,r]=x.useState(!1),[a,i]=x.useState(!1),[d,o]=x.useState(!1),l=`Help me edit https://paperswithcode.co/paper/${t} using the public pwc CLI from https://github.com/huggingface/pwc-cli. Install or update the CLI following its README, then run pwc skills add to load its instructions. Run pwc auth login --paper ${t}; I will authorize this paper in my browser. Export with pwc paper edit export ${t} --output edits.json, make explicit operations for the corrections I request, and preview before submitting. For organization changes, use an organizations operation with payload {"organization_ids": [existing organization IDs]}; this replaces the paper’s organization links and publishes directly. Use existing organizations, benchmark and metric definitions, preserve unrelated entries, and cite source URLs where available. Never print or copy credentials. Ask me what to change if I have not specified it.`;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"action-btn",title:"Edit this paper page with Claude, Codex, Cursor, or OpenCode",onClick:()=>{r(!1),i(!1),o(!0)},children:["Edit with your agent",e.jsx(Aa,{})]}),e.jsx(Ie,{open:d,onOpenChange:o,children:e.jsxs(Re,{className:"max-w-2xl",children:[e.jsxs(Ae,{children:[e.jsx(Le,{children:"Edit this paper with your agent"}),e.jsx(Te,{children:"Spotted a missing code link, a wrong task, or a missing benchmark result? Your favorite coding agent can fix it for you."})]}),e.jsx(La,{}),e.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Copy the prompt below."}),e.jsx("li",{children:"Paste it into Claude Code, Codex, Cursor, OpenCode, or another coding agent, and tell it what to change."}),e.jsxs("li",{children:["The agent installs the ",e.jsx("a",{className:"underline",href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:"pwc CLI"}),", asks you to authorize this paper with your Hugging Face account, and previews the edits before submitting them."]})]}),e.jsx("textarea",{"aria-label":"Paper edit prompt",readOnly:!0,value:l,className:"h-48 w-full resize-none rounded border bg-muted/40 p-3 font-mono text-xs",onFocus:u=>u.currentTarget.select()}),a&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not copy automatically. Select the prompt above and copy it manually."}),e.jsxs(A,{className:"justify-self-end",onClick:async()=>{try{await navigator.clipboard.writeText(l),r(!0),i(!1)}catch{i(!0)}},children:[s?e.jsx(ft,{size:14}):e.jsx(Ta,{size:14}),s?"Prompt copied":"Copy prompt"]})]})})]})}function fr(t){return t.map(s=>{const r=s.best_metric||Object.keys(s.metrics)[0]||"";return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:r,metric_value:String(s.metrics[r]??""),original_metrics:{...s.metrics},original_metric_name:r,best_rank:s.best_rank!=null?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",hf_model_url:s.hf_model_url||"",is_open:s.is_open!==!1,operation:"unchanged"}})}function gr(t,s){const r={...t.original_metrics},a=r[t.original_metric_name];return t.original_metric_name!==s&&delete r[t.original_metric_name],r[s]=a!=null&&t.metric_value===String(a)?a:t.metric_value,r}function xr(t){const s=t==null?void 0:t.trim();return s?Number(s):void 0}function Mt(t){const s=t.trim();return s?Number(s):null}function Ye(t){return t.trim()||null}function Je(t){return!!(t&&/^\d+$/.test(t.trim())&&Number.isSafeInteger(Number(t))&&Number(t)>0)}function js(t){const s=[];return t.forEach((r,a)=>{var o;if(r.operation==="unchanged")return;const i=(l,u)=>{s.push({rowIndex:a,field:l,message:u})};if(r.operation!=="create"&&!Je(r.id)&&i("id","This result has no valid evaluation ID. Reload the paper before editing it."),r.operation==="delete")return;Je(r.task_id)||i("task_id","Select a valid task."),Je(r.dataset_id)||i("dataset_id","Select a valid dataset.");const d=r.metric_name.trim();d?d!==r.original_metric_name&&Object.prototype.hasOwnProperty.call(r.original_metrics,d)&&i("metric_name",`Cannot rename a metric to "${d}": this evaluation already has that score.`):i("metric_name","Select a metric."),(o=r.best_rank)!=null&&o.trim()&&!Number.isSafeInteger(Number(r.best_rank))&&i("best_rank","Enter a whole-number rank."),r.num_parameters.trim()&&(!Number.isSafeInteger(Number(r.num_parameters))||Number(r.num_parameters)<0)&&i("num_parameters","Enter a non-negative whole-number parameter count."),r.metric_value.trim()||i("metric_value","Enter a metric value.")}),s}function br(t,s){const r=js(t);return r.length?{valid:!1,errors:r}:{valid:!0,operations:jr(t,s)}}function jr(t,s){const r=[];for(const a of t){if(a.operation==="delete"){r.push({op:"delete",evaluation_id:Number(a.id)});continue}if(a.operation!=="create"&&a.operation!=="update")continue;const i=a.metric_name.trim(),d=s(a.task_id,a.dataset_id),o={task_id:Number(a.task_id),dataset_id:Number(a.dataset_id),metrics:gr(a,i),best_metric:i,is_open:a.is_open},l=a.model_name.trim(),u=xr(a.best_rank);if(a.operation==="create"){const v=Mt(a.num_parameters),p=Ye(a.hf_model_url);r.push({op:"create",data:{...o,...l?{model_name:l}:{},...d&&a.harness.trim()?{harness:a.harness.trim()}:{},...u!==void 0?{best_rank:u}:{},...v!==null?{num_parameters:v}:{},...p!==null?{hf_model_url:p}:{}}});continue}r.push({op:"update",evaluation_id:Number(a.id),data:{...o,...l?{model_name:l}:{},harness:d?Ye(a.harness):null,...u!==void 0?{best_rank:u}:{},num_parameters:Mt(a.num_parameters),hf_model_url:Ye(a.hf_model_url)}})}return r}function vr(t,s){return s.map(r=>{switch(r.op){case"delete":return{operation:"delete",evaluation_id:r.evaluation_id};case"update":return{operation:"update",evaluation_id:r.evaluation_id,payload:r.data};case"create":return{operation:"create",payload:{paper_id:t,...r.data}}}})}function yr(t,s){const r=t.metrics(s.task_id,s.dataset_id).metrics.map(a=>({value:a.metric_name,label:a.metric_name,description:a.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return s.metric_name&&!r.some(a=>a.value===s.metric_name)&&r.unshift({value:s.metric_name,label:`${s.metric_name} (legacy)`}),r}const q="text-left py-2 px-2 font-medium text-sm";function _r({rows:t,catalog:s,draftErrors:r,errorId:a,isAdmin:i,showHarnessColumn:d,onFieldChange:o,onOpenSourceChange:l,onDelete:u}){const v=(g,f)=>r.some(y=>y.rowIndex===g&&y.field===f),p=(g,f)=>{const y=r.find(k=>k.rowIndex===g&&k.field===f);return y?e.jsx("p",{id:`${a}-${g}-${f}-error`,className:"text-xs text-destructive",children:y.message}):null},c=(g,f)=>({id:`${a}-${g}-${f}`,"aria-invalid":v(g,f),"aria-describedby":`${a}-${g}-${f}-error`});return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:`${q} min-w-[180px]`,children:"Task"}),e.jsx("th",{className:`${q} min-w-[180px]`,children:"Dataset"}),e.jsx("th",{className:`${q} ${d?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),d&&e.jsx("th",{className:`${q} min-w-[140px]`,children:"Harness"}),e.jsx("th",{className:`${q} min-w-[140px]`,children:"Metric"}),e.jsx("th",{className:q,children:"Value"}),e.jsx("th",{className:q,children:"Parameters"}),e.jsx("th",{className:`${q} min-w-[200px]`,children:"HF model URL"}),e.jsx("th",{className:`${q} w-20`,children:"Open source"}),e.jsx("th",{className:`${q} w-16`,children:"Action"})]})}),e.jsx("tbody",{children:t.map((g,f)=>{if(g.operation==="delete")return null;const y=s.task(g.task_id),k=s.dataset(g.dataset_id),b=s.metrics(g.task_id,g.dataset_id),h=yr(s,g);return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Task","aria-describedby":`${a}-${f}-task_id-error`,children:[e.jsx(Dt,{value:g.task_id,onChange:n=>o(f,"task_id",n),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:y?{value:y.id,label:y.name}:null,queryKey:["eval-edit-task-search"],queryFn:s.searchTasks}),p(f,"task_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Dataset","aria-describedby":`${a}-${f}-dataset_id-error`,children:[e.jsx(Dt,{value:g.dataset_id,onChange:n=>o(f,"dataset_id",n),placeholder:g.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:g.task_id?"No datasets found for this task.":"Select a task first.",disabled:!g.task_id,selectedOption:k?{value:k.id,label:k.name}:null,queryKey:["eval-edit-dataset-search",g.task_id],queryFn:s.searchDatasets(g.task_id),enabled:!!g.task_id}),p(f,"dataset_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(z,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:g.model_name,onChange:n=>o(f,"model_name",n.target.value)})}),d&&e.jsx("td",{className:"py-2 px-2",children:s.supportsHarness(g.task_id,g.dataset_id)?e.jsx(z,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:g.harness,onChange:n=>o(f,"harness",n.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsxs("td",{className:"py-2 px-2",children:[!g.task_id||!g.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):b.loading?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(jt,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):h.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",...c(f,"metric_name"),value:g.metric_name,onChange:n=>o(f,"metric_name",n.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),h.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))]}):!b.error&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"}),b.error&&e.jsx("p",{className:"text-xs text-destructive",children:"Could not load metrics"}),p(f,"metric_name")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(z,{type:"text",className:"w-full text-sm",placeholder:"44.9",...c(f,"metric_value"),value:g.metric_value,onChange:n=>o(f,"metric_value",n.target.value)}),p(f,"metric_value")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(z,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",...c(f,"num_parameters"),value:g.num_parameters,onChange:n=>o(f,"num_parameters",n.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."}),p(f,"num_parameters")]}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(z,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:g.hf_model_url,onChange:n=>o(f,"hf_model_url",n.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:g.is_open,onChange:n=>l(f,n.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>u(f),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:g.id&&!i?"Only administrators can delete published results":"Remove row",disabled:!!g.id&&!i,children:e.jsx(pe,{className:"w-4 h-4"})})})]},f)})})]})})}function kr(t){const s=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:s?"Test-only: this change stays on staging.":"Your changes go live right away."}),e.jsx("p",{className:"mt-1 leading-snug",children:s?"This exercises staging-local pending behavior and is not queued for production review.":"Edits are applied immediately and reviewed afterwards. A few, such as links to unfamiliar sites, are held for an admin first."})]})}function V({title:t,description:s,className:r,submitMode:a,isAuthor:i=!1,onOpenChange:d,onSave:o,isSaving:l,saveDisabled:u=!1,footerStart:v,children:p}){const c=a==="pending";return e.jsx(Ie,{open:!0,onOpenChange:d,children:e.jsxs(Re,{className:r,children:[e.jsxs(Ae,{children:[e.jsx(Le,{children:t}),e.jsx(Te,{children:s})]}),c&&e.jsx(kr,{isAuthor:i}),p,e.jsxs(bt,{children:[v,e.jsx(A,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),e.jsx(A,{onClick:o,disabled:l||u,children:l?e.jsxs(e.Fragment,{children:[e.jsx(jt,{className:"w-4 h-4 mr-2 animate-spin"}),c?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ft,{className:"w-4 h-4 mr-2"}),c?"Submit for review":"Save Changes"]})})]})]})})}const Ze=100,Ht=t=>["eval-edit","task",t],Ot=t=>["eval-edit","dataset",t];function le(...t){return new Map(t.flat().flatMap(s=>s?[[s.id,s]]:[]))}function et(t){return[...new Set(t.filter(Boolean))]}function Nr(t,s){var h;const r=Z(),a=x.useMemo(()=>et(t.map(n=>n.task_id)),[t]),i=x.useMemo(()=>et(t.map(n=>n.dataset_id)),[t]),d=x.useMemo(()=>et(t.map(n=>n.task_id&&n.dataset_id?`${n.task_id}:${n.dataset_id}`:"")),[t]),o=x.useMemo(()=>le(s.map(n=>n.task_name?{id:n.task_id,name:n.task_name,slug:n.task_slug,level:0}:void 0)),[s]),l=x.useMemo(()=>le(s.map(n=>n.dataset_name?{id:n.dataset_id,name:n.dataset_name,slug:n.dataset_slug}:void 0)),[s]),u=ve({queries:a.filter(n=>!o.has(n)).map(n=>({queryKey:Ht(n),queryFn:()=>G.getTask(n),staleTime:1/0})),combine:n=>n.map(m=>m.data)}),v=ve({queries:a.map(n=>({queryKey:["eval-edit","task-datasets",n],queryFn:async()=>(await G.listDatasets({task_id:Number(n),page_size:Ze})).results}))}),p=le(...v.map(n=>n.data??[])),c=ve({queries:i.filter(n=>!l.has(n)&&!p.has(n)).map(n=>({queryKey:Ot(n),queryFn:()=>G.getDataset(n),staleTime:1/0})),combine:n=>({data:n.map(m=>m.data),loaded:n.every(m=>m.isSuccess)})}),g=ve({queries:d.map(n=>{const[m,j]=n.split(":");return{queryKey:["eval-edit","leaderboard-metrics",m,j],queryFn:()=>G.leaderboardMetrics(j,m)}})}),f=le([...o.values()],u),y=le([...l.values()],[...p.values()],c.data),k=((h=v.find(n=>n.error))==null?void 0:h.error)??null,b=v.every(n=>n.isSuccess)&&c.loaded;return{task:n=>f.get(n),dataset:n=>y.get(n),supportsHarness:(n,m)=>{var j;return!!(n&&m&&((j=y.get(m))!=null&&j.supports_harness))},metrics:(n,m)=>{const j=g[d.indexOf(`${n}:${m}`)];return{metrics:(j==null?void 0:j.data)??[],loading:(j==null?void 0:j.isFetching)??!1,error:(j==null?void 0:j.error)??null}},datasetListError:k,harnessSupportKnown:b,searchTasks:async n=>{const m=await G.listTasks({page_size:Ze,...n?{q:n}:{}});return m.results.forEach(j=>r.setQueryData(Ht(j.id),j)),m.results.map(j=>{var S;return{value:j.id,label:j.name,description:(S=j.description)==null?void 0:S.slice(0,100)}})},searchDatasets:n=>async m=>{const j=await G.listDatasets({task_id:Number(n),page_size:Ze,...m?{q:m}:{}});return j.results.forEach(S=>r.setQueryData(Ot(S.id),S)),j.results.map(S=>({value:S.id,label:S.name,description:S.full_name}))}}}function wr(t,{toast:s,queryClient:r,paperIds:a,queuedDescription:i}){if(t.status==="approved"){ms(r,a),hs(r),s({title:"Edit applied",description:"Your change is now live on this paper."});return}s({title:"Edit submitted for review",description:i})}function W({editType:t,paperId:s,arxivId:r,submitMode:a,messages:i,toPendingPayload:d,applyDirect:o,applyOptimistic:l,onSaved:u,onClose:v}){const p=Z(),{toast:c}=J(),g=a==="pending";return ae({mutationFn:async f=>g?{submitted:await ds.submit(us(Number(s),t,d(f)))}:{paper:await o(f)},onMutate:async f=>{if(g||!l)return{};const y=await l(f);return v(),{rollback:y}},onSuccess:(f,y)=>{"submitted"in f?(wr(f.submitted,{toast:c,queryClient:p,paperIds:[s,r],queuedDescription:`Thanks! An admin will review your proposed ${i.proposal} shortly.`}),u==null||u(y,{direct:!1,live:f.submitted.status==="approved"})):(f.paper&&za(p,f.paper,[s,r]),u==null||u(y,{direct:!0,live:!0})),v()},onError:(f,y,k)=>{var b;(b=k==null?void 0:k.rollback)==null||b.call(k),c({title:g?"Could not submit edit":`Could not save ${i.noun}`,description:gt(f,g?"Failed to submit your edit. Please try again.":i.failure),variant:"destructive"})}})}const Cr={task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",original_metrics:{},original_metric_name:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"};function Sr(t){return(t??[]).some(s=>s.slug==="coding-agents"||s.name.trim().toLowerCase()==="coding agents")}function qt(t,s){return{...t,...s,operation:t.operation==="unchanged"?"update":t.operation}}function Er({onOpenChange:t,paperId:s,arxivId:r,initialEvaluations:a,paperTasks:i,submitMode:d="direct",isAdmin:o=!1,isAuthor:l=!1}){const u=x.useId(),v=Sr(i),[p,c]=x.useState(null),g=x.useMemo(()=>fr(a),[a]),f=p??g,[y,k]=x.useState(!1),b=y?js(f):[],[h,n]=x.useState(null),m=Nr(f,a),j=Z(),{toast:S}=J(),E=W({editType:"evaluations",paperId:s,arxivId:r,submitMode:d,messages:{proposal:"evaluation changes",noun:"evaluations",failure:"Failed to update evaluations."},toPendingPayload:P=>({operations:P}),applyDirect:async P=>{if(!o&&P.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");const w=Number(s);await $e.batch(w,vr(w,P))},onSaved:(P,{live:w})=>{w&&Da(j,Fa(s,a,P,r))},onClose:()=>t(!1)}),C=(P,w)=>c(f.map((_,R)=>R===P?w(_):_)),I=P=>{if(!f[P].id){c(f.filter((w,_)=>_!==P));return}window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes.")&&C(P,w=>({...w,operation:"delete"}))},L=(P,w,_)=>{C(P,R=>{if(R[w]===_)return R;const $={[w]:_};return(w==="task_id"||w==="dataset_id")&&Object.assign($,{original_metrics:{},original_metric_name:"",metric_value:"",best_rank:"",metric_name:""}),w==="task_id"&&Object.assign($,{dataset_id:"",harness:""}),w==="dataset_id"&&_&&!m.supportsHarness(R.task_id,_)&&($.harness=""),qt(R,$)})},T=()=>{k(!0);const P=br(f,m.supportsHarness);if(P.valid){if(P.operations.length===0){S({title:"No changes to submit",description:"Your evaluation list matches the existing data."});return}E.mutate(P.operations)}},H=P=>f.slice(0,P+1).filter(w=>w.operation!=="delete").length;return e.jsxs(e.Fragment,{children:[e.jsxs(V,{title:"Edit Evaluation Results",description:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result.",className:"max-w-6xl max-h-[800px]",submitMode:d,isAuthor:l,onOpenChange:t,onSave:T,isSaving:E.isPending,saveDisabled:!m.harnessSupportKnown,footerStart:e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(A,{variant:"ghost",onClick:()=>n("benchmark"),children:"Suggest a new benchmark"}),e.jsx(A,{variant:"ghost",onClick:()=>n("metric"),children:"Suggest a new metric"})]}),children:[b.length>0&&e.jsxs("div",{role:"alert",className:"text-sm text-destructive",children:["Fix the following errors before saving. No changes have been submitted.",e.jsx("ul",{children:b.map(P=>e.jsxs("li",{children:["Row ",H(P.rowIndex),": ",P.message]},`${P.rowIndex}-${P.field}`))})]}),m.datasetListError&&e.jsxs("p",{className:"text-sm text-destructive",children:["Could not load the benchmarks for these tasks: ",m.datasetListError.message]}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[f.some(P=>P.operation!=="delete")?e.jsx(_r,{rows:f,catalog:m,draftErrors:b,errorId:u,isAdmin:o,showHarnessColumn:v,onFieldChange:L,onOpenSourceChange:(P,w)=>C(P,_=>qt(_,{is_open:w})),onDelete:I}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ma,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>c([...f,Cr]),className:"flex items-center space-x-2",children:[e.jsx(fe,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]})]}),e.jsx(cs,{open:h!==null,onOpenChange:P=>{P||n(null)},paperId:s,kind:h??"benchmark"})]})}const tt=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function Kt(t){return t.map(s=>s.trim()).filter(Boolean)}function st(t,s){const r=Kt(t).sort(),a=Kt(s).sort();return r.length!==a.length?!1:r.every((i,d)=>i===a[d])}function Pr(t,s){return st(t.hf_models,s.hf_models)&&st(t.hf_datasets,s.hf_datasets)&&st(t.hf_spaces,s.hf_spaces)}function $r({onOpenChange:t,paperId:s,arxivId:r,initialArtifacts:a,submitMode:i="direct",isAuthor:d=!1}){const[o,l]=x.useState(a),[u,v]=x.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),p=W({editType:"hf_artifacts",paperId:s,arxivId:r,submitMode:i,messages:{proposal:"Hugging Face artifact changes",noun:"Hugging Face artifacts",failure:"Failed to update Hugging Face artifacts."},toPendingPayload:b=>b,applyDirect:b=>B.updateHfArtifacts(s,b),onClose:()=>t(!1)}),c=()=>{const b={hf_models:[...o.hf_models],hf_datasets:[...o.hf_datasets],hf_spaces:[...o.hf_spaces]};for(const{key:h}of tt){const n=u[h].trim();if(n){if(b[h].some(m=>m.trim()===n))return alert(`This ${h.replace("hf_","")} URL is already added`),null;b[h]=[...b[h],n]}}return b},g=b=>{const h=u[b].trim();if(h){if(o[b].some(n=>n.trim()===h)){alert(`This ${b.replace("hf_","")} URL is already added`);return}l(n=>({...n,[b]:[...n[b],h]})),v(n=>({...n,[b]:""}))}},f=(b,h)=>{l(n=>({...n,[b]:n[b].filter(m=>m!==h)}))},y=()=>{const b=c();if(b===null)return;const h=Object.keys(a).some(n=>a[n].some(m=>!b[n].includes(m)));i==="direct"&&h&&!window.confirm("Remove one or more Hugging Face artifact links?")||p.mutate(b)},k=x.useMemo(()=>{const b={hf_models:[...o.hf_models],hf_datasets:[...o.hf_datasets],hf_spaces:[...o.hf_spaces]};for(const{key:h}of tt){const n=u[h].trim();if(n){if(b[h].some(m=>m.trim()===n))return!1;b[h]=[...b[h],n]}}return!Pr(b,a)},[o,u,a]);return e.jsx(V,{title:"Edit Hugging Face Artifacts",description:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper.",className:"max-w-2xl max-h-[700px]",submitMode:i,isAuthor:d,onOpenChange:t,onSave:y,isSaving:p.isPending,saveDisabled:!k,children:e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:tt.map(({key:b,label:h,placeholder:n})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:h}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(z,{type:"url",placeholder:n,value:u[b],onChange:m=>v(j=>({...j,[b]:m.target.value})),onKeyPress:m=>{m.key==="Enter"&&(m.preventDefault(),g(b))},className:"flex-1"}),e.jsxs(A,{onClick:()=>g(b),size:"sm",disabled:!u[b].trim(),children:[e.jsx(fe,{className:"w-4 h-4 mr-1"}),"Add"]})]}),o[b].length>0?e.jsx("div",{className:"space-y-2",children:o[b].map(m=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:m}),e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>f(b,m),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${h.toLowerCase()} URL`,children:e.jsx(pe,{className:"w-4 h-4"})})]},m))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",h.toLowerCase()," linked yet."]})]},b))})})}const vs=["image/jpeg","image/png","image/webp","image/gif"],Ir=2*1024*1024;function Rr(t){return vs.includes(t.type)?t.size>Ir?Promise.reject(new Error("Logo must be 2 MB or smaller.")):new Promise((s,r)=>{const a=new FileReader;a.onload=()=>s({file_name:t.name,mime_type:t.type,data_url:String(a.result)}),a.onerror=()=>r(new Error("Could not read that logo.")),a.readAsDataURL(t)}):Promise.reject(new Error("Choose a JPEG, PNG, WebP, or GIF logo."))}function Ar({paperId:t,initialName:s,onApplied:r,onUnsentChange:a}){const[i,d]=x.useState(s),[o,l]=x.useState(""),[u,v]=x.useState(""),[p,c]=x.useState(null),[g,f]=x.useState(""),y=ae({mutationFn:()=>ds.submit(us(Number(t),"new_organization",{name:i.trim(),...o.trim()?{hf_slug:o.trim()}:{},...u.trim()?{website_url:u.trim()}:{},...p?{image:p}:{}})),onSuccess:b=>{b.status==="approved"&&r(i.trim())}}),k=!y.isSuccess&&!!(o.trim()||u.trim()||p);return x.useEffect(()=>a(k),[a,k]),x.useEffect(()=>()=>a(!1),[a]),y.isSuccess?e.jsxs("p",{className:"rounded border p-3 text-sm",children:['Thanks! "',i.trim(),'" was submitted for review. Once an admin approves it, the organization is created and added to this paper.']}):e.jsxs("form",{className:"space-y-2 rounded border p-3",onSubmit:b=>{b.preventDefault(),y.mutate()},children:[e.jsx("p",{className:"text-sm font-medium",children:"Suggest a new organization"}),e.jsx(z,{"aria-label":"Organization name",placeholder:"Name",value:i,maxLength:200,onChange:b=>d(b.target.value)}),e.jsx(z,{"aria-label":"Hugging Face organization",placeholder:"Hugging Face organization (e.g. https://huggingface.co/PrimeIntellect)",value:o,onChange:b=>l(b.target.value)}),e.jsx(z,{"aria-label":"Website",type:"url",placeholder:"Website (e.g. https://www.primeintellect.ai)",value:u,onChange:b=>v(b.target.value)}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:["Logo (optional)",e.jsx("input",{"aria-label":"Logo",type:"file",accept:vs.join(","),onChange:b=>{var n;const h=(n=b.target.files)==null?void 0:n[0];c(null),f(""),h&&Rr(h).then(c,m=>f(m.message))}})]}),p&&e.jsx("img",{src:p.data_url,alt:"Selected logo",className:"h-12 w-12 rounded border object-contain"}),g&&e.jsx("p",{className:"text-sm text-destructive",children:g}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"With a Hugging Face organization it is added right away; otherwise an admin reviews it."}),e.jsx(A,{type:"submit",variant:"outline",disabled:!i.trim()||!o.trim()&&!u.trim()||y.isPending,children:y.isPending?"Submitting...":"Submit organization"})]}),y.error&&e.jsx("p",{className:"text-sm text-destructive",children:gt(y.error,"Could not submit this organization.")})]})}const Lr=({onOpenChange:t,paperId:s,arxivId:r,initialOrganizationIds:a,submitMode:i="direct",isAuthor:d})=>{var n;const[o,l]=x.useState(a),[u,v]=x.useState(""),[p,c]=x.useState(!1),g=Z(),{toast:f}=J(),y=X({queryKey:["organizations","curation"],queryFn:()=>G.organizations(!1)}),k=x.useMemo(()=>{var S,E;const m=u.trim().toLocaleLowerCase();if(!m)return((S=y.data)==null?void 0:S.results)??[];const j=C=>C===m?0:C.startsWith(m)?1:C.split(/[^\p{L}\p{N}]+/u).some(I=>I.startsWith(m))?2:3;return(((E=y.data)==null?void 0:E.results)??[]).map(C=>({organization:C,name:C.name.toLocaleLowerCase()})).filter(({name:C})=>C.includes(m)).sort((C,I)=>j(C.name)-j(I.name)).map(({organization:C})=>C)},[(n=y.data)==null?void 0:n.results,u]),b=W({editType:"organizations",paperId:s,arxivId:r,submitMode:i,messages:{proposal:"organization changes",noun:"organizations",failure:"Failed to update organizations."},toPendingPayload:m=>({organization_ids:m}),applyDirect:m=>B.updateOrganizations(s,m),onClose:()=>t(!1)}),h=()=>{a.some(m=>!o.includes(m))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")||b.mutate(o)};return e.jsxs(V,{title:"Edit organizations",description:"Associate organizations with this paper. If one is missing, search for it and suggest it for review.",submitMode:i,isAuthor:d,onOpenChange:t,onSave:h,isSaving:b.isPending,saveDisabled:p,children:[e.jsxs("div",{className:"relative",children:[e.jsx(lt,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(z,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:u,onChange:m=>v(m.target.value),className:"pl-9 pr-9"}),u&&e.jsx("button",{type:"button",onClick:()=>v(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear organization search",children:e.jsx(ss,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[k.map(m=>{const j=Number(m.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes(j),onChange:S=>l(E=>S.target.checked?[...E,j]:E.filter(C=>C!==j))}),m.name]},m.id)}),!y.isLoading&&k.length===0&&e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:u.trim()?`No organizations found matching "${u.trim()}"`:"No organizations available"})]}),!y.isLoading&&k.length===0&&u.trim()&&e.jsx(Ar,{paperId:s,initialName:u.trim(),onApplied:m=>{t(!1),f({title:"Organization added",description:`Added "${m}" to this paper.`}),ms(g,[s]),hs(g),g.invalidateQueries({queryKey:["organizations"]})},onUnsentChange:c},u.trim()),p&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Submit the organization above, or clear the search, before saving."})]})};function Tr({onOpenChange:t,paperId:s,arxivId:r,initialProjectPages:a,submitMode:i="direct",isAuthor:d=!1}){const[o,l]=x.useState(a),[u,v]=x.useState(""),p=W({editType:"project_pages",paperId:s,arxivId:r,submitMode:i,messages:{proposal:"project page changes",noun:"project pages",failure:"Failed to update project pages."},toPendingPayload:h=>({project_pages:h}),applyDirect:h=>B.updateProjectPages(s,h),onClose:()=>t(!1)}),c=()=>{const h=u.trim();return h?o.some(n=>n.url===h)?(alert("This project page URL is already added"),null):[...o,{url:h,is_official:!1}]:o},g=()=>{const h=c();h!==null&&h.length!==o.length&&(l(h),v(""))},f=h=>{l(o.filter(n=>n.url!==h))},y=h=>{l(o.map(n=>n.url===h?{...n,is_official:!n.is_official}:n))},k=()=>{const h=c();h!==null&&(i==="direct"&&a.some(n=>!h.some(m=>m.url===n.url))&&!window.confirm("Remove one or more project pages from this paper?")||p.mutate(h))},b=x.useMemo(()=>{const h=u.trim(),n=h?[...o,{url:h,is_official:!1}]:o;if(n.length!==a.length)return!0;const m=new Map(a.map(j=>[j.url.trim(),!!j.is_official]));return n.some(j=>{const S=m.get(j.url.trim());return S===void 0||S!==!!j.is_official})},[o,u,a]);return e.jsxs(V,{title:"Edit Paper Project Pages",description:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors.",className:"max-w-2xl max-h-[600px]",submitMode:i,isAuthor:d,onOpenChange:t,onSave:k,isSaving:p.isPending,saveDisabled:!b,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(z,{type:"url",placeholder:"https://example.com/project",value:u,onChange:h=>v(h.target.value),onKeyPress:h=>{h.key==="Enter"&&(h.preventDefault(),g())},className:"flex-1"}),e.jsxs(A,{onClick:g,size:"sm",disabled:!u.trim(),children:[e.jsx(fe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:o.length>0?e.jsx("div",{className:"space-y-2",children:o.map((h,n)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Ut,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:h.url}),h.is_official&&e.jsx(ps,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(A,{variant:h.is_official?"default":"outline",size:"sm",onClick:()=>y(h.url),className:"h-8 px-2 text-xs",title:h.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(gs,{className:`w-3.5 h-3.5 mr-1 ${h.is_official?"fill-current":""}`}),h.is_official?"Official":"Mark official"]}),e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>f(h.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(pe,{className:"w-4 h-4"})})]})]},n))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ut,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})})]})}function Dr({onOpenChange:t,paperId:s,arxivId:r,initialRepositories:a,submitMode:i="direct",isAuthor:d=!1}){const[o,l]=x.useState(a),[u,v]=x.useState(""),p=W({editType:"repositories",paperId:s,arxivId:r,submitMode:i,messages:{proposal:"repository changes",noun:"repositories",failure:"Failed to update paper repositories."},toPendingPayload:n=>({repositories:n}),applyDirect:n=>B.updateRepositories(s,n),onClose:()=>t(!1)}),c=n=>{const m=[];for(const j of n){const S=m.find(E=>Ft(E.url,j.url));if(S)S.is_official=S.is_official||j.is_official;else{const E=He(j.url);m.push({url:E??j.url.trim(),is_official:j.is_official})}}return m},g=()=>{const n=u.trim(),m=n?[...o,{url:n,is_official:!1}]:o;return n&&o.some(j=>Ft(j.url,n))?(alert("This repository URL is already added"),null):c(m)},f=()=>{const n=g();n!==null&&n.length!==o.length&&(l(n),v(""))},y=n=>{l(o.filter(m=>m.url!==n))},k=n=>{l(o.map(m=>m.url===n?{...m,is_official:!m.is_official}:m))},b=()=>{const n=g();n!==null&&(i==="direct"&&a.some(m=>!n.some(j=>j.url===m.url))&&!window.confirm("Remove one or more repositories from this paper?")||p.mutate(n))},h=x.useMemo(()=>{const n=u.trim(),m=n?[...o,{url:n,is_official:!1}]:o;if(m.length!==a.length)return!0;const j=c(a),S=c(m);if(S.length!==j.length)return!0;const E=new Map(j.map(C=>[He(C.url)??C.url.trim(),!!C.is_official]));return S.some(C=>{const I=He(C.url)??C.url.trim(),L=E.get(I);return L===void 0||L!==!!C.is_official})},[o,u,a]);return e.jsxs(V,{title:"Edit Paper Repositories",description:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors.",className:"max-w-2xl max-h-[600px]",submitMode:i,isAuthor:d,onOpenChange:t,onSave:b,isSaving:p.isPending,saveDisabled:!h,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(z,{type:"url",placeholder:"https://github.com/owner/repo",value:u,onChange:n=>v(n.target.value),onKeyPress:n=>{n.key==="Enter"&&(n.preventDefault(),f())},className:"flex-1"}),e.jsxs(A,{onClick:f,size:"sm",disabled:!u.trim(),children:[e.jsx(fe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:o.length>0?e.jsx("div",{className:"space-y-2",children:o.map((n,m)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Bt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:n.url}),n.is_official&&e.jsx(ps,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(A,{variant:n.is_official?"default":"outline",size:"sm",onClick:()=>k(n.url),className:"h-8 px-2 text-xs",title:n.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(gs,{className:`w-3.5 h-3.5 mr-1 ${n.is_official?"fill-current":""}`}),n.is_official?"Official":"Mark official"]}),e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>y(n.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(pe,{className:"w-4 h-4"})})]})]},m))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Bt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})})]})}function Fr({onOpenChange:t,paperId:s,arxivId:r,initialUrl:a,submitMode:i="direct",isAuthor:d=!1}){const[o,l]=x.useState(a),u=W({editType:"source_url",paperId:s,arxivId:r,submitMode:i,messages:{proposal:"source URL change",noun:"source URL",failure:"Failed to update source URL."},toPendingPayload:f=>({source_url:f}),applyDirect:f=>B.updateSourceUrl(s,f),onClose:()=>t(!1)}),v=o.trim(),p=/^https?:\/\//i.test(v),c=v!==(a||"").trim(),g=()=>{p&&u.mutate(v)};return e.jsx(V,{title:"Edit Source URL",description:'Update the canonical URL for this external paper. This is the page the "Source page" button links to. ArXiv papers cannot edit this field.',className:"max-w-2xl",submitMode:i,isAuthor:d,onOpenChange:t,onSave:g,isSaving:u.isPending,saveDisabled:!p||!c,children:e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(z,{type:"url",placeholder:"https://example.com/paper",value:o,onChange:f=>l(f.target.value),onKeyPress:f=>{f.key==="Enter"&&p&&c&&(f.preventDefault(),g())}}),!p&&v.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]})})}var De="Checkbox",[Ur]=xt(De),[Br,vt]=Ur(De);function zr(t){const{__scopeCheckbox:s,checked:r,children:a,defaultChecked:i,disabled:d,form:o,name:l,onCheckedChange:u,required:v,value:p="on",internal_do_not_use_render:c}=t,[g,f]=rs({prop:r,defaultProp:i??!1,onChange:u,caller:De}),[y,k]=x.useState(null),[b,h]=x.useState(null),n=x.useRef(!1),m=y?!!o||!!y.closest("form"):!0,j={checked:g,disabled:d,setChecked:f,control:y,setControl:k,name:l,form:o,value:p,hasConsumerStoppedPropagationRef:n,required:v,defaultChecked:Q(i)?!1:i,isFormControl:m,bubbleInput:b,setBubbleInput:h};return e.jsx(Br,{scope:s,...j,children:Mr(c)?c(j):a})}var ys="CheckboxTrigger",_s=x.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:r,...a},i)=>{const{control:d,value:o,disabled:l,checked:u,required:v,setControl:p,setChecked:c,hasConsumerStoppedPropagationRef:g,isFormControl:f,bubbleInput:y}=vt(ys,t),k=he(i,p),b=x.useRef(u);return x.useEffect(()=>{const h=d==null?void 0:d.form;if(h){const n=()=>c(b.current);return h.addEventListener("reset",n),()=>h.removeEventListener("reset",n)}},[d,c]),e.jsx(ee.button,{type:"button",role:"checkbox","aria-checked":Q(u)?"mixed":u,"aria-required":v,"data-state":Ss(u),"data-disabled":l?"":void 0,disabled:l,value:o,...a,ref:k,onKeyDown:ue(s,h=>{h.key==="Enter"&&h.preventDefault()}),onClick:ue(r,h=>{c(n=>Q(n)?!0:!n),y&&f&&(g.current=h.isPropagationStopped(),g.current||h.stopPropagation())})})});_s.displayName=ys;var yt=x.forwardRef((t,s)=>{const{__scopeCheckbox:r,name:a,checked:i,defaultChecked:d,required:o,disabled:l,value:u,onCheckedChange:v,form:p,...c}=t;return e.jsx(zr,{__scopeCheckbox:r,checked:i,defaultChecked:d,disabled:l,required:o,onCheckedChange:v,name:a,form:p,value:u,internal_do_not_use_render:({isFormControl:g})=>e.jsxs(e.Fragment,{children:[e.jsx(_s,{...c,ref:s,__scopeCheckbox:r}),g&&e.jsx(Cs,{__scopeCheckbox:r})]})})});yt.displayName=De;var ks="CheckboxIndicator",Ns=x.forwardRef((t,s)=>{const{__scopeCheckbox:r,forceMount:a,...i}=t,d=vt(ks,r);return e.jsx(as,{present:a||Q(d.checked)||d.checked===!0,children:e.jsx(ee.span,{"data-state":Ss(d.checked),"data-disabled":d.disabled?"":void 0,...i,ref:s,style:{pointerEvents:"none",...t.style}})})});Ns.displayName=ks;var ws="CheckboxBubbleInput",Cs=x.forwardRef(({__scopeCheckbox:t,...s},r)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:d,defaultChecked:o,required:l,disabled:u,name:v,value:p,form:c,bubbleInput:g,setBubbleInput:f}=vt(ws,t),y=he(r,f),k=fs(d),b=ns(a);x.useEffect(()=>{const n=g;if(!n)return;const m=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(m,"checked").set,E=!i.current;if(k!==d&&S){const C=new Event("click",{bubbles:E});n.indeterminate=Q(d),S.call(n,Q(d)?!1:d),n.dispatchEvent(C)}},[g,k,d,i]);const h=x.useRef(Q(d)?!1:d);return e.jsx(ee.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??h.current,required:l,disabled:u,name:v,value:p,form:c,...s,tabIndex:-1,ref:y,style:{...s.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Cs.displayName=ws;function Mr(t){return typeof t=="function"}function Q(t){return t==="indeterminate"}function Ss(t){return Q(t)?"indeterminate":t?"checked":"unchecked"}const _t=x.forwardRef(({className:t,style:s,...r},a)=>e.jsx(yt,{ref:a,className:we("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...r,children:e.jsx(Ns,{className:we("flex items-center justify-center text-current"),children:e.jsx(ft,{className:"h-4 w-4"})})}));_t.displayName=yt.displayName;const Hr=250,Or=100,qr={editType:"tasks",singular:"task",plural:"tasks",title:"Edit Paper Tasks",description:"Select the tasks that this paper addresses. You can select multiple tasks.",search:t=>G.listTasks(t),toPendingPayload:t=>({task_ids:t}),applyDirect:(t,s)=>B.updateTasks(t,s),patchPaper:(t,s)=>({...t,tasks:[...s].sort((r,a)=>r.name.localeCompare(a.name))})},Kr={editType:"methods",singular:"method",plural:"methods",title:"Edit Paper Methods",description:"Select the methods and techniques used in this paper. You can select multiple methods.",search:t=>G.listMethods(t),toPendingPayload:t=>({method_ids:t}),applyDirect:(t,s)=>B.updateMethods(t,s),subtitle:t=>t.full_name!==t.name?t.full_name:void 0},Gr=t=>t[0].toUpperCase()+t.slice(1),ye=t=>t.map(s=>Number(s.id));function Gt(t){return t.kind==="task"?e.jsx(Xt,{...t,tagKind:qr}):e.jsx(Xt,{...t,tagKind:Kr})}function Xt({tagKind:t,onOpenChange:s,paperId:r,arxivId:a,initialItems:i,submitMode:d="direct",isAuthor:o=!1}){const{singular:l,plural:u,patchPaper:v}=t,[p,c]=x.useState(i),[g,f]=x.useState(!1),[y,k]=x.useState(""),[b,h]=x.useState(""),n=Z(),{toast:m}=J();x.useEffect(()=>{const w=window.setTimeout(()=>{h(y.trim())},Hr);return()=>window.clearTimeout(w)},[y]);const{data:j,isFetching:S}=X({queryKey:[`${u}-search`,b],queryFn:()=>t.search({page_size:Or,...b?{q:b}:{}})}),E=W({editType:t.editType,paperId:r,arxivId:a,submitMode:d,messages:{proposal:`${l} changes`,noun:u,failure:`Failed to update paper ${u}.`},toPendingPayload:w=>t.toPendingPayload(ye(w)),applyDirect:w=>t.applyDirect(r,ye(w)),applyOptimistic:v&&(async w=>{const _=[...new Set([r,a].filter($=>!!$))].flatMap($=>[me.detail($),me.arxiv($)]);await Promise.all(_.map($=>n.cancelQueries({queryKey:$})));const R=_.map($=>({key:$,data:n.getQueryData($)}));return R.forEach(({key:$,data:D})=>{D&&n.setQueryData($,v(D,w))}),()=>R.forEach(({key:$,data:D})=>n.setQueryData($,D))}),onSaved:(w,{direct:_})=>{_&&m({title:`${Gr(u)} updated`,description:`Saved ${w.length} ${w.length===1?l:u} for this paper.`})},onClose:()=>s(!1)}),C=x.useMemo(()=>new Set(ye(p)),[p]),I=x.useMemo(()=>ye(i),[i]),L=x.useMemo(()=>{const w=(j==null?void 0:j.results)??[],_=b?[...w,...p]:[...p,...w];return _.filter((R,$)=>_.findIndex(({id:D})=>D===R.id)===$)},[j,p,b]),T=p.length!==I.length||I.some(w=>!C.has(w)),H=()=>{d==="direct"&&I.some(w=>!C.has(w))&&!window.confirm(`Remove one or more ${l} links from this paper?`)||E.mutate(p)},P=(w,_)=>{c(R=>_?R.some($=>$.id===w.id)?R:[...R,w]:R.filter($=>$.id!==w.id))};return e.jsxs(e.Fragment,{children:[e.jsxs(V,{title:t.title,description:t.description,className:"max-w-2xl max-h-[600px]",submitMode:d,isAuthor:o,onOpenChange:s,onSave:H,isSaving:E.isPending,saveDisabled:!T,footerStart:e.jsxs(A,{variant:"ghost",className:"sm:mr-auto",onClick:()=>f(!0),children:["Suggest a new ",l]}),children:[e.jsxs("div",{className:"relative mb-4",children:[e.jsx(lt,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(z,{type:"text",placeholder:`Search ${u}...`,value:y,onChange:w=>k(w.target.value),className:"pl-9 pr-9"}),y&&e.jsx("button",{type:"button",onClick:()=>k(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(ss,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:L.length>0?e.jsx("div",{className:"space-y-2",children:L.map(w=>{var R;const _=(R=t.subtitle)==null?void 0:R.call(t,w);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(_t,{id:`${l}-${w.id}`,checked:C.has(Number(w.id)),onCheckedChange:$=>P(w,$===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`${l}-${w.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[w.name,_&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:_}),w.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[w.description.substring(0,100),w.description.length>100?"...":""]})]})]},w.id)})}):S?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(jt,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsxs("p",{children:["Loading ",u,"..."]})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(lt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:b?`No ${u} found matching "${b}"`:`No ${u} available`})]})})]}),e.jsx(cs,{open:g,onOpenChange:f,paperId:r,kind:l})]})}const Qt=10,Xr=/^https?:\/\/(?:www\.|mobile\.)?(?:x|twitter)\.com\/(?:[A-Za-z0-9_]{1,15}|i\/web|i)\/status(?:es)?\/(\d{1,25})(?:[/?#].*)?$/;function te(t){var s;return((s=Xr.exec(t.trim()))==null?void 0:s[1])??null}function Qr({onOpenChange:t,paperId:s,arxivId:r,initialUrls:a,submitMode:i="direct",isAuthor:d=!1}){const[o,l]=x.useState(a),[u,v]=x.useState(""),[p,c]=x.useState(null),g=W({editType:"x_threads",paperId:s,arxivId:r,submitMode:i,messages:{proposal:"X threads",noun:"X threads",failure:"Failed to update X threads."},toPendingPayload:n=>({x_threads:n}),applyDirect:n=>B.updateXThreads(s,n),onClose:()=>t(!1)}),f=()=>{const n=u.trim();if(!n)return o;const m=te(n);return m?o.some(j=>te(j)===m)?(c("This post is already listed."),null):o.length>=Qt?(c(`A paper can link at most ${Qt} X threads.`),null):[...o,n]:(c("Paste a post URL such as https://x.com/user/status/123…"),null)},y=()=>{const n=f();n!==null&&(l(n),v(""),c(null))},k=(n,m)=>{const j=[...o];[j[n],j[n+m]]=[j[n+m],j[n]],l(j)},b=()=>{const n=f();n!==null&&(i==="direct"&&a.some(m=>!n.some(j=>te(j)===te(m)))&&!window.confirm("Remove one or more X threads from this paper?")||g.mutate(n))},h=x.useMemo(()=>(u.trim()?[...o,u.trim()]:o).map(te).join()!==a.map(te).join(),[o,u,a]);return e.jsxs(V,{title:"Edit X threads",description:"Link posts on X (formerly Twitter) in which the authors introduce this paper. A preview of each post is shown on the paper page.",className:"max-w-2xl max-h-[600px]",submitMode:i,isAuthor:d,onOpenChange:t,onSave:b,isSaving:g.isPending,saveDisabled:!h,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",htmlFor:"x-thread-url",children:"Add X post URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(z,{id:"x-thread-url",type:"url",placeholder:"https://x.com/user/status/1234567890",value:u,onChange:n=>{v(n.target.value),c(null)},onKeyDown:n=>{n.key==="Enter"&&(n.preventDefault(),y())},"aria-invalid":!!p,className:"flex-1"}),e.jsxs(A,{onClick:y,size:"sm",disabled:!u.trim(),children:[e.jsx(fe,{className:"w-4 h-4 mr-1"}),"Add"]})]}),p&&e.jsx("p",{className:"text-xs text-destructive",children:p})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:o.length>0?e.jsx("div",{className:"space-y-2",children:o.map((n,m)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm font-medium",children:n}),e.jsx(A,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:m===0,onClick:()=>k(m,-1),"aria-label":"Move up",children:e.jsx(Wa,{className:"w-4 h-4"})}),e.jsx(A,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:m===o.length-1,onClick:()=>k(m,1),"aria-label":"Move down",children:e.jsx(Va,{className:"w-4 h-4"})}),e.jsx(A,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive",onClick:()=>l(o.filter(j=>j!==n)),"aria-label":"Remove X thread",children:e.jsx(pe,{className:"w-4 h-4"})})]},n))}):e.jsx("p",{className:"text-center py-8 text-sm text-muted-foreground",children:"No X threads linked yet"})})]})}function Vr({activeEditor:t,arxivId:s,editSubmitMode:r,evaluations:a,isAdmin:i,isLinkedAuthor:d,onOpenChange:o,paper:l}){if(!t)return null;const u={paperId:l.id,arxivId:s,submitMode:r,isAuthor:d,onOpenChange:c=>o(t,c)},v=c=>(c==null?void 0:c.map(({url:g,is_official:f})=>({url:g,is_official:!!f})))??[],p={tasks:()=>e.jsx(Gt,{...u,kind:"task",initialItems:l.tasks??[]}),methods:()=>e.jsx(Gt,{...u,kind:"method",initialItems:l.methods??[]}),repositories:()=>e.jsx(Dr,{...u,initialRepositories:v(l.repositories)}),project_pages:()=>e.jsx(Tr,{...u,initialProjectPages:v(l.project_pages)}),evaluations:()=>e.jsx(Er,{...u,initialEvaluations:a,paperTasks:l.tasks??[],isAdmin:i}),source_url:()=>e.jsx(Fr,{...u,initialUrl:l.source_url??l.url_abs??""}),hf_artifacts:()=>e.jsx($r,{...u,initialArtifacts:{hf_models:l.hf_models??[],hf_datasets:l.hf_datasets??[],hf_spaces:l.hf_spaces??[]}}),x_threads:()=>{var c;return e.jsx(Qr,{...u,initialUrls:((c=l.x_threads)==null?void 0:c.map(({url:g})=>g))??[]})},organizations:()=>e.jsx(Lr,{...u,initialOrganizationIds:(l.organizations??[]).map(({id:c})=>Number(c))})};return e.jsx(x.Fragment,{children:p[t]()},t)}const Wr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals"},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper"}},Vt=new Set(["queued","dispatching","running","awaiting_markdown"]);function Yr({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(Oa,{remarkPlugins:[qa],components:{a:({children:s,...r})=>e.jsx("a",{...r,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:s}),p:({children:s})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:s}),ul:({children:s})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:s}),ol:({children:s})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:s}),h1:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h2:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h3:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),code:({children:s})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:s}),pre:({children:s})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:s})},children:t})})}function Es({kind:t,paperId:s,paperTitle:r,triggerClassName:a,onComplete:i}){var C;const d=Wr[t],o=Z(),[l,u]=x.useState(!1),[v,p]=x.useState(null),c=x.useRef(null),g=I=>["admin","codexPaperJob",t,I],f=X({queryKey:g(v),queryFn:()=>Oe.getPaperJob(t,v),enabled:v!==null,refetchInterval:I=>{var T;const L=(T=I.state.data)==null?void 0:T.status;return L==="awaiting_markdown"?6e4:L&&Vt.has(L)?2e3:!1},retry:!1}),y=I=>{o.setQueryData(g(I.id),I),p(I.id)},k=ae({mutationFn:()=>Oe.startPaperJob(t,s),onSuccess:y}),b=ae({mutationFn:I=>Oe.cancelPaperJob(t,I),onSuccess:y}),h=v?f.data:void 0,n=(h==null?void 0:h.status)==="awaiting_markdown",m=h?Vt.has(h.status):!1,j=f.errorUpdatedAt>f.dataUpdatedAt?f.error:null,S=(C=k.error??b.error??j)==null?void 0:C.message;x.useEffect(()=>{(h==null?void 0:h.status)!=="completed"||c.current===h.id||(c.current=h.id,i())},[h,i]);const E=()=>{p(null),k.reset(),b.reset(),c.current=null};return e.jsxs(Ie,{open:l,onOpenChange:u,children:[e.jsx("button",{type:"button",className:a,onClick:()=>u(!0),children:n?"waiting for Markdown…":m?d.running:(h==null?void 0:h.status)==="completed"?d.complete:d.trigger}),e.jsxs(Re,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(Ae,{className:"min-w-0",children:[e.jsx(Le,{children:d.title}),e.jsx(Te,{children:d.description(r)})]}),h?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",h.status.replace("_"," ")]}),h.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:h.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),n&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[Ha," You can close this window and return."]}),m&&!n&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[h.status==="queued"?"This job is queued and will start after the current Codex job finishes.":d.progress," ","This can take several minutes; you can close this window and return."]}),h.report&&e.jsx(Yr,{report:h.report}),h.error&&!n&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:h.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:d.notice}),S&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:S}),e.jsxs(bt,{children:[e.jsx(A,{variant:"outline",onClick:()=>u(!1),children:m?"Close":"Cancel"}),m&&h&&e.jsx(A,{variant:"outline",onClick:()=>b.mutate(h.id),children:"Cancel job"}),!h&&e.jsx(A,{onClick:()=>k.mutate(),disabled:k.isPending,children:k.isPending?"Starting…":d.action}),h&&!m&&e.jsx(A,{variant:"outline",onClick:E,children:"Run again"})]})]})]})}function Ne({accent:t,id:s,label:r}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:s,children:[e.jsx("span",{children:e.jsx("a",{href:`#${s}`,className:"section-anchor-link",children:r})}),t]})}function Jr({canCopyBadge:t,canEdit:s,evaluationsByTask:r,evaluationsLoading:a,isAdmin:i,onCopyBadge:d,onEdit:o,onRefresh:l,paper:u,visibleEvaluationCount:v}){return e.jsxs(e.Fragment,{children:[e.jsx(Ne,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[v," benchmarks",t&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:d,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(U,{name:"copy",size:10})," Copy PwC badge"]}),i&&ea()&&e.jsx(Es,{kind:"add-evals",triggerClassName:"edit-link",paperId:Number(u.id),paperTitle:u.title,onComplete:l}),s&&e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})}),a?e.jsx(de,{className:"h-32 w-full"}):r.length>0?r.map(p=>e.jsxs("div",{className:p.taskSlug?"paper-section-anchor":void 0,id:p.taskSlug?bs(p.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:p.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(K,{to:`/tasks/${p.taskSlug}`,children:p.taskName}),e.jsx("a",{href:dr(p.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${p.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):p.taskName}),e.jsxs("span",{className:"accent",children:[p.rows.length," ",p.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:p.rows.map(c=>{var g;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:c.dataset_slug?e.jsx(K,{to:`/benchmark/${c.dataset_slug}`,children:c.dataset_name||"—"}):c.dataset_name||"—"}),e.jsxs("td",{className:"model",title:c.model_name||void 0,children:[c.hf_model_url?e.jsx("a",{href:c.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${c.model_name||"model"} on Hugging Face`,children:c.model_name||"—"}):c.model_name||"—",c.is_open===!1&&e.jsx(ya,{}),(c.external??c.is_external)&&e.jsx(_a,{sourceUrl:c.source_url||c.external_source_url||c.result_url})]}),e.jsx("td",{className:"metric",children:c.best_metric}),e.jsx("td",{className:"value",children:ta((g=c.metrics)==null?void 0:g[c.best_metric||""])}),e.jsx("td",{className:"rank",children:c.best_rank!=null?`#${c.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:c.dataset_slug&&e.jsx(K,{to:`/benchmark/${c.dataset_slug}?${[c.task_slug?`task=${encodeURIComponent(c.task_slug)}`:"",`eval=${encodeURIComponent(c.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},c.id)})})]})]},p.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]})}var kt="Radio",[Zr,Ps]=xt(kt),[en,tn]=Zr(kt),$s=x.forwardRef((t,s)=>{const{__scopeRadio:r,name:a,checked:i=!1,required:d,disabled:o,value:l="on",onCheck:u,form:v,...p}=t,[c,g]=x.useState(null),f=he(s,b=>g(b)),y=x.useRef(!1),k=c?v||!!c.closest("form"):!0;return e.jsxs(en,{scope:r,checked:i,disabled:o,children:[e.jsx(ee.button,{type:"button",role:"radio","aria-checked":i,"data-state":Ls(i),"data-disabled":o?"":void 0,disabled:o,value:l,...p,ref:f,onClick:ue(t.onClick,b=>{i||u==null||u(),k&&(y.current=b.isPropagationStopped(),y.current||b.stopPropagation())})}),k&&e.jsx(As,{control:c,bubbles:!y.current,name:a,value:l,checked:i,required:d,disabled:o,form:v,style:{transform:"translateX(-100%)"}})]})});$s.displayName=kt;var Is="RadioIndicator",Rs=x.forwardRef((t,s)=>{const{__scopeRadio:r,forceMount:a,...i}=t,d=tn(Is,r);return e.jsx(as,{present:a||d.checked,children:e.jsx(ee.span,{"data-state":Ls(d.checked),"data-disabled":d.disabled?"":void 0,...i,ref:s})})});Rs.displayName=Is;var sn="RadioBubbleInput",As=x.forwardRef(({__scopeRadio:t,control:s,checked:r,bubbles:a=!0,...i},d)=>{const o=x.useRef(null),l=he(o,d),u=fs(r),v=ns(s);return x.useEffect(()=>{const p=o.current;if(!p)return;const c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(u!==r&&f){const y=new Event("click",{bubbles:a});f.call(p,r),p.dispatchEvent(y)}},[u,r,a]),e.jsx(ee.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:l,style:{...i.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});As.displayName=sn;function Ls(t){return t?"checked":"unchecked"}var an=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Fe="RadioGroup",[rn]=xt(Fe,[is,Ps]),Ts=is(),Ds=Ps(),[nn,on]=rn(Fe),Fs=x.forwardRef((t,s)=>{const{__scopeRadioGroup:r,name:a,defaultValue:i,value:d,required:o=!1,disabled:l=!1,orientation:u,dir:v,loop:p=!0,onValueChange:c,...g}=t,f=Ts(r),y=sa(v),[k,b]=rs({prop:d,defaultProp:i??null,onChange:c,caller:Fe});return e.jsx(nn,{scope:r,name:a,required:o,disabled:l,value:k,onValueChange:b,children:e.jsx(aa,{asChild:!0,...f,orientation:u,dir:y,loop:p,children:e.jsx(ee.div,{role:"radiogroup","aria-required":o,"aria-orientation":u,"data-disabled":l?"":void 0,dir:y,...g,ref:s})})})});Fs.displayName=Fe;var Us="RadioGroupItem",Bs=x.forwardRef((t,s)=>{const{__scopeRadioGroup:r,disabled:a,...i}=t,d=on(Us,r),o=d.disabled||a,l=Ts(r),u=Ds(r),v=x.useRef(null),p=he(s,v),c=d.value===i.value,g=x.useRef(!1);return x.useEffect(()=>{const f=k=>{an.includes(k.key)&&(g.current=!0)},y=()=>g.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",y)}},[]),e.jsx(ra,{asChild:!0,...l,focusable:!o,active:c,children:e.jsx($s,{disabled:o,required:d.required,checked:c,...u,...i,name:d.name,ref:p,onCheck:()=>d.onValueChange(i.value),onKeyDown:ue(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:ue(i.onFocus,()=>{var f;g.current&&((f=v.current)==null||f.click())})})})});Bs.displayName=Us;var ln="RadioGroupIndicator",zs=x.forwardRef((t,s)=>{const{__scopeRadioGroup:r,...a}=t,i=Ds(r);return e.jsx(Rs,{...i,...a,ref:s})});zs.displayName=ln;var Ms=Fs,Hs=Bs,cn=zs;const ct=x.forwardRef(({className:t,...s},r)=>e.jsx(Ms,{className:we("grid gap-2",t),...s,ref:r}));ct.displayName=Ms.displayName;const ce=x.forwardRef(({className:t,...s},r)=>e.jsx(Hs,{ref:r,className:we("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(cn,{className:"flex items-center justify-center",children:e.jsx(na,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ce.displayName=Hs.displayName;const dn={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},dt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,un=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,mn=20,ut="copy_to_bucket";function hn(t){const s=t.trim();if(!un.test(s))return null;const[r,a]=s.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(r)}/${encodeURIComponent(a)}`}function mt(t){return`pwc:bucket-copy:${t}`}function pn(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(ut)!==t)return null;try{const r=window.sessionStorage.getItem(mt(t));if(!r)return null;const a=JSON.parse(r);return a.paperId!==t||typeof a.bucketId!="string"||!["new","existing"].includes(a.destinationMode)||!["public","private"].includes(a.visibility)||!Array.isArray(a.selectedIds)||a.selectedIds.some(i=>typeof i!="string")?null:a}catch{return null}}function fn(t,s=mn){if(s<1)throw new Error("Bucket copy batch size must be positive");const r=[];for(let a=0;a!dt.test(u)))return null;const o=d.join("/"),l=s==="model"?"":`${s}s/`;return{id:`${s}:${o}`,kind:s,label:o,url:`https://huggingface.co/${l}${o}`,source:`hf://${l}${o}/`,destination:`${s}s/${o}/`,repoId:o}}catch{return null}}function gn(t){try{const s=new URL(t);if(s.hostname!=="github.com"&&s.hostname!=="www.github.com")return null;const r=s.pathname.split("/").filter(Boolean);if(r.length<2)return null;const a=r[0],i=r[1].replace(/\.git$/,"");if(!dt.test(a)||!dt.test(i))return null;const d=`${a}/${i}`;return{id:`github:${d}`,kind:"github",label:d,url:`https://github.com/${d}`,source:`https://github.com/${d}.git`,destination:`github/${d}/`}}catch{return null}}function xn({githubUrls:t,hfModelUrls:s,hfDatasetUrls:r,hfSpaceUrls:a,paperId:i,pdfName:d,pdfUrl:o}){const l=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${d||i}.pdf`}:null,...s.map(v=>at(v,"model")),...r.map(v=>at(v,"dataset")),...a.map(v=>at(v,"space")),...t.map(gn)],u=new Set;return l.filter(v=>!v||u.has(v.id)?!1:(u.add(v.id),!0))}function bn(t,s,r){const a=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${_e(t.trim())}`];r.create&&a.push(`hf buckets create "$HF_BUCKET" --exist-ok${r.isPrivate?" --private":""}`);for(const o of s.filter(l=>l.kind!=="github"&&l.kind!=="pdf"))a.push(`hf cp ${_e(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const i=s.find(o=>o.kind==="pdf");i&&a.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${_e(i.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${i.destination}"`);const d=s.filter(o=>o.kind==="github");if(d.length){a.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of d){const l=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;a.push(`git clone --depth 1 -- ${_e(o.source)} "${l}"`,`hf sync "${l}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return a.join(` +`)}function jn(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function vn(t){const{toast:s}=J(),r=x.useMemo(()=>xn({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),a=x.useMemo(()=>pn(t.paperId),[t.paperId]),[i,d]=x.useState(!!a),[o,l]=x.useState((a==null?void 0:a.destinationMode)??"new"),[u,v]=x.useState((a==null?void 0:a.bucketId)??""),[p,c]=x.useState((a==null?void 0:a.visibility)??"public"),[g,f]=x.useState(()=>new Set((a==null?void 0:a.selectedIds)??r.map(_=>_.id))),[y,k]=x.useState(!1),[b,h]=x.useState(null),[n,m]=x.useState(!!a),j=r.filter(_=>g.has(_.id)),S=j.length===r.length,E=hn(u),C=E!==null,I=bn(u,j,{create:o==="new",isPrivate:p==="private"}),L=(_,R)=>{f($=>{const D=new Set($);return R?D.add(_):D.delete(_),D})},T=async()=>{try{await navigator.clipboard.writeText(I),s({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{s({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},H=x.useCallback(()=>{const _=new URL(window.location.href);_.searchParams.set(ut,t.paperId),window.sessionStorage.setItem(mt(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:u.trim(),destinationMode:o,visibility:p,selectedIds:Array.from(g)})),window.location.assign(ia(_.toString(),{authorizeBucket:!0,bucketCreate:o==="new"}))},[u,o,t.paperId,g,p]),P=x.useCallback(async()=>{if(!t.isSignedIn){H();return}k(!0);let _=0,R=0;try{const $=j.filter(M=>M.kind!=="pdf"&&M.kind!=="github"&&!!M.repoId).map(M=>({kind:M.kind,repo_id:M.repoId})),D=fn($);D.length||D.push([]);for(const[M,ge]of D.entries()){h({current:M+1,total:D.length});const xe=await B.copyToBucket(t.paperId,{bucket_id:u.trim(),create:M===0&&o==="new",private:p==="private",include_pdf:M===0&&j.some(Ue=>Ue.kind==="pdf"),artifacts:ge});_+=xe.copied.length,R+=xe.errors.length}const re=j.filter(M=>M.kind==="github").length;s({title:R?"Bucket copy partially completed":"Copied to bucket",description:[`${_} item${_===1?"":"s"} copied.`,R?`${R} item${R===1?"":"s"} failed.`:"",re?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:R?"destructive":void 0,action:E?e.jsx(oa,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:E,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!R&&!re&&d(!1)}catch($){if($ instanceof Ce&&$.code==="bucket_authorization_required"){H();return}s({title:_?"Bucket copy partially completed":"Bucket copy failed",description:_?`${_} item${_===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:$ instanceof Ce&&typeof $.detail=="string"?$.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{k(!1),h(null)}},[H,u,E,o,t.isSignedIn,t.paperId,j,s,p]);x.useEffect(()=>{if(!n||!t.isSignedIn)return;m(!1),window.sessionStorage.removeItem(mt(t.paperId));const _=new URL(window.location.href);_.searchParams.delete(ut),window.history.replaceState({},"",`${_.pathname}${_.search}${_.hash}`),P()},[P,t.isSignedIn,t.paperId,n]);const w=()=>{f(new Set(r.map(_=>_.id))),!u&&t.suggestedBucketId&&v(t.suggestedBucketId),d(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:w,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:r.length?`${r.length} linked artifact${r.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(Ie,{open:i,onOpenChange:d,children:e.jsxs(Re,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(Ae,{children:[e.jsxs(Le,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(Te,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),e.jsx("div",{className:"-mx-6 min-h-0 overflow-y-auto px-6",children:r.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(O,{children:"Choose your destination"}),e.jsxs(ct,{value:o,onValueChange:_=>l(_),className:"grid grid-cols-2 gap-2",children:[e.jsxs(O,{className:"bucket-choice",children:[e.jsx(ce,{value:"new"}),"New bucket"]}),e.jsxs(O,{className:"bucket-choice",children:[e.jsx(ce,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(O,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(z,{id:"bucket-id",value:u,onChange:_=>v(_.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":u.length>0&&!C}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."}),E&&e.jsxs("a",{href:E,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(U,{name:"external",size:10})]})]})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(O,{children:"Bucket visibility"}),e.jsxs(ct,{value:p,onValueChange:_=>c(_),className:"flex gap-5",children:[e.jsxs(O,{className:"flex items-center gap-2 font-normal",children:[e.jsx(ce,{value:"public"}),"Public"]}),e.jsxs(O,{className:"flex items-center gap-2 font-normal",children:[e.jsx(ce,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(O,{children:"Artifacts"}),e.jsx(A,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>f(S?new Set:new Set(r.map(_=>_.id))),children:S?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:r.map(_=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(_t,{id:`bucket-artifact-${_.id}`,checked:g.has(_.id),onCheckedChange:R=>L(_.id,R===!0)}),e.jsxs(O,{htmlFor:`bucket-artifact-${_.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:dn[_.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:_.label})]}),e.jsxs("a",{href:Y(_.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(U,{name:"external",size:10})]})]},_.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(O,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:C?I:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."})}),e.jsxs(bt,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(A,{type:"button",onClick:T,variant:"outline",disabled:!C||j.length===0,children:[e.jsx(U,{name:"copy",size:12}),"Copy commands"]}),e.jsx(A,{type:"button",onClick:P,disabled:y||t.isSignedIn&&(!C||!j.some(_=>_.kind!=="github")),children:y?b&&b.total>1?`Copying ${b.current}/${b.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}function yn({isLoading:t,papers:s}){return t?e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}):s!=null&&s.length?e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),s.map(r=>e.jsxs(K,{to:`/paper/${r.arxiv_id||r.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(ke,{title:r.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:r.arxiv_id?`arXiv:${r.arxiv_id}`:"External resource"}),r.citation_count!=null&&e.jsxs("span",{children:[r.citation_count.toLocaleString()," cites"]})]})]},r.id))]}):null}const _n=/(https?:\/\/[^\s]+)/g;function kn({size:t=12}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fill:"currentColor",d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}function Wt(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Nn(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function wn({text:t}){return e.jsx("p",{className:"x-thread-text",children:t.split(_n).map((s,r)=>r%2===1?e.jsx("span",{className:"x-thread-link",children:s.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")},r):e.jsx(x.Fragment,{children:s},r))})}function Cn({thread:t}){const[s,r]=x.useState(!1);return!t.author_avatar_url||s?e.jsx("span",{className:"x-thread-avatar x-thread-avatar--fallback","aria-hidden":"true",children:t.author_name.charAt(0).toUpperCase()}):e.jsx("img",{className:"x-thread-avatar",src:t.author_avatar_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>r(!0)})}function Sn(){var t;return((t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)").matches)??!1}function En({thread:t}){const[s,r]=x.useState(!1),[a,i]=x.useState(null),[d,o]=x.useState(!1),l=x.useRef(null),{targetRef:u,isIntersecting:v}=Ka({rootMargin:"200px"}),p=t.video_url;if(x.useEffect(()=>{if(!p||a||d||!v||Sn())return;const g=new AbortController;return fetch(p,{referrerPolicy:"no-referrer",signal:g.signal}).then(f=>{if(!f.ok)throw new Error(`HTTP ${f.status}`);return f.blob()}).then(f=>i(URL.createObjectURL(f))).catch(()=>{g.signal.aborted||o(!0)}),()=>g.abort()},[p,a,d,v]),x.useEffect(()=>()=>{a&&URL.revokeObjectURL(a)},[a]),x.useEffect(()=>{const g=l.current;g&&(v?g.play().catch(()=>{}):g.pause())},[v,a]),!t.media_url||s)return null;const c=a&&!d;return e.jsx("div",{className:"x-thread-media",ref:u,children:c?e.jsx("video",{ref:l,src:a,poster:t.media_url,muted:!0,loop:!0,playsInline:!0,autoPlay:!0,"aria-label":"Video",onError:()=>o(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:t.media_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>r(!0)}),t.media_type==="video"&&e.jsx("span",{className:"x-thread-play","aria-label":"Video",children:"▶"})]})})}function Pn({thread:t}){const s=Y(t.url);return s?e.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"x-thread",children:[e.jsxs("div",{className:"x-thread-header",children:[e.jsx(Cn,{thread:t}),e.jsxs("span",{className:"x-thread-author",children:[e.jsx("span",{className:"x-thread-name",children:t.author_name}),e.jsxs("span",{className:"x-thread-handle",children:["@",t.author_handle]})]}),e.jsx("span",{className:"x-thread-logo",children:e.jsx(kn,{})})]}),e.jsx(wn,{text:t.text}),e.jsx(En,{thread:t}),e.jsxs("div",{className:"x-thread-meta",children:[t.posted_at&&e.jsx("time",{dateTime:t.posted_at,children:Nn(t.posted_at)}),t.like_count!=null&&e.jsxs("span",{children:["♥ ",Wt(t.like_count)]}),t.reply_count!=null&&t.reply_count>0&&e.jsxs("span",{children:[Wt(t.reply_count)," ",t.reply_count===1?"reply":"replies"]}),e.jsx("span",{className:"x-thread-read",children:"Read on X →"})]})]}):null}function $n({onEdit:t,threads:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"X threads"}),e.jsxs("span",{className:"badge",children:[s.length," post",s.length===1?"":"s",e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]})]}),s.length>0?e.jsx("div",{className:"x-thread-list",children:s.map(r=>e.jsx(Pn,{thread:r},r.tweet_id))}):e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No author threads linked yet."})]})}const rt=3,Yt=3;function In(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Rn({allHfArtifactUrls:t,citationCopied:s,citationDisplay:r,hfArtifactViewer:a,onCopyCitation:i,onEditHfArtifacts:d,onEditRepositories:o,onEditXThreads:l,paper:u,relatedIsLoading:v,relatedPapers:p,user:c}){var b;const[g,f]=x.useState(!1),y=[...u.repositories??[]].sort((h,n)=>Number(n.is_official)-Number(h.is_official)||(n.num_stars||0)-(h.num_stars||0)),k=(g?y:y.slice(0,rt)).map(h=>({...h,safeHref:Y(h.url)}));return e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[y.length," repo",y.length===1?"":"s",e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})]}),k.filter(({safeHref:h})=>h).map(h=>e.jsxs("a",{href:h.safeHref??void 0,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(U,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[h.owner,"/",h.name]}),h.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",In(h.num_stars)]})]},h.id)),y.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),y.length>rt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>f(h=>!h),children:g?"− show top 3":`+ show ${y.length-rt} more repos`})]}),e.jsx(An,{viewer:a,onEdit:d}),e.jsx($n,{threads:u.x_threads??[],onEdit:l}),e.jsx(vn,{githubUrls:y.map(({url:h})=>h),hfModelUrls:t.models,hfDatasetUrls:t.datasets,hfSpaceUrls:t.spaces,paperId:u.id,pdfName:((b=u.arxiv_id)==null?void 0:b.replace("/","-"))||u.id,pdfUrl:u.url_pdf,isSignedIn:!!c,suggestedBucketId:c?`${c.username}/${jn(u.title)}`:void 0}),e.jsx(yn,{isLoading:v,papers:p}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:i,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(U,{name:"copy",size:11}),s?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:r})]})]})}function An({onEdit:t,viewer:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]}),s.isLoading?e.jsx(de,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(r=>e.jsx(Ln,{...r},r.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]})}function Ln({count:t,href:s,isLimited:r,label:a,links:i}){const[d,o]=x.useState(!1),l=((i==null?void 0:i.length)??0)>Yt,u=d?i:i==null?void 0:i.slice(0,Yt),v=t!=null?`${t}${r?"+":""}`:"—";return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:a}),t?e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:v}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:v})]}),u!=null&&u.length?e.jsxs("div",{className:"hf-artifact-links",children:[u.map(p=>e.jsx("a",{href:p.href,target:"_blank",rel:"noopener noreferrer",children:p.label},p.href)),l&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":d,onClick:()=>o(p=>!p),children:d?"Show fewer":`View all ${i.length}`})]}):null]})}function Tn({abstract:t,mentions:s}){const r=[];let a=0;for(const i of[...s].sort((d,o)=>d.start-o.start))i.startt.length||t.slice(i.start,i.end)===i.surface&&(r.push(e.jsx(ot,{text:t.slice(a,i.start)},`t${a}`)),r.push(e.jsx(Ua,{entity:{kind:i.entity_type,slug:i.slug},className:"abstract-entity-link",newTab:!1,initialPreview:i.preview?{name:i.preview.name,description:i.preview.description??null,imageUrl:i.preview.image_url??null,count:i.preview.count??null,detail:i.preview.detail??null}:void 0,children:i.surface},`m${i.start}`)),a=i.end);return r.push(e.jsx(ot,{text:t.slice(a)},`t${a}`)),e.jsx(e.Fragment,{children:r})}function Dn(t,s){const r=t.arxiv_id?` (arXiv:${Ee(t.arxiv_id)})`:"";return`About the paper "${t.title}"${r}: ${s}`}function Fn({paper:t,readerChatRoute:s}){const r=la()&&!!(t.id&&t.abstract),a=t.suggested_questions,{data:i}=X({queryKey:["paper-suggested-questions",t.id],queryFn:()=>B.suggestedQuestions(String(t.id)),enabled:r&&Array.isArray(a)&&a.length===0,staleTime:o=>{var l;return(l=o.state.data)!=null&&l.questions.length?1/0:0},retry:!1}),d=a!=null&&a.length?a:(i==null?void 0:i.questions)??[];return!r||d.length===0?null:e.jsx("ul",{className:"suggested-questions","aria-label":"Ask about this paper",children:d.map(o=>{const l=s?`${s}?q=${encodeURIComponent(o)}`:`/chat?q=${encodeURIComponent(Dn(t,o))}`;return e.jsx("li",{children:e.jsxs(K,{className:"suggested-question",to:l,onClick:s?()=>ls(s):void 0,children:[e.jsx(U,{name:"chat",size:12}),e.jsx("span",{children:o})]})},o)})})}function Un({canEdit:t,onEditMethods:s,onEditTasks:r,paper:a,readerChatRoute:i}){var l,u,v;const d=a.abstract||"",[o]=x.useState(()=>window.location.hash==="#tldr");return e.jsxs(e.Fragment,{children:[e.jsx(Ne,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",children:(l=a.abstract_mentions)!=null&&l.length?e.jsx(Tn,{abstract:d,mentions:a.abstract_mentions}):e.jsx(ot,{text:d})}),a.tldr&&e.jsxs("details",{className:"tldr-details paper-section-anchor",id:"tldr",open:o,children:[e.jsxs("summary",{children:[e.jsx("span",{className:"tldr-toggle-show",children:"Show TL;DR"}),e.jsx("span",{className:"tldr-toggle-hide",children:"Hide TL;DR"}),e.jsx("span",{className:"tldr-toggle-hint",children:"short summary"})]}),e.jsx("div",{className:"tldr-box",children:a.tldr})]}),e.jsx(Fn,{paper:a,readerChatRoute:i}),e.jsx(Ne,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((u=a.tasks)==null?void 0:u.length)||0," tagged",t&&e.jsx("button",{type:"button",onClick:r,className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(a.tasks??[]).map(p=>e.jsx(xa,{slug:p.slug||"",label:p.name},p.id))}),e.jsx(Ne,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((v=a.methods)==null?void 0:v.length)||0," used",t&&e.jsx("button",{type:"button",onClick:s,className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(a.methods??[]).map(p=>e.jsx(ba,{method:p},p.id))})]})}const se=["my-bookmark-ids"],ht="pwc:pending-bookmark";function Jt(t){window.sessionStorage.setItem(ht,JSON.stringify(t)),window.location.assign(Ga(!0))}function Bn(){var a,i;const{user:t}=Pe(),s=X({queryKey:se,queryFn:()=>it.getBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),r=Se.useMemo(()=>{var d;return new Set(((d=s.data)==null?void 0:d.paper_ids)??[])},[(a=s.data)==null?void 0:a.paper_ids]);return{ids:((i=s.data)==null?void 0:i.paper_ids)??[],idSet:r,isLoading:s.isLoading,isError:s.isError}}function zn(){const{user:t}=Pe(),s=Z(),r=ae({mutationFn:async({paperId:i,isBookmarked:d})=>{d?await it.removeBookmark(i):await it.addBookmark(i)},onMutate:async({paperId:i,isBookmarked:d})=>{await s.cancelQueries({queryKey:se});const o=s.getQueryData(se),l=typeof i=="string"?Number(i):i,u=(o==null?void 0:o.paper_ids)??[],v=d?u.filter(p=>p!==l):[l,...u.filter(p=>p!==l)];return s.setQueryData(se,{paper_ids:v}),{previous:o}},onError:(i,d,o)=>{o!=null&&o.previous&&s.setQueryData(se,o.previous),i instanceof Ce&&i.code==="saved_papers_bucket_authorization_required"&&Jt(d)},onSettled:()=>{s.invalidateQueries({queryKey:se}),s.invalidateQueries({queryKey:[...me.feeds.saved]})}});return Se.useEffect(()=>{if(!t||r.isPending)return;const i=new URL(window.location.href);if(i.searchParams.get(zt)!=="1")return;i.searchParams.delete(zt),window.history.replaceState({},"",`${i.pathname}${i.search}${i.hash}`);const d=window.sessionStorage.getItem(ht);if(d){window.sessionStorage.removeItem(ht);try{const o=JSON.parse(d);(typeof o.paperId=="number"||typeof o.paperId=="string")&&typeof o.isBookmarked=="boolean"&&r.mutate(o)}catch{}}},[r,t]),{toggle:Se.useCallback((i,d)=>{if(!t){if(os())return;Jt({paperId:i,isBookmarked:d});return}r.mutate({paperId:i,isBookmarked:d})},[r,t]),isPending:r.isPending}}const Mn=({paperId:t})=>{const{user:s}=Pe(),{idSet:r}=Bn(),{toggle:a,isPending:i}=zn();if(os())return null;const d=Number(t),o=!!s&&r.has(d),l=()=>{Number.isFinite(d)&&a(d,o)},u=s&&o?"Saved":"Save",v=s?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:l,disabled:i,"aria-pressed":o,"aria-label":v,title:v,children:[e.jsx(U,{name:"bookmark",size:12}),u]})};function nt({children:t,showEdit:s=!1,onEdit:r,editAriaLabel:a}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:r,"aria-label":a,children:"edit"})]}):t}function Zt(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function es(t,s){try{const r=new URL(t),i=r.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return i?i.replace(/[-_]+/g," "):r.hostname.replace(/^www\./,"")}catch{return s}}const Di=()=>{const{arxivId:t}=ca(),s=ts(),{toast:r}=J(),{user:a}=Pe(),i=(a==null?void 0:a.is_admin)??!1,d=!!a,o=Ya(a),{arxivId:l,evaluations:u,evaluationsByTask:v,evaluationsLoading:p,paper:c,paperError:g,paperLoading:f,presentation:y,refetchEvaluations:k,refetchPaper:b,relatedQuery:h,versions:n,visibleEvaluations:m}=mr(t,o),[j,S]=x.useState(!1),{activeEditor:E,openEditor:C,setEditorOpen:I}=hr();x.useEffect(()=>{o!=="direct"||!(c!=null&&c.id)||(E&&E!=="evaluations"&&B.primeCurationState(c.id).catch(()=>{}),E==="evaluations"&&$e.primeCurationState(c.id).catch(()=>{}))},[E,o,c==null?void 0:c.id]);const[L,T]=x.useState(null),H=x.useRef(!1);x.useEffect(()=>{if(!a||!c||H.current)return;const N=sessionStorage.getItem(Tt);if(!N)return;if(H.current=!0,!B.freshAuthMutationDraft()){sessionStorage.removeItem(Tt),Pa(N)&&C(N);return}if(!window.confirm("You signed in again. Apply the saved destructive catalog edit now? The server will recheck the current catalog version before changing anything.")){r({title:"Edit kept locally",description:"Nothing was changed. Reload this paper when you are ready to confirm the saved edit."});return}B.resumeFreshAuthMutation().then(()=>{r({title:"Edit applied",description:"The restored catalog edit was applied."}),window.location.reload()}).catch(oe=>{r({variant:"destructive",title:"Could not apply the saved edit",description:oe instanceof Error?oe.message:"Please reload and review the edit again."})})},[C,c,r,a]);const P=x.useMemo(()=>{if(!a||!(c!=null&&c.author_links))return!1;const N=a.username.toLowerCase();return c.author_links.some(F=>!!F.hf_username&&F.hf_username.toLowerCase()===N)},[a,c==null?void 0:c.author_links]),w=N=>{if(!d){T(N);return}C(N)},_=ae({mutationFn:()=>B.indexFromArxiv(l),onSuccess:()=>{r({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>b(),1200)}}),R=_.error?gt(_.error,"Failed to index paper"):null,$=_.error instanceof Ce&&[429,503].includes(_.error.status)?"Try again later after arXiv has lifted the temporary limit.":null,D=(y==null?void 0:y.citationCopy)??"",re=(y==null?void 0:y.copyableRanks)??[],[M,ge]=x.useState(!1),xe=async()=>{if(D)try{await navigator.clipboard.writeText(D),ge(!0),r({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>ge(!1),1500)}catch{r({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},Ue=async()=>{if(!c)return;const N=c.arxiv_id||c.id,F=Za(N,re);if(F)try{await navigator.clipboard.writeText(F),r({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{r({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(f)return e.jsxs("div",{className:"page",children:[e.jsx(de,{className:"h-12 w-3/4 mb-4"}),e.jsx(de,{className:"h-6 w-1/3 mb-8"}),e.jsx(de,{className:"h-64 w-full"})]});if(g||!c)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(K,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",l]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",l]})," in the database. You can index it from arXiv right now."]}),R&&e.jsx(Ia,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(Ra,{children:[e.jsx("div",{children:R}),$&&e.jsx("div",{className:"mt-2",children:$})]})}),e.jsxs("div",{className:"action-row",children:[i&&e.jsxs("button",{className:"action-btn",onClick:()=>l&&_.mutate(),disabled:_.isPending,children:[e.jsx(U,{name:"sparkle",size:12}),_.isPending?"Indexing…":"Index from arXiv"]}),e.jsx(A,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});if(!y)return null;const{allHfArtifactUrls:Os,authorEntries:Be,citationDisplay:qs,hasIntroducedItems:Ks,hasLineageItems:Gs,hfArtifactViewer:Xs,introducedBenchmarks:Qs,introducedFrameworks:Nt,introducedMethods:Vs,introducedSummary:Ws,numPages:wt,paperSourceLabel:Ct,predecessorPapers:ze,projectPages:ne,safeAbstractUrl:be,safeConferenceUrl:St,safePdfUrl:Et,successorPapers:Me}=y,je=12,ie=wa(c,l),Ys=ie&&At()&&da()&&(!Lt()||i)?ie:null,Pt=c.organizations||[],$t=N=>{const F=Xa(N)??N.name;return e.jsx(K,{to:`/orgs/${N.slug}`,className:`detail-title-org${N.logo_url?" detail-title-org--logo":""}`,title:N.name,"aria-label":N.name,children:N.logo_url?e.jsx("img",{src:N.logo_url,alt:"",onError:oe=>{var Rt;(Rt=oe.currentTarget.parentElement)==null||Rt.classList.remove("detail-title-org--logo"),oe.currentTarget.replaceWith(F)}}):F},N.id)},It=j||Be.length<=je?Be:Be.slice(0,je);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(K,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),c.arxiv_id&&be?e.jsxs("a",{className:"breadcrumb-external",href:be,target:"_blank",rel:"noopener noreferrer",title:"Open on arXiv",children:[Ct,e.jsx("span",{"aria-hidden":"true",children:"↗"})]}):e.jsx("span",{children:Ct})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsxs("h1",{className:"detail-title",children:[e.jsx(ke,{title:c.title}),Pt.slice(0,-1).map($t),e.jsxs("span",{className:"detail-title-tail",children:[Pt.slice(-1).map($t),e.jsx("button",{type:"button",className:"detail-title-edit",onClick:()=>w("organizations"),title:"Edit organizations","aria-label":"Edit organizations",children:e.jsx(U,{name:"pencil",size:11})})]})]}),e.jsxs("div",{className:"detail-meta",children:[e.jsxs("span",{children:["Submitted ",Zt(c.published)]}),wt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[wt," pages"]})]}),c.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[c.citation_count.toLocaleString()," citations"]})]}),(c.proceeding||c.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),c.conference_slug?e.jsx("a",{href:`/conferences/${c.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(c.proceeding||c.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:c.proceeding.replace(/\s+\d{1,2}$/,"")})]}),n.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:c.version,onChange:N=>{const F=N.target.value;c.arxiv_id&&s(`/paper/${Ee(c.arxiv_id)}${F?`?version=${F}`:""}`)},children:n.map(N=>e.jsxs("option",{value:N.version,children:[N.version," — ",Zt(N.published)]},N.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[It.map((N,F)=>e.jsxs(Se.Fragment,{children:[N.hf_username&&e.jsx(Qa,{className:"detail-author-avatar",url:N.hf_avatar_url}),N.id?e.jsx(K,{to:`/authors/${N.id}`,children:N.name}):N.hf_username?e.jsx("a",{href:`https://huggingface.co/${N.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${N.hf_username} on Hugging Face`,children:N.name}):e.jsx("a",{children:N.name}),Fje&&e.jsx("button",{className:"show-more-authors",onClick:()=>S(N=>!N),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:j?"show fewer":`+${c.authors.length-je} more`})]}),e.jsxs("div",{className:"action-row",children:[ie&&At()&&(!Lt()||a!=null&&a.is_admin)?e.jsxs(K,{className:"action-btn",to:ie,onClick:()=>ls(ie),children:[e.jsx(U,{name:"pdf",size:12})," Read paper",e.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:"New"})]}):Et?e.jsxs("a",{className:"action-btn",href:Et,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(U,{name:"pdf",size:12})," View PDF"]}):null,be&&c.source==="external"&&e.jsx(nt,{showEdit:!0,onEdit:()=>w("source_url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:be,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(U,{name:"external",size:12})," Source page"]})}),ne.length===1?e.jsx(nt,{showEdit:!0,onEdit:()=>w("project_pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:ne[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(U,{name:"globe",size:12})," Project page"]})}):null,ne.length>1?e.jsx(nt,{showEdit:!0,onEdit:()=>w("project_pages"),editAriaLabel:"Edit project pages",children:e.jsxs(ua,{children:[e.jsx(ma,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(U,{name:"globe",size:12})," Project page"]})}),e.jsx(ha,{align:"start",className:"project-page-menu",children:ne.map((N,F)=>e.jsx(pa,{asChild:!0,children:N.safeHref?e.jsx("a",{href:N.safeHref,target:"_blank",rel:"noopener noreferrer",children:es(N.url,`Project page ${F+1}`)}):e.jsx("span",{children:es(N.url,`Project page ${F+1}`)})},N.url))})]})}):null,ne.length===0&&d?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>w("project_pages"),title:"Add project page",children:[e.jsx(U,{name:"globe",size:12})," Add project page"]}):null,St&&e.jsxs("a",{className:"action-btn",href:St,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(U,{name:"external",size:12})," Conference"]}),e.jsx(pr,{paperId:Number(c.id)}),i&&fa()&&e.jsx(Es,{kind:"enrich-paper",triggerClassName:"action-btn",paperId:Number(c.id),paperTitle:c.title,onComplete:()=>void b()}),e.jsx(Mn,{paperId:c.id})]}),c.leaderboard_ranks&&c.leaderboard_ranks.length>0&&e.jsx(ja,{wrap:!0,paperHref:`/paper/${c.arxiv_id||c.id}`,ranks:Na(c.leaderboard_ranks)})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(va,{paperId:c.arxiv_id||c.id,title:c.title,thumbnailUrl:ga(c.thumbnail_url),priority:!0})})]}),Ks&&e.jsxs("div",{className:`introduced-banner${Nt.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Vs.map(N=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${N.slug||N.id}`),children:[N.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${N.id}`)),Qs.map(N=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${N.slug||N.id}`),children:[N.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${N.id}`)),Nt.map(N=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/frameworks#framework-${N.slug}`),children:[N.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${N.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Ws,"."]})]}),Gs&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Me.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Me.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Me.map(N=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${N.route_identifier}`),children:[e.jsx(ke,{title:N.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${N.id}`))})]}),ze.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:ze.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:ze.map(N=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${N.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(ke,{title:N.title})]},`predecessor-${N.id}`))})]})]}),e.jsx(Un,{canEdit:!0,onEditMethods:()=>w("methods"),onEditTasks:()=>w("tasks"),paper:c,readerChatRoute:Ys}),e.jsx(Jr,{canCopyBadge:re.length>0,canEdit:!0,evaluationsByTask:v,evaluationsLoading:p,isAdmin:i,onCopyBadge:Ue,onEdit:()=>w("evaluations"),onRefresh:()=>void k(),paper:c,visibleEvaluationCount:(m==null?void 0:m.length)??0})]}),e.jsx(Rn,{allHfArtifactUrls:Os,citationCopied:M,citationDisplay:qs,hfArtifactViewer:Xs,onCopyCitation:xe,onEditHfArtifacts:()=>w("hf_artifacts"),onEditRepositories:()=>w("repositories"),onEditXThreads:()=>w("x_threads"),paper:c,relatedIsLoading:h.isLoading,relatedPapers:h.data,user:a})]}),e.jsx(Vr,{activeEditor:E,arxivId:l,editSubmitMode:o,evaluations:u??[],isAdmin:i,isLinkedAuthor:P,onOpenChange:I,paper:c}),e.jsx(Ba,{open:L!==null,onOpenChange:N=>{N||T(null)},sectionLabel:L?$a[L]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})};export{Di as default}; diff --git a/assets/PaperDetailView-uLa9aL0s.js b/assets/PaperDetailView-uLa9aL0s.js deleted file mode 100644 index adf41759ffbdc2a9b8fe8059161c75fa413295a5..0000000000000000000000000000000000000000 --- a/assets/PaperDetailView-uLa9aL0s.js +++ /dev/null @@ -1,29 +0,0 @@ -import{n as Nt,o as Xs,c as ns,p as se,q as Qs,r as m,j as e,C as he,f as ce,s as fe,P as is,t as Ne,v as os,w as Le,x as Ae,y as ls,z as Ct,A as Oe,X as St,B as Vs,L as me,D as Ws,E as Ys,R as Js,I as Zs,F as cs,G as ea,h as ta,T as sa,J as xt,g as aa,a as Ge,K as Ke,M as bt,i as ds,u as ra,N as zt,O as na,m as Ht,Q as ia,S as oa,U as la,V as ca,W as da,Y as ua}from"./index-YwiKC6Po.js";import{I as V}from"./Icon-DXQ4sjQk.js";import{T as ma,M as ha,S as pa,P as fa}from"./SotaBadges-DiQuEzfo.js";import{L as qe,a as jt}from"./LatexTitle-DI6voLfI.js";import{e as Xe,C as ga,E as xa}from"./ExternalSourceEvalBadge-CimjRPVg.js";import{p as _e,a as Y}from"./paperQueryKeys-C5FMa4Oj.js";import{s as ba,a as ja}from"./transform-CNg3rvXk.js";import{r as us,p as va}from"./paperReader-BIpQD5HO.js";import{u as te}from"./useQuery-DPH6Mb2w.js";import{a as ya}from"./usePapers-C1deOZKl.js";import{f as _a,D as wa}from"./latexPlainText-DI8YEXVe.js";import{s as we}from"./safeExternalHref-CkBrsh84.js";import{S as Ie}from"./skeleton-CXR1qouH.js";import{A as ka,a as Na}from"./alert-Cx5luC5D.js";import{B as L}from"./button-B90pJJiy.js";import{D as ae,a as re,c as ne,b as ie,d as oe,e as de}from"./dialog-foxx0Wu6.js";import{A as Ca,a as Sa}from"./AgentLogos-DhD8p5ds.js";import{C as Ea}from"./copy-YHg6twss.js";import{I as W}from"./input-DEeEc0bH.js";import{S as qt}from"./searchable-select-Bqfyxu17.js";import{u as ee}from"./useMutation-f6iDkf3w.js";import{c as ke}from"./catalog-B15Yh5dN.js";import{s as pe,p as Pa}from"./submissions-BJgYjF7O.js";import{i as ms,a as hs,r as ve}from"./queryInvalidation-Dgyv9_oM.js";import{r as Mt,e as Ot}from"./evaluationQueryInvalidation-CcSZ8CmA.js";import{S as Et,L as ue,a as $a}from"./SignInToEditDialog-DpqyyHCb.js";import{L as le}from"./loader-circle-B0KtDERb.js";import{T as Te,n as et,g as Kt,C as Ra}from"./CatalogEntityPreviewLink-Cv_oezOz.js";import{D as Ia}from"./database-2w-JFZSG.js";import{P as Ue}from"./plus-Cfz0QbT1.js";import{u as ps}from"./index-BaDZKp6X.js";import{S as Fe}from"./search-wcEXdf1i.js";import{B as fs}from"./badge-CFf6CiSg.js";import{G as Gt}from"./globe-DmMnSXeF.js";import{G as Xt}from"./github-BZMCt7Ub.js";import{c as tt,A as Aa}from"./codex-C9BvAdr-.js";import{M as Fa}from"./index-CoRCN2p0.js";import{r as La}from"./index-BM_xSDJM.js";import{u as Ta}from"./useIntersectionObserver-Dt36kyjs.js";import{S as Qt,s as Ua}from"./savedPapersAuth-k5u0Ozsk.js";import{o as Da}from"./organizationNames-BVKzYEBp.js";import{A as Ba}from"./AuthorAvatar-CoTET6B3.js";import"./colors-BkWRhvFI.js";import"./curation-CkzNFTMJ.js";import"./hover-card-BY9tUGxy.js";import"./useInfiniteQuery-BEbL80ez.js";import"./popover-D7ygxg37.js";import"./textarea-BPIMGf5w.js";/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const za=Nt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ha=Nt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gs=Nt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);function qa(t){return t!=null&&t.can_directly_edit_catalog?"direct":"pending"}function Ma(t){return(t??[]).filter(s=>!!(s.dataset_slug&&s.task_slug))}function Oa(t,s,a="https://paperswithcode.co"){return s.map(r=>{const n=encodeURIComponent(r.evaluation_id),l=`${a}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge.svg?eval=${n}&live=1`,o=`${a}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge-link?eval=${n}`;return`[![${`Papers with Code: ${r.best_rank===1?"SOTA":`#${r.best_rank}`} on ${r.dataset_name}`}](${l})](${o})`}).join(` -`)}function Ka(t,s=!0){return te({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return Xe.byPaper(t)},enabled:s&&!!t,staleTime:0,refetchOnMount:"always"})}const xs=t=>t.replace(/v\d+$/,""),Ga={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},st=(t,s)=>{const a=(t[s]||[]).length;return a<100?{count:a,isLimited:!1}:{count:a,isLimited:!0}},at=(t,s)=>{const a=t[s];return Array.isArray(a)?a.map(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"){const n=r;return n.id||n.repoId||null}return null}).filter(r=>!!r).map(r=>`${Ga[s]}${r}`):[]},Xa=async t=>{try{return(await fetch(`https://huggingface.co/api/papers/${xs(t)}`)).ok}catch{return!1}},Qa=async t=>{const s=xs(t),[a,r]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${s}/repos`).then(async i=>i.ok?i.json():(console.warn(`Failed to fetch repos for arXiv:${s}, status: ${i.status}`),null)).catch(i=>(console.warn(`Failed to fetch repos for arXiv:${s}:`,i),null)),Xa(s)]);if(!a)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:r};const n=st(a,"models"),l=st(a,"datasets"),o=st(a,"spaces");return{models:n.count,datasets:l.count,spaces:o.count,modelUrls:at(a,"models"),datasetUrls:at(a,"datasets"),spaceUrls:at(a,"spaces"),isLimited:n.isLimited||l.isLimited||o.isLimited,paperExists:r}},Va=t=>te({queryKey:["huggingface-repos",t],queryFn:()=>Qa(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function Wa(t,s){try{const a=new URL(t),r=a.pathname.split("/").filter(Boolean);return(r[0]==="datasets"||r[0]==="spaces")&&r.shift(),r.slice(0,2).join("/")||a.hostname.replace(/^www\./,"")}catch{return s}}function rt(t,s,a){return[...new Set([...t,...s??[]])].map(r=>({href:r,label:Wa(r,a)}))}function nt(t,s,a){if(a==null&&t.length===0&&!(s!=null&&s.length))return;const r=new Set([...t,...s??[]]);return Math.max(r.size,a??0)}function it(t,s){if(!(t==null&&s==null))return Math.max(t??0,s??0)}function ot(t){return t[0]??"https://huggingface.co"}function lt(t,s){return s[0]??t}function Ya(t){const s=`${t.title.slice(0,60)}${t.title.length>60?"…":""}`,a=`${t.authors[0]||""}${t.authors.length>1?" et al.":""}`,r=t.authors.join(" and "),n=(t.published||"").slice(0,4)||"—",l=(o,i)=>t.arxiv_id?`@article{${t.arxiv_id.replace(".","")}, - title={{${o}}}, - author=${i}, - year={{${n}}}, - eprint={{${t.arxiv_id}}}, - archivePrefix={{arXiv}} -}`:`@misc{paper${t.id}, - title={{${o}}}, - author=${i}, - year={{${n}}}, - url={{${t.source_url||t.url_abs||""}}} -}`;return{citationDisplay:l(s,`{{${a}}}`),citationCopy:l(t.title,`{${r}}`)}}function Ja(t,s,a){var S,b,k,$;const r={models:t.hf_models??[],datasets:t.hf_datasets??[],spaces:t.hf_spaces??[]},n=t.linked_hf_artifacts,l=t.hf_artifact_summary,o={models:[...(s==null?void 0:s.modelUrls)??[],...(n==null?void 0:n.models)??[]],datasets:[...(s==null?void 0:s.datasetUrls)??[],...(n==null?void 0:n.datasets)??[]],spaces:[...(s==null?void 0:s.spaceUrls)??[],...(n==null?void 0:n.spaces)??[]]},i={models:it(s==null?void 0:s.models,l==null?void 0:l.model_count),datasets:it(s==null?void 0:s.datasets,l==null?void 0:l.dataset_count),spaces:it(s==null?void 0:s.spaces,l==null?void 0:l.space_count)},u={models:rt(r.models,o.models,"Model"),datasets:rt(r.datasets,o.datasets,"Dataset"),spaces:rt(r.spaces,o.spaces,"Space")},g={models:u.models.map(({href:E})=>E),datasets:u.datasets.map(({href:E})=>E),spaces:u.spaces.map(({href:E})=>E)},f=((S=t.arxiv_id)==null?void 0:S.replace(/v\d+$/,""))??null,c=t.arxiv_id?{isLoading:a,paperHref:`https://huggingface.co/papers/${f}`,rows:[{label:"Models",href:lt(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,r.models),count:nt(r.models,o.models,i.models),isLimited:s==null?void 0:s.isLimited,links:u.models},{label:"Datasets",href:lt(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,r.datasets),count:nt(r.datasets,o.datasets,i.datasets),isLimited:s==null?void 0:s.isLimited,links:u.datasets},{label:"Spaces",href:lt(`https://huggingface.co/papers/${f}`,r.spaces),count:nt(r.spaces,o.spaces,i.spaces),isLimited:s==null?void 0:s.isLimited,links:u.spaces}],footer:`Cite arxiv.org/abs/${f} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:ot(r.models),count:r.models.length,links:u.models},{label:"Datasets",href:ot(r.datasets),count:r.datasets.length,links:u.datasets},{label:"Spaces",href:ot(r.spaces),count:r.spaces.length,links:u.spaces}],footer:null},x=(t.methods??[]).filter(({source_paper_id:E})=>E===t.id),_=t.introduced_benchmarks??[],j=t.introduced_frameworks??[],C=[x.length&&(x.length===1?"this method":"these methods"),_.length&&(_.length===1?"this benchmark":"these benchmarks"),j.length&&(j.length===1?"this framework":"these frameworks")].filter(E=>!!E);return{...Ya(t),allHfArtifactUrls:g,authorEntries:t.authors.map((E,v)=>{var d,h,w,A,z,M;return{name:E,id:((h=(d=t.author_links)==null?void 0:d[v])==null?void 0:h.id)??null,hf_username:((A=(w=t.author_links)==null?void 0:w[v])==null?void 0:A.hf_username)??null,hf_avatar_url:((M=(z=t.author_links)==null?void 0:z[v])==null?void 0:M.hf_avatar_url)??null}}),copyableRanks:Ma(t.leaderboard_ranks),hasIntroducedItems:C.length>0,hasLineageItems:!!((b=t.predecessor_papers)!=null&&b.length||(k=t.successor_papers)!=null&&k.length),hfArtifactViewer:c,hfPaperExists:!!(s!=null&&s.paperExists),introducedBenchmarks:_,introducedFrameworks:j,introducedMethods:x,introducedSummary:C.join(" and "),numPages:t.num_pages||null,paperSourceLabel:t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",predecessorPapers:t.predecessor_papers??[],projectPages:(($=t.project_pages)==null?void 0:$.filter(({url:E})=>E).map(E=>({...E,safeHref:we(E.url)})))??[],repoSummary:ba(t.repositories),safeAbstractUrl:we(t.url_abs),safeConferenceUrl:we(t.conference_url_abs),safePdfUrl:we(t.url_pdf),successorPapers:t.successor_papers??[]}}const Za=["tldr","abstract","tasks","methods","results"];function er(t){if(!t)return{section:null,resultsTaskSlug:null};const[s,a]=t.split("?",2);if(!Za.includes(s))return{section:null,resultsTaskSlug:null};const r=s;return r!=="results"||!a?{section:r,resultsTaskSlug:null}:{section:r,resultsTaskSlug:new URLSearchParams(a).get("task")}}const bs=t=>`results-task-${t}`,tr=t=>`#results?task=${encodeURIComponent(t)}`;function sr(t,s){return t&&!!s}function ar({direct:t,paperId:s,refetchEvaluations:a,refetchPaper:r}){r(),a(),!(!t||!s)&&(Y.primeCurationState(s,!0).catch(()=>{}),Xe.primeCurationState(s,!0).catch(()=>{}))}function rr(t,s){const a=t?Xs(t):"",r=ns(),{toast:n}=se(),{preferences:l}=Qs(),o=ya(a,!!a),i=o.data,[u,g]=m.useState(!1);m.useEffect(()=>{!t||t===a||r(`/paper/${a}${window.location.search}${window.location.hash}`,{replace:!0})},[a,r,t]),m.useEffect(()=>{if(i!=null&&i.title)return document.title=i.page_title||_a(i.title),()=>{document.title=wa}},[i==null?void 0:i.page_title,i==null?void 0:i.title]),m.useEffect(()=>{if(g(!1),!(i!=null&&i.id))return;const E=window.setTimeout(()=>g(!0),0);return()=>window.clearTimeout(E)},[i==null?void 0:i.id]);const f=sr(u,i==null?void 0:i.id),c=Va(u?i==null?void 0:i.arxiv_id:void 0),x=Ka(i==null?void 0:i.id,f),_=te({queryKey:[..._e.feeds.versions,i==null?void 0:i.arxiv_id],queryFn:()=>Y.versions(i.arxiv_id.replace(/v\d+$/,"")),enabled:f&&!!(i!=null&&i.arxiv_id),staleTime:10*60*1e3}),j=te({queryKey:[..._e.feeds.related,i==null?void 0:i.id],queryFn:()=>Y.related(i.arxiv_id||i.id,4),enabled:f,staleTime:10*60*1e3});m.useEffect(()=>{const E=()=>{ar({direct:s==="direct",paperId:i==null?void 0:i.id,refetchEvaluations:x.refetch,refetchPaper:o.refetch}),n({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",E),()=>window.removeEventListener("pwc:catalog-conflict",E)},[s,x.refetch,i==null?void 0:i.id,o.refetch,n]);const C=m.useMemo(()=>{const E=x.data;return!E||!l.hide_closed_source_evals?E:E.filter(v=>v.is_open!==!1)},[x.data,l.hide_closed_source_evals]),S=m.useMemo(()=>{if(!C)return[];const E=new Map;for(const v of C){const d=E.get(v.task_id);d?d.rows.push(v):E.set(v.task_id,{taskId:v.task_id,taskName:v.task_name||"—",taskSlug:v.task_slug,rows:[v]})}return[...E.values()]},[C]),b=m.useMemo(()=>S.map(({taskSlug:E})=>E??"").join("|"),[S]),k=m.useMemo(()=>i?Ja(i,c.data,c.isLoading):null,[c.data,c.isLoading,i]),$=m.useRef(!1);return m.useEffect(()=>{$.current=!1},[a]),m.useEffect(()=>{let E=0;const v=(h=!1,w=!1)=>{const{section:A,resultsTaskSlug:z}=er(window.location.hash.slice(1));if(!A||!i||A==="tldr"&&!i.tldr||A==="results"&&(!f||x.isLoading)||!h&&$.current)return;let M=A==="results"&&z?document.getElementById(bs(z)):document.getElementById(A);if(!M&&A==="results"&&z){if(S.some(({taskSlug:K})=>K===z))return;M=document.getElementById("results")}M&&(E=window.requestAnimationFrame(()=>{$.current=!0,M.scrollIntoView({block:"start",behavior:w?"smooth":"auto"})}))};v();const d=()=>{$.current=!1,v(!0,!0)};return window.addEventListener("hashchange",d),()=>{window.removeEventListener("hashchange",d),E&&window.cancelAnimationFrame(E)}},[S,x.isLoading,i,b,f]),{arxivId:a,evaluations:x.data,evaluationsByTask:S,evaluationsLoading:x.isLoading,hfLoading:c.isLoading,hfRepos:c.data,paper:i,paperError:o.error,paperLoading:o.isLoading,presentation:k,refetchEvaluations:x.refetch,refetchPaper:o.refetch,relatedQuery:j,versions:_.data??[],visibleEvaluations:C}}const nr={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url",x_threads:"x-threads"};function ir(t){return nr[t]??null}function or(){const[t,s]=m.useState(null),a=m.useCallback(n=>{s(n)},[]),r=m.useCallback((n,l)=>{s(o=>l?n:o===n?null:o)},[]);return{activeEditor:t,openEditor:a,setEditorOpen:r}}function lr({paperId:t}){const[s,a]=m.useState(!1),[r,n]=m.useState(!1),[l,o]=m.useState(!1),i=`Help me edit https://paperswithcode.co/paper/${t} using the public pwc CLI from https://github.com/huggingface/pwc-cli. Install or update the CLI following its README, then run pwc skills add to load its instructions. Run pwc auth login --paper ${t}; I will authorize this paper in my browser. Export with pwc paper edit export ${t} --output edits.json, make explicit operations for the corrections I request, and preview before submitting. For organization changes, use an organizations operation with payload {"organization_ids": [existing organization IDs]}; this replaces the paper’s organization links and publishes directly. Use existing organizations, benchmark and metric definitions, preserve unrelated entries, and cite source URLs where available. Never print or copy credentials. Ask me what to change if I have not specified it.`;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"action-btn",title:"Edit this paper page with Claude, Codex, Cursor, or OpenCode",onClick:()=>{a(!1),n(!1),o(!0)},children:["Edit with your agent",e.jsx(Ca,{})]}),e.jsx(ae,{open:l,onOpenChange:o,children:e.jsxs(re,{className:"max-w-2xl",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit this paper with your agent"}),e.jsx(oe,{children:"Spotted a missing code link, a wrong task, or a missing benchmark result? Your favorite coding agent can fix it for you."})]}),e.jsx(Sa,{}),e.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Copy the prompt below."}),e.jsx("li",{children:"Paste it into Claude Code, Codex, Cursor, OpenCode, or another coding agent, and tell it what to change."}),e.jsxs("li",{children:["The agent installs the ",e.jsx("a",{className:"underline",href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:"pwc CLI"}),", asks you to authorize this paper with your Hugging Face account, and previews the edits before submitting them."]})]}),e.jsx("textarea",{"aria-label":"Paper edit prompt",readOnly:!0,value:i,className:"h-48 w-full resize-none rounded border bg-muted/40 p-3 font-mono text-xs",onFocus:u=>u.currentTarget.select()}),r&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not copy automatically. Select the prompt above and copy it manually."}),e.jsxs(L,{className:"justify-self-end",onClick:async()=>{try{await navigator.clipboard.writeText(i),a(!0),n(!1)}catch{n(!0)}},children:[s?e.jsx(he,{size:14}):e.jsx(Ea,{size:14}),s?"Prompt copied":"Copy prompt"]})]})})]})}function ge(t,{toast:s,queryClient:a,paperIds:r,queuedDescription:n}){if(t.status==="approved"){ms(a,r),hs(a),s({title:"Edit applied",description:"Your change is now live on this paper."});return}s({title:"Edit submitted for review",description:n})}function cr(t){return t.map(s=>{const a=s.best_metric||Object.keys(s.metrics)[0]||"";return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:a,metric_value:String(s.metrics[a]??""),original_metrics:{...s.metrics},original_metric_name:a,best_rank:s.best_rank!=null?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",hf_model_url:s.hf_model_url||"",is_open:s.is_open!==!1,operation:"unchanged"}})}function dr(t,s){const a={...t.original_metrics},r=a[t.original_metric_name];return t.original_metric_name!==s&&delete a[t.original_metric_name],a[s]=r!=null&&t.metric_value===String(r)?r:t.metric_value,a}function ur(t){const s=t==null?void 0:t.trim();return s?Number(s):void 0}function Vt(t){const s=t.trim();return s?Number(s):null}function ct(t){return t.trim()||null}function dt(t){return!!(t&&/^\d+$/.test(t.trim())&&Number.isSafeInteger(Number(t))&&Number(t)>0)}function js(t){const s=[];return t.forEach((a,r)=>{var o;if(!a.operation||a.operation==="unchanged")return;const n=(i,u)=>{s.push({rowIndex:r,field:i,message:u})};if(a.operation!=="create"&&!dt(a.id)&&n("id","This result has no valid evaluation ID. Reload the paper before editing it."),a.operation==="delete")return;dt(a.task_id)||n("task_id","Select a valid task."),dt(a.dataset_id)||n("dataset_id","Select a valid dataset.");const l=a.metric_name.trim();l?l!==a.original_metric_name&&Object.prototype.hasOwnProperty.call(a.original_metrics,l)&&n("metric_name",`Cannot rename a metric to "${l}": this evaluation already has that score.`):n("metric_name","Select a metric."),(o=a.best_rank)!=null&&o.trim()&&!Number.isSafeInteger(Number(a.best_rank))&&n("best_rank","Enter a whole-number rank."),a.num_parameters.trim()&&(!Number.isSafeInteger(Number(a.num_parameters))||Number(a.num_parameters)<0)&&n("num_parameters","Enter a non-negative whole-number parameter count."),a.metric_value.trim()||n("metric_value","Enter a metric value.")}),s}function mr(t,s){const a=js(t);return a.length?{valid:!1,errors:a}:{valid:!0,operations:hr(t,s)}}function hr(t,s){const a=[];for(const r of t){if(r.operation==="delete"){a.push({kind:"delete",evaluationId:Number(r.id)});continue}if(r.operation!=="create"&&r.operation!=="update")continue;const n=r.metric_name.trim(),l=s(r.task_id,r.dataset_id),o={task_id:Number(r.task_id),dataset_id:Number(r.dataset_id),metrics:dr(r,n),best_metric:n,is_open:r.is_open},i=r.model_name.trim(),u=ur(r.best_rank);if(r.operation==="create"){const g=Vt(r.num_parameters),f=ct(r.hf_model_url);a.push({kind:"create",data:{...o,...i?{model_name:i}:{},...l&&r.harness.trim()?{harness:r.harness.trim()}:{},...u!==void 0?{best_rank:u}:{},...g!==null?{num_parameters:g}:{},...f!==null?{hf_model_url:f}:{}}});continue}a.push({kind:"update",evaluationId:Number(r.id),data:{...o,...i?{model_name:i}:{},harness:l?ct(r.harness):null,...u!==void 0?{best_rank:u}:{},num_parameters:Vt(r.num_parameters),hf_model_url:ct(r.hf_model_url)}})}return a}function pr(t,s){return s.map(a=>a.kind==="delete"?{operation:"delete",evaluation_id:a.evaluationId}:{operation:a.kind,...a.kind==="update"?{evaluation_id:a.evaluationId}:{},payload:a.kind==="create"?{paper_id:t,...a.data}:a.data})}function fr(t){return t.map(s=>s.kind==="delete"?{op:"delete",evaluation_id:s.evaluationId}:s.kind==="update"?{op:"update",evaluation_id:s.evaluationId,data:s.data}:{op:"create",data:s.data})}function xe(t){const s=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:s?"Test-only: this change stays on staging.":"Your changes go live right away."}),e.jsx("p",{className:"mt-1 leading-snug",children:s?"This exercises staging-local pending behavior and is not queued for production review.":"Edits are applied immediately and reviewed afterwards. A few, such as links to unfamiliar sites, are held for an admin first."})]})}const ut=100;function gr(t){return(t??[]).some(s=>s.slug==="coding-agents"||s.name.trim().toLowerCase()==="coding agents")}function xr(t){const s=new Map;return t.forEach(a=>{a.task_id&&a.task_name&&s.set(a.task_id,{id:a.task_id,name:a.task_name,slug:a.task_slug,level:0})}),s}function br(t){const s=new Map;return t.forEach(a=>{a.dataset_id&&a.dataset_name&&s.set(a.dataset_id,{id:a.dataset_id,name:a.dataset_name,slug:a.dataset_slug})}),s}function Wt(t,s){return`${t}:${s}`}function jr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialEvaluations:n,paperTasks:l,onSuccess:o,submitMode:i="direct",isAdmin:u=!1,isAuthor:g=!1}){const f=m.useId(),c=gr(l),[x,_]=m.useState([]),[j,C]=m.useState(!1),S=j?js(x):[],[b,k]=m.useState(null),[$,E]=m.useState(new Map),[v,d]=m.useState(new Map),h=ce(),{toast:w}=se(),A=m.useRef(!1),z=m.useRef(!1);m.useEffect(()=>{if(!t){C(!1),A.current=!1,z.current=!1;return}A.current||z.current||n.length!==0&&(A.current=!0,_(cr(n)),E(xr(n)),d(br(n)))},[t,n]);const M=m.useMemo(()=>Array.from(new Set(x.map(y=>y.task_id).filter(y=>y&&y!==""))),[x]),K=m.useMemo(()=>{const y=new Set;return x.forEach(N=>{N.task_id&&N.dataset_id&&y.add(Wt(N.task_id,N.dataset_id))}),Array.from(y)},[x]),G=te({queryKey:["datasets-by-tasks-for-eval-edit",M,t],queryFn:async()=>{const y={};return await Promise.all(M.map(async N=>{try{const F=await ke.listDatasets({task_id:parseInt(N),page_size:ut});y[N]=F.results}catch(F){console.error(`Error fetching datasets for task ${N}:`,F),y[N]=[]}})),y},enabled:t&&M.length>0});m.useEffect(()=>{G.data&&d(y=>{const N=new Map(y);return Object.values(G.data).forEach(F=>{F.forEach(T=>{N.set(T.id,T)})}),N})},[G.data]);const p=te({queryKey:["leaderboard-metrics-for-eval-edit",K,t],queryFn:async()=>{const y={};return await Promise.all(K.map(async N=>{const[F,T]=N.split(":");try{y[N]=await ke.leaderboardMetrics(T,F)}catch(Q){console.error(`Error fetching metrics for leaderboard ${N}:`,Q),y[N]=[]}})),y},enabled:t&&K.length>0}),R=async y=>{const N=await ke.listTasks({page_size:ut,...y?{q:y}:{}});return E(F=>{const T=new Map(F);return N.results.forEach(Q=>T.set(Q.id,Q)),T}),N.results.map(F=>{var T;return{value:F.id,label:F.name,description:(T=F.description)==null?void 0:T.slice(0,100)}})},I=y=>async N=>{const F=await ke.listDatasets({task_id:parseInt(y),page_size:ut,...N?{q:N}:{}});return d(T=>{const Q=new Map(T);return F.results.forEach(X=>Q.set(X.id,X)),Q}),F.results.map(T=>({value:T.id,label:T.name,description:T.full_name}))},U=(y,N)=>{if(!y||!N)return!1;const F=v.get(N);return!!(F!=null&&F.supports_harness)},D=(y,N,F)=>{var X;if(!y||!N)return[];const Q=(((X=p.data)==null?void 0:X[Wt(y,N)])||[]).map(B=>({value:B.metric_name,label:B.metric_name,description:B.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return F&&!Q.some(B=>B.value===F)&&Q.unshift({value:F,label:`${F} (legacy)`}),Q},H=ee({mutationFn:async({paperId:y,canonical:N})=>{if(!u&&i==="direct"&&N.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");const F=Number.parseInt(y,10);if(i==="pending"){const T=await pe.submit({paper_id:F,edit_type:"evaluations",proposed_payload:{operations:fr(N)}});T.status==="approved"&&Mt(h,Ot(y,n,N,r)),ge(T,{toast:w,queryClient:h,paperIds:[y,r],queuedDescription:"Thanks! An admin will review your proposed evaluation changes shortly."})}else{const T=Ot(y,n,N,r);await Xe.batch(F,pr(F,N)),Mt(h,T)}},onSuccess:()=>{o==null||o(),s(!1)},onError:y=>{const N=fe(y,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");w({title:i==="pending"?"Could not submit edit":"Could not save evaluations",description:N,variant:"destructive"})}}),q=()=>{z.current=!0,_([...x,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",original_metrics:{},original_metric_name:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},J=y=>{if(z.current=!0,x[y].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;_(x.map((F,T)=>T===y?{...F,operation:"delete"}:F))}else _(x.filter((F,T)=>T!==y))},Z=(y,N,F)=>{z.current=!0,_(x.map((T,Q)=>{if(Q!==y||T[N]===F)return T;const X={...T,[N]:F};return(N==="task_id"||N==="dataset_id")&&(X.original_metrics={},X.original_metric_name="",X.metric_value="",X.best_rank=""),N==="task_id"&&(X.dataset_id="",X.metric_name="",X.harness=""),N==="dataset_id"&&(X.metric_name="",F&&!U(X.task_id,F)&&(X.harness="")),T.operation==="unchanged"&&(X.operation="update"),X}))},Ye=(y,N)=>{z.current=!0,_(x.map((F,T)=>{if(T!==y)return F;const Q={...F,is_open:N};return F.operation==="unchanged"&&(Q.operation="update"),Q}))},De=()=>{C(!0);const y=mr(x,U);if(y.valid){if(y.operations.length===0){w({title:"No changes to submit",description:"Your evaluation list matches the existing data."});return}H.mutate({paperId:a,canonical:y.operations})}},ye=(y,N)=>{const F=S.find(T=>T.rowIndex===y&&T.field===N);return F?e.jsx("p",{id:`${f}-${y}-${N}-error`,className:"text-xs text-destructive",children:F.message}):null};return e.jsxs(ae,{open:t,onOpenChange:s,children:[e.jsxs(re,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Evaluation Results"}),e.jsx(oe,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),i==="pending"&&e.jsx(xe,{isAuthor:g}),S.length>0&&e.jsxs("div",{role:"alert",className:"text-sm text-destructive",children:["Fix the following errors before saving. No changes have been submitted.",e.jsx("ul",{children:S.map(y=>e.jsxs("li",{children:["Row ",x.slice(0,y.rowIndex+1).filter(N=>N.operation!=="delete").length,": ",y.message]},`${y.rowIndex}-${y.field}`))})]}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[x.filter(y=>y.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:`text-left py-2 px-2 font-medium text-sm ${c?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),c&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:x.map((y,N)=>{if(y.operation==="delete")return null;const F=$.get(y.task_id),T=v.get(y.dataset_id),Q=D(y.task_id,y.dataset_id,y.metric_name),X=!!(y.task_id&&y.dataset_id)&&p.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Task","aria-describedby":`${f}-${N}-task_id-error`,children:[e.jsx(qt,{value:y.task_id,onChange:B=>Z(N,"task_id",B),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:F?{value:F.id,label:F.name}:null,queryKey:["eval-edit-task-search"],queryFn:R,enabled:t}),ye(N,"task_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Dataset","aria-describedby":`${f}-${N}-dataset_id-error`,children:[e.jsx(qt,{value:y.dataset_id,onChange:B=>Z(N,"dataset_id",B),placeholder:y.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:y.task_id?"No datasets found for this task.":"Select a task first.",disabled:!y.task_id,selectedOption:T?{value:T.id,label:T.name}:null,queryKey:["eval-edit-dataset-search",y.task_id],queryFn:I(y.task_id),enabled:t&&!!y.task_id}),ye(N,"dataset_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:y.model_name,onChange:B=>Z(N,"model_name",B.target.value)})}),c&&e.jsx("td",{className:"py-2 px-2",children:U(y.task_id,y.dataset_id)?e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:y.harness,onChange:B=>Z(N,"harness",B.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsxs("td",{className:"py-2 px-2",children:[!y.task_id||!y.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):X?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(le,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):Q.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",id:`${f}-${N}-metric_name`,"aria-invalid":S.some(B=>B.rowIndex===N&&B.field==="metric_name"),"aria-describedby":`${f}-${N}-metric_name-error`,value:y.metric_name,onChange:B=>Z(N,"metric_name",B.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),Q.map(B=>e.jsx("option",{value:B.value,children:B.label},B.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"}),ye(N,"metric_name")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"44.9",id:`${f}-${N}-metric_value`,"aria-invalid":S.some(B=>B.rowIndex===N&&B.field==="metric_value"),"aria-describedby":`${f}-${N}-metric_value-error`,value:y.metric_value,onChange:B=>Z(N,"metric_value",B.target.value)}),ye(N,"metric_value")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(W,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",id:`${f}-${N}-num_parameters`,"aria-invalid":S.some(B=>B.rowIndex===N&&B.field==="num_parameters"),"aria-describedby":`${f}-${N}-num_parameters-error`,value:y.num_parameters,onChange:B=>Z(N,"num_parameters",B.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."}),ye(N,"num_parameters")]}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:y.hf_model_url,onChange:B=>Z(N,"hf_model_url",B.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:y.is_open,onChange:B=>Ye(N,B.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>J(N),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:y.id&&!u?"Only administrators can delete published results":"Remove row",disabled:!!y.id&&!u,children:e.jsx(Te,{className:"w-4 h-4"})})})]},N)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ia,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(L,{variant:"outline",size:"sm",onClick:q,className:"flex items-center space-x-2",children:[e.jsx(Ue,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(de,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(L,{variant:"ghost",onClick:()=>k("benchmark"),children:"Suggest a new benchmark"}),e.jsx(L,{variant:"ghost",onClick:()=>k("metric"),children:"Suggest a new metric"})]}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:De,disabled:H.isPending,children:H.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:b!==null,onOpenChange:y=>{y||k(null)},paperId:a,kind:b??"benchmark"})]})}const mt=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function Yt(t){return t.map(s=>s.trim()).filter(Boolean)}function ht(t,s){const a=Yt(t).sort(),r=Yt(s).sort();return a.length!==r.length?!1:a.every((n,l)=>n===r[l])}function vr(t,s){return ht(t.hf_models,s.hf_models)&&ht(t.hf_datasets,s.hf_datasets)&&ht(t.hf_spaces,s.hf_spaces)}function yr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialArtifacts:n,onSuccess:l,submitMode:o="direct",isAuthor:i=!1}){const[u,g]=m.useState(n),[f,c]=m.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),x=ce(),{toast:_}=se(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),c({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,n]);const C=ee({mutationFn:async({paperId:v,artifacts:d})=>{if(o==="pending"){const h=await pe.submit({paper_id:parseInt(v),edit_type:"hf_artifacts",proposed_payload:d});return ge(h,{toast:_,queryClient:x,paperIds:[v,r],queuedDescription:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),null}return Y.updateHfArtifacts(v,d)},onSuccess:v=>{if(o==="pending"){l==null||l(),s(!1),c({hf_models:"",hf_datasets:"",hf_spaces:""});return}v&&ve(x,v,[a,r]),l==null||l(),s(!1),c({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:v=>{const d=fe(v,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");_({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:d,variant:"destructive"})}}),S=()=>{const v={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:d}of mt){const h=f[d].trim();if(h){if(v[d].some(w=>w.trim()===h))return alert(`This ${d.replace("hf_","")} URL is already added`),null;v[d]=[...v[d],h]}}return v},b=v=>{const d=f[v].trim();if(d){if(u[v].some(h=>h.trim()===d)){alert(`This ${v.replace("hf_","")} URL is already added`);return}g(h=>({...h,[v]:[...h[v],d]})),c(h=>({...h,[v]:""}))}},k=(v,d)=>{g(h=>({...h,[v]:h[v].filter(w=>w!==d)}))},$=()=>{const v=S();if(v===null)return;const d=Object.keys(n).some(h=>n[h].some(w=>!v[h].includes(w)));o==="direct"&&d&&!window.confirm("Remove one or more Hugging Face artifact links?")||C.mutate({paperId:a,artifacts:v})},E=m.useMemo(()=>{const v={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:d}of mt){const h=f[d].trim();if(h){if(v[d].some(w=>w.trim()===h))return!1;v[d]=[...v[d],h]}}return!vr(v,n)},[u,f,n]);return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Hugging Face Artifacts"}),e.jsx(oe,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:mt.map(({key:v,label:d,placeholder:h})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:d}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:h,value:f[v],onChange:w=>c(A=>({...A,[v]:w.target.value})),onKeyPress:w=>{w.key==="Enter"&&(w.preventDefault(),b(v))},className:"flex-1"}),e.jsxs(L,{onClick:()=>b(v),size:"sm",disabled:!f[v].trim(),children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Add"]})]}),u[v].length>0?e.jsx("div",{className:"space-y-2",children:u[v].map(w=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:w}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>k(v,w),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${d.toLowerCase()} URL`,children:e.jsx(Te,{className:"w-4 h-4"})})]},w))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",d.toLowerCase()," linked yet."]})]},v))}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:$,disabled:C.isPending||!E,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}var Qe="Checkbox",[_r]=Ct(Qe),[wr,Pt]=_r(Qe);function kr(t){const{__scopeCheckbox:s,checked:a,children:r,defaultChecked:n,disabled:l,form:o,name:i,onCheckedChange:u,required:g,value:f="on",internal_do_not_use_render:c}=t,[x,_]=os({prop:a,defaultProp:n??!1,onChange:u,caller:Qe}),[j,C]=m.useState(null),[S,b]=m.useState(null),k=m.useRef(!1),$=j?!!o||!!j.closest("form"):!0,E={checked:x,disabled:l,setChecked:_,control:j,setControl:C,name:i,form:o,value:f,hasConsumerStoppedPropagationRef:k,required:g,defaultChecked:je(n)?!1:n,isFormControl:$,bubbleInput:S,setBubbleInput:b};return e.jsx(wr,{scope:s,...E,children:Nr(c)?c(E):r})}var vs="CheckboxTrigger",ys=m.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:a,...r},n)=>{const{control:l,value:o,disabled:i,checked:u,required:g,setControl:f,setChecked:c,hasConsumerStoppedPropagationRef:x,isFormControl:_,bubbleInput:j}=Pt(vs,t),C=Le(n,f),S=m.useRef(u);return m.useEffect(()=>{const b=l==null?void 0:l.form;if(b){const k=()=>c(S.current);return b.addEventListener("reset",k),()=>b.removeEventListener("reset",k)}},[l,c]),e.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":je(u)?"mixed":u,"aria-required":g,"data-state":Cs(u),"data-disabled":i?"":void 0,disabled:i,value:o,...r,ref:C,onKeyDown:Ae(s,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:Ae(a,b=>{c(k=>je(k)?!0:!k),j&&_&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})})});ys.displayName=vs;var $t=m.forwardRef((t,s)=>{const{__scopeCheckbox:a,name:r,checked:n,defaultChecked:l,required:o,disabled:i,value:u,onCheckedChange:g,form:f,...c}=t;return e.jsx(kr,{__scopeCheckbox:a,checked:n,defaultChecked:l,disabled:i,required:o,onCheckedChange:g,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:x})=>e.jsxs(e.Fragment,{children:[e.jsx(ys,{...c,ref:s,__scopeCheckbox:a}),x&&e.jsx(Ns,{__scopeCheckbox:a})]})})});$t.displayName=Qe;var _s="CheckboxIndicator",ws=m.forwardRef((t,s)=>{const{__scopeCheckbox:a,forceMount:r,...n}=t,l=Pt(_s,a);return e.jsx(is,{present:r||je(l.checked)||l.checked===!0,children:e.jsx(Ne.span,{"data-state":Cs(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...t.style}})})});ws.displayName=_s;var ks="CheckboxBubbleInput",Ns=m.forwardRef(({__scopeCheckbox:t,...s},a)=>{const{control:r,hasConsumerStoppedPropagationRef:n,checked:l,defaultChecked:o,required:i,disabled:u,name:g,value:f,form:c,bubbleInput:x,setBubbleInput:_}=Pt(ks,t),j=Le(a,_),C=ps(l),S=ls(r);m.useEffect(()=>{const k=x;if(!k)return;const $=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor($,"checked").set,d=!n.current;if(C!==l&&v){const h=new Event("click",{bubbles:d});k.indeterminate=je(l),v.call(k,je(l)?!1:l),k.dispatchEvent(h)}},[x,C,l,n]);const b=m.useRef(je(l)?!1:l);return e.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:i,disabled:u,name:g,value:f,form:c,...s,tabIndex:-1,ref:j,style:{...s.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ns.displayName=ks;function Nr(t){return typeof t=="function"}function je(t){return t==="indeterminate"}function Cs(t){return je(t)?"indeterminate":t?"checked":"unchecked"}const Ve=m.forwardRef(({className:t,style:s,...a},r)=>e.jsx($t,{ref:r,className:Oe("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...a,children:e.jsx(ws,{className:Oe("flex items-center justify-center text-current"),children:e.jsx(he,{className:"h-4 w-4"})})}));Ve.displayName=$t.displayName;const Cr=250,Sr=100;function Er({open:t,onOpenChange:s,paperId:a,arxivId:r,initialMethodIds:n,initialMethods:l,onSuccess:o,submitMode:i="direct",isAuthor:u=!1}){const[g,f]=m.useState(n),[c,x]=m.useState(!1),[_,j]=m.useState(""),[C,S]=m.useState(""),[b,k]=m.useState(new Map),$=ce(),{toast:E}=se(),v=m.useRef(!1);m.useEffect(()=>{if(!t){v.current=!1;return}if(v.current)return;v.current=!0,f(n),j(""),S("");const p=new Map;(l||[]).forEach(R=>{const I=parseInt(R.id);Number.isNaN(I)||p.set(I,R)}),k(p)},[t,n,l]),m.useEffect(()=>{const p=window.setTimeout(()=>{S(_.trim())},Cr);return()=>window.clearTimeout(p)},[_]);const{data:d,isFetching:h}=te({queryKey:["methods-search",C],queryFn:()=>ke.listMethods({page_size:Sr,...C?{q:C}:{}}),enabled:t});m.useEffect(()=>{var p;(p=d==null?void 0:d.results)!=null&&p.length&&k(R=>{const I=new Map(R);return d.results.forEach(U=>{const D=parseInt(U.id);Number.isNaN(D)||I.set(D,U)}),I})},[d]);const w=m.useMemo(()=>{const p=(d==null?void 0:d.results)||[],R=new Set,I=[],U=(q,J)=>{!J||Number.isNaN(q)||R.has(q)||(I.push(J),R.add(q))},D=()=>g.forEach(q=>U(q,b.get(q))),H=()=>p.forEach(q=>U(parseInt(q.id),q));return C?(H(),D()):(D(),H()),I},[d,g,b,C]),A=ee({mutationFn:async({paperId:p,methodIds:R})=>{if(i==="pending"){const I=await pe.submit({paper_id:parseInt(p),edit_type:"methods",proposed_payload:{method_ids:R}});return ge(I,{toast:E,queryClient:$,paperIds:[p,r],queuedDescription:"Thanks! An admin will review your proposed method changes shortly."}),null}return Y.updateMethods(p,R)},onSuccess:p=>{if(i==="pending"){o==null||o(),s(!1);return}p&&ve($,p,[a,r]),E({title:"Methods updated",description:`Saved ${g.length} method${g.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1)},onError:p=>{const R=fe(p,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");E({title:i==="pending"?"Could not submit edit":"Could not save methods",description:R,variant:"destructive"})}}),z=()=>{i==="direct"&&n.some(p=>!g.includes(p))&&!window.confirm("Remove one or more method links from this paper?")||A.mutate({paperId:a,methodIds:g})},M=m.useMemo(()=>{if(g.length!==n.length)return!0;const p=new Set(n);return g.some(R=>!p.has(R))},[g,n]),K=(p,R)=>{f(I=>R?I.includes(p)?I:[...I,p]:I.filter(U=>U!==p))},G=()=>j("");return e.jsxs(ae,{open:t,onOpenChange:s,children:[e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Paper Methods"}),e.jsx(oe,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),i==="pending"&&e.jsx(xe,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search methods...",value:_,onChange:p=>j(p.target.value),className:"pl-9 pr-9"}),_&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(St,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:w.length>0?e.jsx("div",{className:"space-y-2",children:w.map(p=>{const R=parseInt(p.id),I=g.includes(R);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ve,{id:`method-${p.id}`,checked:I,onCheckedChange:U=>K(R,U===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${p.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[p.name,p.full_name&&p.full_name!==p.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:p.full_name}),p.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[p.description.substring(0,100),p.description.length>100?"...":""]})]})]},p.id)})}):h?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(le,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:C?`No methods found matching "${C}"`:"No methods available"})]})}),e.jsxs(de,{children:[e.jsx(L,{variant:"ghost",className:"sm:mr-auto",onClick:()=>x(!0),children:"Suggest a new method"}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:z,disabled:A.isPending||!M,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:c,onOpenChange:x,paperId:a,kind:"method"})]})}const Ss=["image/jpeg","image/png","image/webp","image/gif"],Pr=2*1024*1024;function $r(t){return Ss.includes(t.type)?t.size>Pr?Promise.reject(new Error("Logo must be 2 MB or smaller.")):new Promise((s,a)=>{const r=new FileReader;r.onload=()=>s({file_name:t.name,mime_type:t.type,data_url:String(r.result)}),r.onerror=()=>a(new Error("Could not read that logo.")),r.readAsDataURL(t)}):Promise.reject(new Error("Choose a JPEG, PNG, WebP, or GIF logo."))}function Rr({paperId:t,initialName:s,onApplied:a,onUnsentChange:r}){const[n,l]=m.useState(s),[o,i]=m.useState(""),[u,g]=m.useState(""),[f,c]=m.useState(null),[x,_]=m.useState(""),j=ee({mutationFn:()=>pe.submit(Pa(Number(t),"new_organization",{name:n.trim(),...o.trim()?{hf_slug:o.trim()}:{},...u.trim()?{website_url:u.trim()}:{},...f?{image:f}:{}})),onSuccess:S=>{S.status==="approved"&&a(n.trim())}}),C=!j.isSuccess&&!!(o.trim()||u.trim()||f);return m.useEffect(()=>r(C),[r,C]),m.useEffect(()=>()=>r(!1),[r]),j.isSuccess?e.jsxs("p",{className:"rounded border p-3 text-sm",children:['Thanks! "',n.trim(),'" was submitted for review. Once an admin approves it, the organization is created and added to this paper.']}):e.jsxs("form",{className:"space-y-2 rounded border p-3",onSubmit:S=>{S.preventDefault(),j.mutate()},children:[e.jsx("p",{className:"text-sm font-medium",children:"Suggest a new organization"}),e.jsx(W,{"aria-label":"Organization name",placeholder:"Name",value:n,maxLength:200,onChange:S=>l(S.target.value)}),e.jsx(W,{"aria-label":"Hugging Face organization",placeholder:"Hugging Face organization (e.g. https://huggingface.co/PrimeIntellect)",value:o,onChange:S=>i(S.target.value)}),e.jsx(W,{"aria-label":"Website",type:"url",placeholder:"Website (e.g. https://www.primeintellect.ai)",value:u,onChange:S=>g(S.target.value)}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:["Logo (optional)",e.jsx("input",{"aria-label":"Logo",type:"file",accept:Ss.join(","),onChange:S=>{var k;const b=(k=S.target.files)==null?void 0:k[0];c(null),_(""),b&&$r(b).then(c,$=>_($.message))}})]}),f&&e.jsx("img",{src:f.data_url,alt:"Selected logo",className:"h-12 w-12 rounded border object-contain"}),x&&e.jsx("p",{className:"text-sm text-destructive",children:x}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"With a Hugging Face organization it is added right away; otherwise an admin reviews it."}),e.jsx(L,{type:"submit",variant:"outline",disabled:!n.trim()||!o.trim()&&!u.trim()||j.isPending,children:j.isPending?"Submitting...":"Submit organization"})]}),j.error&&e.jsx("p",{className:"text-sm text-destructive",children:fe(j.error,"Could not submit this organization.")})]})}const Ir=({open:t,onOpenChange:s,paperId:a,initialOrganizationIds:r,submitMode:n,isAuthor:l})=>{var b;const[o,i]=m.useState(r),[u,g]=m.useState(""),[f,c]=m.useState(!1),x=ce(),{toast:_}=se();m.useEffect(()=>{t&&(i(r),g(""))},[r,t]);const j=te({queryKey:["organizations","curation"],queryFn:()=>ke.organizations(!1),enabled:t}),C=m.useMemo(()=>{var E,v;const k=u.trim().toLocaleLowerCase();if(!k)return((E=j.data)==null?void 0:E.results)??[];const $=d=>d===k?0:d.startsWith(k)?1:d.split(/[^\p{L}\p{N}]+/u).some(h=>h.startsWith(k))?2:3;return(((v=j.data)==null?void 0:v.results)??[]).map(d=>({organization:d,name:d.name.toLocaleLowerCase()})).filter(({name:d})=>d.includes(k)).sort((d,h)=>$(d.name)-$(h.name)).map(({organization:d})=>d)},[(b=j.data)==null?void 0:b.results,u]),S=ee({mutationFn:async()=>{if(!(r.some($=>!o.includes($))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")))if(n==="pending"){const $=await pe.submit({paper_id:Number(a),edit_type:"organizations",proposed_payload:{organization_ids:o}});return ge($,{toast:_,queryClient:x,paperIds:[a],queuedDescription:"Thanks! An admin will review your proposed organization changes shortly."}),null}else return Y.updateOrganizations(a,o)},onSuccess:k=>{k!==void 0&&(k&&ve(x,k,[a]),s(!1))}});return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit organizations"}),e.jsx(oe,{children:"Associate organizations with this paper. If one is missing, search for it and suggest it for review."})]}),n==="pending"&&e.jsx(xe,{isAuthor:l}),e.jsxs("div",{className:"relative",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(W,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:u,onChange:k=>g(k.target.value),className:"pl-9 pr-9"}),u&&e.jsx("button",{type:"button",onClick:()=>g(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear organization search",children:e.jsx(St,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[C.map(k=>{const $=Number(k.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes($),onChange:E=>i(v=>E.target.checked?[...v,$]:v.filter(d=>d!==$))}),k.name]},k.id)}),!j.isLoading&&C.length===0&&e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:u.trim()?`No organizations found matching "${u.trim()}"`:"No organizations available"})]}),!j.isLoading&&C.length===0&&u.trim()&&e.jsx(Rr,{paperId:a,initialName:u.trim(),onApplied:k=>{s(!1),_({title:"Organization added",description:`Added "${k}" to this paper.`}),ms(x,[a]),hs(x),x.invalidateQueries({queryKey:["organizations"]})},onUnsentChange:c},u.trim()),f&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Submit the organization above, or clear the search, before saving."}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:()=>S.mutate(),disabled:S.isPending||f,children:n==="pending"?"Submit test edit":"Save changes"})]})]})})};function Ar({open:t,onOpenChange:s,paperId:a,arxivId:r,initialProjectPages:n,onSuccess:l,submitMode:o="direct",isAuthor:i=!1}){const[u,g]=m.useState(n),[f,c]=m.useState(""),x=ce(),{toast:_}=se(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),c(""))},[t,n]);const C=ee({mutationFn:async({paperId:d,projectPages:h})=>{if(o==="pending"){const w=await pe.submit({paper_id:parseInt(d),edit_type:"project_pages",proposed_payload:{project_pages:h}});return ge(w,{toast:_,queryClient:x,paperIds:[d,r],queuedDescription:"Thanks! An admin will review your proposed project page changes shortly."}),null}return Y.updateProjectPages(d,h)},onSuccess:d=>{if(o==="pending"){l==null||l(),s(!1),c("");return}d&&ve(x,d,[a,r]),l==null||l(),s(!1),c("")},onError:d=>{const h=fe(d,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");_({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:h,variant:"destructive"})}}),S=()=>{const d=f.trim();return d?u.some(h=>h.url===d)?(alert("This project page URL is already added"),null):[...u,{url:d,is_official:!1}]:u},b=()=>{const d=S();d!==null&&d.length!==u.length&&(g(d),c(""))},k=d=>{g(u.filter(h=>h.url!==d))},$=d=>{g(u.map(h=>h.url===d?{...h,is_official:!h.is_official}:h))},E=()=>{const d=S();d!==null&&(o==="direct"&&n.some(h=>!d.some(w=>w.url===h.url))&&!window.confirm("Remove one or more project pages from this paper?")||C.mutate({paperId:a,projectPages:d}))},v=m.useMemo(()=>{const d=f.trim(),h=d?[...u,{url:d,is_official:!1}]:u;if(h.length!==n.length)return!0;const w=new Map(n.map(A=>[A.url.trim(),!!A.is_official]));return h.some(A=>{const z=w.get(A.url.trim());return z===void 0||z!==!!A.is_official})},[u,f,n]);return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Paper Project Pages"}),e.jsx(oe,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:"https://example.com/project",value:f,onChange:d=>c(d.target.value),onKeyPress:d=>{d.key==="Enter"&&(d.preventDefault(),b())},className:"flex-1"}),e.jsxs(L,{onClick:b,size:"sm",disabled:!f.trim(),children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((d,h)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Gt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:d.url}),d.is_official&&e.jsx(fs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(L,{variant:d.is_official?"default":"outline",size:"sm",onClick:()=>$(d.url),className:"h-8 px-2 text-xs",title:d.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(gs,{className:`w-3.5 h-3.5 mr-1 ${d.is_official?"fill-current":""}`}),d.is_official?"Official":"Mark official"]}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>k(d.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},h))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Gt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:E,disabled:C.isPending||!v,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Fr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialRepositories:n,onSuccess:l,submitMode:o="direct",isAuthor:i=!1}){const[u,g]=m.useState(n),[f,c]=m.useState(""),x=ce(),{toast:_}=se(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),c(""))},[t,n]);const C=ee({mutationFn:async({paperId:h,repositories:w})=>{if(o==="pending"){const A=await pe.submit({paper_id:parseInt(h),edit_type:"repositories",proposed_payload:{repositories:w}});return ge(A,{toast:_,queryClient:x,paperIds:[h,r],queuedDescription:"Thanks! An admin will review your proposed repository changes shortly."}),null}return Y.updateRepositories(h,w)},onSuccess:h=>{if(o==="pending"){l==null||l(),s(!1),c("");return}h&&ve(x,h,[a,r]),l==null||l(),s(!1),c("")},onError:h=>{const w=fe(h,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");_({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:w,variant:"destructive"})}}),S=h=>{const w=[];for(const A of h){const z=w.find(M=>Kt(M.url,A.url));if(z)z.is_official=z.is_official||A.is_official;else{const M=et(A.url);w.push({url:M??A.url.trim(),is_official:A.is_official})}}return w},b=()=>{const h=f.trim(),w=h?[...u,{url:h,is_official:!1}]:u;return h&&u.some(A=>Kt(A.url,h))?(alert("This repository URL is already added"),null):S(w)},k=()=>{const h=b();h!==null&&h.length!==u.length&&(g(h),c(""))},$=h=>{g(u.filter(w=>w.url!==h))},E=h=>{g(u.map(w=>w.url===h?{...w,is_official:!w.is_official}:w))},v=()=>{const h=b();h!==null&&(o==="direct"&&n.some(w=>!h.some(A=>A.url===w.url))&&!window.confirm("Remove one or more repositories from this paper?")||C.mutate({paperId:a,repositories:h}))},d=m.useMemo(()=>{const h=f.trim(),w=h?[...u,{url:h,is_official:!1}]:u;if(w.length!==n.length)return!0;const A=S(n),z=S(w);if(z.length!==A.length)return!0;const M=new Map(A.map(K=>[et(K.url)??K.url.trim(),!!K.is_official]));return z.some(K=>{const G=et(K.url)??K.url.trim(),p=M.get(G);return p===void 0||p!==!!K.is_official})},[u,f,n]);return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Paper Repositories"}),e.jsx(oe,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:"https://github.com/owner/repo",value:f,onChange:h=>c(h.target.value),onKeyPress:h=>{h.key==="Enter"&&(h.preventDefault(),k())},className:"flex-1"}),e.jsxs(L,{onClick:k,size:"sm",disabled:!f.trim(),children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((h,w)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Xt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:h.url}),h.is_official&&e.jsx(fs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(L,{variant:h.is_official?"default":"outline",size:"sm",onClick:()=>E(h.url),className:"h-8 px-2 text-xs",title:h.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(gs,{className:`w-3.5 h-3.5 mr-1 ${h.is_official?"fill-current":""}`}),h.is_official?"Official":"Mark official"]}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>$(h.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},w))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Xt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:v,disabled:C.isPending||!d,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Lr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrl:n,onSuccess:l,submitMode:o="direct",isAuthor:i=!1}){const[u,g]=m.useState(n),f=ce(),{toast:c}=se(),x=m.useRef(!1);m.useEffect(()=>{if(!t){x.current=!1;return}x.current||(x.current=!0,g(n))},[t,n]);const _=ee({mutationFn:async({paperId:k,sourceUrl:$})=>{if(o==="pending"){const E=await pe.submit({paper_id:parseInt(k),edit_type:"source_url",proposed_payload:{source_url:$}});return ge(E,{toast:c,queryClient:f,paperIds:[k,r],queuedDescription:"Thanks! An admin will review your proposed source URL change shortly."}),null}return Y.updateSourceUrl(k,$)},onSuccess:k=>{if(o==="pending"){l==null||l(),s(!1);return}k&&ve(f,k,[a,r]),l==null||l(),s(!1)},onError:k=>{const $=fe(k,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");c({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:$,variant:"destructive"})}}),j=u.trim(),C=/^https?:\/\//i.test(j),S=j!==(n||"").trim(),b=()=>{C&&_.mutate({paperId:a,sourceUrl:j})};return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{className:"max-w-2xl",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Source URL"}),e.jsxs(oe,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(W,{type:"url",placeholder:"https://example.com/paper",value:u,onChange:k=>g(k.target.value),onKeyPress:k=>{k.key==="Enter"&&C&&S&&(k.preventDefault(),b())}}),!C&&j.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:b,disabled:_.isPending||!C||!S,children:_.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const Tr=250,Ur=100;function Dr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialTaskIds:n,initialTasks:l,onSuccess:o,submitMode:i="direct",isAuthor:u=!1}){const[g,f]=m.useState(n),[c,x]=m.useState(!1),[_,j]=m.useState(""),[C,S]=m.useState(""),[b,k]=m.useState(new Map),$=ce(),{toast:E}=se(),v=m.useRef(!1);m.useEffect(()=>{if(!t){v.current=!1;return}if(v.current)return;v.current=!0,f(n),j(""),S("");const p=new Map;(l||[]).forEach(R=>{const I=parseInt(R.id);Number.isNaN(I)||p.set(I,R)}),k(p)},[t,n,l]),m.useEffect(()=>{const p=window.setTimeout(()=>{S(_.trim())},Tr);return()=>window.clearTimeout(p)},[_]);const{data:d,isFetching:h}=te({queryKey:["tasks-search",C],queryFn:()=>ke.listTasks({page_size:Ur,...C?{q:C}:{}}),enabled:t});m.useEffect(()=>{var p;(p=d==null?void 0:d.results)!=null&&p.length&&k(R=>{const I=new Map(R);return d.results.forEach(U=>{const D=parseInt(U.id);Number.isNaN(D)||I.set(D,U)}),I})},[d]);const w=m.useMemo(()=>{const p=(d==null?void 0:d.results)||[],R=new Set,I=[],U=(q,J)=>{!J||Number.isNaN(q)||R.has(q)||(I.push(J),R.add(q))},D=()=>g.forEach(q=>U(q,b.get(q))),H=()=>p.forEach(q=>U(parseInt(q.id),q));return C?(H(),D()):(D(),H()),I},[d,g,b,C]),A=ee({mutationFn:async({paperId:p,taskIds:R})=>{if(i==="pending"){const I=await pe.submit({paper_id:parseInt(p),edit_type:"tasks",proposed_payload:{task_ids:R}});return ge(I,{toast:E,queryClient:$,paperIds:[p,r],queuedDescription:"Thanks! An admin will review your proposed task changes shortly."}),null}return Y.updateTasks(p,R)},onMutate:async({taskIds:p})=>{if(i==="pending")return{snapshots:[]};const R=p.map(D=>b.get(D)).filter(D=>!!D).map(D=>({id:D.id,name:D.name,slug:D.slug})).sort((D,H)=>D.name.localeCompare(H.name)),I=Array.from(new Set([a,r].filter(D=>!!D)));await Promise.all(I.flatMap(D=>[$.cancelQueries({queryKey:_e.detail(D)}),$.cancelQueries({queryKey:_e.arxiv(D)})]));const U=[];return I.forEach(D=>{[_e.detail(D),_e.arxiv(D)].forEach(H=>{const q=$.getQueryData(H);U.push({key:H,data:q}),q&&$.setQueryData(H,{...q,tasks:R})})}),o==null||o(),s(!1),{snapshots:U}},onSuccess:(p,{taskIds:R})=>{if(i==="pending"){o==null||o(),s(!1);return}E({title:"Tasks updated",description:`Saved ${R.length} task${R.length===1?"":"s"} for this paper.`}),p&&ve($,p,[a,r])},onError:(p,R,I)=>{var D;(D=I==null?void 0:I.snapshots)==null||D.forEach(({key:H,data:q})=>{$.setQueryData(H,q)});const U=fe(p,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");E({title:i==="pending"?"Could not submit edit":"Could not save tasks",description:U,variant:"destructive"})}}),z=()=>{i==="direct"&&n.some(p=>!g.includes(p))&&!window.confirm("Remove one or more task links from this paper?")||A.mutate({paperId:a,taskIds:g})},M=m.useMemo(()=>{if(g.length!==n.length)return!0;const p=new Set(n);return g.some(R=>!p.has(R))},[g,n]),K=(p,R)=>{f(I=>R?I.includes(p)?I:[...I,p]:I.filter(U=>U!==p))},G=()=>j("");return e.jsxs(ae,{open:t,onOpenChange:s,children:[e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Paper Tasks"}),e.jsx(oe,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),i==="pending"&&e.jsx(xe,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search tasks...",value:_,onChange:p=>j(p.target.value),className:"pl-9 pr-9"}),_&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(St,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:w.length>0?e.jsx("div",{className:"space-y-2",children:w.map(p=>{const R=parseInt(p.id),I=g.includes(R);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ve,{id:`task-${p.id}`,checked:I,onCheckedChange:U=>K(R,U===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${p.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[p.name,p.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[p.description.substring(0,100),p.description.length>100?"...":""]})]})]},p.id)})}):h?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(le,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:C?`No tasks found matching "${C}"`:"No tasks available"})]})}),e.jsxs(de,{children:[e.jsx(L,{variant:"ghost",className:"sm:mr-auto",onClick:()=>x(!0),children:"Suggest a new task"}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:z,disabled:A.isPending||!M,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:c,onOpenChange:x,paperId:a,kind:"task"})]})}const Jt=10,Br=/^https?:\/\/(?:www\.|mobile\.)?(?:x|twitter)\.com\/(?:[A-Za-z0-9_]{1,15}|i\/web|i)\/status(?:es)?\/(\d{1,25})(?:[/?#].*)?$/;function Ce(t){var s;return((s=Br.exec(t.trim()))==null?void 0:s[1])??null}function zr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrls:n,submitMode:l="direct",isAuthor:o=!1}){const[i,u]=m.useState(n),[g,f]=m.useState(""),[c,x]=m.useState(null),_=ce(),{toast:j}=se(),C=m.useRef(!1);m.useEffect(()=>{if(!t){C.current=!1;return}C.current||(C.current=!0,u(n),f(""),x(null))},[t,n]);const S=ee({mutationFn:async d=>{if(l==="pending"){const h=await pe.submit({paper_id:parseInt(a),edit_type:"x_threads",proposed_payload:{x_threads:d}});return ge(h,{toast:j,queryClient:_,paperIds:[a,r],queuedDescription:"Thanks! An admin will review your proposed X threads shortly."}),null}return Y.updateXThreads(a,d)},onSuccess:d=>{l!=="pending"&&d&&ve(_,d,[a,r]),s(!1)},onError:d=>{j({title:l==="pending"?"Could not submit edit":"Could not save X threads",description:fe(d,l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update X threads."),variant:"destructive"})}}),b=()=>{const d=g.trim();if(!d)return i;const h=Ce(d);return h?i.some(w=>Ce(w)===h)?(x("This post is already listed."),null):i.length>=Jt?(x(`A paper can link at most ${Jt} X threads.`),null):[...i,d]:(x("Paste a post URL such as https://x.com/user/status/123…"),null)},k=()=>{const d=b();d!==null&&(u(d),f(""),x(null))},$=(d,h)=>{const w=[...i];[w[d],w[d+h]]=[w[d+h],w[d]],u(w)},E=()=>{const d=b();d!==null&&(l==="direct"&&n.some(h=>!d.some(w=>Ce(w)===Ce(h)))&&!window.confirm("Remove one or more X threads from this paper?")||S.mutate(d))},v=m.useMemo(()=>(g.trim()?[...i,g.trim()]:i).map(Ce).join()!==n.map(Ce).join(),[i,g,n]);return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit X threads"}),e.jsx(oe,{children:"Link posts on X (formerly Twitter) in which the authors introduce this paper. A preview of each post is shown on the paper page."})]}),l==="pending"&&e.jsx(xe,{isAuthor:o}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",htmlFor:"x-thread-url",children:"Add X post URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{id:"x-thread-url",type:"url",placeholder:"https://x.com/user/status/1234567890",value:g,onChange:d=>{f(d.target.value),x(null)},onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),k())},"aria-invalid":!!c,className:"flex-1"}),e.jsxs(L,{onClick:k,size:"sm",disabled:!g.trim(),children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Add"]})]}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:i.length>0?e.jsx("div",{className:"space-y-2",children:i.map((d,h)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm font-medium",children:d}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:h===0,onClick:()=>$(h,-1),"aria-label":"Move up",children:e.jsx(Ha,{className:"w-4 h-4"})}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:h===i.length-1,onClick:()=>$(h,1),"aria-label":"Move down",children:e.jsx(za,{className:"w-4 h-4"})}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive",onClick:()=>u(i.filter(w=>w!==d)),"aria-label":"Remove X thread",children:e.jsx(Te,{className:"w-4 h-4"})})]},d))}):e.jsx("p",{className:"text-center py-8 text-sm text-muted-foreground",children:"No X threads linked yet"})}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:E,disabled:S.isPending||!v,children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Hr({activeEditor:t,arxivId:s,editSubmitMode:a,evaluations:r,isAdmin:n,isLinkedAuthor:l,onOpenChange:o,paper:i}){if(!t)return null;const u={open:!0,paperId:i.id,arxivId:s,submitMode:a,isAuthor:l},g=c=>x=>o(c,x);return{tasks:()=>{var c;return e.jsx(Dr,{...u,onOpenChange:g("tasks"),initialTaskIds:((c=i.tasks)==null?void 0:c.map(x=>Number(x.id)))??[],initialTasks:i.tasks??[]})},methods:()=>{var c;return e.jsx(Er,{...u,onOpenChange:g("methods"),initialMethodIds:((c=i.methods)==null?void 0:c.map(x=>Number(x.id)))??[],initialMethods:i.methods??[]})},repositories:()=>{var c;return e.jsx(Fr,{...u,onOpenChange:g("repositories"),initialRepositories:((c=i.repositories)==null?void 0:c.map(({url:x,is_official:_})=>({url:x,is_official:!!_})))??[]})},"project-pages":()=>{var c;return e.jsx(Ar,{...u,onOpenChange:g("project-pages"),initialProjectPages:((c=i.project_pages)==null?void 0:c.map(({url:x,is_official:_})=>({url:x,is_official:!!_})))??[]})},results:()=>e.jsx(jr,{...u,onOpenChange:g("results"),initialEvaluations:r,paperTasks:i.tasks??[],isAdmin:n}),"source-url":()=>e.jsx(Lr,{...u,onOpenChange:g("source-url"),initialUrl:i.source_url??i.url_abs??""}),"hf-artifacts":()=>e.jsx(yr,{...u,onOpenChange:g("hf-artifacts"),initialArtifacts:{hf_models:i.hf_models??[],hf_datasets:i.hf_datasets??[],hf_spaces:i.hf_spaces??[]}}),"x-threads":()=>{var c;return e.jsx(zr,{...u,onOpenChange:g("x-threads"),initialUrls:((c=i.x_threads)==null?void 0:c.map(({url:x})=>x))??[]})},organizations:()=>e.jsx(Ir,{open:!0,paperId:i.id,onOpenChange:g("organizations"),initialOrganizationIds:(i.organizations??[]).map(({id:c})=>Number(c)),submitMode:a,isAuthor:l})}[t]()}const qr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals"},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper"}},Zt=new Set(["queued","dispatching","running","awaiting_markdown"]);function Mr({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(Fa,{remarkPlugins:[La],components:{a:({children:s,...a})=>e.jsx("a",{...a,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:s}),p:({children:s})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:s}),ul:({children:s})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:s}),ol:({children:s})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:s}),h1:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h2:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h3:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),code:({children:s})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:s}),pre:({children:s})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:s})},children:t})})}function Es({kind:t,paperId:s,paperTitle:a,triggerClassName:r,onComplete:n}){var h;const l=qr[t],o=ce(),[i,u]=m.useState(!1),[g,f]=m.useState(null),c=m.useRef(null),x=w=>["admin","codexPaperJob",t,w],_=te({queryKey:x(g),queryFn:()=>tt.getPaperJob(t,g),enabled:g!==null,refetchInterval:w=>{var z;const A=(z=w.state.data)==null?void 0:z.status;return A==="awaiting_markdown"?6e4:A&&Zt.has(A)?2e3:!1},retry:!1}),j=w=>{o.setQueryData(x(w.id),w),f(w.id)},C=ee({mutationFn:()=>tt.startPaperJob(t,s),onSuccess:j}),S=ee({mutationFn:w=>tt.cancelPaperJob(t,w),onSuccess:j}),b=g?_.data:void 0,k=(b==null?void 0:b.status)==="awaiting_markdown",$=b?Zt.has(b.status):!1,E=_.errorUpdatedAt>_.dataUpdatedAt?_.error:null,v=(h=C.error??S.error??E)==null?void 0:h.message;m.useEffect(()=>{(b==null?void 0:b.status)!=="completed"||c.current===b.id||(c.current=b.id,n())},[b,n]);const d=()=>{f(null),C.reset(),S.reset(),c.current=null};return e.jsxs(ae,{open:i,onOpenChange:u,children:[e.jsx("button",{type:"button",className:r,onClick:()=>u(!0),children:k?"waiting for Markdown…":$?l.running:(b==null?void 0:b.status)==="completed"?l.complete:l.trigger}),e.jsxs(re,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(ne,{className:"min-w-0",children:[e.jsx(ie,{children:l.title}),e.jsx(oe,{children:l.description(a)})]}),b?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",b.status.replace("_"," ")]}),b.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:b.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),k&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[Aa," You can close this window and return."]}),$&&!k&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[b.status==="queued"?"This job is queued and will start after the current Codex job finishes.":l.progress," ","This can take several minutes; you can close this window and return."]}),b.report&&e.jsx(Mr,{report:b.report}),b.error&&!k&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:b.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:l.notice}),v&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:v}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>u(!1),children:$?"Close":"Cancel"}),$&&b&&e.jsx(L,{variant:"outline",onClick:()=>S.mutate(b.id),children:"Cancel job"}),!b&&e.jsx(L,{onClick:()=>C.mutate(),disabled:C.isPending,children:C.isPending?"Starting…":l.action}),b&&!$&&e.jsx(L,{variant:"outline",onClick:d,children:"Run again"})]})]})]})}function Me({accent:t,id:s,label:a}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:s,children:[e.jsx("span",{children:e.jsx("a",{href:`#${s}`,className:"section-anchor-link",children:a})}),t]})}function Or({canCopyBadge:t,canEdit:s,evaluationsByTask:a,evaluationsLoading:r,isAdmin:n,onCopyBadge:l,onEdit:o,onRefresh:i,paper:u,visibleEvaluationCount:g}){return e.jsxs(e.Fragment,{children:[e.jsx(Me,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[g," benchmarks",t&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:l,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(V,{name:"copy",size:10})," Copy PwC badge"]}),n&&Vs()&&e.jsx(Es,{kind:"add-evals",triggerClassName:"edit-link",paperId:Number(u.id),paperTitle:u.title,onComplete:i}),s&&e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})}),r?e.jsx(Ie,{className:"h-32 w-full"}):a.length>0?a.map(f=>e.jsxs("div",{className:f.taskSlug?"paper-section-anchor":void 0,id:f.taskSlug?bs(f.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:f.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(me,{to:`/tasks/${f.taskSlug}`,children:f.taskName}),e.jsx("a",{href:tr(f.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${f.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):f.taskName}),e.jsxs("span",{className:"accent",children:[f.rows.length," ",f.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:f.rows.map(c=>{var x;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:c.dataset_slug?e.jsx(me,{to:`/benchmark/${c.dataset_slug}`,children:c.dataset_name||"—"}):c.dataset_name||"—"}),e.jsxs("td",{className:"model",title:c.model_name||void 0,children:[c.hf_model_url?e.jsx("a",{href:c.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${c.model_name||"model"} on Hugging Face`,children:c.model_name||"—"}):c.model_name||"—",c.is_open===!1&&e.jsx(ga,{}),(c.external??c.is_external)&&e.jsx(xa,{sourceUrl:c.source_url||c.external_source_url||c.result_url})]}),e.jsx("td",{className:"metric",children:c.best_metric}),e.jsx("td",{className:"value",children:Ws((x=c.metrics)==null?void 0:x[c.best_metric||""])}),e.jsx("td",{className:"rank",children:c.best_rank!=null?`#${c.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:c.dataset_slug&&e.jsx(me,{to:`/benchmark/${c.dataset_slug}?${[c.task_slug?`task=${encodeURIComponent(c.task_slug)}`:"",`eval=${encodeURIComponent(c.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},c.id)})})]})]},f.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]})}var Rt="Radio",[Kr,Ps]=Ct(Rt),[Gr,Xr]=Kr(Rt),$s=m.forwardRef((t,s)=>{const{__scopeRadio:a,name:r,checked:n=!1,required:l,disabled:o,value:i="on",onCheck:u,form:g,...f}=t,[c,x]=m.useState(null),_=Le(s,S=>x(S)),j=m.useRef(!1),C=c?g||!!c.closest("form"):!0;return e.jsxs(Gr,{scope:a,checked:n,disabled:o,children:[e.jsx(Ne.button,{type:"button",role:"radio","aria-checked":n,"data-state":Fs(n),"data-disabled":o?"":void 0,disabled:o,value:i,...f,ref:_,onClick:Ae(t.onClick,S=>{n||u==null||u(),C&&(j.current=S.isPropagationStopped(),j.current||S.stopPropagation())})}),C&&e.jsx(As,{control:c,bubbles:!j.current,name:r,value:i,checked:n,required:l,disabled:o,form:g,style:{transform:"translateX(-100%)"}})]})});$s.displayName=Rt;var Rs="RadioIndicator",Is=m.forwardRef((t,s)=>{const{__scopeRadio:a,forceMount:r,...n}=t,l=Xr(Rs,a);return e.jsx(is,{present:r||l.checked,children:e.jsx(Ne.span,{"data-state":Fs(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:s})})});Is.displayName=Rs;var Qr="RadioBubbleInput",As=m.forwardRef(({__scopeRadio:t,control:s,checked:a,bubbles:r=!0,...n},l)=>{const o=m.useRef(null),i=Le(o,l),u=ps(a),g=ls(s);return m.useEffect(()=>{const f=o.current;if(!f)return;const c=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(c,"checked").set;if(u!==a&&_){const j=new Event("click",{bubbles:r});_.call(f,a),f.dispatchEvent(j)}},[u,a,r]),e.jsx(Ne.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...n,tabIndex:-1,ref:i,style:{...n.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});As.displayName=Qr;function Fs(t){return t?"checked":"unchecked"}var Vr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],We="RadioGroup",[Wr]=Ct(We,[cs,Ps]),Ls=cs(),Ts=Ps(),[Yr,Jr]=Wr(We),Us=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,name:r,defaultValue:n,value:l,required:o=!1,disabled:i=!1,orientation:u,dir:g,loop:f=!0,onValueChange:c,...x}=t,_=Ls(a),j=Ys(g),[C,S]=os({prop:l,defaultProp:n??null,onChange:c,caller:We});return e.jsx(Yr,{scope:a,name:r,required:o,disabled:i,value:C,onValueChange:S,children:e.jsx(Js,{asChild:!0,..._,orientation:u,dir:j,loop:f,children:e.jsx(Ne.div,{role:"radiogroup","aria-required":o,"aria-orientation":u,"data-disabled":i?"":void 0,dir:j,...x,ref:s})})})});Us.displayName=We;var Ds="RadioGroupItem",Bs=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,disabled:r,...n}=t,l=Jr(Ds,a),o=l.disabled||r,i=Ls(a),u=Ts(a),g=m.useRef(null),f=Le(s,g),c=l.value===n.value,x=m.useRef(!1);return m.useEffect(()=>{const _=C=>{Vr.includes(C.key)&&(x.current=!0)},j=()=>x.current=!1;return document.addEventListener("keydown",_),document.addEventListener("keyup",j),()=>{document.removeEventListener("keydown",_),document.removeEventListener("keyup",j)}},[]),e.jsx(Zs,{asChild:!0,...i,focusable:!o,active:c,children:e.jsx($s,{disabled:o,required:l.required,checked:c,...u,...n,name:l.name,ref:f,onCheck:()=>l.onValueChange(n.value),onKeyDown:Ae(_=>{_.key==="Enter"&&_.preventDefault()}),onFocus:Ae(n.onFocus,()=>{var _;x.current&&((_=g.current)==null||_.click())})})})});Bs.displayName=Ds;var Zr="RadioGroupIndicator",zs=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,...r}=t,n=Ts(a);return e.jsx(Is,{...n,...r,ref:s})});zs.displayName=Zr;var Hs=Us,qs=Bs,en=zs;const vt=m.forwardRef(({className:t,...s},a)=>e.jsx(Hs,{className:Oe("grid gap-2",t),...s,ref:a}));vt.displayName=Hs.displayName;const Re=m.forwardRef(({className:t,...s},a)=>e.jsx(qs,{ref:a,className:Oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(en,{className:"flex items-center justify-center",children:e.jsx(ea,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Re.displayName=qs.displayName;const tn={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},yt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,sn=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,an=20,_t="copy_to_bucket";function rn(t){const s=t.trim();if(!sn.test(s))return null;const[a,r]=s.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(a)}/${encodeURIComponent(r)}`}function wt(t){return`pwc:bucket-copy:${t}`}function nn(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(_t)!==t)return null;try{const a=window.sessionStorage.getItem(wt(t));if(!a)return null;const r=JSON.parse(a);return r.paperId!==t||typeof r.bucketId!="string"||!["new","existing"].includes(r.destinationMode)||!["public","private"].includes(r.visibility)||!Array.isArray(r.selectedIds)||r.selectedIds.some(n=>typeof n!="string")?null:r}catch{return null}}function on(t,s=an){if(s<1)throw new Error("Bucket copy batch size must be positive");const a=[];for(let r=0;r!yt.test(u)))return null;const o=l.join("/"),i=s==="model"?"":`${s}s/`;return{id:`${s}:${o}`,kind:s,label:o,url:`https://huggingface.co/${i}${o}`,source:`hf://${i}${o}/`,destination:`${s}s/${o}/`,repoId:o}}catch{return null}}function ln(t){try{const s=new URL(t);if(s.hostname!=="github.com"&&s.hostname!=="www.github.com")return null;const a=s.pathname.split("/").filter(Boolean);if(a.length<2)return null;const r=a[0],n=a[1].replace(/\.git$/,"");if(!yt.test(r)||!yt.test(n))return null;const l=`${r}/${n}`;return{id:`github:${l}`,kind:"github",label:l,url:`https://github.com/${l}`,source:`https://github.com/${l}.git`,destination:`github/${l}/`}}catch{return null}}function cn({githubUrls:t,hfModelUrls:s,hfDatasetUrls:a,hfSpaceUrls:r,paperId:n,pdfName:l,pdfUrl:o}){const i=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${l||n}.pdf`}:null,...s.map(g=>pt(g,"model")),...a.map(g=>pt(g,"dataset")),...r.map(g=>pt(g,"space")),...t.map(ln)],u=new Set;return i.filter(g=>!g||u.has(g.id)?!1:(u.add(g.id),!0))}function dn(t,s,a){const r=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${He(t.trim())}`];a.create&&r.push(`hf buckets create "$HF_BUCKET" --exist-ok${a.isPrivate?" --private":""}`);for(const o of s.filter(i=>i.kind!=="github"&&i.kind!=="pdf"))r.push(`hf cp ${He(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const n=s.find(o=>o.kind==="pdf");n&&r.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${He(n.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${n.destination}"`);const l=s.filter(o=>o.kind==="github");if(l.length){r.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of l){const i=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;r.push(`git clone --depth 1 -- ${He(o.source)} "${i}"`,`hf sync "${i}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return r.join(` -`)}function un(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function mn(t){const{toast:s}=se(),a=m.useMemo(()=>cn({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),r=m.useMemo(()=>nn(t.paperId),[t.paperId]),[n,l]=m.useState(!!r),[o,i]=m.useState((r==null?void 0:r.destinationMode)??"new"),[u,g]=m.useState((r==null?void 0:r.bucketId)??""),[f,c]=m.useState((r==null?void 0:r.visibility)??"public"),[x,_]=m.useState(()=>new Set((r==null?void 0:r.selectedIds)??a.map(p=>p.id))),[j,C]=m.useState(!1),[S,b]=m.useState(null),[k,$]=m.useState(!!r),E=a.filter(p=>x.has(p.id)),v=E.length===a.length,d=rn(u),h=d!==null,w=dn(u,E,{create:o==="new",isPrivate:f==="private"}),A=(p,R)=>{_(I=>{const U=new Set(I);return R?U.add(p):U.delete(p),U})},z=async()=>{try{await navigator.clipboard.writeText(w),s({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{s({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},M=m.useCallback(()=>{const p=new URL(window.location.href);p.searchParams.set(_t,t.paperId),window.sessionStorage.setItem(wt(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:u.trim(),destinationMode:o,visibility:f,selectedIds:Array.from(x)})),window.location.assign(ta(p.toString(),{authorizeBucket:!0,bucketCreate:o==="new"}))},[u,o,t.paperId,x,f]),K=m.useCallback(async()=>{if(!t.isSignedIn){M();return}C(!0);let p=0,R=0;try{const I=E.filter(H=>H.kind!=="pdf"&&H.kind!=="github"&&!!H.repoId).map(H=>({kind:H.kind,repo_id:H.repoId})),U=on(I);U.length||U.push([]);for(const[H,q]of U.entries()){b({current:H+1,total:U.length});const J=await Y.copyToBucket(t.paperId,{bucket_id:u.trim(),create:H===0&&o==="new",private:f==="private",include_pdf:H===0&&E.some(Z=>Z.kind==="pdf"),artifacts:q});p+=J.copied.length,R+=J.errors.length}const D=E.filter(H=>H.kind==="github").length;s({title:R?"Bucket copy partially completed":"Copied to bucket",description:[`${p} item${p===1?"":"s"} copied.`,R?`${R} item${R===1?"":"s"} failed.`:"",D?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:R?"destructive":void 0,action:d?e.jsx(sa,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!R&&!D&&l(!1)}catch(I){if(I instanceof xt&&I.code==="bucket_authorization_required"){M();return}s({title:p?"Bucket copy partially completed":"Bucket copy failed",description:p?`${p} item${p===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:I instanceof xt&&typeof I.detail=="string"?I.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{C(!1),b(null)}},[M,u,d,o,t.isSignedIn,t.paperId,E,s,f]);m.useEffect(()=>{if(!k||!t.isSignedIn)return;$(!1),window.sessionStorage.removeItem(wt(t.paperId));const p=new URL(window.location.href);p.searchParams.delete(_t),window.history.replaceState({},"",`${p.pathname}${p.search}${p.hash}`),K()},[K,t.isSignedIn,t.paperId,k]);const G=()=>{_(new Set(a.map(p=>p.id))),!u&&t.suggestedBucketId&&g(t.suggestedBucketId),l(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:G,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:a.length?`${a.length} linked artifact${a.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(ae,{open:n,onOpenChange:l,children:e.jsxs(re,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(ne,{children:[e.jsxs(ie,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(oe,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),e.jsx("div",{className:"-mx-6 min-h-0 overflow-y-auto px-6",children:a.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ue,{children:"Choose your destination"}),e.jsxs(vt,{value:o,onValueChange:p=>i(p),className:"grid grid-cols-2 gap-2",children:[e.jsxs(ue,{className:"bucket-choice",children:[e.jsx(Re,{value:"new"}),"New bucket"]}),e.jsxs(ue,{className:"bucket-choice",children:[e.jsx(Re,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ue,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(W,{id:"bucket-id",value:u,onChange:p=>g(p.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":u.length>0&&!h}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."}),d&&e.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(V,{name:"external",size:10})]})]})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ue,{children:"Bucket visibility"}),e.jsxs(vt,{value:f,onValueChange:p=>c(p),className:"flex gap-5",children:[e.jsxs(ue,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Re,{value:"public"}),"Public"]}),e.jsxs(ue,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Re,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(ue,{children:"Artifacts"}),e.jsx(L,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>_(v?new Set:new Set(a.map(p=>p.id))),children:v?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:a.map(p=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(Ve,{id:`bucket-artifact-${p.id}`,checked:x.has(p.id),onCheckedChange:R=>A(p.id,R===!0)}),e.jsxs(ue,{htmlFor:`bucket-artifact-${p.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:tn[p.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:p.label})]}),e.jsxs("a",{href:we(p.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(V,{name:"external",size:10})]})]},p.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ue,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:h?w:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."})}),e.jsxs(de,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(L,{type:"button",onClick:z,variant:"outline",disabled:!h||E.length===0,children:[e.jsx(V,{name:"copy",size:12}),"Copy commands"]}),e.jsx(L,{type:"button",onClick:K,disabled:j||t.isSignedIn&&(!h||!E.some(p=>p.kind!=="github")),children:j?S&&S.total>1?`Copying ${S.current}/${S.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}function hn({isLoading:t,papers:s}){return t?e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}):s!=null&&s.length?e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),s.map(a=>e.jsxs(me,{to:`/paper/${a.arxiv_id||a.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(qe,{title:a.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:a.arxiv_id?`arXiv:${a.arxiv_id}`:"External resource"}),a.citation_count!=null&&e.jsxs("span",{children:[a.citation_count.toLocaleString()," cites"]})]})]},a.id))]}):null}const pn=/(https?:\/\/[^\s]+)/g;function fn({size:t=12}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fill:"currentColor",d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}function es(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function gn(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function xn({text:t}){return e.jsx("p",{className:"x-thread-text",children:t.split(pn).map((s,a)=>a%2===1?e.jsx("span",{className:"x-thread-link",children:s.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")},a):e.jsx(m.Fragment,{children:s},a))})}function bn({thread:t}){const[s,a]=m.useState(!1);return!t.author_avatar_url||s?e.jsx("span",{className:"x-thread-avatar x-thread-avatar--fallback","aria-hidden":"true",children:t.author_name.charAt(0).toUpperCase()}):e.jsx("img",{className:"x-thread-avatar",src:t.author_avatar_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(!0)})}function jn(){var t;return((t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)").matches)??!1}function vn({thread:t}){const[s,a]=m.useState(!1),[r,n]=m.useState(null),[l,o]=m.useState(!1),i=m.useRef(null),{targetRef:u,isIntersecting:g}=Ta({rootMargin:"200px"}),f=t.video_url;if(m.useEffect(()=>{if(!f||r||l||!g||jn())return;const x=new AbortController;return fetch(f,{referrerPolicy:"no-referrer",signal:x.signal}).then(_=>{if(!_.ok)throw new Error(`HTTP ${_.status}`);return _.blob()}).then(_=>n(URL.createObjectURL(_))).catch(()=>{x.signal.aborted||o(!0)}),()=>x.abort()},[f,r,l,g]),m.useEffect(()=>()=>{r&&URL.revokeObjectURL(r)},[r]),m.useEffect(()=>{const x=i.current;x&&(g?x.play().catch(()=>{}):x.pause())},[g,r]),!t.media_url||s)return null;const c=r&&!l;return e.jsx("div",{className:"x-thread-media",ref:u,children:c?e.jsx("video",{ref:i,src:r,poster:t.media_url,muted:!0,loop:!0,playsInline:!0,autoPlay:!0,"aria-label":"Video",onError:()=>o(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:t.media_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(!0)}),t.media_type==="video"&&e.jsx("span",{className:"x-thread-play","aria-label":"Video",children:"▶"})]})})}function yn({thread:t}){const s=we(t.url);return s?e.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"x-thread",children:[e.jsxs("div",{className:"x-thread-header",children:[e.jsx(bn,{thread:t}),e.jsxs("span",{className:"x-thread-author",children:[e.jsx("span",{className:"x-thread-name",children:t.author_name}),e.jsxs("span",{className:"x-thread-handle",children:["@",t.author_handle]})]}),e.jsx("span",{className:"x-thread-logo",children:e.jsx(fn,{})})]}),e.jsx(xn,{text:t.text}),e.jsx(vn,{thread:t}),e.jsxs("div",{className:"x-thread-meta",children:[t.posted_at&&e.jsx("time",{dateTime:t.posted_at,children:gn(t.posted_at)}),t.like_count!=null&&e.jsxs("span",{children:["♥ ",es(t.like_count)]}),t.reply_count!=null&&t.reply_count>0&&e.jsxs("span",{children:[es(t.reply_count)," ",t.reply_count===1?"reply":"replies"]}),e.jsx("span",{className:"x-thread-read",children:"Read on X →"})]})]}):null}function _n({onEdit:t,threads:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"X threads"}),e.jsxs("span",{className:"badge",children:[s.length," post",s.length===1?"":"s",e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]})]}),s.length>0?e.jsx("div",{className:"x-thread-list",children:s.map(a=>e.jsx(yn,{thread:a},a.tweet_id))}):e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No author threads linked yet."})]})}const ft=3,ts=3;function wn(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function kn({allHfArtifactUrls:t,citationCopied:s,citationDisplay:a,hfArtifactViewer:r,onCopyCitation:n,onEditHfArtifacts:l,onEditRepositories:o,onEditXThreads:i,paper:u,relatedIsLoading:g,relatedPapers:f,user:c}){var S;const[x,_]=m.useState(!1),j=[...u.repositories??[]].sort((b,k)=>Number(k.is_official)-Number(b.is_official)||(k.num_stars||0)-(b.num_stars||0)),C=(x?j:j.slice(0,ft)).map(b=>({...b,safeHref:we(b.url)}));return e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[j.length," repo",j.length===1?"":"s",e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})]}),C.filter(({safeHref:b})=>b).map(b=>e.jsxs("a",{href:b.safeHref??void 0,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(V,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[b.owner,"/",b.name]}),b.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",wn(b.num_stars)]})]},b.id)),j.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),j.length>ft&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>_(b=>!b),children:x?"− show top 3":`+ show ${j.length-ft} more repos`})]}),e.jsx(Nn,{viewer:r,onEdit:l}),e.jsx(_n,{threads:u.x_threads??[],onEdit:i}),e.jsx(mn,{githubUrls:j.map(({url:b})=>b),hfModelUrls:t.models,hfDatasetUrls:t.datasets,hfSpaceUrls:t.spaces,paperId:u.id,pdfName:((S=u.arxiv_id)==null?void 0:S.replace("/","-"))||u.id,pdfUrl:u.url_pdf,isSignedIn:!!c,suggestedBucketId:c?`${c.username}/${un(u.title)}`:void 0}),e.jsx(hn,{isLoading:g,papers:f}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:n,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(V,{name:"copy",size:11}),s?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:a})]})]})}function Nn({onEdit:t,viewer:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]}),s.isLoading?e.jsx(Ie,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(Cn,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]})}function Cn({count:t,href:s,isLimited:a,label:r,links:n}){const[l,o]=m.useState(!1),i=((n==null?void 0:n.length)??0)>ts,u=l?n:n==null?void 0:n.slice(0,ts),g=t!=null?`${t}${a?"+":""}`:"—";return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:r}),t?e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:g}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:g})]}),u!=null&&u.length?e.jsxs("div",{className:"hf-artifact-links",children:[u.map(f=>e.jsx("a",{href:f.href,target:"_blank",rel:"noopener noreferrer",children:f.label},f.href)),i&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":l,onClick:()=>o(f=>!f),children:l?"Show fewer":`View all ${n.length}`})]}):null]})}function Sn({abstract:t,mentions:s}){const a=[];let r=0;for(const n of[...s].sort((l,o)=>l.start-o.start))n.startt.length||t.slice(n.start,n.end)===n.surface&&(a.push(e.jsx(jt,{text:t.slice(r,n.start)},`t${r}`)),a.push(e.jsx(Ra,{entity:{kind:n.entity_type,slug:n.slug},className:"abstract-entity-link",newTab:!1,initialPreview:n.preview?{name:n.preview.name,description:n.preview.description??null,imageUrl:n.preview.image_url??null,count:n.preview.count??null,detail:n.preview.detail??null}:void 0,children:n.surface},`m${n.start}`)),r=n.end);return a.push(e.jsx(jt,{text:t.slice(r)},`t${r}`)),e.jsx(e.Fragment,{children:a})}function En(t,s){const a=t.arxiv_id?` (arXiv:${t.arxiv_id.replace(/v\d+$/i,"")})`:"";return`About the paper "${t.title}"${a}: ${s}`}function Pn({paper:t,readerChatRoute:s}){const a=aa()&&!!(t.id&&t.abstract),r=t.suggested_questions,{data:n}=te({queryKey:["paper-suggested-questions",t.id],queryFn:()=>Y.suggestedQuestions(String(t.id)),enabled:a&&Array.isArray(r)&&r.length===0,staleTime:o=>{var i;return(i=o.state.data)!=null&&i.questions.length?1/0:0},retry:!1}),l=r!=null&&r.length?r:(n==null?void 0:n.questions)??[];return!a||l.length===0?null:e.jsx("ul",{className:"suggested-questions","aria-label":"Ask about this paper",children:l.map(o=>{const i=s?`${s}?q=${encodeURIComponent(o)}`:`/chat?q=${encodeURIComponent(En(t,o))}`;return e.jsx("li",{children:e.jsxs(me,{className:"suggested-question",to:i,onClick:s?()=>us(s):void 0,children:[e.jsx(V,{name:"chat",size:12}),e.jsx("span",{children:o})]})},o)})})}function $n({canEdit:t,onEditMethods:s,onEditTasks:a,paper:r,readerChatRoute:n}){var i,u,g;const l=r.abstract||"",[o]=m.useState(()=>window.location.hash==="#tldr");return e.jsxs(e.Fragment,{children:[e.jsx(Me,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",children:(i=r.abstract_mentions)!=null&&i.length?e.jsx(Sn,{abstract:l,mentions:r.abstract_mentions}):e.jsx(jt,{text:l})}),r.tldr&&e.jsxs("details",{className:"tldr-details paper-section-anchor",id:"tldr",open:o,children:[e.jsxs("summary",{children:[e.jsx("span",{className:"tldr-toggle-show",children:"Show TL;DR"}),e.jsx("span",{className:"tldr-toggle-hide",children:"Hide TL;DR"}),e.jsx("span",{className:"tldr-toggle-hint",children:"short summary"})]}),e.jsx("div",{className:"tldr-box",children:r.tldr})]}),e.jsx(Pn,{paper:r,readerChatRoute:n}),e.jsx(Me,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((u=r.tasks)==null?void 0:u.length)||0," tagged",t&&e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(r.tasks??[]).map(f=>e.jsx(ma,{slug:f.slug||"",label:f.name},f.id))}),e.jsx(Me,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((g=r.methods)==null?void 0:g.length)||0," used",t&&e.jsx("button",{type:"button",onClick:s,className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(r.methods??[]).map(f=>e.jsx(ha,{method:f},f.id))})]})}const Se=["my-bookmark-ids"],kt="pwc:pending-bookmark";function ss(t){window.sessionStorage.setItem(kt,JSON.stringify(t)),window.location.assign(Ua(!0))}function Rn(){var r,n;const{user:t}=Ge(),s=te({queryKey:Se,queryFn:()=>bt.getBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),a=Ke.useMemo(()=>{var l;return new Set(((l=s.data)==null?void 0:l.paper_ids)??[])},[(r=s.data)==null?void 0:r.paper_ids]);return{ids:((n=s.data)==null?void 0:n.paper_ids)??[],idSet:a,isLoading:s.isLoading,isError:s.isError}}function In(){const{user:t}=Ge(),s=ce(),a=ee({mutationFn:async({paperId:n,isBookmarked:l})=>{l?await bt.removeBookmark(n):await bt.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:l})=>{await s.cancelQueries({queryKey:Se});const o=s.getQueryData(Se),i=typeof n=="string"?Number(n):n,u=(o==null?void 0:o.paper_ids)??[],g=l?u.filter(f=>f!==i):[i,...u.filter(f=>f!==i)];return s.setQueryData(Se,{paper_ids:g}),{previous:o}},onError:(n,l,o)=>{o!=null&&o.previous&&s.setQueryData(Se,o.previous),n instanceof xt&&n.code==="saved_papers_bucket_authorization_required"&&ss(l)},onSettled:()=>{s.invalidateQueries({queryKey:Se}),s.invalidateQueries({queryKey:[..._e.feeds.saved]})}});return Ke.useEffect(()=>{if(!t||a.isPending)return;const n=new URL(window.location.href);if(n.searchParams.get(Qt)!=="1")return;n.searchParams.delete(Qt),window.history.replaceState({},"",`${n.pathname}${n.search}${n.hash}`);const l=window.sessionStorage.getItem(kt);if(l){window.sessionStorage.removeItem(kt);try{const o=JSON.parse(l);(typeof o.paperId=="number"||typeof o.paperId=="string")&&typeof o.isBookmarked=="boolean"&&a.mutate(o)}catch{}}},[a,t]),{toggle:Ke.useCallback((n,l)=>{if(!t){if(ds())return;ss({paperId:n,isBookmarked:l});return}a.mutate({paperId:n,isBookmarked:l})},[a,t]),isPending:a.isPending}}const An=({paperId:t})=>{const{user:s}=Ge(),{idSet:a}=Rn(),{toggle:r,isPending:n}=In();if(ds())return null;const l=Number(t),o=!!s&&a.has(l),i=()=>{Number.isFinite(l)&&r(l,o)},u=s&&o?"Saved":"Save",g=s?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:i,disabled:n,"aria-pressed":o,"aria-label":g,title:g,children:[e.jsx(V,{name:"bookmark",size:12}),u]})};function gt({children:t,showEdit:s=!1,onEdit:a,editAriaLabel:r}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:a,"aria-label":r,children:"edit"})]}):t}const Fn={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL","x-threads":"X threads"};function as(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function rs(t,s){try{const a=new URL(t),n=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):a.hostname.replace(/^www\./,"")}catch{return s}}const Pi=()=>{const{arxivId:t}=ra(),s=ns(),{toast:a}=se(),{user:r}=Ge(),n=(r==null?void 0:r.is_admin)??!1,l=!!r,o=qa(r),{arxivId:i,evaluations:u,evaluationsByTask:g,evaluationsLoading:f,paper:c,paperError:x,paperLoading:_,presentation:j,refetchEvaluations:C,refetchPaper:S,relatedQuery:b,versions:k,visibleEvaluations:$}=rr(t,o),[E,v]=m.useState(!1),{activeEditor:d,openEditor:h,setEditorOpen:w}=or();m.useEffect(()=>{o!=="direct"||!(c!=null&&c.id)||(d&&d!=="results"&&Y.primeCurationState(c.id).catch(()=>{}),d==="results"&&Xe.primeCurationState(c.id).catch(()=>{}))},[d,o,c==null?void 0:c.id]);const[A,z]=m.useState(null),M=m.useRef(!1);m.useEffect(()=>{if(!r||!c||M.current)return;const P=sessionStorage.getItem("pwc:fresh-auth-edit");if(!P)return;M.current=!0;const O=ir(P);if(!Y.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),O&&h(O);return}if(!window.confirm("You signed in again. Apply the saved destructive catalog edit now? The server will recheck the current catalog version before changing anything.")){a({title:"Edit kept locally",description:"Nothing was changed. Reload this paper when you are ready to confirm the saved edit."});return}Y.resumeFreshAuthMutation().then(()=>{a({title:"Edit applied",description:"The restored catalog edit was applied."}),window.location.reload()}).catch($e=>{a({variant:"destructive",title:"Could not apply the saved edit",description:$e instanceof Error?$e.message:"Please reload and review the edit again."})})},[h,c,a,r]);const K=m.useMemo(()=>{if(!r||!(c!=null&&c.author_links))return!1;const P=r.username.toLowerCase();return c.author_links.some(O=>!!O.hf_username&&O.hf_username.toLowerCase()===P)},[r,c==null?void 0:c.author_links]),G=P=>{if(!l){z(P);return}h(P)},[p,R]=m.useState("idle"),[I,U]=m.useState(null),[D,H]=m.useState(null),q=async()=>{if(i){R("indexing"),U(null),H(null);try{await Y.indexFromArxiv(i),a({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>S(),1200),R("idle")}catch(P){const O=P;let be=O.message||"Failed to index paper";if(O.response)try{be=JSON.parse(O.response).detail||be}catch{be=O.response}U(be),(O.status===429||O.status===503)&&H("Try again later after arXiv has lifted the temporary limit."),R("idle")}}},J=(j==null?void 0:j.citationCopy)??"",Z=(j==null?void 0:j.copyableRanks)??[],[Ye,De]=m.useState(!1),ye=async()=>{if(J)try{await navigator.clipboard.writeText(J),De(!0),a({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>De(!1),1500)}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},y=async()=>{if(!c)return;const P=c.arxiv_id||c.id,O=Oa(P,Z);if(O)try{await navigator.clipboard.writeText(O),a({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(_)return e.jsxs("div",{className:"page",children:[e.jsx(Ie,{className:"h-12 w-3/4 mb-4"}),e.jsx(Ie,{className:"h-6 w-1/3 mb-8"}),e.jsx(Ie,{className:"h-64 w-full"})]});if(x||!c)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(me,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",i]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",i]})," in the database. You can index it from arXiv right now."]}),I&&e.jsx(ka,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(Na,{children:[e.jsx("div",{children:I}),D&&e.jsx("div",{className:"mt-2",children:D})]})}),e.jsxs("div",{className:"action-row",children:[n&&e.jsxs("button",{className:"action-btn",onClick:q,disabled:p==="indexing",children:[e.jsx(V,{name:"sparkle",size:12}),p==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(L,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});if(!j)return null;const{allHfArtifactUrls:N,authorEntries:F,citationDisplay:T,hasIntroducedItems:Q,hasLineageItems:X,hfArtifactViewer:B,introducedBenchmarks:Ms,introducedFrameworks:It,introducedMethods:Os,introducedSummary:Ks,numPages:At,paperSourceLabel:Ft,predecessorPapers:Je,projectPages:Ee,safeAbstractUrl:Be,safeConferenceUrl:Lt,safePdfUrl:Tt,successorPapers:Ze}=j,ze=12,Pe=va(c,i),Gs=Pe&&zt()&&na()&&(!Ht()||n)?Pe:null,Ut=c.organizations||[],Dt=P=>{const O=Da(P)??P.name;return e.jsx(me,{to:`/orgs/${P.slug}`,className:`detail-title-org${P.logo_url?" detail-title-org--logo":""}`,title:P.name,"aria-label":P.name,children:P.logo_url?e.jsx("img",{src:P.logo_url,alt:"",onError:be=>{var $e;($e=be.currentTarget.parentElement)==null||$e.classList.remove("detail-title-org--logo"),be.currentTarget.replaceWith(O)}}):O},P.id)},Bt=E||F.length<=ze?F:F.slice(0,ze);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(me,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),c.arxiv_id&&Be?e.jsxs("a",{className:"breadcrumb-external",href:Be,target:"_blank",rel:"noopener noreferrer",title:"Open on arXiv",children:[Ft,e.jsx("span",{"aria-hidden":"true",children:"↗"})]}):e.jsx("span",{children:Ft})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsxs("h1",{className:"detail-title",children:[e.jsx(qe,{title:c.title}),Ut.slice(0,-1).map(Dt),e.jsxs("span",{className:"detail-title-tail",children:[Ut.slice(-1).map(Dt),e.jsx("button",{type:"button",className:"detail-title-edit",onClick:()=>G("organizations"),title:"Edit organizations","aria-label":"Edit organizations",children:e.jsx(V,{name:"pencil",size:11})})]})]}),e.jsxs("div",{className:"detail-meta",children:[e.jsxs("span",{children:["Submitted ",as(c.published)]}),At&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[At," pages"]})]}),c.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[c.citation_count.toLocaleString()," citations"]})]}),(c.proceeding||c.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),c.conference_slug?e.jsx("a",{href:`/conferences/${c.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(c.proceeding||c.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:c.proceeding.replace(/\s+\d{1,2}$/,"")})]}),k.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:c.version,onChange:P=>{const O=P.target.value;c.arxiv_id&&s(`/paper/${c.arxiv_id.replace(/v\d+$/,"")}${O?`?version=${O}`:""}`)},children:k.map(P=>e.jsxs("option",{value:P.version,children:[P.version," — ",as(P.published)]},P.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Bt.map((P,O)=>e.jsxs(Ke.Fragment,{children:[P.hf_username&&e.jsx(Ba,{className:"detail-author-avatar",url:P.hf_avatar_url}),P.id?e.jsx(me,{to:`/authors/${P.id}`,children:P.name}):P.hf_username?e.jsx("a",{href:`https://huggingface.co/${P.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${P.hf_username} on Hugging Face`,children:P.name}):e.jsx("a",{children:P.name}),Oze&&e.jsx("button",{className:"show-more-authors",onClick:()=>v(P=>!P),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:E?"show fewer":`+${c.authors.length-ze} more`})]}),e.jsxs("div",{className:"action-row",children:[Pe&&zt()&&(!Ht()||r!=null&&r.is_admin)?e.jsxs(me,{className:"action-btn",to:Pe,onClick:()=>us(Pe),children:[e.jsx(V,{name:"pdf",size:12})," Read paper",e.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:"New"})]}):Tt?e.jsxs("a",{className:"action-btn",href:Tt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"pdf",size:12})," View PDF"]}):null,Be&&c.source==="external"&&e.jsx(gt,{showEdit:!0,onEdit:()=>G("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Be,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Source page"]})}),Ee.length===1?e.jsx(gt,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Ee[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}):null,Ee.length>1?e.jsx(gt,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(ia,{children:[e.jsx(oa,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}),e.jsx(la,{align:"start",className:"project-page-menu",children:Ee.map((P,O)=>e.jsx(ca,{asChild:!0,children:P.safeHref?e.jsx("a",{href:P.safeHref,target:"_blank",rel:"noopener noreferrer",children:rs(P.url,`Project page ${O+1}`)}):e.jsx("span",{children:rs(P.url,`Project page ${O+1}`)})},P.url))})]})}):null,Ee.length===0&&l?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>G("project-pages"),title:"Add project page",children:[e.jsx(V,{name:"globe",size:12})," Add project page"]}):null,Lt&&e.jsxs("a",{className:"action-btn",href:Lt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Conference"]}),e.jsx(lr,{paperId:Number(c.id)}),n&&da()&&e.jsx(Es,{kind:"enrich-paper",triggerClassName:"action-btn",paperId:Number(c.id),paperTitle:c.title,onComplete:()=>void S()}),e.jsx(An,{paperId:c.id})]}),c.leaderboard_ranks&&c.leaderboard_ranks.length>0&&e.jsx(pa,{wrap:!0,paperHref:`/paper/${c.arxiv_id||c.id}`,ranks:ja(c.leaderboard_ranks)})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(fa,{paperId:c.arxiv_id||c.id,title:c.title,thumbnailUrl:ua(c.thumbnail_url),priority:!0})})]}),Q&&e.jsxs("div",{className:`introduced-banner${It.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Os.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${P.slug||P.id}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${P.id}`)),Ms.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${P.slug||P.id}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${P.id}`)),It.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/frameworks#framework-${P.slug}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${P.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Ks,"."]})]}),X&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Ze.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ze.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Ze.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${P.route_identifier}`),children:[e.jsx(qe,{title:P.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${P.id}`))})]}),Je.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Je.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Je.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${P.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(qe,{title:P.title})]},`predecessor-${P.id}`))})]})]}),e.jsx($n,{canEdit:!0,onEditMethods:()=>G("methods"),onEditTasks:()=>G("tasks"),paper:c,readerChatRoute:Gs}),e.jsx(Or,{canCopyBadge:Z.length>0,canEdit:!0,evaluationsByTask:g,evaluationsLoading:f,isAdmin:n,onCopyBadge:y,onEdit:()=>G("results"),onRefresh:()=>void C(),paper:c,visibleEvaluationCount:($==null?void 0:$.length)??0})]}),e.jsx(kn,{allHfArtifactUrls:N,citationCopied:Ye,citationDisplay:T,hfArtifactViewer:B,onCopyCitation:ye,onEditHfArtifacts:()=>G("hf-artifacts"),onEditRepositories:()=>G("repositories"),onEditXThreads:()=>G("x-threads"),paper:c,relatedIsLoading:b.isLoading,relatedPapers:b.data,user:r})]}),e.jsx(Hr,{activeEditor:d,arxivId:i,editSubmitMode:o,evaluations:u??[],isAdmin:n,isLinkedAuthor:K,onOpenChange:w,paper:c}),e.jsx($a,{open:A!==null,onOpenChange:P=>{P||z(null)},sectionLabel:A?Fn[A]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})};export{Pi as default}; diff --git a/assets/PaperFeed-kaLm5US2.js b/assets/PaperFeed-DMvUfA47.js similarity index 93% rename from assets/PaperFeed-kaLm5US2.js rename to assets/PaperFeed-DMvUfA47.js index 87624ed56de276f1cb211d31329aa7a47b93288c..1b4f4923b1867d0e4c2026ff54ce9fe18974465b 100644 --- a/assets/PaperFeed-kaLm5US2.js +++ b/assets/PaperFeed-DMvUfA47.js @@ -1 +1 @@ -import{r as u,j as t,e as q,K as J}from"./index-YwiKC6Po.js";import{P as X}from"./PaperCard-FG-bEpJk.js";import{P as ee,a as te,b as ae}from"./popover-D7ygxg37.js";import{I as se}from"./Icon-DXQ4sjQk.js";import{S as j}from"./skeleton-CXR1qouH.js";import{u as ne}from"./useIntersectionObserver-Dt36kyjs.js";const Y=(e,a)=>{const s=new Date(a),n=new Date(s);return n.setUTCDate(s.getUTCDate()-(e==="week"?6:29)),{startDate:n.toISOString().slice(0,10),endDate:s.toISOString().slice(0,10)}},V=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),Ne=(e,a=new Date,s="week")=>{const n=V(e);if(n.startDate||n.endDate||e.get("time")==="all_time")return n;const o=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));return Y(s,o)},Z=(e,a)=>{const s=new URLSearchParams(e);return a.startDate?s.set("start_date",a.startDate):s.delete("start_date"),a.endDate?s.set("end_date",a.endDate):s.delete("end_date"),s.delete("time"),s},Se=(e,a)=>{const s=Z(e,a);return!a.startDate&&!a.endDate&&s.set("time","all_time"),s},re=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),H=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),O="(max-width: 640px)",oe=()=>{const[e,a]=u.useState(()=>typeof window<"u"&&window.matchMedia(O).matches);return u.useEffect(()=>{const s=window.matchMedia(O),n=o=>a(o.matches);return a(s.matches),s.addEventListener("change",n),()=>s.removeEventListener("change",n)},[]),e},W=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ie=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},F=(e,a)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+a,1)),v=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),ce=(e,a)=>new Date(Date.UTC(a,e.getUTCMonth(),1)),w=(e,a)=>e.startDate===a.startDate&&e.endDate===a.endDate,le=(e,a)=>{const s=b(e),n=b(a),o=H.format(s),i=H.format(n),d=s.getUTCDate(),l=n.getUTCDate(),r=s.getUTCFullYear(),p=n.getUTCFullYear();return e===a?`${o} ${d}, ${r}`:r===p&&s.getUTCMonth()===n.getUTCMonth()?`${o} ${d}–${l}, ${r}`:r===p?`${o} ${d}–${i} ${l}, ${r}`:`${o} ${d}, ${r}–${i} ${l}, ${p}`},de=e=>{const a=e.getUTCFullYear(),s=e.getUTCMonth(),n=new Date(Date.UTC(a,s,1)),o=(n.getUTCDay()+6)%7,i=new Date(n);return i.setUTCDate(n.getUTCDate()-o),Array.from({length:42},(d,l)=>{const r=new Date(i);return r.setUTCDate(i.getUTCDate()+l),{iso:W(r),day:r.getUTCDate(),outsideMonth:r.getUTCMonth()!==s}})},L=({month:e,today:a,startDate:s,endDate:n,onSelect:o,yearLabel:i,yearValue:d,onYearChange:l,secondary:r=!1})=>{const p=u.useMemo(()=>de(e),[e]);return t.jsxs("section",{className:`paper-date-calendar${r?" paper-date-calendar-secondary":""}`,children:[t.jsxs("label",{className:"paper-date-year",children:[t.jsx("span",{children:i}),t.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:a.slice(0,4),step:"1",value:d,onChange:c=>l(c.target.value)})]}),t.jsx("h3",{children:re.format(e)}),t.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(c=>t.jsx("span",{children:c},c))}),t.jsx("div",{className:"paper-date-days",children:p.map(c=>{const g=c.iso===s||c.iso===n,m=!!(s&&n&&c.iso>s&&c.isoa;return t.jsx("button",{type:"button","aria-label":c.iso,"aria-selected":g,disabled:f,className:["paper-date-day",c.outsideMonth?"outside":"",g?"selected":"",m?"in-range":"",c.iso===a?"today":""].filter(Boolean).join(" "),onClick:()=>o(c.iso),children:c.day},c.iso)})})]})},I=({calendar:e,onPrevious:a,onNext:s,secondary:n=!1})=>t.jsxs("div",{className:`paper-date-navigation-group${n?" paper-date-navigation-group-secondary":""}`,children:[t.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:a,children:"←"}),t.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:s,children:"→"})]}),he=({startDate:e,endDate:a,onChange:s,currentDate:n})=>{const o=oe(),i=n?b(n):ie(),[d,l]=u.useState(!1),[r,p]=u.useState(),[c,g]=u.useState(),[m,f]=u.useState(()=>v(i)),[_,T]=u.useState(()=>F(v(i),1)),[z,D]=u.useState(()=>String(i.getUTCFullYear())),[G,y]=u.useState(()=>String(i.getUTCFullYear())),N={startDate:e,endDate:a},M=Y("week",i),P=Y("month",i),k=W(i),R=!!(e&&a&&!w(N,M)&&!w(N,P)),K=()=>{p(e),g(a);const h=v(e?b(e):i),x=v(a?b(a):F(h,1));f(h),T(x),D(String(h.getUTCFullYear())),y(String(x.getUTCFullYear())),l(!0)},E=(h,x,$)=>{if(x(h),!/^\d{4}$/.test(h))return;const C=Number(h);C>=1900&&C<=i.getUTCFullYear()&&$(U=>ce(U,C))},S=(h,x,$,C)=>{const U=F(h,x);$(U),C(String(U.getUTCFullYear()))},A=h=>{!r||c?(p(h),g(void 0)):h{s({}),l(!1)};return t.jsxs("div",{className:`paper-date-filter${o?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(N,M)?" active":""}`,onClick:()=>s(M),children:"Last Week"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(N,P)?" active":""}`,onClick:()=>s(P),children:"Last Month"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!a?" active":""}`,onClick:()=>s({}),children:"All Time"}),t.jsxs(ee,{open:d,onOpenChange:h=>{h?K():l(!1)},children:[t.jsx(te,{asChild:!0,children:t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${R?" active":""}`,"aria-label":R?"Change date range":"Select a range",children:R&&e&&a?le(e,a):"Select a range"})}),t.jsxs(ae,{align:"end",className:`paper-date-popover${o?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[t.jsxs("div",{className:"paper-date-popover-header",children:[t.jsx("h2",{children:"Select a date range"}),t.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),t.jsxs("div",{className:"paper-date-navigation",children:[t.jsx(I,{calendar:"start",onPrevious:()=>S(m,-1,f,D),onNext:()=>S(m,1,f,D)}),!o&&t.jsx(I,{calendar:"end",onPrevious:()=>S(_,-1,T,y),onNext:()=>S(_,1,T,y),secondary:!0})]}),t.jsxs("div",{className:"paper-date-calendars",children:[t.jsx(L,{month:m,today:k,startDate:r,endDate:c,onSelect:A,yearLabel:o?"Year":"Start year",yearValue:z,onYearChange:h=>E(h,D,f)}),!o&&t.jsx(L,{month:_,today:k,startDate:r,endDate:c,onSelect:A,yearLabel:"End year",yearValue:G,onYearChange:h=>E(h,y,T),secondary:!0})]}),t.jsxs("div",{className:"paper-date-actions",children:[t.jsx("button",{type:"button",className:"paper-date-clear",onClick:Q,children:"Clear range"}),t.jsxs("div",{children:[t.jsx("button",{type:"button",onClick:()=>l(!1),children:"Cancel"}),t.jsx("button",{type:"button",className:"paper-date-apply",disabled:!r||!c,onClick:()=>{r&&c&&s({startDate:r,endDate:c}),l(!1)},children:"Apply"})]})]})]})]})]})},pe=()=>t.jsxs("span",{className:"hf-resource-logo",children:[t.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),t.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),B=({checked:e,icon:a,label:s,onChange:n})=>t.jsxs("button",{type:"button",className:`paper-feed-filter ${e?"active":""}`,"aria-pressed":e,onClick:()=>n(!e),children:[t.jsxs("span",{className:"paper-feed-filter-content",children:[t.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),s]}),e&&t.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),ge=({hasCode:e,hasHfArtifacts:a,onHasCodeChange:s,onHasHfArtifactsChange:n,showDivider:o=!0,showHasCode:i=!0})=>t.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[o&&t.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),t.jsxs("div",{className:"paper-feed-filter-options",children:[i&&t.jsx(B,{checked:e,icon:t.jsx(se,{name:"github",size:14}),label:"Has code",onChange:s}),t.jsx(B,{checked:a,icon:t.jsx(pe,{}),label:"Has artifacts",onChange:n})]})]});function ue(e,a="200px"){const{targetRef:s,isIntersecting:n}=ne({rootMargin:a}),{data:o,hasNextPage:i,isFetchingNextPage:d,fetchNextPage:l}=e;return u.useEffect(()=>{n&&i&&!d&&l()},[n,i,d,l,o]),s}const me=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]];function Ue(){const[e,a]=q(),s=e.get("order_by"),n=s==="date_published"||s==="citation_count"?s:"trending",o=e.get("has_code")==="true",i=e.get("has_hf_artifacts")==="true",d=V(e),l=(r,p)=>{const c=new URLSearchParams(e);p?c.set(r,p):c.delete(r),a(c)};return{searchParams:e,setSearchParams:a,orderBy:n,hasCode:o,hasHfArtifacts:i,dateRange:d,setOrderBy:r=>l("order_by",r==="trending"?null:r),setHasCode:r=>l("has_code",r?"true":null),setHasHfArtifacts:r=>l("has_hf_artifacts",r?"true":null),setDateRange:r=>a(Z(e,r)),filters:{order_by:n,order_dir:"desc",latest_only:!0,include_resources:!0,has_code:o,has_hf_artifacts:i,start_date:d.startDate,end_date:d.endDate}}}const ve=({feed:e,sorts:a=me,activeSort:s=e.orderBy,showDateFilter:n=!0,showHasCode:o,style:i,leading:d,children:l})=>t.jsxs("div",{className:"sort-bar",style:i,children:[d,t.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a&&t.jsx("div",{className:"sort-options",children:a.map(([r,p])=>t.jsx("button",{type:"button",className:`sort-btn ${s===r?"active":""}`,onClick:()=>e.setOrderBy(r),children:p},r))}),t.jsx(ge,{hasCode:e.hasCode,hasHfArtifacts:e.hasHfArtifacts,onHasCodeChange:e.setHasCode,onHasHfArtifactsChange:e.setHasHfArtifacts,showDivider:!!a,showHasCode:o})]}),n&&t.jsx(he,{startDate:e.dateRange.startDate,endDate:e.dateRange.endDate,onChange:e.setDateRange}),l]}),fe=()=>t.jsx(j,{className:"h-40 w-full"}),xe=()=>t.jsxs("div",{className:"paper-card",children:[t.jsx("div",{className:"paper-thumb-wrap",children:t.jsx(j,{className:"paper-thumb-skeleton"})}),t.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[t.jsx(j,{className:"h-6 w-3/4"}),t.jsx(j,{className:"h-4 w-1/2"}),t.jsx(j,{className:"h-12 w-full"})]})]}),we=({query:e,isLoading:a=e.isLoading,cards:s,empty:n,skeleton:o="block",showInstitution:i,highlightQuery:d,cardHeader:l,rootMargin:r,children:p})=>{const c=ue(e,r);if(a){const g=o==="card"?xe:fe;return t.jsx("div",{className:"paper-list",children:Array.from({length:o==="card"?6:4}).map((m,f)=>t.jsx(g,{},f))})}return s.length===0?n===null?null:t.jsx("div",{className:"no-results",children:n}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"paper-list",children:s.map((g,m)=>t.jsxs(J.Fragment,{children:[l==null?void 0:l(m),t.jsx(X,{paper:g,priority:m<3,showInstitution:i,highlightQuery:d,followReasons:g.followReasons})]},g.id))}),t.jsx("div",{ref:c,style:{height:1}}),e.isFetchingNextPage&&t.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),p]})};export{he as P,we as a,ve as b,me as c,Ne as r,Ue as u,Se as w}; +import{r as u,j as t,e as J,M as K}from"./index-CbgxfyGU.js";import{P as X}from"./PaperCard-tdTC_dRN.js";import{P as ee,a as te,b as ae}from"./popover-DKJYnYjk.js";import{I as se}from"./Icon-D-kA0Owz.js";import{S as j}from"./skeleton-HwvdxvSN.js";import{u as ne}from"./useIntersectionObserver-CID9Kkak.js";const Y=(e,a)=>{const s=new Date(a),n=new Date(s);return n.setUTCDate(s.getUTCDate()-(e==="week"?6:29)),{startDate:n.toISOString().slice(0,10),endDate:s.toISOString().slice(0,10)}},V=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),Ne=(e,a=new Date,s="week")=>{const n=V(e);if(n.startDate||n.endDate||e.get("time")==="all_time")return n;const o=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));return Y(s,o)},Z=(e,a)=>{const s=new URLSearchParams(e);return a.startDate?s.set("start_date",a.startDate):s.delete("start_date"),a.endDate?s.set("end_date",a.endDate):s.delete("end_date"),s.delete("time"),s},Se=(e,a)=>{const s=Z(e,a);return!a.startDate&&!a.endDate&&s.set("time","all_time"),s},re=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),H=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),O="(max-width: 640px)",oe=()=>{const[e,a]=u.useState(()=>typeof window<"u"&&window.matchMedia(O).matches);return u.useEffect(()=>{const s=window.matchMedia(O),n=o=>a(o.matches);return a(s.matches),s.addEventListener("change",n),()=>s.removeEventListener("change",n)},[]),e},W=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ie=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},F=(e,a)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+a,1)),v=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),ce=(e,a)=>new Date(Date.UTC(a,e.getUTCMonth(),1)),w=(e,a)=>e.startDate===a.startDate&&e.endDate===a.endDate,le=(e,a)=>{const s=b(e),n=b(a),o=H.format(s),i=H.format(n),d=s.getUTCDate(),l=n.getUTCDate(),r=s.getUTCFullYear(),p=n.getUTCFullYear();return e===a?`${o} ${d}, ${r}`:r===p&&s.getUTCMonth()===n.getUTCMonth()?`${o} ${d}–${l}, ${r}`:r===p?`${o} ${d}–${i} ${l}, ${r}`:`${o} ${d}, ${r}–${i} ${l}, ${p}`},de=e=>{const a=e.getUTCFullYear(),s=e.getUTCMonth(),n=new Date(Date.UTC(a,s,1)),o=(n.getUTCDay()+6)%7,i=new Date(n);return i.setUTCDate(n.getUTCDate()-o),Array.from({length:42},(d,l)=>{const r=new Date(i);return r.setUTCDate(i.getUTCDate()+l),{iso:W(r),day:r.getUTCDate(),outsideMonth:r.getUTCMonth()!==s}})},L=({month:e,today:a,startDate:s,endDate:n,onSelect:o,yearLabel:i,yearValue:d,onYearChange:l,secondary:r=!1})=>{const p=u.useMemo(()=>de(e),[e]);return t.jsxs("section",{className:`paper-date-calendar${r?" paper-date-calendar-secondary":""}`,children:[t.jsxs("label",{className:"paper-date-year",children:[t.jsx("span",{children:i}),t.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:a.slice(0,4),step:"1",value:d,onChange:c=>l(c.target.value)})]}),t.jsx("h3",{children:re.format(e)}),t.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(c=>t.jsx("span",{children:c},c))}),t.jsx("div",{className:"paper-date-days",children:p.map(c=>{const g=c.iso===s||c.iso===n,m=!!(s&&n&&c.iso>s&&c.isoa;return t.jsx("button",{type:"button","aria-label":c.iso,"aria-selected":g,disabled:f,className:["paper-date-day",c.outsideMonth?"outside":"",g?"selected":"",m?"in-range":"",c.iso===a?"today":""].filter(Boolean).join(" "),onClick:()=>o(c.iso),children:c.day},c.iso)})})]})},I=({calendar:e,onPrevious:a,onNext:s,secondary:n=!1})=>t.jsxs("div",{className:`paper-date-navigation-group${n?" paper-date-navigation-group-secondary":""}`,children:[t.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:a,children:"←"}),t.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:s,children:"→"})]}),he=({startDate:e,endDate:a,onChange:s,currentDate:n})=>{const o=oe(),i=n?b(n):ie(),[d,l]=u.useState(!1),[r,p]=u.useState(),[c,g]=u.useState(),[m,f]=u.useState(()=>v(i)),[_,T]=u.useState(()=>F(v(i),1)),[z,D]=u.useState(()=>String(i.getUTCFullYear())),[G,y]=u.useState(()=>String(i.getUTCFullYear())),N={startDate:e,endDate:a},M=Y("week",i),P=Y("month",i),k=W(i),R=!!(e&&a&&!w(N,M)&&!w(N,P)),Q=()=>{p(e),g(a);const h=v(e?b(e):i),x=v(a?b(a):F(h,1));f(h),T(x),D(String(h.getUTCFullYear())),y(String(x.getUTCFullYear())),l(!0)},E=(h,x,$)=>{if(x(h),!/^\d{4}$/.test(h))return;const C=Number(h);C>=1900&&C<=i.getUTCFullYear()&&$(U=>ce(U,C))},S=(h,x,$,C)=>{const U=F(h,x);$(U),C(String(U.getUTCFullYear()))},A=h=>{!r||c?(p(h),g(void 0)):h{s({}),l(!1)};return t.jsxs("div",{className:`paper-date-filter${o?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(N,M)?" active":""}`,onClick:()=>s(M),children:"Last Week"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(N,P)?" active":""}`,onClick:()=>s(P),children:"Last Month"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!a?" active":""}`,onClick:()=>s({}),children:"All Time"}),t.jsxs(ee,{open:d,onOpenChange:h=>{h?Q():l(!1)},children:[t.jsx(te,{asChild:!0,children:t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${R?" active":""}`,"aria-label":R?"Change date range":"Select a range",children:R&&e&&a?le(e,a):"Select a range"})}),t.jsxs(ae,{align:"end",className:`paper-date-popover${o?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[t.jsxs("div",{className:"paper-date-popover-header",children:[t.jsx("h2",{children:"Select a date range"}),t.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),t.jsxs("div",{className:"paper-date-navigation",children:[t.jsx(I,{calendar:"start",onPrevious:()=>S(m,-1,f,D),onNext:()=>S(m,1,f,D)}),!o&&t.jsx(I,{calendar:"end",onPrevious:()=>S(_,-1,T,y),onNext:()=>S(_,1,T,y),secondary:!0})]}),t.jsxs("div",{className:"paper-date-calendars",children:[t.jsx(L,{month:m,today:k,startDate:r,endDate:c,onSelect:A,yearLabel:o?"Year":"Start year",yearValue:z,onYearChange:h=>E(h,D,f)}),!o&&t.jsx(L,{month:_,today:k,startDate:r,endDate:c,onSelect:A,yearLabel:"End year",yearValue:G,onYearChange:h=>E(h,y,T),secondary:!0})]}),t.jsxs("div",{className:"paper-date-actions",children:[t.jsx("button",{type:"button",className:"paper-date-clear",onClick:q,children:"Clear range"}),t.jsxs("div",{children:[t.jsx("button",{type:"button",onClick:()=>l(!1),children:"Cancel"}),t.jsx("button",{type:"button",className:"paper-date-apply",disabled:!r||!c,onClick:()=>{r&&c&&s({startDate:r,endDate:c}),l(!1)},children:"Apply"})]})]})]})]})]})},pe=()=>t.jsxs("span",{className:"hf-resource-logo",children:[t.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),t.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),B=({checked:e,icon:a,label:s,onChange:n})=>t.jsxs("button",{type:"button",className:`paper-feed-filter ${e?"active":""}`,"aria-pressed":e,onClick:()=>n(!e),children:[t.jsxs("span",{className:"paper-feed-filter-content",children:[t.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),s]}),e&&t.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),ge=({hasCode:e,hasHfArtifacts:a,onHasCodeChange:s,onHasHfArtifactsChange:n,showDivider:o=!0,showHasCode:i=!0})=>t.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[o&&t.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),t.jsxs("div",{className:"paper-feed-filter-options",children:[i&&t.jsx(B,{checked:e,icon:t.jsx(se,{name:"github",size:14}),label:"Has code",onChange:s}),t.jsx(B,{checked:a,icon:t.jsx(pe,{}),label:"Has artifacts",onChange:n})]})]});function ue(e,a="200px"){const{targetRef:s,isIntersecting:n}=ne({rootMargin:a}),{data:o,hasNextPage:i,isFetchingNextPage:d,fetchNextPage:l}=e;return u.useEffect(()=>{n&&i&&!d&&l()},[n,i,d,l,o]),s}const me=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]];function Ue(){const[e,a]=J(),s=e.get("order_by"),n=s==="date_published"||s==="citation_count"?s:"trending",o=e.get("has_code")==="true",i=e.get("has_hf_artifacts")==="true",d=V(e),l=(r,p)=>{const c=new URLSearchParams(e);p?c.set(r,p):c.delete(r),a(c)};return{searchParams:e,setSearchParams:a,orderBy:n,hasCode:o,hasHfArtifacts:i,dateRange:d,setOrderBy:r=>l("order_by",r==="trending"?null:r),setHasCode:r=>l("has_code",r?"true":null),setHasHfArtifacts:r=>l("has_hf_artifacts",r?"true":null),setDateRange:r=>a(Z(e,r)),filters:{order_by:n,order_dir:"desc",latest_only:!0,include_resources:!0,has_code:o,has_hf_artifacts:i,start_date:d.startDate,end_date:d.endDate}}}const ve=({feed:e,sorts:a=me,activeSort:s=e.orderBy,showDateFilter:n=!0,showHasCode:o,style:i,leading:d,children:l})=>t.jsxs("div",{className:"sort-bar",style:i,children:[d,t.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a&&t.jsx("div",{className:"sort-options",children:a.map(([r,p])=>t.jsx("button",{type:"button",className:`sort-btn ${s===r?"active":""}`,onClick:()=>e.setOrderBy(r),children:p},r))}),t.jsx(ge,{hasCode:e.hasCode,hasHfArtifacts:e.hasHfArtifacts,onHasCodeChange:e.setHasCode,onHasHfArtifactsChange:e.setHasHfArtifacts,showDivider:!!a,showHasCode:o})]}),n&&t.jsx(he,{startDate:e.dateRange.startDate,endDate:e.dateRange.endDate,onChange:e.setDateRange}),l]}),fe=()=>t.jsx(j,{className:"h-40 w-full"}),xe=()=>t.jsxs("div",{className:"paper-card",children:[t.jsx("div",{className:"paper-thumb-wrap",children:t.jsx(j,{className:"paper-thumb-skeleton"})}),t.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[t.jsx(j,{className:"h-6 w-3/4"}),t.jsx(j,{className:"h-4 w-1/2"}),t.jsx(j,{className:"h-12 w-full"})]})]}),we=({query:e,isLoading:a=e.isLoading,cards:s,empty:n,skeleton:o="block",showInstitution:i,highlightQuery:d,cardHeader:l,rootMargin:r,children:p})=>{const c=ue(e,r);if(a){const g=o==="card"?xe:fe;return t.jsx("div",{className:"paper-list",children:Array.from({length:o==="card"?6:4}).map((m,f)=>t.jsx(g,{},f))})}return s.length===0?n===null?null:t.jsx("div",{className:"no-results",children:n}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"paper-list",children:s.map((g,m)=>t.jsxs(K.Fragment,{children:[l==null?void 0:l(m),t.jsx(X,{paper:g,priority:m<3,showInstitution:i,highlightQuery:d,followReasons:g.followReasons})]},g.id))}),t.jsx("div",{ref:c,style:{height:1}}),e.isFetchingNextPage&&t.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),p]})};export{he as P,we as a,ve as b,me as c,Ne as r,Ue as u,Se as w}; diff --git a/assets/PaperPreviewLink-CKfmgBjs.js b/assets/PaperPreviewLink-DZDNIh1g.js similarity index 93% rename from assets/PaperPreviewLink-CKfmgBjs.js rename to assets/PaperPreviewLink-DZDNIh1g.js index e86091628935f05f65cb8898b71791548d687dc0..4c8ffe41da53e8595e539fa1b28c7b5a8cec8676 100644 --- a/assets/PaperPreviewLink-CKfmgBjs.js +++ b/assets/PaperPreviewLink-DZDNIh1g.js @@ -1,7 +1,7 @@ -import{o as F,f as j,m as b,a as le,p as O,b as z,n as D,h as ce,s as ue,c as he,v as pe,S as me}from"./index-CoRCN2p0.js";import{l as fe}from"./index-BM_xSDJM.js";import R from"./katex-DkKDou_j.js";import{j as p,K as A,Y as de,o as C,d as xe,f as ge,L as T,J as ye}from"./index-YwiKC6Po.js";import{u as we}from"./useQuery-DPH6Mb2w.js";import{H as be,a as Ne,b as ve}from"./hover-card-BY9tUGxy.js";import{a as I,p as ke}from"./paperQueryKeys-C5FMa4Oj.js";import{u as Fe}from"./useMutation-f6iDkf3w.js";function je(){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];F(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,""),m=this.stack[this.stack.length-1];F(m.type==="math"),this.exit(a),m.value=c;const f=m.data.hChildren[0];F(f.type==="element"),F(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(),m=this.stack[this.stack.length-1];F(m.type==="inlineMath"),this.exit(a),m.value=c,m.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 Ce(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +import{o as F,f as j,m as b,a as le,p as O,b as z,n as D,h as ce,s as ue,c as he,v as pe,S as me}from"./index-ZkEATkOr.js";import{l as fe}from"./index-BH3yOoza.js";import R from"./katex-DkKDou_j.js";import{j as p,M as A,Z as de,o as C,d as xe,f as ge,L as T,K as ye}from"./index-CbgxfyGU.js";import{u as we}from"./useQuery-Bx9s5-D2.js";import{H as be,a as Ne,b as ve}from"./hover-card-ufez2uMo.js";import{a as I,p as ke}from"./paperQueryKeys-B8u1BWlI.js";import{u as Fe}from"./useMutation-P_trTy9i.js";function je(){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];F(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,""),m=this.stack[this.stack.length-1];F(m.type==="math"),this.exit(a),m.value=c;const f=m.data.hChildren[0];F(f.type==="element"),F(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(),m=this.stack[this.stack.length-1];F(m.type==="inlineMath"),this.exit(a),m.value=c,m.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 Ce(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,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||"",m=l.createTracker(a),f="$".repeat(Math.max(fe(c,"$")+1,2)),g=l.enter("mathFlow");let d=m.move(f);if(s.meta){const x=l.enter("mathFlowMeta");d+=m.move(l.safe(s.meta,{after:` `,before:d,encode:["$"],...m.current()})),x()}return d+=m.move(` `),c&&(d+=m.move(c+` -`)),d+=m.move(f),g(),d}function n(s,o,l){let a=s.value||"",c=1;for(t||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(a);)c++;const m="$".repeat(c);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let f=-1;for(;++fc&&(c=m):m&&(c!==void 0&&c>-1&&a.push(` +`)),d+=m.move(f),g(),d}function n(s,o,l){let a=s.value||"",c=1;for(t||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(a);)c++;const m="$".repeat(c);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let f=-1;for(;++fc&&(c=m):m&&(c!==void 0&&c>-1&&a.push(` `.repeat(c)||" "),c=-1,a.push(m))}return a.join("")}function re(e,t,r){return e.type==="element"?it(e,t,r):e.type==="text"?r.whitespace==="normal"?ie(e,r):at(e):[]}function it(e,t,r){const n=ae(e,r),i=e.children||[];let s=-1,o=[];if(nt(e))return o;let l,a;for(P(e)||W(e)&&V(t,e,W)?a=` -`:tt(e)?(l=2,a=2):ne(e)&&(l=1,a=1);++s({name:r.name,slug:r.slug??""}))}}function mt(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ft(e){var r;if(e.conference)return e.conference;const t=(r=e.published)==null?void 0:r.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const dt=({seed:e=0})=>p.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[p.jsxs("div",{className:"paper-preview-thumb-title",children:[p.jsx("span",{}),p.jsx("span",{})]}),p.jsx("div",{className:"paper-preview-thumb-auth"}),p.jsxs("div",{className:"paper-preview-thumb-cols",children:[p.jsx("div",{className:"paper-preview-thumb-col"}),p.jsx("div",{className:"paper-preview-thumb-col"})]}),p.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),xt=({thumbnailUrl:e,seed:t})=>{const[r,n]=A.useState(!1),i=de(e);return A.useEffect(()=>n(!1),[i]),!i||r?p.jsx(dt,{seed:t}):p.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:p.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>n(!0)})})},Y=({data:e})=>{const t=e.routeId.split("").reduce((n,i)=>n+i.charCodeAt(0),0),r=mt(e);return p.jsxs("div",{className:"paper-preview-inner",children:[p.jsx(xt,{thumbnailUrl:e.thumbnailUrl,seed:t}),p.jsxs("div",{className:"paper-preview-meta",children:[p.jsx("div",{className:"paper-preview-title",children:e.title}),r&&p.jsx("div",{className:"paper-preview-auth",children:r}),p.jsxs("div",{className:"paper-preview-venue",children:[ft(e),e.arxivId&&p.jsxs(p.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&p.jsxs(p.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&p.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(n=>p.jsx("span",{className:"paper-preview-tag",children:n.name},n.slug||n.name))})]})]})},M=e=>ke.preview(C(e)),gt=e=>e.arxiv_id??e.id,J=200;function St(e,t=I){const r=new Set,n=async s=>{const o=new Map;for(const l of s)l.arxiv_id&&r.add(C(l.arxiv_id));for(let l=0;l{const o=s.filter(l=>{const a=C(l);return r.has(a)||e.getQueryData(M(a))?!1:(r.add(a),!0)});o.length&&n(o.map(l=>({key:l,arxiv_id:l}))).catch(()=>{})}}}const yt=/^(\d{4}\.\d{4,5}|[a-z-]+(\.[A-Z]{2})?\/\d{7})$/i,wt=({arxivId:e})=>{var i;const t=xe(),r=ge(),n=Fe({mutationFn:()=>I.submit({arxiv_id:e}),onSuccess:s=>{s.pending_review||r.invalidateQueries({queryKey:M(e)})}});return(i=n.data)!=null&&i.pending_review?p.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[p.jsx("span",{children:"Indexing request queued for review."}),p.jsx(T,{to:"/submissions",target:"_blank",rel:"noopener noreferrer",children:"View submissions ↗"})]}):p.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[p.jsx("span",{children:"Not indexed on Papers with Code yet."}),t!=null&&t.user?p.jsx("button",{type:"button",disabled:n.isPending,onClick:()=>n.mutate(),children:n.isPending?"Requesting…":"Request indexing"}):p.jsx(T,{to:`/submit?arxiv_id=${encodeURIComponent(e)}`,target:"_blank",rel:"noopener noreferrer",children:"Request indexing ↗"}),n.isError&&p.jsx("span",{role:"alert",children:n.error.message})]})},bt=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,Pt=({routeId:e,to:t,initialData:r,className:n,children:i,target:s,title:o,ariaLabel:l,onClick:a,previewFooter:c,cardOpensPaper:m=!1})=>{const f=C(e),[g,d]=A.useState(!1),x=!!(r!=null&&r.title.trim()),h=we({queryKey:M(f),queryFn:()=>I.get(f,!1),enabled:g&&!x,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),y=r??(h.data?pt(h.data,f):void 0),v=h.error instanceof ye&&h.error.status===404&&yt.test(f),u=p.jsx(T,{className:n,to:t??`/paper/${f}`,target:s,title:o,"aria-label":l,onClick:k=>{d(!1),a==null||a(k)},rel:s==="_blank"?"noopener noreferrer":void 0,children:i});return p.jsxs(be,{open:g,onOpenChange:k=>{(!k||!bt())&&d(k)},openDelay:150,closeDelay:100,children:[p.jsx(Ne,{asChild:!0,children:u}),p.jsx(ve,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:y?p.jsxs(p.Fragment,{children:[m?p.jsx(T,{className:"paper-preview-card-link",to:`/paper/${encodeURIComponent(f)}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>d(!1),children:p.jsx(Y,{data:y})}):p.jsx(Y,{data:y}),c==null?void 0:c(y)]}):v?p.jsx(wt,{arxivId:f}):h.isError?p.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):p.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{Pt as P,Et as a,St as c,At as r}; +`:tt(e)?(l=2,a=2):ne(e)&&(l=1,a=1);++s({name:r.name,slug:r.slug??""}))}}function mt(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ft(e){var r;if(e.conference)return e.conference;const t=(r=e.published)==null?void 0:r.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const dt=({seed:e=0})=>p.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[p.jsxs("div",{className:"paper-preview-thumb-title",children:[p.jsx("span",{}),p.jsx("span",{})]}),p.jsx("div",{className:"paper-preview-thumb-auth"}),p.jsxs("div",{className:"paper-preview-thumb-cols",children:[p.jsx("div",{className:"paper-preview-thumb-col"}),p.jsx("div",{className:"paper-preview-thumb-col"})]}),p.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),xt=({thumbnailUrl:e,seed:t})=>{const[r,n]=A.useState(!1),i=de(e);return A.useEffect(()=>n(!1),[i]),!i||r?p.jsx(dt,{seed:t}):p.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:p.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>n(!0)})})},Z=({data:e})=>{const t=e.routeId.split("").reduce((n,i)=>n+i.charCodeAt(0),0),r=mt(e);return p.jsxs("div",{className:"paper-preview-inner",children:[p.jsx(xt,{thumbnailUrl:e.thumbnailUrl,seed:t}),p.jsxs("div",{className:"paper-preview-meta",children:[p.jsx("div",{className:"paper-preview-title",children:e.title}),r&&p.jsx("div",{className:"paper-preview-auth",children:r}),p.jsxs("div",{className:"paper-preview-venue",children:[ft(e),e.arxivId&&p.jsxs(p.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&p.jsxs(p.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&p.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(n=>p.jsx("span",{className:"paper-preview-tag",children:n.name},n.slug||n.name))})]})]})},M=e=>ke.preview(C(e)),gt=e=>e.arxiv_id??e.id,Y=200;function St(e,t=I){const r=new Set,n=async s=>{const o=new Map;for(const l of s)l.arxiv_id&&r.add(C(l.arxiv_id));for(let l=0;l{const o=s.filter(l=>{const a=C(l);return r.has(a)||e.getQueryData(M(a))?!1:(r.add(a),!0)});o.length&&n(o.map(l=>({key:l,arxiv_id:l}))).catch(()=>{})}}}const yt=/^(\d{4}\.\d{4,5}|[a-z-]+(\.[A-Z]{2})?\/\d{7})$/i,wt=({arxivId:e})=>{var i;const t=xe(),r=ge(),n=Fe({mutationFn:()=>I.submit({arxiv_id:e}),onSuccess:s=>{s.pending_review||r.invalidateQueries({queryKey:M(e)})}});return(i=n.data)!=null&&i.pending_review?p.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[p.jsx("span",{children:"Indexing request queued for review."}),p.jsx(T,{to:"/submissions",target:"_blank",rel:"noopener noreferrer",children:"View submissions ↗"})]}):p.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[p.jsx("span",{children:"Not indexed on Papers with Code yet."}),t!=null&&t.user?p.jsx("button",{type:"button",disabled:n.isPending,onClick:()=>n.mutate(),children:n.isPending?"Requesting…":"Request indexing"}):p.jsx(T,{to:`/submit?arxiv_id=${encodeURIComponent(e)}`,target:"_blank",rel:"noopener noreferrer",children:"Request indexing ↗"}),n.isError&&p.jsx("span",{role:"alert",children:n.error.message})]})},bt=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,Pt=({routeId:e,to:t,initialData:r,className:n,children:i,target:s,title:o,ariaLabel:l,onClick:a,previewFooter:c,cardOpensPaper:m=!1})=>{const f=C(e),[g,d]=A.useState(!1),x=!!(r!=null&&r.title.trim()),h=we({queryKey:M(f),queryFn:()=>I.get(f,!1),enabled:g&&!x,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),y=r??(h.data?pt(h.data,f):void 0),v=h.error instanceof ye&&h.error.status===404&&yt.test(f),u=p.jsx(T,{className:n,to:t??`/paper/${f}`,target:s,title:o,"aria-label":l,onClick:k=>{d(!1),a==null||a(k)},rel:s==="_blank"?"noopener noreferrer":void 0,children:i});return p.jsxs(be,{open:g,onOpenChange:k=>{(!k||!bt())&&d(k)},openDelay:150,closeDelay:100,children:[p.jsx(Ne,{asChild:!0,children:u}),p.jsx(ve,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:y?p.jsxs(p.Fragment,{children:[m?p.jsx(T,{className:"paper-preview-card-link",to:`/paper/${encodeURIComponent(f)}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>d(!1),children:p.jsx(Z,{data:y})}):p.jsx(Z,{data:y}),c==null?void 0:c(y)]}):v?p.jsx(wt,{arxivId:f}):h.isError?p.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):p.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{Pt as P,Et as a,St as c,At as r}; diff --git a/assets/PaperReaderView-D2y857wl.js b/assets/PaperReaderView-9hbbSNRK.js similarity index 77% rename from assets/PaperReaderView-D2y857wl.js rename to assets/PaperReaderView-9hbbSNRK.js index 90d35d4e311151b9bf63c77ae1a3457638ad7ee1..97a211e9ec6a145e5b0caaa96b988ec47a64b625 100644 --- a/assets/PaperReaderView-D2y857wl.js +++ b/assets/PaperReaderView-9hbbSNRK.js @@ -1 +1 @@ -import{r as s,j as a,J as G,u as Se,c as Ue,o as De,Y as je,O as Oe,L as Y}from"./index-YwiKC6Po.js";import{u as ee}from"./useQuery-DPH6Mb2w.js";import{u as Ve,R as Qe,A as Xe,c as Ye,d as Je,a as Ze,P as Ge,e as et}from"./ArtifactWorkspace-BxDA6yNF.js";import{M as tt}from"./MarkdownText-C-8yLDus.js";import{g as rt,b as at}from"./paperQueryKeys-C5FMa4Oj.js";import{w as st,e as nt}from"./paperReader-BIpQD5HO.js";import{a as ot}from"./usePapers-C1deOZKl.js";import{c as it}from"./chat-DHGOonJg.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-DsnEMREv.js";import"./chatSessions-CdNQ1toA.js";/* empty css */import"./hover-card-BY9tUGxy.js";import"./CatalogEntityPreviewLink-Cv_oezOz.js";import"./catalog-B15Yh5dN.js";import"./github-BZMCt7Ub.js";import"./file-text-Cijxx2XD.js";import"./PaperPreviewLink-CKfmgBjs.js";import"./index-CoRCN2p0.js";import"./index-BM_xSDJM.js";import"./katex-DkKDou_j.js";import"./useMutation-f6iDkf3w.js";import"./copy-YHg6twss.js";import"./thumbs-up-D9G2aLNB.js";import"./arrow-left-B08fyfNi.js";import"./external-link-4bBJT0yO.js";import"./plus-Cfz0QbT1.js";import"./search-wcEXdf1i.js";import"./chevron-up-BXtxbTfV.js";import"./AuthorAvatar-CoTET6B3.js";import"./curation-CkzNFTMJ.js";import"./useInfiniteQuery-BEbL80ez.js";import"./McpShowcase-Fj71TTNl.js";import"./AgentLogos-DhD8p5ds.js";import"./share-2-m8aPY8Vq.js";import"./openrouter-BT3NQ0bL.js";import"./queryOptions-C9woPjwX.js";function lt(r){return r instanceof G&&r.status===422?"This page could not be turned into a readable paper.":r instanceof G&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function dt({paperId:r,paperKey:i,paperTitle:o,paperHref:b,sourceUrl:d,resources:t,paperVersion:f="",selectionEnabled:v=!1,onReady:h,onPaperSelection:I,onPaperSelectionError:B}){const c=s.useRef(null),g=ee({queryKey:["paperWebMarkdown",r],queryFn:()=>rt(r),staleTime:5*6e4,retry:(w,j)=>w<2&&!(j instanceof G&&j.status<500),retryDelay:3e3}),x=g.isSuccess;s.useEffect(()=>{x&&(h==null||h())},[h,x]),Ve({enabled:v&&!!f&&x,pagesRoot:c,routeId:i,paperVersion:f,numPages:1,onSelect:I,onError:B});const S=g.data?st(g.data):"";return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Qe,{paperTitle:o,paperHref:b,resources:t,label:"Paper controls",children:a.jsx("div",{className:"pdf-toolbar-controls",children:a.jsx("a",{href:d,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:g.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):g.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:lt(g.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void g.refetch(),children:"Retry"})," ",a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:c,className:"reader-web-document","data-page":"1",children:[!S.startsWith("# ")&&a.jsx("h1",{children:o}),a.jsx(tt,{text:S})]})})})]})}const _e=66,ut=240,re="pwc:reader:split-ratio",L=r=>`pwc:reader:session:${r}`,J=r=>`pwc:reader:assistant-collapsed:${r}`,Ce=r=>`pwc:reader:page:${r}`;function Z(r){const i=Number(sessionStorage.getItem(Ce(r)));return Number.isInteger(i)&&i>0?i:1}function pt(){const r=Number(localStorage.getItem(re));return Number.isFinite(r)&&r>=45&&r<=75?r:_e}function ft(r){const i=te(r);if(!i)return null;const o=new URL(i);return(o.hostname==="arxiv.org"||o.hostname==="www.arxiv.org")&&o.pathname.startsWith("/pdf/")&&o.pathname.endsWith(".pdf")&&(o.pathname=o.pathname.slice(0,-4)),o.href}const mt=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function ht(r){const i=new URL(r),o=i.pathname.match(mt);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&o&&!i.search?je(`/paper-assets/arxiv-pdf/${o[1]}`)??r:r}function gt(r){return new URL(r).hostname.replace(/^www\./,"")}function bt(r){if(!r)return{};const i={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=te(d.url);if(!t)continue;const f=new URL(t),v=f.pathname.split("/").filter(Boolean);if((f.hostname==="github.com"||f.hostname==="www.github.com")&&v.length>=2){i.repository={href:t,stars:d.num_stars||0};break}}const o=[...r.project_pages??[]].sort((d,t)=>Number(t.is_official)-Number(d.is_official));for(const d of o){const t=te(d.url);if(t){i.projectPage={href:t,label:gt(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 vt(){var xe,Pe,we,ye,Re;const r=Ue(),{paperId:i}=Se(),o=De(i??"").replace(/v\d+$/i,""),b=ot(o,!!o),d=ee({queryKey:["chatAvailability"],queryFn:()=>it.getAvailability(),refetchInterval:3e4,retry:!1}),t=b.data,f=t?nt(t):null,v=f?null:(t==null?void 0:t.source)==="external"?je(`/paper-assets/external/${t.id}/paper.pdf`):ft(t==null?void 0:t.url_pdf),h=v&&(t==null?void 0:t.source)!=="external"?ht(v):v,I=bt(t),B=s.useMemo(()=>{var e;return(e=t==null?void 0:t.author_links)==null?void 0:e.flatMap(n=>n.id?[{id:n.id,name:n.name,avatarUrl:n.hf_avatar_url}]:[])},[t==null?void 0:t.author_links]),c=((xe=t==null?void 0:t.arxiv_id)==null?void 0:xe.replace(/v\d+$/i,""))||o,g=s.useCallback(()=>r(`/paper/${c}`),[c,r]),[x,S]=s.useState(()=>sessionStorage.getItem(L(o))||void 0),[w,j]=s.useState(pt),[u,ae]=s.useState(()=>sessionStorage.getItem(J(o))==="1"),[P,_]=s.useState("paper"),[H,C]=s.useState(),[ke,se]=s.useState(),[Ae,ne]=s.useState(!1),Ie=s.useCallback(()=>ne(!0),[]),[$e,y]=s.useState(""),[Ne,Ee]=s.useState(()=>Z(o)),[k,Te]=s.useState(0),[oe,ie]=s.useState(!1),[Me,F]=s.useState(!1),$=s.useRef(null),q=s.useRef(null),N=s.useRef(null),ce=s.useRef(null),le=s.useRef(null),K=s.useRef(!1),E=s.useRef(!1),T=s.useRef(0),R=s.useRef(0),U=s.useRef(0),A=s.useRef(w),D=s.useRef(Z(o)),O=s.useRef(t==null?void 0:t.version),de=Ye().reset,ue=s.useRef(`${o}:${x??"new"}`),p=k>=840;s.useEffect(()=>{const e=`${o}:${x??"new"}`;ue.current!==e&&(ue.current=e,de())},[x,de,o]),s.useEffect(()=>{t!=null&&t.version&&O.current&&t.version!==O.current&&(C(void 0),y("")),O.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(T.current),F(!1);const e=sessionStorage.getItem(L(o));S(e||void 0),ae(sessionStorage.getItem(J(o))==="1"),_("paper"),ne(!1),C(void 0),se(void 0),y("");const n=Z(o);D.current=n,Ee(n)},[o]),s.useEffect(()=>()=>{window.clearTimeout(T.current),cancelAnimationFrame(R.current)},[]),s.useLayoutEffect(()=>{const e=$.current;if(!e)return;const n=()=>Te(e.clientWidth);n();const l=new ResizeObserver(n);return l.observe(e),()=>l.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const n=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const l=e.content;e.content="noindex, nofollow";let m=document.querySelector('link[rel="canonical"]');const qe=!m;m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m));const Ke=m.href;return m.href=`${window.location.origin}/paper/${c}`,()=>{document.title="Papers With Code",n?e==null||e.remove():e&&(e.content=l),qe?m==null||m.remove():m&&(m.href=Ke)}},[c,t]);const M=s.useCallback(e=>{if(!k)return Math.max(45,Math.min(75,e));const n=480/k*100,l=100-360/k*100;return Math.max(n,Math.min(l,e))},[k]);s.useEffect(()=>j(e=>{const n=M(e);return A.current=n,n}),[M]);const W=e=>{const n=M(e);A.current=n,j(n),localStorage.setItem(re,String(n))},pe=e=>{var l;const n=M(e);A.current=n,q.current&&(q.current.style.width=`${n}%`),N.current&&(N.current.style.width=`${100-n}%`),(l=ce.current)==null||l.setAttribute("aria-valuenow",String(Math.round(n)))},fe=e=>{U.current=e,!R.current&&(R.current=requestAnimationFrame(()=>{var l;R.current=0;const n=(l=$.current)==null?void 0:l.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}))},We=e=>{E.current=!0,ie(!0),e.currentTarget.setPointerCapture(e.pointerId),fe(e.clientX)},V=()=>{var e;if(E.current){if(R.current){cancelAnimationFrame(R.current),R.current=0;const n=(e=$.current)==null?void 0:e.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}E.current=!1,j(A.current),localStorage.setItem(re,String(A.current)),ie(!1)}},me=e=>{window.clearTimeout(T.current),F(!0),ae(e),sessionStorage.setItem(J(o),e?"1":"0"),T.current=window.setTimeout(()=>F(!1),ut+40)},he=e=>{K.current=!0,me(e)};s.useEffect(()=>{var e;K.current&&(K.current=!1,(e=u?le.current:N.current)==null||e.focus())},[u]);const ze=e=>{S(e),sessionStorage.setItem(L(o),e)},Le=()=>{S(void 0),sessionStorage.removeItem(L(o)),C(void 0),y("")},ge=((Pe=d.data)==null?void 0:Pe.paper_reader_selection_enabled)===!0,be=e=>{C(e),y(`Selection from page ${e.page} added to chat`),p&&u&&me(!1)},Be=s.useCallback(e=>{C(e),e||y("")},[]),Q=((we=d.data)==null?void 0:we.paper_reader_citations_enabled)===!0&&!!h,z=ee({queryKey:["paper-layout",c],queryFn:()=>at(c),enabled:Q&&!!c,staleTime:5*6e4}).data,He=s.useMemo(()=>Q?{layout:z,open:e=>{const n=z?Je(z,e):[];n.length&&(se(l=>({boxes:n,nonce:((l==null?void 0:l.nonce)??0)+1})),_("paper"))}}:null,[Q,z]),ve=Oe()&&((ye=d.data)==null?void 0:ye.paper_reader_chat_enabled)!==!1,X=!!(t&&ve&&!(f&&!Ae)),Fe=t&&ve&&!X?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&X?a.jsx(ct,{mode:"paper",routeSessionId:x,primaryPaper:{id:t.id,routeId:c,title:t.title},currentPage:()=>D.current,paperSelection:H,onPaperSelectionChange:Be,onSessionId:ze,onReaderSubmit:()=>_("assistant"),onReaderNewChat:Le,onReaderClose:p?()=>he(!0):void 0}):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(Y,{to:"/papers",children:"Browse papers"})]}):((Re=d.data)==null?void 0:Re.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(Y,{to:`/paper/${c}`,children:"Back to paper"})]}):!h&&!f?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(Y,{to:`/paper/${c}`,children:"Back to paper"})]}):a.jsxs("div",{className:"paper-reader-shell",children:[!p&&a.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":P==="paper",onClick:()=>_("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":P==="assistant","aria-label":H&&P!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>_("assistant"),children:["Chat",H&&P!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(Ze,{variant:"reader",children:a.jsxs("div",{ref:$,className:`reader-workspace${p?" is-desktop":" is-tabs"}${u?" is-assistant-collapsed":""}${oe?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:q,className:`reader-paper-pane${!p&&P!=="paper"?" is-hidden":""}`,style:p?{width:u?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!p&&P!=="paper",children:f?a.jsx(dt,{paperId:t.id,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,sourceUrl:f,resources:I,paperVersion:t.version,selectionEnabled:ge,onReady:Ie,onPaperSelection:be,onPaperSelectionError:y}):h&&a.jsx(Ge,{url:h,downloadUrl:v??h,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,onClose:g,resources:I,initialPage:Ne,resizeActive:oe||Me,selectionEnabled:ge,paperVersion:t.version,authors:B,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:be,onPaperSelectionError:y,highlight:ke,onPageChange:e=>{D.current=e,sessionStorage.setItem(Ce(o),String(e))}})}),p&&!u&&a.jsx("div",{ref:ce,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:We,onPointerMove:e=>{E.current&&fe(e.clientX)},onPointerUp:V,onPointerCancel:V,onLostPointerCapture:V,onDoubleClick:()=>W(_e),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:N,id:"reader-chat-panel",className:`reader-assistant-pane${!p&&P!=="assistant"?" is-hidden":""}${p&&u?" is-collapsed":""}`,style:p?{width:u?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!p&&P!=="assistant"||u,tabIndex:-1,children:a.jsx(et.Provider,{value:He,children:Fe})}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:$e}),p&&(u||!X)&&a.jsx("button",{ref:le,type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!u,onClick:()=>he(!u),children:u?"Open chat":"Hide chat"})]})})]})}function sr(){const{paperId:r=""}=Se();return a.jsx(Xe,{workspaceKey:`reader:${r}`,children:a.jsx(vt,{})})}export{sr as default,bt as readerToolbarResources}; +import{r as s,j as a,K as J,u as Se,c as Ue,o as De,Z as je,Q as Oe,L as Z}from"./index-CbgxfyGU.js";import{u as ee}from"./useQuery-Bx9s5-D2.js";import{u as Ve,R as Qe,A as Xe,c as Ze,d as Ye,a as Ge,P as Je,e as et}from"./ArtifactWorkspace-Cwix1Wp6.js";import{M as tt}from"./MarkdownText-Bj-G_S-B.js";import{g as rt,b as at}from"./paperQueryKeys-B8u1BWlI.js";import{w as st,e as nt}from"./paperReader-BIpQD5HO.js";import{a as ot}from"./usePapers-CJaWLZ3y.js";import{c as it}from"./chat-DzTo2WUO.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-DlSbJMKT.js";import"./chatSessions-DwLUbLRo.js";/* empty css */import"./hover-card-ufez2uMo.js";import"./CatalogEntityPreviewLink-Cvehtzvn.js";import"./catalog-DhK7_9-6.js";import"./github-BYklgHDz.js";import"./file-text-BK_7Q2rV.js";import"./PaperPreviewLink-DZDNIh1g.js";import"./index-ZkEATkOr.js";import"./index-BH3yOoza.js";import"./katex-DkKDou_j.js";import"./useMutation-P_trTy9i.js";import"./copy-bzw7JVus.js";import"./thumbs-up-CDCzGuPd.js";import"./arrow-left-Czeu3VzJ.js";import"./external-link-DZIH4GGr.js";import"./plus-UK0TEjgd.js";import"./search-CLtAJGOp.js";import"./chevron-up-Cpt5JLeI.js";import"./AuthorAvatar-CUJMmp_z.js";import"./curation-C7Gmmp4z.js";import"./useInfiniteQuery-BAc_4HO5.js";import"./McpShowcase-CMLfdJM2.js";import"./AgentLogos-BBl9UNVD.js";import"./share-2-hXe4dX_y.js";import"./openrouter-DiuY1sPP.js";import"./queryOptions-C9woPjwX.js";function lt(r){return r instanceof J&&r.status===422?"This page could not be turned into a readable paper.":r instanceof J&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function dt({paperId:r,paperKey:i,paperTitle:o,paperHref:b,sourceUrl:d,resources:t,paperVersion:f="",selectionEnabled:v=!1,onReady:h,onPaperSelection:I,onPaperSelectionError:B}){const c=s.useRef(null),g=ee({queryKey:["paperWebMarkdown",r],queryFn:()=>rt(r),staleTime:5*6e4,retry:(w,j)=>w<2&&!(j instanceof J&&j.status<500),retryDelay:3e3}),x=g.isSuccess;s.useEffect(()=>{x&&(h==null||h())},[h,x]),Ve({enabled:v&&!!f&&x,pagesRoot:c,routeId:i,paperVersion:f,numPages:1,onSelect:I,onError:B});const S=g.data?st(g.data):"";return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Qe,{paperTitle:o,paperHref:b,resources:t,label:"Paper controls",children:a.jsx("div",{className:"pdf-toolbar-controls",children:a.jsx("a",{href:d,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:g.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):g.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:lt(g.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void g.refetch(),children:"Retry"})," ",a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:c,className:"reader-web-document","data-page":"1",children:[!S.startsWith("# ")&&a.jsx("h1",{children:o}),a.jsx(tt,{text:S})]})})})]})}const _e=66,ut=240,re="pwc:reader:split-ratio",L=r=>`pwc:reader:session:${r}`,Y=r=>`pwc:reader:assistant-collapsed:${r}`,Ce=r=>`pwc:reader:page:${r}`;function G(r){const i=Number(sessionStorage.getItem(Ce(r)));return Number.isInteger(i)&&i>0?i:1}function pt(){const r=Number(localStorage.getItem(re));return Number.isFinite(r)&&r>=45&&r<=75?r:_e}function ft(r){const i=te(r);if(!i)return null;const o=new URL(i);return(o.hostname==="arxiv.org"||o.hostname==="www.arxiv.org")&&o.pathname.startsWith("/pdf/")&&o.pathname.endsWith(".pdf")&&(o.pathname=o.pathname.slice(0,-4)),o.href}const mt=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function ht(r){const i=new URL(r),o=i.pathname.match(mt);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&o&&!i.search?je(`/paper-assets/arxiv-pdf/${o[1]}`)??r:r}function gt(r){return new URL(r).hostname.replace(/^www\./,"")}function bt(r){if(!r)return{};const i={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=te(d.url);if(!t)continue;const f=new URL(t),v=f.pathname.split("/").filter(Boolean);if((f.hostname==="github.com"||f.hostname==="www.github.com")&&v.length>=2){i.repository={href:t,stars:d.num_stars||0};break}}const o=[...r.project_pages??[]].sort((d,t)=>Number(t.is_official)-Number(d.is_official));for(const d of o){const t=te(d.url);if(t){i.projectPage={href:t,label:gt(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 vt(){var xe,Pe,we,ye,Re;const r=Ue(),{paperId:i}=Se(),o=De(i??"").replace(/v\d+$/i,""),b=ot(o,!!o),d=ee({queryKey:["chatAvailability"],queryFn:()=>it.getAvailability(),refetchInterval:3e4,retry:!1}),t=b.data,f=t?nt(t):null,v=f?null:(t==null?void 0:t.source)==="external"?je(`/paper-assets/external/${t.id}/paper.pdf`):ft(t==null?void 0:t.url_pdf),h=v&&(t==null?void 0:t.source)!=="external"?ht(v):v,I=bt(t),B=s.useMemo(()=>{var e;return(e=t==null?void 0:t.author_links)==null?void 0:e.flatMap(n=>n.id?[{id:n.id,name:n.name,avatarUrl:n.hf_avatar_url}]:[])},[t==null?void 0:t.author_links]),c=((xe=t==null?void 0:t.arxiv_id)==null?void 0:xe.replace(/v\d+$/i,""))||o,g=s.useCallback(()=>r(`/paper/${c}`),[c,r]),[x,S]=s.useState(()=>sessionStorage.getItem(L(o))||void 0),[w,j]=s.useState(pt),[u,ae]=s.useState(()=>sessionStorage.getItem(Y(o))==="1"),[P,_]=s.useState("paper"),[H,C]=s.useState(),[ke,se]=s.useState(),[Ae,ne]=s.useState(!1),Ie=s.useCallback(()=>ne(!0),[]),[$e,y]=s.useState(""),[Ne,Ee]=s.useState(()=>G(o)),[k,Te]=s.useState(0),[oe,ie]=s.useState(!1),[Me,F]=s.useState(!1),$=s.useRef(null),K=s.useRef(null),N=s.useRef(null),ce=s.useRef(null),le=s.useRef(null),q=s.useRef(!1),E=s.useRef(!1),T=s.useRef(0),R=s.useRef(0),U=s.useRef(0),A=s.useRef(w),D=s.useRef(G(o)),O=s.useRef(t==null?void 0:t.version),de=Ze().reset,ue=s.useRef(`${o}:${x??"new"}`),p=k>=840;s.useEffect(()=>{const e=`${o}:${x??"new"}`;ue.current!==e&&(ue.current=e,de())},[x,de,o]),s.useEffect(()=>{t!=null&&t.version&&O.current&&t.version!==O.current&&(C(void 0),y("")),O.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(T.current),F(!1);const e=sessionStorage.getItem(L(o));S(e||void 0),ae(sessionStorage.getItem(Y(o))==="1"),_("paper"),ne(!1),C(void 0),se(void 0),y("");const n=G(o);D.current=n,Ee(n)},[o]),s.useEffect(()=>()=>{window.clearTimeout(T.current),cancelAnimationFrame(R.current)},[]),s.useLayoutEffect(()=>{const e=$.current;if(!e)return;const n=()=>Te(e.clientWidth);n();const l=new ResizeObserver(n);return l.observe(e),()=>l.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const n=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const l=e.content;e.content="noindex, nofollow";let m=document.querySelector('link[rel="canonical"]');const Ke=!m;m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m));const qe=m.href;return m.href=`${window.location.origin}/paper/${c}`,()=>{document.title="Papers With Code",n?e==null||e.remove():e&&(e.content=l),Ke?m==null||m.remove():m&&(m.href=qe)}},[c,t]);const M=s.useCallback(e=>{if(!k)return Math.max(45,Math.min(75,e));const n=480/k*100,l=100-360/k*100;return Math.max(n,Math.min(l,e))},[k]);s.useEffect(()=>j(e=>{const n=M(e);return A.current=n,n}),[M]);const W=e=>{const n=M(e);A.current=n,j(n),localStorage.setItem(re,String(n))},pe=e=>{var l;const n=M(e);A.current=n,K.current&&(K.current.style.width=`${n}%`),N.current&&(N.current.style.width=`${100-n}%`),(l=ce.current)==null||l.setAttribute("aria-valuenow",String(Math.round(n)))},fe=e=>{U.current=e,!R.current&&(R.current=requestAnimationFrame(()=>{var l;R.current=0;const n=(l=$.current)==null?void 0:l.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}))},We=e=>{E.current=!0,ie(!0),e.currentTarget.setPointerCapture(e.pointerId),fe(e.clientX)},V=()=>{var e;if(E.current){if(R.current){cancelAnimationFrame(R.current),R.current=0;const n=(e=$.current)==null?void 0:e.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}E.current=!1,j(A.current),localStorage.setItem(re,String(A.current)),ie(!1)}},me=e=>{window.clearTimeout(T.current),F(!0),ae(e),sessionStorage.setItem(Y(o),e?"1":"0"),T.current=window.setTimeout(()=>F(!1),ut+40)},he=e=>{q.current=!0,me(e)};s.useEffect(()=>{var e;q.current&&(q.current=!1,(e=u?le.current:N.current)==null||e.focus())},[u]);const ze=e=>{S(e),sessionStorage.setItem(L(o),e)},Le=()=>{S(void 0),sessionStorage.removeItem(L(o)),C(void 0),y("")},ge=((Pe=d.data)==null?void 0:Pe.paper_reader_selection_enabled)===!0,be=e=>{C(e),y(`Selection from page ${e.page} added to chat`),p&&u&&me(!1)},Be=s.useCallback(e=>{C(e),e||y("")},[]),Q=((we=d.data)==null?void 0:we.paper_reader_citations_enabled)===!0&&!!h,z=ee({queryKey:["paper-layout",c],queryFn:()=>at(c),enabled:Q&&!!c,staleTime:5*6e4}).data,He=s.useMemo(()=>Q?{layout:z,open:e=>{const n=z?Ye(z,e):[];n.length&&(se(l=>({boxes:n,nonce:((l==null?void 0:l.nonce)??0)+1})),_("paper"))}}:null,[Q,z]),ve=Oe()&&((ye=d.data)==null?void 0:ye.paper_reader_chat_enabled)!==!1,X=!!(t&&ve&&!(f&&!Ae)),Fe=t&&ve&&!X?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&X?a.jsx(ct,{mode:"paper",routeSessionId:x,primaryPaper:{id:t.id,routeId:c,title:t.title},currentPage:()=>D.current,paperSelection:H,onPaperSelectionChange:Be,onSessionId:ze,onReaderSubmit:()=>_("assistant"),onReaderNewChat:Le,onReaderClose:p?()=>he(!0):void 0}):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(Z,{to:"/papers",children:"Browse papers"})]}):((Re=d.data)==null?void 0:Re.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(Z,{to:`/paper/${c}`,children:"Back to paper"})]}):!h&&!f?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(Z,{to:`/paper/${c}`,children:"Back to paper"})]}):a.jsxs("div",{className:"paper-reader-shell",children:[!p&&a.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":P==="paper",onClick:()=>_("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":P==="assistant","aria-label":H&&P!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>_("assistant"),children:["Chat",H&&P!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(Ge,{variant:"reader",children:a.jsxs("div",{ref:$,className:`reader-workspace${p?" is-desktop":" is-tabs"}${u?" is-assistant-collapsed":""}${oe?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:K,className:`reader-paper-pane${!p&&P!=="paper"?" is-hidden":""}`,style:p?{width:u?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!p&&P!=="paper",children:f?a.jsx(dt,{paperId:t.id,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,sourceUrl:f,resources:I,paperVersion:t.version,selectionEnabled:ge,onReady:Ie,onPaperSelection:be,onPaperSelectionError:y}):h&&a.jsx(Je,{url:h,downloadUrl:v??h,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,onClose:g,resources:I,initialPage:Ne,resizeActive:oe||Me,selectionEnabled:ge,paperVersion:t.version,authors:B,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:be,onPaperSelectionError:y,highlight:ke,onPageChange:e=>{D.current=e,sessionStorage.setItem(Ce(o),String(e))}})}),p&&!u&&a.jsx("div",{ref:ce,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:We,onPointerMove:e=>{E.current&&fe(e.clientX)},onPointerUp:V,onPointerCancel:V,onLostPointerCapture:V,onDoubleClick:()=>W(_e),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:N,id:"reader-chat-panel",className:`reader-assistant-pane${!p&&P!=="assistant"?" is-hidden":""}${p&&u?" is-collapsed":""}`,style:p?{width:u?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!p&&P!=="assistant"||u,tabIndex:-1,children:a.jsx(et.Provider,{value:He,children:Fe})}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:$e}),p&&(u||!X)&&a.jsx("button",{ref:le,type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!u,onClick:()=>he(!u),children:u?"Open chat":"Hide chat"})]})})]})}function sr(){const{paperId:r=""}=Se();return a.jsx(Xe,{workspaceKey:`reader:${r}`,children:a.jsx(vt,{})})}export{sr as default,bt as readerToolbarResources}; diff --git a/assets/PapersListView-zhvzkmK9.js b/assets/PapersListView-DhkGuTns.js similarity index 87% rename from assets/PapersListView-zhvzkmK9.js rename to assets/PapersListView-DhkGuTns.js index 051859d05ca82b4c23b6028ca04d718af12fc876..465be1c8cdbc3d866ab41acd451d754fb830e67d 100644 --- a/assets/PapersListView-zhvzkmK9.js +++ b/assets/PapersListView-DhkGuTns.js @@ -1 +1 @@ -import{r as f,j as e,L as x,g as K}from"./index-YwiKC6Po.js";import{T as V}from"./SotaBadges-DiQuEzfo.js";import{I as H}from"./Icon-DXQ4sjQk.js";import{u as X,P as J,b as W,c as Y,a as Z}from"./PaperFeed-kaLm5US2.js";import{c as ee}from"./catalog-B15Yh5dN.js";import{a as M,p as O}from"./paperQueryKeys-C5FMa4Oj.js";import{t as re,d as se}from"./transform-CNg3rvXk.js";import{u as z}from"./usePapers-C1deOZKl.js";import{u as ae}from"./useDebounce-BFugPTG4.js";import{S as te}from"./skeleton-CXR1qouH.js";import{A as ne,a as ie}from"./alert-Cx5luC5D.js";import{u as oe}from"./useQuery-DPH6Mb2w.js";import{i as le}from"./apiErrors-DBfE_SVR.js";import{f as ce}from"./frameworks-DDA0P4Tf.js";import"./colors-BkWRhvFI.js";import"./PaperCard-FG-bEpJk.js";import"./AuthorAvatar-CoTET6B3.js";import"./LatexTitle-DI6voLfI.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D7ygxg37.js";import"./useIntersectionObserver-Dt36kyjs.js";import"./curation-CkzNFTMJ.js";import"./useInfiniteQuery-BEbL80ez.js";const g=360;function de(s,t){const c=s.toLocaleLowerCase();return t.trim().split(/\s+/).filter(Boolean).reduce((i,l)=>{const o=c.indexOf(l.toLocaleLowerCase());return o>=0&&(i<0||o=0?l+1:t}function me(s,t){if(s.length<=g)return s;const c=de(s,t);if(c<0||c0?"…":""}${s.slice(i,l).trim()}${l{var L,R,D,$,T,A,B,I,q;const s=X(),{searchParams:t,setSearchParams:c}=s,i=t.get("framework")||void 0,l=t.get("repository")||void 0,o=!!(i||l),d=t.get("search")||"",[b,F]=f.useState(d),h=ae(b,300),n=!o&&d.trim().length>0;f.useEffect(()=>F(d),[d]),f.useEffect(()=>{if(h===d)return;const a=new URLSearchParams(t);h?a.set("search",h):a.delete("search"),c(a,{replace:!0})},[h]),f.useEffect(()=>{const a=t.get("order_by"),m=new URLSearchParams(t);n&&!["relevance","date_published","citation_count"].includes(a||"")?(m.set("order_by","relevance"),c(m,{replace:!0})):!n&&a==="relevance"&&(m.delete("order_by"),c(m,{replace:!0}))},[n,t,c]);const j=n&&s.orderBy==="trending"?"relevance":s.orderBy,S=!o&&s.hasCode,P={...s.filters,has_code:S,search:o&&h||void 0,conference:t.get("conference")||void 0,latest_only:t.get("latest_only")!=="false",framework:i,repository:l},k=z([...O.feeds.infinite,P],a=>M.list({...P,page:a,page_size:20}),{enabled:!n}),_={q:h.trim(),order_by:j==="trending"?"relevance":j,start_date:s.dateRange.startDate,end_date:s.dateRange.endDate,has_code:S,has_hf_artifacts:s.hasHfArtifacts},C=z([...O.feeds.search,_],a=>M.searchFeed({..._,page:a,page_size:20,mode:"hybrid"}),{enabled:n&&_.q.length>0}),p=n?C:k,E=oe({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),enabled:!o&&!n,staleTime:10*60*1e3}),v=f.useMemo(()=>{var m;return(((m=p.data)==null?void 0:m.pages.flatMap(N=>N.results))||[]).map(N=>{const w=re(N);return n?{...w,abstract:me(w.abstract,d)}:w})},[p.data,n,d]),u=((D=(R=(L=k.data)==null?void 0:L.pages)==null?void 0:R[0])==null?void 0:D.count)??0,r=(A=(T=($=k.data)==null?void 0:$.pages)==null?void 0:T[0])==null?void 0:A.scope,y=(I=(B=C.data)==null?void 0:B.pages)==null?void 0:I.at(-1),Q=i&&le(p.error),U=(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(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:r.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:o?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:U||i||l})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",d,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:o?(r==null?void 0:r.kind)==="framework"?u>0&&`${u.toLocaleString()} papers.`:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",u>0&&`${u.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${v.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})}),o&&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(H,{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:["★ ",ce(r.num_stars)]})]}):"GitHub"]}),r.kind==="framework"&&r.introducing_paper_arxiv_id&&e.jsx(x,{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(a=>a.slug?e.jsx(V,{slug:a.slug,label:a.name},a.id):null)})]})]}),e.jsx(J,{startDate:s.dateRange.startDate,endDate:s.dateRange.endDate,onChange:s.setDateRange})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(H,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:a=>F(a.target.value)})]})}),e.jsxs("div",{className:o||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!o&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),E.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((a,m)=>e.jsx(te,{className:"h-5 w-full"},m))}),e.jsx("div",{className:"sidebar-links",children:(q=E.data)==null?void 0:q.map(a=>e.jsxs(x,{to:`/tasks/${a.slug}`,className:"sidebar-link",children:[se(a.name,a.slug),a.paper_count!=null&&e.jsx("span",{className:"count",children:a.paper_count})]},a.id))})]})}),e.jsxs("div",{children:[e.jsx(W,{feed:s,sorts:n?pe:Y,activeSort:j,showDateFilter:!1,showHasCode:!o,children:e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})}),Q?e.jsx("div",{className:"no-results",children:"Framework not found."}):e.jsxs(e.Fragment,{children:[p.error&&e.jsx(ne,{variant:"destructive",className:"mb-4",children:e.jsx(ie,{children:"Failed to load papers. Please try again."})}),e.jsx(Z,{query:p,cards:v,skeleton:"card",highlightQuery:n?d:void 0,empty:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"No matching papers."}),n&&K()&&e.jsx(x,{to:`/chat?q=${encodeURIComponent(d.trim())}`,children:"Ask the assistant instead"})]}),children:!p.hasNextPage&&!p.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:y!=null&&y.cap_reached?"End of the top 100 results":"End of results"})})]})]})]})]})};export{Ae as default}; +import{r as f,j as e,L as x,g as K}from"./index-CbgxfyGU.js";import{T as V}from"./SotaBadges-C-sTR-EF.js";import{I as H}from"./Icon-D-kA0Owz.js";import{u as X,P as J,b as W,c as Y,a as Z}from"./PaperFeed-DMvUfA47.js";import{c as ee}from"./catalog-DhK7_9-6.js";import{a as M,p as O}from"./paperQueryKeys-B8u1BWlI.js";import{t as re,d as se}from"./transform-0Udg2p6b.js";import{u as z}from"./usePapers-CJaWLZ3y.js";import{u as ae}from"./useDebounce-DkuI5tkx.js";import{S as te}from"./skeleton-HwvdxvSN.js";import{A as ne,a as ie}from"./alert-CFDDvdIM.js";import{u as oe}from"./useQuery-Bx9s5-D2.js";import{i as le}from"./apiErrors-BZ5h1Kmb.js";import{f as ce}from"./frameworks-DDA0P4Tf.js";import"./colors-BkWRhvFI.js";import"./PaperCard-tdTC_dRN.js";import"./AuthorAvatar-CUJMmp_z.js";import"./LatexTitle-Z-HGmZ-H.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DKJYnYjk.js";import"./useIntersectionObserver-CID9Kkak.js";import"./curation-C7Gmmp4z.js";import"./useInfiniteQuery-BAc_4HO5.js";const g=360;function de(s,t){const c=s.toLocaleLowerCase();return t.trim().split(/\s+/).filter(Boolean).reduce((i,l)=>{const o=c.indexOf(l.toLocaleLowerCase());return o>=0&&(i<0||o=0?l+1:t}function me(s,t){if(s.length<=g)return s;const c=de(s,t);if(c<0||c0?"…":""}${s.slice(i,l).trim()}${l{var L,R,D,$,T,A,B,I,q;const s=X(),{searchParams:t,setSearchParams:c}=s,i=t.get("framework")||void 0,l=t.get("repository")||void 0,o=!!(i||l),d=t.get("search")||"",[b,F]=f.useState(d),h=ae(b,300),n=!o&&d.trim().length>0;f.useEffect(()=>F(d),[d]),f.useEffect(()=>{if(h===d)return;const a=new URLSearchParams(t);h?a.set("search",h):a.delete("search"),c(a,{replace:!0})},[h]),f.useEffect(()=>{const a=t.get("order_by"),m=new URLSearchParams(t);n&&!["relevance","date_published","citation_count"].includes(a||"")?(m.set("order_by","relevance"),c(m,{replace:!0})):!n&&a==="relevance"&&(m.delete("order_by"),c(m,{replace:!0}))},[n,t,c]);const j=n&&s.orderBy==="trending"?"relevance":s.orderBy,S=!o&&s.hasCode,P={...s.filters,has_code:S,search:o&&h||void 0,conference:t.get("conference")||void 0,latest_only:t.get("latest_only")!=="false",framework:i,repository:l},k=z([...O.feeds.infinite,P],a=>M.list({...P,page:a,page_size:20}),{enabled:!n}),_={q:h.trim(),order_by:j==="trending"?"relevance":j,start_date:s.dateRange.startDate,end_date:s.dateRange.endDate,has_code:S,has_hf_artifacts:s.hasHfArtifacts},C=z([...O.feeds.search,_],a=>M.searchFeed({..._,page:a,page_size:20,mode:"hybrid"}),{enabled:n&&_.q.length>0}),p=n?C:k,E=oe({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),enabled:!o&&!n,staleTime:10*60*1e3}),v=f.useMemo(()=>{var m;return(((m=p.data)==null?void 0:m.pages.flatMap(N=>N.results))||[]).map(N=>{const w=re(N);return n?{...w,abstract:me(w.abstract,d)}:w})},[p.data,n,d]),u=((D=(R=(L=k.data)==null?void 0:L.pages)==null?void 0:R[0])==null?void 0:D.count)??0,r=(A=(T=($=k.data)==null?void 0:$.pages)==null?void 0:T[0])==null?void 0:A.scope,y=(I=(B=C.data)==null?void 0:B.pages)==null?void 0:I.at(-1),Q=i&&le(p.error),U=(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(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:r.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:o?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:U||i||l})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",d,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:o?(r==null?void 0:r.kind)==="framework"?u>0&&`${u.toLocaleString()} papers.`:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",u>0&&`${u.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${v.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})}),o&&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(H,{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:["★ ",ce(r.num_stars)]})]}):"GitHub"]}),r.kind==="framework"&&r.introducing_paper_arxiv_id&&e.jsx(x,{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(a=>a.slug?e.jsx(V,{slug:a.slug,label:a.name},a.id):null)})]})]}),e.jsx(J,{startDate:s.dateRange.startDate,endDate:s.dateRange.endDate,onChange:s.setDateRange})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(H,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:a=>F(a.target.value)})]})}),e.jsxs("div",{className:o||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!o&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),E.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((a,m)=>e.jsx(te,{className:"h-5 w-full"},m))}),e.jsx("div",{className:"sidebar-links",children:(q=E.data)==null?void 0:q.map(a=>e.jsxs(x,{to:`/tasks/${a.slug}`,className:"sidebar-link",children:[se(a.name,a.slug),a.paper_count!=null&&e.jsx("span",{className:"count",children:a.paper_count})]},a.id))})]})}),e.jsxs("div",{children:[e.jsx(W,{feed:s,sorts:n?pe:Y,activeSort:j,showDateFilter:!1,showHasCode:!o,children:e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})}),Q?e.jsx("div",{className:"no-results",children:"Framework not found."}):e.jsxs(e.Fragment,{children:[p.error&&e.jsx(ne,{variant:"destructive",className:"mb-4",children:e.jsx(ie,{children:"Failed to load papers. Please try again."})}),e.jsx(Z,{query:p,cards:v,skeleton:"card",highlightQuery:n?d:void 0,empty:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"No matching papers."}),n&&K()&&e.jsx(x,{to:`/chat?q=${encodeURIComponent(d.trim())}`,children:"Ask the assistant instead"})]}),children:!p.hasNextPage&&!p.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:y!=null&&y.cap_reached?"End of the top 100 results":"End of results"})})]})]})]})]})};export{Ae as default}; diff --git a/assets/PrivacyView-B0DBzRMW.js b/assets/PrivacyView-CodFIqUq.js similarity index 99% rename from assets/PrivacyView-B0DBzRMW.js rename to assets/PrivacyView-CodFIqUq.js index f104f41c1f33475fe0e77bb1380c1f92e7036454..232fb279614267d7343c6e0ca303d6ba01b75d53 100644 --- a/assets/PrivacyView-B0DBzRMW.js +++ b/assets/PrivacyView-CodFIqUq.js @@ -1 +1 @@ -import{K as s,j as e}from"./index-YwiKC6Po.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}; +import{M as s,j as e}from"./index-CbgxfyGU.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}; diff --git a/assets/RateLimitsView-JyYAwVUh.js b/assets/RateLimitsView-C9bDo_Dq.js similarity index 87% rename from assets/RateLimitsView-JyYAwVUh.js rename to assets/RateLimitsView-C9bDo_Dq.js index af29cc0c82c99b7b4a2e58c9d68e4bb133ffa8e9..d9069bbd9eb2a2ada6666da03b828e07b194fb36 100644 --- a/assets/RateLimitsView-JyYAwVUh.js +++ b/assets/RateLimitsView-C9bDo_Dq.js @@ -1 +1 @@ -import{j as e,M as t}from"./index-YwiKC6Po.js";import{u as s}from"./useQuery-DPH6Mb2w.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}; +import{j as e,N as t}from"./index-CbgxfyGU.js";import{u as s}from"./useQuery-Bx9s5-D2.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}; diff --git a/assets/ResearchFollowButton-BFXC8E3t.js b/assets/ResearchFollowButton-D2BXlDtQ.js similarity index 89% rename from assets/ResearchFollowButton-BFXC8E3t.js rename to assets/ResearchFollowButton-D2BXlDtQ.js index fd1046acd15d5ca72e8f986f7a94cb750a891d0a..d931106e13a225cc1c94624601829fb06cbbf66a 100644 --- a/assets/ResearchFollowButton-BFXC8E3t.js +++ b/assets/ResearchFollowButton-D2BXlDtQ.js @@ -1 +1 @@ -import{d as y,b as F,f as N,r as S,i as v,j as e,h as C,C as L,L as c}from"./index-YwiKC6Po.js";import{u as G}from"./useQuery-DPH6Mb2w.js";import{u as Q}from"./useMutation-f6iDkf3w.js";import{r as m}from"./research-5UpiU-ea.js";import{P as p}from"./plus-Cfz0QbT1.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 _({kind:a,entityId:t}){var f;const l=y(),s=l==null?void 0:l.user,h=F(),n=N(),[x,g]=S.useState(null),u=`${a}:${t}`,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(t)))??!1,i=Q({mutationFn:()=>m.setFollow(a,t,!o),onSuccess:async()=>{g(o?null:u),await n.invalidateQueries({queryKey:d}),await n.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]}),await n.invalidateQueries({queryKey:["research-email",s==null?void 0:s.hf_subject]})}});if(!l||!s&&v())return null;if(!s)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:C(h.pathname+h.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=i.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||i.isPending,"aria-pressed":o,"aria-label":o?"Unfollow":"Follow",onClick:()=>i.mutate(),children:o?e.jsxs(e.Fragment,{children:[e.jsx(L,{"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(c,{to:"/following",children:"your Following feed"})," · ",e.jsx(c,{to:"/settings",children:"Manage in Settings"})]}):e.jsxs("span",{className:"research-follow-hint",children:[j[a]," in ",e.jsx(c,{to:"/following",children:"your Following feed"}),"."]})]})}export{_ as R}; +import{d as y,b as F,f as N,r as S,i as v,j as e,h as C,C as L,L as c}from"./index-CbgxfyGU.js";import{u as G}from"./useQuery-Bx9s5-D2.js";import{u as Q}from"./useMutation-P_trTy9i.js";import{r as m}from"./research-DgpyzSy_.js";import{P as p}from"./plus-UK0TEjgd.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 _({kind:a,entityId:t}){var f;const l=y(),s=l==null?void 0:l.user,h=F(),n=N(),[x,g]=S.useState(null),u=`${a}:${t}`,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(t)))??!1,i=Q({mutationFn:()=>m.setFollow(a,t,!o),onSuccess:async()=>{g(o?null:u),await n.invalidateQueries({queryKey:d}),await n.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]}),await n.invalidateQueries({queryKey:["research-email",s==null?void 0:s.hf_subject]})}});if(!l||!s&&v())return null;if(!s)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:C(h.pathname+h.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=i.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||i.isPending,"aria-pressed":o,"aria-label":o?"Unfollow":"Follow",onClick:()=>i.mutate(),children:o?e.jsxs(e.Fragment,{children:[e.jsx(L,{"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(c,{to:"/following",children:"your Following feed"})," · ",e.jsx(c,{to:"/settings",children:"Manage in Settings"})]}):e.jsxs("span",{className:"research-follow-hint",children:[j[a]," in ",e.jsx(c,{to:"/following",children:"your Following feed"}),"."]})]})}export{_ as R}; diff --git a/assets/SavedPapersView-CWUM_gRn.js b/assets/SavedPapersView-CewIlVsw.js similarity index 86% rename from assets/SavedPapersView-CWUM_gRn.js rename to assets/SavedPapersView-CewIlVsw.js index 29ec7e89765b30bbf9106094c4edd2d3b89b02f3..30944e07ac02f75c1445175b9e36e2b9e0f98a9b 100644 --- a/assets/SavedPapersView-CWUM_gRn.js +++ b/assets/SavedPapersView-CewIlVsw.js @@ -1 +1 @@ -import{a as g,J as v,j as e,H as x,L as j,M as b}from"./index-YwiKC6Po.js";import{p as f}from"./paperQueryKeys-C5FMa4Oj.js";import{u as N}from"./useQuery-DPH6Mb2w.js";import{P as k}from"./PaperCard-FG-bEpJk.js";import{T as y}from"./SotaBadges-DiQuEzfo.js";import{S as r}from"./skeleton-CXR1qouH.js";import{A as w,a as A}from"./alert-Cx5luC5D.js";import{t as B}from"./transform-CNg3rvXk.js";import{s as F}from"./savedPapersAuth-k5u0Ozsk.js";import"./curation-CkzNFTMJ.js";import"./AuthorAvatar-CoTET6B3.js";import"./Icon-DXQ4sjQk.js";import"./LatexTitle-DI6voLfI.js";import"./safeExternalHref-CkBrsh84.js";import"./colors-BkWRhvFI.js";const M=()=>{var d,l;const{user:i,isLoading:m}=g(),a=N({queryKey:[...f.feeds.saved],queryFn:()=>b.getBookmarks(),enabled:!!i,staleTime:30*1e3,refetchOnWindowFocus:!1}),c=a.error instanceof v&&a.error.code==="saved_papers_bucket_authorization_required",o=!!a.data&&!a.data.bucket_connected,n=()=>{window.location.assign(F())};if(m)return 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"})]});if(!i)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:["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(x,{returnTo:"/saved"})})]});let h=0;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:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(l=a.data)!=null&&l.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${i.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),c?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:n,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(w,{variant:"destructive",className:"mb-4",children:e.jsx(A,{children:"Failed to load your saved papers. Please try again."})}):null,o&&a.data.bucket_migrated?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are already in your private Hugging Face Bucket. Reconnect it in this browser to read from it and save new papers there."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:n,children:"Reconnect Hugging Face Bucket"})]}):o?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:n,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,c||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,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(j,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(t=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:t.name}),t.tasks.map(s=>{const p=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(y,{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:[p," ",p===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(u=>e.jsx(k,{paper:B(u),priority:h++<3},u.id))})]},`task-${t.id??"other"}-${s.id??"untagged"}`)})]},`area-${t.id??"other"}`))]})};export{M as default}; +import{a as g,K as v,j as e,H as x,L as j,N as b}from"./index-CbgxfyGU.js";import{p as f}from"./paperQueryKeys-B8u1BWlI.js";import{u as N}from"./useQuery-Bx9s5-D2.js";import{P as k}from"./PaperCard-tdTC_dRN.js";import{T as y}from"./SotaBadges-C-sTR-EF.js";import{S as r}from"./skeleton-HwvdxvSN.js";import{A as w,a as A}from"./alert-CFDDvdIM.js";import{t as B}from"./transform-0Udg2p6b.js";import{s as F}from"./savedPapersAuth-DsQUuWa_.js";import"./curation-C7Gmmp4z.js";import"./AuthorAvatar-CUJMmp_z.js";import"./Icon-D-kA0Owz.js";import"./LatexTitle-Z-HGmZ-H.js";import"./safeExternalHref-CkBrsh84.js";import"./colors-BkWRhvFI.js";const O=()=>{var d,l;const{user:i,isLoading:m}=g(),a=N({queryKey:[...f.feeds.saved],queryFn:()=>b.getBookmarks(),enabled:!!i,staleTime:30*1e3,refetchOnWindowFocus:!1}),c=a.error instanceof v&&a.error.code==="saved_papers_bucket_authorization_required",o=!!a.data&&!a.data.bucket_connected,n=()=>{window.location.assign(F())};if(m)return 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"})]});if(!i)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:["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(x,{returnTo:"/saved"})})]});let h=0;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:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(l=a.data)!=null&&l.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${i.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),c?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:n,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(w,{variant:"destructive",className:"mb-4",children:e.jsx(A,{children:"Failed to load your saved papers. Please try again."})}):null,o&&a.data.bucket_migrated?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are already in your private Hugging Face Bucket. Reconnect it in this browser to read from it and save new papers there."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:n,children:"Reconnect Hugging Face Bucket"})]}):o?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:n,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,c||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,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(j,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(t=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:t.name}),t.tasks.map(s=>{const p=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(y,{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:[p," ",p===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(u=>e.jsx(k,{paper:B(u),priority:h++<3},u.id))})]},`task-${t.id??"other"}-${s.id??"untagged"}`)})]},`area-${t.id??"other"}`))]})};export{O as default}; diff --git a/assets/SearchOverlay-CzggQ3fk.js b/assets/SearchOverlay-LaDVSpVs.js similarity index 88% rename from assets/SearchOverlay-CzggQ3fk.js rename to assets/SearchOverlay-LaDVSpVs.js index bc611e274fde17343373c76b539307fbd68a4f8a..3210e65e0933339de66efb1096067600adc48cb3 100644 --- a/assets/SearchOverlay-CzggQ3fk.js +++ b/assets/SearchOverlay-LaDVSpVs.js @@ -1 +1 @@ -import{r as z,c as O,K as M,g as B,j as e}from"./index-YwiKC6Po.js";import{p as H,a as R}from"./paperQueryKeys-C5FMa4Oj.js";import{u as i}from"./useQuery-DPH6Mb2w.js";import{L as U}from"./LatexTitle-DI6voLfI.js";import{c as x}from"./catalog-B15Yh5dN.js";import{u as Y}from"./useDebounce-BFugPTG4.js";import{c as G,h as X}from"./colors-BkWRhvFI.js";import{d as Z}from"./transform-CNg3rvXk.js";import"./curation-CkzNFTMJ.js";const V=10,S=6,W=350,f=3,is=({open:t,onClose:h})=>{var A,C,w,K,P,Q;const v=z.useRef(null),$=O(),[c,D]=M.useState(""),a=Y(c,W),j=c.trim(),r=a.trim().length>=f,y=B();z.useEffect(()=>{var l;if(!t)return;(l=v.current)==null||l.focus();const s=N=>{N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),h())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,h]);const k=i({queryKey:[...H.feeds.searchOverlay,a],queryFn:()=>R.search(a,1,V),enabled:t&&r,staleTime:6e4,retry:!1}),_=i({queryKey:["search-tasks",a],queryFn:()=>x.listTasks({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),b=i({queryKey:["search-methods",a],queryFn:()=>x.listMethods({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),E=i({queryKey:["search-benchmarks",a],queryFn:()=>x.listDatasets({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),F=i({queryKey:["search-authors",a],queryFn:()=>R.searchAuthors(a,S),enabled:t&&r,staleTime:6e4,retry:!1}),q=i({queryKey:["search-organizations",a],queryFn:()=>x.searchOrganizations(a,S),enabled:t&&r,staleTime:6e4,retry:!1});if(!t)return null;const o=((A=_.data)==null?void 0:A.results)||[],d=((C=b.data)==null?void 0:C.results)||[],m=((w=E.data)==null?void 0:w.results)||[],u=((K=F.data)==null?void 0:K.results)||[],p=((P=q.data)==null?void 0:P.results)||[],g=((Q=k.data)==null?void 0:Q.results)||[],I=k.isFetching||_.isFetching||b.isFetching||E.isFetching||F.isFetching||q.isFetching,L=o.length||g.length||d.length||m.length||u.length||p.length,n=s=>{h(),$(s)},T=()=>{const s=c.trim();s&&n(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:h,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, benchmarks, authors, or organizations…",value:c,onChange:s=>D(s.target.value),onKeyDown:s=>{y&&s.key==="Enter"&&(s.preventDefault(),T())}}),e.jsxs("div",{className:"search-results",children:[y&&c.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:T,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",y&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!r&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",f," characters."]}),r&&!I&&!L&&e.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(s=>{const l=G(X(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:l.dot}}),e.jsx("span",{className:"name",children:Z(s.name,s.slug)}),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:["Methods · ",d.length]}),d.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/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))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",m.length]}),m.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/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))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",u.length]}),u.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/authors/${s.id}`),children:[e.jsx("span",{className:"name",children:s.full_name}),s.hf_username&&e.jsxs("span",{className:"handle",children:["@",s.hf_username]}),s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),p.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Organizations · ",p.length]}),p.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/orgs/${s.slug}`),children:[s.logo_url&&e.jsx("img",{className:"logo",src:s.logo_url,alt:"",loading:"lazy"}),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," papers"]})]},s.id))]}),g.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",g.length]}),g.map(s=>{var l;return e.jsxs("div",{className:"search-result",onClick:()=>n(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(U,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((l=s.authors)==null?void 0:l[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)})]}),j.length>=f&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>n(`/papers?search=${encodeURIComponent(j)}`),children:["View all paper results for “",j,"”"]})]})]})})};export{is as default}; +import{r as K,c as M,M as O,g as B,j as e}from"./index-CbgxfyGU.js";import{p as H,a as R}from"./paperQueryKeys-B8u1BWlI.js";import{u as i}from"./useQuery-Bx9s5-D2.js";import{L as U}from"./LatexTitle-Z-HGmZ-H.js";import{c as x}from"./catalog-DhK7_9-6.js";import{u as Y}from"./useDebounce-DkuI5tkx.js";import{c as G,h as X}from"./colors-BkWRhvFI.js";import{d as Z}from"./transform-0Udg2p6b.js";import"./curation-C7Gmmp4z.js";const V=10,S=6,W=350,f=3,is=({open:t,onClose:h})=>{var A,C,w,P,Q,z;const v=K.useRef(null),$=M(),[c,D]=O.useState(""),a=Y(c,W),j=c.trim(),r=a.trim().length>=f,y=B();K.useEffect(()=>{var l;if(!t)return;(l=v.current)==null||l.focus();const s=N=>{N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),h())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,h]);const k=i({queryKey:[...H.feeds.searchOverlay,a],queryFn:()=>R.search(a,1,V),enabled:t&&r,staleTime:6e4,retry:!1}),_=i({queryKey:["search-tasks",a],queryFn:()=>x.listTasks({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),b=i({queryKey:["search-methods",a],queryFn:()=>x.listMethods({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),E=i({queryKey:["search-benchmarks",a],queryFn:()=>x.listDatasets({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),F=i({queryKey:["search-authors",a],queryFn:()=>R.searchAuthors(a,S),enabled:t&&r,staleTime:6e4,retry:!1}),q=i({queryKey:["search-organizations",a],queryFn:()=>x.searchOrganizations(a,S),enabled:t&&r,staleTime:6e4,retry:!1});if(!t)return null;const o=((A=_.data)==null?void 0:A.results)||[],d=((C=b.data)==null?void 0:C.results)||[],m=((w=E.data)==null?void 0:w.results)||[],u=((P=F.data)==null?void 0:P.results)||[],p=((Q=q.data)==null?void 0:Q.results)||[],g=((z=k.data)==null?void 0:z.results)||[],I=k.isFetching||_.isFetching||b.isFetching||E.isFetching||F.isFetching||q.isFetching,L=o.length||g.length||d.length||m.length||u.length||p.length,n=s=>{h(),$(s)},T=()=>{const s=c.trim();s&&n(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:h,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, benchmarks, authors, or organizations…",value:c,onChange:s=>D(s.target.value),onKeyDown:s=>{y&&s.key==="Enter"&&(s.preventDefault(),T())}}),e.jsxs("div",{className:"search-results",children:[y&&c.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:T,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",y&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!r&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",f," characters."]}),r&&!I&&!L&&e.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(s=>{const l=G(X(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:l.dot}}),e.jsx("span",{className:"name",children:Z(s.name,s.slug)}),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:["Methods · ",d.length]}),d.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/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))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",m.length]}),m.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/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))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",u.length]}),u.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/authors/${s.id}`),children:[e.jsx("span",{className:"name",children:s.full_name}),s.hf_username&&e.jsxs("span",{className:"handle",children:["@",s.hf_username]}),s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),p.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Organizations · ",p.length]}),p.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/orgs/${s.slug}`),children:[s.logo_url&&e.jsx("img",{className:"logo",src:s.logo_url,alt:"",loading:"lazy"}),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," papers"]})]},s.id))]}),g.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",g.length]}),g.map(s=>{var l;return e.jsxs("div",{className:"search-result",onClick:()=>n(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(U,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((l=s.authors)==null?void 0:l[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)})]}),j.length>=f&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>n(`/papers?search=${encodeURIComponent(j)}`),children:["View all paper results for “",j,"”"]})]})]})})};export{is as default}; diff --git a/assets/SettingsView-BurbOJNZ.js b/assets/SettingsView-C0A-yv3U.js similarity index 93% rename from assets/SettingsView-BurbOJNZ.js rename to assets/SettingsView-C0A-yv3U.js index 904f76560b20b401aba9d321e71b4ccef3ef37f1..98c71adab7aa0a696191222e14213e3d751246c3 100644 --- a/assets/SettingsView-BurbOJNZ.js +++ b/assets/SettingsView-C0A-yv3U.js @@ -1,4 +1,4 @@ -import{n as C,a as T,b as le,r as A,j as e,L as q,f as Q,H as R,h as ce,q as de,ap as he,g as ue,K as S,J as ne}from"./index-YwiKC6Po.js";import{u as O}from"./useQuery-DPH6Mb2w.js";import{u as _}from"./useMutation-f6iDkf3w.js";import{T as ee,r as M}from"./research-5UpiU-ea.js";import{S as z}from"./switch-Crqp0RkL.js";import{u as ge}from"./researchTopic-CAL_T-Y-.js";import{S as me}from"./sparkles-C3L7JDLC.js";import{A as pe}from"./arrow-right-CSx7rJG4.js";import{T as fe}from"./trophy-B60aAfG3.js";import{c as F}from"./chat-DHGOonJg.js";import{f as ye,D as xe}from"./latexPlainText-DI8YEXVe.js";import{a as je,u as be,r as ve,O as Y}from"./openrouter-BT3NQ0bL.js";import{E as se}from"./external-link-4bBJT0yO.js";import{M as we}from"./moon-DfjUzC9G.js";import"./index-BaDZKp6X.js";/** +import{n as C,a as q,b as le,r as A,j as e,L as T,f as Q,H as R,h as ce,q as de,aq as he,g as ue,M as S,K as ne}from"./index-CbgxfyGU.js";import{u as O}from"./useQuery-Bx9s5-D2.js";import{u as _}from"./useMutation-P_trTy9i.js";import{T as ee,r as M}from"./research-DgpyzSy_.js";import{S as z}from"./switch-BSZohE4x.js";import{u as ge}from"./researchTopic-CteUev4M.js";import{S as me}from"./sparkles-BqBXJPmy.js";import{A as pe}from"./arrow-right-DotD9yNb.js";import{T as fe}from"./trophy-BQwEH3L7.js";import{c as F}from"./chat-DzTo2WUO.js";import{f as ye,D as xe}from"./latexPlainText-DI8YEXVe.js";import{a as je,u as be,r as ve,O as Y}from"./openrouter-DiuY1sPP.js";import{E as se}from"./external-link-DZIH4GGr.js";import{M as we}from"./moon-BVv5zopc.js";import"./index-CxPKwmVQ.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -33,4 +33,4 @@ import{n as C,a as T,b as le,r as A,j as e,L as q,f as Q,H as R,h as ce,q as de, * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ee=C("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={task:"task",method:"method",benchmark:"benchmark",author:"author",organization:"organization"};function Me(s){return s.status==="failed"?"We could not finish finding papers for this topic. Save it again to retry.":s.status==="done"?"Matching papers appear in your Following feed, and new ones are added every hour.":s.total?`Your feed shows the closest papers now. Refining matches: ${s.judged.toLocaleString()} of ${s.total.toLocaleString()} checked…`:"Your feed shows the closest papers now. Refining matches…"}function Oe(){var E,w,k;const{user:s}=T(),l=le(),h=A.useRef(null),j=["research-topic",s==null?void 0:s.hf_subject],d=O({queryKey:j,queryFn:M.topic,enabled:!!s,refetchInterval:i=>i.state.data&&["pending","running"].includes(i.state.data.status)?5e3:!1}),[f,y]=A.useState(null),a=ge(()=>y(null));if(A.useEffect(()=>{var i,N;l.hash==="#topic"&&d.isSuccess&&((i=h.current)==null||i.scrollIntoView({block:"center"}),(N=h.current)==null||N.focus())},[l.hash,d.isSuccess]),!s)return null;const c=((E=d.data)==null?void 0:E.text)??"",t=f??c,u=t.trim().replace(/\s+/g," "),g=((w=d.data)==null?void 0:w.status)==="failed"&&u===c,o=u.length>=3&&(u!==c||g),r=()=>{o&&!a.isPending&&a.mutate(u)};return e.jsxs("div",{className:"research-topic",id:"topic",children:[e.jsxs("h3",{className:"research-follow-group-title",children:[e.jsx(me,{"aria-hidden":"true"}),"Topic"]}),e.jsxs("p",{className:"settings-row-desc",children:["Describe the research you want to follow in your own words, for example"," ",e.jsx("em",{children:"real-time video generation"})," or ",e.jsx("em",{children:"speculative decoding for LLM inference"}),". A model reads every new paper and adds the ones that match to your Following feed."]}),d.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading your topic…"}):d.error?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load your topic."}):e.jsxs("form",{className:"research-topic-form",onSubmit:i=>{i.preventDefault(),r()},children:[e.jsx("textarea",{ref:h,className:"research-topic-input",rows:4,maxLength:ee,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation",value:t,onChange:i=>y(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&(i.preventDefault(),r())}}),e.jsxs("div",{className:"research-topic-actions",children:[e.jsxs("span",{className:"research-topic-count",children:[t.length,"/",ee]}),c&&e.jsx("button",{type:"button",className:"research-follow-action",disabled:a.isPending,onClick:()=>a.mutate(null),children:"Remove"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:a.isPending||!o,children:g?"Retry":c?"Update topic":"Follow topic"})]})]}),d.data&&e.jsx("p",{className:"research-email-status",role:"status",children:Me(d.data)}),(k=d.data)==null?void 0:k.suggestions.map(i=>e.jsxs("p",{className:"research-topic-suggestion",children:[e.jsx(q,{to:i.url,children:i.name})," is a ",Se[i.kind]," in the catalog. Following it as well adds every paper tagged with it."]},`${i.kind}:${i.entity_id}`)),a.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your topic. Please try again."})]})}const ae=[{kind:"task",label:"Tasks",icon:Ce,browse:"/tasks"},{kind:"method",label:"Methods",icon:Ne,browse:"/methods"},{kind:"benchmark",label:"Benchmarks",icon:fe},{kind:"author",label:"Authors",icon:Ee},{kind:"organization",label:"Organizations",icon:ke,browse:"/organizations"}],v=s=>`${s.kind}:${s.entity_id}`,Le=s=>new Date(s).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});function Pe({follows:s}){const{user:l}=T(),h=Q(),[j,d]=A.useState([]),f=_({mutationFn:({follow:c,enabled:t})=>M.setFollow(c.kind,c.entity_id,t),onSuccess:(c,{follow:t,enabled:u})=>{const g=["research-follows",l==null?void 0:l.hf_subject];h.setQueryData(g,o=>u?[...o??[],t]:(o??[]).filter(r=>v(r)!==v(t))),d(o=>[...o.filter(r=>v(r)!==v(t)),...u?[]:[t]]),h.invalidateQueries({queryKey:g}),h.invalidateQueries({queryKey:["research-feed",l==null?void 0:l.hf_subject]})}}),y=new Set(s.map(v)),a=[...s,...j.filter(c=>!y.has(v(c)))];return a.length?e.jsxs(e.Fragment,{children:[ae.map(({kind:c,label:t,icon:u})=>{const g=a.filter(o=>o.kind===c).sort((o,r)=>o.name.localeCompare(r.name));return g.length?e.jsxs("div",{className:"research-follow-group",children:[e.jsxs("h3",{className:"research-follow-group-title",children:[e.jsx(u,{"aria-hidden":"true"}),t]}),e.jsx("ul",{className:"research-follow-list",children:g.map(o=>{const r=y.has(v(o));return e.jsxs("li",{className:r?"research-follow-row":"research-follow-row is-unfollowed",children:[e.jsxs("div",{className:"research-follow-text",children:[e.jsx(q,{to:o.url,children:o.name}),e.jsx("span",{children:r?`Following since ${Le(o.created_at)}`:"Unfollowed"})]}),e.jsx("button",{type:"button",className:r?"research-follow-action":"research-follow-action is-refollow",disabled:f.isPending,"aria-label":`${r?"Unfollow":"Follow"} ${o.name}`,onClick:()=>f.mutate({follow:o,enabled:!r}),children:r?"Unfollow":"Follow again"})]},v(o))})})]},c):null}),f.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not update follows. Please try again."})]}):e.jsx(Ie,{})}function Ie(){return e.jsxs("div",{className:"research-follow-empty",children:[e.jsx("p",{children:e.jsx("strong",{children:"You are not following any tasks, methods, benchmarks, authors, or organizations 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:ae.filter(s=>s.browse).map(({kind:s,label:l,icon:h,browse:j})=>e.jsxs(q,{to:j,children:[e.jsx(h,{"aria-hidden":"true"}),"Browse ",l.toLowerCase()]},s))})]})}function Ae(){var t;const{user:s}=T(),l=Q(),h=O({queryKey:["research-follows",s==null?void 0:s.hf_subject],queryFn:M.follows,enabled:!!s}),j=["research-email",s==null?void 0:s.hf_subject],d=O({queryKey:j,queryFn:M.email,enabled:!!s}),f=_({mutationFn:M.setEmail,onSuccess:u=>l.setQueryData(j,u)}),y=((t=h.data)==null?void 0:t.length)??0,a=d.data,c=!!(a!=null&&a.email)&&!a.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",y>0&&e.jsx("span",{className:"research-follow-count",children:y})]}),s&&e.jsxs(q,{className:"research-feed-link",to:"/following",children:["Open Following feed ",e.jsx(pe,{"aria-hidden":"true"})]})]}),e.jsx("p",{className:"settings-row-desc research-section-intro",children:"New papers and benchmark results from your topic and what you follow appear in your Following feed. Your topic and follows are private."}),s?h.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading follows…"}):h.error?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load your follows."}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{}),e.jsx(Pe,{follows:h.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(R,{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"}),d.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading email preferences…"}):d.error||!a?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. On by default once you follow something; turn it off here or from any email."})]}),e.jsx(z,{id:"research-weekly-email",checked:a.enabled,disabled:f.isPending||!a.enabled&&!c,onCheckedChange:u=>f.mutate(u)})]}),e.jsxs("div",{className:"research-email-destination",children:[e.jsx(Fe,{"aria-hidden":"true"}),a.email?e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:["Sending to ",e.jsx("strong",{children:a.email})]}),e.jsx("a",{href:ce("/settings",{collectEmail:!0}),children:"Refresh from Hugging Face"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"To receive it, allow access to the verified email on your Hugging Face account."}),e.jsx(R,{returnTo:"/settings",collectEmail:!0,label:"Allow email access"})]})]}),a.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."}),!a.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."}),f.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 Te="https://openrouter.ai/settings/keys";function qe(s,l){if(s instanceof ne){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:l}const es=()=>{var J;const{user:s,isLoading:l}=T(),{preferences:h,setHideClosedSourceEvals:j,canPersist:d,isLoading:f}=de(),{theme:y,setTheme:a}=he(),c=y??"system",t=ue(),[u,g]=S.useState(""),[o,r]=S.useState(""),[E,w]=S.useState(""),[k,i]=S.useState(""),N=Q(),L=O({queryKey:["chat","models","settings"],enabled:t&&!!s,queryFn:()=>F.getModels()}),D=new Set((((J=L.data)==null?void 0:J.items)??[]).map(n=>n.provider)),H=D.has("huggingface"),P=D.has("openrouter"),te=D.has("openai"),I=O({queryKey:["inference-billing",s==null?void 0:s.hf_subject],enabled:t&&!!s&&H,queryFn:()=>F.getInferenceBilling()}),x=I.data??null,U=je(t&&!!s&&P),W=be(t&&!!s&&P),m=U.data,b=W.data,p=m?ve(m.resets_at):null,ie=t&&!!s&&(L.isLoading||!L.isError&&(H&&I.isLoading||P&&(U.isLoading||W.isLoading))),oe=l||f||y===void 0||ie,V=_({mutationFn:n=>F.selectInferenceBillingAccount(n),onSuccess:n=>{N.setQueryData(["inference-billing",s==null?void 0:s.hf_subject],n),g("")},onError:n=>{g(n instanceof Error?n.message:"Could not change the billing account.")}}),re=I.isLoading||V.isPending,K=(n,B)=>{r(qe(n,B)),w(n instanceof ne?n.code??"":"")},$=_({mutationFn:n=>F.connectOpenRouterCredential(n),onSuccess:n=>{N.setQueryData(Y,n),i(""),r(""),w("")},onError:n=>K(n,"Could not connect the OpenRouter key.")}),G=_({mutationFn:n=>F.setOpenRouterFallback(n),onSuccess:n=>{N.setQueryData(Y,n),r(""),w("")},onError:n=>K(n,"Could not change paid fallback.")}),X=_({mutationFn:()=>F.disconnectOpenRouterCredential(),onSuccess:()=>{N.setQueryData(Y,{connected:!1,verified_at:null,fallback_enabled:!1}),r(""),w("")},onError:n=>K(n,"Could not disconnect the OpenRouter key.")});return S.useEffect(()=>(document.title=ye("Settings"),()=>{document.title=xe}),[]),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."})]})}),oe?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(Ae,{}),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."]})})]}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),s?L.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:[H&&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"})]}),(x==null?void 0:x.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),I.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Hugging Face billing is currently unavailable."}):x!=null&&x.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:x.bill_to?`Organization · ${x.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:x.bill_to??"",onChange:n=>{g(""),V.mutate(n.target.value||null)},disabled:re,children:[e.jsxs("option",{value:"",children:["Personal account (@",s.username,")"]}),x.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:x.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(se,{"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(R,{returnTo:"/settings",label:"Re-sign in with Hugging Face",authorizeInference:!0})})]})]}),P&&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"})]}),(b==null?void 0:b.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."}),m?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 ",p==null?void 0:p.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",p==null?void 0:p.utc,")"]})]})]}),e.jsx("strong",{children:m.available?`${m.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${m.remaining_percent}% remaining; resets ${p==null?void 0:p.local}; ${p==null?void 0:p.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m.remaining_percent,children:e.jsx("span",{style:{width:`${m.remaining_percent}%`}})}),!m.available&&e.jsxs("p",{className:"settings-limit-note",children:[m.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${m.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:U.isError||m?"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"}),b!=null&&b.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",b.verified_at?` · Last verified ${new Date(b.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(z,{checked:b.fallback_enabled,disabled:G.isPending,onCheckedChange:n=>G.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:X.isPending,onClick:()=>X.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:Te,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(se,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:n=>{n.preventDefault(),k.trim()&&$.mutate(k.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:k,onChange:n=>i(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:!k.trim()||$.isPending,children:$.isPending?"Verifying…":"Connect key"})})]}),o&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:E==="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.":o}),E==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(R,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]}),te&&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(R,{returnTo:"/settings",authorizeInference:!0})})]})]}),t&&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:Re},{value:"light",label:"Light",description:"Always use light mode",icon:_e},{value:"dark",label:"Dark",description:"Always use dark mode",icon:we}].map(n=>{const B=n.icon,Z=c===n.value;return e.jsxs("button",{type:"button",className:`theme-option ${Z?"is-selected":""}`,"aria-pressed":Z,onClick:()=>a(n.value),children:[e.jsx(B,{"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(z,{id:"hide-closed-source-evals",checked:h.hide_closed_source_evals,onCheckedChange:n=>{j(!!n)}})]}),!l&&!d&&!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(R,{returnTo:"/settings"})})]})]})]})]})};export{es as default}; + */const Ee=C("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={task:"task",method:"method",benchmark:"benchmark",author:"author",organization:"organization"};function Me(s){return s.status==="failed"?"We could not finish finding papers for this topic. Save it again to retry.":s.status==="done"?"Matching papers appear in your Following feed, and new ones are added every hour.":s.total?`Your feed shows the closest papers now. Refining matches: ${s.judged.toLocaleString()} of ${s.total.toLocaleString()} checked…`:"Your feed shows the closest papers now. Refining matches…"}function Oe(){var E,w,k;const{user:s}=q(),l=le(),h=A.useRef(null),j=["research-topic",s==null?void 0:s.hf_subject],d=O({queryKey:j,queryFn:M.topic,enabled:!!s,refetchInterval:i=>i.state.data&&["pending","running"].includes(i.state.data.status)?5e3:!1}),[f,y]=A.useState(null),a=ge(()=>y(null));if(A.useEffect(()=>{var i,N;l.hash==="#topic"&&d.isSuccess&&((i=h.current)==null||i.scrollIntoView({block:"center"}),(N=h.current)==null||N.focus())},[l.hash,d.isSuccess]),!s)return null;const c=((E=d.data)==null?void 0:E.text)??"",t=f??c,u=t.trim().replace(/\s+/g," "),g=((w=d.data)==null?void 0:w.status)==="failed"&&u===c,o=u.length>=3&&(u!==c||g),r=()=>{o&&!a.isPending&&a.mutate(u)};return e.jsxs("div",{className:"research-topic",id:"topic",children:[e.jsxs("h3",{className:"research-follow-group-title",children:[e.jsx(me,{"aria-hidden":"true"}),"Topic"]}),e.jsxs("p",{className:"settings-row-desc",children:["Describe the research you want to follow in your own words, for example"," ",e.jsx("em",{children:"real-time video generation"})," or ",e.jsx("em",{children:"speculative decoding for LLM inference"}),". A model reads every new paper and adds the ones that match to your Following feed."]}),d.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading your topic…"}):d.error?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load your topic."}):e.jsxs("form",{className:"research-topic-form",onSubmit:i=>{i.preventDefault(),r()},children:[e.jsx("textarea",{ref:h,className:"research-topic-input",rows:4,maxLength:ee,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation",value:t,onChange:i=>y(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&(i.preventDefault(),r())}}),e.jsxs("div",{className:"research-topic-actions",children:[e.jsxs("span",{className:"research-topic-count",children:[t.length,"/",ee]}),c&&e.jsx("button",{type:"button",className:"research-follow-action",disabled:a.isPending,onClick:()=>a.mutate(null),children:"Remove"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:a.isPending||!o,children:g?"Retry":c?"Update topic":"Follow topic"})]})]}),d.data&&e.jsx("p",{className:"research-email-status",role:"status",children:Me(d.data)}),(k=d.data)==null?void 0:k.suggestions.map(i=>e.jsxs("p",{className:"research-topic-suggestion",children:[e.jsx(T,{to:i.url,children:i.name})," is a ",Se[i.kind]," in the catalog. Following it as well adds every paper tagged with it."]},`${i.kind}:${i.entity_id}`)),a.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your topic. Please try again."})]})}const ae=[{kind:"task",label:"Tasks",icon:Ce,browse:"/tasks"},{kind:"method",label:"Methods",icon:Ne,browse:"/methods"},{kind:"benchmark",label:"Benchmarks",icon:fe},{kind:"author",label:"Authors",icon:Ee},{kind:"organization",label:"Organizations",icon:ke,browse:"/organizations"}],v=s=>`${s.kind}:${s.entity_id}`,Le=s=>new Date(s).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});function Pe({follows:s}){const{user:l}=q(),h=Q(),[j,d]=A.useState([]),f=_({mutationFn:({follow:c,enabled:t})=>M.setFollow(c.kind,c.entity_id,t),onSuccess:(c,{follow:t,enabled:u})=>{const g=["research-follows",l==null?void 0:l.hf_subject];h.setQueryData(g,o=>u?[...o??[],t]:(o??[]).filter(r=>v(r)!==v(t))),d(o=>[...o.filter(r=>v(r)!==v(t)),...u?[]:[t]]),h.invalidateQueries({queryKey:g}),h.invalidateQueries({queryKey:["research-feed",l==null?void 0:l.hf_subject]})}}),y=new Set(s.map(v)),a=[...s,...j.filter(c=>!y.has(v(c)))];return a.length?e.jsxs(e.Fragment,{children:[ae.map(({kind:c,label:t,icon:u})=>{const g=a.filter(o=>o.kind===c).sort((o,r)=>o.name.localeCompare(r.name));return g.length?e.jsxs("div",{className:"research-follow-group",children:[e.jsxs("h3",{className:"research-follow-group-title",children:[e.jsx(u,{"aria-hidden":"true"}),t]}),e.jsx("ul",{className:"research-follow-list",children:g.map(o=>{const r=y.has(v(o));return e.jsxs("li",{className:r?"research-follow-row":"research-follow-row is-unfollowed",children:[e.jsxs("div",{className:"research-follow-text",children:[e.jsx(T,{to:o.url,children:o.name}),e.jsx("span",{children:r?`Following since ${Le(o.created_at)}`:"Unfollowed"})]}),e.jsx("button",{type:"button",className:r?"research-follow-action":"research-follow-action is-refollow",disabled:f.isPending,"aria-label":`${r?"Unfollow":"Follow"} ${o.name}`,onClick:()=>f.mutate({follow:o,enabled:!r}),children:r?"Unfollow":"Follow again"})]},v(o))})})]},c):null}),f.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not update follows. Please try again."})]}):e.jsx(Ie,{})}function Ie(){return e.jsxs("div",{className:"research-follow-empty",children:[e.jsx("p",{children:e.jsx("strong",{children:"You are not following any tasks, methods, benchmarks, authors, or organizations 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:ae.filter(s=>s.browse).map(({kind:s,label:l,icon:h,browse:j})=>e.jsxs(T,{to:j,children:[e.jsx(h,{"aria-hidden":"true"}),"Browse ",l.toLowerCase()]},s))})]})}function Ae(){var t;const{user:s}=q(),l=Q(),h=O({queryKey:["research-follows",s==null?void 0:s.hf_subject],queryFn:M.follows,enabled:!!s}),j=["research-email",s==null?void 0:s.hf_subject],d=O({queryKey:j,queryFn:M.email,enabled:!!s}),f=_({mutationFn:M.setEmail,onSuccess:u=>l.setQueryData(j,u)}),y=((t=h.data)==null?void 0:t.length)??0,a=d.data,c=!!(a!=null&&a.email)&&!a.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",y>0&&e.jsx("span",{className:"research-follow-count",children:y})]}),s&&e.jsxs(T,{className:"research-feed-link",to:"/following",children:["Open Following feed ",e.jsx(pe,{"aria-hidden":"true"})]})]}),e.jsx("p",{className:"settings-row-desc research-section-intro",children:"New papers and benchmark results from your topic and what you follow appear in your Following feed. Your topic and follows are private."}),s?h.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading follows…"}):h.error?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load your follows."}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{}),e.jsx(Pe,{follows:h.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(R,{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"}),d.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading email preferences…"}):d.error||!a?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. On by default once you follow something; turn it off here or from any email."})]}),e.jsx(z,{id:"research-weekly-email",checked:a.enabled,disabled:f.isPending||!a.enabled&&!c,onCheckedChange:u=>f.mutate(u)})]}),e.jsxs("div",{className:"research-email-destination",children:[e.jsx(Fe,{"aria-hidden":"true"}),a.email?e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:["Sending to ",e.jsx("strong",{children:a.email})]}),e.jsx("a",{href:ce("/settings",{collectEmail:!0}),children:"Refresh from Hugging Face"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"To receive it, allow access to the verified email on your Hugging Face account."}),e.jsx(R,{returnTo:"/settings",collectEmail:!0,label:"Allow email access"})]})]}),a.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."}),!a.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."}),f.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 qe="https://openrouter.ai/settings/keys";function Te(s,l){if(s instanceof ne){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:l}const es=()=>{var Z;const{user:s,isLoading:l}=q(),{preferences:h,setHideClosedSourceEvals:j,canPersist:d,isLoading:f}=de(),{theme:y,setTheme:a}=he(),c=y??"system",t=ue(),[u,g]=S.useState(""),[o,r]=S.useState(""),[E,w]=S.useState(""),[k,i]=S.useState(""),N=Q(),L=O({queryKey:["chat","models","settings"],enabled:t&&!!s,queryFn:()=>F.getModels()}),D=new Set((((Z=L.data)==null?void 0:Z.items)??[]).map(n=>n.provider)),H=D.has("huggingface"),P=D.has("openrouter"),te=D.has("openai"),I=O({queryKey:["inference-billing",s==null?void 0:s.hf_subject],enabled:t&&!!s&&H,queryFn:()=>F.getInferenceBilling()}),x=I.data??null,U=je(t&&!!s&&P),W=be(t&&!!s&&P),m=U.data,b=W.data,p=m?ve(m.resets_at):null,ie=t&&!!s&&(L.isLoading||!L.isError&&(H&&I.isLoading||P&&(U.isLoading||W.isLoading))),oe=l||f||y===void 0||ie,V=_({mutationFn:n=>F.selectInferenceBillingAccount(n),onSuccess:n=>{N.setQueryData(["inference-billing",s==null?void 0:s.hf_subject],n),g("")},onError:n=>{g(n instanceof Error?n.message:"Could not change the billing account.")}}),re=I.isLoading||V.isPending,K=(n,B)=>{r(Te(n,B)),w(n instanceof ne?n.code??"":"")},$=_({mutationFn:n=>F.connectOpenRouterCredential(n),onSuccess:n=>{N.setQueryData(Y,n),i(""),r(""),w("")},onError:n=>K(n,"Could not connect the OpenRouter key.")}),G=_({mutationFn:n=>F.setOpenRouterFallback(n),onSuccess:n=>{N.setQueryData(Y,n),r(""),w("")},onError:n=>K(n,"Could not change paid fallback.")}),X=_({mutationFn:()=>F.disconnectOpenRouterCredential(),onSuccess:()=>{N.setQueryData(Y,{connected:!1,verified_at:null,fallback_enabled:!1}),r(""),w("")},onError:n=>K(n,"Could not disconnect the OpenRouter key.")});return S.useEffect(()=>(document.title=ye("Settings"),()=>{document.title=xe}),[]),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."})]})}),oe?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(Ae,{}),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."]})})]}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),s?L.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:[H&&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"})]}),(x==null?void 0:x.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),I.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Hugging Face billing is currently unavailable."}):x!=null&&x.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:x.bill_to?`Organization · ${x.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:x.bill_to??"",onChange:n=>{g(""),V.mutate(n.target.value||null)},disabled:re,children:[e.jsxs("option",{value:"",children:["Personal account (@",s.username,")"]}),x.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:x.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(se,{"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(R,{returnTo:"/settings",label:"Re-sign in with Hugging Face",authorizeInference:!0})})]})]}),P&&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"})]}),(b==null?void 0:b.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."}),m?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 ",p==null?void 0:p.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",p==null?void 0:p.utc,")"]})]})]}),e.jsx("strong",{children:m.available?`${m.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${m.remaining_percent}% remaining; resets ${p==null?void 0:p.local}; ${p==null?void 0:p.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m.remaining_percent,children:e.jsx("span",{style:{width:`${m.remaining_percent}%`}})}),!m.available&&e.jsxs("p",{className:"settings-limit-note",children:[m.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${m.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:U.isError||m?"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"}),b!=null&&b.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",b.verified_at?` · Last verified ${new Date(b.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(z,{checked:b.fallback_enabled,disabled:G.isPending,onCheckedChange:n=>G.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:X.isPending,onClick:()=>X.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:qe,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(se,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:n=>{n.preventDefault(),k.trim()&&$.mutate(k.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:k,onChange:n=>i(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:!k.trim()||$.isPending,children:$.isPending?"Verifying…":"Connect key"})})]}),o&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:E==="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.":o}),E==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(R,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]}),te&&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(R,{returnTo:"/settings",authorizeInference:!0})})]})]}),t&&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:Re},{value:"light",label:"Light",description:"Always use light mode",icon:_e},{value:"dark",label:"Dark",description:"Always use dark mode",icon:we}].map(n=>{const B=n.icon,J=c===n.value;return e.jsxs("button",{type:"button",className:`theme-option ${J?"is-selected":""}`,"aria-pressed":J,onClick:()=>a(n.value),children:[e.jsx(B,{"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(z,{id:"hide-closed-source-evals",checked:h.hide_closed_source_evals,onCheckedChange:n=>{j(!!n)}})]}),!l&&!d&&!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(R,{returnTo:"/settings"})})]})]})]})]})};export{es as default}; diff --git a/assets/SharedChatView-C8jGkNjy.js b/assets/SharedChatView-DO_TTtXn.js similarity index 78% rename from assets/SharedChatView-C8jGkNjy.js rename to assets/SharedChatView-DO_TTtXn.js index 796a426dc30177bd0fb8e68d4f1ff2b8c81b4951..86fd98fdec73ce7613e2af4ede57397a3077dfa7 100644 --- a/assets/SharedChatView-C8jGkNjy.js +++ b/assets/SharedChatView-DO_TTtXn.js @@ -1 +1 @@ -import{u as f,c as x,r as h,j as e,m as g}from"./index-YwiKC6Po.js";import{u as v}from"./useQuery-DPH6Mb2w.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-BxDA6yNF.js";import{C as m,e as w,p as N,q as C,g as q}from"./chatSessions-CdNQ1toA.js";/* empty css */import"./hover-card-BY9tUGxy.js";import"./CatalogEntityPreviewLink-Cv_oezOz.js";import"./catalog-B15Yh5dN.js";import"./github-BZMCt7Ub.js";import"./file-text-Cijxx2XD.js";import"./PaperPreviewLink-CKfmgBjs.js";import"./index-CoRCN2p0.js";import"./index-BM_xSDJM.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-C5FMa4Oj.js";import"./curation-CkzNFTMJ.js";import"./useMutation-f6iDkf3w.js";import"./chat-DHGOonJg.js";import"./copy-YHg6twss.js";import"./thumbs-up-D9G2aLNB.js";import"./arrow-left-B08fyfNi.js";import"./external-link-4bBJT0yO.js";import"./plus-Cfz0QbT1.js";import"./search-wcEXdf1i.js";import"./chevron-up-BXtxbTfV.js";import"./AuthorAvatar-CoTET6B3.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))})},te=()=>{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{te as default}; +import{u as f,c as x,r as h,j as e,m as g}from"./index-CbgxfyGU.js";import{u as v}from"./useQuery-Bx9s5-D2.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-Cwix1Wp6.js";import{C as m,e as w,p as N,q as C,g as q}from"./chatSessions-DwLUbLRo.js";/* empty css */import"./hover-card-ufez2uMo.js";import"./CatalogEntityPreviewLink-Cvehtzvn.js";import"./catalog-DhK7_9-6.js";import"./github-BYklgHDz.js";import"./file-text-BK_7Q2rV.js";import"./PaperPreviewLink-DZDNIh1g.js";import"./index-ZkEATkOr.js";import"./index-BH3yOoza.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-B8u1BWlI.js";import"./curation-C7Gmmp4z.js";import"./useMutation-P_trTy9i.js";import"./chat-DzTo2WUO.js";import"./copy-bzw7JVus.js";import"./thumbs-up-CDCzGuPd.js";import"./arrow-left-Czeu3VzJ.js";import"./external-link-DZIH4GGr.js";import"./plus-UK0TEjgd.js";import"./search-CLtAJGOp.js";import"./chevron-up-Cpt5JLeI.js";import"./AuthorAvatar-CUJMmp_z.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))})},te=()=>{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{te as default}; diff --git a/assets/SignInToEditDialog-DpqyyHCb.js b/assets/SignInToEditDialog-CNIcNqbK.js similarity index 66% rename from assets/SignInToEditDialog-DpqyyHCb.js rename to assets/SignInToEditDialog-CNIcNqbK.js index 4eeea07f312c112560697a2e050e3a27fcd8a494..f7a81841b84eca4f79c7fee823e5c6d5f496e7f6 100644 --- a/assets/SignInToEditDialog-DpqyyHCb.js +++ b/assets/SignInToEditDialog-CNIcNqbK.js @@ -1,6 +1,6 @@ -import{n as be,r as a,j as e,a6 as je,A as fe,a7 as ye,p as Ne,s as we,X as Se,C as _e,H as ke}from"./index-YwiKC6Po.js";import{B as P}from"./button-B90pJJiy.js";import{I as u}from"./input-DEeEc0bH.js";import{T as Ce}from"./textarea-BPIMGf5w.js";import{S as se}from"./searchable-select-Bqfyxu17.js";import{D as ie,a as oe,c as le,b as ce,d as de,e as De}from"./dialog-foxx0Wu6.js";import{u as Ie}from"./useMutation-f6iDkf3w.js";import{s as b,p as j}from"./submissions-BJgYjF7O.js";import{c as te}from"./catalog-B15Yh5dN.js";import{L as Ee}from"./loader-circle-B0KtDERb.js";/** +import{n as be,r as a,j as e,a7 as je,B as fe,a8 as ye,p as Ne,t as we,X as Se,C as _e,H as ke}from"./index-CbgxfyGU.js";import{B as P}from"./button-Bv9oZ-QU.js";import{I as u}from"./input-B6pxtfPe.js";import{T as Ce}from"./textarea-Bf06GTSH.js";import{S as te}from"./searchable-select-DNdBIahG.js";import{D as ie,a as oe,c as le,b as ce,d as de,e as De}from"./dialog-Cfp_d3CC.js";import{u as Ie}from"./useMutation-P_trTy9i.js";import{s as b,p as j}from"./submissions-aWj7YtuZ.js";import{c as se}from"./catalog-DhK7_9-6.js";import{L as Ee}from"./loader-circle-CWMja8Zn.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Me=be("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);var Le=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=Le.reduce((l,c)=>{const d=je(`Primitive.${c}`),t=a.forwardRef((o,f)=>{const{asChild:m,...y}=o,p=m?d:c;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...y,ref:f})});return t.displayName=`Primitive.${c}`,{...l,[c]:t}},{}),Ae="Label",ue=a.forwardRef((l,c)=>e.jsx(Pe.label,{...l,ref:c,onMouseDown:d=>{var o;d.target.closest("button, input, select, textarea")||((o=l.onMouseDown)==null||o.call(l,d),!d.defaultPrevented&&d.detail>1&&d.preventDefault())}}));ue.displayName=Ae;var me=ue;const Fe=ye("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),i=a.forwardRef(({className:l,...c},d)=>e.jsx(me,{ref:d,className:fe(Fe(),l),...c}));i.displayName=me.displayName;const ae=200,Be=2e3,Re=300,Te=500,re=1e3,Ge=2*1024*1024,ne=["image/jpeg","image/png","image/webp","image/gif"],He={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Ue={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function Qe({open:l,onOpenChange:c,paperId:d,kind:t}){const[o,f]=a.useState(""),[m,y]=a.useState(""),[p,A]=a.useState(""),[F,B]=a.useState(""),[R,T]=a.useState(""),[G,H]=a.useState(""),[S,U]=a.useState(""),[x,_]=a.useState(null),[k,O]=a.useState(""),[C,V]=a.useState(""),[X,K]=a.useState(""),[D,z]=a.useState(""),[I,$]=a.useState(""),[E,q]=a.useState(""),[n,Y]=a.useState(null),[g,M]=a.useState(null),[J,W]=a.useState("higher_is_better"),[Q,h]=a.useState(""),N=a.useRef(null),{toast:Z}=Ne(),w=t,ge=t==="task"||t==="method";a.useEffect(()=>{l||(f(""),y(""),A(""),B(""),T(""),H(""),U(""),_(null),O(""),V(""),K(""),z(""),$(""),q(""),Y(null),M(null),W("higher_is_better"),h(""))},[l]);const ee=s=>{if(!s)return;if(h(""),!ne.includes(s.type)){h("Choose a JPEG, PNG, WebP, or GIF image.");return}if(s.size>Ge){h("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){h("Could not read that image.");return}_({file_name:s.name,mime_type:s.type,data_url:r.result})},r.onerror=()=>h("Could not read that image."),r.readAsDataURL(s)},he=s=>{s.preventDefault(),ee(s.dataTransfer.files[0])},pe=async s=>(await te.listTasks({page_size:100,...s?{q:s}:{}})).results.map(v=>({value:v.id,label:v.name})),xe=async s=>n?(await te.listDatasets({task_id:Number(n.value),page_size:100,...s?{q:s}:{}})).results.map(v=>({value:v.id,label:v.name})):[],L=Ie({mutationFn:async()=>{const s=d?parseInt(d):null,r=m.trim()||void 0;switch(t){case"task":return b.submit(j(s,"new_task",{name:o.trim(),description:r,image:x??void 0,image_credit:k.trim()||void 0,keywords:X.trim()||void 0,parent_id:D?Number(D):void 0,area_id:I?Number(I):void 0}));case"method":return b.submit(j(s,"new_method",{name:o.trim(),description:r,image:x??void 0,image_credit:k.trim()||void 0,source_url:C.trim()||void 0}));case"benchmark":return b.submit(j(s,"new_benchmark",{benchmark:o.trim(),task:E.trim(),description:m.trim()}));case"metric":return b.submit(j(s,"new_metric",{name:o.trim(),description:m.trim(),direction:J==="lower_is_better"?"lower_is_better":"higher_is_better",task_id:Number(n==null?void 0:n.value),dataset_id:Number(g==null?void 0:g.value)}));case"conference":return b.submit(j(s,"new_conference",{name:o.trim(),description:r,year:Number(p),start_date:F||void 0,end_date:R||void 0,venue:G.trim()||void 0,url:S.trim()}))}},onSuccess:()=>{Z({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${w} shortly.`}),c(!1)},onError:s=>{const r=we(s,`Failed to submit your ${w} suggestion.`);Z({title:"Could not submit suggestion",description:r,variant:"destructive"})}}),ve=o.trim().length>0&&(t==="task"||t==="method"&&!!C.trim()||t==="conference"&&!!p&&!!S.trim()||t==="benchmark"&&!!E.trim()&&!!m.trim()||t==="metric"&&!!n&&!!g&&!!m.trim());return e.jsx(ie,{open:l,onOpenChange:c,children:e.jsxs(oe,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Suggest a new ",w]}),e.jsxs(de,{children:["Propose a ",w," that isn't in the list yet. An admin will review the suggestion, but approval won't automatically change the catalog."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-name",children:t==="benchmark"?"Benchmark":"Name"}),e.jsx(u,{id:"suggest-name",value:o,maxLength:ae,placeholder:He[t],onChange:s=>f(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(i,{htmlFor:"suggest-description",children:["Description",t==="task"||t==="method"||t==="conference"?" (optional)":""]}),e.jsx(Ce,{id:"suggest-description",value:m,maxLength:Be,placeholder:Ue[t],onChange:s=>y(s.target.value)})]}),t==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(u,{id:"suggest-keywords",value:X,onChange:s=>K(s.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{type:"number",min:"1",value:D,onChange:s=>z(s.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(u,{type:"number",min:"1",value:I,onChange:s=>$(s.target.value),placeholder:"Area ID (optional)"})]})]}),t==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-benchmark-task",children:"Task"}),e.jsx(u,{id:"suggest-benchmark-task",value:E,maxLength:ae,placeholder:"e.g. Deepfake Detection",onChange:s=>q(s.target.value)})]}),t==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(i,{children:"Intended leaderboard"}),e.jsxs("select",{"aria-label":"Metric direction",className:"w-full rounded-md border bg-background p-2",value:J,onChange:s=>W(s.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Task"}),e.jsx(se,{value:(n==null?void 0:n.value)??"",onChange:(s,r)=>{Y(r),M(null)},selectedOption:n,placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",errorMessage:"Could not load tasks. Try again.",queryKey:["suggest-metric-task-search"],queryFn:pe,ariaLabel:"Select task",className:"h-10"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Benchmark"}),e.jsx(se,{value:(g==null?void 0:g.value)??"",onChange:(s,r)=>M(r),selectedOption:g,placeholder:n?"Select benchmark":"Select task first",searchPlaceholder:"Search benchmarks...",emptyMessage:"No benchmarks found for this task.",errorMessage:"Could not load benchmarks. Try again.",disabled:!n,queryKey:["suggest-metric-benchmark-search",n==null?void 0:n.value],queryFn:xe,enabled:!!n,ariaLabel:"Select benchmark",className:"h-10"})]})]})]}),ge&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Image (optional)"}),e.jsx("input",{ref:N,className:"sr-only",type:"file",accept:ne.join(","),onChange:s=>{var r;return ee((r=s.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(P,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{_(null),N.current&&(N.current.value="")},children:[e.jsx(Se,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var s;return(s=N.current)==null?void 0:s.click()},onDragOver:s=>s.preventDefault(),onDrop:he,children:[e.jsx(Me,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),Q&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:Q})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(u,{id:"suggest-image-source",value:k,maxLength:re,placeholder:"Creator, publication, or source URL",onChange:s=>O(s.target.value)})]}),t==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(u,{id:"suggest-method-source",value:C,maxLength:re,placeholder:"https://arxiv.org/abs/...",onChange:s=>V(s.target.value)})]})]}),t==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(u,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:p,placeholder:"2026",onChange:s=>A(s.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(i,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(u,{id:"suggest-start-date",type:"date",value:F,onChange:s=>B(s.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(u,{id:"suggest-end-date",type:"date",value:R,onChange:s=>T(s.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(u,{id:"suggest-venue",value:G,maxLength:Re,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:s=>H(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(u,{id:"suggest-url",type:"url",inputMode:"url",value:S,maxLength:Te,placeholder:"https://example.org/conference",onChange:s=>U(s.target.value)})]})]})]}),e.jsxs(De,{children:[e.jsx(P,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(P,{onClick:()=>L.mutate(),disabled:L.isPending||!ve,children:L.isPending?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_e,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function Ze({open:l,onOpenChange:c,sectionLabel:d,returnTo:t,taxonomySuggestion:o=!1}){return e.jsx(ie,{open:l,onOpenChange:c,children:e.jsxs(oe,{className:"max-w-md",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Sign in to ",o?"suggest":"edit"," ",d]}),e.jsx(de,{children:o?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(ke,{returnTo:t})})]})})}export{i as L,Qe as S,Ze as a}; + */const Me=be("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);var Le=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=Le.reduce((l,c)=>{const d=je(`Primitive.${c}`),s=a.forwardRef((o,f)=>{const{asChild:m,...y}=o,p=m?d:c;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...y,ref:f})});return s.displayName=`Primitive.${c}`,{...l,[c]:s}},{}),Fe="Label",ue=a.forwardRef((l,c)=>e.jsx(Pe.label,{...l,ref:c,onMouseDown:d=>{var o;d.target.closest("button, input, select, textarea")||((o=l.onMouseDown)==null||o.call(l,d),!d.defaultPrevented&&d.detail>1&&d.preventDefault())}}));ue.displayName=Fe;var me=ue;const Ae=ye("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),i=a.forwardRef(({className:l,...c},d)=>e.jsx(me,{ref:d,className:fe(Ae(),l),...c}));i.displayName=me.displayName;const ae=200,Be=2e3,Re=300,Te=500,re=1e3,Ge=2*1024*1024,ne=["image/jpeg","image/png","image/webp","image/gif"],He={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Ue={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function Qe({open:l,onOpenChange:c,paperId:d,kind:s}){const[o,f]=a.useState(""),[m,y]=a.useState(""),[p,F]=a.useState(""),[A,B]=a.useState(""),[R,T]=a.useState(""),[G,H]=a.useState(""),[S,U]=a.useState(""),[x,_]=a.useState(null),[k,O]=a.useState(""),[C,V]=a.useState(""),[X,K]=a.useState(""),[D,z]=a.useState(""),[I,$]=a.useState(""),[E,q]=a.useState(""),[n,Y]=a.useState(null),[g,M]=a.useState(null),[J,W]=a.useState("higher_is_better"),[Q,h]=a.useState(""),N=a.useRef(null),{toast:Z}=Ne(),w=s,ge=s==="task"||s==="method";a.useEffect(()=>{l||(f(""),y(""),F(""),B(""),T(""),H(""),U(""),_(null),O(""),V(""),K(""),z(""),$(""),q(""),Y(null),M(null),W("higher_is_better"),h(""))},[l]);const ee=t=>{if(!t)return;if(h(""),!ne.includes(t.type)){h("Choose a JPEG, PNG, WebP, or GIF image.");return}if(t.size>Ge){h("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){h("Could not read that image.");return}_({file_name:t.name,mime_type:t.type,data_url:r.result})},r.onerror=()=>h("Could not read that image."),r.readAsDataURL(t)},he=t=>{t.preventDefault(),ee(t.dataTransfer.files[0])},pe=async t=>(await se.listTasks({page_size:100,...t?{q:t}:{}})).results.map(v=>({value:v.id,label:v.name})),xe=async t=>n?(await se.listDatasets({task_id:Number(n.value),page_size:100,...t?{q:t}:{}})).results.map(v=>({value:v.id,label:v.name})):[],L=Ie({mutationFn:async()=>{const t=d?parseInt(d):null,r=m.trim()||void 0;switch(s){case"task":return b.submit(j(t,"new_task",{name:o.trim(),description:r,image:x??void 0,image_credit:k.trim()||void 0,keywords:X.trim()||void 0,parent_id:D?Number(D):void 0,area_id:I?Number(I):void 0}));case"method":return b.submit(j(t,"new_method",{name:o.trim(),description:r,image:x??void 0,image_credit:k.trim()||void 0,source_url:C.trim()||void 0}));case"benchmark":return b.submit(j(t,"new_benchmark",{benchmark:o.trim(),task:E.trim(),description:m.trim()}));case"metric":return b.submit(j(t,"new_metric",{name:o.trim(),description:m.trim(),direction:J==="lower_is_better"?"lower_is_better":"higher_is_better",task_id:Number(n==null?void 0:n.value),dataset_id:Number(g==null?void 0:g.value)}));case"conference":return b.submit(j(t,"new_conference",{name:o.trim(),description:r,year:Number(p),start_date:A||void 0,end_date:R||void 0,venue:G.trim()||void 0,url:S.trim()}))}},onSuccess:()=>{Z({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${w} shortly.`}),c(!1)},onError:t=>{const r=we(t,`Failed to submit your ${w} suggestion.`);Z({title:"Could not submit suggestion",description:r,variant:"destructive"})}}),ve=o.trim().length>0&&(s==="task"||s==="method"&&!!C.trim()||s==="conference"&&!!p&&!!S.trim()||s==="benchmark"&&!!E.trim()&&!!m.trim()||s==="metric"&&!!n&&!!g&&!!m.trim());return e.jsx(ie,{open:l,onOpenChange:c,children:e.jsxs(oe,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Suggest a new ",w]}),e.jsxs(de,{children:["Propose a ",w," that isn't in the list yet. An admin will review the suggestion, but approval won't automatically change the catalog."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-name",children:s==="benchmark"?"Benchmark":"Name"}),e.jsx(u,{id:"suggest-name",value:o,maxLength:ae,placeholder:He[s],onChange:t=>f(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(i,{htmlFor:"suggest-description",children:["Description",s==="task"||s==="method"||s==="conference"?" (optional)":""]}),e.jsx(Ce,{id:"suggest-description",value:m,maxLength:Be,placeholder:Ue[s],onChange:t=>y(t.target.value)})]}),s==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(u,{id:"suggest-keywords",value:X,onChange:t=>K(t.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{type:"number",min:"1",value:D,onChange:t=>z(t.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(u,{type:"number",min:"1",value:I,onChange:t=>$(t.target.value),placeholder:"Area ID (optional)"})]})]}),s==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-benchmark-task",children:"Task"}),e.jsx(u,{id:"suggest-benchmark-task",value:E,maxLength:ae,placeholder:"e.g. Deepfake Detection",onChange:t=>q(t.target.value)})]}),s==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(i,{children:"Intended leaderboard"}),e.jsxs("select",{"aria-label":"Metric direction",className:"w-full rounded-md border bg-background p-2",value:J,onChange:t=>W(t.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Task"}),e.jsx(te,{value:(n==null?void 0:n.value)??"",onChange:(t,r)=>{Y(r),M(null)},selectedOption:n,placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",errorMessage:"Could not load tasks. Try again.",queryKey:["suggest-metric-task-search"],queryFn:pe,ariaLabel:"Select task",className:"h-10"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Benchmark"}),e.jsx(te,{value:(g==null?void 0:g.value)??"",onChange:(t,r)=>M(r),selectedOption:g,placeholder:n?"Select benchmark":"Select task first",searchPlaceholder:"Search benchmarks...",emptyMessage:"No benchmarks found for this task.",errorMessage:"Could not load benchmarks. Try again.",disabled:!n,queryKey:["suggest-metric-benchmark-search",n==null?void 0:n.value],queryFn:xe,enabled:!!n,ariaLabel:"Select benchmark",className:"h-10"})]})]})]}),ge&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Image (optional)"}),e.jsx("input",{ref:N,className:"sr-only",type:"file",accept:ne.join(","),onChange:t=>{var r;return ee((r=t.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(P,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{_(null),N.current&&(N.current.value="")},children:[e.jsx(Se,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var t;return(t=N.current)==null?void 0:t.click()},onDragOver:t=>t.preventDefault(),onDrop:he,children:[e.jsx(Me,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),Q&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:Q})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(u,{id:"suggest-image-source",value:k,maxLength:re,placeholder:"Creator, publication, or source URL",onChange:t=>O(t.target.value)})]}),s==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(u,{id:"suggest-method-source",value:C,maxLength:re,placeholder:"https://arxiv.org/abs/...",onChange:t=>V(t.target.value)})]})]}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(u,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:p,placeholder:"2026",onChange:t=>F(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(i,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(u,{id:"suggest-start-date",type:"date",value:A,onChange:t=>B(t.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(u,{id:"suggest-end-date",type:"date",value:R,onChange:t=>T(t.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(u,{id:"suggest-venue",value:G,maxLength:Re,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:t=>H(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(u,{id:"suggest-url",type:"url",inputMode:"url",value:S,maxLength:Te,placeholder:"https://example.org/conference",onChange:t=>U(t.target.value)})]})]})]}),e.jsxs(De,{children:[e.jsx(P,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(P,{onClick:()=>L.mutate(),disabled:L.isPending||!ve,children:L.isPending?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_e,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function Ze({open:l,onOpenChange:c,sectionLabel:d,returnTo:s,taxonomySuggestion:o=!1}){return e.jsx(ie,{open:l,onOpenChange:c,children:e.jsxs(oe,{className:"max-w-md",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Sign in to ",o?"suggest":"edit"," ",d]}),e.jsx(de,{children:o?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(ke,{returnTo:s})})]})})}export{i as L,Qe as S,Ze as a}; diff --git a/assets/SotaBadges-DiQuEzfo.js b/assets/SotaBadges-C-sTR-EF.js similarity index 95% rename from assets/SotaBadges-DiQuEzfo.js rename to assets/SotaBadges-C-sTR-EF.js index 201de390bc867b620980d81a7733986b3fb0b832..b045051906698e6f346262a6a489d0697618e38b 100644 --- a/assets/SotaBadges-DiQuEzfo.js +++ b/assets/SotaBadges-C-sTR-EF.js @@ -1 +1 @@ -import{c as M,j as e,K as x,L as C}from"./index-YwiKC6Po.js";import{h as F,c as E}from"./colors-BkWRhvFI.js";import{d as A,h as P}from"./transform-CNg3rvXk.js";const D=({slug:t,label:s,onClick:r})=>{const a=M(),j=F(t),o=E(j),p=c=>{if(c.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:p,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),A(s||P(t),t)]})},I=({method:t,onClick:s})=>{const r=M(),a=t.slug||t.id||"";if(!a)return null;const j=o=>{if(o.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:j,children:t.name})},W=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},O=({paperId:t})=>{const s=W(t),r=160,a=220,j=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,p=[],c=9+Math.floor(s()*3);for(let y=0;y.3,l=Math.floor(s()*3),m=[],$=6+Math.floor(s()*3);for(let y=0;y<$;y++)m.push(.5+s()*.45);const d="#9A9588",u="#3A352D",i=5,h=(r-i*2-2)/2,k=i,f=i+h+2;let w=i+2;const R=w;w+=6;const T=w+1;w+=5;const L=w;w+=3;const g=w+1;return e.jsx("div",{style:{width:r,height:a,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,style:{display:"block"},children:[j.map((y,v)=>e.jsx("rect",{x:i+(r-i*2)*(1-y)/2,y:R+v*2.4,width:(r-i*2)*y,height:1.4,fill:u,rx:.3},`t${v}`)),e.jsx("rect",{x:i+(r-i*2)*(1-o)/2,y:T,width:(r-i*2)*o,height:.9,fill:d,opacity:.7,rx:.2}),e.jsx("rect",{x:i,y:L,width:6,height:1,fill:u,opacity:.6}),p.map((y,v)=>{const b=g+v*2.1;return b>a-i-1?null:e.jsx("rect",{x:k,y:b,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:f,y:g,width:h,height:14,fill:"#F0EBE0",stroke:d,strokeWidth:.3,opacity:.9}),l===0&&e.jsx("g",{stroke:u,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${f+2},${g+11} ${f+6},${g+8} ${f+10},${g+9} ${f+14},${g+5} ${f+18},${g+6} ${f+22},${g+3}`})}),l===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:f+h/2,cy:g+7,r:3.5,fill:u}),e.jsx("rect",{x:f+2,y:g+11,width:h-4,height:1.5,fill:d})]}),l===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:f+3,y:g+5,width:h-6,height:1,fill:u}),e.jsx("rect",{x:f+6,y:g+8,width:h-12,height:.8,fill:u})]})]}),m.map((y,v)=>{const b=g+(n?16:0)+v*2.1;return b>a-i-1?null:e.jsx("rect",{x:f,y:b,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`r${v}`)})]})})},Y=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[j,o]=x.useState(!1),[p,c]=x.useState(0),[n,l]=x.useState(a),m=x.useRef(null);x.useEffect(()=>{o(!1),c(0)},[r]);const $=x.useMemo(()=>{if(!r)return null;if(p===0)return r;const d=r.includes("?")?"&":"?";return`${r}${d}retry=${p}`},[r,p]);return x.useEffect(()=>{if(a||n)return;const d=m.current;if(!d)return;const u=new IntersectionObserver(([i])=>{i.isIntersecting&&(l(!0),u.disconnect())},{rootMargin:"250px"});return u.observe(d),()=>u.disconnect()},[a,n]),r&&!j?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&$&&e.jsx("img",{src:$,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(p<1){c(d=>d+1);return}o(!0)}},$)}):e.jsx(O,{paperId:t})},S={1:"SOTA 🏆",2:"#2",3:"#3"},N=({units:t,paperHref:s})=>{const r=x.useRef(null),a=x.useRef(null),[j,o]=x.useState(t.length);if(x.useLayoutEffect(()=>{const n=r.current,l=a.current;if(!n||!l||t.length===0)return;const m=u=>(l.textContent=u,l.scrollWidth),$=()=>{const u=n.clientWidth;if(u<=0)return;let i=0,h=0;for(const k of t){const f=m(k.measureText);if(i+f<=u)i+=f,h+=1;else break}if(h0&&i+m(` · +${t.length-h} more`)>u;)h-=1,i-=m(t[h].measureText);h===0&&(h=1)}o(h)};$();const d=new ResizeObserver($);return d.observe(n),()=>d.disconnect()},[t]),t.length===0)return null;const p=t.slice(0,Math.max(1,Math.min(j,t.length))),c=t.length-p.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),p.map((n,l)=>e.jsxs(x.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[l>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:S[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.href?e.jsx(C,{to:n.href,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.href||n.name}-${l}`)),c>0&&e.jsxs(C,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",c," more"]})]})},K=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=x.useMemo(()=>{const o=[];let p=!0;for(const c of[1,2,3]){const n=t.filter(l=>l.rank===c);n.forEach((l,m)=>{const $=m===0,d=$?`${p?"":" · "}${S[c]} on `:", ";o.push({name:l.name,href:l.href,rank:c,isGroupStart:$,measureText:d+l.name})}),n.length>0&&(p=!1)}return o},[t]),j=x.useMemo(()=>[1,2,3].map(o=>t.filter(c=>c.rank===o).map((c,n)=>({name:c.name,href:c.href,rank:o,isGroupStart:n===0,measureText:(n===0?`${S[o]} on `:", ")+c.name}))).filter(o=>o.length>0),[t]);return r?j.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:j.map(o=>e.jsx(N,{units:o,paperHref:s},o[0].rank))}):a.length===0?null:e.jsx(N,{units:a,paperHref:s})};export{I as M,Y as P,K as S,D as T}; +import{c as M,j as e,M as x,L as C}from"./index-CbgxfyGU.js";import{h as F,c as E}from"./colors-BkWRhvFI.js";import{d as A,h as P}from"./transform-0Udg2p6b.js";const D=({slug:t,label:s,onClick:r})=>{const a=M(),j=F(t),o=E(j),p=c=>{if(c.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:p,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),A(s||P(t),t)]})},I=({method:t,onClick:s})=>{const r=M(),a=t.slug||t.id||"";if(!a)return null;const j=o=>{if(o.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:j,children:t.name})},W=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},O=({paperId:t})=>{const s=W(t),r=160,a=220,j=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,p=[],c=9+Math.floor(s()*3);for(let y=0;y.3,l=Math.floor(s()*3),m=[],$=6+Math.floor(s()*3);for(let y=0;y<$;y++)m.push(.5+s()*.45);const d="#9A9588",u="#3A352D",i=5,h=(r-i*2-2)/2,k=i,f=i+h+2;let w=i+2;const R=w;w+=6;const T=w+1;w+=5;const L=w;w+=3;const g=w+1;return e.jsx("div",{style:{width:r,height:a,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,style:{display:"block"},children:[j.map((y,v)=>e.jsx("rect",{x:i+(r-i*2)*(1-y)/2,y:R+v*2.4,width:(r-i*2)*y,height:1.4,fill:u,rx:.3},`t${v}`)),e.jsx("rect",{x:i+(r-i*2)*(1-o)/2,y:T,width:(r-i*2)*o,height:.9,fill:d,opacity:.7,rx:.2}),e.jsx("rect",{x:i,y:L,width:6,height:1,fill:u,opacity:.6}),p.map((y,v)=>{const b=g+v*2.1;return b>a-i-1?null:e.jsx("rect",{x:k,y:b,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:f,y:g,width:h,height:14,fill:"#F0EBE0",stroke:d,strokeWidth:.3,opacity:.9}),l===0&&e.jsx("g",{stroke:u,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${f+2},${g+11} ${f+6},${g+8} ${f+10},${g+9} ${f+14},${g+5} ${f+18},${g+6} ${f+22},${g+3}`})}),l===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:f+h/2,cy:g+7,r:3.5,fill:u}),e.jsx("rect",{x:f+2,y:g+11,width:h-4,height:1.5,fill:d})]}),l===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:f+3,y:g+5,width:h-6,height:1,fill:u}),e.jsx("rect",{x:f+6,y:g+8,width:h-12,height:.8,fill:u})]})]}),m.map((y,v)=>{const b=g+(n?16:0)+v*2.1;return b>a-i-1?null:e.jsx("rect",{x:f,y:b,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`r${v}`)})]})})},Y=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[j,o]=x.useState(!1),[p,c]=x.useState(0),[n,l]=x.useState(a),m=x.useRef(null);x.useEffect(()=>{o(!1),c(0)},[r]);const $=x.useMemo(()=>{if(!r)return null;if(p===0)return r;const d=r.includes("?")?"&":"?";return`${r}${d}retry=${p}`},[r,p]);return x.useEffect(()=>{if(a||n)return;const d=m.current;if(!d)return;const u=new IntersectionObserver(([i])=>{i.isIntersecting&&(l(!0),u.disconnect())},{rootMargin:"250px"});return u.observe(d),()=>u.disconnect()},[a,n]),r&&!j?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&$&&e.jsx("img",{src:$,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(p<1){c(d=>d+1);return}o(!0)}},$)}):e.jsx(O,{paperId:t})},S={1:"SOTA 🏆",2:"#2",3:"#3"},N=({units:t,paperHref:s})=>{const r=x.useRef(null),a=x.useRef(null),[j,o]=x.useState(t.length);if(x.useLayoutEffect(()=>{const n=r.current,l=a.current;if(!n||!l||t.length===0)return;const m=u=>(l.textContent=u,l.scrollWidth),$=()=>{const u=n.clientWidth;if(u<=0)return;let i=0,h=0;for(const k of t){const f=m(k.measureText);if(i+f<=u)i+=f,h+=1;else break}if(h0&&i+m(` · +${t.length-h} more`)>u;)h-=1,i-=m(t[h].measureText);h===0&&(h=1)}o(h)};$();const d=new ResizeObserver($);return d.observe(n),()=>d.disconnect()},[t]),t.length===0)return null;const p=t.slice(0,Math.max(1,Math.min(j,t.length))),c=t.length-p.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),p.map((n,l)=>e.jsxs(x.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[l>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:S[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.href?e.jsx(C,{to:n.href,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.href||n.name}-${l}`)),c>0&&e.jsxs(C,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",c," more"]})]})},_=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=x.useMemo(()=>{const o=[];let p=!0;for(const c of[1,2,3]){const n=t.filter(l=>l.rank===c);n.forEach((l,m)=>{const $=m===0,d=$?`${p?"":" · "}${S[c]} on `:", ";o.push({name:l.name,href:l.href,rank:c,isGroupStart:$,measureText:d+l.name})}),n.length>0&&(p=!1)}return o},[t]),j=x.useMemo(()=>[1,2,3].map(o=>t.filter(c=>c.rank===o).map((c,n)=>({name:c.name,href:c.href,rank:o,isGroupStart:n===0,measureText:(n===0?`${S[o]} on `:", ")+c.name}))).filter(o=>o.length>0),[t]);return r?j.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:j.map(o=>e.jsx(N,{units:o,paperHref:s},o[0].rank))}):a.length===0?null:e.jsx(N,{units:a,paperHref:s})};export{I as M,Y as P,_ as S,D as T}; diff --git a/assets/StagingAccessRequestView-DFeZrs_b.js b/assets/StagingAccessRequestView-DgeEeE2r.js similarity index 95% rename from assets/StagingAccessRequestView-DFeZrs_b.js rename to assets/StagingAccessRequestView-DgeEeE2r.js index 2d2dcfc832a5862f4ddb7b60414c235728ea237e..bba1c28d9e8747d35bacd13c3edf909d9c20f900 100644 --- a/assets/StagingAccessRequestView-DFeZrs_b.js +++ b/assets/StagingAccessRequestView-DgeEeE2r.js @@ -1 +1 @@ -import{a as m,K as a,j as e,H as g,aX as p}from"./index-YwiKC6Po.js";import{C as j}from"./circle-check-BPcHPjjB.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default}; +import{a as m,M as a,j as e,H as g,aY as p}from"./index-CbgxfyGU.js";import{C as j}from"./circle-check-Bci9ZTu9.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default}; diff --git a/assets/SubmissionsDashboard-6OF_L4gN.js b/assets/SubmissionsDashboard-6OF_L4gN.js deleted file mode 100644 index 9bd9084042c1b36e52f98c8b4c79296e47323312..0000000000000000000000000000000000000000 --- a/assets/SubmissionsDashboard-6OF_L4gN.js +++ /dev/null @@ -1,11 +0,0 @@ -var xe=s=>{throw TypeError(s)};var re=(s,t,n)=>t.has(s)||xe("Cannot "+n);var b=(s,t,n)=>(re(s,t,"read from private field"),n?n.call(s):t.get(s)),C=(s,t,n)=>t.has(s)?xe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),k=(s,t,n,i)=>(re(s,t,"write to private field"),i?i.call(s,n):t.set(s,n),n),O=(s,t,n)=>(re(s,t,"access private method"),n);import{at as Ie,au as le,av as Fe,aw as Ue,f as Ee,r as H,ax as Qe,n as Re,j as e,Y as Ce,A,K as w,p as Oe,s as z,ay as $e,az as qe,aA as De}from"./index-YwiKC6Po.js";import{r as Le,e as ze}from"./evaluationQueryInvalidation-CcSZ8CmA.js";import{a as Pe,p as Be}from"./paperQueryKeys-C5FMa4Oj.js";import{i as je,a as ae}from"./queryInvalidation-Dgyv9_oM.js";import{Q as Me,a as He,b as Ke,e as Je,c as Ge,d as We,s as ve,f as Ye,g as Ve,u as Te}from"./useQuery-DPH6Mb2w.js";import{u as se}from"./useMutation-f6iDkf3w.js";import{u as Xe}from"./useInfiniteQuery-BEbL80ez.js";import{c as U}from"./catalog-B15Yh5dN.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{s as G}from"./submissions-BJgYjF7O.js";import{R as Ze,C as es}from"./refresh-cw-4AZFTXDl.js";import{L as W}from"./loader-circle-B0KtDERb.js";import{C as ss}from"./circle-check-BPcHPjjB.js";import"./curation-CkzNFTMJ.js";function _e(s,t){const n=new Set(t);return s.filter(i=>!n.has(i))}function ts(s,t,n){const i=s.slice(0);return i[t]=n,i}var P,E,B,q,R,F,Y,V,X,Z,N,ce,de,Ae,ue,pe,he,Se,is=(Se=class extends Ie{constructor(t,n,i){super();C(this,N);C(this,P);C(this,E);C(this,B);C(this,q);C(this,R);C(this,F);C(this,Y);C(this,V);C(this,X);C(this,Z,[]);k(this,P,t),k(this,q,i),k(this,B,[]),k(this,R,[]),k(this,E,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&b(this,R).forEach(t=>{t.subscribe(n=>{O(this,N,pe).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,b(this,R).forEach(t=>{t.destroy()})}setQueries(t,n){k(this,B,t),k(this,q,n),le.batch(()=>{const i=b(this,R),r=O(this,N,ue).call(this,b(this,B));r.forEach(l=>l.observer.setOptions(l.defaultedQueryOptions));const o=r.map(l=>l.observer),a=o.map(l=>l.getCurrentResult()),u=i.length!==o.length,d=o.some((l,m)=>l!==i[m]),p=u||d,v=p?!0:a.some((l,m)=>{const c=b(this,E)[m];return!c||!Fe(l,c)});!p&&!v||(p&&(k(this,Z,r),k(this,R,o)),k(this,E,a),this.hasListeners()&&(p&&(_e(i,o).forEach(l=>{l.destroy()}),_e(o,i).forEach(l=>{l.subscribe(m=>{O(this,N,pe).call(this,l,m)})})),O(this,N,he).call(this)))})}getCurrentResult(){return b(this,E)}getQueries(){return b(this,R).map(t=>t.getCurrentQuery())}getObservers(){return b(this,R)}getOptimisticResult(t,n){const i=O(this,N,ue).call(this,t),r=i.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),o=i.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>O(this,N,de).call(this,a??r,n,o),()=>O(this,N,ce).call(this,r,i)]}},P=new WeakMap,E=new WeakMap,B=new WeakMap,q=new WeakMap,R=new WeakMap,F=new WeakMap,Y=new WeakMap,V=new WeakMap,X=new WeakMap,Z=new WeakMap,N=new WeakSet,ce=function(t,n){return n.map((i,r)=>{const o=t[r];return i.defaultedQueryOptions.notifyOnChangeProps?o:i.observer.trackResult(o,a=>{n.forEach(u=>{u.observer.trackProp(a)})})})},de=function(t,n,i){if(n){const r=b(this,X),o=i!==void 0&&r!==void 0&&(r.length!==i.length||i.some((a,u)=>a!==r[u]));return(!b(this,F)||b(this,E)!==b(this,V)||o||n!==b(this,Y))&&(k(this,Y,n),k(this,V,b(this,E)),i!==void 0&&k(this,X,i),k(this,F,Ue(b(this,F),n(t)))),b(this,F)}return t},Ae=function(){var t;return((t=b(this,q))==null?void 0:t.combine)!==void 0&&b(this,R).some((n,i)=>{var r;return n.options.suspense&&((r=b(this,E)[i])==null?void 0:r.data)===void 0})},ue=function(t){const n=new Map;b(this,R).forEach(r=>{const o=r.options.queryHash;if(!o)return;const a=n.get(o);a?a.push(r):n.set(o,[r])});const i=[];return t.forEach(r=>{var d;const o=b(this,P).defaultQueryOptions(r),u=((d=n.get(o.queryHash))==null?void 0:d.shift())??new Me(b(this,P),o);i.push({defaultedQueryOptions:o,observer:u})}),i},pe=function(t,n){const i=b(this,R).indexOf(t);i!==-1&&(k(this,E,ts(b(this,E),i,n)),O(this,N,he).call(this))},he=function(){var t;if(this.hasListeners()){const n=O(this,N,ce).call(this,b(this,E),b(this,Z)),i=O(this,N,Ae).call(this),r=b(this,F),o=i?r:O(this,N,de).call(this,n,(t=b(this,q))==null?void 0:t.combine);(i||r!==o)&&le.batch(()=>{this.listeners.forEach(a=>{a(b(this,E))})})}},Se);function ie({queries:s,...t},n){const i=Ee(),r=He(),o=Ke(),a=H.useMemo(()=>s.map(x=>{const _=i.defaultQueryOptions(x);return _._optimisticResults=r?"isRestoring":"optimistic",_}),[s,i,r]);a.forEach(x=>{Je(x);const _=i.getQueryCache().get(x.queryHash);Ge(x,o,_)}),We(o);const[u]=H.useState(()=>new is(i,a,t)),[d,p,v]=u.getOptimisticResult(a,t.combine),l=!r&&t.subscribed!==!1;H.useSyncExternalStore(H.useCallback(x=>l?u.subscribe(le.batchCalls(x)):Qe,[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),H.useEffect(()=>{u.setQueries(a,t)},[a,t,u]);const c=d.some((x,_)=>ve(a[_],x))?d.flatMap((x,_)=>{const S=a[_];if(S&&ve(S,x)){const Q=new Me(i,S);return Ye(S,Q,o)}return[]}):[];if(c.length>0)throw Promise.all(c);const f=d.find((x,_)=>{const S=a[_];return S&&Ve({result:x,errorResetBoundary:o,throwOnError:S.throwOnError,query:i.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(f!=null&&f.error)throw f.error;return p(v())}/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ye=Re("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ns=Re("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);function rs({currentPayload:s,proposedPayload:t}){const[n,i]=w.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>i(r=>!r),children:n?"Hide raw JSON":"Show raw JSON"}),n&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(me,{title:"Current payload",value:s??{}}),e.jsx(me,{title:"Proposed payload",value:t})]})]})}function me({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function fe({currentItems:s,proposedIds:t,queryPrefix:n,fetchEntity:i,knownNames:r}){const o=w.useMemo(()=>Array.from(new Set([...s.map(c=>c.id),...t])).sort((c,f)=>c-f),[s,t]),a=ie({queries:i?o.map(c=>({queryKey:[n,String(c)],queryFn:()=>i(String(c)),staleTime:5*60*1e3})):[]}),u=w.useMemo(()=>{const c=new Map;return s.forEach(f=>c.set(f.id,f.name)),r==null||r.forEach((f,x)=>c.set(x,f)),a.forEach(f=>{const x=f.data;if(!x)return;const _=Number(x.id);Number.isFinite(_)&&c.set(_,x.name)}),c},[s,a,r]),d=new Set(s.map(c=>c.id)),p=new Set(t),v=o.filter(c=>d.has(c)&&!p.has(c)),l=o.filter(c=>!d.has(c)&&p.has(c)),m=(c,f)=>{const x=f==="current"&&v.includes(c),_=f==="proposed"&&l.includes(c);return e.jsx("span",{className:A("submission-diff-pill",x&&"removed",_&&"added"),children:u.get(c)??`#${c}`},c)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Currently tagged",children:s.length>0?s.map(c=>m(c.id,"current")):e.jsx(y,{children:"No current tags"})}),e.jsx(j,{title:"Will be tagged",children:t.length>0?t.map(c=>m(c,"proposed")):e.jsx(y,{children:"No proposed tags"})})]})}function as({currentItems:s,proposedIds:t}){var o;const n=Te({queryKey:["organizations","submission-diff"],queryFn:()=>U.organizations(),staleTime:3e5}),i=new Map(s.map(a=>[a.id,a.name]));(o=n.data)==null||o.results.forEach(a=>{const u=Number(a.id);Number.isFinite(u)&&i.set(u,a.name)});const r=s.map(a=>({...a,name:i.get(a.id)??a.name}));return e.jsx(fe,{currentItems:r,proposedIds:t,queryPrefix:"organization",knownNames:i})}function te({label:s,currentItems:t,proposedItems:n}){const i=new Map(t.map(a=>[a.url,a])),r=new Map(n.map(a=>[a.url,a])),o=Array.from(new Set([...i.keys(),...r.keys()])).sort();return o.length===0?e.jsxs(y,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:o.map(a=>{var m;const u=i.get(a),d=r.get(a),p=!u&&d,v=u&&!d,l=u&&d&&u.is_official!==d.is_official;return e.jsx("div",{className:A("submission-url-row",p&&"added",v&&"removed",l&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:D(a)??void 0,target:"_blank",rel:"noopener noreferrer",className:A("submission-url-link",v&&"removed"),children:a}),p&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),v&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),l&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(u.is_official)," ","->"," ",String(d.is_official)]}),((m=d??u)==null?void 0:m.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},a)})})}function os({currentPayload:s,proposedPayload:t}){const n=w.useMemo(()=>(s==null?void 0:s.evaluations)??[],[s]),i=t.operations,r=w.useMemo(()=>{const l=new Set;return n.forEach(m=>{m.task_id&&l.add(Number(m.task_id))}),i.forEach(m=>{const c=m.data;c!=null&&c.task_id&&l.add(Number(c.task_id))}),Array.from(l).filter(m=>Number.isFinite(m))},[n,i]),o=w.useMemo(()=>{const l=new Set;return n.forEach(m=>{m.dataset_id&&l.add(Number(m.dataset_id))}),i.forEach(m=>{const c=m.data;c!=null&&c.dataset_id&&l.add(Number(c.dataset_id))}),Array.from(l).filter(m=>Number.isFinite(m))},[n,i]),a=ie({queries:r.map(l=>({queryKey:["task",String(l)],queryFn:()=>U.getTask(String(l)),staleTime:5*60*1e3}))}),u=ie({queries:o.map(l=>({queryKey:["dataset",String(l)],queryFn:()=>U.getDataset(String(l)),staleTime:5*60*1e3}))}),d=w.useMemo(()=>{const l=new Map;return a.forEach(m=>{const c=m.data;if(!c)return;const f=Number(c.id);Number.isFinite(f)&&l.set(f,c.name)}),l},[a]),p=w.useMemo(()=>{const l=new Map;return u.forEach(m=>{const c=m.data;if(!c)return;const f=Number(c.id);Number.isFinite(f)&&l.set(f,c.name)}),l},[u]),v=new Map(n.filter(l=>l.id!=null).map(l=>[Number(l.id),l]));return i.length===0?e.jsx(y,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:i.map((l,m)=>{const c=l.evaluation_id?v.get(l.evaluation_id):void 0,x=(l.op==="update"?{...c,...l.data}:l.data??c)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:A("submission-pill status",l.op==="create"&&"approved",l.op==="update"&&"changed",l.op==="delete"&&"rejected"),children:l.op??"unknown"}),l.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",l.evaluation_id]})]}),l.op&&["create","update","delete"].includes(l.op)?e.jsx(ls,{evaluation:x,taskNames:d,datasetNames:p}):e.jsx(me,{title:"Unsupported operation",value:l})]},`${l.op}-${l.evaluation_id??m}`)})})}function ls({evaluation:s,taskNames:t,datasetNames:n}){const i=s.task_id?Number(s.task_id):void 0,r=s.dataset_id?Number(s.dataset_id):void 0,o=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(I,{label:"Task",value:i?t.get(i)??`#${i}`:null}),e.jsx(I,{label:"Dataset",value:r?n.get(r)??`#${r}`:null}),e.jsx(I,{label:"Model",value:s.model_name||null}),e.jsx(I,{label:"Harness",value:s.harness||null}),e.jsx(I,{label:"Best rank",value:s.best_rank??null}),e.jsx(I,{label:"Parameters",value:s.num_parameters??null}),e.jsx(I,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(I,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(o).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(o).map(([a,u])=>e.jsxs("span",{className:"submission-metric-pill",children:[a,": ",String(u)]},a))}):e.jsx(y,{children:"No metrics"})]})]})}function I({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function cs({currentPayload:s,proposedPayload:t}){const n=s==null?void 0:s.source_url,i=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Current source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:D(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(y,{children:"No current URL"})}),e.jsx(j,{title:"Proposed source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(y,{children:"No proposed URL"})})]})}function Ne({url:s,empty:t}){return s?e.jsx("a",{className:"submission-url-link",href:D(s)??void 0,target:"_blank",rel:"noopener noreferrer",children:s}):e.jsx(y,{children:t})}function ds({proposedPayload:s}){var a;const{name:t,hf_slug:n,website_url:i,image:r}=s,o=r!=null&&r.url?Ce(r.url):(a=r==null?void 0:r.data_url)!=null&&a.startsWith("data:image/")?r.data_url:void 0;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Suggested organization name",children:e.jsx("span",{className:"submission-diff-pill added",children:t})}),e.jsx(j,{title:"Hugging Face organization",children:e.jsx(Ne,{url:n?`https://huggingface.co/${n}`:void 0,empty:"No Hugging Face organization provided"})}),e.jsx(j,{title:"Website",children:e.jsx(Ne,{url:i,empty:"No website provided"})}),e.jsx(j,{title:"Logo",children:o?e.jsx("img",{src:o,alt:(r==null?void 0:r.file_name)??"Suggested logo",className:"max-h-32 max-w-full rounded-md border border-border object-contain"}):e.jsx(y,{children:"No logo provided"})})]})}function us({proposedPayload:s}){const{title:t,source_url:n,abstract:i="",date_published:r,authors:o}=s;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(y,{children:"No title provided"})}),e.jsx(j,{title:"Publication date",children:r||e.jsx(y,{children:"No publication date provided"})}),e.jsx(j,{title:"Authors",children:o.length>0?o.map((a,u)=>e.jsx("span",{className:"submission-diff-pill added",children:a},`${a}-${u}`)):e.jsx(y,{children:"No authors provided"})}),e.jsx(j,{title:"Source URL",children:n?e.jsx("a",{className:"submission-url-link",href:D(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(y,{children:"No source URL provided"})}),e.jsx(j,{title:"Abstract",children:i?e.jsx("span",{className:"submission-field-value",children:i}):e.jsx(y,{children:"No abstract provided"})})]})}function K({kind:s,proposedPayload:t}){const n=typeof t.benchmark=="string"?t.benchmark:typeof t.name=="string"?t.name:"",i=typeof t.description=="string"?t.description:"",r=typeof t.year=="number"?t.year:null,o=typeof t.start_date=="string"?t.start_date:"",a=typeof t.end_date=="string"?t.end_date:"",u=typeof t.venue=="string"?t.venue:"",d=typeof t.url=="string"?t.url:"",p=t.image??{},v=typeof p.data_url=="string"&&p.data_url.startsWith("data:image/")?p.data_url:"",l=typeof p.url=="string"?Ce(p.url)??"":v,m=typeof p.file_name=="string"?p.file_name:"Suggested image",c=typeof t.image_credit=="string"?t.image_credit:"",f=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:`Suggested ${s} name`,children:n?e.jsx("span",{className:"submission-diff-pill added",children:n}):e.jsx(y,{children:"No name provided"})}),e.jsx(j,{title:"Description",children:i?e.jsx("span",{className:"submission-field-value",children:i}):e.jsx(y,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(j,{title:"Image",children:l?e.jsx("img",{src:l,alt:m,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(y,{children:"No image provided"})}),e.jsx(j,{title:"Image source",children:c||e.jsx(y,{children:"No image source provided"})})]}),s==="task"&&e.jsx(j,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(j,{title:"Task",children:e.jsx("span",{className:"submission-field-value",children:typeof t.task=="string"?t.task:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(j,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(j,{title:"Source",children:f?f.startsWith("http://")||f.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:D(f)??void 0,target:"_blank",rel:"noopener noreferrer",children:f}):e.jsx("span",{className:"submission-field-value",children:f}):e.jsx(y,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(j,{title:"Edition and dates",children:r?`${r}${o?` · ${o}${a?` – ${a}`:""}`:""}`:e.jsx(y,{children:"No edition provided"})}),e.jsx(j,{title:"Venue",children:u||e.jsx(y,{children:"No venue provided"})}),e.jsx(j,{title:"URL",children:d?e.jsx("a",{className:"submission-url-link",href:D(d)??void 0,target:"_blank",rel:"noopener noreferrer",children:d}):e.jsx(y,{children:"No URL provided"})})]})]})}function j({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function y({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ps({currentPayload:s,proposedPayload:t}){const n=s,i=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:i.map(({key:r,label:o})=>{const a=(n==null?void 0:n[r])??[],u=t[r];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:o}),e.jsx(te,{label:o.toLowerCase(),currentItems:a.map(d=>({url:d,is_official:!1})),proposedItems:u.map(d=>({url:d,is_official:!1}))})]},r)})})}function hs(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function ms({edit:s}){var n,i,r,o,a,u;let t;switch(s.edit_type){case"tasks":t=e.jsx(fe,{currentItems:((n=s.current_payload)==null?void 0:n.tasks)??[],proposedIds:s.proposed_payload.task_ids,queryPrefix:"task",fetchEntity:U.getTask.bind(U)});break;case"methods":t=e.jsx(fe,{currentItems:((i=s.current_payload)==null?void 0:i.methods)??[],proposedIds:s.proposed_payload.method_ids,queryPrefix:"method",fetchEntity:U.getMethod.bind(U)});break;case"organizations":t=e.jsx(as,{currentItems:((r=s.current_payload)==null?void 0:r.organizations)??[],proposedIds:s.proposed_payload.organization_ids});break;case"repositories":t=e.jsx(te,{label:"repositories",currentItems:((o=s.current_payload)==null?void 0:o.repositories)??[],proposedItems:s.proposed_payload.repositories});break;case"project_pages":t=e.jsx(te,{label:"project pages",currentItems:((a=s.current_payload)==null?void 0:a.project_pages)??[],proposedItems:s.proposed_payload.project_pages});break;case"evaluations":t=e.jsx(os,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"source_url":t=e.jsx(cs,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"hf_artifacts":t=e.jsx(ps,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"x_threads":t=e.jsx(te,{label:"X threads",currentItems:(((u=s.current_payload)==null?void 0:u.x_threads)??[]).map(({url:d})=>({url:d,is_official:!1})),proposedItems:s.proposed_payload.x_threads.map(d=>({url:d,is_official:!1}))});break;case"new_task":t=e.jsx(K,{kind:"task",proposedPayload:s.proposed_payload});break;case"new_method":t=e.jsx(K,{kind:"method",proposedPayload:s.proposed_payload});break;case"new_benchmark":t=e.jsx(K,{kind:"benchmark",proposedPayload:s.proposed_payload});break;case"new_metric":t=e.jsx(K,{kind:"metric",proposedPayload:s.proposed_payload});break;case"new_conference":t=e.jsx(K,{kind:"conference",proposedPayload:s.proposed_payload});break;case"new_organization":t=e.jsx(ds,{proposedPayload:s.proposed_payload});break;case"new_external_paper":t=e.jsx(us,{proposedPayload:s.proposed_payload});break;default:hs(s)}return e.jsxs("div",{className:"submission-diff-body",children:[t,e.jsx(rs,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const ke=25,fs=["pending","approved","rejected","all"],gs=["all","tasks","methods","evaluations","repositories","project_pages","source_url","x_threads","hf_artifacts","organizations","new_task","new_method","new_benchmark","new_metric","new_conference","new_organization","new_external_paper"],oe=["pending","approved","rejected"],bs=new Set(["new_task","new_method","new_benchmark","new_metric","new_conference"]);function xs(s){return s.slice(0,2).toUpperCase()}function J(s){return s.replace(/_/g," ")}function js(s){return s==="new_external_paper"?"external paper":J(s)}const vs={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_organization:{title:"New organization",subtitle:"Organization suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};function we(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const n=Date.now()-t.getTime(),i=Math.floor(n/6e4),r=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"just now":i<60?`${i}m ago`:r<24?`${r}h ago`:o<14?`${o}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function _s(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function ys(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function Ns(s){return[...s].sort((t,n)=>new Date(n.created_at).getTime()-new Date(t.created_at).getTime())}async function ks(s,t,n,i){const r=await Promise.all(s.map(p=>G.list({status:p,edit_type:t==="all"?void 0:t,reviewed_by_kind:n?"auto":void 0,limit:ke,offset:i[p]??0}))),o=Ns(r.flatMap(p=>p.results)).slice(0,ke),a={};s.forEach((p,v)=>{const l=o.filter(m=>r[v].results.includes(m)).length;a[p]=(i[p]??0)+l});const u=r.reduce((p,v)=>p+v.count,0),d=s.reduce((p,v)=>p+(a[v]??0),0);return{count:u,results:o,nextOffsets:o.length>0&&d{n.invalidateQueries({queryKey:["pendingPaperEdits"]}),n.invalidateQueries({queryKey:["pendingPaperEdit",g.id]}),g.paper_id!=null&&g.edit_type!=="evaluations"&&je(n,[String(g.paper_id),t==null?void 0:t.arxiv_id])},[t==null?void 0:t.arxiv_id,n]),f=se({mutationFn:()=>G.approve(s.id),onSuccess:g=>{var ee;c(g),g.edit_type==="evaluations"&&g.paper_id!=null?Le(n,ze(String(g.paper_id),((ee=g.current_payload)==null?void 0:ee.evaluations)??[],g.proposed_payload.operations.map(L=>L.op==="create"?{kind:"create",data:L.data}:L.op==="update"?{kind:"update",evaluationId:L.evaluation_id,data:L.data}:{kind:"delete",evaluationId:L.evaluation_id}),(t==null?void 0:t.arxiv_id)??void 0)):g.paper_id!=null&&!a&&ae(n),i({title:"Submission approved",description:a?`Marked ${J(s.edit_type)} suggestion as approved. No catalog changes were applied.`:`Applied ${J(s.edit_type)} changes for ${p}.`})},onError:g=>{i({title:"Could not approve submission",description:z(g,"Approval failed. Please try again."),variant:"destructive"})}}),x=se({mutationFn:()=>G.reject(s.id),onSuccess:g=>{c(g),i({title:"Submission rejected",description:`Rejected ${J(s.edit_type)} changes for ${p}.`})},onError:g=>{i({title:"Could not reject submission",description:z(g,"Rejection failed. Please try again."),variant:"destructive"})}}),_=se({mutationFn:()=>U.rollbackEvent(s.catalog_event_id),onSuccess:()=>{n.invalidateQueries({queryKey:["pendingPaperEdits"]}),s.paper_id!=null&&(je(n,[String(s.paper_id),t==null?void 0:t.arxiv_id]),ae(n)),i({title:"Edit reverted",description:`Restored ${p} to its previous state.`})},onError:g=>{i({title:"Could not revert edit",description:z(g,"The paper changed after this edit, or it was already reverted."),variant:"destructive"})}}),S=se({mutationFn:g=>G.revertAutoApproved(s.hf_subject,{suspend:g}),onSuccess:g=>{n.invalidateQueries({queryKey:["pendingPaperEdits"]}),ae(n),i({title:`Reverted ${g.reverted} edits by @${s.hf_username}`,description:g.skipped.length?`${g.skipped.length} were skipped because the paper changed since.`:void 0})},onError:g=>{i({title:"Could not revert edits",description:z(g,"Bulk revert failed. Please try again."),variant:"destructive"})}}),Q=g=>{const ee=`Revert every edit @${s.hf_username} had auto-applied in the last 7 days${g?" and suspend the account":""}?`;window.confirm(ee)&&S.mutate(g)},h=s.reviewed_by_kind==="auto",T=h&&!!s.catalog_event_id,M=f.isPending,$=x.isPending,ge=M||$,ne=_.isPending||S.isPending;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}):e.jsx("div",{className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:o?u.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:we(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:J(s.edit_type)}),h&&e.jsx("span",{className:"submission-pill",children:"Auto-applied"}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:A("submission-pill status",_s(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs($e,{className:"h-6 w-6",children:[e.jsx(qe,{src:v,alt:s.hf_username}),e.jsx(De,{className:"text-[10px]",children:xs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(ms,{edit:s})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:l?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>x.mutate(),disabled:ge,className:"submission-action-btn reject",children:[$?e.jsx(W,{className:"spin",size:14}):e.jsx(es,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>f.mutate(),disabled:ge,className:"submission-action-btn approve",children:[M?e.jsx(W,{className:"spin",size:14}):e.jsx(ss,{size:14}),"Approve"]})]})}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${we(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),m&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),T&&e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>_.mutate(),disabled:ne,className:"submission-action-btn reject",children:[_.isPending?e.jsx(W,{className:"spin",size:14}):e.jsx(ns,{size:14}),"Revert this edit"]}),s.hf_subject&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>Q(!1),disabled:ne,className:"submission-action-btn reject",children:["Revert all by @",s.hf_username]}),e.jsx("button",{type:"button",onClick:()=>Q(!0),disabled:ne,className:"submission-action-btn reject",children:"Revert all and suspend"})]})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:a?"Reviewed payload":"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function Ls(){var S,Q;const{toast:s}=Oe(),[t,n]=w.useState("pending"),[i,r]=w.useState("all"),[o,a]=w.useState(!1),u=Te({queryKey:["pendingPaperEdits","counts",i,o],queryFn:async()=>{const h=i==="all"?void 0:i,T=await Promise.all(oe.map(M=>G.list({status:M,edit_type:h,reviewed_by_kind:o?"auto":void 0,limit:1,offset:0})));return Object.fromEntries(T.map((M,$)=>[oe[$],M.count]))},staleTime:30*1e3}),d=Xe({queryKey:["pendingPaperEdits",{status:t,editType:i,autoOnly:o}],queryFn:({pageParam:h})=>ks(t==="all"?oe:[t],i,o,h),initialPageParam:{},getNextPageParam:h=>h.nextOffsets??void 0,retry:!1}),p=w.useMemo(()=>{var h;return((h=d.data)==null?void 0:h.pages.flatMap(T=>T.results))??[]},[d.data]),v=w.useMemo(()=>Array.from(new Set(p.map(h=>h.paper_id).filter(h=>h!=null))).sort((h,T)=>h-T),[p]),l=ie({queries:v.map(h=>({queryKey:Be.summary(String(h)),queryFn:()=>Pe.get(String(h),!1),staleTime:5*60*1e3}))}),m=w.useMemo(()=>{const h=new Map;return l.forEach(T=>{const M=T.data;if(!M)return;const $=Number(M.id);Number.isFinite($)&&h.set($,M)}),h},[l]);w.useEffect(()=>{d.error&&s({title:"Could not load submissions",description:z(d.error,"Failed to load pending paper edits."),variant:"destructive"})},[d.error,s]);const c=u.data,f=c?c.pending+c.approved+c.rejected:void 0,x={pending:c==null?void 0:c.pending,approved:c==null?void 0:c.approved,rejected:c==null?void 0:c.rejected,all:f},_=((Q=(S=d.data)==null?void 0:S.pages[0])==null?void 0:Q.count)??0;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{u.refetch(),d.refetch()},disabled:d.isFetching||u.isFetching,children:[e.jsx(Ze,{className:A((d.isFetching||u.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsxs("div",{className:"period-switch",children:[fs.map(h=>e.jsxs("button",{type:"button",className:A("period-btn",t===h&&"active"),onClick:()=>n(h),children:[h,x[h]!=null&&e.jsx("span",{className:"submission-count",children:x[h]})]},h)),e.jsx("button",{type:"button",className:A("period-btn",o&&"active"),onClick:()=>{a(h=>!h),o||n("approved")},children:"auto-applied only"})]})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:gs.map(h=>e.jsx("button",{type:"button",className:A("sort-btn",i===h&&"active"),onClick:()=>r(h),children:js(h)},h))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:d.isFetching?"refreshing":`${_} submissions`})})})}),d.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(W,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):d.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(ye,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:z(d.error,"The submissions response was invalid.")})]}):p.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ye,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:p.map(h=>e.jsx(ws,{submission:h,paper:h.paper_id==null?void 0:m.get(h.paper_id)},h.id))}),p.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",p.length," of ",_," submissions"]}),d.hasNextPage&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>d.fetchNextPage(),disabled:d.isFetching,children:[d.isFetchingNextPage&&e.jsx(W,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Ls as default}; diff --git a/assets/SubmissionsDashboard-eKjMsSf9.js b/assets/SubmissionsDashboard-eKjMsSf9.js new file mode 100644 index 0000000000000000000000000000000000000000..ff57f1b8873ea731629936e19ce40738dd45da49 --- /dev/null +++ b/assets/SubmissionsDashboard-eKjMsSf9.js @@ -0,0 +1,11 @@ +import{n as te,M as v,j as e,B as y,Z as ie,p as ae,t as E,f as re,au as oe,av as le,aw as de}from"./index-CbgxfyGU.js";import{u as J,r as ce,e as ue}from"./evaluationQueryInvalidation-BogLM1gw.js";import{a as pe,p as me}from"./paperQueryKeys-B8u1BWlI.js";import{i as G,a as Q}from"./queryInvalidation-Chlw4DEx.js";import{u as ne}from"./useQuery-Bx9s5-D2.js";import{u as A}from"./useMutation-P_trTy9i.js";import{u as he}from"./useInfiniteQuery-BAc_4HO5.js";import{c as C}from"./catalog-DhK7_9-6.js";import{s as fe}from"./safeExternalHref-CkBrsh84.js";import{E as U,s as T}from"./submissions-aWj7YtuZ.js";import{R as je,C as xe}from"./refresh-cw-Cps6nypW.js";import{L as I}from"./loader-circle-CWMja8Zn.js";import{C as ge}from"./circle-check-Bci9ZTu9.js";import"./curation-C7Gmmp4z.js";/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X=te("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ve=te("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);function j({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function g({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function k({url:s,empty:t,className:i}){return s?e.jsx("a",{className:y("submission-url-link",i),href:fe(s)??void 0,target:"_blank",rel:"noopener noreferrer",children:s}):t?e.jsx(g,{children:t}):null}function N({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function Y({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function be({currentPayload:s,proposedPayload:t}){const[i,a]=v.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>a(n=>!n),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(Y,{title:"Current payload",value:s??{}}),e.jsx(Y,{title:"Proposed payload",value:t})]})]})}function B({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:a,knownNames:n}){const o=v.useMemo(()=>Array.from(new Set([...s.map(d=>d.id),...t])).sort((d,f)=>d-f),[s,t]),c=J({queries:a?o.map(d=>({queryKey:[i,String(d)],queryFn:()=>a(String(d)),staleTime:5*60*1e3})):[]}),h=v.useMemo(()=>{const d=new Map;return s.forEach(f=>d.set(f.id,f.name)),n==null||n.forEach((f,x)=>d.set(x,f)),c.forEach(({data:f})=>{f&&d.set(Number(f.id),f.name)}),d},[s,c,n]),r=new Set(s.map(d=>d.id)),u=new Set(t),m=(d,f)=>e.jsx("span",{className:y("submission-diff-pill",f==="current"&&!u.has(d)&&"removed",f==="proposed"&&!r.has(d)&&"added"),children:h.get(d)??`#${d}`},d);return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Currently tagged",children:s.length>0?s.map(d=>m(d.id,"current")):e.jsx(g,{children:"No current tags"})}),e.jsx(j,{title:"Will be tagged",children:t.length>0?t.map(d=>m(d,"proposed")):e.jsx(g,{children:"No proposed tags"})})]})}function ye({currentItems:s,proposedIds:t}){var n;const i=ne({queryKey:["organizations","submission-diff"],queryFn:()=>C.organizations(),staleTime:3e5}),a=new Map(s.map(o=>[o.id,o.name]));return(n=i.data)==null||n.results.forEach(o=>{a.set(Number(o.id),o.name)}),e.jsx(B,{currentItems:s,proposedIds:t,queryPrefix:"organization",knownNames:a})}function V(s,t,i){return J({queries:t.map(a=>({queryKey:[s,String(a)],queryFn:()=>i(String(a)),staleTime:5*60*1e3})),combine:a=>new Map(a.flatMap(({data:n})=>n?[[Number(n.id),n.name]]:[]))})}function _e({edit:s}){const t=v.useMemo(()=>{var r;return((r=s.current_payload)==null?void 0:r.evaluations)??[]},[s.current_payload]),i=s.proposed_payload.operations,{taskIds:a,datasetIds:n}=v.useMemo(()=>{const r=[...t,...i.flatMap(m=>m.op==="delete"?[]:[m.data])],u=m=>Array.from(new Set(r.flatMap(d=>d[m]?[d[m]]:[])));return{taskIds:u("task_id"),datasetIds:u("dataset_id")}},[t,i]),o=V("task",a,r=>C.getTask(r)),c=V("dataset",n,r=>C.getDataset(r)),h=new Map(t.filter(r=>r.id!=null).map(r=>[r.id,r]));return i.length===0?e.jsx(g,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:i.map((r,u)=>{const m=r.op==="create"?void 0:r.evaluation_id,d=m?h.get(m):void 0,f=r.op==="update"?{...d,...r.data}:r.op==="create"?r.data:d??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:y("submission-pill status",r.op==="create"&&"approved",r.op==="update"&&"changed",r.op==="delete"&&"rejected"),children:r.op}),m&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",m]})]}),e.jsx(Ne,{evaluation:f,taskNames:o,datasetNames:c})]},`${r.op}-${m??u}`)})})}function Ne({evaluation:s,taskNames:t,datasetNames:i}){const{task_id:a,dataset_id:n}=s,o=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(N,{label:"Task",value:a?t.get(a)??`#${a}`:null}),e.jsx(N,{label:"Dataset",value:n?i.get(n)??`#${n}`:null}),e.jsx(N,{label:"Model",value:s.model_name||null}),e.jsx(N,{label:"Harness",value:s.harness||null}),e.jsx(N,{label:"Best rank",value:s.best_rank??null}),e.jsx(N,{label:"Parameters",value:s.num_parameters??null}),e.jsx(N,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(N,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(o).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(o).map(([c,h])=>e.jsxs("span",{className:"submission-metric-pill",children:[c,": ",String(h)]},c))}):e.jsx(g,{children:"No metrics"})]})]})}function O({label:s,currentItems:t,proposedItems:i}){const a=new Map(t.map(c=>[c.url,c])),n=new Map(i.map(c=>[c.url,c])),o=Array.from(new Set([...a.keys(),...n.keys()])).sort();return o.length===0?e.jsxs(g,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:o.map(c=>{var f;const h=a.get(c),r=n.get(c),u=!h&&r,m=h&&!r,d=h&&r&&h.is_official!==r.is_official;return e.jsx("div",{className:y("submission-url-row",u&&"added",m&&"removed",d&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx(k,{url:c,className:y(m&&"removed")}),u&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),m&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),d&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(h.is_official)," ","->"," ",String(r.is_official)]}),((f=r??h)==null?void 0:f.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},c)})})}const L=s=>({url:s,is_official:!1});function ke({edit:s}){const t=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:t.map(({key:i,label:a})=>{var n;return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:a}),e.jsx(O,{label:a.toLowerCase(),currentItems:(((n=s.current_payload)==null?void 0:n[i])??[]).map(L),proposedItems:s.proposed_payload[i].map(L)})]},i)})})}function we({edit:s}){var t;return e.jsx(O,{label:"X threads",currentItems:(((t=s.current_payload)==null?void 0:t.x_threads)??[]).map(({url:i})=>L(i)),proposedItems:s.proposed_payload.x_threads.map(L)})}function Se({edit:s}){var t;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Current source URL",children:e.jsx(k,{url:(t=s.current_payload)==null?void 0:t.source_url,empty:"No current URL"})}),e.jsx(j,{title:"Proposed source URL",children:e.jsx(k,{url:s.proposed_payload.source_url,empty:"No proposed URL"})})]})}const Ee={new_task:"task",new_method:"method",new_benchmark:"benchmark",new_metric:"metric",new_conference:"conference"};function z({text:s,empty:t}){return s?e.jsx("span",{className:"submission-field-value",children:s}):e.jsx(g,{children:t})}function Z({edit:s}){var n;const{image:t,image_credit:i}=s.proposed_payload,a=(t==null?void 0:t.url)!==void 0?ie(t.url)??"":(n=t==null?void 0:t.data_url)!=null&&n.startsWith("data:image/")?t.data_url:"";return e.jsxs(e.Fragment,{children:[e.jsx(j,{title:"Image",children:a?e.jsx("img",{src:a,alt:(t==null?void 0:t.file_name)??"Suggested image",className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(g,{children:"No image provided"})}),e.jsx(j,{title:"Image source",children:i||e.jsx(g,{children:"No image source provided"})})]})}function Ce({edit:s}){switch(s.edit_type){case"new_task":{const{parent_id:t,area_id:i,keywords:a}=s.proposed_payload;return e.jsxs(e.Fragment,{children:[e.jsx(Z,{edit:s}),e.jsx(j,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t??null,area_id:i??null,keywords:a??null})})})]})}case"new_method":{const t=s.proposed_payload.source_url??"";return e.jsxs(e.Fragment,{children:[e.jsx(Z,{edit:s}),e.jsx(j,{title:"Source",children:/^https?:\/\//.test(t)?e.jsx(k,{url:t}):e.jsx(z,{text:t,empty:"No source provided"})})]})}case"new_benchmark":{const t=s.proposed_payload;return e.jsx(j,{title:"Task",children:e.jsx("span",{className:"submission-field-value",children:"task"in t?t.task:JSON.stringify(t.task_ids)})})}case"new_metric":{const{direction:t,scale:i,task_id:a,dataset_id:n}=s.proposed_payload;return e.jsx(j,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t,scale:i,task_id:a,dataset_id:n})})})}case"new_conference":{const{year:t,start_date:i,end_date:a,venue:n,url:o}=s.proposed_payload;return e.jsxs(e.Fragment,{children:[e.jsx(j,{title:"Edition and dates",children:t?`${t}${i?` · ${i}${a?` – ${a}`:""}`:""}`:e.jsx(g,{children:"No edition provided"})}),e.jsx(j,{title:"Venue",children:n||e.jsx(g,{children:"No venue provided"})}),e.jsx(j,{title:"URL",children:e.jsx(k,{url:o,empty:"No URL provided"})})]})}}}function Pe({edit:s}){const t=s.proposed_payload,i="benchmark"in t?t.benchmark:t.name;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:`Suggested ${Ee[s.edit_type]} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(g,{children:"No name provided"})}),e.jsx(j,{title:"Description",children:e.jsx(z,{text:t.description,empty:"No description provided"})}),e.jsx(Ce,{edit:s})]})}function Re({edit:s}){var c;const{name:t,hf_slug:i,website_url:a,image:n}=s.proposed_payload,o=n!=null&&n.url?ie(n.url):(c=n==null?void 0:n.data_url)!=null&&c.startsWith("data:image/")?n.data_url:void 0;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Suggested organization name",children:e.jsx("span",{className:"submission-diff-pill added",children:t})}),e.jsx(j,{title:"Hugging Face organization",children:e.jsx(k,{url:i?`https://huggingface.co/${i}`:void 0,empty:"No Hugging Face organization provided"})}),e.jsx(j,{title:"Website",children:e.jsx(k,{url:a,empty:"No website provided"})}),e.jsx(j,{title:"Logo",children:o?e.jsx("img",{src:o,alt:(n==null?void 0:n.file_name)??"Suggested logo",className:"max-h-32 max-w-full rounded-md border border-border object-contain"}):e.jsx(g,{children:"No logo provided"})})]})}function Me({edit:s}){const{title:t,source_url:i,abstract:a,date_published:n,authors:o}=s.proposed_payload;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Title",children:e.jsx(z,{text:t,empty:"No title provided"})}),e.jsx(j,{title:"Publication date",children:n||e.jsx(g,{children:"No publication date provided"})}),e.jsx(j,{title:"Authors",children:o.length>0?o.map((c,h)=>e.jsx("span",{className:"submission-diff-pill added",children:c},`${c}-${h}`)):e.jsx(g,{children:"No authors provided"})}),e.jsx(j,{title:"Source URL",children:e.jsx(k,{url:i,empty:"No source URL provided"})}),e.jsx(j,{title:"Abstract",children:e.jsx(z,{text:a,empty:"No abstract provided"})})]})}function Te(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function Ie({edit:s}){var t,i,a,n,o;switch(s.edit_type){case"tasks":return e.jsx(B,{currentItems:((t=s.current_payload)==null?void 0:t.tasks)??[],proposedIds:s.proposed_payload.task_ids,queryPrefix:"task",fetchEntity:c=>C.getTask(c)});case"methods":return e.jsx(B,{currentItems:((i=s.current_payload)==null?void 0:i.methods)??[],proposedIds:s.proposed_payload.method_ids,queryPrefix:"method",fetchEntity:c=>C.getMethod(c)});case"organizations":return e.jsx(ye,{currentItems:((a=s.current_payload)==null?void 0:a.organizations)??[],proposedIds:s.proposed_payload.organization_ids});case"repositories":return e.jsx(O,{label:"repositories",currentItems:((n=s.current_payload)==null?void 0:n.repositories)??[],proposedItems:s.proposed_payload.repositories});case"project_pages":return e.jsx(O,{label:"project pages",currentItems:((o=s.current_payload)==null?void 0:o.project_pages)??[],proposedItems:s.proposed_payload.project_pages});case"evaluations":return e.jsx(_e,{edit:s});case"source_url":return e.jsx(Se,{edit:s});case"hf_artifacts":return e.jsx(ke,{edit:s});case"x_threads":return e.jsx(we,{edit:s});case"new_task":case"new_method":case"new_benchmark":case"new_metric":case"new_conference":return e.jsx(Pe,{edit:s});case"new_organization":return e.jsx(Re,{edit:s});case"new_external_paper":return e.jsx(Me,{edit:s});default:return Te(s)}}function $e({edit:s}){return e.jsxs("div",{className:"submission-diff-body",children:[e.jsx(Ie,{edit:s}),e.jsx(be,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const ee=25,Fe=["pending","approved","rejected","all"],Ae=["all",...Object.keys(U)],K=["pending","approved","rejected"];function De(s){return s.slice(0,2).toUpperCase()}function D(s){return s.replace(/_/g," ")}function se(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const i=Date.now()-t.getTime(),a=Math.floor(i/6e4),n=Math.floor(i/36e5),o=Math.floor(i/864e5);return a<1?"just now":a<60?`${a}m ago`:n<24?`${n}h ago`:o<14?`${o}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function Ue(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function Oe(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function Le(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function ze(s,t,i,a){const n=await Promise.all(s.map(u=>T.list({status:u,edit_type:t==="all"?void 0:t,reviewed_by_kind:i?"auto":void 0,limit:ee,offset:a[u]??0}))),o=Le(n.flatMap(u=>u.results)).slice(0,ee),c={};s.forEach((u,m)=>{const d=o.filter(f=>n[m].results.includes(f)).length;c[u]=(a[u]??0)+d});const h=n.reduce((u,m)=>u+m.count,0),r=s.reduce((u,m)=>u+(c[m]??0),0);return{count:h,results:o,nextOffsets:o.length>0&&r{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),i.invalidateQueries({queryKey:["pendingPaperEdit",p.id]}),p.paper_id!=null&&p.edit_type!=="evaluations"&&G(i,[String(p.paper_id),t==null?void 0:t.arxiv_id])},[t==null?void 0:t.arxiv_id,i]),$=A({mutationFn:()=>T.approve(s.id),onSuccess:p=>{var F;x(p),p.edit_type==="evaluations"&&p.paper_id!=null?ce(i,ue(String(p.paper_id),((F=p.current_payload)==null?void 0:F.evaluations)??[],p.proposed_payload.operations,(t==null?void 0:t.arxiv_id)??void 0)):p.paper_id!=null&&!c&&Q(i),a({title:"Submission approved",description:c?`Marked ${D(s.edit_type)} suggestion as approved. No catalog changes were applied.`:`Applied ${D(s.edit_type)} changes for ${u}.`})},onError:p=>{a({title:"Could not approve submission",description:E(p,"Approval failed. Please try again."),variant:"destructive"})}}),P=A({mutationFn:()=>T.reject(s.id),onSuccess:p=>{x(p),a({title:"Submission rejected",description:`Rejected ${D(s.edit_type)} changes for ${u}.`})},onError:p=>{a({title:"Could not reject submission",description:E(p,"Rejection failed. Please try again."),variant:"destructive"})}}),S=A({mutationFn:()=>C.rollbackEvent(s.catalog_event_id),onSuccess:()=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),s.paper_id!=null&&(G(i,[String(s.paper_id),t==null?void 0:t.arxiv_id]),Q(i)),a({title:"Edit reverted",description:`Restored ${u} to its previous state.`})},onError:p=>{a({title:"Could not revert edit",description:E(p,"The paper changed after this edit, or it was already reverted."),variant:"destructive"})}}),R=A({mutationFn:p=>T.revertAutoApproved(s.hf_subject,{suspend:p}),onSuccess:p=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),Q(i),a({title:`Reverted ${p.reverted} edits by @${s.hf_username}`,description:p.skipped.length?`${p.skipped.length} were skipped because the paper changed since.`:void 0})},onError:p=>{a({title:"Could not revert edits",description:E(p,"Bulk revert failed. Please try again."),variant:"destructive"})}}),M=p=>{const F=`Revert every edit @${s.hf_username} had auto-applied in the last 7 days${p?" and suspend the account":""}?`;window.confirm(F)&&R.mutate(p)},l=s.reviewed_by_kind==="auto",_=l&&!!s.catalog_event_id,b=$.isPending,w=P.isPending,H=b||w,q=S.isPending||R.isPending;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[r?e.jsx("a",{href:`/paper/${encodeURIComponent(r)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:u}):e.jsx("div",{className:"submission-title",children:u}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:o?h.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:se(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:D(s.edit_type)}),l&&e.jsx("span",{className:"submission-pill",children:"Auto-applied"}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:y("submission-pill status",Ue(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(oe,{className:"h-6 w-6",children:[e.jsx(le,{src:m,alt:s.hf_username}),e.jsx(de,{className:"text-[10px]",children:De(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx($e,{edit:s})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:d?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>P.mutate(),disabled:H,className:"submission-action-btn reject",children:[w?e.jsx(I,{className:"spin",size:14}):e.jsx(xe,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>$.mutate(),disabled:H,className:"submission-action-btn approve",children:[b?e.jsx(I,{className:"spin",size:14}):e.jsx(ge,{size:14}),"Approve"]})]})}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${se(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),f&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),_&&e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>S.mutate(),disabled:q,className:"submission-action-btn reject",children:[S.isPending?e.jsx(I,{className:"spin",size:14}):e.jsx(ve,{size:14}),"Revert this edit"]}),s.hf_subject&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>M(!1),disabled:q,className:"submission-action-btn reject",children:["Revert all by @",s.hf_username]}),e.jsx("button",{type:"button",onClick:()=>M(!0),disabled:q,className:"submission-action-btn reject",children:"Revert all and suspend"})]})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:c?"Reviewed payload":"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function is(){var R,M;const{toast:s}=ae(),[t,i]=v.useState("pending"),[a,n]=v.useState("all"),[o,c]=v.useState(!1),h=ne({queryKey:["pendingPaperEdits","counts",a,o],queryFn:async()=>{const l=a==="all"?void 0:a,_=await Promise.all(K.map(b=>T.list({status:b,edit_type:l,reviewed_by_kind:o?"auto":void 0,limit:1,offset:0})));return Object.fromEntries(_.map((b,w)=>[K[w],b.count]))},staleTime:30*1e3}),r=he({queryKey:["pendingPaperEdits",{status:t,editType:a,autoOnly:o}],queryFn:({pageParam:l})=>ze(t==="all"?K:[t],a,o,l),initialPageParam:{},getNextPageParam:l=>l.nextOffsets??void 0,retry:!1}),u=v.useMemo(()=>{var l;return((l=r.data)==null?void 0:l.pages.flatMap(_=>_.results))??[]},[r.data]),m=v.useMemo(()=>Array.from(new Set(u.map(l=>l.paper_id).filter(l=>l!=null))).sort((l,_)=>l-_),[u]),d=J({queries:m.map(l=>({queryKey:me.summary(String(l)),queryFn:()=>pe.get(String(l),!1),staleTime:5*60*1e3}))}),f=v.useMemo(()=>{const l=new Map;return d.forEach(_=>{const b=_.data;if(!b)return;const w=Number(b.id);Number.isFinite(w)&&l.set(w,b)}),l},[d]);v.useEffect(()=>{r.error&&s({title:"Could not load submissions",description:E(r.error,"Failed to load pending paper edits."),variant:"destructive"})},[r.error,s]);const x=h.data,$=x?x.pending+x.approved+x.rejected:void 0,P={pending:x==null?void 0:x.pending,approved:x==null?void 0:x.approved,rejected:x==null?void 0:x.rejected,all:$},S=((M=(R=r.data)==null?void 0:R.pages[0])==null?void 0:M.count)??0;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{h.refetch(),r.refetch()},disabled:r.isFetching||h.isFetching,children:[e.jsx(je,{className:y((r.isFetching||h.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsxs("div",{className:"period-switch",children:[Fe.map(l=>e.jsxs("button",{type:"button",className:y("period-btn",t===l&&"active"),onClick:()=>i(l),children:[l,P[l]!=null&&e.jsx("span",{className:"submission-count",children:P[l]})]},l)),e.jsx("button",{type:"button",className:y("period-btn",o&&"active"),onClick:()=>{c(l=>!l),o||i("approved")},children:"auto-applied only"})]})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:Ae.map(l=>e.jsx("button",{type:"button",className:y("sort-btn",a===l&&"active"),onClick:()=>n(l),children:l==="all"?"all":U[l].label},l))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:r.isFetching?"refreshing":`${S} submissions`})})})}),r.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(I,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):r.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(X,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:E(r.error,"The submissions response was invalid.")})]}):u.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(X,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:u.map(l=>e.jsx(qe,{submission:l,paper:l.paper_id==null?void 0:f.get(l.paper_id)},l.id))}),u.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",u.length," of ",S," submissions"]}),r.hasNextPage&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>r.fetchNextPage(),disabled:r.isFetching,children:[r.isFetchingNextPage&&e.jsx(I,{className:"spin",size:14}),"Load more"]})]})]})]})}export{is as default}; diff --git a/assets/SubmitView-CCWdg0_v.js b/assets/SubmitView-C6p4dpHt.js similarity index 88% rename from assets/SubmitView-CCWdg0_v.js rename to assets/SubmitView-C6p4dpHt.js index 65c9abcd38394b9b8344ebdfa92ef3f11dca40c4..b5334886b3b967fc723f2871a4ed64c1c3ea571b 100644 --- a/assets/SubmitView-CCWdg0_v.js +++ b/assets/SubmitView-C6p4dpHt.js @@ -1 +1 @@ -import{c as D,f as E,p as C,a as F,e as N,K as o,s as X,j as e,h as z}from"./index-YwiKC6Po.js";import{u as U}from"./useMutation-f6iDkf3w.js";import{A as O,a as q}from"./alert-Cx5luC5D.js";import{B as P}from"./button-B90pJJiy.js";import{I as h}from"./input-DEeEc0bH.js";import{T as B}from"./textarea-BPIMGf5w.js";import{a as H}from"./paperQueryKeys-C5FMa4Oj.js";import{a as M}from"./queryInvalidation-Dgyv9_oM.js";import"./curation-CkzNFTMJ.js";const S="pwc:paper-submit-draft",R={color:"var(--accent-text)",fontWeight:600,textDecoration:"underline",textUnderlineOffset:2},V=/^\d{4}\.\d{4,5}(v\d+)?$/i,J=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,W=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function k(l){const i=l.trim();return i?V.test(i)||J.test(i)||W.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function $(l,i){const r=l.trim();if(k(r)==="arxiv")return/^https?:\/\//i.test(r)?{source_url:r}:{arxiv_id:r};const s={source_url:r},p=i.title.trim();p&&(s.title=p);const d=i.abstract.trim();d&&(s.abstract=d);const n=i.authors.split(/[,\n]/).map(c=>c.trim()).filter(Boolean);return n.length>0&&(s.authors=n),i.datePublished&&(s.date_published=i.datePublished),s}const re=()=>{const l=D(),i=E(),{toast:r}=C(),{user:g,isLoading:s}=F(),[p]=N(),d=p.get("arxiv_id")??"",[n,c]=o.useState(d),[f,j]=o.useState(""),[x,w]=o.useState(""),[b,I]=o.useState(""),[v,_]=o.useState(""),[A,y]=o.useState(null);o.useEffect(()=>{if(d)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const a=JSON.parse(t);c(a.input??""),j(a.title??""),w(a.abstract??""),I(a.authors??""),_(a.datePublished??"")}catch{}}},[d]);const m=k(n),L=m==="external",u=U({mutationFn:t=>H.submit(t),onSuccess:t=>{if(t.pending_review){r({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),u.reset();return}M(i);const a=t.refreshed&&t.created&&t.latest_version;r({title:a?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:a?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&l(`/paper/${t.route_identifier}`)},onError:t=>{y(X(t,"Submission failed"))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!g){sessionStorage.setItem(S,JSON.stringify({input:n,title:f,abstract:x,authors:b,datePublished:v})),window.location.assign(z(window.location.href));return}const a=$(n,{title:f,abstract:x,authors:b,datePublished:v});u.mutate(a)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is on arXiv, submit it on"," ",e.jsx("a",{href:"https://huggingface.co/papers/submit",target:"_blank",rel:"noopener noreferrer",style:R,children:"Hugging Face"}),", which will automatically index it on Papers with Code."]}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is not on arXiv, submit it here. Non-arXiv papers (blog posts, technical reports, model release pages) enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",style:R,children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:n,onChange:t=>c(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),L&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:f,onChange:t=>j(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(B,{id:"submit-abstract",value:x,onChange:t=>w(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:b,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:v,onChange:t=>_(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),A&&e.jsx(O,{variant:"destructive",children:e.jsx(q,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:u.isPending||s,children:s?"Checking sign-in…":u.isPending?"Submitting…":g?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>l(-1),disabled:u.isPending,children:"Cancel"})]})]})]})};export{re as default}; +import{c as D,f as E,p as C,a as F,e as N,M as o,t as X,j as e,h as z}from"./index-CbgxfyGU.js";import{u as U}from"./useMutation-P_trTy9i.js";import{A as O,a as M}from"./alert-CFDDvdIM.js";import{B as P}from"./button-Bv9oZ-QU.js";import{I as h}from"./input-B6pxtfPe.js";import{T as q}from"./textarea-Bf06GTSH.js";import{a as B}from"./paperQueryKeys-B8u1BWlI.js";import{a as H}from"./queryInvalidation-Chlw4DEx.js";import"./curation-C7Gmmp4z.js";const S="pwc:paper-submit-draft",R={color:"var(--accent-text)",fontWeight:600,textDecoration:"underline",textUnderlineOffset:2},V=/^\d{4}\.\d{4,5}(v\d+)?$/i,J=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,W=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function k(l){const i=l.trim();return i?V.test(i)||J.test(i)||W.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function $(l,i){const r=l.trim();if(k(r)==="arxiv")return/^https?:\/\//i.test(r)?{source_url:r}:{arxiv_id:r};const s={source_url:r},p=i.title.trim();p&&(s.title=p);const d=i.abstract.trim();d&&(s.abstract=d);const n=i.authors.split(/[,\n]/).map(c=>c.trim()).filter(Boolean);return n.length>0&&(s.authors=n),i.datePublished&&(s.date_published=i.datePublished),s}const re=()=>{const l=D(),i=E(),{toast:r}=C(),{user:g,isLoading:s}=F(),[p]=N(),d=p.get("arxiv_id")??"",[n,c]=o.useState(d),[f,j]=o.useState(""),[x,w]=o.useState(""),[b,I]=o.useState(""),[v,_]=o.useState(""),[A,y]=o.useState(null);o.useEffect(()=>{if(d)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const a=JSON.parse(t);c(a.input??""),j(a.title??""),w(a.abstract??""),I(a.authors??""),_(a.datePublished??"")}catch{}}},[d]);const m=k(n),L=m==="external",u=U({mutationFn:t=>B.submit(t),onSuccess:t=>{if(t.pending_review){r({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),u.reset();return}H(i);const a=t.refreshed&&t.created&&t.latest_version;r({title:a?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:a?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&l(`/paper/${t.route_identifier}`)},onError:t=>{y(X(t,"Submission failed"))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!g){sessionStorage.setItem(S,JSON.stringify({input:n,title:f,abstract:x,authors:b,datePublished:v})),window.location.assign(z(window.location.href));return}const a=$(n,{title:f,abstract:x,authors:b,datePublished:v});u.mutate(a)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is on arXiv, submit it on"," ",e.jsx("a",{href:"https://huggingface.co/papers/submit",target:"_blank",rel:"noopener noreferrer",style:R,children:"Hugging Face"}),", which will automatically index it on Papers with Code."]}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is not on arXiv, submit it here. Non-arXiv papers (blog posts, technical reports, model release pages) enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",style:R,children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:n,onChange:t=>c(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),L&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:f,onChange:t=>j(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(q,{id:"submit-abstract",value:x,onChange:t=>w(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:b,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:v,onChange:t=>_(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),A&&e.jsx(O,{variant:"destructive",children:e.jsx(M,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:u.isPending||s,children:s?"Checking sign-in…":u.isPending?"Submitting…":g?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>l(-1),disabled:u.isPending,children:"Cancel"})]})]})]})};export{re as default}; diff --git a/assets/TagBrowseView-BzhdvNbn.js b/assets/TagBrowseView-CRgLg1ki.js similarity index 84% rename from assets/TagBrowseView-BzhdvNbn.js rename to assets/TagBrowseView-CRgLg1ki.js index 5f1f587c9f156f31f1647dd4f69ee3fb1eacfc63..e8f4cdfa814d13d6850fa207856d28d21cdd9c32 100644 --- a/assets/TagBrowseView-BzhdvNbn.js +++ b/assets/TagBrowseView-CRgLg1ki.js @@ -1 +1 @@ -import{j as e,L as g,K as ce,u as le,c as oe,r as j,q as de,Y as me}from"./index-YwiKC6Po.js";import{R as he}from"./ResearchFollowButton-BFXC8E3t.js";import{u as K}from"./useQuery-DPH6Mb2w.js";import{M as pe}from"./SotaBadges-DiQuEzfo.js";import{u as ue,b as ge,a as be}from"./PaperFeed-kaLm5US2.js";import{A as L}from"./arrow-right-CSx7rJG4.js";import{B as xe}from"./BenchmarkTrendSparkline-BBLKxMdW.js";import{M as U}from"./MarkdownText-C-8yLDus.js";import{c as O}from"./catalog-B15Yh5dN.js";import{p as je,a as ke}from"./paperQueryKeys-C5FMa4Oj.js";import{i as _e}from"./apiErrors-DBfE_SVR.js";import{f as fe}from"./frameworks-DDA0P4Tf.js";import{s as Ne}from"./slug-BpH-Nkvz.js";import{d as N,t as we}from"./transform-CNg3rvXk.js";import{u as ve}from"./usePapers-C1deOZKl.js";import{S as P}from"./skeleton-CXR1qouH.js";import{A as ye,a as Se}from"./alert-Cx5luC5D.js";import Ee from"./NotFound-D8hwuoEl.js";import{T as Te}from"./trophy-B60aAfG3.js";import{G as $e}from"./github-BZMCt7Ub.js";import"./useMutation-f6iDkf3w.js";import"./research-5UpiU-ea.js";import"./plus-Cfz0QbT1.js";import"./colors-BkWRhvFI.js";import"./PaperCard-FG-bEpJk.js";import"./AuthorAvatar-CoTET6B3.js";import"./Icon-DXQ4sjQk.js";import"./LatexTitle-DI6voLfI.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D7ygxg37.js";import"./useIntersectionObserver-Dt36kyjs.js";/* empty css */import"./PaperPreviewLink-CKfmgBjs.js";import"./index-CoRCN2p0.js";import"./index-BM_xSDJM.js";import"./katex-DkKDou_j.js";import"./hover-card-BY9tUGxy.js";import"./curation-CkzNFTMJ.js";import"./useInfiniteQuery-BEbL80ez.js";const Be=()=>e.jsxs(g,{to:"/astra-for-robotics",className:"task-featured-collection","aria-label":"Featured collection: GPT-6 Astra for Robotics",children:[e.jsx("span",{className:"task-featured-collection-eyebrow",children:"Featured collection"}),e.jsx("strong",{children:"GPT-6 Astra for Robotics"}),e.jsx("span",{className:"task-featured-collection-description",children:"Papers and demos that put GPT-6 Astra in control of real and simulated robots, as the policy itself or as an agent orchestrating the stack."}),e.jsxs("span",{className:"task-featured-collection-meta",children:["Explore the collection",e.jsx(L,{size:14,"aria-hidden":"true"})]})]}),W=n=>{const c=n.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(d=>d.trim()).filter(Boolean):[]};function Ce(n,c){const d=W(n);if(c===void 0)return"standard";const i=new Set(W(c).map(l=>l.toLowerCase())),m=d.filter(l=>!i.has(l.toLowerCase()));return m.length?m.join(", "):n}function Me(n,c){const d=new Map(n.map(l=>[l.id,l])),i=l=>{const x=new Set([l.id]);let k=l;for(;;){const w=c(k),_=w?d.get(w):void 0;if(!_)return k.id;if(x.has(_.id))return l.id;x.add(_.id),k=_}},m=new Map;return n.forEach(l=>{const x=i(l);m.set(x,[...m.get(x)||[],l])}),[...m].map(([l,x])=>({key:l,members:[d.get(l),...x.filter(k=>k.id!==l)]}))}const R=3,Fe=[{slug:"healthcare",eyebrow:"Clinical systems",title:"Clinical AI & Healthcare",description:"Agents, clinical workflows, medical calculators, safety, and decision support.",href:"#benchmarks"},{slug:"medical-question-answering",eyebrow:"Language & reasoning",title:"Medical Question Answering",description:"Medical exams, biomedical evidence, clinical comprehension, and explanations.",href:"/tasks/medical-question-answering"},{slug:"medical-imaging",eyebrow:"Vision",title:"Medical Imaging",description:"Radiology, pathology, ophthalmology, ultrasound, and diagnostic imaging.",href:"/tasks/medical-imaging"},{slug:"medical-visual-question-answering",eyebrow:"Multimodal",title:"Medical Visual Question Answering",description:"Questions grounded in radiology, pathology, and other biomedical images.",href:"/tasks/medical-visual-question-answering"}],Ae=({frameworks:n})=>n.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),n.map(c=>e.jsxs(g,{to:`/papers?framework=${encodeURIComponent(c.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:c.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",fe(c.num_stars)]})]},c.framework_id))]}),Pe=({task:n,area:c,parents:d})=>e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(g,{to:"/tasks",children:"Tasks"}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks#area-${Ne(c.name)}`,children:c.name})]}),[...d].reverse().map(i=>e.jsxs(ce.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks/${i.slug||i.id}`,children:N(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:N(n.name,n.slug)})]}),Re=({task:n,relatedTasks:c})=>{const d=new Map([n,...c].map(i=>[i.slug,i]));return e.jsxs("section",{className:"medical-ai-hub","aria-labelledby":"medical-ai-hub-title",children:[e.jsxs("div",{className:"medical-ai-hub-heading",children:[e.jsx("span",{children:"Medical AI directory"}),e.jsx("h2",{id:"medical-ai-hub-title",children:"Explore Healthcare & Medical AI"}),e.jsx("p",{children:"Browse the field by clinical application, language, vision, or multimodal reasoning."})]}),e.jsx("div",{className:"medical-ai-hub-grid",children:Fe.map(i=>{const m=d.get(i.slug),l=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"medical-ai-hub-card-eyebrow",children:i.eyebrow}),e.jsx("strong",{children:i.title}),e.jsx("span",{className:"medical-ai-hub-card-description",children:i.description}),e.jsxs("span",{className:"medical-ai-hub-card-meta",children:[(m==null?void 0:m.paper_count)!=null?`${m.paper_count.toLocaleString()} papers`:"Explore task",e.jsx(L,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:l},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:l},i.slug)})})]})},Le=n=>[...n].sort((c,d)=>{const i=c.slug==="classic-language-modeling",m=d.slug==="classic-language-modeling";return i!==m?i?1:-1:0}),ws=()=>{var z,V,G;const{taskSlug:n}=le(),c=oe(),d=ue(),{searchParams:i}=d,[m,l]=j.useState(!1),[x,k]=j.useState({}),[w,_]=j.useState(()=>new Set),{preferences:Y}=de(),T=(s,a)=>{const t=s||"";return a?`/benchmark/${t}?task=${encodeURIComponent(a)}`:`/benchmark/${t}`},v=Y.hide_closed_source_evals?!0:void 0,h=K({queryKey:["task-page",n,v],queryFn:()=>O.taskPage(n,{is_open:v}),enabled:!!n,staleTime:10*60*1e3});j.useEffect(()=>{var t;const s=(t=h.data)==null?void 0:t.task.slug;if(!n||!s||s===n)return;const a=i.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(z=h.data)==null?void 0:z.task.slug,i,n]);const I=K({queryKey:["task-benchmark-trends",n,v],queryFn:()=>O.trendingBenchmarks(n,{limit:100,min_recent_papers:0,is_open:v}),enabled:!!n,staleTime:10*60*1e3}),y=j.useMemo(()=>{var s;return Le(((s=h.data)==null?void 0:s.children)||[])},[h.data]),$=j.useMemo(()=>{var a;const s=new Map;return(((a=h.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(t=>{s.set(t.subtask_id,t.benchmarks||[])}),s},[h.data]),f=ve([...je.feeds.task,n,d.filters],s=>ke.forTask(n,{...d.filters,page:s,page_size:20,repository_limit:1}),{enabled:!!n}),J=j.useMemo(()=>{var s;return((s=f.data)==null?void 0:s.pages.flatMap(a=>a.results.map(we)))??[]},[f.data]),B=j.useMemo(()=>{var a;const s={};return(a=f.data)==null||a.pages.forEach(t=>t.results.forEach(b=>(b.methods||[]).forEach(u=>{const r=u.slug||u.id;s[r]||(s[r]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[r].count++}))),Object.values(s).sort((t,b)=>b.count-t.count).slice(0,8)},[f.data]);if(h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(P,{className:"h-12 w-1/2 mb-4"}),e.jsx(P,{className:"h-6 w-1/3 mb-8"}),e.jsx(P,{className:"h-64 w-full"})]});if(_e(h.error))return e.jsx(Ee,{});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ye,{variant:"destructive",children:e.jsx(Se,{children:"Task not found."})})});const o=h.data.task,X=h.data.parents||[],C=N(o.name,o.slug),M=(h.data.sisters||[]).filter(s=>s.id!==o.id),Z=h.data.recommended_frameworks||[],S=h.data.benchmarks||[],q=new Map(S.map(s=>[s.id,s])),ee=new Set(S.map(s=>s.id)),H=(((V=I.data)==null?void 0:V.results)||[]).filter(s=>ee.has(s.id)).map(s=>{const a=q.get(s.id);return{...s,best_model_name:(a==null?void 0:a.best_model_name)??s.best_model_name,best_paper_route:a==null?void 0:a.best_paper_route,best_paper_title:a==null?void 0:a.best_paper_title,best_code_url:a==null?void 0:a.best_code_url}}),F=H.length?H:S.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),E=Me(F,s=>{var a;return(a=q.get(s.id))==null?void 0:a.parent_dataset_id}),se=m?E:E.slice(0,5),ae=E.slice(5).reduce((s,a)=>s+a.members.length,0),D=((G=I.data)==null?void 0:G.recent_days)||90,re=y.some(s=>($.get(s.id)||[]).length>0),ne=y.length>0,Q=F.length>0,te=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),$.forEach(a=>a.forEach(t=>s.add(t.id))),s.size})(),ie=s=>{_(a=>{const t=new Set(a);return t.has(s)?t.delete(s):t.add(s),t})};return e.jsxs("div",{className:"page",children:[e.jsx(Pe,{task:o,area:h.data.area,parents:X}),e.jsxs("div",{className:o.image_url?`task-hero-grid${o.slug==="auto-research"?" task-hero-grid--wide":""}`: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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:C}),e.jsx(he,{kind:"task",entityId:o.id}),o.description&&e.jsx(U,{className:"task-explainer",text:o.description}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(o.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:te}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[B.length,"+"]}),"METHODS USED"]})]}),e.jsx(Ae,{frameworks:Z})]}),o.image_url&&e.jsxs("figure",{className:`task-figure-card${o.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:me(o.image_url)??void 0,alt:`${C} schematic`,onError:s=>{var a,t;(t=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",C,o.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(U,{className:"task-image-credit",text:o.image_credit})]})]})]})]}),o.slug==="healthcare"&&e.jsx(Re,{task:o,relatedTasks:M}),o.slug==="robotics"&&e.jsx(Be,{}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[Q&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[D,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",F.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),se.map(({key:s,members:a})=>{const t=a[0],b=p=>p===t?"standard":Ce(p.name,t.name),u=[t,...a.slice(1).sort((p,A)=>b(p).localeCompare(b(A),void 0,{sensitivity:"base"}))],r=u.find(p=>p.id===x[s])??t;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(xe,{history:r.history,benchmarkName:r.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:r.recent_paper_count})," ",r.recent_paper_count===1?"paper":"papers"," /"," ",D,"d"]}),r.rate_change==null?r.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${r.rate_change>=1?"is-up":"is-down"}`,children:[r.rate_change>=1?"↑":"↓"," ",r.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:T(r.slug||r.id,n),children:r.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${t.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===r.id,title:p.name,onClick:()=>k(A=>({...A,[s]:p.id})),children:b(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:r.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:r.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(Te,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:r.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:r.best_paper_route&&r.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(r.best_paper_route)}`,children:r.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:r.best_code_url?e.jsx("a",{href:r.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${r.best_paper_title||r.best_model_name}`,children:e.jsx($e,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(g,{to:T(r.slug||r.id,n),"aria-label":`Compare ${r.best_model_name||"the best model"} with all results on ${r.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(L,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),E.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>l(s=>!s),children:m?"− show top 5":`+ show ${ae} more benchmarks`})]}),ne&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:Q?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:re?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",y.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:y.map(s=>{const a=$.get(s.id)||[],t=w.has(s.id),b=t?a:a.slice(0,R),u=a.length-R;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:N(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:a.length>0?`[${a.length} benchmark${a.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),b.length>0?b.map((r,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(T(r.slug||r.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(p+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:r.name}),e.jsx("div",{className:"bench-row-sub",children:r.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:r.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},r.id)):e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),u>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ie(s.id),children:t?`− show top ${R}`:`+ show ${u} more benchmark${u===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(o.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsx(ge,{feed:d}),e.jsx(be,{query:f,cards:J,empty:"No papers in this task yet."})]}),e.jsxs("aside",{className:"task-side",children:[M.length>0&&o.slug!=="healthcare"&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),M.slice(0,8).map(s=>e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:N(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),B.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),B.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(pe,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Re as HealthcareMedicalAiHub,Ae as RecommendedFrameworkLinks,Pe as TaskBreadcrumb,ws as default}; +import{j as e,L as g,M as ce,u as le,c as oe,r as j,q as de,Z as me}from"./index-CbgxfyGU.js";import{R as he}from"./ResearchFollowButton-D2BXlDtQ.js";import{u as U}from"./useQuery-Bx9s5-D2.js";import{M as pe}from"./SotaBadges-C-sTR-EF.js";import{u as ue,b as ge,a as be}from"./PaperFeed-DMvUfA47.js";import{A as L}from"./arrow-right-DotD9yNb.js";import{B as xe}from"./BenchmarkTrendSparkline-C135_NtS.js";import{M as K}from"./MarkdownText-Bj-G_S-B.js";import{c as O}from"./catalog-DhK7_9-6.js";import{p as je,a as ke}from"./paperQueryKeys-B8u1BWlI.js";import{i as _e}from"./apiErrors-BZ5h1Kmb.js";import{f as fe}from"./frameworks-DDA0P4Tf.js";import{s as Ne}from"./slug-BpH-Nkvz.js";import{d as N,t as we}from"./transform-0Udg2p6b.js";import{u as ve}from"./usePapers-CJaWLZ3y.js";import{S as P}from"./skeleton-HwvdxvSN.js";import{A as ye,a as Se}from"./alert-CFDDvdIM.js";import Ee from"./NotFound-DtzwOULp.js";import{T as Te}from"./trophy-BQwEH3L7.js";import{G as $e}from"./github-BYklgHDz.js";import"./useMutation-P_trTy9i.js";import"./research-DgpyzSy_.js";import"./plus-UK0TEjgd.js";import"./colors-BkWRhvFI.js";import"./PaperCard-tdTC_dRN.js";import"./AuthorAvatar-CUJMmp_z.js";import"./Icon-D-kA0Owz.js";import"./LatexTitle-Z-HGmZ-H.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DKJYnYjk.js";import"./useIntersectionObserver-CID9Kkak.js";/* empty css */import"./PaperPreviewLink-DZDNIh1g.js";import"./index-ZkEATkOr.js";import"./index-BH3yOoza.js";import"./katex-DkKDou_j.js";import"./hover-card-ufez2uMo.js";import"./curation-C7Gmmp4z.js";import"./useInfiniteQuery-BAc_4HO5.js";const Be=()=>e.jsxs(g,{to:"/astra-for-robotics",className:"task-featured-collection","aria-label":"Featured collection: GPT-6 Astra for Robotics",children:[e.jsx("span",{className:"task-featured-collection-eyebrow",children:"Featured collection"}),e.jsx("strong",{children:"GPT-6 Astra for Robotics"}),e.jsx("span",{className:"task-featured-collection-description",children:"Papers and demos that put GPT-6 Astra in control of real and simulated robots, as the policy itself or as an agent orchestrating the stack."}),e.jsxs("span",{className:"task-featured-collection-meta",children:["Explore the collection",e.jsx(L,{size:14,"aria-hidden":"true"})]})]}),W=n=>{const c=n.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(d=>d.trim()).filter(Boolean):[]};function Me(n,c){const d=W(n);if(c===void 0)return"standard";const i=new Set(W(c).map(l=>l.toLowerCase())),m=d.filter(l=>!i.has(l.toLowerCase()));return m.length?m.join(", "):n}function Ce(n,c){const d=new Map(n.map(l=>[l.id,l])),i=l=>{const x=new Set([l.id]);let k=l;for(;;){const w=c(k),_=w?d.get(w):void 0;if(!_)return k.id;if(x.has(_.id))return l.id;x.add(_.id),k=_}},m=new Map;return n.forEach(l=>{const x=i(l);m.set(x,[...m.get(x)||[],l])}),[...m].map(([l,x])=>({key:l,members:[d.get(l),...x.filter(k=>k.id!==l)]}))}const R=3,Fe=[{slug:"healthcare",eyebrow:"Clinical systems",title:"Clinical AI & Healthcare",description:"Agents, clinical workflows, medical calculators, safety, and decision support.",href:"#benchmarks"},{slug:"medical-question-answering",eyebrow:"Language & reasoning",title:"Medical Question Answering",description:"Medical exams, biomedical evidence, clinical comprehension, and explanations.",href:"/tasks/medical-question-answering"},{slug:"medical-imaging",eyebrow:"Vision",title:"Medical Imaging",description:"Radiology, pathology, ophthalmology, ultrasound, and diagnostic imaging.",href:"/tasks/medical-imaging"},{slug:"medical-visual-question-answering",eyebrow:"Multimodal",title:"Medical Visual Question Answering",description:"Questions grounded in radiology, pathology, and other biomedical images.",href:"/tasks/medical-visual-question-answering"}],Ae=({frameworks:n})=>n.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),n.map(c=>e.jsxs(g,{to:`/papers?framework=${encodeURIComponent(c.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:c.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",fe(c.num_stars)]})]},c.framework_id))]}),Pe=({task:n,area:c,parents:d})=>e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(g,{to:"/tasks",children:"Tasks"}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks#area-${Ne(c.name)}`,children:c.name})]}),[...d].reverse().map(i=>e.jsxs(ce.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks/${i.slug||i.id}`,children:N(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:N(n.name,n.slug)})]}),Re=({task:n,relatedTasks:c})=>{const d=new Map([n,...c].map(i=>[i.slug,i]));return e.jsxs("section",{className:"medical-ai-hub","aria-labelledby":"medical-ai-hub-title",children:[e.jsxs("div",{className:"medical-ai-hub-heading",children:[e.jsx("span",{children:"Medical AI directory"}),e.jsx("h2",{id:"medical-ai-hub-title",children:"Explore Healthcare & Medical AI"}),e.jsx("p",{children:"Browse the field by clinical application, language, vision, or multimodal reasoning."})]}),e.jsx("div",{className:"medical-ai-hub-grid",children:Fe.map(i=>{const m=d.get(i.slug),l=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"medical-ai-hub-card-eyebrow",children:i.eyebrow}),e.jsx("strong",{children:i.title}),e.jsx("span",{className:"medical-ai-hub-card-description",children:i.description}),e.jsxs("span",{className:"medical-ai-hub-card-meta",children:[(m==null?void 0:m.paper_count)!=null?`${m.paper_count.toLocaleString()} papers`:"Explore task",e.jsx(L,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:l},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:l},i.slug)})})]})},Le=n=>[...n].sort((c,d)=>{const i=c.slug==="classic-language-modeling",m=d.slug==="classic-language-modeling";return i!==m?i?1:-1:0}),ws=()=>{var z,V,G;const{taskSlug:n}=le(),c=oe(),d=ue(),{searchParams:i}=d,[m,l]=j.useState(!1),[x,k]=j.useState({}),[w,_]=j.useState(()=>new Set),{preferences:Z}=de(),T=(s,a)=>{const t=s||"";return a?`/benchmark/${t}?task=${encodeURIComponent(a)}`:`/benchmark/${t}`},v=Z.hide_closed_source_evals?!0:void 0,h=U({queryKey:["task-page",n,v],queryFn:()=>O.taskPage(n,{is_open:v}),enabled:!!n,staleTime:10*60*1e3});j.useEffect(()=>{var t;const s=(t=h.data)==null?void 0:t.task.slug;if(!n||!s||s===n)return;const a=i.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(z=h.data)==null?void 0:z.task.slug,i,n]);const I=U({queryKey:["task-benchmark-trends",n,v],queryFn:()=>O.trendingBenchmarks(n,{limit:100,min_recent_papers:0,is_open:v}),enabled:!!n,staleTime:10*60*1e3}),y=j.useMemo(()=>{var s;return Le(((s=h.data)==null?void 0:s.children)||[])},[h.data]),$=j.useMemo(()=>{var a;const s=new Map;return(((a=h.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(t=>{s.set(t.subtask_id,t.benchmarks||[])}),s},[h.data]),f=ve([...je.feeds.task,n,d.filters],s=>ke.forTask(n,{...d.filters,page:s,page_size:20,repository_limit:1}),{enabled:!!n}),J=j.useMemo(()=>{var s;return((s=f.data)==null?void 0:s.pages.flatMap(a=>a.results.map(we)))??[]},[f.data]),B=j.useMemo(()=>{var a;const s={};return(a=f.data)==null||a.pages.forEach(t=>t.results.forEach(b=>(b.methods||[]).forEach(u=>{const r=u.slug||u.id;s[r]||(s[r]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[r].count++}))),Object.values(s).sort((t,b)=>b.count-t.count).slice(0,8)},[f.data]);if(h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(P,{className:"h-12 w-1/2 mb-4"}),e.jsx(P,{className:"h-6 w-1/3 mb-8"}),e.jsx(P,{className:"h-64 w-full"})]});if(_e(h.error))return e.jsx(Ee,{});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ye,{variant:"destructive",children:e.jsx(Se,{children:"Task not found."})})});const o=h.data.task,X=h.data.parents||[],M=N(o.name,o.slug),C=(h.data.sisters||[]).filter(s=>s.id!==o.id),Y=h.data.recommended_frameworks||[],S=h.data.benchmarks||[],q=new Map(S.map(s=>[s.id,s])),ee=new Set(S.map(s=>s.id)),H=(((V=I.data)==null?void 0:V.results)||[]).filter(s=>ee.has(s.id)).map(s=>{const a=q.get(s.id);return{...s,best_model_name:(a==null?void 0:a.best_model_name)??s.best_model_name,best_paper_route:a==null?void 0:a.best_paper_route,best_paper_title:a==null?void 0:a.best_paper_title,best_code_url:a==null?void 0:a.best_code_url}}),F=H.length?H:S.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),E=Ce(F,s=>{var a;return(a=q.get(s.id))==null?void 0:a.parent_dataset_id}),se=m?E:E.slice(0,5),ae=E.slice(5).reduce((s,a)=>s+a.members.length,0),D=((G=I.data)==null?void 0:G.recent_days)||90,re=y.some(s=>($.get(s.id)||[]).length>0),ne=y.length>0,Q=F.length>0,te=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),$.forEach(a=>a.forEach(t=>s.add(t.id))),s.size})(),ie=s=>{_(a=>{const t=new Set(a);return t.has(s)?t.delete(s):t.add(s),t})};return e.jsxs("div",{className:"page",children:[e.jsx(Pe,{task:o,area:h.data.area,parents:X}),e.jsxs("div",{className:o.image_url?`task-hero-grid${o.slug==="auto-research"?" task-hero-grid--wide":""}`: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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:M}),e.jsx(he,{kind:"task",entityId:o.id}),o.description&&e.jsx(K,{className:"task-explainer",text:o.description}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(o.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:te}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[B.length,"+"]}),"METHODS USED"]})]}),e.jsx(Ae,{frameworks:Y})]}),o.image_url&&e.jsxs("figure",{className:`task-figure-card${o.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:me(o.image_url)??void 0,alt:`${M} schematic`,onError:s=>{var a,t;(t=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",M,o.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(K,{className:"task-image-credit",text:o.image_credit})]})]})]})]}),o.slug==="healthcare"&&e.jsx(Re,{task:o,relatedTasks:C}),o.slug==="robotics"&&e.jsx(Be,{}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[Q&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[D,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",F.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),se.map(({key:s,members:a})=>{const t=a[0],b=p=>p===t?"standard":Me(p.name,t.name),u=[t,...a.slice(1).sort((p,A)=>b(p).localeCompare(b(A),void 0,{sensitivity:"base"}))],r=u.find(p=>p.id===x[s])??t;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(xe,{history:r.history,benchmarkName:r.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:r.recent_paper_count})," ",r.recent_paper_count===1?"paper":"papers"," /"," ",D,"d"]}),r.rate_change==null?r.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${r.rate_change>=1?"is-up":"is-down"}`,children:[r.rate_change>=1?"↑":"↓"," ",r.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:T(r.slug||r.id,n),children:r.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${t.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===r.id,title:p.name,onClick:()=>k(A=>({...A,[s]:p.id})),children:b(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:r.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:r.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(Te,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:r.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:r.best_paper_route&&r.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(r.best_paper_route)}`,children:r.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:r.best_code_url?e.jsx("a",{href:r.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${r.best_paper_title||r.best_model_name}`,children:e.jsx($e,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(g,{to:T(r.slug||r.id,n),"aria-label":`Compare ${r.best_model_name||"the best model"} with all results on ${r.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(L,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),E.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>l(s=>!s),children:m?"− show top 5":`+ show ${ae} more benchmarks`})]}),ne&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:Q?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:re?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",y.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:y.map(s=>{const a=$.get(s.id)||[],t=w.has(s.id),b=t?a:a.slice(0,R),u=a.length-R;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:N(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:a.length>0?`[${a.length} benchmark${a.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),b.length>0?b.map((r,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(T(r.slug||r.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(p+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:r.name}),e.jsx("div",{className:"bench-row-sub",children:r.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:r.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},r.id)):e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),u>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ie(s.id),children:t?`− show top ${R}`:`+ show ${u} more benchmark${u===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(o.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsx(ge,{feed:d}),e.jsx(be,{query:f,cards:J,empty:"No papers in this task yet."})]}),e.jsxs("aside",{className:"task-side",children:[C.length>0&&o.slug!=="healthcare"&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),C.slice(0,8).map(s=>e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:N(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),B.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),B.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(pe,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Re as HealthcareMedicalAiHub,Ae as RecommendedFrameworkLinks,Pe as TaskBreadcrumb,ws as default}; diff --git a/assets/TagsIndexView-DJJJY-D1.js b/assets/TagsIndexView-jyuGT4BB.js similarity index 97% rename from assets/TagsIndexView-DJJJY-D1.js rename to assets/TagsIndexView-jyuGT4BB.js index 5ce1f85ee27c24b8ccdb1f675610781e1880c968..83f5fcfae62d488a9c90642692028bc4f70ce562 100644 --- a/assets/TagsIndexView-DJJJY-D1.js +++ b/assets/TagsIndexView-jyuGT4BB.js @@ -1,4 +1,4 @@ -import{n as e,r as x,j as a,L as q}from"./index-YwiKC6Po.js";import{u as s}from"./useQuery-DPH6Mb2w.js";import{c as p}from"./catalog-B15Yh5dN.js";import{c as g,h as v}from"./colors-BkWRhvFI.js";import{d as u}from"./transform-CNg3rvXk.js";import{s as z}from"./slug-BpH-Nkvz.js";import{S as j}from"./search-wcEXdf1i.js";import{I as L,T as S}from"./triangle-alert-BWObrJc7.js";import{S as C}from"./share-2-m8aPY8Vq.js";import{T as V}from"./trending-up-Sm0tkX5g.js";import{M as A}from"./moon-DfjUzC9G.js";import{T as H}from"./thumbs-up-D9G2aLNB.js";import{D as T}from"./database-2w-JFZSG.js";import{T as F}from"./trophy-B60aAfG3.js";import{F as Z}from"./file-text-Cijxx2XD.js";import{A as B}from"./activity-95309hog.js";import{G as P}from"./globe-DmMnSXeF.js";import{S as N}from"./sparkles-C3L7JDLC.js";import{A as D,a as G}from"./alert-Cx5luC5D.js";import{A as _,a as E,b as I}from"./AreaSection-CfCNkiTd.js";import{T as U}from"./TaxonomySuggestionTile-4WqZSJGN.js";import{u as W,T as Q}from"./useHashScrollOnReady-BKkkyVVX.js";import{s as R}from"./areas-Dvi8w2dp.js";import"./skeleton-CXR1qouH.js";import"./SignInToEditDialog-DpqyyHCb.js";import"./button-B90pJJiy.js";import"./input-DEeEc0bH.js";import"./textarea-BPIMGf5w.js";import"./searchable-select-Bqfyxu17.js";import"./popover-D7ygxg37.js";import"./dialog-foxx0Wu6.js";import"./loader-circle-B0KtDERb.js";import"./useMutation-f6iDkf3w.js";import"./submissions-BJgYjF7O.js";import"./plus-Cfz0QbT1.js";/** +import{n as e,r as x,j as a,L as q}from"./index-CbgxfyGU.js";import{u as s}from"./useQuery-Bx9s5-D2.js";import{c as p}from"./catalog-DhK7_9-6.js";import{c as g,h as v}from"./colors-BkWRhvFI.js";import{d as u}from"./transform-0Udg2p6b.js";import{s as z}from"./slug-BpH-Nkvz.js";import{S as j}from"./search-CLtAJGOp.js";import{I as L,T as S}from"./triangle-alert-U7T_j3JE.js";import{S as C}from"./share-2-hXe4dX_y.js";import{T as V}from"./trending-up-B3K5RlyX.js";import{M as A}from"./moon-BVv5zopc.js";import{T as H}from"./thumbs-up-CDCzGuPd.js";import{D as T}from"./database-CTvEb5JG.js";import{T as F}from"./trophy-BQwEH3L7.js";import{F as Z}from"./file-text-BK_7Q2rV.js";import{A as B}from"./activity-dcKMRXBy.js";import{G as P}from"./globe-B_laOt9Z.js";import{S as N}from"./sparkles-BqBXJPmy.js";import{A as D,a as G}from"./alert-CFDDvdIM.js";import{A as _,a as E,b as I}from"./AreaSection-NWvfO4Sb.js";import{T as U}from"./TaxonomySuggestionTile-DIw_GKfA.js";import{u as W,T as Q}from"./useHashScrollOnReady-DgB3XFQL.js";import{s as R}from"./areas-Dvi8w2dp.js";import"./skeleton-HwvdxvSN.js";import"./SignInToEditDialog-CNIcNqbK.js";import"./button-Bv9oZ-QU.js";import"./input-B6pxtfPe.js";import"./textarea-Bf06GTSH.js";import"./searchable-select-DNdBIahG.js";import"./popover-DKJYnYjk.js";import"./dialog-Cfp_d3CC.js";import"./loader-circle-CWMja8Zn.js";import"./useMutation-P_trTy9i.js";import"./submissions-aWj7YtuZ.js";import"./plus-UK0TEjgd.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TaxonomySuggestionTile-4WqZSJGN.js b/assets/TaxonomySuggestionTile-DIw_GKfA.js similarity index 76% rename from assets/TaxonomySuggestionTile-4WqZSJGN.js rename to assets/TaxonomySuggestionTile-DIw_GKfA.js index 47faeaf2c19668898f316ca707f617b19437c72c..86aa5fc8d35e3efbb0d8851928305c271be1fd1c 100644 --- a/assets/TaxonomySuggestionTile-4WqZSJGN.js +++ b/assets/TaxonomySuggestionTile-DIw_GKfA.js @@ -1 +1 @@ -import{a as u,r as t,j as e}from"./index-YwiKC6Po.js";import{S as c,a as m}from"./SignInToEditDialog-DpqyyHCb.js";import{P as p}from"./plus-Cfz0QbT1.js";function j({kind:s}){const{user:a}=u(),[i,n]=t.useState(!1),[r,o]=t.useState(!1),l=`Suggest a new ${s}...`,g=()=>{a?n(!0):o(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(p,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),l]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(c,{open:i,onOpenChange:n,kind:s}),e.jsx(m,{open:r,onOpenChange:o,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{j as T}; +import{a as u,r as t,j as e}from"./index-CbgxfyGU.js";import{S as c,a as m}from"./SignInToEditDialog-CNIcNqbK.js";import{P as p}from"./plus-UK0TEjgd.js";function j({kind:s}){const{user:a}=u(),[i,n]=t.useState(!1),[r,o]=t.useState(!1),l=`Suggest a new ${s}...`,g=()=>{a?n(!0):o(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(p,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),l]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(c,{open:i,onOpenChange:n,kind:s}),e.jsx(m,{open:r,onOpenChange:o,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{j as T}; diff --git a/assets/TrendsView-CW281bBi.js b/assets/TrendsView-DhWigqns.js similarity index 88% rename from assets/TrendsView-CW281bBi.js rename to assets/TrendsView-DhWigqns.js index 97f35eacc965cc3679a29fdf047178004bf7a816..7d5bd3dce3ce83e5c226b341b915fba6b4c798cf 100644 --- a/assets/TrendsView-CW281bBi.js +++ b/assets/TrendsView-DhWigqns.js @@ -1 +1 @@ -import{K as I,j as e,a5 as X}from"./index-YwiKC6Po.js";import{u as G}from"./useQuery-DPH6Mb2w.js";import{A as J,a as E}from"./alert-Cx5luC5D.js";import{S as P}from"./skeleton-CXR1qouH.js";const m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},f=980,j=400,x=62,B=26,g=30,K=58,u=f-x-B,A=j-g-K,v=g+A,Q=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s{const[a,y]=I.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=Q(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+A/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(r[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:s,display:"inline-block"}}),r[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})};class V{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const Y=new V(X),$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ne=()=>{const t=G({queryKey:["research-trends"],queryFn:()=>Y.trends(),staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(J,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:M,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:M,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ne as default}; +import{M as I,j as e,a6 as X}from"./index-CbgxfyGU.js";import{u as G}from"./useQuery-Bx9s5-D2.js";import{A as J,a as E}from"./alert-CFDDvdIM.js";import{S as P}from"./skeleton-HwvdxvSN.js";const m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},f=980,j=400,x=62,B=26,g=30,Q=58,u=f-x-B,A=j-g-Q,v=g+A,V=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s{const[a,y]=I.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=V(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+A/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(r[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:s,display:"inline-block"}}),r[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})};class Y{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const K=new Y(X),$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ne=()=>{const t=G({queryKey:["research-trends"],queryFn:()=>K.trends(),staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(J,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(M,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(M,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ne as default}; diff --git a/assets/UserProfileView-jtJ9PNjL.js b/assets/UserProfileView-gm0usnRn.js similarity index 86% rename from assets/UserProfileView-jtJ9PNjL.js rename to assets/UserProfileView-gm0usnRn.js index 33b9e13527b9704c3423367868d0f61f3f2d8155..b591814cc99564eb0890eb71f839e6d4fcba0684 100644 --- a/assets/UserProfileView-jtJ9PNjL.js +++ b/assets/UserProfileView-gm0usnRn.js @@ -1 +1 @@ -import{aO as n,u as i,j as e,ah as o}from"./index-YwiKC6Po.js";import{u as d}from"./useQuery-DPH6Mb2w.js";import{C as l}from"./OrganizationContributionGraph-BZyCpVX4.js";import"./skeleton-CXR1qouH.js";import"./catalog-B15Yh5dN.js";const c={async get(s){const a=await n(`/profiles/${encodeURIComponent(s)}`),r=await a.json();if(!a.redirected)return r;const t=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:t,redirected_from_alias:!0}}},j=()=>{const{username:s=""}=i(),a=d({queryKey:["user-profile",s.toLowerCase()],queryFn:()=>c.get(s)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(o,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(l,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{j as default}; +import{aP as n,u as i,j as e,ai as o}from"./index-CbgxfyGU.js";import{u as d}from"./useQuery-Bx9s5-D2.js";import{C as l}from"./OrganizationContributionGraph-ah6EPb13.js";import"./skeleton-HwvdxvSN.js";import"./catalog-DhK7_9-6.js";const c={async get(s){const a=await n(`/profiles/${encodeURIComponent(s)}`),r=await a.json();if(!a.redirected)return r;const t=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:t,redirected_from_alias:!0}}},j=()=>{const{username:s=""}=i(),a=d({queryKey:["user-profile",s.toLowerCase()],queryFn:()=>c.get(s)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(o,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(l,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{j as default}; diff --git a/assets/activity-95309hog.js b/assets/activity-dcKMRXBy.js similarity index 89% rename from assets/activity-95309hog.js rename to assets/activity-dcKMRXBy.js index c2cf73aaab8087c988fbe65f82be183882709acd..8a138dde1e82de01c131d6489ab57ca7f5424f19 100644 --- a/assets/activity-95309hog.js +++ b/assets/activity-dcKMRXBy.js @@ -1,4 +1,4 @@ -import{n as t}from"./index-YwiKC6Po.js";/** +import{n as t}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/alert-Cx5luC5D.js b/assets/alert-CFDDvdIM.js similarity index 92% rename from assets/alert-Cx5luC5D.js rename to assets/alert-CFDDvdIM.js index dfdcd3794a6a7746433b86b8b486e37c5964b98e..e64e01115986ce79c18954ba2fd48f9d702976ed 100644 --- a/assets/alert-Cx5luC5D.js +++ b/assets/alert-CFDDvdIM.js @@ -1 +1 @@ -import{r as a,j as s,A as l,a7 as i}from"./index-YwiKC6Po.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; +import{r as a,j as s,B as l,a8 as i}from"./index-CbgxfyGU.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; diff --git a/assets/apiErrors-BZ5h1Kmb.js b/assets/apiErrors-BZ5h1Kmb.js new file mode 100644 index 0000000000000000000000000000000000000000..387767507722943d7b35510b17e4f020e03450a1 --- /dev/null +++ b/assets/apiErrors-BZ5h1Kmb.js @@ -0,0 +1 @@ +import{K as s}from"./index-CbgxfyGU.js";const i=o=>o instanceof s&&o.status===404;export{i}; diff --git a/assets/apiErrors-DBfE_SVR.js b/assets/apiErrors-DBfE_SVR.js deleted file mode 100644 index 53251202776fb471f248f46c297c026e39326467..0000000000000000000000000000000000000000 --- a/assets/apiErrors-DBfE_SVR.js +++ /dev/null @@ -1 +0,0 @@ -import{J as s}from"./index-YwiKC6Po.js";const i=o=>o instanceof s&&o.status===404;export{i}; diff --git a/assets/arrow-left-B08fyfNi.js b/assets/arrow-left-Czeu3VzJ.js similarity index 86% rename from assets/arrow-left-B08fyfNi.js rename to assets/arrow-left-Czeu3VzJ.js index 5ce67e70c2ef8cf8d754afa43c402356f61bb178..42a1c9096ff41cd310871bd4b1602207d3ba9873 100644 --- a/assets/arrow-left-B08fyfNi.js +++ b/assets/arrow-left-Czeu3VzJ.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-YwiKC6Po.js";/** +import{n as e}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/arrow-right-CSx7rJG4.js b/assets/arrow-right-DotD9yNb.js similarity index 86% rename from assets/arrow-right-CSx7rJG4.js rename to assets/arrow-right-DotD9yNb.js index 232ae976d26fb39c12991e25a5e810dfc6c8523c..eb98b8c69a7926be78d7cacbb724eb030a71b6c0 100644 --- a/assets/arrow-right-CSx7rJG4.js +++ b/assets/arrow-right-DotD9yNb.js @@ -1,4 +1,4 @@ -import{n as r}from"./index-YwiKC6Po.js";/** +import{n as r}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/badge-CFf6CiSg.js b/assets/badge-Klg-RRGs.js similarity index 90% rename from assets/badge-CFf6CiSg.js rename to assets/badge-Klg-RRGs.js index ba0e6aef6e335def07672591768d2adcd2d0ee49..65bcf7192c1c418ae98cb904d6719da4ee103291 100644 --- a/assets/badge-CFf6CiSg.js +++ b/assets/badge-Klg-RRGs.js @@ -1 +1 @@ -import{j as n,A as o,a7 as a}from"./index-YwiKC6Po.js";const s=a("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function d({className:r,variant:e,...t}){return n.jsx("div",{className:o(s({variant:e}),r),...t})}export{d as B}; +import{j as n,B as o,a8 as a}from"./index-CbgxfyGU.js";const s=a("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function d({className:r,variant:e,...t}){return n.jsx("div",{className:o(s({variant:e}),r),...t})}export{d as B}; diff --git a/assets/button-B90pJJiy.js b/assets/button-Bv9oZ-QU.js similarity index 89% rename from assets/button-B90pJJiy.js rename to assets/button-Bv9oZ-QU.js index 8932e396fdde22080ade356aa5900dac5c892f47..cf0839bd7fe24ef5e7d64d545bbc803cf28f599c 100644 --- a/assets/button-B90pJJiy.js +++ b/assets/button-Bv9oZ-QU.js @@ -1 +1 @@ -import{r as a,j as d,as as u,A as c,a7 as f}from"./index-YwiKC6Po.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; +import{r as a,j as d,at as u,B as c,a8 as f}from"./index-CbgxfyGU.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; diff --git a/assets/catalog-B15Yh5dN.js b/assets/catalog-DhK7_9-6.js similarity index 97% rename from assets/catalog-B15Yh5dN.js rename to assets/catalog-DhK7_9-6.js index 1bb31ded82f18bff5106275927a2f3af302ee427..097a7ab627b8897490fdc09faee65890eb3caf98 100644 --- a/assets/catalog-B15Yh5dN.js +++ b/assets/catalog-DhK7_9-6.js @@ -1 +1 @@ -import{a5 as o}from"./index-YwiKC6Po.js";function s(a,e){const t=new URLSearchParams;for(const[i,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(i,String(n));const r=t.toString();return`${a}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}methodIndex(){return this.request("/methods/index/cards")}trendingMethods(e){return this.request(s("/methods/trending",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}relatedMethods(e){return this.request(`/methods/${encodeURIComponent(e)}/related`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}searchOrganizations(e,t){return this.request(s("/organizations/",{q:e,limit:t}))}organizationIndex(){return this.request("/organizations/index/cards")}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const d=new u(o);export{d as c}; +import{a6 as o}from"./index-CbgxfyGU.js";function s(a,e){const t=new URLSearchParams;for(const[i,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(i,String(n));const r=t.toString();return`${a}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}methodIndex(){return this.request("/methods/index/cards")}trendingMethods(e){return this.request(s("/methods/trending",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}relatedMethods(e){return this.request(`/methods/${encodeURIComponent(e)}/related`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}searchOrganizations(e,t){return this.request(s("/organizations/",{q:e,limit:t}))}organizationIndex(){return this.request("/organizations/index/cards")}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const d=new u(o);export{d as c}; diff --git a/assets/chat-DHGOonJg.js b/assets/chat-DzTo2WUO.js similarity index 97% rename from assets/chat-DHGOonJg.js rename to assets/chat-DzTo2WUO.js index 723e69e78230005cf83a68905e79ed54e485e958..684bce5c5cc86f3d7675cd117a9f6949236be76a 100644 --- a/assets/chat-DHGOonJg.js +++ b/assets/chat-DzTo2WUO.js @@ -1 +1 @@ -import{a5 as n,ar as r}from"./index-YwiKC6Po.js";class o{constructor(e){this.request=e}listSessions(e){const t=new URLSearchParams({limit:"50"});return e&&t.set("cursor",e),this.request(`/chat/sessions?${t.toString()}`)}createSession(e,t="low"){return this.request("/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:t})})}getSession(e){return this.request(`/chat/sessions/${e}`)}updateSession(e,t){return this.request(`/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(t)})}removeSession(e){return this.request(`/chat/sessions/${e}`,{method:"DELETE"})}archiveOldChats(){return this.request("/chat/sessions/archive-old",{method:"POST"})}archiveOldestChats(){return this.request("/chat/sessions/archive-oldest",{method:"POST"})}cancelSession(e){return this.request(`/chat/sessions/${e}/cancel`,{method:"POST"})}createOrRefreshShare(e){return this.request(`/chat/sessions/${e}/share`,{method:"POST"})}getSessionPublicShare(e){return this.request(`/chat/sessions/${encodeURIComponent(e)}/public-share`,{credentials:"omit"})}getSharedChat(e){return this.request(`/chat/shares/${encodeURIComponent(e)}`,{credentials:"omit"})}getModels(){return this.request("/chat/models")}getUsage(){return this.request("/chat/usage",{cache:"no-store"})}getOpenAIUsage(){return this.request("/chat/openai-usage",{cache:"no-store"})}getAvailability(){return this.request("/chat/availability",{cache:"no-store"})}getAutocompleteVocabulary(){return this.request("/chat/autocomplete-vocabulary")}getInferenceBilling(){return this.request("/me/inference-billing",{cache:"no-store"})}selectInferenceBillingAccount(e){return this.request("/me/inference-billing",{method:"PATCH",body:JSON.stringify({bill_to:e})})}prewarmPaperContext(e){return this.request("/chat/paper-context/prewarm",{method:"POST",body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"})}getSandboxSpend(e){const t=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${t}`,{cache:"no-store"})}getWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}disconnectOpenRouterCredential(){return this.request("/chat/openrouter-key",{method:"DELETE"})}reportLatency(e,t){return r(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,s){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...s?{comment:s}:{}})})}stream(e,t){return r("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,s){return r(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...s&&s>0?{"Last-Event-ID":String(s)}:{}},signal:t})}}const h=new o(n);export{h as c}; +import{a6 as n,as as r}from"./index-CbgxfyGU.js";class o{constructor(e){this.request=e}listSessions(e){const t=new URLSearchParams({limit:"50"});return e&&t.set("cursor",e),this.request(`/chat/sessions?${t.toString()}`)}createSession(e,t="low"){return this.request("/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:t})})}getSession(e){return this.request(`/chat/sessions/${e}`)}updateSession(e,t){return this.request(`/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(t)})}removeSession(e){return this.request(`/chat/sessions/${e}`,{method:"DELETE"})}archiveOldChats(){return this.request("/chat/sessions/archive-old",{method:"POST"})}archiveOldestChats(){return this.request("/chat/sessions/archive-oldest",{method:"POST"})}cancelSession(e){return this.request(`/chat/sessions/${e}/cancel`,{method:"POST"})}createOrRefreshShare(e){return this.request(`/chat/sessions/${e}/share`,{method:"POST"})}getSessionPublicShare(e){return this.request(`/chat/sessions/${encodeURIComponent(e)}/public-share`,{credentials:"omit"})}getSharedChat(e){return this.request(`/chat/shares/${encodeURIComponent(e)}`,{credentials:"omit"})}getModels(){return this.request("/chat/models")}getUsage(){return this.request("/chat/usage",{cache:"no-store"})}getOpenAIUsage(){return this.request("/chat/openai-usage",{cache:"no-store"})}getAvailability(){return this.request("/chat/availability",{cache:"no-store"})}getAutocompleteVocabulary(){return this.request("/chat/autocomplete-vocabulary")}getInferenceBilling(){return this.request("/me/inference-billing",{cache:"no-store"})}selectInferenceBillingAccount(e){return this.request("/me/inference-billing",{method:"PATCH",body:JSON.stringify({bill_to:e})})}prewarmPaperContext(e){return this.request("/chat/paper-context/prewarm",{method:"POST",body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"})}getSandboxSpend(e){const t=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${t}`,{cache:"no-store"})}getWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}disconnectOpenRouterCredential(){return this.request("/chat/openrouter-key",{method:"DELETE"})}reportLatency(e,t){return r(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,s){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...s?{comment:s}:{}})})}stream(e,t){return r("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,s){return r(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...s&&s>0?{"Last-Event-ID":String(s)}:{}},signal:t})}}const h=new o(n);export{h as c}; diff --git a/assets/chatSessions-CdNQ1toA.js b/assets/chatSessions-DwLUbLRo.js similarity index 97% rename from assets/chatSessions-CdNQ1toA.js rename to assets/chatSessions-DwLUbLRo.js index 71c4ad2ef766b1f1348bab40eae48ca8834a6ad5..23b36ce40400e4d663419fd728b381ff81776f20 100644 --- a/assets/chatSessions-CdNQ1toA.js +++ b/assets/chatSessions-DwLUbLRo.js @@ -1,14 +1,14 @@ -import{j as h,K as f,J as ee,a4 as Oe}from"./index-YwiKC6Po.js";import{u as te}from"./useQuery-DPH6Mb2w.js";import{c as m}from"./chat-DHGOonJg.js";import{a as be}from"./paperQueryKeys-C5FMa4Oj.js";const Je=({light:e})=>h.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),Qe=({open:e})=>h.jsx("svg",{className:`chat-chev${e?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.jsx("path",{d:"m6 9 6 6 6-6"})}),Ze=()=>h.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"m9 12 2 2 4-4"})]}),et=({size:e=14})=>h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("circle",{cx:"11",cy:"11",r:"7"}),h.jsx("path",{d:"m21 21-4.3-4.3"})]}),tt=()=>h.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:h.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),rt=()=>h.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.jsx("path",{d:"M12 5v14M5 12h14"})}),nt=()=>h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[h.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),h.jsx("path",{d:"M9 4v16"})]}),at=()=>h.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),ot=({text:e,mentions:t,scrollTop:n=0,variant:r="composer",completion:a=""})=>{const i=[];let s=0;for(const o of[...t].sort((u,d)=>u.start-d.start)){const u=e.slice(o.start,o.end),d=u===o.title||u===`@${o.title}`;o.starte.length||!d||(i.push(e.slice(s,o.start)),i.push(h.jsx("span",{className:`chat-paper-inline-highlight${o.unavailable?" is-unavailable":""}`,"data-paper-route-id":o.route_id,children:u},o.key)),s=o.end)}return i.push(e.slice(s)),a&&i.push(h.jsx("span",{className:"chat-prompt-completion",children:a},"completion")),e.endsWith(` +import{j as h,M as f,K as ee,a5 as Oe}from"./index-CbgxfyGU.js";import{u as te}from"./useQuery-Bx9s5-D2.js";import{c as m}from"./chat-DzTo2WUO.js";import{a as be}from"./paperQueryKeys-B8u1BWlI.js";const Qe=({light:e})=>h.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),Je=({open:e})=>h.jsx("svg",{className:`chat-chev${e?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.jsx("path",{d:"m6 9 6 6 6-6"})}),Ze=()=>h.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"m9 12 2 2 4-4"})]}),et=({size:e=14})=>h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("circle",{cx:"11",cy:"11",r:"7"}),h.jsx("path",{d:"m21 21-4.3-4.3"})]}),tt=()=>h.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:h.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),rt=()=>h.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.jsx("path",{d:"M12 5v14M5 12h14"})}),nt=()=>h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[h.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),h.jsx("path",{d:"M9 4v16"})]}),at=()=>h.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),ot=({text:e,mentions:t,scrollTop:n=0,variant:r="composer",completion:a=""})=>{const i=[];let s=0;for(const o of[...t].sort((u,d)=>u.start-d.start)){const u=e.slice(o.start,o.end),d=u===o.title||u===`@${o.title}`;o.starte.length||!d||(i.push(e.slice(s,o.start)),i.push(h.jsx("span",{className:`chat-paper-inline-highlight${o.unavailable?" is-unavailable":""}`,"data-paper-route-id":o.route_id,children:u},o.key)),s=o.end)}return i.push(e.slice(s)),a&&i.push(h.jsx("span",{className:"chat-prompt-completion",children:a},"completion")),e.endsWith(` `)&&i.push("​"),h.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${r}`,children:h.jsx("div",{style:{transform:`translateY(-${n}px)`},children:i})})},st=({open:e,query:t,results:n,activeIndex:r,loading:a,error:i,onSelect:s,id:o="chat-paper-picker",optionIdPrefix:u="chat-paper-option"})=>{if(!e)return null;const d=t.trim()?a?"Searching papers…":i?"Paper search is unavailable":n.length?`${n.length} paper${n.length===1?"":"s"} found`:"No papers found":"Type to search papers";return h.jsxs("div",{className:"chat-paper-picker",id:o,role:"listbox","aria-label":"Paper results",children:[h.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:d}),n.map((p,l)=>{const O=p.arxiv_id||p.id,k=p.arxiv_id||(()=>{try{return p.source_url?new URL(p.source_url).hostname:"External resource"}catch{return"External resource"}})();return h.jsxs("button",{type:"button",id:`${u}-${l}`,role:"option","aria-selected":l===r,className:`chat-paper-option${l===r?" is-active":""}`,onMouseDown:P=>{P.preventDefault(),s(p)},children:[h.jsx("span",{className:"chat-paper-option-title",children:p.title}),h.jsx("span",{className:"chat-paper-option-meta",children:k})]},O)})]})},Te=["What are decision models?","Find relevant papers on RLVR","What's the state-of-the-art for real-time object detection?"],Ee=[...Te,"What are the latest papers on ","Which benchmarks are used for ","Which methods work best for ","How does ","Explain how ","Compare ","Summarize the key contributions of "],Ce=3,Re=4,xe=new Set(["about","all","and","are","best","can","compare","does","explain","find","for","from","give","how","into","latest","list","method","methods","model","models","new","paper","papers","recent","show","state","summarize","task","tasks","the","this","use","what","when","where","which","who","why","with","work"]),ke=new RegExp(`(?:^|(?<=[\\s("'“‘]))(?=\\S)`,"g"),Ae=e=>{const t=e.toLowerCase(),n=Ee.find(r=>r.length>e.length&&r.toLowerCase().startsWith(t));return n?n.slice(e.length):""},De=(e,t)=>{const n=[...e.matchAll(ke)].map(r=>r.index??0);for(const r of n.slice(-4)){const a=e.slice(r),i=a.toLowerCase(),s=/\s/.test(a);if(a.length<(s?Ce:Re)||!s&&xe.has(i))continue;const o=t.find(u=>u.length>a.length&&u.toLowerCase().startsWith(i));if(o)return o.slice(a.length)}return""},Le=(e,t)=>!e.trim()||/\s$/.test(e)?"":Ae(e)||De(e,t);function it(e,t=!1){var p;const n=e.text,[r,a]=f.useState(null),i=te({queryKey:["chatAutocompleteVocabulary"],queryFn:()=>m.getAutocompleteVocabulary(),enabled:n.length>0,staleTime:1/0,gcTime:1/0,retry:!1}),s=(r==null?void 0:r.text)===n?r.atEnd:!0,o=e.paperMentions.some(l=>l.end===n.length);return{completion:!t&&s&&!o?Le(n,((p=i.data)==null?void 0:p.names)??[]):"",trackCaret:l=>a({text:l.value,atEnd:l.selectionStart===l.selectionEnd&&l.selectionEnd===l.value.length})}}const ct=e=>e.key==="Tab"&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.nativeEvent.isComposing,lt=e=>{var n;const t=(n=e.parentElement)==null?void 0:n.querySelector(".chat-paper-highlight-layer");return Math.max(e.scrollHeight,(t==null?void 0:t.scrollHeight)??0)},re=8e3,ne=16384,ae=1e4,E={crossPage:"Select text within one PDF page.",outside:"Select text from the paper, not the surrounding interface.",tooLarge:"Select a shorter passage (maximum 8,000 characters)."};function oe(e){return new TextEncoder().encode(e).length}function se(e){return e.replace(/\r\n/g,` `).replace(/\r/g,` -`).replace(/\u00a0/g," ").replace(/[^\S\n]+/g," ").trim()}function ut(e){return`${e.routeId}\0${e.paperVersion}\0${e.page}\0${e.text}`}function dt(e){return{route_id:e.routeId,paper_version:e.paperVersion,page:e.page,text:e.text}}function L(e="",t){return t?{text:e,paperMentions:[],paperSelection:t}:{text:e,paperMentions:[]}}function V(e,t,n){return e.paperSelection?{text:t,paperMentions:n,paperSelection:e.paperSelection}:{text:t,paperMentions:n}}function Pe(e){if(!e||typeof e!="object")return;const t=e;if(typeof t.routeId!="string"||!t.routeId.trim()||typeof t.paperVersion!="string"||!t.paperVersion.trim())return;const n=t.page;if(typeof n!="number"||!Number.isInteger(n)||n<1||n>ae||typeof t.text!="string")return;const r=se(t.text);if(r&&!(r.length>re)&&!(oe(r)>ne))return{routeId:t.routeId.trim(),paperVersion:t.paperVersion.trim(),page:n,text:r}}function Ie(e,t){if(typeof e=="string")return L(e);if(!e||typeof e!="object")return t===void 0?null:L(t);const n=e;if(typeof n.text!="string"||!Array.isArray(n.paperMentions))return t===void 0?null:L(t);const r=Pe(n.paperSelection);return r?{text:n.text,paperMentions:n.paperMentions,paperSelection:r}:{text:n.text,paperMentions:n.paperMentions}}function ie(e){return e?e instanceof Element?e:e.parentElement:null}function $(e,t){const n=ie(e);if(!n||!t.contains(n)||!n.closest(".textLayer, .reader-web-document"))return null;const r=n.closest(".pdf-page[data-page], .reader-web-document[data-page]");if(!r||!t.contains(r))return null;const a=Number(r.dataset.page);return!Number.isInteger(a)||a<1||a>ae?null:a}function ht(e){const{selection:t,pagesRoot:n,routeId:r,paperVersion:a,numPages:i}=e;if(!n||!t||t.rangeCount!==1)return t&&t.rangeCount>1?{ok:!1,error:E.crossPage}:{ok:!1,error:null};const s=t.getRangeAt(0);if(s.collapsed)return{ok:!1,error:null};const o=$(s.startContainer,n),u=$(s.endContainer,n),d=ie(s.commonAncestorContainer);if(!d||!n.contains(d))return{ok:!1,error:E.outside};if(o===null||u===null)return{ok:!1,error:E.outside};if(o!==u)return{ok:!1,error:E.crossPage};if(i&&(o<1||o>i))return{ok:!1,error:E.crossPage};const p=t.toString(),l=se(p);return l?l.length>re||oe(l)>ne?{ok:!1,error:E.tooLarge}:{ok:!0,selection:{routeId:r,paperVersion:a,page:o,text:l}}:{ok:!1,error:E.crossPage}}const Ne=10,Me=3;function B(e,t){const r=e.slice(0,t).lastIndexOf("@");if(r<0)return null;const a=r>0?e[r-1]:"";if(a&&/[\p{L}\p{M}\p{N}_@]/u.test(a))return null;const i=e.slice(r+1,t);return/[\n\r@]/.test(i)?null:{start:r,end:t,query:i}}function K(e,t,n){let r=0;for(;ro.end<=r?[o]:o.start>=i?[{...o,start:o.start+s,end:o.end+s}]:[])}function pt({draft:e,onChange:t,enabled:n,textareaRef:r}){var q;const a=`chat-paper-picker-${f.useId().replace(/:/g,"")}`,i=`${a}-option`,[s,o]=f.useState(null),[u,d]=f.useState(""),[p,l]=f.useState(0),[O,k]=f.useState(""),P=f.useRef(new Set);f.useEffect(()=>{n||o(null)},[n]),f.useEffect(()=>{const c=window.setTimeout(()=>d((s==null?void 0:s.query.trim())??""),150);return()=>window.clearTimeout(c)},[s==null?void 0:s.query]);const R=te({queryKey:["chat-paper-mention-search",u.toLowerCase()],queryFn:({signal:c})=>be.search(u,1,10,"hybrid",c),enabled:n&&!!s&&u.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),_=f.useMemo(()=>{var c;return((c=R.data)==null?void 0:c.results)??[]},[(q=R.data)==null?void 0:q.results]);f.useEffect(()=>l(0),[u]),f.useEffect(()=>{var c;(c=document.getElementById(`${i}-${p}`))==null||c.scrollIntoView({block:"nearest"})},[p,i]);const _e=f.useCallback(c=>{var w;if(!n){o(null);return}const g=c??((w=r.current)==null?void 0:w.selectionStart)??e.text.length;if(e.paperMentions.some(b=>g>b.start&&g<=b.end)){o(null);return}o(B(e.text,g))},[e.paperMentions,e.text,n,r]),we=f.useCallback((c,g)=>{var A;const w=K(e.text,c,e.paperMentions),b=V(e,c,w);t(b);const T=g??((A=r.current)==null?void 0:A.selectionStart)??c.length;n&&!w.some(D=>T>D.start&&T<=D.end)?o(B(c,T)):o(null)},[e,n,t,r]),j=f.useCallback(c=>{if(!s)return!1;const g=c.arxiv_id||c.id,w=new Set(e.paperMentions.map(x=>x.route_id));if(e.paperMentions.length>=Ne)return k("A message can contain at most 10 paper mentions."),!1;if(!w.has(g)&&w.size>=Me)return k("A message can attach at most 3 distinct papers."),!1;const b=c.title,T=e.text.slice(s.end),A=T.length===0,D=e.text.slice(0,s.start)+b+(A?" ":"")+T,Se=K(e.text,D,e.paperMentions),H={key:crypto.randomUUID(),route_id:g,title:c.title,source:c.source==="external"?"external":"arxiv",start:s.start,end:s.start+b.length};return t(V(e,D,[...Se,H].sort((x,I)=>x.start-I.start))),o(null),k(""),window.requestAnimationFrame(()=>{var I,U;const x=H.end+(A||T.startsWith(" ")?1:0);(I=r.current)==null||I.focus(),(U=r.current)==null||U.setSelectionRange(x,x)}),P.current.has(g)||(P.current.add(g),m.prewarmPaperContext(g).catch(()=>{})),!0},[s,e,t,r]),ve=f.useCallback(c=>!s||c.nativeEvent.isComposing?!1:c.key==="Tab"?(o(null),!1):c.key==="Escape"?(c.preventDefault(),o(null),!0):c.key==="ArrowDown"||c.key==="ArrowUp"?(c.preventDefault(),_.length&&l(g=>c.key==="ArrowDown"?(g+1)%_.length:(g-1+_.length)%_.length),!0):c.key==="Home"&&_.length?(c.preventDefault(),l(0),!0):c.key==="End"&&_.length?(c.preventDefault(),l(_.length-1),!0):c.key==="Enter"&&!c.shiftKey?(c.preventDefault(),_[p]?j(_[p]):R.isFetching||o(null),!0):!1,[s,p,_,R.isFetching,j]);return{open:!!s,query:(s==null?void 0:s.query)??"",results:_,activeIndex:p,loading:R.isFetching,error:R.isError,message:O,pickerId:a,optionIdPrefix:i,updateText:we,refresh:_e,select:j,keyDown:ve,close:()=>o(null)}}const y=(e,t)=>new Promise(n=>{const r=setTimeout(a,e);function a(){t==null||t.removeEventListener("abort",a),clearTimeout(r),n()}t==null||t.addEventListener("abort",a)}),v=e=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...e}),S={name:"Object Detection",slug:"object-detection"},C={name:"Real-Time Object Detection",slug:"real-time-object-detection"},Ye={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:v({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[S,C],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:v({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[S,C],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:v({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[S,C],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:v({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[S,C],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:v({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[S,C],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:v({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[S,C],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:v({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},S],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:v({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[S,C],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},ce=e=>e.map(t=>Ye[t]),G=ce(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),z=ce(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),X="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",J="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",Q=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve. +`).replace(/\u00a0/g," ").replace(/[^\S\n]+/g," ").trim()}function ut(e){return`${e.routeId}\0${e.paperVersion}\0${e.page}\0${e.text}`}function dt(e){return{route_id:e.routeId,paper_version:e.paperVersion,page:e.page,text:e.text}}function L(e="",t){return t?{text:e,paperMentions:[],paperSelection:t}:{text:e,paperMentions:[]}}function V(e,t,n){return e.paperSelection?{text:t,paperMentions:n,paperSelection:e.paperSelection}:{text:t,paperMentions:n}}function Pe(e){if(!e||typeof e!="object")return;const t=e;if(typeof t.routeId!="string"||!t.routeId.trim()||typeof t.paperVersion!="string"||!t.paperVersion.trim())return;const n=t.page;if(typeof n!="number"||!Number.isInteger(n)||n<1||n>ae||typeof t.text!="string")return;const r=se(t.text);if(r&&!(r.length>re)&&!(oe(r)>ne))return{routeId:t.routeId.trim(),paperVersion:t.paperVersion.trim(),page:n,text:r}}function Ie(e,t){if(typeof e=="string")return L(e);if(!e||typeof e!="object")return t===void 0?null:L(t);const n=e;if(typeof n.text!="string"||!Array.isArray(n.paperMentions))return t===void 0?null:L(t);const r=Pe(n.paperSelection);return r?{text:n.text,paperMentions:n.paperMentions,paperSelection:r}:{text:n.text,paperMentions:n.paperMentions}}function ie(e){return e?e instanceof Element?e:e.parentElement:null}function $(e,t){const n=ie(e);if(!n||!t.contains(n)||!n.closest(".textLayer, .reader-web-document"))return null;const r=n.closest(".pdf-page[data-page], .reader-web-document[data-page]");if(!r||!t.contains(r))return null;const a=Number(r.dataset.page);return!Number.isInteger(a)||a<1||a>ae?null:a}function ht(e){const{selection:t,pagesRoot:n,routeId:r,paperVersion:a,numPages:i}=e;if(!n||!t||t.rangeCount!==1)return t&&t.rangeCount>1?{ok:!1,error:E.crossPage}:{ok:!1,error:null};const s=t.getRangeAt(0);if(s.collapsed)return{ok:!1,error:null};const o=$(s.startContainer,n),u=$(s.endContainer,n),d=ie(s.commonAncestorContainer);if(!d||!n.contains(d))return{ok:!1,error:E.outside};if(o===null||u===null)return{ok:!1,error:E.outside};if(o!==u)return{ok:!1,error:E.crossPage};if(i&&(o<1||o>i))return{ok:!1,error:E.crossPage};const p=t.toString(),l=se(p);return l?l.length>re||oe(l)>ne?{ok:!1,error:E.tooLarge}:{ok:!0,selection:{routeId:r,paperVersion:a,page:o,text:l}}:{ok:!1,error:E.crossPage}}const Ne=10,Me=3;function B(e,t){const r=e.slice(0,t).lastIndexOf("@");if(r<0)return null;const a=r>0?e[r-1]:"";if(a&&/[\p{L}\p{M}\p{N}_@]/u.test(a))return null;const i=e.slice(r+1,t);return/[\n\r@]/.test(i)?null:{start:r,end:t,query:i}}function K(e,t,n){let r=0;for(;ro.end<=r?[o]:o.start>=i?[{...o,start:o.start+s,end:o.end+s}]:[])}function pt({draft:e,onChange:t,enabled:n,textareaRef:r}){var q;const a=`chat-paper-picker-${f.useId().replace(/:/g,"")}`,i=`${a}-option`,[s,o]=f.useState(null),[u,d]=f.useState(""),[p,l]=f.useState(0),[O,k]=f.useState(""),P=f.useRef(new Set);f.useEffect(()=>{n||o(null)},[n]),f.useEffect(()=>{const c=window.setTimeout(()=>d((s==null?void 0:s.query.trim())??""),150);return()=>window.clearTimeout(c)},[s==null?void 0:s.query]);const R=te({queryKey:["chat-paper-mention-search",u.toLowerCase()],queryFn:({signal:c})=>be.search(u,1,10,"hybrid",c),enabled:n&&!!s&&u.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),_=f.useMemo(()=>{var c;return((c=R.data)==null?void 0:c.results)??[]},[(q=R.data)==null?void 0:q.results]);f.useEffect(()=>l(0),[u]),f.useEffect(()=>{var c;(c=document.getElementById(`${i}-${p}`))==null||c.scrollIntoView({block:"nearest"})},[p,i]);const _e=f.useCallback(c=>{var w;if(!n){o(null);return}const g=c??((w=r.current)==null?void 0:w.selectionStart)??e.text.length;if(e.paperMentions.some(b=>g>b.start&&g<=b.end)){o(null);return}o(B(e.text,g))},[e.paperMentions,e.text,n,r]),we=f.useCallback((c,g)=>{var A;const w=K(e.text,c,e.paperMentions),b=V(e,c,w);t(b);const T=g??((A=r.current)==null?void 0:A.selectionStart)??c.length;n&&!w.some(D=>T>D.start&&T<=D.end)?o(B(c,T)):o(null)},[e,n,t,r]),j=f.useCallback(c=>{if(!s)return!1;const g=c.arxiv_id||c.id,w=new Set(e.paperMentions.map(x=>x.route_id));if(e.paperMentions.length>=Ne)return k("A message can contain at most 10 paper mentions."),!1;if(!w.has(g)&&w.size>=Me)return k("A message can attach at most 3 distinct papers."),!1;const b=c.title,T=e.text.slice(s.end),A=T.length===0,D=e.text.slice(0,s.start)+b+(A?" ":"")+T,Se=K(e.text,D,e.paperMentions),H={key:crypto.randomUUID(),route_id:g,title:c.title,source:c.source==="external"?"external":"arxiv",start:s.start,end:s.start+b.length};return t(V(e,D,[...Se,H].sort((x,I)=>x.start-I.start))),o(null),k(""),window.requestAnimationFrame(()=>{var I,U;const x=H.end+(A||T.startsWith(" ")?1:0);(I=r.current)==null||I.focus(),(U=r.current)==null||U.setSelectionRange(x,x)}),P.current.has(g)||(P.current.add(g),m.prewarmPaperContext(g).catch(()=>{})),!0},[s,e,t,r]),ve=f.useCallback(c=>!s||c.nativeEvent.isComposing?!1:c.key==="Tab"?(o(null),!1):c.key==="Escape"?(c.preventDefault(),o(null),!0):c.key==="ArrowDown"||c.key==="ArrowUp"?(c.preventDefault(),_.length&&l(g=>c.key==="ArrowDown"?(g+1)%_.length:(g-1+_.length)%_.length),!0):c.key==="Home"&&_.length?(c.preventDefault(),l(0),!0):c.key==="End"&&_.length?(c.preventDefault(),l(_.length-1),!0):c.key==="Enter"&&!c.shiftKey?(c.preventDefault(),_[p]?j(_[p]):R.isFetching||o(null),!0):!1,[s,p,_,R.isFetching,j]);return{open:!!s,query:(s==null?void 0:s.query)??"",results:_,activeIndex:p,loading:R.isFetching,error:R.isError,message:O,pickerId:a,optionIdPrefix:i,updateText:we,refresh:_e,select:j,keyDown:ve,close:()=>o(null)}}const y=(e,t)=>new Promise(n=>{const r=setTimeout(a,e);function a(){t==null||t.removeEventListener("abort",a),clearTimeout(r),n()}t==null||t.addEventListener("abort",a)}),v=e=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...e}),S={name:"Object Detection",slug:"object-detection"},C={name:"Real-Time Object Detection",slug:"real-time-object-detection"},Ye={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:v({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[S,C],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:v({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[S,C],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:v({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[S,C],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:v({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[S,C],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:v({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[S,C],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:v({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[S,C],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:v({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},S],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:v({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[S,C],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},ce=e=>e.map(t=>Ye[t]),G=ce(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),z=ce(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),X="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",Q="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",J=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve. **At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency. **At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost. -**My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,je=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*Fe(e,t){const n=()=>(t==null?void 0:t.aborted)===!0,r=e.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await y(350,t),!n()){yield{type:"reasoning_start"};for(let a=0;a{const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"},ft=()=>!0;class F extends Error{constructor(t,n,r,a){super(t),this.code=n,this.status=r,this.retryAfterSeconds=a,this.name="ChatStreamError"}}class Z extends Error{constructor(t="The assistant stream was interrupted."){super(t),this.name="ChatTransportError"}}function mt(e,t){if(ue())try{m.reportLatency(e,t).catch(()=>{})}catch{}}function gt(e,t={}){return ue()?We(e,t):Fe(e.message,t.signal)}function yt(e,t={}){return qe(e,t)}async function*We(e,t){try{const n=await m.stream(e,t.signal);yield*he(n,t)}catch(n){throw de(n)}}async function*qe(e,t){try{const n=await m.resumeStream(e,t.signal,t.afterSequence);yield*he(n,t)}catch(n){throw de(n)}}function de(e){return e instanceof F||e instanceof Z?e:e instanceof SyntaxError?new F("The assistant returned an invalid stream event.","invalid_stream_event"):new Z(e instanceof Error?e.message:"The assistant stream was interrupted.")}function He(e){let t=null,n="message";const r=[];for(const a of e.split(` +**My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,je=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*Fe(e,t){const n=()=>(t==null?void 0:t.aborted)===!0,r=e.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await y(350,t),!n()){yield{type:"reasoning_start"};for(let a=0;a{const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"},ft=()=>!0;class F extends Error{constructor(t,n,r,a){super(t),this.code=n,this.status=r,this.retryAfterSeconds=a,this.name="ChatStreamError"}}class Z extends Error{constructor(t="The assistant stream was interrupted."){super(t),this.name="ChatTransportError"}}function mt(e,t){if(ue())try{m.reportLatency(e,t).catch(()=>{})}catch{}}function gt(e,t={}){return ue()?We(e,t):Fe(e.message,t.signal)}function yt(e,t={}){return qe(e,t)}async function*We(e,t){try{const n=await m.stream(e,t.signal);yield*he(n,t)}catch(n){throw de(n)}}async function*qe(e,t){try{const n=await m.resumeStream(e,t.signal,t.afterSequence);yield*he(n,t)}catch(n){throw de(n)}}function de(e){return e instanceof F||e instanceof Z?e:e instanceof SyntaxError?new F("The assistant returned an invalid stream event.","invalid_stream_event"):new Z(e instanceof Error?e.message:"The assistant stream was interrupted.")}function He(e){let t=null,n="message";const r=[];for(const a of e.split(` `))if(a.startsWith("id:")){const i=a.slice(3).trim();/^[1-9]\d*$/.test(i)&&(t=Number(i))}else a.startsWith("event:")?n=a.slice(6).trimStart():a.startsWith("data:")&&r.push(a.slice(5).trimStart());return{sequence:t,event:n,data:r.join(` `)}}async function*he(e,t){var s;if(!e.ok||!e.body){const o=e.ok?null:new ee(e,await e.text());o&&Oe(o);const u=o==null?void 0:o.detail,d=typeof u=="object"&&u!==null?u:null,p=e.status===403&&!u,l=Number(e.headers.get("Retry-After")),O=Number.isFinite(l)&&l>=0?Math.min(300,Math.ceil(l)):void 0;throw new F(p?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(o==null?void 0:o.message)||`Chat stream failed (${e.status})`,d&&"code"in d&&typeof d.code=="string"?d.code:p?"staging_access_required":void 0,e.status,O)}const n=e.body.getReader(),r=new TextDecoder;let a="",i=t.afterSequence&&t.afterSequence>0?t.afterSequence:0;try{for(;;){const{done:o,value:u}=await n.read();if(o)break;a+=r.decode(u,{stream:!0});let d;for(;(d=a.indexOf(` -`))!==-1;){const p=a.slice(0,d);a=a.slice(d+2);const l=He(p);if(!l.data||l.data==="[DONE]"||l.sequence!==null&&l.sequence<=i)continue;const O=JSON.parse(l.data);l.sequence!==null&&(i=l.sequence,(s=t.onSequence)==null||s.call(t,l.sequence)),yield O}}}finally{n.releaseLock()}}const W="pwc:chat-oauth-draft",N="pwc:chat-oauth-model",M="pwc:chat-oauth-auto-send",Ue="pwc:chat-oauth-attempted",Y="pwc:chat-reasoning-effort";function _t(e,t,n={}){const r=typeof e=="string"?e:e.text,a=r.length-r.trimStart().length,i=r.trim();if(!i)return;const s=a+i.length,o=typeof e=="string"?[]:e.paperMentions.filter(d=>d.start>=a&&d.end<=s).map(d=>({...d,start:d.start-a,end:d.end-a})),u={text:i,paperMentions:o,...typeof e!="string"&&e.paperSelection?{paperSelection:e.paperSelection}:{}};sessionStorage.setItem(W,u.paperMentions.length||u.paperSelection?JSON.stringify(u):i),n.autoSend===!1?sessionStorage.removeItem(M):sessionStorage.setItem(M,"1"),t?sessionStorage.setItem(N,t):sessionStorage.removeItem(N),sessionStorage.setItem(Y,n.reasoningEffort??le)}function wt(){var r;if(typeof window>"u"||sessionStorage.getItem(M)!=="1")return null;const e=(r=sessionStorage.getItem(W))==null?void 0:r.trim();if(!e)return null;let t=L(e);try{t=Ie(JSON.parse(e),e)??L(e)}catch{}const n=t.text.trim();return n?{prompt:n,draft:{...t,text:n},model:sessionStorage.getItem(N),reasoningEffort:["low","medium","high","max"].includes(sessionStorage.getItem(Y)??"")?sessionStorage.getItem(Y):"low"}:null}function vt(){sessionStorage.removeItem(W),sessionStorage.removeItem(N),sessionStorage.removeItem(M),sessionStorage.removeItem(Ue),sessionStorage.removeItem(Y)}const pe="gpt-5.6-luna@openai",Ve="deepseek-ai/DeepSeek-V4-Flash-0731",$e="openai/gpt-5.6-luna",fe="deepseek-ai/DeepSeek-V4.1-Flash-1017";function St(e,t){var n;return((n=e.find(r=>r.id===t))==null?void 0:n.provider)??(t===$e?"openrouter":t===pe?"openai":"huggingface")}function Ot(e,t){const n=e.find(r=>r.id===t);return n?n.sponsored===!0:t===fe}const bt=[{id:pe,label:"GPT-6 Luna",provider:"openai"},{id:fe,label:"DeepSeek V4.1 Flash",provider:"huggingface",sponsored:!0}],Tt=[{id:Ve,label:"DeepSeek V4 Flash",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"},{id:"gpt-5.6-luna@openrouter",label:"GPT-5.6 Luna",provider:"openrouter"},{id:"gpt-5.6-luna@openai",label:"GPT-6 Luna (Direct)",provider:"openai"}];class Be extends Error{constructor(t,n){super(t),this.status=n}}async function Et(){const e=[];let t=null;do{const n=await m.listSessions(t);e.push(...n.items),t=n.next_cursor}while(t&&e.length<100);return e}function Ct(e,t=le){return m.createSession(e,t)}function Rt(e){return m.getSession(e)}function xt(e,t){return m.updateSession(e,t)}function kt(e){return m.removeSession(e)}function At(){return m.archiveOldChats()}function Dt(){return m.archiveOldestChats()}function Lt(e){return m.cancelSession(e)}function Pt(e){return m.createOrRefreshShare(e)}async function It(e){try{return await m.getSharedChat(e)}catch(t){throw t instanceof ee?new Be(t.message,t.status):t}}async function Nt(){return m.getModels()}function me(e,t){return e.display_blocks.length===0&&e.content?[{kind:"answer",text:e.content,done:!0}]:ge(e.display_blocks,t)}function ge(e,t){const n=e.map(r=>r.kind==="reasoning"?{...r,active:!1,open:!1}:r.kind==="tool"?{...r,status:r.status==="running"?"error":r.status,open:t&&(r.status==="error"||r.status==="denied"||r.status==="running")}:r.kind==="app"?{...r,schema_version:1,result:r.result??{content:[],structuredContent:{},isError:!1},csp:r.csp??{},permissions:r.permissions??{clipboardWrite:!0},height:r.height||525,public_fork:!!r.public_fork}:r.kind==="artifact"?{...r}:{...r,done:!0});return n.filter((r,a)=>{const i=n[a-1];return!(r.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&r.text===i.text)})}function ye(e){if(e!=null&&e.text)return{routeId:e.route_id,paperVersion:e.paper_version,page:e.page,text:e.text}}function Mt(e){const t=r=>r==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":r==="hf_inference_credential_expired"?"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.":r==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":r==="provider_timeout"?"The model provider timed out. Try again shortly.":r==="openrouter_monthly_budget_exhausted"?"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.":r==="openrouter_staging_funding_disabled"?"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.":r==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":r==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":r==="openrouter_byok_billing_error"?"Your OpenRouter key is connected, but OpenRouter rejected billing for the account behind it. A key spending limit is not an account credit balance. Add credits or enable pay-as-you-go in OpenRouter, then try again.":r==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":r==="openai_budget_exhausted"?"The Papers With Code direct OpenAI allowance is exhausted. Select another model or try again later.":r==="context_too_large"?"This conversation is too large for the selected model. Start a new chat or shorten the context.":["provider_error","provider_unavailable"].includes(r??"")?"The model provider failed before completing the response. You can edit and retry your question.":r==="persistence_error"?"The response could not be saved. You can edit and retry your question.":r==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":r==="external_worker_lost"?"The assistant worker lost contact before the response could be saved. You can edit and retry your question.":"The response did not complete. You can edit and retry your question.",n=r=>r==null||["cancelled","interrupted","stopped"].includes(r);return e.messages.flatMap(r=>{if(r.role==="assistant")return[{id:r.id,role:"assistant",blocks:me(r,!0),followups:r.followups,citations:r.citations,finishReason:r.finish_reason??void 0,streaming:!1}];const a={id:r.id,role:"user",text:r.content,paperMentions:(r.paper_mentions??[]).map(s=>({...s,key:s.occurrence_id})),paperSelection:ye(r.paper_selection),revision:r.revision,status:r.status,error:r.status==="complete"?void 0:r.error_code||r.status};if(!["error","interrupted"].includes(r.status))return[a];const i=r.status==="interrupted"&&n(r.error_code);return[a,{id:`${r.id}-${r.status==="interrupted"?"interrupted":"error"}`,role:"assistant",blocks:ge(r.display_blocks,!0),streaming:!1,finishReason:i?"stopped":void 0,error:i?void 0:t(r.error_code),errorCode:i?void 0:r.error_code??void 0}]})}function Yt(e){return e.messages.map(t=>t.role==="user"?{id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(n=>({...n,key:n.occurrence_id})),paperSelection:ye(t.paper_selection)}:{id:t.id,role:"assistant",blocks:me(t,!1),citations:t.citations,finishReason:t.finish_reason??void 0,error:t.error??void 0,streaming:!1})}function jt(e){const t=Date.now(),n=new Date().setHours(0,0,0,0),r=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const a of[...e].sort((i,s)=>Date.parse(s.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(a.updated_at),s=t-i;i>=n?r[0].items.push(a):s<7*864e5?r[1].items.push(a):s<30*864e5?r[2].items.push(a):r[3].items.push(a)}return r.filter(a=>a.items.length>0)}export{Ze as $,tt as A,ft as B,Be as C,pe as D,Rt as E,Mt as F,Et as G,wt as H,Tt as I,bt as J,St as K,Ot as L,W as M,N,Y as O,ot as P,M as Q,Ue as R,Te as S,at as T,vt as U,Nt as V,Ie as W,xt as X,kt as Y,ht as Z,ut as _,it as a,Qe as a0,et as a1,st as b,lt as c,Ct as d,Je as e,ue as f,It as g,rt as h,ct as i,nt as j,jt as k,Pt as l,Dt as m,At as n,Z as o,Yt as p,_t as q,mt as r,yt as s,F as t,pt as u,L as v,le as w,Lt as x,dt as y,gt as z}; +`))!==-1;){const p=a.slice(0,d);a=a.slice(d+2);const l=He(p);if(!l.data||l.data==="[DONE]"||l.sequence!==null&&l.sequence<=i)continue;const O=JSON.parse(l.data);l.sequence!==null&&(i=l.sequence,(s=t.onSequence)==null||s.call(t,l.sequence)),yield O}}}finally{n.releaseLock()}}const W="pwc:chat-oauth-draft",N="pwc:chat-oauth-model",M="pwc:chat-oauth-auto-send",Ue="pwc:chat-oauth-attempted",Y="pwc:chat-reasoning-effort";function _t(e,t,n={}){const r=typeof e=="string"?e:e.text,a=r.length-r.trimStart().length,i=r.trim();if(!i)return;const s=a+i.length,o=typeof e=="string"?[]:e.paperMentions.filter(d=>d.start>=a&&d.end<=s).map(d=>({...d,start:d.start-a,end:d.end-a})),u={text:i,paperMentions:o,...typeof e!="string"&&e.paperSelection?{paperSelection:e.paperSelection}:{}};sessionStorage.setItem(W,u.paperMentions.length||u.paperSelection?JSON.stringify(u):i),n.autoSend===!1?sessionStorage.removeItem(M):sessionStorage.setItem(M,"1"),t?sessionStorage.setItem(N,t):sessionStorage.removeItem(N),sessionStorage.setItem(Y,n.reasoningEffort??le)}function wt(){var r;if(typeof window>"u"||sessionStorage.getItem(M)!=="1")return null;const e=(r=sessionStorage.getItem(W))==null?void 0:r.trim();if(!e)return null;let t=L(e);try{t=Ie(JSON.parse(e),e)??L(e)}catch{}const n=t.text.trim();return n?{prompt:n,draft:{...t,text:n},model:sessionStorage.getItem(N),reasoningEffort:["low","medium","high","max"].includes(sessionStorage.getItem(Y)??"")?sessionStorage.getItem(Y):"low"}:null}function vt(){sessionStorage.removeItem(W),sessionStorage.removeItem(N),sessionStorage.removeItem(M),sessionStorage.removeItem(Ue),sessionStorage.removeItem(Y)}const pe="gpt-5.6-luna@openai",Ve="deepseek-ai/DeepSeek-V4-Flash-0731",$e="openai/gpt-5.6-luna",fe="deepseek-ai/DeepSeek-V4.1-Flash-1017";function St(e,t){var n;return((n=e.find(r=>r.id===t))==null?void 0:n.provider)??(t===$e?"openrouter":t===pe?"openai":"huggingface")}function Ot(e,t){const n=e.find(r=>r.id===t);return n?n.sponsored===!0:t===fe}const bt=[{id:pe,label:"GPT-6 Luna",provider:"openai"},{id:fe,label:"DeepSeek V4.1 Flash",provider:"huggingface",sponsored:!0}],Tt=[{id:Ve,label:"DeepSeek V4 Flash",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"},{id:"gpt-5.6-luna@openrouter",label:"GPT-5.6 Luna",provider:"openrouter"},{id:"gpt-5.6-luna@openai",label:"GPT-6 Luna (Direct)",provider:"openai"}];class Be extends Error{constructor(t,n){super(t),this.status=n}}async function Et(){const e=[];let t=null;do{const n=await m.listSessions(t);e.push(...n.items),t=n.next_cursor}while(t&&e.length<100);return e}function Ct(e,t=le){return m.createSession(e,t)}function Rt(e){return m.getSession(e)}function xt(e,t){return m.updateSession(e,t)}function kt(e){return m.removeSession(e)}function At(){return m.archiveOldChats()}function Dt(){return m.archiveOldestChats()}function Lt(e){return m.cancelSession(e)}function Pt(e){return m.createOrRefreshShare(e)}async function It(e){try{return await m.getSharedChat(e)}catch(t){throw t instanceof ee?new Be(t.message,t.status):t}}async function Nt(){return m.getModels()}function me(e,t){return e.display_blocks.length===0&&e.content?[{kind:"answer",text:e.content,done:!0}]:ge(e.display_blocks,t)}function ge(e,t){const n=e.map(r=>r.kind==="reasoning"?{...r,active:!1,open:!1}:r.kind==="tool"?{...r,status:r.status==="running"?"error":r.status,open:t&&(r.status==="error"||r.status==="denied"||r.status==="running")}:r.kind==="app"?{...r,schema_version:1,result:r.result??{content:[],structuredContent:{},isError:!1},csp:r.csp??{},permissions:r.permissions??{clipboardWrite:!0},height:r.height||525,public_fork:!!r.public_fork}:r.kind==="artifact"?{...r}:{...r,done:!0});return n.filter((r,a)=>{const i=n[a-1];return!(r.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&r.text===i.text)})}function ye(e){if(e!=null&&e.text)return{routeId:e.route_id,paperVersion:e.paper_version,page:e.page,text:e.text}}function Mt(e){const t=r=>r==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":r==="hf_inference_credential_expired"?"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.":r==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":r==="provider_timeout"?"The model provider timed out. Try again shortly.":r==="openrouter_monthly_budget_exhausted"?"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.":r==="openrouter_staging_funding_disabled"?"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.":r==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":r==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":r==="openrouter_byok_billing_error"?"Your OpenRouter key is connected, but OpenRouter rejected billing for the account behind it. A key spending limit is not an account credit balance. Add credits or enable pay-as-you-go in OpenRouter, then try again.":r==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":r==="openai_budget_exhausted"?"The Papers With Code direct OpenAI allowance is exhausted. Select another model or try again later.":r==="context_too_large"?"This conversation is too large for the selected model. Start a new chat or shorten the context.":["provider_error","provider_unavailable"].includes(r??"")?"The model provider failed before completing the response. You can edit and retry your question.":r==="persistence_error"?"The response could not be saved. You can edit and retry your question.":r==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":r==="external_worker_lost"?"The assistant worker lost contact before the response could be saved. You can edit and retry your question.":"The response did not complete. You can edit and retry your question.",n=r=>r==null||["cancelled","interrupted","stopped"].includes(r);return e.messages.flatMap(r=>{if(r.role==="assistant")return[{id:r.id,role:"assistant",blocks:me(r,!0),followups:r.followups,citations:r.citations,finishReason:r.finish_reason??void 0,streaming:!1}];const a={id:r.id,role:"user",text:r.content,paperMentions:(r.paper_mentions??[]).map(s=>({...s,key:s.occurrence_id})),paperSelection:ye(r.paper_selection),revision:r.revision,status:r.status,error:r.status==="complete"?void 0:r.error_code||r.status};if(!["error","interrupted"].includes(r.status))return[a];const i=r.status==="interrupted"&&n(r.error_code);return[a,{id:`${r.id}-${r.status==="interrupted"?"interrupted":"error"}`,role:"assistant",blocks:ge(r.display_blocks,!0),streaming:!1,finishReason:i?"stopped":void 0,error:i?void 0:t(r.error_code),errorCode:i?void 0:r.error_code??void 0}]})}function Yt(e){return e.messages.map(t=>t.role==="user"?{id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(n=>({...n,key:n.occurrence_id})),paperSelection:ye(t.paper_selection)}:{id:t.id,role:"assistant",blocks:me(t,!1),citations:t.citations,finishReason:t.finish_reason??void 0,error:t.error??void 0,streaming:!1})}function jt(e){const t=Date.now(),n=new Date().setHours(0,0,0,0),r=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const a of[...e].sort((i,s)=>Date.parse(s.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(a.updated_at),s=t-i;i>=n?r[0].items.push(a):s<7*864e5?r[1].items.push(a):s<30*864e5?r[2].items.push(a):r[3].items.push(a)}return r.filter(a=>a.items.length>0)}export{Ze as $,tt as A,ft as B,Be as C,pe as D,Rt as E,Mt as F,Et as G,wt as H,Tt as I,bt as J,St as K,Ot as L,W as M,N,Y as O,ot as P,M as Q,Ue as R,Te as S,at as T,vt as U,Nt as V,Ie as W,xt as X,kt as Y,ht as Z,ut as _,it as a,Je as a0,et as a1,st as b,lt as c,Ct as d,Qe as e,ue as f,It as g,rt as h,ct as i,nt as j,jt as k,Pt as l,Dt as m,At as n,Z as o,Yt as p,_t as q,mt as r,yt as s,F as t,pt as u,L as v,le as w,Lt as x,dt as y,gt as z}; diff --git a/assets/chevron-up-BXtxbTfV.js b/assets/chevron-up-Cpt5JLeI.js similarity index 91% rename from assets/chevron-up-BXtxbTfV.js rename to assets/chevron-up-Cpt5JLeI.js index ca2699da91fe4c3bcfedbd3b145b61edf721e633..af0fb73ca33f013191d5e4a4f879a8e99c1fe9da 100644 --- a/assets/chevron-up-BXtxbTfV.js +++ b/assets/chevron-up-Cpt5JLeI.js @@ -1,4 +1,4 @@ -import{n as o}from"./index-YwiKC6Po.js";/** +import{n as o}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-BPcHPjjB.js b/assets/circle-check-Bci9ZTu9.js similarity index 87% rename from assets/circle-check-BPcHPjjB.js rename to assets/circle-check-Bci9ZTu9.js index 25e7c39cc1e5daede0ef18775c5fd13cbe79f80e..4b804d90610068940b1510f2298a55c67cbc3444 100644 --- a/assets/circle-check-BPcHPjjB.js +++ b/assets/circle-check-Bci9ZTu9.js @@ -1,4 +1,4 @@ -import{n as c}from"./index-YwiKC6Po.js";/** +import{n as c}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codex-Bl7j51l-.js b/assets/codex-Bl7j51l-.js new file mode 100644 index 0000000000000000000000000000000000000000..640cd22c0035b3a25ba6fc87ae2c0c6e5bc4a4f3 --- /dev/null +++ b/assets/codex-Bl7j51l-.js @@ -0,0 +1 @@ +import{a6 as i,a0 as c}from"./index-CbgxfyGU.js";const u="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.",r="/admin/codex-curation/jobs";class n{constructor(e){this.request=e}startPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs`,{method:"POST",body:JSON.stringify({paper_id:t})})}getPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs/${t}`)}cancelPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs/${t}`,{method:"DELETE"})}listJobs(e=100,t={}){const a=new URLSearchParams({limit:String(e)});return Object.entries(t).forEach(([o,s])=>{s&&a.set(o,s)}),this.request(`${r}?${a}`,{cache:"no-store"})}retryJob(e){return this.request(`${r}/${e}/retry`,{method:"POST"})}cancelJob(e){return this.request(`${r}/${e}`,{method:"DELETE"})}async retryTrace(e){await this.request(`${r}/${e}/retry-trace`,{method:"POST"})}async setScheduler(e){await this.request(`${r}/scheduler/${e}`,{method:"POST"})}async promoteBenchmarkCandidate(e,t){await this.request(`${r}/benchmark-candidates/${e}/promote`,{method:"POST",body:JSON.stringify(t)})}async rollbackBenchmarkCandidate(e){await this.request(`${r}/benchmark-candidates/${e}/rollback`,{method:"POST"})}traceUrl(e){return c(`/api/v1${r}/${e}/trace`)}}const m=new n(i);export{u as A,m as c}; diff --git a/assets/codex-C9BvAdr-.js b/assets/codex-C9BvAdr-.js deleted file mode 100644 index b72710c4f2c068547ac45c8de99b707ddd1e43f0..0000000000000000000000000000000000000000 --- a/assets/codex-C9BvAdr-.js +++ /dev/null @@ -1 +0,0 @@ -import{a5 as i,$ as c}from"./index-YwiKC6Po.js";const u="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.",r="/admin/codex-curation/jobs";class n{constructor(e){this.request=e}startPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs`,{method:"POST",body:JSON.stringify({paper_id:t})})}getPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs/${t}`)}cancelPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs/${t}`,{method:"DELETE"})}listJobs(e=100,t={}){const a=new URLSearchParams({limit:String(e)});return Object.entries(t).forEach(([o,s])=>{s&&a.set(o,s)}),this.request(`${r}?${a}`,{cache:"no-store"})}retryJob(e){return this.request(`${r}/${e}/retry`,{method:"POST"})}cancelJob(e){return this.request(`${r}/${e}`,{method:"DELETE"})}async retryTrace(e){await this.request(`${r}/${e}/retry-trace`,{method:"POST"})}async setScheduler(e){await this.request(`${r}/scheduler/${e}`,{method:"POST"})}async promoteBenchmarkCandidate(e,t){await this.request(`${r}/benchmark-candidates/${e}/promote`,{method:"POST",body:JSON.stringify(t)})}async rollbackBenchmarkCandidate(e){await this.request(`${r}/benchmark-candidates/${e}/rollback`,{method:"POST"})}traceUrl(e){return c(`/api/v1${r}/${e}/trace`)}}const m=new n(i);export{u as A,m as c}; diff --git a/assets/copy-YHg6twss.js b/assets/copy-bzw7JVus.js similarity index 89% rename from assets/copy-YHg6twss.js rename to assets/copy-bzw7JVus.js index c9206f49135d1821f0a9c24dfbf404be4b5dac55..bd21172ed0e91cc11c0703b1d79b734a0074f746 100644 --- a/assets/copy-YHg6twss.js +++ b/assets/copy-bzw7JVus.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-YwiKC6Po.js";/** +import{n as e}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/curation-C7Gmmp4z.js b/assets/curation-C7Gmmp4z.js new file mode 100644 index 0000000000000000000000000000000000000000..d0ca352d0607684a0bcea77b01df48b329c9fd7e --- /dev/null +++ b/assets/curation-C7Gmmp4z.js @@ -0,0 +1 @@ +var f=Object.defineProperty;var w=(i,e,t)=>e in i?f(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var d=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);import{K as l,aX as g,a6 as v}from"./index-CbgxfyGU.js";const y={tasks:"tasks",methods:"methods",organizations:"organizations",repositories:"GitHub repositories",project_pages:"project pages",hf_artifacts:"Hugging Face artifacts",source_url:"source URL",x_threads:"X threads",evaluations:"evaluation results"};function _(i){return Object.prototype.hasOwnProperty.call(y,i)}const p="pwc:fresh-auth-edit",c="pwc:fresh-auth-mutation";function E(i){if(typeof window>"u")return;sessionStorage.setItem(p,i);const e=g("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class S{constructor(e,t=E){d(this,"paperLoads",new Map);d(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let s=this.paperLoads.get(e);return s||(s=this.request(`/papers/${e}/curation-state`).catch(o=>{throw this.paperLoads.delete(e),o}),this.paperLoads.set(e,s)),s}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let s=this.evaluationLoads.get(e);return s||(s=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(o=>{throw this.evaluationLoads.delete(e),o}),this.evaluationLoads.set(e,s)),s}async mutatePaper(e,t,s,o,a){const r=this.paperLoads.get(e);if(!r)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const h=(await r).sections[t];if(!h)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,o,s,h,a,`paper:${e}:${t}`)}async mutateEvaluations(e,t,s,o){const a=this.evaluationLoads.get(String(e));if(!a)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const r=(await a).version;return this.mutate("evaluations",s,t,r,o,`paper:${e}:evaluations`)}async mutate(e,t,s,o,a,r){const h=new Headers(a.headers);Object.entries(this.idempotencyHeaders(r,s,o)).forEach(([n,m])=>h.set(n,m));const u={...a,headers:h};try{const n=await this.request(t,u);return this.clearAttempt(u),n}catch(n){throw n instanceof l&&n.status===401&&n.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,s,u),this.recoverFreshAuth(e)):n instanceof l&&n.status===409&&(this.clearAttempt(u),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),n}}freshAuthMutationDraft(){const e=sessionStorage.getItem(c);if(!e)return null;try{const t=JSON.parse(e);if(!t.endpoint.startsWith("/")||t.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(t.options.method))throw new Error("Invalid saved mutation draft");return t}catch{return sessionStorage.removeItem(c),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const t=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(c),sessionStorage.removeItem(p),t}saveFreshAuthMutation(e,t,s,o){const a=Object.fromEntries(new Headers(o.headers).entries()),r=typeof o.body=="string"?o.body:void 0;sessionStorage.setItem(c,JSON.stringify({section:e,endpoint:t,payload:s,options:{method:(o.method??"POST").toUpperCase(),body:r,headers:a}}))}idempotencyHeaders(e,t,s){const o=`pwc:mutation:${e}:${JSON.stringify(t)}`,a=sessionStorage.getItem(o);if(a){const h=JSON.parse(a);return{"Idempotency-Key":h.key,"If-Match":h.version}}const r=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:r,version:s})),sessionStorage.setItem(`pwc:mutation-key:${r}`,o),{"Idempotency-Key":r,"If-Match":s}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const s=sessionStorage.getItem(`pwc:mutation-key:${t}`);s&&sessionStorage.removeItem(s),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const T=new S(v);export{p as F,y as P,_ as i,T as p}; diff --git a/assets/curation-CkzNFTMJ.js b/assets/curation-CkzNFTMJ.js deleted file mode 100644 index ce397596953a11efdc91a877343b5712ba0882cd..0000000000000000000000000000000000000000 --- a/assets/curation-CkzNFTMJ.js +++ /dev/null @@ -1 +0,0 @@ -var p=Object.defineProperty;var f=(n,e,t)=>e in n?p(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var c=(n,e,t)=>f(n,typeof e!="symbol"?e+"":e,t);import{J as l,aW as w,a5 as v}from"./index-YwiKC6Po.js";const u="pwc:fresh-auth-mutation";function g(n){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",n);const e=w("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class y{constructor(e,t=g){c(this,"paperLoads",new Map);c(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let s=this.paperLoads.get(e);return s||(s=this.request(`/papers/${e}/curation-state`).catch(o=>{throw this.paperLoads.delete(e),o}),this.paperLoads.set(e,s)),s}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let s=this.evaluationLoads.get(e);return s||(s=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(o=>{throw this.evaluationLoads.delete(e),o}),this.evaluationLoads.set(e,s)),s}async mutatePaper(e,t,s,o,a){const r=this.paperLoads.get(e);if(!r)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const h=(await r).sections[t];if(!h)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,o,s,h,a,`paper:${e}:${t}`)}async mutateEvaluations(e,t,s,o){const a=this.evaluationLoads.get(String(e));if(!a)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const r=(await a).version;return this.mutate("evaluations",s,t,r,o,`paper:${e}:evaluations`)}async mutate(e,t,s,o,a,r){const h=new Headers(a.headers);Object.entries(this.idempotencyHeaders(r,s,o)).forEach(([i,m])=>h.set(i,m));const d={...a,headers:h};try{const i=await this.request(t,d);return this.clearAttempt(d),i}catch(i){throw i instanceof l&&i.status===401&&i.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,s,d),this.recoverFreshAuth(e)):i instanceof l&&i.status===409&&(this.clearAttempt(d),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),i}}freshAuthMutationDraft(){const e=sessionStorage.getItem(u);if(!e)return null;try{const t=JSON.parse(e);if(!t.endpoint.startsWith("/")||t.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(t.options.method))throw new Error("Invalid saved mutation draft");return t}catch{return sessionStorage.removeItem(u),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const t=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(u),sessionStorage.removeItem("pwc:fresh-auth-edit"),t}saveFreshAuthMutation(e,t,s,o){const a=Object.fromEntries(new Headers(o.headers).entries()),r=typeof o.body=="string"?o.body:void 0;sessionStorage.setItem(u,JSON.stringify({section:e,endpoint:t,payload:s,options:{method:(o.method??"POST").toUpperCase(),body:r,headers:a}}))}idempotencyHeaders(e,t,s){const o=`pwc:mutation:${e}:${JSON.stringify(t)}`,a=sessionStorage.getItem(o);if(a){const h=JSON.parse(a);return{"Idempotency-Key":h.key,"If-Match":h.version}}const r=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:r,version:s})),sessionStorage.setItem(`pwc:mutation-key:${r}`,o),{"Idempotency-Key":r,"If-Match":s}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const s=sessionStorage.getItem(`pwc:mutation-key:${t}`);s&&sessionStorage.removeItem(s),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const A=new y(v);export{A as p}; diff --git a/assets/database-2w-JFZSG.js b/assets/database-CTvEb5JG.js similarity index 89% rename from assets/database-2w-JFZSG.js rename to assets/database-CTvEb5JG.js index 6ae55f06f867710ea6192f79bb63dee79fd4f832..e60464fc5c4551ae3ded8905f414a2824e07237c 100644 --- a/assets/database-2w-JFZSG.js +++ b/assets/database-CTvEb5JG.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-YwiKC6Po.js";/** +import{n as e}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/dialog-foxx0Wu6.js b/assets/dialog-Cfp_d3CC.js similarity index 93% rename from assets/dialog-foxx0Wu6.js rename to assets/dialog-Cfp_d3CC.js index d22f3a6faff2c6adb9bab1ded39b91a2c0bed330..1896313f8e5223296f93ceeeaed740e28c31de89 100644 --- a/assets/dialog-foxx0Wu6.js +++ b/assets/dialog-Cfp_d3CC.js @@ -1 +1 @@ -import{a9 as f,r as l,j as t,aa as p,ac as d,ae as g,X as x,A as o,ab as n,af as i,ag as r}from"./index-YwiKC6Po.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{ref:s,className:o("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e}));c.displayName=n.displayName;const y=l.forwardRef(({className:a,children:e,...s},m)=>t.jsxs(u,{children:[t.jsx(c,{}),t.jsxs(d,{ref:m,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...s,children:[e,t.jsxs(g,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[t.jsx(x,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));y.displayName=d.displayName;const N=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",a),...e});N.displayName="DialogHeader";const j=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});j.displayName="DialogFooter";const D=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=i.displayName;const b=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=r.displayName;export{w as D,y as a,D as b,N as c,b as d,j as e}; +import{aa as f,r as l,j as t,ab as p,ad as d,af as g,X as x,B as o,ac as n,ag as i,ah as r}from"./index-CbgxfyGU.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{ref:s,className:o("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e}));c.displayName=n.displayName;const y=l.forwardRef(({className:a,children:e,...s},m)=>t.jsxs(u,{children:[t.jsx(c,{}),t.jsxs(d,{ref:m,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...s,children:[e,t.jsxs(g,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[t.jsx(x,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));y.displayName=d.displayName;const N=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",a),...e});N.displayName="DialogHeader";const j=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});j.displayName="DialogFooter";const D=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=i.displayName;const b=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=r.displayName;export{w as D,y as a,D as b,N as c,b as d,j as e}; diff --git a/assets/evaluationQueryInvalidation-BogLM1gw.js b/assets/evaluationQueryInvalidation-BogLM1gw.js new file mode 100644 index 0000000000000000000000000000000000000000..84d39e5917d70a92b0da9e86a5b773dff5b8dbd4 --- /dev/null +++ b/assets/evaluationQueryInvalidation-BogLM1gw.js @@ -0,0 +1 @@ +var D=i=>{throw TypeError(i)};var K=(i,e,t)=>e.has(i)||D("Cannot "+t);var c=(i,e,t)=>(K(i,e,"read from private field"),t?t.call(i):e.get(i)),m=(i,e,t)=>e.has(i)?D("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),l=(i,e,t,s)=>(K(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),y=(i,e,t)=>(K(i,e,"access private method"),t);import{ax as N,ay as A,az as V,aA as X,f as Y,r as _,aB as Z}from"./index-CbgxfyGU.js";import{Q as T,a as W,b as ee,e as se,c as te,d as re,s as U,f as ae,g as ie}from"./useQuery-Bx9s5-D2.js";import{i as ne,a as oe}from"./queryInvalidation-Chlw4DEx.js";function j(i,e){const t=new Set(e);return i.filter(s=>!t.has(s))}function ue(i,e,t){const s=i.slice(0);return s[e]=t,s}var C,p,w,E,g,Q,x,M,I,P,h,H,L,G,q,$,z,F,ce=(F=class extends N{constructor(e,t,s){super();m(this,h);m(this,C);m(this,p);m(this,w);m(this,E);m(this,g);m(this,Q);m(this,x);m(this,M);m(this,I);m(this,P,[]);l(this,C,e),l(this,E,s),l(this,w,[]),l(this,g,[]),l(this,p,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&c(this,g).forEach(e=>{e.subscribe(t=>{y(this,h,$).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,c(this,g).forEach(e=>{e.destroy()})}setQueries(e,t){l(this,w,e),l(this,E,t),A.batch(()=>{const s=c(this,g),a=y(this,h,q).call(this,c(this,w));a.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const r=a.map(u=>u.observer),o=r.map(u=>u.getCurrentResult()),d=s.length!==r.length,n=r.some((u,v)=>u!==s[v]),f=d||n,k=f?!0:o.some((u,v)=>{const R=c(this,p)[v];return!R||!V(u,R)});!f&&!k||(f&&(l(this,P,a),l(this,g,r)),l(this,p,o),this.hasListeners()&&(f&&(j(s,r).forEach(u=>{u.destroy()}),j(r,s).forEach(u=>{u.subscribe(v=>{y(this,h,$).call(this,u,v)})})),y(this,h,z).call(this)))})}getCurrentResult(){return c(this,p)}getQueries(){return c(this,g).map(e=>e.getCurrentQuery())}getObservers(){return c(this,g)}getOptimisticResult(e,t){const s=y(this,h,q).call(this,e),a=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),r=s.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>y(this,h,L).call(this,o??a,t,r),()=>y(this,h,H).call(this,a,s)]}},C=new WeakMap,p=new WeakMap,w=new WeakMap,E=new WeakMap,g=new WeakMap,Q=new WeakMap,x=new WeakMap,M=new WeakMap,I=new WeakMap,P=new WeakMap,h=new WeakSet,H=function(e,t){return t.map((s,a)=>{const r=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,o=>{t.forEach(d=>{d.observer.trackProp(o)})})})},L=function(e,t,s){if(t){const a=c(this,I),r=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((o,d)=>o!==a[d]));return(!c(this,Q)||c(this,p)!==c(this,M)||r||t!==c(this,x))&&(l(this,x,t),l(this,M,c(this,p)),s!==void 0&&l(this,I,s),l(this,Q,X(c(this,Q),t(e)))),c(this,Q)}return e},G=function(){var e;return((e=c(this,E))==null?void 0:e.combine)!==void 0&&c(this,g).some((t,s)=>{var a;return t.options.suspense&&((a=c(this,p)[s])==null?void 0:a.data)===void 0})},q=function(e){const t=new Map;c(this,g).forEach(a=>{const r=a.options.queryHash;if(!r)return;const o=t.get(r);o?o.push(a):t.set(r,[a])});const s=[];return e.forEach(a=>{var n;const r=c(this,C).defaultQueryOptions(a),d=((n=t.get(r.queryHash))==null?void 0:n.shift())??new T(c(this,C),r);s.push({defaultedQueryOptions:r,observer:d})}),s},$=function(e,t){const s=c(this,g).indexOf(e);s!==-1&&(l(this,p,ue(c(this,p),s,t)),y(this,h,z).call(this))},z=function(){var e;if(this.hasListeners()){const t=y(this,h,H).call(this,c(this,p),c(this,P)),s=y(this,h,G).call(this),a=c(this,Q),r=s?a:y(this,h,L).call(this,t,(e=c(this,E))==null?void 0:e.combine);(s||a!==r)&&A.batch(()=>{this.listeners.forEach(o=>{o(c(this,p))})})}},F);function pe({queries:i,...e},t){const s=Y(),a=W(),r=ee(),o=_.useMemo(()=>i.map(b=>{const S=s.defaultQueryOptions(b);return S._optimisticResults=a?"isRestoring":"optimistic",S}),[i,s,a]);o.forEach(b=>{se(b);const S=s.getQueryCache().get(b.queryHash);te(b,r,S)}),re(r);const[d]=_.useState(()=>new ce(s,o,e)),[n,f,k]=d.getOptimisticResult(o,e.combine),u=!a&&e.subscribed!==!1;_.useSyncExternalStore(_.useCallback(b=>u?d.subscribe(A.batchCalls(b)):Z,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),_.useEffect(()=>{d.setQueries(o,e)},[o,e,d]);const R=n.some((b,S)=>U(o[S],b))?n.flatMap((b,S)=>{const O=o[S];if(O&&U(O,b)){const J=new T(s,O);return ae(O,J,r)}return[]}):[];if(R.length>0)throw Promise.all(R);const B=n.find((b,S)=>{const O=o[S];return O&&ie({result:b,errorResetBoundary:r,throwOnError:O.throwOnError,query:s.getQueryCache().get(O.queryHash),suspense:O.suspense})});if(B!=null&&B.error)throw B.error;return f(k())}function be(i,e,t,s){const a=new Set(t.flatMap(r=>r.op==="create"?[]:[String(r.evaluation_id)]));return{paperId:i,arxivId:s,contexts:[...e.filter(r=>r.id!==void 0&&a.has(String(r.id))),...t.flatMap(r=>r.op==="delete"?[]:[r.data])]}}function ge(i,e){const t=new Set(e.contexts.flatMap(n=>n.dataset_id==null?[]:[String(n.dataset_id)])),s=new Set(e.contexts.flatMap(n=>n.task_id==null?[]:[String(n.task_id)])),a=new Set([e.paperId]),r=new Set;e.arxivId&&r.add(e.arxivId);const o=new Set(e.contexts.map(n=>`${n.task_id}:${n.dataset_id}`)),d=i.getQueryCache().findAll({predicate:n=>n.queryKey[0]==="dataset-evals"||n.queryKey[0]==="evaluations"&&n.queryKey[1]==="paper"});for(const n of d)for(const f of n.state.data??[])o.has(`${f.task_id}:${f.dataset_id}`)&&(a.add(String(f.paper_id)),f.paper_arxiv_id&&r.add(f.paper_arxiv_id));ne(i,[...a,...r]),oe(i),i.invalidateQueries({predicate:n=>n.queryKey[0]==="evaluations"&&n.queryKey[1]==="paper"&&a.has(String(n.queryKey[2]))}),i.invalidateQueries({predicate:n=>{const[f,k]=n.queryKey;switch(f){case"dataset-evals":case"dataset-tasks":return t.has(String(k));case"dataset":{const u=n.state.data;return t.has(String(k))||!!(u&&t.has(String(u.id)))}case"task-page":{const u=n.state.data;return s.has(String(k))||!!(u&&(s.has(String(u.task.id))||u.subtask_benchmarks.some(v=>s.has(String(v.subtask_id)))||u.benchmarks.some(v=>t.has(String(v.id)))||u.subtask_benchmarks.some(v=>v.benchmarks.some(R=>t.has(String(R.id))))))}case"task-benchmark-trends":{const u=n.state.data;return s.has(String(k))||!!(u&&s.has(String(u.task_id)))}default:return!1}}})}export{be as e,ge as r,pe as u}; diff --git a/assets/evaluationQueryInvalidation-CcSZ8CmA.js b/assets/evaluationQueryInvalidation-CcSZ8CmA.js deleted file mode 100644 index d34d9317ebb8a0c78160e1072b97f52c914eca8a..0000000000000000000000000000000000000000 --- a/assets/evaluationQueryInvalidation-CcSZ8CmA.js +++ /dev/null @@ -1 +0,0 @@ -import{i as S,a as k}from"./queryInvalidation-Dgyv9_oM.js";function h(d,s,i,n){const o=new Set(i.flatMap(t=>t.kind==="create"?[]:[String(t.evaluationId)]));return{paperId:d,arxivId:n,contexts:[...s.filter(t=>t.id!==void 0&&o.has(String(t.id))),...i.flatMap(t=>t.kind==="delete"?[]:[t.data])]}}function _(d,s){const i=new Set(s.contexts.flatMap(a=>a.dataset_id==null?[]:[String(a.dataset_id)])),n=new Set(s.contexts.flatMap(a=>a.task_id==null?[]:[String(a.task_id)])),o=new Set([s.paperId]),t=new Set;s.arxivId&&t.add(s.arxivId);const f=new Set(s.contexts.map(a=>`${a.task_id}:${a.dataset_id}`)),p=d.getQueryCache().findAll({predicate:a=>a.queryKey[0]==="dataset-evals"||a.queryKey[0]==="evaluations"&&a.queryKey[1]==="paper"});for(const a of p)for(const r of a.state.data??[])f.has(`${r.task_id}:${r.dataset_id}`)&&(o.add(String(r.paper_id)),r.paper_arxiv_id&&t.add(r.paper_arxiv_id));S(d,[...o,...t]),k(d),d.invalidateQueries({predicate:a=>a.queryKey[0]==="evaluations"&&a.queryKey[1]==="paper"&&o.has(String(a.queryKey[2]))}),d.invalidateQueries({predicate:a=>{const[r,l]=a.queryKey;switch(r){case"dataset-evals":case"dataset-tasks":return i.has(String(l));case"dataset":{const e=a.state.data;return i.has(String(l))||!!(e&&i.has(String(e.id)))}case"task-page":{const e=a.state.data;return n.has(String(l))||!!(e&&(n.has(String(e.task.id))||e.subtask_benchmarks.some(c=>n.has(String(c.subtask_id)))||e.benchmarks.some(c=>i.has(String(c.id)))||e.subtask_benchmarks.some(c=>c.benchmarks.some(u=>i.has(String(u.id))))))}case"task-benchmark-trends":{const e=a.state.data;return n.has(String(l))||!!(e&&n.has(String(e.task_id)))}default:return!1}}})}export{h as e,_ as r}; diff --git a/assets/external-link-4bBJT0yO.js b/assets/external-link-DZIH4GGr.js similarity index 89% rename from assets/external-link-4bBJT0yO.js rename to assets/external-link-DZIH4GGr.js index b11f14af1c370fdb6132949233395cf08cb1f816..aa81f50f95b4197a3c3cc71725fd66f2bcb578c4 100644 --- a/assets/external-link-4bBJT0yO.js +++ b/assets/external-link-DZIH4GGr.js @@ -1,4 +1,4 @@ -import{n as a}from"./index-YwiKC6Po.js";/** +import{n as a}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-Cijxx2XD.js b/assets/file-text-BK_7Q2rV.js similarity index 91% rename from assets/file-text-Cijxx2XD.js rename to assets/file-text-BK_7Q2rV.js index 816d2fc25283fe69bdb013e38a74804d97374d75..ae00d2329718618e394caaf846503ee08e8f1948 100644 --- a/assets/file-text-Cijxx2XD.js +++ b/assets/file-text-BK_7Q2rV.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-YwiKC6Po.js";/** +import{n as e}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-BZMCt7Ub.js b/assets/github-BYklgHDz.js similarity index 92% rename from assets/github-BZMCt7Ub.js rename to assets/github-BYklgHDz.js index bb697e463b83c62368c3f2d335578b63ef661ea0..295ed7233ae5e400770eac2df622f5b6e8c1bad3 100644 --- a/assets/github-BZMCt7Ub.js +++ b/assets/github-BYklgHDz.js @@ -1,4 +1,4 @@ -import{n as c}from"./index-YwiKC6Po.js";/** +import{n as c}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/globe-DmMnSXeF.js b/assets/globe-B_laOt9Z.js similarity index 89% rename from assets/globe-DmMnSXeF.js rename to assets/globe-B_laOt9Z.js index 28892157115e93d50ba8573a7883d09721ee7533..200290389d542b44ca8ce2da867cbb74cc668429 100644 --- a/assets/globe-DmMnSXeF.js +++ b/assets/globe-B_laOt9Z.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-YwiKC6Po.js";/** +import{n as e}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-BY9tUGxy.js b/assets/hover-card-BY9tUGxy.js deleted file mode 100644 index 8e4670f16522c0c590c8624d5038be13776be65d..0000000000000000000000000000000000000000 --- a/assets/hover-card-BY9tUGxy.js +++ /dev/null @@ -1 +0,0 @@ -import{r as n,v as M,j as i,ai as F,aj as I,t as U,x as l,ak as T,P as O,al as $,z,w as W,am as B,an as G,ao as K,A as V}from"./index-YwiKC6Po.js";var E,b="HoverCard",[y]=z(b,[T]),g=T(),[q,S]=y(b),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:c,openDelay:f=700,closeDelay:v=300}=e,d=g(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=M({prop:s,defaultProp:a??!1,onChange:c,caller:b}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),k=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),i.jsx(q,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:k,hasSelectionRef:h,isPointerDownOnContentRef:p,children:i.jsx(F,{...d,children:r})})};N.displayName=b;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),c=g(r);return i.jsx(I,{asChild:!0,...c,children:i.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,w(a.onOpen)),onPointerLeave:l(e.onPointerLeave,w(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,c=S(H,o);return i.jsx(J,{scope:o,forceMount:r,children:i.jsx(O,{present:r||c.open,children:i.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,c=S(R,e.__scopeHoverCard);return i.jsx(O,{present:s||c.open,children:i.jsx(X,{"data-state":c.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,w(c.onOpen)),onPointerLeave:l(e.onPointerLeave,w(c.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:f,...v}=e,d=S(R,r),C=g(r),u=n.useRef(null),h=W(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),i.jsx(B,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(c,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:i.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=g(r);return i.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function w(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ie=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>i.jsx(re,{children:i.jsx(L,{ref:a,align:o,sideOffset:r,className:V("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ie as a,ne as b}; diff --git a/assets/hover-card-ufez2uMo.js b/assets/hover-card-ufez2uMo.js new file mode 100644 index 0000000000000000000000000000000000000000..ecd904e9ef6cc7ffcb27d5a7092ab4d7db0dbb75 --- /dev/null +++ b/assets/hover-card-ufez2uMo.js @@ -0,0 +1 @@ +import{r as n,w as M,j as c,aj as F,ak as I,v as U,y as l,al as T,P as y,am as $,A as B,x as W,an as z,ao as G,ap as K,B as V}from"./index-CbgxfyGU.js";var E,b="HoverCard",[O]=B(b,[T]),g=T(),[q,S]=O(b),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=g(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=M({prop:s,defaultProp:a??!1,onChange:i,caller:b}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),k=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(q,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:k,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=b;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=g(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,w(a.onOpen)),onPointerLeave:l(e.onPointerLeave,w(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=O(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(J,{scope:o,forceMount:r,children:c.jsx(y,{present:r||i.open,children:c.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=S(R,e.__scopeHoverCard);return c.jsx(y,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,w(i.onOpen)),onPointerLeave:l(e.onPointerLeave,w(i.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=S(R,r),C=g(r),u=n.useRef(null),h=W(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),c.jsx(z,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(i,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=g(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function w(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.jsx(L,{ref:a,align:o,sideOffset:r,className:V("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ce as a,ne as b}; diff --git a/assets/index-BM_xSDJM.js b/assets/index-BH3yOoza.js similarity index 99% rename from assets/index-BM_xSDJM.js rename to assets/index-BH3yOoza.js index 524da544e5aa51f6d7f538560262bf3c2288a21b..61b5157ac1c8eca12b3045925bcde6d6a7d5a6cc 100644 --- a/assets/index-BM_xSDJM.js +++ b/assets/index-BH3yOoza.js @@ -1,4 +1,4 @@ -import{c as ce,v as _e,o as E,u as I,e as Z,g as O,i as W,j as Oe,t as fe,E as je,k as J,l as M,q as A,r as Be,w as qe,f as S,x as H,y as We,m as P,z as T,A as $e}from"./index-CoRCN2p0.js";function re(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,o=t.indexOf(n);for(;o!==-1;)i++,o=t.indexOf(n,o+n.length);return i}function He(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ue(e,n,t){const o=ce((t||{}).ignore||[]),a=Ve(n);let r=-1;for(;++r0?{type:"text",value:y}:void 0),y===!1?p.lastIndex=v+1:(m!==v&&w.push({type:"text",value:s.value.slice(m,v)}),Array.isArray(y)?w.push(...y):y&&w.push(y),m=v+d[0].length,k=!0),!p.global)break;d=p.exec(s.value)}return k?(m?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],i=t.indexOf(")");const o=re(e,"(");let a=re(e,")");for(;i!==-1&&o>a;)e+=t.slice(0,i+1),t=t.slice(i+1),i=t.indexOf(")"),a++;return[e,t]}function he(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||I(t)||Z(t))&&(!n||t!==47)}me.peek=pt;function ot(){this.buffer()}function at(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ut(){this.buffer()}function st(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ct(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteReference"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ft(e){this.exit(e)}function ht(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteDefinition"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function mt(e){this.exit(e)}function pt(){return"["}function me(e,n,t,i){const o=t.createTracker(i);let a=o.move("[^");const r=t.enter("footnoteReference"),u=t.enter("reference");return a+=o.move(t.safe(t.associationId(e),{after:"]",before:a})),u(),r(),a+=o.move("]"),a}function gt(){return{enter:{gfmFootnoteCallString:ot,gfmFootnoteCall:at,gfmFootnoteDefinitionLabelString:ut,gfmFootnoteDefinition:st},exit:{gfmFootnoteCallString:ct,gfmFootnoteCall:ft,gfmFootnoteDefinitionLabelString:ht,gfmFootnoteDefinition:mt}}}function kt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:me},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(i,o,a,r){const u=a.createTracker(r);let l=u.move("[^");const s=a.enter("footnoteDefinition"),h=a.enter("label");return l+=u.move(a.safe(a.associationId(i),{before:l,after:"]"})),h(),l+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),l+=u.move((n?` +import{c as ce,v as _e,o as E,u as I,e as Z,g as O,i as W,j as Oe,t as fe,E as je,k as J,l as M,q as A,r as Be,w as qe,f as S,x as H,y as We,m as P,z as T,A as $e}from"./index-ZkEATkOr.js";function re(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,o=t.indexOf(n);for(;o!==-1;)i++,o=t.indexOf(n,o+n.length);return i}function He(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ue(e,n,t){const o=ce((t||{}).ignore||[]),a=Ve(n);let r=-1;for(;++r0?{type:"text",value:y}:void 0),y===!1?p.lastIndex=v+1:(m!==v&&w.push({type:"text",value:s.value.slice(m,v)}),Array.isArray(y)?w.push(...y):y&&w.push(y),m=v+d[0].length,k=!0),!p.global)break;d=p.exec(s.value)}return k?(m?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],i=t.indexOf(")");const o=re(e,"(");let a=re(e,")");for(;i!==-1&&o>a;)e+=t.slice(0,i+1),t=t.slice(i+1),i=t.indexOf(")"),a++;return[e,t]}function he(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||I(t)||Z(t))&&(!n||t!==47)}me.peek=pt;function ot(){this.buffer()}function at(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ut(){this.buffer()}function st(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ct(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteReference"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ft(e){this.exit(e)}function ht(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteDefinition"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function mt(e){this.exit(e)}function pt(){return"["}function me(e,n,t,i){const o=t.createTracker(i);let a=o.move("[^");const r=t.enter("footnoteReference"),u=t.enter("reference");return a+=o.move(t.safe(t.associationId(e),{after:"]",before:a})),u(),r(),a+=o.move("]"),a}function gt(){return{enter:{gfmFootnoteCallString:ot,gfmFootnoteCall:at,gfmFootnoteDefinitionLabelString:ut,gfmFootnoteDefinition:st},exit:{gfmFootnoteCallString:ct,gfmFootnoteCall:ft,gfmFootnoteDefinitionLabelString:ht,gfmFootnoteDefinition:mt}}}function kt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:me},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(i,o,a,r){const u=a.createTracker(r);let l=u.move("[^");const s=a.enter("footnoteDefinition"),h=a.enter("label");return l+=u.move(a.safe(a.associationId(i),{before:l,after:"]"})),h(),l+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),l+=u.move((n?` `:" ")+a.indentLines(a.containerFlow(i,u.current()),n?pe:bt))),s(),l}}function bt(e,n,t){return n===0?e:pe(e,n,t)}function pe(e,n,t){return(t?"":" ")+e}const xt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ge.peek=vt;function wt(){return{canContainEols:["delete"],enter:{strikethrough:yt},exit:{strikethrough:Ct}}}function dt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xt}],handlers:{delete:ge}}}function yt(e){this.enter({type:"delete",children:[]},e)}function Ct(e){this.exit(e)}function ge(e,n,t,i){const o=t.createTracker(i),a=t.enter("strikethrough");let r=o.move("~~");return r+=t.containerPhrasing(e,{...o.current(),before:r,after:"~"}),r+=o.move("~~"),a(),r}function vt(){return"~"}function At(e){return e.length}function Dt(e,n){const t=n||{},i=(t.align||[]).concat(),o=t.stringLength||At,a=[],r=[],u=[],l=[];let s=0,h=-1;for(;++hs&&(s=e[h].length);++kl[k])&&(l[k]=d)}b.push(w)}r[h]=b,u[h]=x}let c=-1;if(typeof i=="object"&&"length"in i)for(;++cl[c]&&(l[c]=w),g[c]=w),p[c]=d}r.splice(1,0,p),u.splice(1,0,g),h=-1;const m=[];for(;++h "),a.shift(2);const r=t.indentLines(t.containerFlow(e,a.current()),Lt);return o(),r}function Lt(e,n,t){return">"+(t?"":" ")+e}function Tt(e,n){return le(e,n.inConstruct,!0)&&!le(e,n.notInConstruct,!1)}function le(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let i=-1;for(;++ii.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-D0e1jji8.js","assets/useQuery-Bx9s5-D2.js","assets/useMutation-P_trTy9i.js","assets/button-Bv9oZ-QU.js","assets/paperEdits-C5GTaRR8.js","assets/FollowingView-nVVViEvV.js","assets/FeedView-BR2dQQ-K.js","assets/sparkles-BqBXJPmy.js","assets/dialog-Cfp_d3CC.js","assets/catalog-DhK7_9-6.js","assets/research-DgpyzSy_.js","assets/transform-0Udg2p6b.js","assets/researchTopic-CteUev4M.js","assets/plus-UK0TEjgd.js","assets/arrow-right-DotD9yNb.js","assets/PaperFeed-DMvUfA47.js","assets/PaperCard-tdTC_dRN.js","assets/AuthorAvatar-CUJMmp_z.js","assets/AuthorAvatar-o5W6pl_W.css","assets/SotaBadges-C-sTR-EF.js","assets/colors-BkWRhvFI.js","assets/Icon-D-kA0Owz.js","assets/LatexTitle-Z-HGmZ-H.js","assets/paperQueryKeys-B8u1BWlI.js","assets/curation-C7Gmmp4z.js","assets/safeExternalHref-CkBrsh84.js","assets/popover-DKJYnYjk.js","assets/skeleton-HwvdxvSN.js","assets/useIntersectionObserver-CID9Kkak.js","assets/McpShowcase-CMLfdJM2.js","assets/AgentLogos-BBl9UNVD.js","assets/chatSessions-DwLUbLRo.js","assets/chat-DzTo2WUO.js","assets/usePapers-CJaWLZ3y.js","assets/useInfiniteQuery-BAc_4HO5.js","assets/alert-CFDDvdIM.js","assets/ChatView-DlSbJMKT.js","assets/ArtifactWorkspace-Cwix1Wp6.js","assets/hover-card-ufez2uMo.js","assets/CatalogEntityPreviewLink-Cvehtzvn.js","assets/github-BYklgHDz.js","assets/file-text-BK_7Q2rV.js","assets/PaperPreviewLink-DZDNIh1g.js","assets/index-ZkEATkOr.js","assets/index-BH3yOoza.js","assets/katex-DkKDou_j.js","assets/copy-bzw7JVus.js","assets/thumbs-up-CDCzGuPd.js","assets/arrow-left-Czeu3VzJ.js","assets/external-link-DZIH4GGr.js","assets/search-CLtAJGOp.js","assets/chevron-up-Cpt5JLeI.js","assets/ArtifactWorkspace-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/share-2-hXe4dX_y.js","assets/openrouter-DiuY1sPP.js","assets/queryOptions-C9woPjwX.js","assets/SharedChatView-DO_TTtXn.js","assets/PapersListView-DhkGuTns.js","assets/useDebounce-DkuI5tkx.js","assets/apiErrors-BZ5h1Kmb.js","assets/frameworks-DDA0P4Tf.js","assets/PaperDetailView-F3D4F2PU.js","assets/ExternalSourceEvalBadge-npO6bZ8N.js","assets/ExternalSourceEvalBadge-CWUQ52cV.css","assets/paperReader-BIpQD5HO.js","assets/latexPlainText-DI8YEXVe.js","assets/evaluationQueryInvalidation-BogLM1gw.js","assets/queryInvalidation-Chlw4DEx.js","assets/input-B6pxtfPe.js","assets/searchable-select-DNdBIahG.js","assets/loader-circle-CWMja8Zn.js","assets/SignInToEditDialog-CNIcNqbK.js","assets/textarea-Bf06GTSH.js","assets/submissions-aWj7YtuZ.js","assets/database-CTvEb5JG.js","assets/badge-Klg-RRGs.js","assets/globe-B_laOt9Z.js","assets/index-CxPKwmVQ.js","assets/codex-Bl7j51l-.js","assets/savedPapersAuth-DsQUuWa_.js","assets/organizationNames-BVKzYEBp.js","assets/PaperDetailView-CUWCgV3F.css","assets/PaperReaderView-9hbbSNRK.js","assets/MarkdownText-Bj-G_S-B.js","assets/TagsIndexView-jyuGT4BB.js","assets/slug-BpH-Nkvz.js","assets/triangle-alert-U7T_j3JE.js","assets/trending-up-B3K5RlyX.js","assets/moon-BVv5zopc.js","assets/trophy-BQwEH3L7.js","assets/activity-dcKMRXBy.js","assets/AreaSection-NWvfO4Sb.js","assets/TaxonomySuggestionTile-DIw_GKfA.js","assets/useHashScrollOnReady-DgB3XFQL.js","assets/areas-Dvi8w2dp.js","assets/TagBrowseView-CRgLg1ki.js","assets/ResearchFollowButton-D2BXlDtQ.js","assets/BenchmarkTrendSparkline-C135_NtS.js","assets/NotFound-DtzwOULp.js","assets/MethodsIndexView-DYp0dUSa.js","assets/FrameworksIndexView-CQtYg5mA.js","assets/TrendsView-DhWigqns.js","assets/ConferencesIndexView-Cw6IrAk5.js","assets/deadlines-BH32v7D1.js","assets/AiDeadlinesView-BhXjtcbF.js","assets/switch-BSZohE4x.js","assets/ConferenceDetailView-i-HB-ysc.js","assets/conferenceListings-BnmhBx-_.js","assets/ConferenceTaskView-BZBMXZD8.js","assets/OrganizationsIndexView-Bd4D8teF.js","assets/OrganizationsIndexView-CJnrfIkP.css","assets/OrganizationDetailView-BD-vOirQ.js","assets/OrganizationContributionGraph-ah6EPb13.js","assets/AuthorDetailView-BpcSKHs1.js","assets/MethodDetailView-CEUGGyVV.js","assets/BenchmarkDetailView-BGwBE1Ld.js","assets/BenchmarkDetailView-CXxK75GR.css","assets/SavedPapersView-CewIlVsw.js","assets/SettingsView-C0A-yv3U.js","assets/PrivacyView-CodFIqUq.js","assets/ApiDocsView-hjoHKqpf.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-BrXaRo4V.js","assets/McpView-EGeqkP46.css","assets/SubmitView-C6p4dpHt.js","assets/CronDashboard-CC1lPV3k.js","assets/CronDashboard-B3Xofwvu.js","assets/CronDashboard-DwChfW9h.css","assets/refresh-cw-Cps6nypW.js","assets/circle-check-Bci9ZTu9.js","assets/AutonomousOperations-CzJGtkdV.js","assets/SubmissionsDashboard-eKjMsSf9.js","assets/SubmissionsDashboard-BTmvDoLW.css","assets/UserProfileView-gm0usnRn.js","assets/RateLimitsView-C9bDo_Dq.js","assets/AstraForRoboticsView-pQ4cp5_V.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-LaDVSpVs.js","assets/StagingAccessRequestView-DgeEeE2r.js"])))=>i.map(i=>d[i]); var rk=Object.defineProperty;var zg=t=>{throw TypeError(t)};var ik=(t,e,n)=>e in t?rk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var wr=(t,e,n)=>ik(t,typeof e!="symbol"?e+"":e,n),hd=(t,e,n)=>e.has(t)||zg("Cannot "+n);var A=(t,e,n)=>(hd(t,e,"read from private field"),n?n.call(t):e.get(t)),le=(t,e,n)=>e.has(t)?zg("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ee=(t,e,n,r)=>(hd(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),nt=(t,e,n)=>(hd(t,e,"access private method"),n);var al=(t,e,n,r)=>({set _(i){ee(t,e,i,n)},get _(){return A(t,e,r)}});function sk(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var c3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function k0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var P0={exports:{}},Cc={},R0={exports:{}},ae={};/** * @license React * react.production.min.js @@ -119,7 +119,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var fo=g;function E$(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var S$=typeof Object.is=="function"?Object.is:E$,C$=fo.useState,k$=fo.useEffect,P$=fo.useLayoutEffect,R$=fo.useDebugValue;function T$(t,e){var n=e(),r=C$({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return P$(function(){i.value=n,i.getSnapshot=e,Rf(i)&&s({inst:i})},[t,n,e]),k$(function(){return Rf(i)&&s({inst:i}),t(function(){Rf(i)&&s({inst:i})})},[t]),R$(n),n}function Rf(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!S$(t,n)}catch{return!0}}function I$(t,e){return e()}var O$=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?I$:T$;jS.useSyncExternalStore=fo.useSyncExternalStore!==void 0?fo.useSyncExternalStore:O$;LS.exports=jS;var M$=LS.exports;function A$(){return M$.useSyncExternalStore(N$,()=>!0,()=>!1)}function N$(){return()=>{}}var hg="Avatar",[$$]=h$(hg),[F$,DS]=$$(hg),zS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[i,s]=g.useState("idle");return w.jsx(F$,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:w.jsx(fg.span,{...r,ref:e})})});zS.displayName=hg;var US="AvatarImage",VS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=t,o=DS(US,n),a=L$(r,s),l=Ft(u=>{i(u),o.onImageLoadingStatusChange(u)});return on(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?w.jsx(fg.img,{...s,ref:e,src:r}):null});VS.displayName=US;var BS="AvatarFallback",qS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...i}=t,s=DS(BS,n),[o,a]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&s.imageLoadingStatus!=="loaded"?w.jsx(fg.span,{...i,ref:e}):null});qS.displayName=BS;function B_(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function L$(t,{referrerPolicy:e,crossOrigin:n}){const r=A$(),i=g.useRef(null),s=r?(i.current||(i.current=new window.Image),i.current):null,[o,a]=g.useState(()=>B_(s,t));return on(()=>{a(B_(s,t))},[s,t]),on(()=>{const l=d=>()=>{a(d)};if(!s)return;const u=l("loaded"),c=l("error");return s.addEventListener("load",u),s.addEventListener("error",c),e&&(s.referrerPolicy=e),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",u),s.removeEventListener("error",c)}},[s,n,e]),o}var HS=zS,WS=VS,GS=qS;function KS(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const e=z$(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(pg);return a[0]===""&&a.length!==1&&a.shift(),YS(a,e)||D$(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},YS=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?YS(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(pg);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},q_=/^\[(.+)\]$/,D$=t=>{if(q_.test(t)){const e=q_.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},z$=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return V$(Object.entries(t.classGroups),n).forEach(([s,o])=>{Pp(o,r,s,e)}),r},Pp=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:H_(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(U$(i)){Pp(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Pp(o,H_(e,s),n,r)})})},H_=(t,e)=>{let n=t;return e.split(pg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},U$=t=>t.isThemeGetter,V$=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[n,i]}):t,B$=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},XS="!",q$=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,o=a=>{const l=[];let u=0,c=0,d;for(let y=0;yc?d-c:void 0;return{modifiers:l,hasImportantModifier:_,baseClassName:m,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},H$=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},W$=t=>({cache:B$(t.cacheSize),parseClassName:q$(t),...j$(t)}),G$=/\s+/,K$=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(G$);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:_}=n(u);let m=!!_,p=r(m?f.substring(0,_):f);if(!p){if(!m){a=u+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=u+(a.length>0?" "+a:a);continue}m=!1}const y=H$(c).join(":"),h=d?y+XS:y,v=h+p;if(s.includes(v))continue;s.push(v);const x=i(p,m);for(let b=0;b0?" "+a:a)}return a};function Q$(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rd(c),t());return n=W$(u),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=K$(l,n);return i(l,c),c}return function(){return s(Q$.apply(null,arguments))}}const Re=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},ZS=/^\[(?:([a-z-]+):)?(.+)\]$/i,X$=/^\d+\/\d+$/,J$=new Set(["px","full","screen"]),Z$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wn=t=>js(t)||J$.has(t)||X$.test(t),Sr=t=>_o(t,"length",dF),js=t=>!!t&&!Number.isNaN(Number(t)),Tf=t=>_o(t,"number",js),zo=t=>!!t&&Number.isInteger(Number(t)),iF=t=>t.endsWith("%")&&js(t.slice(0,-1)),re=t=>ZS.test(t),Cr=t=>Z$.test(t),sF=new Set(["length","size","percentage"]),oF=t=>_o(t,sF,e1),aF=t=>_o(t,"position",e1),lF=new Set(["image","url"]),uF=t=>_o(t,lF,hF),cF=t=>_o(t,"",fF),Uo=()=>!0,_o=(t,e,n)=>{const r=ZS.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},dF=t=>eF.test(t)&&!tF.test(t),e1=()=>!1,fF=t=>nF.test(t),hF=t=>rF.test(t),pF=()=>{const t=Re("colors"),e=Re("spacing"),n=Re("blur"),r=Re("brightness"),i=Re("borderColor"),s=Re("borderRadius"),o=Re("borderSpacing"),a=Re("borderWidth"),l=Re("contrast"),u=Re("grayscale"),c=Re("hueRotate"),d=Re("invert"),f=Re("gap"),_=Re("gradientColorStops"),m=Re("gradientColorStopPositions"),p=Re("inset"),y=Re("margin"),h=Re("opacity"),v=Re("padding"),x=Re("saturate"),b=Re("scale"),E=Re("sepia"),S=Re("skew"),k=Re("space"),C=Re("translate"),R=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",re,e],O=()=>[re,e],U=()=>["",Wn,Sr],L=()=>["auto",js,re],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",re],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[js,re];return{cacheSize:500,separator:":",theme:{colors:[Uo],spacing:[Wn,Sr],blur:["none","",Cr,re],brightness:G(),borderColor:[t],borderRadius:["none","","full",Cr,re],borderSpacing:O(),borderWidth:U(),contrast:G(),grayscale:M(),hueRotate:G(),invert:M(),gap:O(),gradientColorStops:[t],gradientColorStopPositions:[iF,Sr],inset:$(),margin:$(),opacity:G(),padding:O(),saturate:G(),scale:G(),sepia:M(),skew:G(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Cr]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),re]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",zo,re]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",zo,re]}],"grid-cols":[{"grid-cols":[Uo]}],"col-start-end":[{col:["auto",{span:["full",zo,re]},re]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Uo]}],"row-start-end":[{row:["auto",{span:[zo,re]},re]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,e]}],"min-w":[{"min-w":[re,e,"min","max","fit"]}],"max-w":[{"max-w":[re,e,"none","full","min","max","fit","prose",{screen:[Cr]},Cr]}],h:[{h:[re,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Cr,Sr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Tf]}],"font-family":[{font:[Uo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",re]}],"line-clamp":[{"line-clamp":["none",js,Tf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wn,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wn,Sr]}],"underline-offset":[{"underline-offset":["auto",Wn,re]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),aF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},uF]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[_]}],"gradient-via":[{via:[_]}],"gradient-to":[{to:[_]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:q()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...q()]}],"outline-offset":[{"outline-offset":[Wn,re]}],"outline-w":[{outline:[Wn,Sr]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Wn,Sr]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Cr,cF]}],"shadow-color":[{shadow:[Uo]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Cr,re]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[zo,re]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Wn,Sr,Tf]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},vF=Y$(pF);function at(...t){return vF(QS(t))}function k3(t){const e=t.trim(),n=e.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=e.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:e}function P3(t){if(t==null||t==="")return"—";const e=typeof t=="string"?parseFloat(t):t;return Number.isFinite(e)?Math.abs(e)>=100?Bl(e,0):Math.abs(e)>=10?Bl(e,1):Math.abs(e)<1?Bl(e,3):Bl(e,2):String(t)}function Bl(t,e){const n=String(Math.abs(t));if(n.includes("e"))return t.toFixed(e);const r=+`${Math.round(+`${n}e${e}`)}e-${e}`;return(t<0?-r:r).toFixed(e)}const t1=g.forwardRef(({className:t,...e},n)=>w.jsx(HS,{ref:n,className:at("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));t1.displayName=HS.displayName;const n1=g.forwardRef(({className:t,...e},n)=>w.jsx(WS,{ref:n,className:at("aspect-square h-full w-full",t),...e}));n1.displayName=WS.displayName;const r1=g.forwardRef(({className:t,...e},n)=>w.jsx(GS,{ref:n,className:at("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));r1.displayName=GS.displayName;function W_(t){const e=gF(t),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(yF);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function gF(t){const e=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=wF(i),a=_F(s,i.props);return i.type!==g.Fragment&&(a.ref=r?oi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var mF=Symbol("radix.slottable");function yF(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===mF}function _F(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function wF(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function vg(t){const e=t+"CollectionProvider",[n,r]=Wi(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:y,children:h}=p,v=V.useRef(null),x=V.useRef(new Map).current;return w.jsx(i,{scope:y,itemMap:x,collectionRef:v,children:h})};o.displayName=e;const a=t+"CollectionSlot",l=W_(a),u=V.forwardRef((p,y)=>{const{scope:h,children:v}=p,x=s(a,h),b=Xe(y,x.collectionRef);return w.jsx(l,{ref:b,children:v})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",f=W_(c),_=V.forwardRef((p,y)=>{const{scope:h,children:v,...x}=p,b=V.useRef(null),E=Xe(y,b),S=s(c,h);return V.useEffect(()=>(S.itemMap.set(b,{ref:b,...x}),()=>void S.itemMap.delete(b))),w.jsx(f,{[d]:"",ref:E,children:v})});_.displayName=c;function m(p){const y=s(t+"CollectionConsumer",p);return V.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((S,k)=>x.indexOf(S.ref.current)-x.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:_},m,r]}var xF=g.createContext(void 0);function i1(t){const e=g.useContext(xF);return t||e||"ltr"}const bF=["top","right","bottom","left"],ti=Math.min,zt=Math.max,yc=Math.round,ql=Math.floor,Un=t=>({x:t,y:t}),EF={left:"right",right:"left",bottom:"top",top:"bottom"};function Rp(t,e,n){return zt(t,ti(e,n))}function fr(t,e){return typeof t=="function"?t(e):t}function hr(t){return t.split("-")[0]}function wo(t){return t.split("-")[1]}function gg(t){return t==="x"?"y":"x"}function mg(t){return t==="y"?"height":"width"}function jn(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function yg(t){return gg(jn(t))}function SF(t,e,n){n===void 0&&(n=!1);const r=wo(t),i=yg(t),s=mg(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=_c(o)),[o,_c(o)]}function CF(t){const e=_c(t);return[Tp(t),e,Tp(e)]}function Tp(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const G_=["left","right"],K_=["right","left"],kF=["top","bottom"],PF=["bottom","top"];function RF(t,e,n){switch(t){case"top":case"bottom":return n?e?K_:G_:e?G_:K_;case"left":case"right":return e?kF:PF;default:return[]}}function TF(t,e,n,r){const i=wo(t);let s=RF(hr(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Tp)))),s}function _c(t){const e=hr(t);return EF[e]+t.slice(e.length)}function IF(t){return{top:0,right:0,bottom:0,left:0,...t}}function s1(t){return typeof t!="number"?IF(t):{top:t,right:t,bottom:t,left:t}}function wc(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Q_(t,e,n){let{reference:r,floating:i}=t;const s=jn(e),o=yg(e),a=mg(o),l=hr(e),u=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let _;switch(l){case"top":_={x:c,y:r.y-i.height};break;case"bottom":_={x:c,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:d};break;case"left":_={x:r.x-i.width,y:d};break;default:_={x:r.x,y:r.y}}switch(wo(e)){case"start":_[o]-=f*(n&&u?-1:1);break;case"end":_[o]+=f*(n&&u?-1:1);break}return _}async function OF(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:_=0}=fr(e,t),m=s1(_),y=a[f?d==="floating"?"reference":"floating":d],h=wc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),b=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=wc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:x,strategy:l}):v);return{top:(h.top-E.top+m.top)/b.y,bottom:(E.bottom-h.bottom+m.bottom)/b.y,left:(h.left-E.left+m.left)/b.x,right:(E.right-h.right+m.right)/b.x}}const MF=50,AF=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:OF},l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:d}=Q_(u,r,l),f=r,_=0;const m={};for(let p=0;p({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=fr(t,e)||{};if(u==null)return{};const d=s1(c),f={x:n,y:r},_=yg(i),m=mg(_),p=await o.getDimensions(u),y=_==="y",h=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",b=s.reference[m]+s.reference[_]-f[_]-s.floating[m],E=f[_]-s.reference[_],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=S?S[x]:0;(!k||!await(o.isElement==null?void 0:o.isElement(S)))&&(k=a.floating[x]||s.floating[m]);const C=b/2-E/2,R=k/2-p[m]/2-1,P=ti(d[h],R),$=ti(d[v],R),O=P,U=k-p[m]-$,L=k/2-p[m]/2+C,H=Rp(O,L,U),q=!l.arrow&&wo(i)!=null&&L!==H&&s.reference[m]/2-(LL<=0)){var $,O;const L=((($=s.flip)==null?void 0:$.index)||0)+1,H=k[L];if(H&&(!(d==="alignment"?v!==jn(H):!1)||P.every(I=>jn(I.placement)===v?I.overflows[0]>0:!0)))return{data:{index:L,overflows:P},reset:{placement:H}};let q=(O=P.filter(K=>K.overflows[0]<=0).sort((K,I)=>K.overflows[1]-I.overflows[1])[0])==null?void 0:O.placement;if(!q)switch(_){case"bestFit":{var U;const K=(U=P.filter(I=>{if(S){const M=jn(I.placement);return M===v||M==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(M=>M>0).reduce((M,B)=>M+B,0)]).sort((I,M)=>I[1]-M[1])[0])==null?void 0:U[0];K&&(q=K);break}case"initialPlacement":q=a;break}if(i!==q)return{reset:{placement:q}}}return{}}}};function Y_(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function X_(t){return bF.some(e=>t[e]>=0)}const FF=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...s}=fr(t,e);switch(i){case"referenceHidden":{const o=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=Y_(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:X_(a)}}}case"escaped":{const o=await r.detectOverflow(e,{...s,altBoundary:!0}),a=Y_(o,n.floating);return{data:{escapedOffsets:a,escaped:X_(a)}}}default:return{}}}}},o1=new Set(["left","top"]);async function LF(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=hr(n),a=wo(n),l=jn(n)==="y",u=o1.has(o)?-1:1,c=s&&l?-1:1,d=fr(e,t);let{mainAxis:f,crossAxis:_,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(_=a==="end"?m*-1:m),l?{x:_*c,y:f*u}:{x:f*u,y:_*c}}const jF=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await LF(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},DF=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:h=>{let{x:v,y:x}=h;return{x:v,y:x}}},...u}=fr(t,e),c={x:n,y:r},d=await s.detectOverflow(e,u),f=jn(hr(i)),_=gg(f);let m=c[_],p=c[f];if(o){const h=_==="y"?"top":"left",v=_==="y"?"bottom":"right",x=m+d[h],b=m-d[v];m=Rp(x,m,b)}if(a){const h=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+d[h],b=p-d[v];p=Rp(x,p,b)}const y=l.fn({...e,[_]:m,[f]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[_]:o,[f]:a}}}}}},zF=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=fr(t,e),c={x:n,y:r},d=jn(i),f=gg(d);let _=c[f],m=c[d];const p=fr(a,e),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const x=f==="y"?"height":"width",b=s.reference[f]-s.floating[x]+y.mainAxis,E=s.reference[f]+s.reference[x]-y.mainAxis;_E&&(_=E)}if(u){var h,v;const x=f==="y"?"width":"height",b=o1.has(hr(i)),E=s.reference[d]-s.floating[x]+(b&&((h=o.offset)==null?void 0:h[d])||0)+(b?0:y.crossAxis),S=s.reference[d]+s.reference[x]+(b?0:((v=o.offset)==null?void 0:v[d])||0)-(b?y.crossAxis:0);mS&&(m=S)}return{[f]:_,[d]:m}}}},UF=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...u}=fr(t,e),c=await o.detectOverflow(e,u),d=hr(i),f=wo(i),_=jn(i)==="y",{width:m,height:p}=s.floating;let y,h;d==="top"||d==="bottom"?(y=d,h=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,y=f==="end"?"top":"bottom");const v=p-c.top-c.bottom,x=m-c.left-c.right,b=ti(p-c[y],v),E=ti(m-c[h],x),S=!e.middlewareData.shift;let k=b,C=E;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(C=x),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(k=v),S&&!f){const P=zt(c.left,0),$=zt(c.right,0),O=zt(c.top,0),U=zt(c.bottom,0);_?C=m-2*(P!==0||$!==0?P+$:zt(c.left,c.right)):k=p-2*(O!==0||U!==0?O+U:zt(c.top,c.bottom))}await l({...e,availableWidth:C,availableHeight:k});const R=await o.getDimensions(a.floating);return m!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function nd(){return typeof window<"u"}function xo(t){return a1(t)?(t.nodeName||"").toLowerCase():"#document"}function Ht(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Bn(t){var e;return(e=(a1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function a1(t){return nd()?t instanceof Node||t instanceof Ht(t).Node:!1}function bn(t){return nd()?t instanceof Element||t instanceof Ht(t).Element:!1}function mr(t){return nd()?t instanceof HTMLElement||t instanceof Ht(t).HTMLElement:!1}function J_(t){return!nd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ht(t).ShadowRoot}function nl(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=En(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function VF(t){return/^(table|td|th)$/.test(xo(t))}function rd(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const BF=/transform|translate|scale|rotate|perspective|filter/,qF=/paint|layout|strict|content/,fi=t=>!!t&&t!=="none";let If;function _g(t){const e=bn(t)?En(t):t;return fi(e.transform)||fi(e.translate)||fi(e.scale)||fi(e.rotate)||fi(e.perspective)||!wg()&&(fi(e.backdropFilter)||fi(e.filter))||BF.test(e.willChange||"")||qF.test(e.contain||"")}function HF(t){let e=ni(t);for(;mr(e)&&!ho(e);){if(_g(e))return e;if(rd(e))return null;e=ni(e)}return null}function wg(){return If==null&&(If=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),If}function ho(t){return/^(html|body|#document)$/.test(xo(t))}function En(t){return Ht(t).getComputedStyle(t)}function id(t){return bn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ni(t){if(xo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||J_(t)&&t.host||Bn(t);return J_(e)?e.host:e}function l1(t){const e=ni(t);return ho(e)?t.ownerDocument?t.ownerDocument.body:t.body:mr(e)&&nl(e)?e:l1(e)}function Ba(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=l1(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Ht(i);if(s){const a=Ip(o);return e.concat(o,o.visualViewport||[],nl(i)?i:[],a&&n?Ba(a):[])}else return e.concat(i,Ba(i,[],n))}function Ip(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function u1(t){const e=En(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=mr(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=yc(n)!==s||yc(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function xg(t){return bn(t)?t:t.contextElement}function Ds(t){const e=xg(t);if(!mr(e))return Un(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=u1(e);let o=(s?yc(n.width):n.width)/r,a=(s?yc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const WF=Un(0);function c1(t){const e=Ht(t);return!wg()||!e.visualViewport?WF:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function GF(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ht(t)?!1:e}function Vi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=xg(t);let o=Un(1);e&&(r?bn(r)&&(o=Ds(r)):o=Ds(t));const a=GF(s,n,r)?c1(s):Un(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=Ht(s),_=r&&bn(r)?Ht(r):r;let m=f,p=Ip(m);for(;p&&r&&_!==m;){const y=Ds(p),h=p.getBoundingClientRect(),v=En(p),x=h.left+(p.clientLeft+parseFloat(v.paddingLeft))*y.x,b=h.top+(p.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=x,u+=b,m=Ht(p),p=Ip(m)}}return wc({width:c,height:d,x:l,y:u})}function sd(t,e){const n=id(t).scrollLeft;return e?e.left+n:Vi(Bn(t)).left+n}function d1(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-sd(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function KF(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Bn(r),a=e?rd(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Un(1);const c=Un(0),d=mr(r);if((d||!d&&!s)&&((xo(r)!=="body"||nl(o))&&(l=id(r)),d)){const _=Vi(r);u=Ds(r),c.x=_.x+r.clientLeft,c.y=_.y+r.clientTop}const f=o&&!d&&!s?d1(o,l):Un(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function QF(t){return Array.from(t.getClientRects())}function YF(t){const e=Bn(t),n=id(t),r=t.ownerDocument.body,i=zt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=zt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+sd(t);const a=-n.scrollTop;return En(r).direction==="rtl"&&(o+=zt(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const Z_=25;function XF(t,e){const n=Ht(t),r=Bn(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=wg();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=sd(r);if(u<=0){const c=r.ownerDocument,d=c.body,f=getComputedStyle(d),_=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-_);m<=Z_&&(s-=m)}else u<=Z_&&(s+=u);return{width:s,height:o,x:a,y:l}}function JF(t,e){const n=Vi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=mr(t)?Ds(t):Un(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function e0(t,e,n){let r;if(e==="viewport")r=XF(t,n);else if(e==="document")r=YF(Bn(t));else if(bn(e))r=JF(e,n);else{const i=c1(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return wc(r)}function f1(t,e){const n=ni(t);return n===e||!bn(n)||ho(n)?!1:En(n).position==="fixed"||f1(n,e)}function ZF(t,e){const n=e.get(t);if(n)return n;let r=Ba(t,[],!1).filter(a=>bn(a)&&xo(a)!=="body"),i=null;const s=En(t).position==="fixed";let o=s?ni(t):t;for(;bn(o)&&!ho(o);){const a=En(o),l=_g(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||nl(o)&&!l&&f1(t,o))?r=r.filter(c=>c!==o):i=a,o=ni(o)}return e.set(t,r),r}function eL(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?rd(e)?[]:ZF(e,this._c):[].concat(n),r],a=e0(e,o[0],i);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}k===1&&!p1(u,t.getBoundingClientRect())&&o(),b=!1}try{n=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(t)}return o(!0),s}function aL(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=xg(t),c=i||s?[...u?Ba(u):[],...e?Ba(e):[]]:[];c.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const d=u&&a?oL(u,n):null;let f=-1,_=null;o&&(_=new ResizeObserver(h=>{let[v]=h;v&&v.target===u&&_&&e&&(_.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=_)==null||x.observe(e)})),n()}),u&&!l&&_.observe(u),e&&_.observe(e));let m,p=l?Vi(t):null;l&&y();function y(){const h=Vi(t);p&&!p1(p,h)&&n(),p=h,m=requestAnimationFrame(y)}return n(),()=>{var h;c.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(h=_)==null||h.disconnect(),_=null,l&&cancelAnimationFrame(m)}}const lL=jF,uL=DF,cL=$F,dL=UF,fL=FF,n0=NF,hL=zF,pL=(t,e,n)=>{const r=new Map,i={platform:sL,...n},s={...i.platform,_c:r};return AF(t,e,{...i,platform:s})};var vL=typeof document<"u",gL=function(){},hu=vL?g.useLayoutEffect:gL;function xc(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!xc(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!xc(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function v1(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function r0(t,e){const n=v1(t);return Math.round(e*n)/n}function Mf(t){const e=g.useRef(t);return hu(()=>{e.current=t}),e}function mL(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,d]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,_]=g.useState(r);xc(f,r)||_(r);const[m,p]=g.useState(null),[y,h]=g.useState(null),v=g.useCallback(I=>{I!==S.current&&(S.current=I,p(I))},[]),x=g.useCallback(I=>{I!==k.current&&(k.current=I,h(I))},[]),b=s||m,E=o||y,S=g.useRef(null),k=g.useRef(null),C=g.useRef(c),R=l!=null,P=Mf(l),$=Mf(i),O=Mf(u),U=g.useCallback(()=>{if(!S.current||!k.current)return;const I={placement:e,strategy:n,middleware:f};$.current&&(I.platform=$.current),pL(S.current,k.current,I).then(M=>{const B={...M,isPositioned:O.current!==!1};L.current&&!xc(C.current,B)&&(C.current=B,el.flushSync(()=>{d(B)}))})},[f,e,n,$,O]);hu(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(I=>({...I,isPositioned:!1})))},[u]);const L=g.useRef(!1);hu(()=>(L.current=!0,()=>{L.current=!1}),[]),hu(()=>{if(b&&(S.current=b),E&&(k.current=E),b&&E){if(P.current)return P.current(b,E,U);U()}},[b,E,U,P,R]);const H=g.useMemo(()=>({reference:S,floating:k,setReference:v,setFloating:x}),[v,x]),q=g.useMemo(()=>({reference:b,floating:E}),[b,E]),K=g.useMemo(()=>{const I={position:n,left:0,top:0};if(!q.floating)return I;const M=r0(q.floating,c.x),B=r0(q.floating,c.y);return a?{...I,transform:"translate("+M+"px, "+B+"px)",...v1(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:B}},[n,a,q.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:U,refs:H,elements:q,floatingStyles:K}),[c,U,H,q,K])}const yL=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?n0({element:r.current,padding:i}).fn(n):{}:r?n0({element:r,padding:i}).fn(n):{}}}},_L=(t,e)=>{const n=lL(t);return{name:n.name,fn:n.fn,options:[t,e]}},wL=(t,e)=>{const n=uL(t);return{name:n.name,fn:n.fn,options:[t,e]}},xL=(t,e)=>({fn:hL(t).fn,options:[t,e]}),bL=(t,e)=>{const n=cL(t);return{name:n.name,fn:n.fn,options:[t,e]}},EL=(t,e)=>{const n=dL(t);return{name:n.name,fn:n.fn,options:[t,e]}},SL=(t,e)=>{const n=fL(t);return{name:n.name,fn:n.fn,options:[t,e]}},CL=(t,e)=>{const n=yL(t);return{name:n.name,fn:n.fn,options:[t,e]}};var kL="Arrow",g1=g.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return w.jsx(Ee.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});g1.displayName=kL;var PL=g1;function RL(t){const[e,n]=g.useState(void 0);return on(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var bg="Popper",[m1,y1]=Wi(bg),[TL,_1]=m1(bg),w1=t=>{const{__scopePopper:e,children:n}=t,[r,i]=g.useState(null);return w.jsx(TL,{scope:e,anchor:r,onAnchorChange:i,children:n})};w1.displayName=bg;var x1="PopperAnchor",b1=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=_1(x1,n),o=g.useRef(null),a=Xe(e,o),l=g.useRef(null);return g.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||o.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:w.jsx(Ee.div,{...i,ref:a})});b1.displayName=x1;var Eg="PopperContent",[IL,OL]=m1(Eg),E1=g.forwardRef((t,e)=>{var ze,ve,Ae,kt,yr,gt;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:_="optimized",onPlaced:m,...p}=t,y=_1(Eg,n),[h,v]=g.useState(null),x=Xe(e,Ge=>v(Ge)),[b,E]=g.useState(null),S=RL(b),k=(S==null?void 0:S.width)??0,C=(S==null?void 0:S.height)??0,R=r+(s!=="center"?"-"+s:""),P=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(u)?u:[u],O=$.length>0,U={padding:P,boundary:$.filter(AL),altBoundary:O},{refs:L,floatingStyles:H,placement:q,isPositioned:K,middlewareData:I}=mL({strategy:"fixed",placement:R,whileElementsMounted:(...Ge)=>aL(...Ge,{animationFrame:_==="always"}),elements:{reference:y.anchor},middleware:[_L({mainAxis:i+C,alignmentAxis:o}),l&&wL({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?xL():void 0,...U}),l&&bL({...U}),EL({...U,apply:({elements:Ge,rects:ai,availableWidth:Yi,availableHeight:Pt})=>{const{width:Xi,height:_r}=ai.reference,ln=Ge.floating.style;ln.setProperty("--radix-popper-available-width",`${Yi}px`),ln.setProperty("--radix-popper-available-height",`${Pt}px`),ln.setProperty("--radix-popper-anchor-width",`${Xi}px`),ln.setProperty("--radix-popper-anchor-height",`${_r}px`)}}),b&&CL({element:b,padding:a}),NL({arrowWidth:k,arrowHeight:C}),f&&SL({strategy:"referenceHidden",...U})]}),[M,B]=k1(q),G=Ft(m);on(()=>{K&&(G==null||G())},[K,G]);const Z=(ze=I.arrow)==null?void 0:ze.x,se=(ve=I.arrow)==null?void 0:ve.y,ce=((Ae=I.arrow)==null?void 0:Ae.centerOffset)!==0,[_e,Se]=g.useState();return on(()=>{h&&Se(window.getComputedStyle(h).zIndex)},[h]),w.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:K?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[(kt=I.transformOrigin)==null?void 0:kt.x,(yr=I.transformOrigin)==null?void 0:yr.y].join(" "),...((gt=I.hide)==null?void 0:gt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:w.jsx(IL,{scope:n,placedSide:M,onArrowChange:E,arrowX:Z,arrowY:se,shouldHideArrow:ce,children:w.jsx(Ee.div,{"data-side":M,"data-align":B,...p,ref:x,style:{...p.style,animation:K?void 0:"none"}})})})});E1.displayName=Eg;var S1="PopperArrow",ML={top:"bottom",right:"left",bottom:"top",left:"right"},C1=g.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=OL(S1,r),o=ML[s.placedSide];return w.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:w.jsx(PL,{...i,ref:n,style:{...i.style,display:"block"}})})});C1.displayName=S1;function AL(t){return t!==null}var NL=t=>({name:"transformOrigin",options:t,fn(e){var y,h,v;const{placement:n,rects:r,middlewareData:i}=e,o=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,c]=k1(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((h=i.arrow)==null?void 0:h.x)??0)+a/2,_=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let m="",p="";return u==="bottom"?(m=o?d:`${f}px`,p=`${-l}px`):u==="top"?(m=o?d:`${f}px`,p=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,p=o?d:`${_}px`):u==="left"&&(m=`${r.floating.width+l}px`,p=o?d:`${_}px`),{data:{x:m,y:p}}}});function k1(t){const[e,n="center"]=t.split("-");return[e,n]}var $L=w1,FL=b1,LL=E1,jL=C1,Af="rovingFocusGroup.onEntryFocus",DL={bubbles:!1,cancelable:!0},rl="RovingFocusGroup",[Op,P1,zL]=vg(rl),[UL,R1]=Wi(rl,[zL]),[VL,BL]=UL(rl),T1=g.forwardRef((t,e)=>w.jsx(Op.Provider,{scope:t.__scopeRovingFocusGroup,children:w.jsx(Op.Slot,{scope:t.__scopeRovingFocusGroup,children:w.jsx(qL,{...t,ref:e})})}));T1.displayName=rl;var qL=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=t,f=g.useRef(null),_=Xe(e,f),m=i1(s),[p,y]=Xc({prop:o,defaultProp:a??null,onChange:l,caller:rl}),[h,v]=g.useState(!1),x=Ft(u),b=P1(n),E=g.useRef(!1),[S,k]=g.useState(0);return g.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(Af,x),()=>C.removeEventListener(Af,x)},[x]),w.jsx(VL,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:p,onItemFocus:g.useCallback(C=>y(C),[y]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(C=>C+1),[]),onFocusableItemRemove:g.useCallback(()=>k(C=>C-1),[]),children:w.jsx(Ee.div,{tabIndex:h||S===0?-1:0,"data-orientation":r,...d,ref:_,style:{outline:"none",...t.style},onMouseDown:J(t.onMouseDown,()=>{E.current=!0}),onFocus:J(t.onFocus,C=>{const R=!E.current;if(C.target===C.currentTarget&&R&&!h){const P=new CustomEvent(Af,DL);if(C.currentTarget.dispatchEvent(P),!P.defaultPrevented){const $=b().filter(q=>q.focusable),O=$.find(q=>q.active),U=$.find(q=>q.id===p),H=[O,U,...$].filter(Boolean).map(q=>q.ref.current);M1(H,c)}}E.current=!1}),onBlur:J(t.onBlur,()=>v(!1))})})}),I1="RovingFocusGroupItem",O1=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=t,l=Fs(),u=s||l,c=BL(I1,n),d=c.currentTabStopId===u,f=P1(n),{onFocusableItemAdd:_,onFocusableItemRemove:m,currentTabStopId:p}=c;return g.useEffect(()=>{if(r)return _(),()=>m()},[r,_,m]),w.jsx(Op.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:w.jsx(Ee.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:J(t.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:J(t.onFocus,()=>c.onItemFocus(u)),onKeyDown:J(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const h=GL(y,c.orientation,c.dir);if(h!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=f().filter(b=>b.focusable).map(b=>b.ref.current);if(h==="last")x.reverse();else if(h==="prev"||h==="next"){h==="prev"&&x.reverse();const b=x.indexOf(y.currentTarget);x=c.loop?KL(x,b+1):x.slice(b+1)}setTimeout(()=>M1(x))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:p!=null}):o})})});O1.displayName=I1;var HL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WL(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function GL(t,e,n){const r=WL(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HL[r]}function M1(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function KL(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var QL=T1,YL=O1;function XL(t){const e=JL(t),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(ej);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function JL(t){const e=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=nj(i),a=tj(s,i.props);return i.type!==g.Fragment&&(a.ref=r?oi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var ZL=Symbol("radix.slottable");function ej(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===ZL}function tj(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function nj(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Mp=["Enter"," "],rj=["ArrowDown","PageUp","Home"],A1=["ArrowUp","PageDown","End"],ij=[...rj,...A1],sj={ltr:[...Mp,"ArrowRight"],rtl:[...Mp,"ArrowLeft"]},oj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},il="Menu",[qa,aj,lj]=vg(il),[Ki,N1]=Wi(il,[lj,y1,R1]),od=y1(),$1=R1(),[uj,Qi]=Ki(il),[cj,sl]=Ki(il),F1=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,a=od(e),[l,u]=g.useState(null),c=g.useRef(!1),d=Ft(s),f=i1(i);return g.useEffect(()=>{const _=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),w.jsx($L,{...a,children:w.jsx(uj,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:u,children:w.jsx(cj,{scope:e,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:r})})})};F1.displayName=il;var dj="MenuAnchor",Sg=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=od(n);return w.jsx(FL,{...i,...r,ref:e})});Sg.displayName=dj;var Cg="MenuPortal",[fj,L1]=Ki(Cg,{forceMount:void 0}),j1=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=Qi(Cg,e);return w.jsx(fj,{scope:e,forceMount:n,children:w.jsx(gr,{present:n||s.open,children:w.jsx(Zc,{asChild:!0,container:i,children:r})})})};j1.displayName=Cg;var nn="MenuContent",[hj,kg]=Ki(nn),D1=g.forwardRef((t,e)=>{const n=L1(nn,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Qi(nn,t.__scopeMenu),o=sl(nn,t.__scopeMenu);return w.jsx(qa.Provider,{scope:t.__scopeMenu,children:w.jsx(gr,{present:r||s.open,children:w.jsx(qa.Slot,{scope:t.__scopeMenu,children:o.modal?w.jsx(pj,{...i,ref:e}):w.jsx(vj,{...i,ref:e})})})})}),pj=g.forwardRef((t,e)=>{const n=Qi(nn,t.__scopeMenu),r=g.useRef(null),i=Xe(e,r);return g.useEffect(()=>{const s=r.current;if(s)return gS(s)},[]),w.jsx(Pg,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:J(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vj=g.forwardRef((t,e)=>{const n=Qi(nn,t.__scopeMenu);return w.jsx(Pg,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),gj=XL("MenuContent.ScrollLock"),Pg=g.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:_,disableOutsideScroll:m,...p}=t,y=Qi(nn,n),h=sl(nn,n),v=od(n),x=$1(n),b=aj(n),[E,S]=g.useState(null),k=g.useRef(null),C=Xe(e,k,y.onContentChange),R=g.useRef(0),P=g.useRef(""),$=g.useRef(0),O=g.useRef(null),U=g.useRef("right"),L=g.useRef(0),H=m?og:g.Fragment,q=m?{as:gj,allowPinchZoom:!0}:void 0,K=M=>{var ze,ve;const B=P.current+M,G=b().filter(Ae=>!Ae.disabled),Z=document.activeElement,se=(ze=G.find(Ae=>Ae.ref.current===Z))==null?void 0:ze.textValue,ce=G.map(Ae=>Ae.textValue),_e=Rj(ce,B,se),Se=(ve=G.find(Ae=>Ae.textValue===_e))==null?void 0:ve.ref.current;(function Ae(kt){P.current=kt,window.clearTimeout(R.current),kt!==""&&(R.current=window.setTimeout(()=>Ae(""),1e3))})(B),Se&&setTimeout(()=>Se.focus())};g.useEffect(()=>()=>window.clearTimeout(R.current),[]),aS();const I=g.useCallback(M=>{var G,Z;return U.current===((G=O.current)==null?void 0:G.side)&&Ij(M,(Z=O.current)==null?void 0:Z.area)},[]);return w.jsx(hj,{scope:n,searchRef:P,onItemEnter:g.useCallback(M=>{I(M)&&M.preventDefault()},[I]),onItemLeave:g.useCallback(M=>{var B;I(M)||((B=k.current)==null||B.focus(),S(null))},[I]),onTriggerLeave:g.useCallback(M=>{I(M)&&M.preventDefault()},[I]),pointerGraceTimerRef:$,onPointerGraceIntentChange:g.useCallback(M=>{O.current=M},[]),children:w.jsx(H,{...q,children:w.jsx(sg,{asChild:!0,trapped:i,onMountAutoFocus:J(s,M=>{var B;M.preventDefault(),(B=k.current)==null||B.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:w.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:_,children:w.jsx(QL,{asChild:!0,...x,dir:h.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:J(l,M=>{h.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(LL,{role:"menu","aria-orientation":"vertical","data-state":tC(y.open),"data-radix-menu-content":"",dir:h.dir,...v,...p,ref:C,style:{outline:"none",...p.style},onKeyDown:J(p.onKeyDown,M=>{const G=M.target.closest("[data-radix-menu-content]")===M.currentTarget,Z=M.ctrlKey||M.altKey||M.metaKey,se=M.key.length===1;G&&(M.key==="Tab"&&M.preventDefault(),!Z&&se&&K(M.key));const ce=k.current;if(M.target!==ce||!ij.includes(M.key))return;M.preventDefault();const Se=b().filter(ze=>!ze.disabled).map(ze=>ze.ref.current);A1.includes(M.key)&&Se.reverse(),kj(Se)}),onBlur:J(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(R.current),P.current="")}),onPointerMove:J(t.onPointerMove,Ha(M=>{const B=M.target,G=L.current!==M.clientX;if(M.currentTarget.contains(B)&&G){const Z=M.clientX>L.current?"right":"left";U.current=Z,L.current=M.clientX}}))})})})})})})});D1.displayName=nn;var mj="MenuGroup",Rg=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Ee.div,{role:"group",...r,ref:e})});Rg.displayName=mj;var yj="MenuLabel",z1=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Ee.div,{...r,ref:e})});z1.displayName=yj;var bc="MenuItem",i0="menu.itemSelect",ad=g.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=g.useRef(null),o=sl(bc,t.__scopeMenu),a=kg(bc,t.__scopeMenu),l=Xe(e,s),u=g.useRef(!1),c=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(i0,{bubbles:!0,cancelable:!0});d.addEventListener(i0,_=>r==null?void 0:r(_),{once:!0}),ig(d,f),f.defaultPrevented?u.current=!1:o.onClose()}};return w.jsx(U1,{...i,ref:l,disabled:n,onClick:J(t.onClick,c),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),u.current=!0},onPointerUp:J(t.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:J(t.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Mp.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ad.displayName=bc;var U1=g.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=kg(bc,n),a=$1(n),l=g.useRef(null),u=Xe(e,l),[c,d]=g.useState(!1),[f,_]=g.useState("");return g.useEffect(()=>{const m=l.current;m&&_((m.textContent??"").trim())},[s.children]),w.jsx(qa.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:w.jsx(YL,{asChild:!0,...a,focusable:!r,children:w.jsx(Ee.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:J(t.onPointerMove,Ha(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:J(t.onPointerLeave,Ha(m=>o.onItemLeave(m))),onFocus:J(t.onFocus,()=>d(!0)),onBlur:J(t.onBlur,()=>d(!1))})})})}),_j="MenuCheckboxItem",V1=g.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return w.jsx(G1,{scope:t.__scopeMenu,checked:n,children:w.jsx(ad,{role:"menuitemcheckbox","aria-checked":Ec(n)?"mixed":n,...i,ref:e,"data-state":Ig(n),onSelect:J(i.onSelect,()=>r==null?void 0:r(Ec(n)?!0:!n),{checkForDefaultPrevented:!1})})})});V1.displayName=_j;var B1="MenuRadioGroup",[wj,xj]=Ki(B1,{value:void 0,onValueChange:()=>{}}),q1=g.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Ft(r);return w.jsx(wj,{scope:t.__scopeMenu,value:n,onValueChange:s,children:w.jsx(Rg,{...i,ref:e})})});q1.displayName=B1;var H1="MenuRadioItem",W1=g.forwardRef((t,e)=>{const{value:n,...r}=t,i=xj(H1,t.__scopeMenu),s=n===i.value;return w.jsx(G1,{scope:t.__scopeMenu,checked:s,children:w.jsx(ad,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":Ig(s),onSelect:J(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});W1.displayName=H1;var Tg="MenuItemIndicator",[G1,bj]=Ki(Tg,{checked:!1}),K1=g.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=bj(Tg,n);return w.jsx(gr,{present:r||Ec(s.checked)||s.checked===!0,children:w.jsx(Ee.span,{...i,ref:e,"data-state":Ig(s.checked)})})});K1.displayName=Tg;var Ej="MenuSeparator",Q1=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Ee.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});Q1.displayName=Ej;var Sj="MenuArrow",Y1=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=od(n);return w.jsx(jL,{...i,...r,ref:e})});Y1.displayName=Sj;var Cj="MenuSub",[R3,X1]=Ki(Cj),Yo="MenuSubTrigger",J1=g.forwardRef((t,e)=>{const n=Qi(Yo,t.__scopeMenu),r=sl(Yo,t.__scopeMenu),i=X1(Yo,t.__scopeMenu),s=kg(Yo,t.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:t.__scopeMenu},c=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>c,[c]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),w.jsx(Sg,{asChild:!0,...u,children:w.jsx(U1,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":tC(n.open),...t,ref:oi(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:J(t.onPointerMove,Ha(d=>{s.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:J(t.onPointerLeave,Ha(d=>{var _,m;c();const f=(_=n.content)==null?void 0:_.getBoundingClientRect();if(f){const p=(m=n.content)==null?void 0:m.dataset.side,y=p==="right",h=y?-5:5,v=f[y?"left":"right"],x=f[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:v,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:v,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:J(t.onKeyDown,d=>{var _;const f=s.searchRef.current!=="";t.disabled||f&&d.key===" "||sj[r.dir].includes(d.key)&&(n.onOpenChange(!0),(_=n.content)==null||_.focus(),d.preventDefault())})})})});J1.displayName=Yo;var Z1="MenuSubContent",eC=g.forwardRef((t,e)=>{const n=L1(nn,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Qi(nn,t.__scopeMenu),o=sl(nn,t.__scopeMenu),a=X1(Z1,t.__scopeMenu),l=g.useRef(null),u=Xe(e,l);return w.jsx(qa.Provider,{scope:t.__scopeMenu,children:w.jsx(gr,{present:r||s.open,children:w.jsx(qa.Slot,{scope:t.__scopeMenu,children:w.jsx(Pg,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:J(t.onFocusOutside,c=>{c.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:J(t.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:J(t.onKeyDown,c=>{var _;const d=c.currentTarget.contains(c.target),f=oj[o.dir].includes(c.key);d&&f&&(s.onOpenChange(!1),(_=a.trigger)==null||_.focus(),c.preventDefault())})})})})})});eC.displayName=Z1;function tC(t){return t?"open":"closed"}function Ec(t){return t==="indeterminate"}function Ig(t){return Ec(t)?"indeterminate":t?"checked":"unchecked"}function kj(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function Pj(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function Rj(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=Pj(t,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Tj(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;sr!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(i=!i)}return i}function Ij(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Tj(n,e)}function Ha(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Oj=F1,Mj=Sg,Aj=j1,Nj=D1,$j=Rg,Fj=z1,Lj=ad,jj=V1,Dj=q1,zj=W1,Uj=K1,Vj=Q1,Bj=Y1,qj=J1,Hj=eC,ld="DropdownMenu",[Wj]=Wi(ld,[N1]),Ct=N1(),[Gj,nC]=Wj(ld),rC=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,l=Ct(e),u=g.useRef(null),[c,d]=Xc({prop:i,defaultProp:s??!1,onChange:o,caller:ld});return w.jsx(Gj,{scope:e,triggerId:Fs(),triggerRef:u,contentId:Fs(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:w.jsx(Oj,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};rC.displayName=ld;var iC="DropdownMenuTrigger",sC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=nC(iC,n),o=Ct(n);return w.jsx(Mj,{asChild:!0,...o,children:w.jsx(Ee.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:oi(e,s.triggerRef),onPointerDown:J(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:J(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});sC.displayName=iC;var Kj="DropdownMenuPortal",oC=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Ct(e);return w.jsx(Aj,{...r,...n})};oC.displayName=Kj;var aC="DropdownMenuContent",lC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=nC(aC,n),s=Ct(n),o=g.useRef(!1);return w.jsx(Nj,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:J(t.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:J(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});lC.displayName=aC;var Qj="DropdownMenuGroup",Yj=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx($j,{...i,...r,ref:e})});Yj.displayName=Qj;var Xj="DropdownMenuLabel",uC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Fj,{...i,...r,ref:e})});uC.displayName=Xj;var Jj="DropdownMenuItem",cC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Lj,{...i,...r,ref:e})});cC.displayName=Jj;var Zj="DropdownMenuCheckboxItem",dC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(jj,{...i,...r,ref:e})});dC.displayName=Zj;var eD="DropdownMenuRadioGroup",tD=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Dj,{...i,...r,ref:e})});tD.displayName=eD;var nD="DropdownMenuRadioItem",fC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(zj,{...i,...r,ref:e})});fC.displayName=nD;var rD="DropdownMenuItemIndicator",hC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Uj,{...i,...r,ref:e})});hC.displayName=rD;var iD="DropdownMenuSeparator",pC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Vj,{...i,...r,ref:e})});pC.displayName=iD;var sD="DropdownMenuArrow",oD=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Bj,{...i,...r,ref:e})});oD.displayName=sD;var aD="DropdownMenuSubTrigger",vC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(qj,{...i,...r,ref:e})});vC.displayName=aD;var lD="DropdownMenuSubContent",gC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Hj,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gC.displayName=lD;var uD=rC,cD=sC,dD=oC,mC=lC,yC=uC,_C=cC,wC=dC,xC=fC,bC=hC,EC=pC,SC=vC,CC=gC;/** + */var fo=g;function E$(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var S$=typeof Object.is=="function"?Object.is:E$,C$=fo.useState,k$=fo.useEffect,P$=fo.useLayoutEffect,R$=fo.useDebugValue;function T$(t,e){var n=e(),r=C$({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return P$(function(){i.value=n,i.getSnapshot=e,Rf(i)&&s({inst:i})},[t,n,e]),k$(function(){return Rf(i)&&s({inst:i}),t(function(){Rf(i)&&s({inst:i})})},[t]),R$(n),n}function Rf(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!S$(t,n)}catch{return!0}}function I$(t,e){return e()}var O$=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?I$:T$;jS.useSyncExternalStore=fo.useSyncExternalStore!==void 0?fo.useSyncExternalStore:O$;LS.exports=jS;var M$=LS.exports;function A$(){return M$.useSyncExternalStore(N$,()=>!0,()=>!1)}function N$(){return()=>{}}var hg="Avatar",[$$]=h$(hg),[F$,DS]=$$(hg),zS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[i,s]=g.useState("idle");return w.jsx(F$,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:w.jsx(fg.span,{...r,ref:e})})});zS.displayName=hg;var US="AvatarImage",VS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=t,o=DS(US,n),a=L$(r,s),l=Ft(u=>{i(u),o.onImageLoadingStatusChange(u)});return on(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?w.jsx(fg.img,{...s,ref:e,src:r}):null});VS.displayName=US;var BS="AvatarFallback",qS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...i}=t,s=DS(BS,n),[o,a]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&s.imageLoadingStatus!=="loaded"?w.jsx(fg.span,{...i,ref:e}):null});qS.displayName=BS;function B_(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function L$(t,{referrerPolicy:e,crossOrigin:n}){const r=A$(),i=g.useRef(null),s=r?(i.current||(i.current=new window.Image),i.current):null,[o,a]=g.useState(()=>B_(s,t));return on(()=>{a(B_(s,t))},[s,t]),on(()=>{const l=d=>()=>{a(d)};if(!s)return;const u=l("loaded"),c=l("error");return s.addEventListener("load",u),s.addEventListener("error",c),e&&(s.referrerPolicy=e),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",u),s.removeEventListener("error",c)}},[s,n,e]),o}var HS=zS,WS=VS,GS=qS;function KS(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const e=z$(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(pg);return a[0]===""&&a.length!==1&&a.shift(),YS(a,e)||D$(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},YS=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?YS(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(pg);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},q_=/^\[(.+)\]$/,D$=t=>{if(q_.test(t)){const e=q_.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},z$=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return V$(Object.entries(t.classGroups),n).forEach(([s,o])=>{Pp(o,r,s,e)}),r},Pp=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:H_(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(U$(i)){Pp(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Pp(o,H_(e,s),n,r)})})},H_=(t,e)=>{let n=t;return e.split(pg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},U$=t=>t.isThemeGetter,V$=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[n,i]}):t,B$=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},XS="!",q$=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,o=a=>{const l=[];let u=0,c=0,d;for(let y=0;yc?d-c:void 0;return{modifiers:l,hasImportantModifier:_,baseClassName:m,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},H$=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},W$=t=>({cache:B$(t.cacheSize),parseClassName:q$(t),...j$(t)}),G$=/\s+/,K$=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(G$);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:_}=n(u);let m=!!_,p=r(m?f.substring(0,_):f);if(!p){if(!m){a=u+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=u+(a.length>0?" "+a:a);continue}m=!1}const y=H$(c).join(":"),h=d?y+XS:y,v=h+p;if(s.includes(v))continue;s.push(v);const x=i(p,m);for(let b=0;b0?" "+a:a)}return a};function Q$(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rd(c),t());return n=W$(u),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=K$(l,n);return i(l,c),c}return function(){return s(Q$.apply(null,arguments))}}const Re=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},ZS=/^\[(?:([a-z-]+):)?(.+)\]$/i,X$=/^\d+\/\d+$/,J$=new Set(["px","full","screen"]),Z$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wn=t=>js(t)||J$.has(t)||X$.test(t),Sr=t=>_o(t,"length",dF),js=t=>!!t&&!Number.isNaN(Number(t)),Tf=t=>_o(t,"number",js),zo=t=>!!t&&Number.isInteger(Number(t)),iF=t=>t.endsWith("%")&&js(t.slice(0,-1)),re=t=>ZS.test(t),Cr=t=>Z$.test(t),sF=new Set(["length","size","percentage"]),oF=t=>_o(t,sF,e1),aF=t=>_o(t,"position",e1),lF=new Set(["image","url"]),uF=t=>_o(t,lF,hF),cF=t=>_o(t,"",fF),Uo=()=>!0,_o=(t,e,n)=>{const r=ZS.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},dF=t=>eF.test(t)&&!tF.test(t),e1=()=>!1,fF=t=>nF.test(t),hF=t=>rF.test(t),pF=()=>{const t=Re("colors"),e=Re("spacing"),n=Re("blur"),r=Re("brightness"),i=Re("borderColor"),s=Re("borderRadius"),o=Re("borderSpacing"),a=Re("borderWidth"),l=Re("contrast"),u=Re("grayscale"),c=Re("hueRotate"),d=Re("invert"),f=Re("gap"),_=Re("gradientColorStops"),m=Re("gradientColorStopPositions"),p=Re("inset"),y=Re("margin"),h=Re("opacity"),v=Re("padding"),x=Re("saturate"),b=Re("scale"),E=Re("sepia"),S=Re("skew"),k=Re("space"),C=Re("translate"),R=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",re,e],O=()=>[re,e],U=()=>["",Wn,Sr],L=()=>["auto",js,re],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",re],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[js,re];return{cacheSize:500,separator:":",theme:{colors:[Uo],spacing:[Wn,Sr],blur:["none","",Cr,re],brightness:G(),borderColor:[t],borderRadius:["none","","full",Cr,re],borderSpacing:O(),borderWidth:U(),contrast:G(),grayscale:M(),hueRotate:G(),invert:M(),gap:O(),gradientColorStops:[t],gradientColorStopPositions:[iF,Sr],inset:$(),margin:$(),opacity:G(),padding:O(),saturate:G(),scale:G(),sepia:M(),skew:G(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Cr]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),re]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",zo,re]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",zo,re]}],"grid-cols":[{"grid-cols":[Uo]}],"col-start-end":[{col:["auto",{span:["full",zo,re]},re]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Uo]}],"row-start-end":[{row:["auto",{span:[zo,re]},re]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,e]}],"min-w":[{"min-w":[re,e,"min","max","fit"]}],"max-w":[{"max-w":[re,e,"none","full","min","max","fit","prose",{screen:[Cr]},Cr]}],h:[{h:[re,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Cr,Sr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Tf]}],"font-family":[{font:[Uo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",re]}],"line-clamp":[{"line-clamp":["none",js,Tf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wn,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wn,Sr]}],"underline-offset":[{"underline-offset":["auto",Wn,re]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),aF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},uF]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[_]}],"gradient-via":[{via:[_]}],"gradient-to":[{to:[_]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:q()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...q()]}],"outline-offset":[{"outline-offset":[Wn,re]}],"outline-w":[{outline:[Wn,Sr]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Wn,Sr]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Cr,cF]}],"shadow-color":[{shadow:[Uo]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Cr,re]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[zo,re]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Wn,Sr,Tf]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},vF=Y$(pF);function at(...t){return vF(QS(t))}function k3(t){return t.replace(/v\d+$/i,"")}function P3(t){const e=t.trim(),n=e.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=e.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:e}function R3(t){if(t==null||t==="")return"—";const e=typeof t=="string"?parseFloat(t):t;return Number.isFinite(e)?Math.abs(e)>=100?Bl(e,0):Math.abs(e)>=10?Bl(e,1):Math.abs(e)<1?Bl(e,3):Bl(e,2):String(t)}function Bl(t,e){const n=String(Math.abs(t));if(n.includes("e"))return t.toFixed(e);const r=+`${Math.round(+`${n}e${e}`)}e-${e}`;return(t<0?-r:r).toFixed(e)}const t1=g.forwardRef(({className:t,...e},n)=>w.jsx(HS,{ref:n,className:at("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));t1.displayName=HS.displayName;const n1=g.forwardRef(({className:t,...e},n)=>w.jsx(WS,{ref:n,className:at("aspect-square h-full w-full",t),...e}));n1.displayName=WS.displayName;const r1=g.forwardRef(({className:t,...e},n)=>w.jsx(GS,{ref:n,className:at("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));r1.displayName=GS.displayName;function W_(t){const e=gF(t),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(yF);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function gF(t){const e=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=wF(i),a=_F(s,i.props);return i.type!==g.Fragment&&(a.ref=r?oi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var mF=Symbol("radix.slottable");function yF(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===mF}function _F(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function wF(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function vg(t){const e=t+"CollectionProvider",[n,r]=Wi(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:y,children:h}=p,v=V.useRef(null),x=V.useRef(new Map).current;return w.jsx(i,{scope:y,itemMap:x,collectionRef:v,children:h})};o.displayName=e;const a=t+"CollectionSlot",l=W_(a),u=V.forwardRef((p,y)=>{const{scope:h,children:v}=p,x=s(a,h),b=Xe(y,x.collectionRef);return w.jsx(l,{ref:b,children:v})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",f=W_(c),_=V.forwardRef((p,y)=>{const{scope:h,children:v,...x}=p,b=V.useRef(null),E=Xe(y,b),S=s(c,h);return V.useEffect(()=>(S.itemMap.set(b,{ref:b,...x}),()=>void S.itemMap.delete(b))),w.jsx(f,{[d]:"",ref:E,children:v})});_.displayName=c;function m(p){const y=s(t+"CollectionConsumer",p);return V.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((S,k)=>x.indexOf(S.ref.current)-x.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:_},m,r]}var xF=g.createContext(void 0);function i1(t){const e=g.useContext(xF);return t||e||"ltr"}const bF=["top","right","bottom","left"],ti=Math.min,zt=Math.max,yc=Math.round,ql=Math.floor,Un=t=>({x:t,y:t}),EF={left:"right",right:"left",bottom:"top",top:"bottom"};function Rp(t,e,n){return zt(t,ti(e,n))}function fr(t,e){return typeof t=="function"?t(e):t}function hr(t){return t.split("-")[0]}function wo(t){return t.split("-")[1]}function gg(t){return t==="x"?"y":"x"}function mg(t){return t==="y"?"height":"width"}function jn(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function yg(t){return gg(jn(t))}function SF(t,e,n){n===void 0&&(n=!1);const r=wo(t),i=yg(t),s=mg(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=_c(o)),[o,_c(o)]}function CF(t){const e=_c(t);return[Tp(t),e,Tp(e)]}function Tp(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const G_=["left","right"],K_=["right","left"],kF=["top","bottom"],PF=["bottom","top"];function RF(t,e,n){switch(t){case"top":case"bottom":return n?e?K_:G_:e?G_:K_;case"left":case"right":return e?kF:PF;default:return[]}}function TF(t,e,n,r){const i=wo(t);let s=RF(hr(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Tp)))),s}function _c(t){const e=hr(t);return EF[e]+t.slice(e.length)}function IF(t){return{top:0,right:0,bottom:0,left:0,...t}}function s1(t){return typeof t!="number"?IF(t):{top:t,right:t,bottom:t,left:t}}function wc(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Q_(t,e,n){let{reference:r,floating:i}=t;const s=jn(e),o=yg(e),a=mg(o),l=hr(e),u=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let _;switch(l){case"top":_={x:c,y:r.y-i.height};break;case"bottom":_={x:c,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:d};break;case"left":_={x:r.x-i.width,y:d};break;default:_={x:r.x,y:r.y}}switch(wo(e)){case"start":_[o]-=f*(n&&u?-1:1);break;case"end":_[o]+=f*(n&&u?-1:1);break}return _}async function OF(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:_=0}=fr(e,t),m=s1(_),y=a[f?d==="floating"?"reference":"floating":d],h=wc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),b=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=wc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:x,strategy:l}):v);return{top:(h.top-E.top+m.top)/b.y,bottom:(E.bottom-h.bottom+m.bottom)/b.y,left:(h.left-E.left+m.left)/b.x,right:(E.right-h.right+m.right)/b.x}}const MF=50,AF=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:OF},l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:d}=Q_(u,r,l),f=r,_=0;const m={};for(let p=0;p({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=fr(t,e)||{};if(u==null)return{};const d=s1(c),f={x:n,y:r},_=yg(i),m=mg(_),p=await o.getDimensions(u),y=_==="y",h=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",b=s.reference[m]+s.reference[_]-f[_]-s.floating[m],E=f[_]-s.reference[_],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=S?S[x]:0;(!k||!await(o.isElement==null?void 0:o.isElement(S)))&&(k=a.floating[x]||s.floating[m]);const C=b/2-E/2,R=k/2-p[m]/2-1,P=ti(d[h],R),$=ti(d[v],R),O=P,U=k-p[m]-$,L=k/2-p[m]/2+C,H=Rp(O,L,U),q=!l.arrow&&wo(i)!=null&&L!==H&&s.reference[m]/2-(LL<=0)){var $,O;const L=((($=s.flip)==null?void 0:$.index)||0)+1,H=k[L];if(H&&(!(d==="alignment"?v!==jn(H):!1)||P.every(I=>jn(I.placement)===v?I.overflows[0]>0:!0)))return{data:{index:L,overflows:P},reset:{placement:H}};let q=(O=P.filter(K=>K.overflows[0]<=0).sort((K,I)=>K.overflows[1]-I.overflows[1])[0])==null?void 0:O.placement;if(!q)switch(_){case"bestFit":{var U;const K=(U=P.filter(I=>{if(S){const M=jn(I.placement);return M===v||M==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(M=>M>0).reduce((M,B)=>M+B,0)]).sort((I,M)=>I[1]-M[1])[0])==null?void 0:U[0];K&&(q=K);break}case"initialPlacement":q=a;break}if(i!==q)return{reset:{placement:q}}}return{}}}};function Y_(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function X_(t){return bF.some(e=>t[e]>=0)}const FF=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...s}=fr(t,e);switch(i){case"referenceHidden":{const o=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=Y_(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:X_(a)}}}case"escaped":{const o=await r.detectOverflow(e,{...s,altBoundary:!0}),a=Y_(o,n.floating);return{data:{escapedOffsets:a,escaped:X_(a)}}}default:return{}}}}},o1=new Set(["left","top"]);async function LF(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=hr(n),a=wo(n),l=jn(n)==="y",u=o1.has(o)?-1:1,c=s&&l?-1:1,d=fr(e,t);let{mainAxis:f,crossAxis:_,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(_=a==="end"?m*-1:m),l?{x:_*c,y:f*u}:{x:f*u,y:_*c}}const jF=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await LF(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},DF=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:h=>{let{x:v,y:x}=h;return{x:v,y:x}}},...u}=fr(t,e),c={x:n,y:r},d=await s.detectOverflow(e,u),f=jn(hr(i)),_=gg(f);let m=c[_],p=c[f];if(o){const h=_==="y"?"top":"left",v=_==="y"?"bottom":"right",x=m+d[h],b=m-d[v];m=Rp(x,m,b)}if(a){const h=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+d[h],b=p-d[v];p=Rp(x,p,b)}const y=l.fn({...e,[_]:m,[f]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[_]:o,[f]:a}}}}}},zF=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=fr(t,e),c={x:n,y:r},d=jn(i),f=gg(d);let _=c[f],m=c[d];const p=fr(a,e),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const x=f==="y"?"height":"width",b=s.reference[f]-s.floating[x]+y.mainAxis,E=s.reference[f]+s.reference[x]-y.mainAxis;_E&&(_=E)}if(u){var h,v;const x=f==="y"?"width":"height",b=o1.has(hr(i)),E=s.reference[d]-s.floating[x]+(b&&((h=o.offset)==null?void 0:h[d])||0)+(b?0:y.crossAxis),S=s.reference[d]+s.reference[x]+(b?0:((v=o.offset)==null?void 0:v[d])||0)-(b?y.crossAxis:0);mS&&(m=S)}return{[f]:_,[d]:m}}}},UF=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...u}=fr(t,e),c=await o.detectOverflow(e,u),d=hr(i),f=wo(i),_=jn(i)==="y",{width:m,height:p}=s.floating;let y,h;d==="top"||d==="bottom"?(y=d,h=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,y=f==="end"?"top":"bottom");const v=p-c.top-c.bottom,x=m-c.left-c.right,b=ti(p-c[y],v),E=ti(m-c[h],x),S=!e.middlewareData.shift;let k=b,C=E;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(C=x),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(k=v),S&&!f){const P=zt(c.left,0),$=zt(c.right,0),O=zt(c.top,0),U=zt(c.bottom,0);_?C=m-2*(P!==0||$!==0?P+$:zt(c.left,c.right)):k=p-2*(O!==0||U!==0?O+U:zt(c.top,c.bottom))}await l({...e,availableWidth:C,availableHeight:k});const R=await o.getDimensions(a.floating);return m!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function nd(){return typeof window<"u"}function xo(t){return a1(t)?(t.nodeName||"").toLowerCase():"#document"}function Ht(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Bn(t){var e;return(e=(a1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function a1(t){return nd()?t instanceof Node||t instanceof Ht(t).Node:!1}function bn(t){return nd()?t instanceof Element||t instanceof Ht(t).Element:!1}function mr(t){return nd()?t instanceof HTMLElement||t instanceof Ht(t).HTMLElement:!1}function J_(t){return!nd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ht(t).ShadowRoot}function nl(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=En(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function VF(t){return/^(table|td|th)$/.test(xo(t))}function rd(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const BF=/transform|translate|scale|rotate|perspective|filter/,qF=/paint|layout|strict|content/,fi=t=>!!t&&t!=="none";let If;function _g(t){const e=bn(t)?En(t):t;return fi(e.transform)||fi(e.translate)||fi(e.scale)||fi(e.rotate)||fi(e.perspective)||!wg()&&(fi(e.backdropFilter)||fi(e.filter))||BF.test(e.willChange||"")||qF.test(e.contain||"")}function HF(t){let e=ni(t);for(;mr(e)&&!ho(e);){if(_g(e))return e;if(rd(e))return null;e=ni(e)}return null}function wg(){return If==null&&(If=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),If}function ho(t){return/^(html|body|#document)$/.test(xo(t))}function En(t){return Ht(t).getComputedStyle(t)}function id(t){return bn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ni(t){if(xo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||J_(t)&&t.host||Bn(t);return J_(e)?e.host:e}function l1(t){const e=ni(t);return ho(e)?t.ownerDocument?t.ownerDocument.body:t.body:mr(e)&&nl(e)?e:l1(e)}function Ba(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=l1(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Ht(i);if(s){const a=Ip(o);return e.concat(o,o.visualViewport||[],nl(i)?i:[],a&&n?Ba(a):[])}else return e.concat(i,Ba(i,[],n))}function Ip(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function u1(t){const e=En(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=mr(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=yc(n)!==s||yc(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function xg(t){return bn(t)?t:t.contextElement}function Ds(t){const e=xg(t);if(!mr(e))return Un(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=u1(e);let o=(s?yc(n.width):n.width)/r,a=(s?yc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const WF=Un(0);function c1(t){const e=Ht(t);return!wg()||!e.visualViewport?WF:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function GF(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ht(t)?!1:e}function Vi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=xg(t);let o=Un(1);e&&(r?bn(r)&&(o=Ds(r)):o=Ds(t));const a=GF(s,n,r)?c1(s):Un(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=Ht(s),_=r&&bn(r)?Ht(r):r;let m=f,p=Ip(m);for(;p&&r&&_!==m;){const y=Ds(p),h=p.getBoundingClientRect(),v=En(p),x=h.left+(p.clientLeft+parseFloat(v.paddingLeft))*y.x,b=h.top+(p.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=x,u+=b,m=Ht(p),p=Ip(m)}}return wc({width:c,height:d,x:l,y:u})}function sd(t,e){const n=id(t).scrollLeft;return e?e.left+n:Vi(Bn(t)).left+n}function d1(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-sd(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function KF(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Bn(r),a=e?rd(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Un(1);const c=Un(0),d=mr(r);if((d||!d&&!s)&&((xo(r)!=="body"||nl(o))&&(l=id(r)),d)){const _=Vi(r);u=Ds(r),c.x=_.x+r.clientLeft,c.y=_.y+r.clientTop}const f=o&&!d&&!s?d1(o,l):Un(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function QF(t){return Array.from(t.getClientRects())}function YF(t){const e=Bn(t),n=id(t),r=t.ownerDocument.body,i=zt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=zt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+sd(t);const a=-n.scrollTop;return En(r).direction==="rtl"&&(o+=zt(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const Z_=25;function XF(t,e){const n=Ht(t),r=Bn(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=wg();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=sd(r);if(u<=0){const c=r.ownerDocument,d=c.body,f=getComputedStyle(d),_=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-_);m<=Z_&&(s-=m)}else u<=Z_&&(s+=u);return{width:s,height:o,x:a,y:l}}function JF(t,e){const n=Vi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=mr(t)?Ds(t):Un(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function e0(t,e,n){let r;if(e==="viewport")r=XF(t,n);else if(e==="document")r=YF(Bn(t));else if(bn(e))r=JF(e,n);else{const i=c1(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return wc(r)}function f1(t,e){const n=ni(t);return n===e||!bn(n)||ho(n)?!1:En(n).position==="fixed"||f1(n,e)}function ZF(t,e){const n=e.get(t);if(n)return n;let r=Ba(t,[],!1).filter(a=>bn(a)&&xo(a)!=="body"),i=null;const s=En(t).position==="fixed";let o=s?ni(t):t;for(;bn(o)&&!ho(o);){const a=En(o),l=_g(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||nl(o)&&!l&&f1(t,o))?r=r.filter(c=>c!==o):i=a,o=ni(o)}return e.set(t,r),r}function eL(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?rd(e)?[]:ZF(e,this._c):[].concat(n),r],a=e0(e,o[0],i);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}k===1&&!p1(u,t.getBoundingClientRect())&&o(),b=!1}try{n=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(t)}return o(!0),s}function aL(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=xg(t),c=i||s?[...u?Ba(u):[],...e?Ba(e):[]]:[];c.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const d=u&&a?oL(u,n):null;let f=-1,_=null;o&&(_=new ResizeObserver(h=>{let[v]=h;v&&v.target===u&&_&&e&&(_.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=_)==null||x.observe(e)})),n()}),u&&!l&&_.observe(u),e&&_.observe(e));let m,p=l?Vi(t):null;l&&y();function y(){const h=Vi(t);p&&!p1(p,h)&&n(),p=h,m=requestAnimationFrame(y)}return n(),()=>{var h;c.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(h=_)==null||h.disconnect(),_=null,l&&cancelAnimationFrame(m)}}const lL=jF,uL=DF,cL=$F,dL=UF,fL=FF,n0=NF,hL=zF,pL=(t,e,n)=>{const r=new Map,i={platform:sL,...n},s={...i.platform,_c:r};return AF(t,e,{...i,platform:s})};var vL=typeof document<"u",gL=function(){},hu=vL?g.useLayoutEffect:gL;function xc(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!xc(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!xc(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function v1(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function r0(t,e){const n=v1(t);return Math.round(e*n)/n}function Mf(t){const e=g.useRef(t);return hu(()=>{e.current=t}),e}function mL(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,d]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,_]=g.useState(r);xc(f,r)||_(r);const[m,p]=g.useState(null),[y,h]=g.useState(null),v=g.useCallback(I=>{I!==S.current&&(S.current=I,p(I))},[]),x=g.useCallback(I=>{I!==k.current&&(k.current=I,h(I))},[]),b=s||m,E=o||y,S=g.useRef(null),k=g.useRef(null),C=g.useRef(c),R=l!=null,P=Mf(l),$=Mf(i),O=Mf(u),U=g.useCallback(()=>{if(!S.current||!k.current)return;const I={placement:e,strategy:n,middleware:f};$.current&&(I.platform=$.current),pL(S.current,k.current,I).then(M=>{const B={...M,isPositioned:O.current!==!1};L.current&&!xc(C.current,B)&&(C.current=B,el.flushSync(()=>{d(B)}))})},[f,e,n,$,O]);hu(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(I=>({...I,isPositioned:!1})))},[u]);const L=g.useRef(!1);hu(()=>(L.current=!0,()=>{L.current=!1}),[]),hu(()=>{if(b&&(S.current=b),E&&(k.current=E),b&&E){if(P.current)return P.current(b,E,U);U()}},[b,E,U,P,R]);const H=g.useMemo(()=>({reference:S,floating:k,setReference:v,setFloating:x}),[v,x]),q=g.useMemo(()=>({reference:b,floating:E}),[b,E]),K=g.useMemo(()=>{const I={position:n,left:0,top:0};if(!q.floating)return I;const M=r0(q.floating,c.x),B=r0(q.floating,c.y);return a?{...I,transform:"translate("+M+"px, "+B+"px)",...v1(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:B}},[n,a,q.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:U,refs:H,elements:q,floatingStyles:K}),[c,U,H,q,K])}const yL=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?n0({element:r.current,padding:i}).fn(n):{}:r?n0({element:r,padding:i}).fn(n):{}}}},_L=(t,e)=>{const n=lL(t);return{name:n.name,fn:n.fn,options:[t,e]}},wL=(t,e)=>{const n=uL(t);return{name:n.name,fn:n.fn,options:[t,e]}},xL=(t,e)=>({fn:hL(t).fn,options:[t,e]}),bL=(t,e)=>{const n=cL(t);return{name:n.name,fn:n.fn,options:[t,e]}},EL=(t,e)=>{const n=dL(t);return{name:n.name,fn:n.fn,options:[t,e]}},SL=(t,e)=>{const n=fL(t);return{name:n.name,fn:n.fn,options:[t,e]}},CL=(t,e)=>{const n=yL(t);return{name:n.name,fn:n.fn,options:[t,e]}};var kL="Arrow",g1=g.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return w.jsx(Ee.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});g1.displayName=kL;var PL=g1;function RL(t){const[e,n]=g.useState(void 0);return on(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var bg="Popper",[m1,y1]=Wi(bg),[TL,_1]=m1(bg),w1=t=>{const{__scopePopper:e,children:n}=t,[r,i]=g.useState(null);return w.jsx(TL,{scope:e,anchor:r,onAnchorChange:i,children:n})};w1.displayName=bg;var x1="PopperAnchor",b1=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=_1(x1,n),o=g.useRef(null),a=Xe(e,o),l=g.useRef(null);return g.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||o.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:w.jsx(Ee.div,{...i,ref:a})});b1.displayName=x1;var Eg="PopperContent",[IL,OL]=m1(Eg),E1=g.forwardRef((t,e)=>{var ze,ve,Ae,kt,yr,gt;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:_="optimized",onPlaced:m,...p}=t,y=_1(Eg,n),[h,v]=g.useState(null),x=Xe(e,Ge=>v(Ge)),[b,E]=g.useState(null),S=RL(b),k=(S==null?void 0:S.width)??0,C=(S==null?void 0:S.height)??0,R=r+(s!=="center"?"-"+s:""),P=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(u)?u:[u],O=$.length>0,U={padding:P,boundary:$.filter(AL),altBoundary:O},{refs:L,floatingStyles:H,placement:q,isPositioned:K,middlewareData:I}=mL({strategy:"fixed",placement:R,whileElementsMounted:(...Ge)=>aL(...Ge,{animationFrame:_==="always"}),elements:{reference:y.anchor},middleware:[_L({mainAxis:i+C,alignmentAxis:o}),l&&wL({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?xL():void 0,...U}),l&&bL({...U}),EL({...U,apply:({elements:Ge,rects:ai,availableWidth:Yi,availableHeight:Pt})=>{const{width:Xi,height:_r}=ai.reference,ln=Ge.floating.style;ln.setProperty("--radix-popper-available-width",`${Yi}px`),ln.setProperty("--radix-popper-available-height",`${Pt}px`),ln.setProperty("--radix-popper-anchor-width",`${Xi}px`),ln.setProperty("--radix-popper-anchor-height",`${_r}px`)}}),b&&CL({element:b,padding:a}),NL({arrowWidth:k,arrowHeight:C}),f&&SL({strategy:"referenceHidden",...U})]}),[M,B]=k1(q),G=Ft(m);on(()=>{K&&(G==null||G())},[K,G]);const Z=(ze=I.arrow)==null?void 0:ze.x,se=(ve=I.arrow)==null?void 0:ve.y,ce=((Ae=I.arrow)==null?void 0:Ae.centerOffset)!==0,[_e,Se]=g.useState();return on(()=>{h&&Se(window.getComputedStyle(h).zIndex)},[h]),w.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:K?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[(kt=I.transformOrigin)==null?void 0:kt.x,(yr=I.transformOrigin)==null?void 0:yr.y].join(" "),...((gt=I.hide)==null?void 0:gt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:w.jsx(IL,{scope:n,placedSide:M,onArrowChange:E,arrowX:Z,arrowY:se,shouldHideArrow:ce,children:w.jsx(Ee.div,{"data-side":M,"data-align":B,...p,ref:x,style:{...p.style,animation:K?void 0:"none"}})})})});E1.displayName=Eg;var S1="PopperArrow",ML={top:"bottom",right:"left",bottom:"top",left:"right"},C1=g.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=OL(S1,r),o=ML[s.placedSide];return w.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:w.jsx(PL,{...i,ref:n,style:{...i.style,display:"block"}})})});C1.displayName=S1;function AL(t){return t!==null}var NL=t=>({name:"transformOrigin",options:t,fn(e){var y,h,v;const{placement:n,rects:r,middlewareData:i}=e,o=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,c]=k1(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((h=i.arrow)==null?void 0:h.x)??0)+a/2,_=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let m="",p="";return u==="bottom"?(m=o?d:`${f}px`,p=`${-l}px`):u==="top"?(m=o?d:`${f}px`,p=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,p=o?d:`${_}px`):u==="left"&&(m=`${r.floating.width+l}px`,p=o?d:`${_}px`),{data:{x:m,y:p}}}});function k1(t){const[e,n="center"]=t.split("-");return[e,n]}var $L=w1,FL=b1,LL=E1,jL=C1,Af="rovingFocusGroup.onEntryFocus",DL={bubbles:!1,cancelable:!0},rl="RovingFocusGroup",[Op,P1,zL]=vg(rl),[UL,R1]=Wi(rl,[zL]),[VL,BL]=UL(rl),T1=g.forwardRef((t,e)=>w.jsx(Op.Provider,{scope:t.__scopeRovingFocusGroup,children:w.jsx(Op.Slot,{scope:t.__scopeRovingFocusGroup,children:w.jsx(qL,{...t,ref:e})})}));T1.displayName=rl;var qL=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=t,f=g.useRef(null),_=Xe(e,f),m=i1(s),[p,y]=Xc({prop:o,defaultProp:a??null,onChange:l,caller:rl}),[h,v]=g.useState(!1),x=Ft(u),b=P1(n),E=g.useRef(!1),[S,k]=g.useState(0);return g.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(Af,x),()=>C.removeEventListener(Af,x)},[x]),w.jsx(VL,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:p,onItemFocus:g.useCallback(C=>y(C),[y]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(C=>C+1),[]),onFocusableItemRemove:g.useCallback(()=>k(C=>C-1),[]),children:w.jsx(Ee.div,{tabIndex:h||S===0?-1:0,"data-orientation":r,...d,ref:_,style:{outline:"none",...t.style},onMouseDown:J(t.onMouseDown,()=>{E.current=!0}),onFocus:J(t.onFocus,C=>{const R=!E.current;if(C.target===C.currentTarget&&R&&!h){const P=new CustomEvent(Af,DL);if(C.currentTarget.dispatchEvent(P),!P.defaultPrevented){const $=b().filter(q=>q.focusable),O=$.find(q=>q.active),U=$.find(q=>q.id===p),H=[O,U,...$].filter(Boolean).map(q=>q.ref.current);M1(H,c)}}E.current=!1}),onBlur:J(t.onBlur,()=>v(!1))})})}),I1="RovingFocusGroupItem",O1=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=t,l=Fs(),u=s||l,c=BL(I1,n),d=c.currentTabStopId===u,f=P1(n),{onFocusableItemAdd:_,onFocusableItemRemove:m,currentTabStopId:p}=c;return g.useEffect(()=>{if(r)return _(),()=>m()},[r,_,m]),w.jsx(Op.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:w.jsx(Ee.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:J(t.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:J(t.onFocus,()=>c.onItemFocus(u)),onKeyDown:J(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const h=GL(y,c.orientation,c.dir);if(h!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=f().filter(b=>b.focusable).map(b=>b.ref.current);if(h==="last")x.reverse();else if(h==="prev"||h==="next"){h==="prev"&&x.reverse();const b=x.indexOf(y.currentTarget);x=c.loop?KL(x,b+1):x.slice(b+1)}setTimeout(()=>M1(x))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:p!=null}):o})})});O1.displayName=I1;var HL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WL(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function GL(t,e,n){const r=WL(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HL[r]}function M1(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function KL(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var QL=T1,YL=O1;function XL(t){const e=JL(t),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(ej);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function JL(t){const e=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=nj(i),a=tj(s,i.props);return i.type!==g.Fragment&&(a.ref=r?oi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var ZL=Symbol("radix.slottable");function ej(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===ZL}function tj(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function nj(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Mp=["Enter"," "],rj=["ArrowDown","PageUp","Home"],A1=["ArrowUp","PageDown","End"],ij=[...rj,...A1],sj={ltr:[...Mp,"ArrowRight"],rtl:[...Mp,"ArrowLeft"]},oj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},il="Menu",[qa,aj,lj]=vg(il),[Ki,N1]=Wi(il,[lj,y1,R1]),od=y1(),$1=R1(),[uj,Qi]=Ki(il),[cj,sl]=Ki(il),F1=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,a=od(e),[l,u]=g.useState(null),c=g.useRef(!1),d=Ft(s),f=i1(i);return g.useEffect(()=>{const _=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),w.jsx($L,{...a,children:w.jsx(uj,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:u,children:w.jsx(cj,{scope:e,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:r})})})};F1.displayName=il;var dj="MenuAnchor",Sg=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=od(n);return w.jsx(FL,{...i,...r,ref:e})});Sg.displayName=dj;var Cg="MenuPortal",[fj,L1]=Ki(Cg,{forceMount:void 0}),j1=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=Qi(Cg,e);return w.jsx(fj,{scope:e,forceMount:n,children:w.jsx(gr,{present:n||s.open,children:w.jsx(Zc,{asChild:!0,container:i,children:r})})})};j1.displayName=Cg;var nn="MenuContent",[hj,kg]=Ki(nn),D1=g.forwardRef((t,e)=>{const n=L1(nn,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Qi(nn,t.__scopeMenu),o=sl(nn,t.__scopeMenu);return w.jsx(qa.Provider,{scope:t.__scopeMenu,children:w.jsx(gr,{present:r||s.open,children:w.jsx(qa.Slot,{scope:t.__scopeMenu,children:o.modal?w.jsx(pj,{...i,ref:e}):w.jsx(vj,{...i,ref:e})})})})}),pj=g.forwardRef((t,e)=>{const n=Qi(nn,t.__scopeMenu),r=g.useRef(null),i=Xe(e,r);return g.useEffect(()=>{const s=r.current;if(s)return gS(s)},[]),w.jsx(Pg,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:J(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vj=g.forwardRef((t,e)=>{const n=Qi(nn,t.__scopeMenu);return w.jsx(Pg,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),gj=XL("MenuContent.ScrollLock"),Pg=g.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:_,disableOutsideScroll:m,...p}=t,y=Qi(nn,n),h=sl(nn,n),v=od(n),x=$1(n),b=aj(n),[E,S]=g.useState(null),k=g.useRef(null),C=Xe(e,k,y.onContentChange),R=g.useRef(0),P=g.useRef(""),$=g.useRef(0),O=g.useRef(null),U=g.useRef("right"),L=g.useRef(0),H=m?og:g.Fragment,q=m?{as:gj,allowPinchZoom:!0}:void 0,K=M=>{var ze,ve;const B=P.current+M,G=b().filter(Ae=>!Ae.disabled),Z=document.activeElement,se=(ze=G.find(Ae=>Ae.ref.current===Z))==null?void 0:ze.textValue,ce=G.map(Ae=>Ae.textValue),_e=Rj(ce,B,se),Se=(ve=G.find(Ae=>Ae.textValue===_e))==null?void 0:ve.ref.current;(function Ae(kt){P.current=kt,window.clearTimeout(R.current),kt!==""&&(R.current=window.setTimeout(()=>Ae(""),1e3))})(B),Se&&setTimeout(()=>Se.focus())};g.useEffect(()=>()=>window.clearTimeout(R.current),[]),aS();const I=g.useCallback(M=>{var G,Z;return U.current===((G=O.current)==null?void 0:G.side)&&Ij(M,(Z=O.current)==null?void 0:Z.area)},[]);return w.jsx(hj,{scope:n,searchRef:P,onItemEnter:g.useCallback(M=>{I(M)&&M.preventDefault()},[I]),onItemLeave:g.useCallback(M=>{var B;I(M)||((B=k.current)==null||B.focus(),S(null))},[I]),onTriggerLeave:g.useCallback(M=>{I(M)&&M.preventDefault()},[I]),pointerGraceTimerRef:$,onPointerGraceIntentChange:g.useCallback(M=>{O.current=M},[]),children:w.jsx(H,{...q,children:w.jsx(sg,{asChild:!0,trapped:i,onMountAutoFocus:J(s,M=>{var B;M.preventDefault(),(B=k.current)==null||B.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:w.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:_,children:w.jsx(QL,{asChild:!0,...x,dir:h.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:J(l,M=>{h.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(LL,{role:"menu","aria-orientation":"vertical","data-state":tC(y.open),"data-radix-menu-content":"",dir:h.dir,...v,...p,ref:C,style:{outline:"none",...p.style},onKeyDown:J(p.onKeyDown,M=>{const G=M.target.closest("[data-radix-menu-content]")===M.currentTarget,Z=M.ctrlKey||M.altKey||M.metaKey,se=M.key.length===1;G&&(M.key==="Tab"&&M.preventDefault(),!Z&&se&&K(M.key));const ce=k.current;if(M.target!==ce||!ij.includes(M.key))return;M.preventDefault();const Se=b().filter(ze=>!ze.disabled).map(ze=>ze.ref.current);A1.includes(M.key)&&Se.reverse(),kj(Se)}),onBlur:J(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(R.current),P.current="")}),onPointerMove:J(t.onPointerMove,Ha(M=>{const B=M.target,G=L.current!==M.clientX;if(M.currentTarget.contains(B)&&G){const Z=M.clientX>L.current?"right":"left";U.current=Z,L.current=M.clientX}}))})})})})})})});D1.displayName=nn;var mj="MenuGroup",Rg=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Ee.div,{role:"group",...r,ref:e})});Rg.displayName=mj;var yj="MenuLabel",z1=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Ee.div,{...r,ref:e})});z1.displayName=yj;var bc="MenuItem",i0="menu.itemSelect",ad=g.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=g.useRef(null),o=sl(bc,t.__scopeMenu),a=kg(bc,t.__scopeMenu),l=Xe(e,s),u=g.useRef(!1),c=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(i0,{bubbles:!0,cancelable:!0});d.addEventListener(i0,_=>r==null?void 0:r(_),{once:!0}),ig(d,f),f.defaultPrevented?u.current=!1:o.onClose()}};return w.jsx(U1,{...i,ref:l,disabled:n,onClick:J(t.onClick,c),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),u.current=!0},onPointerUp:J(t.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:J(t.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Mp.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ad.displayName=bc;var U1=g.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=kg(bc,n),a=$1(n),l=g.useRef(null),u=Xe(e,l),[c,d]=g.useState(!1),[f,_]=g.useState("");return g.useEffect(()=>{const m=l.current;m&&_((m.textContent??"").trim())},[s.children]),w.jsx(qa.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:w.jsx(YL,{asChild:!0,...a,focusable:!r,children:w.jsx(Ee.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:J(t.onPointerMove,Ha(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:J(t.onPointerLeave,Ha(m=>o.onItemLeave(m))),onFocus:J(t.onFocus,()=>d(!0)),onBlur:J(t.onBlur,()=>d(!1))})})})}),_j="MenuCheckboxItem",V1=g.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return w.jsx(G1,{scope:t.__scopeMenu,checked:n,children:w.jsx(ad,{role:"menuitemcheckbox","aria-checked":Ec(n)?"mixed":n,...i,ref:e,"data-state":Ig(n),onSelect:J(i.onSelect,()=>r==null?void 0:r(Ec(n)?!0:!n),{checkForDefaultPrevented:!1})})})});V1.displayName=_j;var B1="MenuRadioGroup",[wj,xj]=Ki(B1,{value:void 0,onValueChange:()=>{}}),q1=g.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Ft(r);return w.jsx(wj,{scope:t.__scopeMenu,value:n,onValueChange:s,children:w.jsx(Rg,{...i,ref:e})})});q1.displayName=B1;var H1="MenuRadioItem",W1=g.forwardRef((t,e)=>{const{value:n,...r}=t,i=xj(H1,t.__scopeMenu),s=n===i.value;return w.jsx(G1,{scope:t.__scopeMenu,checked:s,children:w.jsx(ad,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":Ig(s),onSelect:J(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});W1.displayName=H1;var Tg="MenuItemIndicator",[G1,bj]=Ki(Tg,{checked:!1}),K1=g.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=bj(Tg,n);return w.jsx(gr,{present:r||Ec(s.checked)||s.checked===!0,children:w.jsx(Ee.span,{...i,ref:e,"data-state":Ig(s.checked)})})});K1.displayName=Tg;var Ej="MenuSeparator",Q1=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Ee.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});Q1.displayName=Ej;var Sj="MenuArrow",Y1=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=od(n);return w.jsx(jL,{...i,...r,ref:e})});Y1.displayName=Sj;var Cj="MenuSub",[T3,X1]=Ki(Cj),Yo="MenuSubTrigger",J1=g.forwardRef((t,e)=>{const n=Qi(Yo,t.__scopeMenu),r=sl(Yo,t.__scopeMenu),i=X1(Yo,t.__scopeMenu),s=kg(Yo,t.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:t.__scopeMenu},c=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>c,[c]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),w.jsx(Sg,{asChild:!0,...u,children:w.jsx(U1,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":tC(n.open),...t,ref:oi(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:J(t.onPointerMove,Ha(d=>{s.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:J(t.onPointerLeave,Ha(d=>{var _,m;c();const f=(_=n.content)==null?void 0:_.getBoundingClientRect();if(f){const p=(m=n.content)==null?void 0:m.dataset.side,y=p==="right",h=y?-5:5,v=f[y?"left":"right"],x=f[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:v,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:v,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:J(t.onKeyDown,d=>{var _;const f=s.searchRef.current!=="";t.disabled||f&&d.key===" "||sj[r.dir].includes(d.key)&&(n.onOpenChange(!0),(_=n.content)==null||_.focus(),d.preventDefault())})})})});J1.displayName=Yo;var Z1="MenuSubContent",eC=g.forwardRef((t,e)=>{const n=L1(nn,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Qi(nn,t.__scopeMenu),o=sl(nn,t.__scopeMenu),a=X1(Z1,t.__scopeMenu),l=g.useRef(null),u=Xe(e,l);return w.jsx(qa.Provider,{scope:t.__scopeMenu,children:w.jsx(gr,{present:r||s.open,children:w.jsx(qa.Slot,{scope:t.__scopeMenu,children:w.jsx(Pg,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:J(t.onFocusOutside,c=>{c.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:J(t.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:J(t.onKeyDown,c=>{var _;const d=c.currentTarget.contains(c.target),f=oj[o.dir].includes(c.key);d&&f&&(s.onOpenChange(!1),(_=a.trigger)==null||_.focus(),c.preventDefault())})})})})})});eC.displayName=Z1;function tC(t){return t?"open":"closed"}function Ec(t){return t==="indeterminate"}function Ig(t){return Ec(t)?"indeterminate":t?"checked":"unchecked"}function kj(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function Pj(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function Rj(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=Pj(t,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Tj(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;sr!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(i=!i)}return i}function Ij(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Tj(n,e)}function Ha(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Oj=F1,Mj=Sg,Aj=j1,Nj=D1,$j=Rg,Fj=z1,Lj=ad,jj=V1,Dj=q1,zj=W1,Uj=K1,Vj=Q1,Bj=Y1,qj=J1,Hj=eC,ld="DropdownMenu",[Wj]=Wi(ld,[N1]),Ct=N1(),[Gj,nC]=Wj(ld),rC=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,l=Ct(e),u=g.useRef(null),[c,d]=Xc({prop:i,defaultProp:s??!1,onChange:o,caller:ld});return w.jsx(Gj,{scope:e,triggerId:Fs(),triggerRef:u,contentId:Fs(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:w.jsx(Oj,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};rC.displayName=ld;var iC="DropdownMenuTrigger",sC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=nC(iC,n),o=Ct(n);return w.jsx(Mj,{asChild:!0,...o,children:w.jsx(Ee.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:oi(e,s.triggerRef),onPointerDown:J(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:J(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});sC.displayName=iC;var Kj="DropdownMenuPortal",oC=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Ct(e);return w.jsx(Aj,{...r,...n})};oC.displayName=Kj;var aC="DropdownMenuContent",lC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=nC(aC,n),s=Ct(n),o=g.useRef(!1);return w.jsx(Nj,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:J(t.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:J(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});lC.displayName=aC;var Qj="DropdownMenuGroup",Yj=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx($j,{...i,...r,ref:e})});Yj.displayName=Qj;var Xj="DropdownMenuLabel",uC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Fj,{...i,...r,ref:e})});uC.displayName=Xj;var Jj="DropdownMenuItem",cC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Lj,{...i,...r,ref:e})});cC.displayName=Jj;var Zj="DropdownMenuCheckboxItem",dC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(jj,{...i,...r,ref:e})});dC.displayName=Zj;var eD="DropdownMenuRadioGroup",tD=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Dj,{...i,...r,ref:e})});tD.displayName=eD;var nD="DropdownMenuRadioItem",fC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(zj,{...i,...r,ref:e})});fC.displayName=nD;var rD="DropdownMenuItemIndicator",hC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Uj,{...i,...r,ref:e})});hC.displayName=rD;var iD="DropdownMenuSeparator",pC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Vj,{...i,...r,ref:e})});pC.displayName=iD;var sD="DropdownMenuArrow",oD=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Bj,{...i,...r,ref:e})});oD.displayName=sD;var aD="DropdownMenuSubTrigger",vC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(qj,{...i,...r,ref:e})});vC.displayName=aD;var lD="DropdownMenuSubContent",gC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Hj,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gC.displayName=lD;var uD=rC,cD=sC,dD=oC,mC=lC,yC=uC,_C=cC,wC=dC,xC=fC,bC=hC,EC=pC,SC=vC,CC=gC;/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -159,4 +159,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yD=ud("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),_D=uD,wD=cD,xD=g.forwardRef(({className:t,inset:e,children:n,...r},i)=>w.jsxs(SC,{ref:i,className:at("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",e&&"pl-8",t),...r,children:[n,w.jsx(gD,{className:"ml-auto h-4 w-4"})]}));xD.displayName=SC.displayName;const bD=g.forwardRef(({className:t,...e},n)=>w.jsx(CC,{ref:n,className:at("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));bD.displayName=CC.displayName;const PC=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(dD,{children:w.jsx(mC,{ref:r,sideOffset:e,className:at("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));PC.displayName=mC.displayName;const Qn=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(_C,{ref:r,className:at("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e&&"pl-8",t),...n}));Qn.displayName=_C.displayName;const ED=g.forwardRef(({className:t,children:e,checked:n,...r},i)=>w.jsxs(wC,{ref:i,className:at("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),checked:n,...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(bC,{children:w.jsx(vD,{className:"h-4 w-4"})})}),e]}));ED.displayName=wC.displayName;const SD=g.forwardRef(({className:t,children:e,...n},r)=>w.jsxs(xC,{ref:r,className:at("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(bC,{children:w.jsx(mD,{className:"h-2 w-2 fill-current"})})}),e]}));SD.displayName=xC.displayName;const RC=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(yC,{ref:r,className:at("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));RC.displayName=yC.displayName;const Ap=g.forwardRef(({className:t,...e},n)=>w.jsx(EC,{ref:n,className:at("-mx-1 my-1 h-px bg-muted",t),...e}));Ap.displayName=EC.displayName;function CD(t){const n=(t.name||t.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const kD=({user:t,onLogout:e})=>w.jsxs(_D,{children:[w.jsx(wD,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:w.jsxs(t1,{className:"h-8 w-8",children:[t.avatar_url&&w.jsx(n1,{src:t.avatar_url,alt:t.username}),w.jsx(r1,{className:"text-xs",children:CD(t)})]})})}),w.jsxs(PC,{align:"end",className:"w-56",children:[w.jsxs(RC,{className:"flex flex-col gap-0.5 py-2",children:[w.jsx("span",{className:"text-sm font-medium leading-tight",children:t.name||t.username}),w.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",t.username]}),t.is_admin&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-900",children:"Admin"}),t.role==="contributor"&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),w.jsx(Ap,{}),w.jsx(Qn,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/frameworks",children:"Frameworks"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/trends",children:"Trends"})}),t.is_admin&&w.jsxs(w.Fragment,{children:[w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/admin-dashboard",children:"Admin dashboard"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/submissions",children:"Review submissions"})})]}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/settings",children:"Settings"})}),w.jsx(Ap,{}),w.jsx(Qn,{onSelect:n=>{n.preventDefault(),e()},children:"Log out"})]})]}),PD=!1;class cd extends Error{constructor(n,r){var i;super(`API request failed: ${n.status} ${n.statusText}`);wr(this,"status");wr(this,"statusText");wr(this,"response");wr(this,"detail");wr(this,"code");wr(this,"displayMessage");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(i=JSON.parse(r))==null?void 0:i.detail,typeof this.detail=="string"&&(this.message=this.detail),Array.isArray(this.detail)){const s=this.detail[0];typeof s=="object"&&s!==null&&"msg"in s&&typeof s.msg=="string"&&(this.message=s.msg)}if(typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const s="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${s}`}}catch{this.detail=void 0,this.displayMessage=r||this.message;return}this.displayMessage=this.message}}function T3(t,e){return t instanceof cd?t.displayMessage||e:typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"&&t.message||e}class RD{constructor(e){this.baseUrl=e}async fetch(e,n){const r=`${this.baseUrl}${e}`;try{const{headers:i,...s}=n??{},a=(s.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=new Headers(i);return typeof s.body=="string"&&!l.has("Content-Type")&&l.set("Content-Type","application/json"),await fetch(r,{...s,cache:s.cache??a,credentials:s.credentials??"include",headers:l})}catch(i){throw console.error(`[API] Request to ${r} failed:`,i),i}}async fetchOk(e,n){const r=await this.fetch(e,n);if(!r.ok){const i=new cd(r,await r.text());throw console.error("[API] Error response:",i.response),i}return r}async request(e,n){const r=await this.fetchOk(e,n);return r.status===204?void 0:await r.json()}}function TD(t){t instanceof cd&&t.status===401&&t.code!=="fresh_auth_required"&&t.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"))}async function TC(t){try{return await t()}catch(e){throw TD(e),e}}const Og=new RD(`${cg()}/api/v1`),ID=(t,e)=>Og.fetch(t,e),I3=(t,e)=>TC(()=>Og.fetchOk(t,e)),Sc=(t,e)=>TC(()=>Og.request(t,e));async function O3(t,e){try{return await Sc(t,e)}catch(n){if(n instanceof cd&&n.status===404)return null;throw n}}const s0={async getCurrentUser(){if(yo())return null;const t=await ID("/auth/me",{cache:"no-store"});return t.status===401||!t.ok?null:t.json()},async logout(){await Sc("/auth/logout",{method:"POST"})},async requestStagingAccess(){await Sc("/staging-access-request",{method:"POST"})}},Mg=V.createContext(null),o0="pwc:auth-stale",OD=({children:t})=>{const[e,n]=V.useState(null),[r,i]=V.useState(!0),s=mA(),o=V.useRef(null),a=V.useCallback(async()=>{i(!0);const c=await s0.getCurrentUser();n(c),i(!1)},[]),l=V.useCallback(async()=>{const c=dg("/api/v1/auth/logout");if(new URL(c,window.location.origin).origin!==window.location.origin){const d=document.createElement("form");d.method="POST",d.action=`${c}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(d),d.submit();return}await s0.logout(),n(null)},[]);V.useEffect(()=>{a()},[a]),V.useEffect(()=>{},[e]),V.useEffect(()=>{o.current&&!e&&s.resetQueries(),o.current=e},[s,e]),V.useEffect(()=>{const c=()=>{n(null)};return window.addEventListener(o0,c),()=>window.removeEventListener(o0,c)},[]);const u=V.useMemo(()=>({user:e,isLoading:r,refresh:a,logout:l}),[e,r,a,l]);return w.jsx(Mg.Provider,{value:u,children:t})};function Ag(){const t=V.useContext(Mg);if(!t)throw new Error("useAuth must be used inside an ");return t}function M3(){return V.useContext(Mg)}const kr=({name:t,size:e=14})=>{const n={search:w.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),bookmark:w.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:w.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:w.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),github:w.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})};return w.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:n[t]})},a0="https://github.com/huggingface/paperswithcode-feedback/issues",l0="https://github.com/huggingface/paperswithcode",MD="https://paperswithcode.co/following",u0="pwc:announcement:following-feed:v1:dismissed",Nf=[{to:"/",label:"Trending",end:!0},{to:"/tasks",label:"Browse state-of-the-art",end:!1},{to:"/methods",label:"Methods",end:!1},{to:"/conferences",label:"Conferences",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],AD=()=>{if(typeof navigator>"u")return!1;const t=navigator.userAgentData,e=(t==null?void 0:t.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(e)},ND=()=>{const[t,e]=V.useState(!1);return V.useEffect(()=>{e(AD())},[]),w.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},$D=({onOpenSearch:t})=>{const[e,n]=V.useState(!1),[r,i]=V.useState(()=>localStorage.getItem(u0)!=="1"),s=V.useRef(null),o=V.useRef(null),a=()=>n(!1),{user:l,logout:u}=Ag(),c=an(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",_=yo(),m=Va()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:u$()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:l$}:null,p=m?[Nf[0],m,...Nf.slice(1)]:Nf;return V.useLayoutEffect(()=>{var S;const y=s.current,h=o.current;if(!y||!h)return;let v=!1;const x=()=>{if(v)return;const k=y.querySelector(".nav-item.active"),C=(k==null?void 0:k.offsetWidth)??0;h.style.width=`${C}px`,h.style.transform=`translateX(${(k==null?void 0:k.offsetLeft)??0}px)`,h.style.opacity=C>0?"1":"0"};x();const b=window.requestAnimationFrame(()=>{h.classList.add("nav-indicator-ready")}),E=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return E==null||E.observe(y),window.addEventListener("resize",x),(S=document.fonts)==null||S.ready.then(x),()=>{v=!0,window.cancelAnimationFrame(b),E==null||E.disconnect(),window.removeEventListener("resize",x)}},[c.pathname,p.length]),w.jsxs(ZN,{open:e,onOpenChange:n,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(is,{to:"/",className:"brand",onClick:a,children:[w.jsx("span",{className:"brand-mark"}),w.jsxs("span",{className:"brand-name",children:["Papers ",w.jsx("em",{children:"With Code"})]})]}),w.jsxs("nav",{className:"nav",ref:s,children:[p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const E=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:`nav-item${x?" nav-item-with-badge":""}`,children:E},y):w.jsx(is,{to:y,end:v,className:({isActive:S})=>`nav-item${x?" nav-item-with-badge":""}${S?" active":""}`,children:E},y)}),w.jsx("span",{ref:o,className:"nav-indicator","aria-hidden":"true"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"feedback-link header-feedback-link",href:a0,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),w.jsx("a",{className:"icon-btn header-github-btn",href:l0,target:"_blank",rel:"noreferrer","aria-label":"GitHub repository",title:"GitHub repository",children:w.jsx(kr,{name:"github",size:14})}),w.jsxs("button",{className:"search-trigger","aria-label":"Search papers, authors, domains",onClick:t,children:[w.jsx(kr,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domains…"}),w.jsx(ND,{})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:w.jsx(kr,{name:"search",size:14})}),!_&&w.jsx(is,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(kr,{name:"bookmark",size:13})}),_?null:l?w.jsx(kD,{user:l,onLogout:u}):w.jsx(NS,{returnTo:f}),w.jsx(e$,{asChild:!0,children:w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",children:w.jsx(kr,{name:"menu",size:14})})})]}),!d&&r&&w.jsxs("div",{className:"site-announcement",role:"status",children:[w.jsx("span",{children:"New: "}),_?w.jsx("a",{href:MD,target:"_blank",rel:"noreferrer",children:"following feed"}):w.jsx(mn,{to:"/following",children:"following feed"}),w.jsx("span",{children:", follow your favorite tasks, benchmarks, authors or organizations"}),w.jsx("button",{type:"button",className:"site-announcement-close","aria-label":"Dismiss announcement",onClick:()=>{localStorage.setItem(u0,"1"),i(!1)},children:w.jsx(kr,{name:"close",size:11})})]})]}),w.jsx(t$,{children:w.jsx(n$,{className:"mobile-nav-drawer",children:w.jsxs(r$,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(i$,{className:"sr-only",children:"Navigation menu"}),w.jsx(s$,{className:"icon-btn mobile-nav-close","aria-label":"Close menu",children:w.jsx(kr,{name:"close",size:14})}),w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),t()},children:[w.jsx(kr,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domains…"})]}),p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const E=`mobile-nav-link${x?" mobile-nav-link-with-badge":""}`,S=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:E,onClick:a,children:S},y):w.jsx(is,{to:y,end:v,className:E,onClick:a,children:S},y)}),w.jsx("a",{className:"mobile-nav-link",href:a0,target:"_blank",rel:"noreferrer",onClick:a,children:"Submit feedback"}),w.jsx("a",{className:"mobile-nav-link",href:l0,target:"_blank",rel:"noreferrer",onClick:a,children:"GitHub"}),!_&&w.jsx(is,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!_&&(l==null?void 0:l.is_admin)&&w.jsx(is,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},FD=()=>{const{pathname:t}=an();return t==="/chat"||t.startsWith("/chat/")||t.startsWith("/pdf/")?null:w.jsx("footer",{className:"site-footer",children:w.jsxs("div",{className:"site-footer-inner",children:[w.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),w.jsx(mn,{to:"/docs/api",children:"API"}),w.jsx(mn,{to:"/mcp",children:"MCP"}),w.jsx(mn,{to:"/privacy",children:"Privacy"}),w.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},LD=1,jD=1e6;let $f=0;function DD(){return $f=($f+1)%Number.MAX_SAFE_INTEGER,$f.toString()}const Ff=new Map,c0=t=>{if(Ff.has(t))return;const e=setTimeout(()=>{Ff.delete(t),fa({type:"REMOVE_TOAST",toastId:t})},jD);Ff.set(t,e)},zD=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,LD)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?c0(n):t.toasts.forEach(r=>{c0(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},pu=[];let vu={toasts:[]};function fa(t){vu=zD(vu,t),pu.forEach(e=>{e(vu)})}function UD({...t}){const e=DD(),n=i=>fa({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>fa({type:"DISMISS_TOAST",toastId:e});return fa({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function VD(){const[t,e]=g.useState(vu);return g.useEffect(()=>(pu.push(e),()=>{const n=pu.indexOf(e);n>-1&&pu.splice(n,1)}),[t]),{...t,toast:UD,dismiss:n=>fa({type:"DISMISS_TOAST",toastId:n})}}var BD=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),qD="VisuallyHidden",Ng=g.forwardRef((t,e)=>w.jsx(Ee.span,{...t,ref:e,style:{...BD,...t.style}}));Ng.displayName=qD;var $g="ToastProvider",[Fg,HD,WD]=vg("Toast"),[IC]=Wi("Toast",[WD]),[GD,dd]=IC($g),OC=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,l]=g.useState(null),[u,c]=g.useState(0),d=g.useRef(!1),f=g.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${$g}\`. Expected non-empty \`string\`.`),w.jsx(Fg.Provider,{scope:e,children:w.jsx(GD,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>c(_=>_+1),[]),onToastRemove:g.useCallback(()=>c(_=>_-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};OC.displayName=$g;var MC="ToastViewport",KD=["F8"],Np="toast.viewportPause",$p="toast.viewportResume",AC=g.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=KD,label:i="Notifications ({hotkey})",...s}=t,o=dd(MC,n),a=HD(n),l=g.useRef(null),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),f=Xe(e,d,o.onViewportChange),_=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=o.toastCount>0;g.useEffect(()=>{const y=h=>{var x;r.length!==0&&r.every(b=>h[b]||h.code===b)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),g.useEffect(()=>{const y=l.current,h=d.current;if(m&&y&&h){const v=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(Np);h.dispatchEvent(S),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent($p);h.dispatchEvent(S),o.isClosePausedRef.current=!1}},b=S=>{!y.contains(S.relatedTarget)&&x()},E=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",v),y.addEventListener("focusout",b),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",E),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",b),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",E),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[m,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:y})=>{const v=a().map(x=>{const b=x.ref.current,E=[b,...a2(b)];return y==="forwards"?E:E.reverse()});return(y==="forwards"?v.reverse():v).flat()},[a]);return g.useEffect(()=>{const y=d.current;if(y){const h=v=>{var E,S,k;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const C=document.activeElement,R=v.shiftKey;if(v.target===y&&R){(E=u.current)==null||E.focus();return}const O=p({tabbingDirection:R?"backwards":"forwards"}),U=O.findIndex(L=>L===C);Lf(O.slice(U+1))?v.preventDefault():R?(S=u.current)==null||S.focus():(k=c.current)==null||k.focus()}};return y.addEventListener("keydown",h),()=>y.removeEventListener("keydown",h)}},[a,p]),w.jsxs(UA,{ref:l,role:"region","aria-label":i.replace("{hotkey}",_),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&w.jsx(Fp,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});Lf(y)}}),w.jsx(Fg.Slot,{scope:n,children:w.jsx(Ee.ol,{tabIndex:-1,...s,ref:f})}),m&&w.jsx(Fp,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});Lf(y)}})]})});AC.displayName=MC;var NC="ToastFocusProxy",Fp=g.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,s=dd(NC,n);return w.jsx(Ng,{tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});Fp.displayName=NC;var ol="Toast",QD="toast.swipeStart",YD="toast.swipeMove",XD="toast.swipeCancel",JD="toast.swipeEnd",$C=g.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=t,[a,l]=Xc({prop:r,defaultProp:i??!0,onChange:s,caller:ol});return w.jsx(gr,{present:n||a,children:w.jsx(t2,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Ft(t.onPause),onResume:Ft(t.onResume),onSwipeStart:J(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:J(t.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:J(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:J(t.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});$C.displayName=ol;var[ZD,e2]=IC(ol,{onClose(){}}),t2=g.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:_,...m}=t,p=dd(ol,n),[y,h]=g.useState(null),v=Xe(e,L=>h(L)),x=g.useRef(null),b=g.useRef(null),E=i||p.duration,S=g.useRef(0),k=g.useRef(E),C=g.useRef(0),{onToastAdd:R,onToastRemove:P}=p,$=Ft(()=>{var H;(y==null?void 0:y.contains(document.activeElement))&&((H=p.viewport)==null||H.focus()),o()}),O=g.useCallback(L=>{!L||L===1/0||(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout($,L))},[$]);g.useEffect(()=>{const L=p.viewport;if(L){const H=()=>{O(k.current),u==null||u()},q=()=>{const K=new Date().getTime()-S.current;k.current=k.current-K,window.clearTimeout(C.current),l==null||l()};return L.addEventListener(Np,q),L.addEventListener($p,H),()=>{L.removeEventListener(Np,q),L.removeEventListener($p,H)}}},[p.viewport,E,l,u,O]),g.useEffect(()=>{s&&!p.isClosePausedRef.current&&O(E)},[s,E,p.isClosePausedRef,O]),g.useEffect(()=>(R(),()=>P()),[R,P]);const U=g.useMemo(()=>y?VC(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[U&&w.jsx(n2,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:U}),w.jsx(ZD,{scope:n,onClose:$,children:el.createPortal(w.jsx(Fg.ItemSlot,{scope:n,children:w.jsx(zA,{asChild:!0,onEscapeKeyDown:J(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||$(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(Ee.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":p.swipeDirection,...m,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:J(t.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:J(t.onPointerDown,L=>{L.button===0&&(x.current={x:L.clientX,y:L.clientY})}),onPointerMove:J(t.onPointerMove,L=>{if(!x.current)return;const H=L.clientX-x.current.x,q=L.clientY-x.current.y,K=!!b.current,I=["left","right"].includes(p.swipeDirection),M=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,B=I?M(0,H):0,G=I?0:M(0,q),Z=L.pointerType==="touch"?10:2,se={x:B,y:G},ce={originalEvent:L,delta:se};K?(b.current=se,Hl(YD,d,ce,{discrete:!1})):d0(se,p.swipeDirection,Z)?(b.current=se,Hl(QD,c,ce,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(H)>Z||Math.abs(q)>Z)&&(x.current=null)}),onPointerUp:J(t.onPointerUp,L=>{const H=b.current,q=L.target;if(q.hasPointerCapture(L.pointerId)&&q.releasePointerCapture(L.pointerId),b.current=null,x.current=null,H){const K=L.currentTarget,I={originalEvent:L,delta:H};d0(H,p.swipeDirection,p.swipeThreshold)?Hl(JD,_,I,{discrete:!0}):Hl(XD,f,I,{discrete:!0}),K.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),n2=t=>{const{__scopeToast:e,children:n,...r}=t,i=dd(ol,e),[s,o]=g.useState(!1),[a,l]=g.useState(!1);return s2(()=>o(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(Zc,{asChild:!0,children:w.jsx(Ng,{...r,children:s&&w.jsxs(w.Fragment,{children:[i.label," ",n]})})})},r2="ToastTitle",FC=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Ee.div,{...r,ref:e})});FC.displayName=r2;var i2="ToastDescription",LC=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Ee.div,{...r,ref:e})});LC.displayName=i2;var jC="ToastAction",DC=g.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?w.jsx(UC,{altText:n,asChild:!0,children:w.jsx(Lg,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${jC}\`. Expected non-empty \`string\`.`),null)});DC.displayName=jC;var zC="ToastClose",Lg=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=e2(zC,n);return w.jsx(UC,{asChild:!0,children:w.jsx(Ee.button,{type:"button",...r,ref:e,onClick:J(t.onClick,i.onClose)})})});Lg.displayName=zC;var UC=g.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return w.jsx(Ee.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function VC(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),o2(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...VC(r))}}),e}function Hl(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?ig(i,s):i.dispatchEvent(s)}var d0=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),s=r>i;return e==="left"||e==="right"?s&&r>n:!s&&i>n};function s2(t=()=>{}){const e=Ft(t);on(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function o2(t){return t.nodeType===t.ELEMENT_NODE}function a2(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Lf(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var l2=OC,BC=AC,qC=$C,HC=FC,WC=LC,GC=DC,KC=Lg;const f0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,h0=QS,u2=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return h0(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=s==null?void 0:s[u];if(c===null)return null;const f=f0(c)||f0(d);return i[u][f]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,..._}=c;return Object.entries(_).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...s,...a}[p]):{...s,...a}[p]===y})?[...u,d,f]:u},[]);return h0(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},c2=l2,QC=g.forwardRef(({className:t,...e},n)=>w.jsx(BC,{ref:n,className:at("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));QC.displayName=BC.displayName;const d2=u2("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-16 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),YC=g.forwardRef(({className:t,variant:e,...n},r)=>w.jsx(qC,{ref:r,className:at(d2({variant:e}),t),...n}));YC.displayName=qC.displayName;const f2=g.forwardRef(({className:t,...e},n)=>w.jsx(GC,{ref:n,className:at("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));f2.displayName=GC.displayName;const XC=g.forwardRef(({className:t,...e},n)=>w.jsx(KC,{ref:n,className:at("absolute right-2 top-2 inline-flex h-11 w-11 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring group-[.destructive]:text-destructive-foreground group-[.destructive]:hover:bg-destructive-foreground/10 group-[.destructive]:focus:ring-destructive-foreground",t),"aria-label":"Dismiss notification","toast-close":"",...e,children:w.jsx(yD,{className:"h-4 w-4"})}));XC.displayName=KC.displayName;const JC=g.forwardRef(({className:t,...e},n)=>w.jsx(HC,{ref:n,className:at("text-sm font-semibold",t),...e}));JC.displayName=HC.displayName;const ZC=g.forwardRef(({className:t,...e},n)=>w.jsx(WC,{ref:n,className:at("text-sm opacity-90",t),...e}));ZC.displayName=WC.displayName;function h2(){const{toasts:t}=VD();return w.jsxs(c2,{children:[t.map(function({id:e,title:n,description:r,action:i,...s}){return w.jsxs(YC,{...s,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx(JC,{children:n}),r&&w.jsx(ZC,{children:r})]}),i,w.jsx(XC,{})]},e)}),w.jsx(QC,{})]})}function p2(){const{pathname:t,hash:e}=an();g.useLayoutEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"instant"})},[t,e])}class v2{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}getRateLimitPolicy(){return this.request("/rate-limits",{credentials:"omit"})}getBookmarkIds(){return this.request("/me/bookmarks/ids")}getBookmarks(){return this.request("/me/bookmarks")}addBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"POST"})}removeBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const p0=new v2(Sc),jf={hide_closed_source_evals:!1},ek=V.createContext(null),g2=({children:t})=>{const{user:e}=Ag(),[n,r]=V.useState(jf),[i,s]=V.useState(!1);V.useEffect(()=>{let l=!1;if(!e){r(jf);return}return s(!0),p0.getPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(jf)}).finally(()=>{l||s(!1)}),()=>{l=!0}},[e]);const o=V.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await p0.updatePreferences(u);r(c)}catch{r(n)}},[n,e]),a=V.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:i,setHideClosedSourceEvals:o}),[n,e,i,o]);return w.jsx(ek.Provider,{value:a,children:t})};function A3(){const t=V.useContext(ek);if(!t)throw new Error("usePreferences must be used inside a ");return t}const tk=d$(),m2=tk?LM:FM;if(!tk&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const y2=V.lazy(()=>oe(()=>import("./AuthorizePaperEditView-BxV6NPKV.js"),__vite__mapDeps([0,1,2,3,4]))),_2=V.lazy(()=>oe(()=>import("./FollowingView-BYs2N-nq.js"),__vite__mapDeps([5,6,7,1,8,9,10,11,12,2,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]))),v0=V.lazy(()=>oe(()=>import("./FeedView-CFzlAcol.js"),__vite__mapDeps([6,7,1,8,9,10,11,12,2,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]))),w2=V.lazy(()=>oe(()=>import("./ChatView-DsnEMREv.js"),__vite__mapDeps([36,1,37,31,32,23,24,38,39,9,40,41,42,43,44,45,2,46,47,48,49,13,50,51,17,18,52,53,29,30,54,55,56]))),x2=V.lazy(()=>oe(()=>import("./SharedChatView-C8jGkNjy.js"),__vite__mapDeps([57,1,37,31,32,23,24,38,39,9,40,41,42,43,44,45,2,46,47,48,49,13,50,51,17,18,52,53]))),b2=V.lazy(()=>oe(()=>import("./PapersListView-zhvzkmK9.js"),__vite__mapDeps([58,19,20,11,21,15,16,17,18,22,23,24,25,26,27,28,9,33,1,34,59,35,60,61]))),E2=V.lazy(()=>oe(()=>import("./PaperDetailView-uLa9aL0s.js"),__vite__mapDeps([62,21,19,20,11,22,63,24,38,25,64,23,65,1,33,34,66,27,35,3,8,30,46,67,68,26,50,69,2,9,70,71,72,73,74,39,75,13,76,77,78,40,79,43,44,28,80,81,17,18,82]))),S2=V.lazy(()=>oe(()=>import("./PaperReaderView-D2y857wl.js"),__vite__mapDeps([83,1,37,31,32,23,24,38,39,9,40,41,42,43,44,45,2,46,47,48,49,13,50,51,17,18,52,53,84,65,25,33,34,36,29,30,54,55,56]))),C2=V.lazy(()=>oe(()=>import("./TagsIndexView-DJJJY-D1.js"),__vite__mapDeps([85,1,9,20,11,86,50,87,54,88,89,47,75,90,41,91,78,7,35,92,27,93,73,3,67,74,68,26,8,69,2,70,13,94,95]))),k2=V.lazy(()=>oe(()=>import("./TagBrowseView-BzhdvNbn.js"),__vite__mapDeps([96,97,1,2,10,13,19,20,11,15,16,17,18,21,22,23,24,25,26,27,28,14,98,84,42,43,44,45,38,53,9,60,61,86,33,34,35,99,90,40]))),P2=V.lazy(()=>oe(()=>import("./MethodsIndexView-CS3VxsBJ.js"),__vite__mapDeps([100,1,9,95,86,35,92,27,93,73,3,67,74,68,26,8,50,69,2,70,13,94,88]))),R2=V.lazy(()=>oe(()=>import("./FrameworksIndexView-CqtIM7jE.js"),__vite__mapDeps([101,1,21,9,20,61]))),T2=V.lazy(()=>oe(()=>import("./TrendsView-CW281bBi.js"),__vite__mapDeps([102,1,35,27]))),I2=V.lazy(()=>oe(()=>import("./ConferencesIndexView-DUaazjEx.js"),__vite__mapDeps([103,1,9,104,35,92,27,93,73,3,67,74,68,26,8,50,69,2,70,13]))),O2=V.lazy(()=>oe(()=>import("./AiDeadlinesView-BWqSvLms.js"),__vite__mapDeps([105,1,9,106,76,27,35,25,8,104]))),M2=V.lazy(()=>oe(()=>import("./ConferenceDetailView-CX4S54m2.js"),__vite__mapDeps([107,1,92,27,84,42,43,44,45,38,23,24,2,53,9,60,95,20,108,104,11,35,25,99]))),A2=V.lazy(()=>oe(()=>import("./ConferenceTaskView-DvbWh5_R.js"),__vite__mapDeps([109,1,15,16,17,18,19,20,11,21,22,23,24,25,26,27,28,84,42,43,44,45,38,2,53,9,60,108,33,34,35,99]))),N2=V.lazy(()=>oe(()=>import("./OrganizationsIndexView-CbWS3zNq.js"),__vite__mapDeps([110,1,35,9,111]))),$2=V.lazy(()=>oe(()=>import("./OrganizationDetailView-C69MBUc4.js"),__vite__mapDeps([112,97,1,2,10,13,84,42,43,44,45,38,23,24,53,113,27,9,15,16,17,18,19,20,11,21,22,25,26,28,35,68,3,8,50,69,33,34,60,81,99]))),F2=V.lazy(()=>oe(()=>import("./OrganizationDetailView-C69MBUc4.js"),__vite__mapDeps([112,97,1,2,10,13,84,42,43,44,45,38,23,24,53,113,27,9,15,16,17,18,19,20,11,21,22,25,26,28,35,68,3,8,50,69,33,34,60,81,99]))),L2=V.lazy(()=>oe(()=>import("./AuthorDetailView-ETu8URv_.js"),__vite__mapDeps([114,1,17,18,15,16,19,20,11,21,22,23,24,25,26,27,28,97,2,10,13,35,33,34,60,99]))),j2=V.lazy(()=>oe(()=>import("./MethodDetailView-CU5sbo2E.js"),__vite__mapDeps([115,97,1,2,10,13,23,24,19,20,11,15,16,17,18,21,22,25,26,27,28,84,42,43,44,45,38,53,9,60,86,33,34,35,99]))),D2=V.lazy(()=>oe(()=>import("./BenchmarkDetailView-CzOCvqTF.js"),__vite__mapDeps([116,97,1,2,10,13,9,63,24,38,25,64,22,106,76,21,27,35,98,86,60,99,117]))),z2=V.lazy(()=>oe(()=>import("./SavedPapersView-CWUM_gRn.js"),__vite__mapDeps([118,23,24,1,16,17,18,19,20,11,21,22,25,27,35,80]))),U2=V.lazy(()=>oe(()=>import("./SettingsView-BurbOJNZ.js"),__vite__mapDeps([119,1,2,10,106,76,12,7,14,90,32,66,55,49,89]))),V2=V.lazy(()=>oe(()=>import("./PrivacyView-B0DBzRMW.js"),__vite__mapDeps([120,66]))),B2=V.lazy(()=>oe(()=>import("./ApiDocsView-Bb326kAF.js"),__vite__mapDeps([121,1,43,122]))),q2=V.lazy(()=>oe(()=>import("./McpView-CMm_vOrt.js"),__vite__mapDeps([123,1,66,56,40,49,46,124]))),H2=V.lazy(()=>oe(()=>import("./SubmitView-CCWdg0_v.js"),__vite__mapDeps([125,2,35,3,67,74,23,24,71]))),W2=V.lazy(()=>oe(()=>import("./CronDashboard-DMMdAs4p.js"),__vite__mapDeps([126,1,2,127,128,77,3,51,75,88,91,41,87,49,129,69,130,79,34,4,9,32]))),G2=V.lazy(()=>oe(()=>import("./AutonomousOperations-epH5w9S2.js"),__vite__mapDeps([131,1,2,127,128,77,3,67,91,48]))),K2=V.lazy(()=>oe(()=>import("./SubmissionsDashboard-6OF_L4gN.js"),__vite__mapDeps([132,72,71,23,24,1,2,34,9,25,70,129,69,130,133]))),Q2=V.lazy(()=>oe(()=>import("./UserProfileView-jtJ9PNjL.js"),__vite__mapDeps([134,1,113,27,9]))),Y2=V.lazy(()=>oe(()=>import("./RateLimitsView-JyYAwVUh.js"),__vite__mapDeps([135,1]))),X2=V.lazy(()=>oe(()=>import("./AstraForRoboticsView-CqbM4y2W.js"),__vite__mapDeps([136,15,16,17,18,19,20,11,21,22,23,24,25,26,27,28,35,33,1,34,66,137]))),Df=V.lazy(()=>oe(()=>import("./NotFound-D8hwuoEl.js"),[])),J2=V.lazy(()=>oe(()=>import("./SearchOverlay-CzggQ3fk.js"),__vite__mapDeps([138,23,24,1,22,9,59,20,11]))),Z2=V.lazy(()=>oe(()=>import("./StagingAccessRequestView-DFeZrs_b.js"),__vite__mapDeps([139,130]))),nk=()=>w.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),w.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),e3=new gA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),t3=()=>{const{arxivId:t}=zE();return w.jsx(co,{to:t?`/paper/${t}`:"/papers",replace:!0})},n3=()=>{const{taskSlug:t}=zE();return w.jsx(co,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},r3=({element:t})=>yo()?w.jsx(co,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:t}),Lp=({element:t})=>{const{user:e,isLoading:n}=Ag(),r=an();return yo()?w.jsx(co,{to:"/",replace:!0}):n?w.jsx("div",{className:"page",children:w.jsx("div",{className:"submission-loading",children:w.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?w.jsx(w.Fragment,{children:t}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Admin access required"}),w.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Sign in required"}),w.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),w.jsx(NS,{returnTo:`${r.pathname}${r.search}`})]})})},i3=()=>{const t=a$(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return V.useEffect(()=>{e&&window.location.replace(t)},[t,e]),e?w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-loading",children:[w.jsx("span",{children:"Opening the production admin dashboard..."}),w.jsx("a",{href:t,children:"Continue"})]})}):w.jsx(Lp,{element:w.jsx(W2,{})})},g0=({reader:t=!1})=>{const[e,n]=V.useState(!1),{pathname:r}=an();V.useEffect(()=>{const a=l=>{(l.metaKey||l.ctrlKey)&&l.key==="k"&&(l.preventDefault(),n(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);const i=w.jsx($D,{onOpenSearch:()=>n(!0)}),s=w.jsx(OE,{resetKey:r,children:w.jsx(V.Suspense,{fallback:w.jsx(nk,{}),children:w.jsx(kM,{})})}),o=e&&w.jsx(V.Suspense,{fallback:null,children:w.jsx(J2,{open:e,onClose:()=>n(!1)})});return t?w.jsxs("div",{className:"reader-route-shell",children:[i,w.jsx("div",{className:"reader-route-content",children:s}),o]}):w.jsxs(w.Fragment,{children:[i,w.jsx("main",{children:s}),w.jsx(FD,{}),o]})},s3=()=>(p2(),V.useLayoutEffect(()=>{var t;(t=document.getElementById("initial-discovery-footer"))==null||t.remove()},[]),w.jsxs(PM,{children:[w.jsx(ne,{path:"/request-access",element:w.jsx(V.Suspense,{fallback:w.jsx(nk,{}),children:w.jsx(Z2,{})})}),w.jsx(ne,{element:w.jsx(g0,{reader:!0}),children:w.jsx(ne,{path:"/pdf/:paperId",element:c$()?w.jsx(S2,{}):w.jsx(Df,{})})}),w.jsxs(ne,{element:w.jsx(g0,{}),children:[w.jsx(ne,{path:"/",element:w.jsx(v0,{})}),w.jsx(ne,{path:"/following",element:w.jsx(_2,{})}),w.jsx(ne,{path:"/x-trending",element:w.jsx(v0,{xTrending:!0})}),w.jsx(ne,{path:"/chat/:sessionId?",element:Va()?w.jsx(w2,{}):w.jsx(co,{to:"/",replace:!0})}),w.jsx(ne,{path:"/share/:shareId",element:Va()?w.jsx(x2,{}):w.jsx(Df,{})}),w.jsx(ne,{path:"/papers",element:w.jsx(b2,{})}),w.jsx(ne,{path:"/papers/:arxivId",element:w.jsx(t3,{})}),w.jsx(ne,{path:"/paper/:arxivId",element:w.jsx(E2,{})}),w.jsx(ne,{path:"/tasks",element:w.jsx(C2,{})}),w.jsx(ne,{path:"/tasks/:taskSlug",element:w.jsx(k2,{})}),w.jsx(ne,{path:"/task/:taskSlug",element:w.jsx(n3,{})}),w.jsx(ne,{path:"/methods",element:w.jsx(P2,{})}),w.jsx(ne,{path:"/methods/:methodSlug",element:w.jsx(j2,{})}),w.jsx(ne,{path:"/frameworks",element:w.jsx(R2,{})}),w.jsx(ne,{path:"/trends",element:w.jsx(T2,{})}),w.jsx(ne,{path:"/conferences",element:w.jsx(I2,{})}),w.jsx(ne,{path:"/ai-deadlines",element:w.jsx(O2,{})}),w.jsx(ne,{path:"/conferences/:confSlug",element:w.jsx(M2,{})}),w.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(A2,{})}),w.jsx(ne,{path:"/organizations",element:w.jsx(N2,{})}),w.jsx(ne,{path:"/orgs/:orgSlug",element:w.jsx($2,{})}),w.jsx(ne,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(F2,{})}),w.jsx(ne,{path:"/authors/:authorId",element:w.jsx(L2,{})}),w.jsx(ne,{path:"/benchmark/:datasetSlug",element:w.jsx(D2,{})}),w.jsx(ne,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(y2,{})}),w.jsx(ne,{path:"/submit",element:w.jsx(H2,{})}),w.jsx(ne,{path:"/saved",element:w.jsx(r3,{element:w.jsx(z2,{})})}),w.jsx(ne,{path:"/settings",element:w.jsx(U2,{})}),w.jsx(ne,{path:"/privacy",element:w.jsx(V2,{})}),w.jsx(ne,{path:"/docs/api",element:w.jsx(B2,{})}),w.jsx(ne,{path:"/mcp",element:w.jsx(q2,{})}),w.jsx(ne,{path:"/admin-dashboard",element:w.jsx(i3,{})}),w.jsx(ne,{path:"/autonomous-operations",element:w.jsx(Lp,{element:w.jsx(G2,{})})}),w.jsx(ne,{path:"/cron-dashboard",element:w.jsx(co,{to:"/admin-dashboard",replace:!0})}),w.jsx(ne,{path:"/submissions",element:w.jsx(Lp,{element:w.jsx(K2,{})})}),w.jsx(ne,{path:"/rate-limits",element:w.jsx(Y2,{})}),w.jsx(ne,{path:"/astra-for-robotics",element:w.jsx(X2,{})}),w.jsx(ne,{path:"/:username",element:w.jsx(Q2,{})}),w.jsx(ne,{path:"*",element:w.jsx(Df,{})})]})]})),o3=()=>w.jsx(yA,{client:e3,children:w.jsx(OD,{children:w.jsxs(g2,{children:[w.jsx(m2,{children:w.jsx(s3,{})}),w.jsx(h2,{}),!1]})})});NO();const a3=w.jsx(NR,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(OE,{children:w.jsx(o3,{})})}),l3=Dx(document.getElementById("root"));l3.render(w.jsx(V.StrictMode,{children:a3}));export{o$ as $,at as A,x3 as B,vD as C,P3 as D,i1 as E,R1 as F,mD as G,NS as H,YL as I,cd as J,V as K,mn as L,p0 as M,c$ as N,w3 as O,gr as P,_D as Q,QL as R,wD as S,f2 as T,PC as U,Qn as V,b3 as W,yD as X,_3 as Y,S3 as Z,k0 as _,Ag as a,oe as a0,QS as a1,gD as a2,el as a3,TD as a4,Sc as a5,FS as a6,u2 as a7,Fs as a8,ZN as a9,r1 as aA,za as aB,hA as aC,p3 as aD,iA as aE,XM as aF,xp as aG,YE as aH,QM as aI,YM as aJ,wp as aK,GE as aL,dA as aM,eA as aN,I3 as aO,O3 as aP,gS as aQ,og as aR,aS,sg as aT,g3 as aU,v3 as aV,dg as aW,s0 as aX,t$ as aa,n$ as ab,r$ as ac,oi as ad,s$ as ae,i$ as af,y3 as ag,co as ah,$L as ai,FL as aj,y1 as ak,Zc as al,Jc as am,LL as an,jL as ao,d3 as ap,c3 as aq,ID as ar,C3 as as,Yc as at,wt as au,h3 as av,KE as aw,hn as ax,t1 as ay,n1 as az,an as b,tg as c,M3 as d,f3 as e,mA as f,Va as g,AS as h,yo as i,w as j,u$ as k,l$ as l,E3 as m,ud as n,k3 as o,VD as p,A3 as q,g as r,T3 as s,Ee as t,zE as u,Xc as v,Xe as w,J as x,RL as y,Wi as z}; + */const yD=ud("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),_D=uD,wD=cD,xD=g.forwardRef(({className:t,inset:e,children:n,...r},i)=>w.jsxs(SC,{ref:i,className:at("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",e&&"pl-8",t),...r,children:[n,w.jsx(gD,{className:"ml-auto h-4 w-4"})]}));xD.displayName=SC.displayName;const bD=g.forwardRef(({className:t,...e},n)=>w.jsx(CC,{ref:n,className:at("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));bD.displayName=CC.displayName;const PC=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(dD,{children:w.jsx(mC,{ref:r,sideOffset:e,className:at("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));PC.displayName=mC.displayName;const Qn=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(_C,{ref:r,className:at("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e&&"pl-8",t),...n}));Qn.displayName=_C.displayName;const ED=g.forwardRef(({className:t,children:e,checked:n,...r},i)=>w.jsxs(wC,{ref:i,className:at("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),checked:n,...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(bC,{children:w.jsx(vD,{className:"h-4 w-4"})})}),e]}));ED.displayName=wC.displayName;const SD=g.forwardRef(({className:t,children:e,...n},r)=>w.jsxs(xC,{ref:r,className:at("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(bC,{children:w.jsx(mD,{className:"h-2 w-2 fill-current"})})}),e]}));SD.displayName=xC.displayName;const RC=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(yC,{ref:r,className:at("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));RC.displayName=yC.displayName;const Ap=g.forwardRef(({className:t,...e},n)=>w.jsx(EC,{ref:n,className:at("-mx-1 my-1 h-px bg-muted",t),...e}));Ap.displayName=EC.displayName;function CD(t){const n=(t.name||t.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const kD=({user:t,onLogout:e})=>w.jsxs(_D,{children:[w.jsx(wD,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:w.jsxs(t1,{className:"h-8 w-8",children:[t.avatar_url&&w.jsx(n1,{src:t.avatar_url,alt:t.username}),w.jsx(r1,{className:"text-xs",children:CD(t)})]})})}),w.jsxs(PC,{align:"end",className:"w-56",children:[w.jsxs(RC,{className:"flex flex-col gap-0.5 py-2",children:[w.jsx("span",{className:"text-sm font-medium leading-tight",children:t.name||t.username}),w.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",t.username]}),t.is_admin&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-900",children:"Admin"}),t.role==="contributor"&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),w.jsx(Ap,{}),w.jsx(Qn,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/frameworks",children:"Frameworks"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/trends",children:"Trends"})}),t.is_admin&&w.jsxs(w.Fragment,{children:[w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/admin-dashboard",children:"Admin dashboard"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/submissions",children:"Review submissions"})})]}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/settings",children:"Settings"})}),w.jsx(Ap,{}),w.jsx(Qn,{onSelect:n=>{n.preventDefault(),e()},children:"Log out"})]})]}),PD=!1;class cd extends Error{constructor(n,r){var i;super(`API request failed: ${n.status} ${n.statusText}`);wr(this,"status");wr(this,"statusText");wr(this,"response");wr(this,"detail");wr(this,"code");wr(this,"displayMessage");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(i=JSON.parse(r))==null?void 0:i.detail,typeof this.detail=="string"&&(this.message=this.detail),Array.isArray(this.detail)){const s=this.detail[0];typeof s=="object"&&s!==null&&"msg"in s&&typeof s.msg=="string"&&(this.message=s.msg)}if(typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const s="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${s}`}}catch{this.detail=void 0,this.displayMessage=r||this.message;return}this.displayMessage=this.message}}function I3(t,e){return t instanceof cd?t.displayMessage||e:typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"&&t.message||e}class RD{constructor(e){this.baseUrl=e}async fetch(e,n){const r=`${this.baseUrl}${e}`;try{const{headers:i,...s}=n??{},a=(s.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=new Headers(i);return typeof s.body=="string"&&!l.has("Content-Type")&&l.set("Content-Type","application/json"),await fetch(r,{...s,cache:s.cache??a,credentials:s.credentials??"include",headers:l})}catch(i){throw console.error(`[API] Request to ${r} failed:`,i),i}}async fetchOk(e,n){const r=await this.fetch(e,n);if(!r.ok){const i=new cd(r,await r.text());throw console.error("[API] Error response:",i.response),i}return r}async request(e,n){const r=await this.fetchOk(e,n);return r.status===204?void 0:await r.json()}}function TD(t){t instanceof cd&&t.status===401&&t.code!=="fresh_auth_required"&&t.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"))}async function TC(t){try{return await t()}catch(e){throw TD(e),e}}const Og=new RD(`${cg()}/api/v1`),ID=(t,e)=>Og.fetch(t,e),O3=(t,e)=>TC(()=>Og.fetchOk(t,e)),Sc=(t,e)=>TC(()=>Og.request(t,e));async function M3(t,e){try{return await Sc(t,e)}catch(n){if(n instanceof cd&&n.status===404)return null;throw n}}const s0={async getCurrentUser(){if(yo())return null;const t=await ID("/auth/me",{cache:"no-store"});return t.status===401||!t.ok?null:t.json()},async logout(){await Sc("/auth/logout",{method:"POST"})},async requestStagingAccess(){await Sc("/staging-access-request",{method:"POST"})}},Mg=V.createContext(null),o0="pwc:auth-stale",OD=({children:t})=>{const[e,n]=V.useState(null),[r,i]=V.useState(!0),s=mA(),o=V.useRef(null),a=V.useCallback(async()=>{i(!0);const c=await s0.getCurrentUser();n(c),i(!1)},[]),l=V.useCallback(async()=>{const c=dg("/api/v1/auth/logout");if(new URL(c,window.location.origin).origin!==window.location.origin){const d=document.createElement("form");d.method="POST",d.action=`${c}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(d),d.submit();return}await s0.logout(),n(null)},[]);V.useEffect(()=>{a()},[a]),V.useEffect(()=>{},[e]),V.useEffect(()=>{o.current&&!e&&s.resetQueries(),o.current=e},[s,e]),V.useEffect(()=>{const c=()=>{n(null)};return window.addEventListener(o0,c),()=>window.removeEventListener(o0,c)},[]);const u=V.useMemo(()=>({user:e,isLoading:r,refresh:a,logout:l}),[e,r,a,l]);return w.jsx(Mg.Provider,{value:u,children:t})};function Ag(){const t=V.useContext(Mg);if(!t)throw new Error("useAuth must be used inside an ");return t}function A3(){return V.useContext(Mg)}const kr=({name:t,size:e=14})=>{const n={search:w.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),bookmark:w.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:w.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:w.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),github:w.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})};return w.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:n[t]})},a0="https://github.com/huggingface/paperswithcode-feedback/issues",l0="https://github.com/huggingface/paperswithcode",MD="https://paperswithcode.co/following",u0="pwc:announcement:following-feed:v1:dismissed",Nf=[{to:"/",label:"Trending",end:!0},{to:"/tasks",label:"Browse state-of-the-art",end:!1},{to:"/methods",label:"Methods",end:!1},{to:"/conferences",label:"Conferences",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],AD=()=>{if(typeof navigator>"u")return!1;const t=navigator.userAgentData,e=(t==null?void 0:t.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(e)},ND=()=>{const[t,e]=V.useState(!1);return V.useEffect(()=>{e(AD())},[]),w.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},$D=({onOpenSearch:t})=>{const[e,n]=V.useState(!1),[r,i]=V.useState(()=>localStorage.getItem(u0)!=="1"),s=V.useRef(null),o=V.useRef(null),a=()=>n(!1),{user:l,logout:u}=Ag(),c=an(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",_=yo(),m=Va()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:u$()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:l$}:null,p=m?[Nf[0],m,...Nf.slice(1)]:Nf;return V.useLayoutEffect(()=>{var S;const y=s.current,h=o.current;if(!y||!h)return;let v=!1;const x=()=>{if(v)return;const k=y.querySelector(".nav-item.active"),C=(k==null?void 0:k.offsetWidth)??0;h.style.width=`${C}px`,h.style.transform=`translateX(${(k==null?void 0:k.offsetLeft)??0}px)`,h.style.opacity=C>0?"1":"0"};x();const b=window.requestAnimationFrame(()=>{h.classList.add("nav-indicator-ready")}),E=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return E==null||E.observe(y),window.addEventListener("resize",x),(S=document.fonts)==null||S.ready.then(x),()=>{v=!0,window.cancelAnimationFrame(b),E==null||E.disconnect(),window.removeEventListener("resize",x)}},[c.pathname,p.length]),w.jsxs(ZN,{open:e,onOpenChange:n,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(is,{to:"/",className:"brand",onClick:a,children:[w.jsx("span",{className:"brand-mark"}),w.jsxs("span",{className:"brand-name",children:["Papers ",w.jsx("em",{children:"With Code"})]})]}),w.jsxs("nav",{className:"nav",ref:s,children:[p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const E=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:`nav-item${x?" nav-item-with-badge":""}`,children:E},y):w.jsx(is,{to:y,end:v,className:({isActive:S})=>`nav-item${x?" nav-item-with-badge":""}${S?" active":""}`,children:E},y)}),w.jsx("span",{ref:o,className:"nav-indicator","aria-hidden":"true"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"feedback-link header-feedback-link",href:a0,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),w.jsx("a",{className:"icon-btn header-github-btn",href:l0,target:"_blank",rel:"noreferrer","aria-label":"GitHub repository",title:"GitHub repository",children:w.jsx(kr,{name:"github",size:14})}),w.jsxs("button",{className:"search-trigger","aria-label":"Search papers, authors, domains",onClick:t,children:[w.jsx(kr,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domains…"}),w.jsx(ND,{})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:w.jsx(kr,{name:"search",size:14})}),!_&&w.jsx(is,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(kr,{name:"bookmark",size:13})}),_?null:l?w.jsx(kD,{user:l,onLogout:u}):w.jsx(NS,{returnTo:f}),w.jsx(e$,{asChild:!0,children:w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",children:w.jsx(kr,{name:"menu",size:14})})})]}),!d&&r&&w.jsxs("div",{className:"site-announcement",role:"status",children:[w.jsx("span",{children:"New: "}),_?w.jsx("a",{href:MD,target:"_blank",rel:"noreferrer",children:"following feed"}):w.jsx(mn,{to:"/following",children:"following feed"}),w.jsx("span",{children:", follow your favorite tasks, benchmarks, authors or organizations"}),w.jsx("button",{type:"button",className:"site-announcement-close","aria-label":"Dismiss announcement",onClick:()=>{localStorage.setItem(u0,"1"),i(!1)},children:w.jsx(kr,{name:"close",size:11})})]})]}),w.jsx(t$,{children:w.jsx(n$,{className:"mobile-nav-drawer",children:w.jsxs(r$,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(i$,{className:"sr-only",children:"Navigation menu"}),w.jsx(s$,{className:"icon-btn mobile-nav-close","aria-label":"Close menu",children:w.jsx(kr,{name:"close",size:14})}),w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),t()},children:[w.jsx(kr,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domains…"})]}),p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const E=`mobile-nav-link${x?" mobile-nav-link-with-badge":""}`,S=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:E,onClick:a,children:S},y):w.jsx(is,{to:y,end:v,className:E,onClick:a,children:S},y)}),w.jsx("a",{className:"mobile-nav-link",href:a0,target:"_blank",rel:"noreferrer",onClick:a,children:"Submit feedback"}),w.jsx("a",{className:"mobile-nav-link",href:l0,target:"_blank",rel:"noreferrer",onClick:a,children:"GitHub"}),!_&&w.jsx(is,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!_&&(l==null?void 0:l.is_admin)&&w.jsx(is,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},FD=()=>{const{pathname:t}=an();return t==="/chat"||t.startsWith("/chat/")||t.startsWith("/pdf/")?null:w.jsx("footer",{className:"site-footer",children:w.jsxs("div",{className:"site-footer-inner",children:[w.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),w.jsx(mn,{to:"/docs/api",children:"API"}),w.jsx(mn,{to:"/mcp",children:"MCP"}),w.jsx(mn,{to:"/privacy",children:"Privacy"}),w.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},LD=1,jD=1e6;let $f=0;function DD(){return $f=($f+1)%Number.MAX_SAFE_INTEGER,$f.toString()}const Ff=new Map,c0=t=>{if(Ff.has(t))return;const e=setTimeout(()=>{Ff.delete(t),fa({type:"REMOVE_TOAST",toastId:t})},jD);Ff.set(t,e)},zD=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,LD)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?c0(n):t.toasts.forEach(r=>{c0(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},pu=[];let vu={toasts:[]};function fa(t){vu=zD(vu,t),pu.forEach(e=>{e(vu)})}function UD({...t}){const e=DD(),n=i=>fa({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>fa({type:"DISMISS_TOAST",toastId:e});return fa({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function VD(){const[t,e]=g.useState(vu);return g.useEffect(()=>(pu.push(e),()=>{const n=pu.indexOf(e);n>-1&&pu.splice(n,1)}),[t]),{...t,toast:UD,dismiss:n=>fa({type:"DISMISS_TOAST",toastId:n})}}var BD=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),qD="VisuallyHidden",Ng=g.forwardRef((t,e)=>w.jsx(Ee.span,{...t,ref:e,style:{...BD,...t.style}}));Ng.displayName=qD;var $g="ToastProvider",[Fg,HD,WD]=vg("Toast"),[IC]=Wi("Toast",[WD]),[GD,dd]=IC($g),OC=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,l]=g.useState(null),[u,c]=g.useState(0),d=g.useRef(!1),f=g.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${$g}\`. Expected non-empty \`string\`.`),w.jsx(Fg.Provider,{scope:e,children:w.jsx(GD,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>c(_=>_+1),[]),onToastRemove:g.useCallback(()=>c(_=>_-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};OC.displayName=$g;var MC="ToastViewport",KD=["F8"],Np="toast.viewportPause",$p="toast.viewportResume",AC=g.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=KD,label:i="Notifications ({hotkey})",...s}=t,o=dd(MC,n),a=HD(n),l=g.useRef(null),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),f=Xe(e,d,o.onViewportChange),_=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=o.toastCount>0;g.useEffect(()=>{const y=h=>{var x;r.length!==0&&r.every(b=>h[b]||h.code===b)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),g.useEffect(()=>{const y=l.current,h=d.current;if(m&&y&&h){const v=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(Np);h.dispatchEvent(S),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent($p);h.dispatchEvent(S),o.isClosePausedRef.current=!1}},b=S=>{!y.contains(S.relatedTarget)&&x()},E=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",v),y.addEventListener("focusout",b),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",E),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",b),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",E),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[m,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:y})=>{const v=a().map(x=>{const b=x.ref.current,E=[b,...a2(b)];return y==="forwards"?E:E.reverse()});return(y==="forwards"?v.reverse():v).flat()},[a]);return g.useEffect(()=>{const y=d.current;if(y){const h=v=>{var E,S,k;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const C=document.activeElement,R=v.shiftKey;if(v.target===y&&R){(E=u.current)==null||E.focus();return}const O=p({tabbingDirection:R?"backwards":"forwards"}),U=O.findIndex(L=>L===C);Lf(O.slice(U+1))?v.preventDefault():R?(S=u.current)==null||S.focus():(k=c.current)==null||k.focus()}};return y.addEventListener("keydown",h),()=>y.removeEventListener("keydown",h)}},[a,p]),w.jsxs(UA,{ref:l,role:"region","aria-label":i.replace("{hotkey}",_),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&w.jsx(Fp,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});Lf(y)}}),w.jsx(Fg.Slot,{scope:n,children:w.jsx(Ee.ol,{tabIndex:-1,...s,ref:f})}),m&&w.jsx(Fp,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});Lf(y)}})]})});AC.displayName=MC;var NC="ToastFocusProxy",Fp=g.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,s=dd(NC,n);return w.jsx(Ng,{tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});Fp.displayName=NC;var ol="Toast",QD="toast.swipeStart",YD="toast.swipeMove",XD="toast.swipeCancel",JD="toast.swipeEnd",$C=g.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=t,[a,l]=Xc({prop:r,defaultProp:i??!0,onChange:s,caller:ol});return w.jsx(gr,{present:n||a,children:w.jsx(t2,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Ft(t.onPause),onResume:Ft(t.onResume),onSwipeStart:J(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:J(t.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:J(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:J(t.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});$C.displayName=ol;var[ZD,e2]=IC(ol,{onClose(){}}),t2=g.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:_,...m}=t,p=dd(ol,n),[y,h]=g.useState(null),v=Xe(e,L=>h(L)),x=g.useRef(null),b=g.useRef(null),E=i||p.duration,S=g.useRef(0),k=g.useRef(E),C=g.useRef(0),{onToastAdd:R,onToastRemove:P}=p,$=Ft(()=>{var H;(y==null?void 0:y.contains(document.activeElement))&&((H=p.viewport)==null||H.focus()),o()}),O=g.useCallback(L=>{!L||L===1/0||(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout($,L))},[$]);g.useEffect(()=>{const L=p.viewport;if(L){const H=()=>{O(k.current),u==null||u()},q=()=>{const K=new Date().getTime()-S.current;k.current=k.current-K,window.clearTimeout(C.current),l==null||l()};return L.addEventListener(Np,q),L.addEventListener($p,H),()=>{L.removeEventListener(Np,q),L.removeEventListener($p,H)}}},[p.viewport,E,l,u,O]),g.useEffect(()=>{s&&!p.isClosePausedRef.current&&O(E)},[s,E,p.isClosePausedRef,O]),g.useEffect(()=>(R(),()=>P()),[R,P]);const U=g.useMemo(()=>y?VC(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[U&&w.jsx(n2,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:U}),w.jsx(ZD,{scope:n,onClose:$,children:el.createPortal(w.jsx(Fg.ItemSlot,{scope:n,children:w.jsx(zA,{asChild:!0,onEscapeKeyDown:J(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||$(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(Ee.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":p.swipeDirection,...m,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:J(t.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:J(t.onPointerDown,L=>{L.button===0&&(x.current={x:L.clientX,y:L.clientY})}),onPointerMove:J(t.onPointerMove,L=>{if(!x.current)return;const H=L.clientX-x.current.x,q=L.clientY-x.current.y,K=!!b.current,I=["left","right"].includes(p.swipeDirection),M=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,B=I?M(0,H):0,G=I?0:M(0,q),Z=L.pointerType==="touch"?10:2,se={x:B,y:G},ce={originalEvent:L,delta:se};K?(b.current=se,Hl(YD,d,ce,{discrete:!1})):d0(se,p.swipeDirection,Z)?(b.current=se,Hl(QD,c,ce,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(H)>Z||Math.abs(q)>Z)&&(x.current=null)}),onPointerUp:J(t.onPointerUp,L=>{const H=b.current,q=L.target;if(q.hasPointerCapture(L.pointerId)&&q.releasePointerCapture(L.pointerId),b.current=null,x.current=null,H){const K=L.currentTarget,I={originalEvent:L,delta:H};d0(H,p.swipeDirection,p.swipeThreshold)?Hl(JD,_,I,{discrete:!0}):Hl(XD,f,I,{discrete:!0}),K.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),n2=t=>{const{__scopeToast:e,children:n,...r}=t,i=dd(ol,e),[s,o]=g.useState(!1),[a,l]=g.useState(!1);return s2(()=>o(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(Zc,{asChild:!0,children:w.jsx(Ng,{...r,children:s&&w.jsxs(w.Fragment,{children:[i.label," ",n]})})})},r2="ToastTitle",FC=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Ee.div,{...r,ref:e})});FC.displayName=r2;var i2="ToastDescription",LC=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Ee.div,{...r,ref:e})});LC.displayName=i2;var jC="ToastAction",DC=g.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?w.jsx(UC,{altText:n,asChild:!0,children:w.jsx(Lg,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${jC}\`. Expected non-empty \`string\`.`),null)});DC.displayName=jC;var zC="ToastClose",Lg=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=e2(zC,n);return w.jsx(UC,{asChild:!0,children:w.jsx(Ee.button,{type:"button",...r,ref:e,onClick:J(t.onClick,i.onClose)})})});Lg.displayName=zC;var UC=g.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return w.jsx(Ee.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function VC(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),o2(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...VC(r))}}),e}function Hl(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?ig(i,s):i.dispatchEvent(s)}var d0=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),s=r>i;return e==="left"||e==="right"?s&&r>n:!s&&i>n};function s2(t=()=>{}){const e=Ft(t);on(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function o2(t){return t.nodeType===t.ELEMENT_NODE}function a2(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Lf(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var l2=OC,BC=AC,qC=$C,HC=FC,WC=LC,GC=DC,KC=Lg;const f0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,h0=QS,u2=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return h0(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=s==null?void 0:s[u];if(c===null)return null;const f=f0(c)||f0(d);return i[u][f]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,..._}=c;return Object.entries(_).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...s,...a}[p]):{...s,...a}[p]===y})?[...u,d,f]:u},[]);return h0(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},c2=l2,QC=g.forwardRef(({className:t,...e},n)=>w.jsx(BC,{ref:n,className:at("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));QC.displayName=BC.displayName;const d2=u2("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-16 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),YC=g.forwardRef(({className:t,variant:e,...n},r)=>w.jsx(qC,{ref:r,className:at(d2({variant:e}),t),...n}));YC.displayName=qC.displayName;const f2=g.forwardRef(({className:t,...e},n)=>w.jsx(GC,{ref:n,className:at("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));f2.displayName=GC.displayName;const XC=g.forwardRef(({className:t,...e},n)=>w.jsx(KC,{ref:n,className:at("absolute right-2 top-2 inline-flex h-11 w-11 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring group-[.destructive]:text-destructive-foreground group-[.destructive]:hover:bg-destructive-foreground/10 group-[.destructive]:focus:ring-destructive-foreground",t),"aria-label":"Dismiss notification","toast-close":"",...e,children:w.jsx(yD,{className:"h-4 w-4"})}));XC.displayName=KC.displayName;const JC=g.forwardRef(({className:t,...e},n)=>w.jsx(HC,{ref:n,className:at("text-sm font-semibold",t),...e}));JC.displayName=HC.displayName;const ZC=g.forwardRef(({className:t,...e},n)=>w.jsx(WC,{ref:n,className:at("text-sm opacity-90",t),...e}));ZC.displayName=WC.displayName;function h2(){const{toasts:t}=VD();return w.jsxs(c2,{children:[t.map(function({id:e,title:n,description:r,action:i,...s}){return w.jsxs(YC,{...s,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx(JC,{children:n}),r&&w.jsx(ZC,{children:r})]}),i,w.jsx(XC,{})]},e)}),w.jsx(QC,{})]})}function p2(){const{pathname:t,hash:e}=an();g.useLayoutEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"instant"})},[t,e])}class v2{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}getRateLimitPolicy(){return this.request("/rate-limits",{credentials:"omit"})}getBookmarkIds(){return this.request("/me/bookmarks/ids")}getBookmarks(){return this.request("/me/bookmarks")}addBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"POST"})}removeBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const p0=new v2(Sc),jf={hide_closed_source_evals:!1},ek=V.createContext(null),g2=({children:t})=>{const{user:e}=Ag(),[n,r]=V.useState(jf),[i,s]=V.useState(!1);V.useEffect(()=>{let l=!1;if(!e){r(jf);return}return s(!0),p0.getPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(jf)}).finally(()=>{l||s(!1)}),()=>{l=!0}},[e]);const o=V.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await p0.updatePreferences(u);r(c)}catch{r(n)}},[n,e]),a=V.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:i,setHideClosedSourceEvals:o}),[n,e,i,o]);return w.jsx(ek.Provider,{value:a,children:t})};function N3(){const t=V.useContext(ek);if(!t)throw new Error("usePreferences must be used inside a ");return t}const tk=d$(),m2=tk?LM:FM;if(!tk&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const y2=V.lazy(()=>oe(()=>import("./AuthorizePaperEditView-D0e1jji8.js"),__vite__mapDeps([0,1,2,3,4]))),_2=V.lazy(()=>oe(()=>import("./FollowingView-nVVViEvV.js"),__vite__mapDeps([5,6,7,1,8,9,10,11,12,2,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]))),v0=V.lazy(()=>oe(()=>import("./FeedView-BR2dQQ-K.js"),__vite__mapDeps([6,7,1,8,9,10,11,12,2,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]))),w2=V.lazy(()=>oe(()=>import("./ChatView-DlSbJMKT.js"),__vite__mapDeps([36,1,37,31,32,23,24,38,39,9,40,41,42,43,44,45,2,46,47,48,49,13,50,51,17,18,52,53,29,30,54,55,56]))),x2=V.lazy(()=>oe(()=>import("./SharedChatView-DO_TTtXn.js"),__vite__mapDeps([57,1,37,31,32,23,24,38,39,9,40,41,42,43,44,45,2,46,47,48,49,13,50,51,17,18,52,53]))),b2=V.lazy(()=>oe(()=>import("./PapersListView-DhkGuTns.js"),__vite__mapDeps([58,19,20,11,21,15,16,17,18,22,23,24,25,26,27,28,9,33,1,34,59,35,60,61]))),E2=V.lazy(()=>oe(()=>import("./PaperDetailView-F3D4F2PU.js"),__vite__mapDeps([62,2,21,19,20,11,22,63,24,38,25,64,23,65,1,33,34,66,27,35,3,8,30,46,67,68,69,70,26,50,71,39,9,72,73,74,75,13,76,77,40,78,79,43,44,28,80,81,17,18,82]))),S2=V.lazy(()=>oe(()=>import("./PaperReaderView-9hbbSNRK.js"),__vite__mapDeps([83,1,37,31,32,23,24,38,39,9,40,41,42,43,44,45,2,46,47,48,49,13,50,51,17,18,52,53,84,65,25,33,34,36,29,30,54,55,56]))),C2=V.lazy(()=>oe(()=>import("./TagsIndexView-jyuGT4BB.js"),__vite__mapDeps([85,1,9,20,11,86,50,87,54,88,89,47,75,90,41,91,77,7,35,92,27,93,72,3,69,73,70,26,8,71,2,74,13,94,95]))),k2=V.lazy(()=>oe(()=>import("./TagBrowseView-CRgLg1ki.js"),__vite__mapDeps([96,97,1,2,10,13,19,20,11,15,16,17,18,21,22,23,24,25,26,27,28,14,98,84,42,43,44,45,38,53,9,60,61,86,33,34,35,99,90,40]))),P2=V.lazy(()=>oe(()=>import("./MethodsIndexView-DYp0dUSa.js"),__vite__mapDeps([100,1,9,95,86,35,92,27,93,72,3,69,73,70,26,8,50,71,2,74,13,94,88]))),R2=V.lazy(()=>oe(()=>import("./FrameworksIndexView-CQtYg5mA.js"),__vite__mapDeps([101,1,21,9,20,61]))),T2=V.lazy(()=>oe(()=>import("./TrendsView-DhWigqns.js"),__vite__mapDeps([102,1,35,27]))),I2=V.lazy(()=>oe(()=>import("./ConferencesIndexView-Cw6IrAk5.js"),__vite__mapDeps([103,1,9,104,35,92,27,93,72,3,69,73,70,26,8,50,71,2,74,13]))),O2=V.lazy(()=>oe(()=>import("./AiDeadlinesView-BhXjtcbF.js"),__vite__mapDeps([105,1,9,106,78,27,35,25,8,104]))),M2=V.lazy(()=>oe(()=>import("./ConferenceDetailView-i-HB-ysc.js"),__vite__mapDeps([107,1,92,27,84,42,43,44,45,38,23,24,2,53,9,60,95,20,108,104,11,35,25,99]))),A2=V.lazy(()=>oe(()=>import("./ConferenceTaskView-BZBMXZD8.js"),__vite__mapDeps([109,1,15,16,17,18,19,20,11,21,22,23,24,25,26,27,28,84,42,43,44,45,38,2,53,9,60,108,33,34,35,99]))),N2=V.lazy(()=>oe(()=>import("./OrganizationsIndexView-Bd4D8teF.js"),__vite__mapDeps([110,1,35,9,111]))),$2=V.lazy(()=>oe(()=>import("./OrganizationDetailView-BD-vOirQ.js"),__vite__mapDeps([112,97,1,2,10,13,84,42,43,44,45,38,23,24,53,113,27,9,15,16,17,18,19,20,11,21,22,25,26,28,35,70,3,8,50,71,33,34,60,81,99]))),F2=V.lazy(()=>oe(()=>import("./OrganizationDetailView-BD-vOirQ.js"),__vite__mapDeps([112,97,1,2,10,13,84,42,43,44,45,38,23,24,53,113,27,9,15,16,17,18,19,20,11,21,22,25,26,28,35,70,3,8,50,71,33,34,60,81,99]))),L2=V.lazy(()=>oe(()=>import("./AuthorDetailView-BpcSKHs1.js"),__vite__mapDeps([114,1,17,18,15,16,19,20,11,21,22,23,24,25,26,27,28,97,2,10,13,35,33,34,60,99]))),j2=V.lazy(()=>oe(()=>import("./MethodDetailView-CEUGGyVV.js"),__vite__mapDeps([115,97,1,2,10,13,23,24,19,20,11,15,16,17,18,21,22,25,26,27,28,84,42,43,44,45,38,53,9,60,86,33,34,35,99]))),D2=V.lazy(()=>oe(()=>import("./BenchmarkDetailView-BGwBE1Ld.js"),__vite__mapDeps([116,97,1,2,10,13,9,63,24,38,25,64,22,106,78,21,27,35,98,86,60,99,117]))),z2=V.lazy(()=>oe(()=>import("./SavedPapersView-CewIlVsw.js"),__vite__mapDeps([118,23,24,1,16,17,18,19,20,11,21,22,25,27,35,80]))),U2=V.lazy(()=>oe(()=>import("./SettingsView-C0A-yv3U.js"),__vite__mapDeps([119,1,2,10,106,78,12,7,14,90,32,66,55,49,89]))),V2=V.lazy(()=>oe(()=>import("./PrivacyView-CodFIqUq.js"),__vite__mapDeps([120,66]))),B2=V.lazy(()=>oe(()=>import("./ApiDocsView-hjoHKqpf.js"),__vite__mapDeps([121,1,43,122]))),q2=V.lazy(()=>oe(()=>import("./McpView-BrXaRo4V.js"),__vite__mapDeps([123,1,66,56,40,49,46,124]))),H2=V.lazy(()=>oe(()=>import("./SubmitView-C6p4dpHt.js"),__vite__mapDeps([125,2,35,3,69,73,23,24,68]))),W2=V.lazy(()=>oe(()=>import("./CronDashboard-CC1lPV3k.js"),__vite__mapDeps([126,1,2,127,128,76,3,51,75,88,91,41,87,49,129,71,130,79,34,4,9,32]))),G2=V.lazy(()=>oe(()=>import("./AutonomousOperations-CzJGtkdV.js"),__vite__mapDeps([131,1,2,127,128,76,3,69,91,48]))),K2=V.lazy(()=>oe(()=>import("./SubmissionsDashboard-eKjMsSf9.js"),__vite__mapDeps([132,67,1,68,23,24,2,34,9,25,74,129,71,130,133]))),Q2=V.lazy(()=>oe(()=>import("./UserProfileView-gm0usnRn.js"),__vite__mapDeps([134,1,113,27,9]))),Y2=V.lazy(()=>oe(()=>import("./RateLimitsView-C9bDo_Dq.js"),__vite__mapDeps([135,1]))),X2=V.lazy(()=>oe(()=>import("./AstraForRoboticsView-pQ4cp5_V.js"),__vite__mapDeps([136,15,16,17,18,19,20,11,21,22,23,24,25,26,27,28,35,33,1,34,66,137]))),Df=V.lazy(()=>oe(()=>import("./NotFound-DtzwOULp.js"),[])),J2=V.lazy(()=>oe(()=>import("./SearchOverlay-LaDVSpVs.js"),__vite__mapDeps([138,23,24,1,22,9,59,20,11]))),Z2=V.lazy(()=>oe(()=>import("./StagingAccessRequestView-DgeEeE2r.js"),__vite__mapDeps([139,130]))),nk=()=>w.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),w.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),e3=new gA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),t3=()=>{const{arxivId:t}=zE();return w.jsx(co,{to:t?`/paper/${t}`:"/papers",replace:!0})},n3=()=>{const{taskSlug:t}=zE();return w.jsx(co,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},r3=({element:t})=>yo()?w.jsx(co,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:t}),Lp=({element:t})=>{const{user:e,isLoading:n}=Ag(),r=an();return yo()?w.jsx(co,{to:"/",replace:!0}):n?w.jsx("div",{className:"page",children:w.jsx("div",{className:"submission-loading",children:w.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?w.jsx(w.Fragment,{children:t}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Admin access required"}),w.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Sign in required"}),w.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),w.jsx(NS,{returnTo:`${r.pathname}${r.search}`})]})})},i3=()=>{const t=a$(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return V.useEffect(()=>{e&&window.location.replace(t)},[t,e]),e?w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-loading",children:[w.jsx("span",{children:"Opening the production admin dashboard..."}),w.jsx("a",{href:t,children:"Continue"})]})}):w.jsx(Lp,{element:w.jsx(W2,{})})},g0=({reader:t=!1})=>{const[e,n]=V.useState(!1),{pathname:r}=an();V.useEffect(()=>{const a=l=>{(l.metaKey||l.ctrlKey)&&l.key==="k"&&(l.preventDefault(),n(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);const i=w.jsx($D,{onOpenSearch:()=>n(!0)}),s=w.jsx(OE,{resetKey:r,children:w.jsx(V.Suspense,{fallback:w.jsx(nk,{}),children:w.jsx(kM,{})})}),o=e&&w.jsx(V.Suspense,{fallback:null,children:w.jsx(J2,{open:e,onClose:()=>n(!1)})});return t?w.jsxs("div",{className:"reader-route-shell",children:[i,w.jsx("div",{className:"reader-route-content",children:s}),o]}):w.jsxs(w.Fragment,{children:[i,w.jsx("main",{children:s}),w.jsx(FD,{}),o]})},s3=()=>(p2(),V.useLayoutEffect(()=>{var t;(t=document.getElementById("initial-discovery-footer"))==null||t.remove()},[]),w.jsxs(PM,{children:[w.jsx(ne,{path:"/request-access",element:w.jsx(V.Suspense,{fallback:w.jsx(nk,{}),children:w.jsx(Z2,{})})}),w.jsx(ne,{element:w.jsx(g0,{reader:!0}),children:w.jsx(ne,{path:"/pdf/:paperId",element:c$()?w.jsx(S2,{}):w.jsx(Df,{})})}),w.jsxs(ne,{element:w.jsx(g0,{}),children:[w.jsx(ne,{path:"/",element:w.jsx(v0,{})}),w.jsx(ne,{path:"/following",element:w.jsx(_2,{})}),w.jsx(ne,{path:"/x-trending",element:w.jsx(v0,{xTrending:!0})}),w.jsx(ne,{path:"/chat/:sessionId?",element:Va()?w.jsx(w2,{}):w.jsx(co,{to:"/",replace:!0})}),w.jsx(ne,{path:"/share/:shareId",element:Va()?w.jsx(x2,{}):w.jsx(Df,{})}),w.jsx(ne,{path:"/papers",element:w.jsx(b2,{})}),w.jsx(ne,{path:"/papers/:arxivId",element:w.jsx(t3,{})}),w.jsx(ne,{path:"/paper/:arxivId",element:w.jsx(E2,{})}),w.jsx(ne,{path:"/tasks",element:w.jsx(C2,{})}),w.jsx(ne,{path:"/tasks/:taskSlug",element:w.jsx(k2,{})}),w.jsx(ne,{path:"/task/:taskSlug",element:w.jsx(n3,{})}),w.jsx(ne,{path:"/methods",element:w.jsx(P2,{})}),w.jsx(ne,{path:"/methods/:methodSlug",element:w.jsx(j2,{})}),w.jsx(ne,{path:"/frameworks",element:w.jsx(R2,{})}),w.jsx(ne,{path:"/trends",element:w.jsx(T2,{})}),w.jsx(ne,{path:"/conferences",element:w.jsx(I2,{})}),w.jsx(ne,{path:"/ai-deadlines",element:w.jsx(O2,{})}),w.jsx(ne,{path:"/conferences/:confSlug",element:w.jsx(M2,{})}),w.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(A2,{})}),w.jsx(ne,{path:"/organizations",element:w.jsx(N2,{})}),w.jsx(ne,{path:"/orgs/:orgSlug",element:w.jsx($2,{})}),w.jsx(ne,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(F2,{})}),w.jsx(ne,{path:"/authors/:authorId",element:w.jsx(L2,{})}),w.jsx(ne,{path:"/benchmark/:datasetSlug",element:w.jsx(D2,{})}),w.jsx(ne,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(y2,{})}),w.jsx(ne,{path:"/submit",element:w.jsx(H2,{})}),w.jsx(ne,{path:"/saved",element:w.jsx(r3,{element:w.jsx(z2,{})})}),w.jsx(ne,{path:"/settings",element:w.jsx(U2,{})}),w.jsx(ne,{path:"/privacy",element:w.jsx(V2,{})}),w.jsx(ne,{path:"/docs/api",element:w.jsx(B2,{})}),w.jsx(ne,{path:"/mcp",element:w.jsx(q2,{})}),w.jsx(ne,{path:"/admin-dashboard",element:w.jsx(i3,{})}),w.jsx(ne,{path:"/autonomous-operations",element:w.jsx(Lp,{element:w.jsx(G2,{})})}),w.jsx(ne,{path:"/cron-dashboard",element:w.jsx(co,{to:"/admin-dashboard",replace:!0})}),w.jsx(ne,{path:"/submissions",element:w.jsx(Lp,{element:w.jsx(K2,{})})}),w.jsx(ne,{path:"/rate-limits",element:w.jsx(Y2,{})}),w.jsx(ne,{path:"/astra-for-robotics",element:w.jsx(X2,{})}),w.jsx(ne,{path:"/:username",element:w.jsx(Q2,{})}),w.jsx(ne,{path:"*",element:w.jsx(Df,{})})]})]})),o3=()=>w.jsx(yA,{client:e3,children:w.jsx(OD,{children:w.jsxs(g2,{children:[w.jsx(m2,{children:w.jsx(s3,{})}),w.jsx(h2,{}),!1]})})});NO();const a3=w.jsx(NR,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(OE,{children:w.jsx(o3,{})})}),l3=Dx(document.getElementById("root"));l3.render(w.jsx(V.StrictMode,{children:a3}));export{k0 as $,Wi as A,at as B,vD as C,x3 as D,R3 as E,i1 as F,R1 as G,NS as H,YL as I,mD as J,cd as K,mn as L,V as M,p0 as N,c$ as O,gr as P,w3 as Q,QL as R,_D as S,f2 as T,wD as U,PC as V,Qn as W,yD as X,b3 as Y,_3 as Z,S3 as _,Ag as a,o$ as a0,oe as a1,QS as a2,gD as a3,el as a4,TD as a5,Sc as a6,FS as a7,u2 as a8,Fs as a9,KE as aA,hn as aB,za as aC,hA as aD,p3 as aE,iA as aF,XM as aG,xp as aH,YE as aI,QM as aJ,YM as aK,wp as aL,GE as aM,dA as aN,eA as aO,O3 as aP,M3 as aQ,gS as aR,og as aS,aS as aT,sg as aU,g3 as aV,v3 as aW,dg as aX,s0 as aY,ZN as aa,t$ as ab,n$ as ac,r$ as ad,oi as ae,s$ as af,i$ as ag,y3 as ah,co as ai,$L as aj,FL as ak,y1 as al,Zc as am,Jc as an,LL as ao,jL as ap,d3 as aq,c3 as ar,ID as as,C3 as at,t1 as au,n1 as av,r1 as aw,Yc as ax,wt as ay,h3 as az,an as b,tg as c,A3 as d,f3 as e,mA as f,Va as g,AS as h,yo as i,w as j,u$ as k,l$ as l,E3 as m,ud as n,P3 as o,VD as p,N3 as q,g as r,k3 as s,I3 as t,zE as u,Ee as v,Xc as w,Xe as x,J as y,RL as z}; diff --git a/assets/index-BaDZKp6X.js b/assets/index-CxPKwmVQ.js similarity index 72% rename from assets/index-BaDZKp6X.js rename to assets/index-CxPKwmVQ.js index fa218fe491651e837e8cb505f29dfd043421ec15..982b95c8e4c127abe12a34d68044bc7be8e05600 100644 --- a/assets/index-BaDZKp6X.js +++ b/assets/index-CxPKwmVQ.js @@ -1 +1 @@ -import{r as u}from"./index-YwiKC6Po.js";function o(r){const e=u.useRef({value:r,previous:r});return u.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; +import{r as u}from"./index-CbgxfyGU.js";function o(r){const e=u.useRef({value:r,previous:r});return u.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; diff --git a/assets/index-CoRCN2p0.js b/assets/index-ZkEATkOr.js similarity index 99% rename from assets/index-CoRCN2p0.js rename to assets/index-ZkEATkOr.js index 6bb49ee795a4413901a564b26dd433b7146ca39a..87cb5b1667954fa629fcff49c1a93ff50fd99763 100644 --- a/assets/index-CoRCN2p0.js +++ b/assets/index-ZkEATkOr.js @@ -1,4 +1,4 @@ -import{aq as We,_ as Ot,j as Ze}from"./index-YwiKC6Po.js";function hu(){}function mu(e){const n=[],t=String(e||"");let r=t.indexOf(","),i=0,l=!1;for(;!l;){r===-1&&(r=t.length,l=!0);const o=t.slice(i,r).trim();(o||!l)&&n.push(o),i=r+1,r=t.indexOf(",",i)}return n}function Ir(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Tr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ar=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pr={};function Vn(e,n){return(Pr.jsx?Ar:Tr).test(e)}const zr=/[ \t\n\f\r]/g;function Lr(e){return typeof e=="object"?e.type==="text"?qn(e.value):!1:qn(e)}function qn(e){return e.replace(zr,"")===""}class Me{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Me.prototype.normal={};Me.prototype.property={};Me.prototype.space=void 0;function _t(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Me(t,r,n)}function fn(e){return e.toLowerCase()}class J{constructor(n,t){this.attribute=t,this.property=n}}J.prototype.attribute="";J.prototype.booleanish=!1;J.prototype.boolean=!1;J.prototype.commaOrSpaceSeparated=!1;J.prototype.commaSeparated=!1;J.prototype.defined=!1;J.prototype.mustUseProperty=!1;J.prototype.number=!1;J.prototype.overloadedBoolean=!1;J.prototype.property="";J.prototype.spaceSeparated=!1;J.prototype.space=void 0;let vr=0;const z=be(),$=be(),hn=be(),k=be(),R=be(),Ie=be(),ee=be();function be(){return 2**++vr}const mn=Object.freeze(Object.defineProperty({__proto__:null,boolean:z,booleanish:$,commaOrSpaceSeparated:ee,commaSeparated:Ie,number:k,overloadedBoolean:hn,spaceSeparated:R},Symbol.toStringTag,{value:"Module"})),en=Object.keys(mn);class En extends J{constructor(n,t,r,i){let l=-1;if(super(n,t),$n(this,"space",i),typeof r=="number")for(;++l4&&t.slice(0,4)==="data"&&Fr.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Wn,Br);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Wn.test(l)){let o=l.replace(Nr,Mr);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=En}return new i(r,n)}function Mr(e){return"-"+e.toLowerCase()}function Br(e){return e.charAt(1).toUpperCase()}const jr=_t([Nt,Dr,Mt,Bt,jt],"html"),Cn=_t([Nt,Or,Mt,Bt,jt],"svg");function du(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function Hr(e){return e.join(" ").trim()}var In={},Yn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ur=/\n/g,Vr=/^\s*/,qr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$r=/^:\s*/,Wr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Yr=/^[;\s]*/,Xr=/^\s+|\s+$/g,Qr=` +import{ar as We,$ as Ot,j as Ze}from"./index-CbgxfyGU.js";function hu(){}function mu(e){const n=[],t=String(e||"");let r=t.indexOf(","),i=0,l=!1;for(;!l;){r===-1&&(r=t.length,l=!0);const o=t.slice(i,r).trim();(o||!l)&&n.push(o),i=r+1,r=t.indexOf(",",i)}return n}function Ir(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Tr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ar=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pr={};function Vn(e,n){return(Pr.jsx?Ar:Tr).test(e)}const zr=/[ \t\n\f\r]/g;function Lr(e){return typeof e=="object"?e.type==="text"?qn(e.value):!1:qn(e)}function qn(e){return e.replace(zr,"")===""}class Me{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Me.prototype.normal={};Me.prototype.property={};Me.prototype.space=void 0;function _t(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Me(t,r,n)}function fn(e){return e.toLowerCase()}class J{constructor(n,t){this.attribute=t,this.property=n}}J.prototype.attribute="";J.prototype.booleanish=!1;J.prototype.boolean=!1;J.prototype.commaOrSpaceSeparated=!1;J.prototype.commaSeparated=!1;J.prototype.defined=!1;J.prototype.mustUseProperty=!1;J.prototype.number=!1;J.prototype.overloadedBoolean=!1;J.prototype.property="";J.prototype.spaceSeparated=!1;J.prototype.space=void 0;let vr=0;const z=be(),$=be(),hn=be(),k=be(),R=be(),Ie=be(),ee=be();function be(){return 2**++vr}const mn=Object.freeze(Object.defineProperty({__proto__:null,boolean:z,booleanish:$,commaOrSpaceSeparated:ee,commaSeparated:Ie,number:k,overloadedBoolean:hn,spaceSeparated:R},Symbol.toStringTag,{value:"Module"})),en=Object.keys(mn);class En extends J{constructor(n,t,r,i){let l=-1;if(super(n,t),$n(this,"space",i),typeof r=="number")for(;++l4&&t.slice(0,4)==="data"&&Fr.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Wn,Br);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Wn.test(l)){let o=l.replace(Nr,Mr);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=En}return new i(r,n)}function Mr(e){return"-"+e.toLowerCase()}function Br(e){return e.charAt(1).toUpperCase()}const jr=_t([Nt,Dr,Mt,Bt,jt],"html"),Cn=_t([Nt,Or,Mt,Bt,jt],"svg");function du(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function Hr(e){return e.join(" ").trim()}var In={},Yn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ur=/\n/g,Vr=/^\s*/,qr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$r=/^:\s*/,Wr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Yr=/^[;\s]*/,Xr=/^\s+|\s+$/g,Qr=` `,Xn="/",Qn="*",ke="",Gr="comment",Kr="declaration";function Jr(e,n){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];n=n||{};var t=1,r=1;function i(y){var b=y.match(Ur);b&&(t+=b.length);var T=y.lastIndexOf(Qr);r=~T?y.length-T:r+y.length}function l(){var y={line:t,column:r};return function(b){return b.position=new o(y),c(),b}}function o(y){this.start=y,this.end={line:t,column:r},this.source=n.source}o.prototype.content=e;function a(y){var b=new Error(n.source+":"+t+":"+r+": "+y);if(b.reason=y,b.filename=n.source,b.line=t,b.column=r,b.source=e,!n.silent)throw b}function u(y){var b=y.exec(e);if(b){var T=b[0];return i(T),e=e.slice(T.length),b}}function c(){u(Vr)}function s(y){var b;for(y=y||[];b=f();)b!==!1&&y.push(b);return y}function f(){var y=l();if(!(Xn!=e.charAt(0)||Qn!=e.charAt(1))){for(var b=2;ke!=e.charAt(b)&&(Qn!=e.charAt(b)||Xn!=e.charAt(b+1));)++b;if(b+=2,ke===e.charAt(b-1))return a("End of comment missing");var T=e.slice(2,b-2);return r+=2,i(T),e=e.slice(b),r+=2,y({type:Gr,comment:T})}}function d(){var y=l(),b=u(qr);if(b){if(f(),!u($r))return a("property missing ':'");var T=u(Wr),w=y({type:Kr,property:Gn(b[0].replace(Yn,ke)),value:T?Gn(T[0].replace(Yn,ke)):ke});return u(Yr),w}}function p(){var y=[];s(y);for(var b;b=d();)b!==!1&&(y.push(b),s(y));return y}return c(),p()}function Gn(e){return e?e.replace(Xr,ke):ke}var Zr=Jr,ei=We&&We.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(In,"__esModule",{value:!0});In.default=ti;const ni=ei(Zr);function ti(e,n){let t=null;if(!e||typeof e!="string")return t;const r=(0,ni.default)(e),i=typeof n=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:a}=l;i?n(o,a,l):a&&(t=t||{},t[o]=a)}),t}var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.camelCase=void 0;var ri=/^--[a-zA-Z0-9_-]+$/,ii=/-([a-z])/g,li=/^[^-]+$/,oi=/^-(webkit|moz|ms|o|khtml)-/,ai=/^-(ms)-/,ui=function(e){return!e||li.test(e)||ri.test(e)},si=function(e,n){return n.toUpperCase()},Kn=function(e,n){return"".concat(n,"-")},ci=function(e,n){return n===void 0&&(n={}),ui(e)?e:(e=e.toLowerCase(),n.reactCompat?e=e.replace(ai,Kn):e=e.replace(oi,Kn),e.replace(ii,si))};Qe.camelCase=ci;var pi=We&&We.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},fi=pi(In),hi=Qe;function dn(e,n){var t={};return!e||typeof e!="string"||(0,fi.default)(e,function(r,i){r&&i&&(t[(0,hi.camelCase)(r,n)]=i)}),t}dn.default=dn;var mi=dn;const di=Ot(mi),Ht=Ut("end"),Tn=Ut("start");function Ut(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function gi(e){const n=Tn(e),t=Ht(e);if(n&&t)return{start:n,end:t}}function _e(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jn(e.position):"start"in e||"end"in e?Jn(e):"line"in e||"column"in e?gn(e):""}function gn(e){return Zn(e&&e.line)+":"+Zn(e&&e.column)}function Jn(e){return gn(e&&e.start)+"-"+gn(e&&e.end)}function Zn(e){return e&&typeof e=="number"?e:1}class Q extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(o=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=_e(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Q.prototype.file="";Q.prototype.name="";Q.prototype.reason="";Q.prototype.message="";Q.prototype.stack="";Q.prototype.column=void 0;Q.prototype.line=void 0;Q.prototype.ancestors=void 0;Q.prototype.cause=void 0;Q.prototype.fatal=void 0;Q.prototype.place=void 0;Q.prototype.ruleId=void 0;Q.prototype.source=void 0;const An={}.hasOwnProperty,yi=new Map,xi=/[A-Z]/g,ki=new Set(["table","tbody","thead","tfoot","tr"]),bi=new Set(["td","th"]),Vt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wi(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=zi(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Pi(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Cn:jr,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=qt(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function qt(e,n,t){if(n.type==="element")return Si(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Ei(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Ii(e,n,t);if(n.type==="mdxjsEsm")return Ci(e,n);if(n.type==="root")return Ti(e,n,t);if(n.type==="text")return Ai(e,n)}function Si(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Cn,e.schema=i),e.ancestors.push(n);const l=Wt(e,n.tagName,!1),o=Li(e,n);let a=zn(e,n);return ki.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Lr(u):!0})),$t(e,o,l,n),Pn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Ei(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Re(e,n.position)}function Ci(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Re(e,n.position)}function Ii(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Cn,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:Wt(e,n.name,!0),o=vi(e,n),a=zn(e,n);return $t(e,o,l,n),Pn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Ti(e,n,t){const r={};return Pn(r,zn(e,n)),e.create(n,e.Fragment,r,t)}function Ai(e,n){return n.value}function $t(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Pn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Pi(e,n,t){return r;function r(i,l,o,a){const c=Array.isArray(o.children)?t:n;return a?c(l,o,a):c(l,o)}}function zi(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),u=Tn(r);return n(i,l,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Li(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&An.call(n.properties,i)){const l=Di(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&bi.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function vi(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Re(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else Re(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function zn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:yi;for(;++ri?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l0?(se(e,e.length,0,n),e):n}const tt={}.hasOwnProperty;function ji(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Te(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ue=ge(/[A-Za-z]/),ne=ge(/[\dA-Za-z]/),Vi=ge(/[#-'*+\--9=?A-Z^-~]/);function yn(e){return e!==null&&(e<32||e===127)}const xn=ge(/\d/),qi=ge(/[\dA-Fa-f]/),$i=ge(/[!-/:-@[-`{-~]/);function A(e){return e!==null&&e<-2}function K(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const Wi=ge(new RegExp("\\p{P}|\\p{S}","u")),Yi=ge(/\s/);function ge(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Pe(e){const n=[];let t=-1,r=0,i=0;for(;++t55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function M(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(u){return O(u)?(e.enter(t),a(u)):n(u)}function a(u){return O(u)&&l++o))return;const _=n.events.length;let V=_,N,B;for(;V--;)if(n.events[V][0]==="exit"&&n.events[V][1].type==="chunkFlow"){if(N){B=n.events[V][1].end;break}N=!0}for(w(r),x=_;xE;){const U=t[j];n.containerState=U[1],U[0].exit.call(n,e)}t.length=E}function L(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Ji(e,n,t){return M(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function it(e){if(e===null||K(e)||Yi(e))return 1;if(Wi(e))return 2}function vn(e,n,t){const r=[];let i=-1;for(;++i1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const f={...e[r][1].end},d={...e[t][1].start};lt(f,-u),lt(d,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},l={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=te(c,[["enter",e[r][1],n],["exit",e[r][1],n]])),c=te(c,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),c=te(c,vn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),c=te(c,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(s=2,c=te(c,[["enter",e[t][1],n],["exit",e[t][1],n]])):s=0,se(e,r-1,t-r+3,c),t=r+c.length-s-2;break}}for(t=-1;++t0&&O(x)?M(e,L,"linePrefix",l+1)(x):L(x)}function L(x){return x===null||A(x)?e.check(ot,b,j)(x):(e.enter("codeFlowValue"),E(x))}function E(x){return x===null||A(x)?(e.exit("codeFlowValue"),L(x)):(e.consume(x),E)}function j(x){return e.exit("codeFenced"),n(x)}function U(x,_,V){let N=0;return B;function B(D){return x.enter("lineEnding"),x.consume(D),x.exit("lineEnding"),I}function I(D){return x.enter("codeFencedFence"),O(D)?M(x,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):C(D)}function C(D){return D===a?(x.enter("codeFencedFenceSequence"),H(D)):V(D)}function H(D){return D===a?(N++,x.consume(D),H):N>=o?(x.exit("codeFencedFenceSequence"),O(D)?M(x,q,"whitespace")(D):q(D)):V(D)}function q(D){return D===null||A(D)?(x.exit("codeFencedFence"),_(D)):V(D)}}}function cl(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const tn={name:"codeIndented",tokenize:fl},pl={partial:!0,tokenize:hl};function fl(e,n,t){const r=this;return i;function i(c){return e.enter("codeIndented"),M(e,l,"linePrefix",5)(c)}function l(c){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?o(c):t(c)}function o(c){return c===null?u(c):A(c)?e.attempt(pl,o,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||A(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),n(c)}}function hl(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):A(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):M(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):A(o)?i(o):t(o)}}const ml={name:"codeText",previous:gl,resolve:dl,tokenize:yl};function dl(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&De(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),De(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),De(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function Zt(e,n,t,r,i,l,o,a,u){const c=u||Number.POSITIVE_INFINITY;let s=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(w),e.exit(l),d):w===null||w===32||w===41||yn(w)?t(w):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(w))}function d(w){return w===62?(e.enter(l),e.consume(w),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),d(w)):w===null||w===60||A(w)?t(w):(e.consume(w),w===92?y:p)}function y(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function b(w){return!s&&(w===null||w===41||K(w))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(w)):s999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(p):p===93?(e.exit(l),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):A(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||A(p)||a++>999?(e.exit("chunkString"),s(p)):(e.consume(p),u||(u=!O(p)),p===92?d:f)}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function nr(e,n,t,r,i,l){let o;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),o=d===40?41:d,u):t(d)}function u(d){return d===o?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):(e.enter(l),c(d))}function c(d){return d===o?(e.exit(l),u(o)):d===null?t(d):A(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),M(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(d))}function s(d){return d===o||d===null||A(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?f:s)}function f(d){return d===o||d===92?(e.consume(d),s):s(d)}}function Ne(e,n){let t;return r;function r(i){return A(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):O(i)?M(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Il={name:"definition",tokenize:Al},Tl={partial:!0,tokenize:Pl};function Al(e,n,t){const r=this;let i;return l;function l(p){return e.enter("definition"),o(p)}function o(p){return er.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Te(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):t(p)}function u(p){return K(p)?Ne(e,c)(p):c(p)}function c(p){return Zt(e,s,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function s(p){return e.attempt(Tl,f,f)(p)}function f(p){return O(p)?M(e,d,"whitespace")(p):d(p)}function d(p){return p===null||A(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Pl(e,n,t){return r;function r(a){return K(a)?Ne(e,i)(a):t(a)}function i(a){return nr(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return O(a)?M(e,o,"whitespace")(a):o(a)}function o(a){return a===null||A(a)?n(a):t(a)}}const zl={name:"hardBreakEscape",tokenize:Ll};function Ll(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return A(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const vl={name:"headingAtx",resolve:Dl,tokenize:Ol};function Dl(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},se(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function Ol(e,n,t){let r=0;return i;function i(s){return e.enter("atxHeading"),l(s)}function l(s){return e.enter("atxHeadingSequence"),o(s)}function o(s){return s===35&&r++<6?(e.consume(s),o):s===null||K(s)?(e.exit("atxHeadingSequence"),a(s)):t(s)}function a(s){return s===35?(e.enter("atxHeadingSequence"),u(s)):s===null||A(s)?(e.exit("atxHeading"),n(s)):O(s)?M(e,a,"whitespace")(s):(e.enter("atxHeadingText"),c(s))}function u(s){return s===35?(e.consume(s),u):(e.exit("atxHeadingSequence"),a(s))}function c(s){return s===null||s===35||K(s)?(e.exit("atxHeadingText"),a(s)):(e.consume(s),c)}}const _l=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ut=["pre","script","style","textarea"],Nl={concrete:!0,name:"htmlFlow",resolveTo:Ml,tokenize:Bl},Fl={partial:!0,tokenize:Hl},Rl={partial:!0,tokenize:jl};function Ml(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Bl(e,n,t){const r=this;let i,l,o,a,u;return c;function c(m){return s(m)}function s(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),f}function f(m){return m===33?(e.consume(m),d):m===47?(e.consume(m),l=!0,b):m===63?(e.consume(m),i=3,r.interrupt?n:h):ue(m)?(e.consume(m),o=String.fromCharCode(m),T):t(m)}function d(m){return m===45?(e.consume(m),i=2,p):m===91?(e.consume(m),i=5,a=0,y):ue(m)?(e.consume(m),i=4,r.interrupt?n:h):t(m)}function p(m){return m===45?(e.consume(m),r.interrupt?n:h):t(m)}function y(m){const le="CDATA[";return m===le.charCodeAt(a++)?(e.consume(m),a===le.length?r.interrupt?n:C:y):t(m)}function b(m){return ue(m)?(e.consume(m),o=String.fromCharCode(m),T):t(m)}function T(m){if(m===null||m===47||m===62||K(m)){const le=m===47,ye=o.toLowerCase();return!le&&!l&&ut.includes(ye)?(i=1,r.interrupt?n(m):C(m)):_l.includes(o.toLowerCase())?(i=6,le?(e.consume(m),w):r.interrupt?n(m):C(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):l?L(m):E(m))}return m===45||ne(m)?(e.consume(m),o+=String.fromCharCode(m),T):t(m)}function w(m){return m===62?(e.consume(m),r.interrupt?n:C):t(m)}function L(m){return O(m)?(e.consume(m),L):B(m)}function E(m){return m===47?(e.consume(m),B):m===58||m===95||ue(m)?(e.consume(m),j):O(m)?(e.consume(m),E):B(m)}function j(m){return m===45||m===46||m===58||m===95||ne(m)?(e.consume(m),j):U(m)}function U(m){return m===61?(e.consume(m),x):O(m)?(e.consume(m),U):E(m)}function x(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),u=m,_):O(m)?(e.consume(m),x):V(m)}function _(m){return m===u?(e.consume(m),u=null,N):m===null||A(m)?t(m):(e.consume(m),_)}function V(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||K(m)?U(m):(e.consume(m),V)}function N(m){return m===47||m===62||O(m)?E(m):t(m)}function B(m){return m===62?(e.consume(m),I):t(m)}function I(m){return m===null||A(m)?C(m):O(m)?(e.consume(m),I):t(m)}function C(m){return m===45&&i===2?(e.consume(m),X):m===60&&i===1?(e.consume(m),W):m===62&&i===4?(e.consume(m),ie):m===63&&i===3?(e.consume(m),h):m===93&&i===5?(e.consume(m),ce):A(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Fl,pe,H)(m)):m===null||A(m)?(e.exit("htmlFlowData"),H(m)):(e.consume(m),C)}function H(m){return e.check(Rl,q,pe)(m)}function q(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),D}function D(m){return m===null||A(m)?H(m):(e.enter("htmlFlowData"),C(m))}function X(m){return m===45?(e.consume(m),h):C(m)}function W(m){return m===47?(e.consume(m),o="",re):C(m)}function re(m){if(m===62){const le=o.toLowerCase();return ut.includes(le)?(e.consume(m),ie):C(m)}return ue(m)&&o.length<8?(e.consume(m),o+=String.fromCharCode(m),re):C(m)}function ce(m){return m===93?(e.consume(m),h):C(m)}function h(m){return m===62?(e.consume(m),ie):m===45&&i===2?(e.consume(m),h):C(m)}function ie(m){return m===null||A(m)?(e.exit("htmlFlowData"),pe(m)):(e.consume(m),ie)}function pe(m){return e.exit("htmlFlow"),n(m)}}function jl(e,n,t){const r=this;return i;function i(o){return A(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function Hl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ge,n,t)}}const Ul={name:"htmlText",tokenize:Vl};function Vl(e,n,t){const r=this;let i,l,o;return a;function a(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),u}function u(h){return h===33?(e.consume(h),c):h===47?(e.consume(h),U):h===63?(e.consume(h),E):ue(h)?(e.consume(h),V):t(h)}function c(h){return h===45?(e.consume(h),s):h===91?(e.consume(h),l=0,y):ue(h)?(e.consume(h),L):t(h)}function s(h){return h===45?(e.consume(h),p):t(h)}function f(h){return h===null?t(h):h===45?(e.consume(h),d):A(h)?(o=f,W(h)):(e.consume(h),f)}function d(h){return h===45?(e.consume(h),p):f(h)}function p(h){return h===62?X(h):h===45?d(h):f(h)}function y(h){const ie="CDATA[";return h===ie.charCodeAt(l++)?(e.consume(h),l===ie.length?b:y):t(h)}function b(h){return h===null?t(h):h===93?(e.consume(h),T):A(h)?(o=b,W(h)):(e.consume(h),b)}function T(h){return h===93?(e.consume(h),w):b(h)}function w(h){return h===62?X(h):h===93?(e.consume(h),w):b(h)}function L(h){return h===null||h===62?X(h):A(h)?(o=L,W(h)):(e.consume(h),L)}function E(h){return h===null?t(h):h===63?(e.consume(h),j):A(h)?(o=E,W(h)):(e.consume(h),E)}function j(h){return h===62?X(h):E(h)}function U(h){return ue(h)?(e.consume(h),x):t(h)}function x(h){return h===45||ne(h)?(e.consume(h),x):_(h)}function _(h){return A(h)?(o=_,W(h)):O(h)?(e.consume(h),_):X(h)}function V(h){return h===45||ne(h)?(e.consume(h),V):h===47||h===62||K(h)?N(h):t(h)}function N(h){return h===47?(e.consume(h),X):h===58||h===95||ue(h)?(e.consume(h),B):A(h)?(o=N,W(h)):O(h)?(e.consume(h),N):X(h)}function B(h){return h===45||h===46||h===58||h===95||ne(h)?(e.consume(h),B):I(h)}function I(h){return h===61?(e.consume(h),C):A(h)?(o=I,W(h)):O(h)?(e.consume(h),I):N(h)}function C(h){return h===null||h===60||h===61||h===62||h===96?t(h):h===34||h===39?(e.consume(h),i=h,H):A(h)?(o=C,W(h)):O(h)?(e.consume(h),C):(e.consume(h),q)}function H(h){return h===i?(e.consume(h),i=void 0,D):h===null?t(h):A(h)?(o=H,W(h)):(e.consume(h),H)}function q(h){return h===null||h===34||h===39||h===60||h===61||h===96?t(h):h===47||h===62||K(h)?N(h):(e.consume(h),q)}function D(h){return h===47||h===62||K(h)?N(h):t(h)}function X(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),n):t(h)}function W(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),re}function re(h){return O(h)?M(e,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):ce(h)}function ce(h){return e.enter("htmlTextData"),o(h)}}const Dn={name:"labelEnd",resolveAll:Yl,resolveTo:Xl,tokenize:Ql},ql={tokenize:Gl},$l={tokenize:Kl},Wl={tokenize:Jl};function Yl(e){let n=-1;const t=[];for(;++n=3&&(c===null||A(c))?(e.exit("thematicBreak"),n(c)):t(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),O(c)?M(e,a,"whitespace")(c):a(c))}}const G={continuation:{tokenize:uo},exit:co,name:"list",tokenize:ao},lo={partial:!0,tokenize:po},oo={partial:!0,tokenize:so};function ao(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const y=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:xn(p)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(qe,t,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return t(p)}function u(p){return xn(p)&&++o<10?(e.consume(p),u):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):t(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ge,r.interrupt?t:s,e.attempt(lo,d,f))}function s(p){return r.containerState.initialBlankLine=!0,l++,d(p)}function f(p){return O(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):t(p)}function d(p){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function uo(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ge,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,M(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(oo,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,M(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function so(e,n,t){const r=this;return M(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function co(e){e.exit(this.containerState.type)}function po(e,n,t){const r=this;return M(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!O(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const st={name:"setextUnderline",resolveTo:fo,tokenize:ho};function fo(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function ho(e,n,t){const r=this;let i;return l;function l(c){let s=r.events.length,f;for(;s--;)if(r.events[s][1].type!=="lineEnding"&&r.events[s][1].type!=="linePrefix"&&r.events[s][1].type!=="content"){f=r.events[s][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):t(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),O(c)?M(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||A(c)?(e.exit("setextHeadingLine"),n(c)):t(c)}}const mo={tokenize:go};function go(e){const n=this,t=e.attempt(Ge,r,e.attempt(this.parser.constructs.flowInitial,i,M(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bl,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const yo={resolveAll:rr()},xo=tr("string"),ko=tr("text");function tr(e){return{resolveAll:rr(e==="text"?bo:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(s){return c(s)?l(s):a(s)}function a(s){if(s===null){t.consume(s);return}return t.enter("data"),t.consume(s),u}function u(s){return c(s)?(t.exit("data"),l(s)):(t.consume(s),u)}function c(s){if(s===null)return!0;const f=i[s];let d=-1;if(f)for(;++d-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Oo(e,n){let t=-1;const r=[];let i;for(;++t0){const oe=P.tokenStack[P.tokenStack.length-1];(oe[1]||pt).call(P,void 0,oe[0])}for(S.position={start:de(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:de(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},F=-1;++Fi.jsx("input",{type:r,className:n("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...o}));d.displayName="Input";export{d as I}; +import{r as s,j as i,B as n}from"./index-CbgxfyGU.js";const d=s.forwardRef(({className:e,type:r,...o},t)=>i.jsx("input",{type:r,className:n("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...o}));d.displayName="Input";export{d as I}; diff --git a/assets/loader-circle-B0KtDERb.js b/assets/loader-circle-CWMja8Zn.js similarity index 85% rename from assets/loader-circle-B0KtDERb.js rename to assets/loader-circle-CWMja8Zn.js index e5deabb1e31cafe47c0e3c85a68295079f653404..83cb8862e35b13258ccfd93ddc1d0034fe77b99f 100644 --- a/assets/loader-circle-B0KtDERb.js +++ b/assets/loader-circle-CWMja8Zn.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-YwiKC6Po.js";/** +import{n as e}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/moon-DfjUzC9G.js b/assets/moon-BVv5zopc.js similarity index 85% rename from assets/moon-DfjUzC9G.js rename to assets/moon-BVv5zopc.js index 3f7c1ec5de4e8d940a848aff3023daca7a429c51..8090737c096a0de8de3a47023eee4467ba9f010c 100644 --- a/assets/moon-DfjUzC9G.js +++ b/assets/moon-BVv5zopc.js @@ -1,4 +1,4 @@ -import{n as o}from"./index-YwiKC6Po.js";/** +import{n as o}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-BT3NQ0bL.js b/assets/openrouter-DiuY1sPP.js similarity index 82% rename from assets/openrouter-BT3NQ0bL.js rename to assets/openrouter-DiuY1sPP.js index 0775dfb667cb76a03e36a24d5712660292da4b5f..5d3588a6ee8f5050234a4a7fa43cc314e8493929 100644 --- a/assets/openrouter-BT3NQ0bL.js +++ b/assets/openrouter-DiuY1sPP.js @@ -1 +1 @@ -import{u as r}from"./useQuery-DPH6Mb2w.js";import{c as n}from"./chat-DHGOonJg.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{o as O,s as a,m as r,c as u}; +import{u as r}from"./useQuery-Bx9s5-D2.js";import{c as n}from"./chat-DzTo2WUO.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{o as O,s as a,m as r,c as u}; diff --git a/assets/paperEdits-B8a9u4Tx.js b/assets/paperEdits-C5GTaRR8.js similarity index 84% rename from assets/paperEdits-B8a9u4Tx.js rename to assets/paperEdits-C5GTaRR8.js index b7dd0f22d04432950cdbbf5bbc41f1df68cdc93d..d5ad3906c86ca4dacefadbc8a19e121261169fbf 100644 --- a/assets/paperEdits-B8a9u4Tx.js +++ b/assets/paperEdits-C5GTaRR8.js @@ -1 +1 @@ -import{a5 as p}from"./index-YwiKC6Po.js";const a={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),digest:(e,t)=>p(`/admin/paper-edit-digest?day=${e}&page=${t}`),suspend:(e,t)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:t})})};export{a as p}; +import{a6 as p}from"./index-CbgxfyGU.js";const a={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),digest:(e,t)=>p(`/admin/paper-edit-digest?day=${e}&page=${t}`),suspend:(e,t)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:t})})};export{a as p}; diff --git a/assets/paperQueryKeys-C5FMa4Oj.js b/assets/paperQueryKeys-B8u1BWlI.js similarity index 97% rename from assets/paperQueryKeys-C5FMa4Oj.js rename to assets/paperQueryKeys-B8u1BWlI.js index 498ee062e894cd60b9392f2c51b3d97560437cab..0ffe2783734292c6f7331445e5db0343fbfce214 100644 --- a/assets/paperQueryKeys-C5FMa4Oj.js +++ b/assets/paperQueryKeys-B8u1BWlI.js @@ -1 +1 @@ -import{p as n}from"./curation-CkzNFTMJ.js";import{a5 as c,aO as h,aP as m}from"./index-YwiKC6Po.js";function p(a){const e=new URLSearchParams;for(const[t,s]of Object.entries(a??{}))s!==void 0&&s!==""&&e.set(t,String(s));const r=e.toString();return r?`?${r}`:""}class d{constructor(e){this.request=e}list(e){const r=new URLSearchParams;for(const[s,i]of Object.entries(e??{}))i!==void 0&&i!==""&&r.set(s,String(i));const t=r.toString();return this.request(`/papers/${t?`?${t}`:""}`,{cache:"no-cache"})}search(e,r=1,t=10,s,i,o){const u=new URLSearchParams({q:e,page:r.toString(),page_size:t.toString()});return s&&u.set("mode",s),o!=null&&o.start_date&&u.set("start_date",o.start_date),o!=null&&o.end_date&&u.set("end_date",o.end_date),this.request(`/papers/search?${u.toString()}`,{signal:i})}searchFeed(e){return this.request(`/papers/search/feed${p(e)}`,{cache:"no-cache"})}get(e,r=!0){const t=r?"?include_resources=true":"";return this.request(`/papers/${e}${t}`)}getByArxivId(e,r=!0){const t=r?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${t}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,r=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${r}`)}suggestedQuestions(e){return this.request(`/papers/${encodeURIComponent(e)}/suggested-questions`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,r){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(r)})}trending(e){const r=new URLSearchParams;for(const[s,i]of Object.entries(e??{}))i!==void 0&&r.set(s,String(i));const t=r.toString();return this.request(`/papers/trending${t?`?${t}`:""}`,{cache:"no-store"})}xTrending(e){return this.request(`/papers/x-trending${p(e)}`)}forTask(e,r){return this.request(`/tasks/${e}/papers${p(r)}`)}forMethod(e,r){return this.request(`/methods/${encodeURIComponent(e)}/papers${p(r)}`)}forConference(e,r){return this.request(`/conferences/${e}/papers${p(r)}`)}forOrganization(e,r){return this.request(`/organizations/${e}/papers${p(r)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,r){return this.request(`/authors/${p({search:e,page_size:r})}`)}primeCurationState(e,r=!1){return n.primePaper(e,r)}freshAuthMutationDraft(){return n.freshAuthMutationDraft()}resumeFreshAuthMutation(){return n.resumeFreshAuthMutation()}updateTasks(e,r){const t=new URLSearchParams(r.map(s=>["task_ids",String(s)])).toString();return n.mutatePaper(e,"tasks",r,`/papers/${e}/tasks?${t}`,{method:"PUT"})}updateMethods(e,r){const t=new URLSearchParams(r.map(s=>["method_ids",String(s)])).toString();return n.mutatePaper(e,"methods",r,`/papers/${e}/methods?${t}`,{method:"PUT"})}updateOrganizations(e,r){const t=new URLSearchParams(r.map(s=>["organization_ids",String(s)])).toString();return n.mutatePaper(e,"organizations",r,`/papers/${e}/organizations?${t}`,{method:"PUT"})}updateRepositories(e,r){return n.mutatePaper(e,"repositories",r,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:r})})}updateProjectPages(e,r){return n.mutatePaper(e,"project_pages",r,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:r})})}updateXThreads(e,r){return n.mutatePaper(e,"x_threads",r,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:r})})}updateSourceUrl(e,r){return n.mutatePaper(e,"source_url",r,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:r})})}updateHfArtifacts(e,r){return n.mutatePaper(e,"hf_artifacts",r,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(r)})}}const $=new d(c);async function y(a){return(await h(`/papers/${encodeURIComponent(a)}/web-markdown`)).text()}function P(a){return m(`/papers/${encodeURIComponent(a)}/layout`)}const S={detail:a=>["paper",a],arxiv:a=>["paper-arxiv",a],preview:a=>["paper-preview",a],summary:a=>["paper-summary",a],feeds:{list:["papers"],infinite:["papers-infinite"],xTrending:["x-trending-papers-infinite"],following:["research-feed"],search:["paper-search-feed"],task:["task-papers-infinite"],conference:["conference-papers-infinite"],organization:["organization-papers-infinite"],method:["method-papers-infinite"],saved:["my-bookmarks"],related:["related-papers"],versions:["paper-versions"],searchOverlay:["search-papers"],mentions:["chat-paper-mention-search"],trending:["trending-papers"]}};export{$ as a,P as b,y as g,S as p}; +import{p as n}from"./curation-C7Gmmp4z.js";import{a6 as c,aP as h,aQ as m}from"./index-CbgxfyGU.js";function p(a){const e=new URLSearchParams;for(const[t,s]of Object.entries(a??{}))s!==void 0&&s!==""&&e.set(t,String(s));const r=e.toString();return r?`?${r}`:""}class d{constructor(e){this.request=e}list(e){const r=new URLSearchParams;for(const[s,i]of Object.entries(e??{}))i!==void 0&&i!==""&&r.set(s,String(i));const t=r.toString();return this.request(`/papers/${t?`?${t}`:""}`,{cache:"no-cache"})}search(e,r=1,t=10,s,i,o){const u=new URLSearchParams({q:e,page:r.toString(),page_size:t.toString()});return s&&u.set("mode",s),o!=null&&o.start_date&&u.set("start_date",o.start_date),o!=null&&o.end_date&&u.set("end_date",o.end_date),this.request(`/papers/search?${u.toString()}`,{signal:i})}searchFeed(e){return this.request(`/papers/search/feed${p(e)}`,{cache:"no-cache"})}get(e,r=!0){const t=r?"?include_resources=true":"";return this.request(`/papers/${e}${t}`)}getByArxivId(e,r=!0){const t=r?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${t}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,r=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${r}`)}suggestedQuestions(e){return this.request(`/papers/${encodeURIComponent(e)}/suggested-questions`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,r){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(r)})}trending(e){const r=new URLSearchParams;for(const[s,i]of Object.entries(e??{}))i!==void 0&&r.set(s,String(i));const t=r.toString();return this.request(`/papers/trending${t?`?${t}`:""}`,{cache:"no-store"})}xTrending(e){return this.request(`/papers/x-trending${p(e)}`)}forTask(e,r){return this.request(`/tasks/${e}/papers${p(r)}`)}forMethod(e,r){return this.request(`/methods/${encodeURIComponent(e)}/papers${p(r)}`)}forConference(e,r){return this.request(`/conferences/${e}/papers${p(r)}`)}forOrganization(e,r){return this.request(`/organizations/${e}/papers${p(r)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,r){return this.request(`/authors/${p({search:e,page_size:r})}`)}primeCurationState(e,r=!1){return n.primePaper(e,r)}freshAuthMutationDraft(){return n.freshAuthMutationDraft()}resumeFreshAuthMutation(){return n.resumeFreshAuthMutation()}updateTasks(e,r){const t=new URLSearchParams(r.map(s=>["task_ids",String(s)])).toString();return n.mutatePaper(e,"tasks",r,`/papers/${e}/tasks?${t}`,{method:"PUT"})}updateMethods(e,r){const t=new URLSearchParams(r.map(s=>["method_ids",String(s)])).toString();return n.mutatePaper(e,"methods",r,`/papers/${e}/methods?${t}`,{method:"PUT"})}updateOrganizations(e,r){const t=new URLSearchParams(r.map(s=>["organization_ids",String(s)])).toString();return n.mutatePaper(e,"organizations",r,`/papers/${e}/organizations?${t}`,{method:"PUT"})}updateRepositories(e,r){return n.mutatePaper(e,"repositories",r,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:r})})}updateProjectPages(e,r){return n.mutatePaper(e,"project_pages",r,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:r})})}updateXThreads(e,r){return n.mutatePaper(e,"x_threads",r,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:r})})}updateSourceUrl(e,r){return n.mutatePaper(e,"source_url",r,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:r})})}updateHfArtifacts(e,r){return n.mutatePaper(e,"hf_artifacts",r,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(r)})}}const $=new d(c);async function y(a){return(await h(`/papers/${encodeURIComponent(a)}/web-markdown`)).text()}function P(a){return m(`/papers/${encodeURIComponent(a)}/layout`)}const S={detail:a=>["paper",a],arxiv:a=>["paper-arxiv",a],preview:a=>["paper-preview",a],summary:a=>["paper-summary",a],feeds:{list:["papers"],infinite:["papers-infinite"],xTrending:["x-trending-papers-infinite"],following:["research-feed"],search:["paper-search-feed"],task:["task-papers-infinite"],conference:["conference-papers-infinite"],organization:["organization-papers-infinite"],method:["method-papers-infinite"],saved:["my-bookmarks"],related:["related-papers"],versions:["paper-versions"],searchOverlay:["search-papers"],mentions:["chat-paper-mention-search"],trending:["trending-papers"]}};export{$ as a,P as b,y as g,S as p}; diff --git a/assets/plus-Cfz0QbT1.js b/assets/plus-UK0TEjgd.js similarity index 86% rename from assets/plus-Cfz0QbT1.js rename to assets/plus-UK0TEjgd.js index 59c6864aae7c17678961794776c70498227a99b5..e89d9456741821a7bdee56982ca831e26605472a 100644 --- a/assets/plus-Cfz0QbT1.js +++ b/assets/plus-UK0TEjgd.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-YwiKC6Po.js";/** +import{n as e}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/popover-D7ygxg37.js b/assets/popover-D7ygxg37.js deleted file mode 100644 index 7d1eaf078d7b6f0778a89c88a68f572c7d845aca..0000000000000000000000000000000000000000 --- a/assets/popover-D7ygxg37.js +++ /dev/null @@ -1 +0,0 @@ -import{r as s,j as l,ad as V,v as $,ai as L,a8 as W,w as A,t as O,x as h,aj as E,ak as y,P as _,al as H,z,aQ as G,aR as B,aS as K,aT as Z,am as Q,an as U,ao as q,A as J}from"./index-YwiKC6Po.js";function X(e){const t=Y(e),r=s.forwardRef((n,o)=>{const{children:a,...c}=n,i=s.Children.toArray(a),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=s.forwardRef((r,n)=>{const{children:o,...a}=r;if(s.isValidElement(o)){const c=re(o),i=te(a,o.props);return o.type!==s.Fragment&&(i.ref=n?V(n,c):c),s.cloneElement(o,i)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ee}function te(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const p=a(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function re(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C="Popover",[b]=z(C,[y]),m=y(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:c=!1}=e,i=m(t),p=s.useRef(null),[u,P]=s.useState(!1),[f,v]=$({prop:n,defaultProp:o??!1,onChange:a,caller:C});return l.jsx(L,{...i,children:l.jsx(ne,{scope:t,contentId:W(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>P(!0),[]),onCustomAnchorRemove:s.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",ae=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),a=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return s.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...a,...n,ref:t})});ae.displayName=w;var S="PopoverTrigger",N=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),a=m(r),c=A(t,o.triggerRef),i=l.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":M(o.open),...n,ref:c,onClick:h(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(E,{asChild:!0,...a,children:i})});N.displayName=S;var R="PopoverPortal",[se,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=d(R,t);return l.jsx(se,{scope:t,forceMount:r,children:l.jsx(_,{present:r||a.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=s.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=d(g,e.__scopePopover);return l.jsx(_,{present:n||a.open,children:a.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(null),o=A(t,n),a=s.useRef(!1);return s.useEffect(()=>{const c=n.current;if(c)return G(c)},[]),l.jsx(B,{as:ie,allowPinchZoom:!0,children:l.jsx(I,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),a.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(!1),o=s.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),I=s.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return K(),l.jsx(Z,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:l.jsx(Q,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:P,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(U,{"data-state":M(v.open),role:"dialog",id:v.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ue=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(O.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(q,{...o,...n,ref:t})});fe.displayName=de;function M(e){return e?"open":"closed"}var ve=j,Pe=N,ge=F,k=D;const Ce=ve,xe=Pe,he=s.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>l.jsx(ge,{children:l.jsx(k,{ref:o,align:t,sideOffset:r,className:J("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));he.displayName=k.displayName;export{Ce as P,xe as a,he as b}; diff --git a/assets/popover-DKJYnYjk.js b/assets/popover-DKJYnYjk.js new file mode 100644 index 0000000000000000000000000000000000000000..1be5c8318a969bccf1be2637e68d881178206dbb --- /dev/null +++ b/assets/popover-DKJYnYjk.js @@ -0,0 +1 @@ +import{r as s,j as l,ae as V,w as $,aj as L,a9 as W,x as A,v as O,y as h,ak as y,al as E,P as _,am as H,A as z,aR as B,aS as G,aT as K,aU as U,an as Z,ao as q,ap as J,B as Q}from"./index-CbgxfyGU.js";function X(e){const t=Y(e),r=s.forwardRef((n,o)=>{const{children:a,...c}=n,i=s.Children.toArray(a),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=s.forwardRef((r,n)=>{const{children:o,...a}=r;if(s.isValidElement(o)){const c=re(o),i=te(a,o.props);return o.type!==s.Fragment&&(i.ref=n?V(n,c):c),s.cloneElement(o,i)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ee}function te(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const p=a(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function re(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C="Popover",[b]=z(C,[E]),m=E(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:c=!1}=e,i=m(t),p=s.useRef(null),[u,P]=s.useState(!1),[f,v]=$({prop:n,defaultProp:o??!1,onChange:a,caller:C});return l.jsx(L,{...i,children:l.jsx(ne,{scope:t,contentId:W(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>P(!0),[]),onCustomAnchorRemove:s.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",ae=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),a=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return s.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(y,{...a,...n,ref:t})});ae.displayName=w;var S="PopoverTrigger",N=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),a=m(r),c=A(t,o.triggerRef),i=l.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":M(o.open),...n,ref:c,onClick:h(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(y,{asChild:!0,...a,children:i})});N.displayName=S;var R="PopoverPortal",[se,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=d(R,t);return l.jsx(se,{scope:t,forceMount:r,children:l.jsx(_,{present:r||a.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=s.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=d(g,e.__scopePopover);return l.jsx(_,{present:n||a.open,children:a.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(null),o=A(t,n),a=s.useRef(!1);return s.useEffect(()=>{const c=n.current;if(c)return B(c)},[]),l.jsx(G,{as:ie,allowPinchZoom:!0,children:l.jsx(I,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),a.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(!1),o=s.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),I=s.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return K(),l.jsx(U,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:l.jsx(Z,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:P,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(q,{"data-state":M(v.open),role:"dialog",id:v.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ue=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(O.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(J,{...o,...n,ref:t})});fe.displayName=de;function M(e){return e?"open":"closed"}var ve=j,Pe=N,ge=F,k=D;const Ce=ve,xe=Pe,he=s.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>l.jsx(ge,{children:l.jsx(k,{ref:o,align:t,sideOffset:r,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));he.displayName=k.displayName;export{Ce as P,xe as a,he as b}; diff --git a/assets/queryInvalidation-Dgyv9_oM.js b/assets/queryInvalidation-Chlw4DEx.js similarity index 94% rename from assets/queryInvalidation-Dgyv9_oM.js rename to assets/queryInvalidation-Chlw4DEx.js index 22daf6bd4ebddea20e411c99a316a30292bb95ec..0ef49180c50116482e3f2e61739fa7ddde173698 100644 --- a/assets/queryInvalidation-Dgyv9_oM.js +++ b/assets/queryInvalidation-Chlw4DEx.js @@ -1 +1 @@ -import{p as a}from"./paperQueryKeys-C5FMa4Oj.js";function o(e,s,n){if(!e)return e;const i=r=>r.paper_id!==s||r.paper_title===n?r:{...r,paper_title:n};if(Array.isArray(e)){const r=e.map(i);return r.some((t,u)=>t!==e[u])?r:e}if(Array.isArray(e.results)){const r=e.results.map(i);return r.some((t,u)=>t!==e.results[u])?{...e,results:r}:e}return e}function v(e,s){const n=new Set(s.filter(i=>!!i));for(const i of n)for(const r of[a.detail(i),a.arxiv(i),a.preview(i),a.summary(i)])e.invalidateQueries({queryKey:r,exact:!0})}function f(e){for(const s of Object.values(a.feeds))e.invalidateQueries({queryKey:s,refetchType:"none"})}function p(e,s,n){new Set([...n,s.id,s.arxiv_id].filter(t=>!!t)).forEach(t=>{e.setQueryData(a.detail(t),s),e.setQueryData(a.arxiv(t),s),e.setQueriesData({queryKey:a.preview(t),exact:!0},s),e.setQueriesData({queryKey:a.summary(t),exact:!0},s)}),f(e);const r=String(s.id),c=t=>o(t,r,s.title);e.setQueriesData({queryKey:["evaluations"]},c),e.setQueriesData({queryKey:["dataset-evals"]},c),e.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),e.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}export{f as a,v as i,p as r}; +import{p as a}from"./paperQueryKeys-B8u1BWlI.js";function o(e,s,n){if(!e)return e;const i=r=>r.paper_id!==s||r.paper_title===n?r:{...r,paper_title:n};if(Array.isArray(e)){const r=e.map(i);return r.some((t,u)=>t!==e[u])?r:e}if(Array.isArray(e.results)){const r=e.results.map(i);return r.some((t,u)=>t!==e.results[u])?{...e,results:r}:e}return e}function v(e,s){const n=new Set(s.filter(i=>!!i));for(const i of n)for(const r of[a.detail(i),a.arxiv(i),a.preview(i),a.summary(i)])e.invalidateQueries({queryKey:r,exact:!0})}function f(e){for(const s of Object.values(a.feeds))e.invalidateQueries({queryKey:s,refetchType:"none"})}function p(e,s,n){new Set([...n,s.id,s.arxiv_id].filter(t=>!!t)).forEach(t=>{e.setQueryData(a.detail(t),s),e.setQueryData(a.arxiv(t),s),e.setQueriesData({queryKey:a.preview(t),exact:!0},s),e.setQueriesData({queryKey:a.summary(t),exact:!0},s)}),f(e);const r=String(s.id),c=t=>o(t,r,s.title);e.setQueriesData({queryKey:["evaluations"]},c),e.setQueriesData({queryKey:["dataset-evals"]},c),e.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),e.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}export{f as a,v as i,p as r}; diff --git a/assets/refresh-cw-4AZFTXDl.js b/assets/refresh-cw-Cps6nypW.js similarity index 94% rename from assets/refresh-cw-4AZFTXDl.js rename to assets/refresh-cw-Cps6nypW.js index 45785330d9b3939cb5562ab8f8d61097e08867d0..11b2b5f6cf0910103a8221e57cfb67939bfa2ca2 100644 --- a/assets/refresh-cw-4AZFTXDl.js +++ b/assets/refresh-cw-Cps6nypW.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-YwiKC6Po.js";/** +import{n as e}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/research-5UpiU-ea.js b/assets/research-DgpyzSy_.js similarity index 91% rename from assets/research-5UpiU-ea.js rename to assets/research-DgpyzSy_.js index a6f314e896b65ab72682a130b8ac4e30dd582e0f..0e0ca8e0543f55038b9a6d62dba385128db99e04 100644 --- a/assets/research-5UpiU-ea.js +++ b/assets/research-DgpyzSy_.js @@ -1 +1 @@ -import{a5 as t}from"./index-YwiKC6Po.js";const i=300,m={follows:()=>t("/me/follows"),followSuggestions:()=>t("/research/follow-suggestions"),setFollow:(o,e,a)=>t(`/me/follows/${o}/${e}`,{method:a?"PUT":"DELETE"}),following:(o=0,e={})=>{const a=new URLSearchParams({offset:String(o),limit:"40"});return e.startDate&&a.set("start_date",e.startDate),e.endDate&&a.set("end_date",e.endDate),!e.startDate&&!e.endDate&&a.set("all_time","true"),e.topicOnly&&a.set("topic_only","true"),t(`/me/following?${a}`)},topic:()=>t("/me/topic"),setTopic:o=>t("/me/topic",{method:"PUT",body:JSON.stringify({text:o})}),clearTopic:()=>t("/me/topic",{method:"DELETE"}),email:()=>t("/me/research-email"),setEmail:o=>t("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:o})})};export{i as T,m as r}; +import{a6 as t}from"./index-CbgxfyGU.js";const i=300,m={follows:()=>t("/me/follows"),followSuggestions:()=>t("/research/follow-suggestions"),setFollow:(o,e,a)=>t(`/me/follows/${o}/${e}`,{method:a?"PUT":"DELETE"}),following:(o=0,e={})=>{const a=new URLSearchParams({offset:String(o),limit:"40"});return e.startDate&&a.set("start_date",e.startDate),e.endDate&&a.set("end_date",e.endDate),!e.startDate&&!e.endDate&&a.set("all_time","true"),e.topicOnly&&a.set("topic_only","true"),t(`/me/following?${a}`)},topic:()=>t("/me/topic"),setTopic:o=>t("/me/topic",{method:"PUT",body:JSON.stringify({text:o})}),clearTopic:()=>t("/me/topic",{method:"DELETE"}),email:()=>t("/me/research-email"),setEmail:o=>t("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:o})})};export{i as T,m as r}; diff --git a/assets/researchTopic-CAL_T-Y-.js b/assets/researchTopic-CteUev4M.js similarity index 91% rename from assets/researchTopic-CAL_T-Y-.js rename to assets/researchTopic-CteUev4M.js index 32400b0992d900e6674022507c05496a96a8d70c..05d6e46d9f0bd5a90155fcadec3c65f3f5d5b584 100644 --- a/assets/researchTopic-CAL_T-Y-.js +++ b/assets/researchTopic-CteUev4M.js @@ -1 +1 @@ -import{d as u,f}from"./index-YwiKC6Po.js";import{u as d}from"./useMutation-f6iDkf3w.js";import{r as a}from"./research-5UpiU-ea.js";function y(e){var n;const s=(n=u())==null?void 0:n.user,t=f();return d({mutationFn:async o=>o===null?(await a.clearTopic(),null):a.setTopic(o),onSuccess:o=>{t.setQueryData(["research-topic",s==null?void 0:s.hf_subject],o),m(),e==null||e(),t.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]}),t.invalidateQueries({queryKey:["research-email",s==null?void 0:s.hf_subject]})}})}const r="pwc:following-pending-topic";function S(e){sessionStorage.setItem(r,e)}function v(){return sessionStorage.getItem(r)}function m(){sessionStorage.removeItem(r)}function P(){var t;const e=(t=u())==null?void 0:t.user,s=f();return d({mutationFn:async n=>{const l=(await Promise.allSettled(n.map(i=>a.setFollow(i.kind,i.id,i.follow??!0)))).find(i=>i.status==="rejected");if(l)throw l.reason},onSuccess:()=>g(),onSettled:()=>{s.invalidateQueries({queryKey:["research-follows",e==null?void 0:e.hf_subject]}),s.invalidateQueries({queryKey:["research-feed",e==null?void 0:e.hf_subject]}),s.invalidateQueries({queryKey:["research-email",e==null?void 0:e.hf_subject]})}})}const c="pwc:following-pending-follows";function _(e){sessionStorage.setItem(c,JSON.stringify(e))}function I(){return JSON.parse(sessionStorage.getItem(c)??"[]")}function g(){sessionStorage.removeItem(c)}export{P as a,_ as b,I as c,m as d,v as r,S as s,y as u}; +import{d as u,f}from"./index-CbgxfyGU.js";import{u as d}from"./useMutation-P_trTy9i.js";import{r as a}from"./research-DgpyzSy_.js";function y(e){var n;const s=(n=u())==null?void 0:n.user,t=f();return d({mutationFn:async o=>o===null?(await a.clearTopic(),null):a.setTopic(o),onSuccess:o=>{t.setQueryData(["research-topic",s==null?void 0:s.hf_subject],o),m(),e==null||e(),t.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]}),t.invalidateQueries({queryKey:["research-email",s==null?void 0:s.hf_subject]})}})}const r="pwc:following-pending-topic";function S(e){sessionStorage.setItem(r,e)}function v(){return sessionStorage.getItem(r)}function m(){sessionStorage.removeItem(r)}function P(){var t;const e=(t=u())==null?void 0:t.user,s=f();return d({mutationFn:async n=>{const l=(await Promise.allSettled(n.map(i=>a.setFollow(i.kind,i.id,i.follow??!0)))).find(i=>i.status==="rejected");if(l)throw l.reason},onSuccess:()=>g(),onSettled:()=>{s.invalidateQueries({queryKey:["research-follows",e==null?void 0:e.hf_subject]}),s.invalidateQueries({queryKey:["research-feed",e==null?void 0:e.hf_subject]}),s.invalidateQueries({queryKey:["research-email",e==null?void 0:e.hf_subject]})}})}const c="pwc:following-pending-follows";function _(e){sessionStorage.setItem(c,JSON.stringify(e))}function I(){return JSON.parse(sessionStorage.getItem(c)??"[]")}function g(){sessionStorage.removeItem(c)}export{P as a,_ as b,I as c,m as d,v as r,S as s,y as u}; diff --git a/assets/savedPapersAuth-k5u0Ozsk.js b/assets/savedPapersAuth-DsQUuWa_.js similarity index 75% rename from assets/savedPapersAuth-k5u0Ozsk.js rename to assets/savedPapersAuth-DsQUuWa_.js index d745433960a0880bbd97c3818b5f9665facd08a9..79881fdc854827d7bb5da3a0f2c8be81e370d5d6 100644 --- a/assets/savedPapersAuth-k5u0Ozsk.js +++ b/assets/savedPapersAuth-DsQUuWa_.js @@ -1 +1 @@ -import{h as a}from"./index-YwiKC6Po.js";const t="saved_papers_authorized";function o(r=!1){const e=new URL(window.location.href);return r&&e.searchParams.set(t,"1"),a(`${e.pathname}${e.search}${e.hash}`,{authorizeBucket:!0,bucketCreate:!0})}export{t as S,o as s}; +import{h as a}from"./index-CbgxfyGU.js";const t="saved_papers_authorized";function o(r=!1){const e=new URL(window.location.href);return r&&e.searchParams.set(t,"1"),a(`${e.pathname}${e.search}${e.hash}`,{authorizeBucket:!0,bucketCreate:!0})}export{t as S,o as s}; diff --git a/assets/search-wcEXdf1i.js b/assets/search-CLtAJGOp.js similarity index 87% rename from assets/search-wcEXdf1i.js rename to assets/search-CLtAJGOp.js index db1580c61f2f2b3277f4b2d4a8c8595b481620dc..c718175606d071789d8db74d5375176429e8d97d 100644 --- a/assets/search-wcEXdf1i.js +++ b/assets/search-CLtAJGOp.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-YwiKC6Po.js";/** +import{n as e}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/searchable-select-Bqfyxu17.js b/assets/searchable-select-DNdBIahG.js similarity index 91% rename from assets/searchable-select-Bqfyxu17.js rename to assets/searchable-select-DNdBIahG.js index 31dd203734465e5941ca076f06edb1adb08c67fe..9129e7d290cfc850cbd5ccab0079f4a55466dda4 100644 --- a/assets/searchable-select-Bqfyxu17.js +++ b/assets/searchable-select-DNdBIahG.js @@ -1,6 +1,6 @@ -import{n as Ae,r as a,a8 as Q,t as L,a9 as Me,aa as De,ab as $e,ac as Le,ad as H,j as p,A as D,C as Pe}from"./index-YwiKC6Po.js";import{u as Fe}from"./useQuery-DPH6Mb2w.js";import{B as Ke}from"./button-B90pJJiy.js";import{P as qe,a as Ve,b as Be}from"./popover-D7ygxg37.js";import"./dialog-foxx0Wu6.js";import{S as Ue}from"./search-wcEXdf1i.js";import{L as Qe}from"./loader-circle-B0KtDERb.js";/** +import{n as Ae,r as a,a9 as Q,v as L,aa as Me,ab as De,ac as $e,ad as Le,ae as H,j as p,B as D,C as Pe}from"./index-CbgxfyGU.js";import{u as Fe}from"./useQuery-Bx9s5-D2.js";import{B as Ke}from"./button-Bv9oZ-QU.js";import{P as qe,a as Be,b as Ve}from"./popover-DKJYnYjk.js";import"./dialog-Cfp_d3CC.js";import{S as Ue}from"./search-CLtAJGOp.js";import{L as Qe}from"./loader-circle-CWMja8Zn.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Te=Ae("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var fe=1,ze=.9,Ge=.8,He=.17,re=.1,ne=.999,We=.9999,Je=.99,Xe=/[\\\/_+.#"@\[\(\{&]/,Ye=/[\\\/_+.#"@\[\(\{&]/g,Ze=/[\s-]/,he=/[\s-]/g;function le(e,n,t,m,o,i,d){if(i===n.length)return o===e.length?fe:Je;var c=`${o},${i}`;if(d[c]!==void 0)return d[c];for(var y=m.charAt(i),u=t.indexOf(y,o),v=0,g,C,E,j;u>=0;)g=le(e,n,t,m,u+1,i+1,d),g>v&&(u===o?g*=fe:Xe.test(e.charAt(u-1))?(g*=Ge,E=e.slice(o,u-1).match(Ye),E&&o>0&&(g*=Math.pow(ne,E.length))):Ze.test(e.charAt(u-1))?(g*=ze,j=e.slice(o,u-1).match(he),j&&o>0&&(g*=Math.pow(ne,j.length))):(g*=He,o>0&&(g*=Math.pow(ne,u-o))),e.charAt(u)!==n.charAt(i)&&(g*=We)),(gg&&(g=C*re)),g>v&&(v=g),u=t.indexOf(y,u+1);return d[c]=v,v}function pe(e){return e.toLowerCase().replace(he," ")}function _e(e,n,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,le(e,n,pe(e),pe(n),0,0,{})}var G='[cmdk-group=""]',ae='[cmdk-group-items=""]',Oe='[cmdk-group-heading=""]',ge='[cmdk-item=""]',ve=`${ge}:not([aria-disabled="true"])`,oe="cmdk-item-select",B="data-value",et=(e,n,t)=>_e(e,n,t),xe=a.createContext(void 0),W=()=>a.useContext(xe),be=a.createContext(void 0),ue=()=>a.useContext(be),ye=a.createContext(void 0),we=a.forwardRef((e,n)=>{let t=U(()=>{var r,s;return{search:"",value:(s=(r=e.value)!=null?r:e.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),m=U(()=>new Set),o=U(()=>new Map),i=U(()=>new Map),d=U(()=>new Set),c=Ee(e),{label:y,children:u,value:v,onValueChange:g,filter:C,shouldFilter:E,loop:j,disablePointerSelection:P=!1,vimBindings:R=!0,...F}=e,q=Q(),A=Q(),T=Q(),M=a.useRef(null),x=dt();K(()=>{if(v!==void 0){let r=v.trim();t.current.value=r,k.emit()}},[v]),K(()=>{x(6,ie)},[]);let k=a.useMemo(()=>({subscribe:r=>(d.current.add(r),()=>d.current.delete(r)),snapshot:()=>t.current,setState:(r,s,f)=>{var l,h,b,I;if(!Object.is(t.current[r],s)){if(t.current[r]=s,r==="search")O(),Z(),x(1,_);else if(r==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let S=document.getElementById(T);S?S.focus():(l=document.getElementById(q))==null||l.focus()}if(x(7,()=>{var S;t.current.selectedItemId=(S=V())==null?void 0:S.id,k.emit()}),f||x(5,ie),((h=c.current)==null?void 0:h.value)!==void 0){let S=s??"";(I=(b=c.current).onValueChange)==null||I.call(b,S);return}}k.emit()}},emit:()=>{d.current.forEach(r=>r())}}),[]),w=a.useMemo(()=>({value:(r,s,f)=>{var l;s!==((l=i.current.get(r))==null?void 0:l.value)&&(i.current.set(r,{value:s,keywords:f}),t.current.filtered.items.set(r,J(s,f)),x(2,()=>{Z(),k.emit()}))},item:(r,s)=>(m.current.add(r),s&&(o.current.has(s)?o.current.get(s).add(r):o.current.set(s,new Set([r]))),x(3,()=>{O(),Z(),t.current.value||_(),k.emit()}),()=>{i.current.delete(r),m.current.delete(r),t.current.filtered.items.delete(r);let f=V();x(4,()=>{O(),(f==null?void 0:f.getAttribute("id"))===r&&_(),k.emit()})}),group:r=>(o.current.has(r)||o.current.set(r,new Set),()=>{i.current.delete(r),o.current.delete(r)}),filter:()=>c.current.shouldFilter,label:y||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:q,inputId:T,labelId:A,listInnerRef:M}),[]);function J(r,s){var f,l;let h=(l=(f=c.current)==null?void 0:f.filter)!=null?l:et;return r?h(r,t.current.search,s):0}function Z(){if(!t.current.search||c.current.shouldFilter===!1)return;let r=t.current.filtered.items,s=[];t.current.filtered.groups.forEach(l=>{let h=o.current.get(l),b=0;h.forEach(I=>{let S=r.get(I);b=Math.max(S,b)}),s.push([l,b])});let f=M.current;z().sort((l,h)=>{var b,I;let S=l.getAttribute("id"),X=h.getAttribute("id");return((b=r.get(X))!=null?b:0)-((I=r.get(S))!=null?I:0)}).forEach(l=>{let h=l.closest(ae);h?h.appendChild(l.parentElement===h?l:l.closest(`${ae} > *`)):f.appendChild(l.parentElement===f?l:l.closest(`${ae} > *`))}),s.sort((l,h)=>h[1]-l[1]).forEach(l=>{var h;let b=(h=M.current)==null?void 0:h.querySelector(`${G}[${B}="${encodeURIComponent(l[0])}"]`);b==null||b.parentElement.appendChild(b)})}function _(){let r=z().find(f=>f.getAttribute("aria-disabled")!=="true"),s=r==null?void 0:r.getAttribute(B);k.setState("value",s||void 0)}function O(){var r,s,f,l;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=m.current.size;return}t.current.filtered.groups=new Set;let h=0;for(let b of m.current){let I=(s=(r=i.current.get(b))==null?void 0:r.value)!=null?s:"",S=(l=(f=i.current.get(b))==null?void 0:f.keywords)!=null?l:[],X=J(I,S);t.current.filtered.items.set(b,X),X>0&&h++}for(let[b,I]of o.current)for(let S of I)if(t.current.filtered.items.get(S)>0){t.current.filtered.groups.add(b);break}t.current.filtered.count=h}function ie(){var r,s,f;let l=V();l&&(((r=l.parentElement)==null?void 0:r.firstChild)===l&&((f=(s=l.closest(G))==null?void 0:s.querySelector(Oe))==null||f.scrollIntoView({block:"nearest"})),l.scrollIntoView({block:"nearest"}))}function V(){var r;return(r=M.current)==null?void 0:r.querySelector(`${ge}[aria-selected="true"]`)}function z(){var r;return Array.from(((r=M.current)==null?void 0:r.querySelectorAll(ve))||[])}function ee(r){let s=z()[r];s&&k.setState("value",s.getAttribute(B))}function te(r){var s;let f=V(),l=z(),h=l.findIndex(I=>I===f),b=l[h+r];(s=c.current)!=null&&s.loop&&(b=h+r<0?l[l.length-1]:h+r===l.length?l[0]:l[h+r]),b&&k.setState("value",b.getAttribute(B))}function se(r){let s=V(),f=s==null?void 0:s.closest(G),l;for(;f&&!l;)f=r>0?st(f,G):ct(f,G),l=f==null?void 0:f.querySelector(ve);l?k.setState("value",l.getAttribute(B)):te(r)}let ce=()=>ee(z().length-1),de=r=>{r.preventDefault(),r.metaKey?ce():r.altKey?se(1):te(1)},me=r=>{r.preventDefault(),r.metaKey?ee(0):r.altKey?se(-1):te(-1)};return a.createElement(L.div,{ref:n,tabIndex:-1,...F,"cmdk-root":"",onKeyDown:r=>{var s;(s=F.onKeyDown)==null||s.call(F,r);let f=r.nativeEvent.isComposing||r.keyCode===229;if(!(r.defaultPrevented||f))switch(r.key){case"n":case"j":{R&&r.ctrlKey&&de(r);break}case"ArrowDown":{de(r);break}case"p":case"k":{R&&r.ctrlKey&&me(r);break}case"ArrowUp":{me(r);break}case"Home":{r.preventDefault(),ee(0);break}case"End":{r.preventDefault(),ce();break}case"Enter":{r.preventDefault();let l=V();if(l){let h=new Event(oe);l.dispatchEvent(h)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:w.inputId,id:w.labelId,style:ft},y),Y(e,r=>a.createElement(be.Provider,{value:k},a.createElement(xe.Provider,{value:w},r))))}),tt=a.forwardRef((e,n)=>{var t,m;let o=Q(),i=a.useRef(null),d=a.useContext(ye),c=W(),y=Ee(e),u=(m=(t=y.current)==null?void 0:t.forceMount)!=null?m:d==null?void 0:d.forceMount;K(()=>{if(!u)return c.item(o,d==null?void 0:d.id)},[u]);let v=ke(o,i,[e.value,e.children,i],e.keywords),g=ue(),C=$(x=>x.value&&x.value===v.current),E=$(x=>u||c.filter()===!1?!0:x.search?x.filtered.items.get(o)>0:!0);a.useEffect(()=>{let x=i.current;if(!(!x||e.disabled))return x.addEventListener(oe,j),()=>x.removeEventListener(oe,j)},[E,e.onSelect,e.disabled]);function j(){var x,k;P(),(k=(x=y.current).onSelect)==null||k.call(x,v.current)}function P(){g.setState("value",v.current,!0)}if(!E)return null;let{disabled:R,value:F,onSelect:q,forceMount:A,keywords:T,...M}=e;return a.createElement(L.div,{ref:H(i,n),...M,id:o,"cmdk-item":"",role:"option","aria-disabled":!!R,"aria-selected":!!C,"data-disabled":!!R,"data-selected":!!C,onPointerMove:R||c.getDisablePointerSelection()?void 0:P,onClick:R?void 0:j},e.children)}),rt=a.forwardRef((e,n)=>{let{heading:t,children:m,forceMount:o,...i}=e,d=Q(),c=a.useRef(null),y=a.useRef(null),u=Q(),v=W(),g=$(E=>o||v.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);K(()=>v.group(d),[]),ke(d,c,[e.value,e.heading,y]);let C=a.useMemo(()=>({id:d,forceMount:o}),[o]);return a.createElement(L.div,{ref:H(c,n),...i,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&a.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:u},t),Y(e,E=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?u:void 0},a.createElement(ye.Provider,{value:C},E))))}),nt=a.forwardRef((e,n)=>{let{alwaysRender:t,...m}=e,o=a.useRef(null),i=$(d=>!d.search);return!t&&!i?null:a.createElement(L.div,{ref:H(o,n),...m,"cmdk-separator":"",role:"separator"})}),at=a.forwardRef((e,n)=>{let{onValueChange:t,...m}=e,o=e.value!=null,i=ue(),d=$(u=>u.search),c=$(u=>u.selectedItemId),y=W();return a.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),a.createElement(L.input,{ref:n,...m,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":c,id:y.inputId,type:"text",value:o?e.value:d,onChange:u=>{o||i.setState("search",u.target.value),t==null||t(u.target.value)}})}),lt=a.forwardRef((e,n)=>{let{children:t,label:m="Suggestions",...o}=e,i=a.useRef(null),d=a.useRef(null),c=$(u=>u.selectedItemId),y=W();return a.useEffect(()=>{if(d.current&&i.current){let u=d.current,v=i.current,g,C=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let E=u.offsetHeight;v.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return C.observe(u),()=>{cancelAnimationFrame(g),C.unobserve(u)}}},[]),a.createElement(L.div,{ref:H(i,n),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":m,id:y.listId},Y(e,u=>a.createElement("div",{ref:H(d,y.listInnerRef),"cmdk-list-sizer":""},u)))}),ot=a.forwardRef((e,n)=>{let{open:t,onOpenChange:m,overlayClassName:o,contentClassName:i,container:d,...c}=e;return a.createElement(Me,{open:t,onOpenChange:m},a.createElement(De,{container:d},a.createElement($e,{"cmdk-overlay":"",className:o}),a.createElement(Le,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(we,{ref:n,...c}))))}),ut=a.forwardRef((e,n)=>$(t=>t.filtered.count===0)?a.createElement(L.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),it=a.forwardRef((e,n)=>{let{progress:t,children:m,label:o="Loading...",...i}=e;return a.createElement(L.div,{ref:n,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Y(e,d=>a.createElement("div",{"aria-hidden":!0},d)))}),N=Object.assign(we,{List:lt,Item:tt,Input:at,Group:rt,Separator:nt,Dialog:ot,Empty:ut,Loading:it});function st(e,n){let t=e.nextElementSibling;for(;t;){if(t.matches(n))return t;t=t.nextElementSibling}}function ct(e,n){let t=e.previousElementSibling;for(;t;){if(t.matches(n))return t;t=t.previousElementSibling}}function Ee(e){let n=a.useRef(e);return K(()=>{n.current=e}),n}var K=typeof window>"u"?a.useEffect:a.useLayoutEffect;function U(e){let n=a.useRef();return n.current===void 0&&(n.current=e()),n}function $(e){let n=ue(),t=()=>e(n.snapshot());return a.useSyncExternalStore(n.subscribe,t,t)}function ke(e,n,t,m=[]){let o=a.useRef(),i=W();return K(()=>{var d;let c=(()=>{var u;for(let v of t){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(u=v.current.textContent)==null?void 0:u.trim():o.current}})(),y=m.map(u=>u.trim());i.value(e,c,y),(d=n.current)==null||d.setAttribute(B,c),o.current=c}),o}var dt=()=>{let[e,n]=a.useState(),t=U(()=>new Map);return K(()=>{t.current.forEach(m=>m()),t.current=new Map},[e]),(m,o)=>{t.current.set(m,o),n({})}};function mt(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function Y({asChild:e,children:n},t){return e&&a.isValidElement(n)?a.cloneElement(mt(n),{ref:n.ref},t(n.props.children)):t(n)}var ft={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Se=a.forwardRef(({className:e,...n},t)=>p.jsx(N,{ref:t,className:D("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n}));Se.displayName=N.displayName;const Ce=a.forwardRef(({className:e,...n},t)=>p.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[p.jsx(Ue,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),p.jsx(N.Input,{ref:t,className:D("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]}));Ce.displayName=N.Input.displayName;const Ne=a.forwardRef(({className:e,...n},t)=>p.jsx(N.List,{ref:t,className:D("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n}));Ne.displayName=N.List.displayName;const Ie=a.forwardRef((e,n)=>p.jsx(N.Empty,{ref:n,className:"py-6 text-center text-sm",...e}));Ie.displayName=N.Empty.displayName;const je=a.forwardRef(({className:e,...n},t)=>p.jsx(N.Group,{ref:t,className:D("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n}));je.displayName=N.Group.displayName;const pt=a.forwardRef(({className:e,...n},t)=>p.jsx(N.Separator,{ref:t,className:D("-mx-1 h-px bg-border",e),...n}));pt.displayName=N.Separator.displayName;const Re=a.forwardRef(({className:e,...n},t)=>p.jsx(N.Item,{ref:t,className:D("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...n}));Re.displayName=N.Item.displayName;const vt=250;function kt({value:e,onChange:n,placeholder:t="Select...",searchPlaceholder:m="Search...",emptyMessage:o="No results found.",errorMessage:i,disabled:d=!1,selectedOption:c,queryKey:y,queryFn:u,enabled:v=!0,className:g,ariaLabel:C}){const[E,j]=a.useState(!1),[P,R]=a.useState(""),[F,q]=a.useState("");a.useEffect(()=>{const w=window.setTimeout(()=>{q(P.trim())},vt);return()=>window.clearTimeout(w)},[P]),a.useEffect(()=>{E||(R(""),q(""))},[E]);const{data:A=[],isFetching:T,isError:M}=Fe({queryKey:[...y,F],queryFn:()=>u(F),enabled:v&&E}),x=a.useMemo(()=>!e||A.some(w=>w.value===e)?A:(c==null?void 0:c.value)===e?[c,...A]:A,[A,c,e]),k=a.useMemo(()=>{if(!e)return t;const w=x.find(J=>J.value===e)??((c==null?void 0:c.value)===e?c:null);return(w==null?void 0:w.label)??t},[x,t,c,e]);return p.jsxs(qe,{open:E,onOpenChange:j,modal:!0,children:[p.jsx(Ve,{asChild:!0,children:p.jsxs(Ke,{type:"button",variant:"outline",role:"combobox","aria-expanded":E,"aria-label":C,disabled:d,className:D("h-8 w-full justify-between px-2 text-sm font-normal",!e&&"text-muted-foreground",g),children:[p.jsx("span",{className:"truncate",children:k}),p.jsx(Te,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),p.jsx(Be,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:w=>w.stopPropagation(),children:p.jsxs(Se,{shouldFilter:!1,className:"h-full",children:[p.jsx(Ce,{placeholder:m,value:P,onValueChange:R}),p.jsx(Ne,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:T?p.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[p.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):M&&i?p.jsx("div",{className:"px-4 py-6 text-center text-sm text-destructive",role:"alert",children:i}):x.length===0?p.jsx(Ie,{children:o}):p.jsx(je,{children:x.map(w=>p.jsxs(Re,{value:w.value,onSelect:()=>{n(w.value,w),j(!1)},children:[p.jsx(Pe,{className:D("mr-2 h-4 w-4",e===w.value?"opacity-100":"opacity-0")}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate",children:w.label}),w.description?p.jsx("div",{className:"truncate text-xs text-muted-foreground",children:w.description}):null]})]},w.value))})})]})})]})}export{kt as S}; + */const Te=Ae("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var fe=1,ze=.9,Ge=.8,He=.17,re=.1,ne=.999,We=.9999,Je=.99,Xe=/[\\\/_+.#"@\[\(\{&]/,Ye=/[\\\/_+.#"@\[\(\{&]/g,Ze=/[\s-]/,he=/[\s-]/g;function le(e,n,t,m,o,i,d){if(i===n.length)return o===e.length?fe:Je;var c=`${o},${i}`;if(d[c]!==void 0)return d[c];for(var y=m.charAt(i),u=t.indexOf(y,o),v=0,g,C,E,j;u>=0;)g=le(e,n,t,m,u+1,i+1,d),g>v&&(u===o?g*=fe:Xe.test(e.charAt(u-1))?(g*=Ge,E=e.slice(o,u-1).match(Ye),E&&o>0&&(g*=Math.pow(ne,E.length))):Ze.test(e.charAt(u-1))?(g*=ze,j=e.slice(o,u-1).match(he),j&&o>0&&(g*=Math.pow(ne,j.length))):(g*=He,o>0&&(g*=Math.pow(ne,u-o))),e.charAt(u)!==n.charAt(i)&&(g*=We)),(gg&&(g=C*re)),g>v&&(v=g),u=t.indexOf(y,u+1);return d[c]=v,v}function pe(e){return e.toLowerCase().replace(he," ")}function _e(e,n,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,le(e,n,pe(e),pe(n),0,0,{})}var G='[cmdk-group=""]',ae='[cmdk-group-items=""]',Oe='[cmdk-group-heading=""]',ge='[cmdk-item=""]',ve=`${ge}:not([aria-disabled="true"])`,oe="cmdk-item-select",V="data-value",et=(e,n,t)=>_e(e,n,t),xe=a.createContext(void 0),W=()=>a.useContext(xe),be=a.createContext(void 0),ue=()=>a.useContext(be),ye=a.createContext(void 0),we=a.forwardRef((e,n)=>{let t=U(()=>{var r,s;return{search:"",value:(s=(r=e.value)!=null?r:e.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),m=U(()=>new Set),o=U(()=>new Map),i=U(()=>new Map),d=U(()=>new Set),c=Ee(e),{label:y,children:u,value:v,onValueChange:g,filter:C,shouldFilter:E,loop:j,disablePointerSelection:P=!1,vimBindings:R=!0,...F}=e,q=Q(),A=Q(),T=Q(),M=a.useRef(null),x=dt();K(()=>{if(v!==void 0){let r=v.trim();t.current.value=r,k.emit()}},[v]),K(()=>{x(6,ie)},[]);let k=a.useMemo(()=>({subscribe:r=>(d.current.add(r),()=>d.current.delete(r)),snapshot:()=>t.current,setState:(r,s,f)=>{var l,h,b,I;if(!Object.is(t.current[r],s)){if(t.current[r]=s,r==="search")O(),Z(),x(1,_);else if(r==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let S=document.getElementById(T);S?S.focus():(l=document.getElementById(q))==null||l.focus()}if(x(7,()=>{var S;t.current.selectedItemId=(S=B())==null?void 0:S.id,k.emit()}),f||x(5,ie),((h=c.current)==null?void 0:h.value)!==void 0){let S=s??"";(I=(b=c.current).onValueChange)==null||I.call(b,S);return}}k.emit()}},emit:()=>{d.current.forEach(r=>r())}}),[]),w=a.useMemo(()=>({value:(r,s,f)=>{var l;s!==((l=i.current.get(r))==null?void 0:l.value)&&(i.current.set(r,{value:s,keywords:f}),t.current.filtered.items.set(r,J(s,f)),x(2,()=>{Z(),k.emit()}))},item:(r,s)=>(m.current.add(r),s&&(o.current.has(s)?o.current.get(s).add(r):o.current.set(s,new Set([r]))),x(3,()=>{O(),Z(),t.current.value||_(),k.emit()}),()=>{i.current.delete(r),m.current.delete(r),t.current.filtered.items.delete(r);let f=B();x(4,()=>{O(),(f==null?void 0:f.getAttribute("id"))===r&&_(),k.emit()})}),group:r=>(o.current.has(r)||o.current.set(r,new Set),()=>{i.current.delete(r),o.current.delete(r)}),filter:()=>c.current.shouldFilter,label:y||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:q,inputId:T,labelId:A,listInnerRef:M}),[]);function J(r,s){var f,l;let h=(l=(f=c.current)==null?void 0:f.filter)!=null?l:et;return r?h(r,t.current.search,s):0}function Z(){if(!t.current.search||c.current.shouldFilter===!1)return;let r=t.current.filtered.items,s=[];t.current.filtered.groups.forEach(l=>{let h=o.current.get(l),b=0;h.forEach(I=>{let S=r.get(I);b=Math.max(S,b)}),s.push([l,b])});let f=M.current;z().sort((l,h)=>{var b,I;let S=l.getAttribute("id"),X=h.getAttribute("id");return((b=r.get(X))!=null?b:0)-((I=r.get(S))!=null?I:0)}).forEach(l=>{let h=l.closest(ae);h?h.appendChild(l.parentElement===h?l:l.closest(`${ae} > *`)):f.appendChild(l.parentElement===f?l:l.closest(`${ae} > *`))}),s.sort((l,h)=>h[1]-l[1]).forEach(l=>{var h;let b=(h=M.current)==null?void 0:h.querySelector(`${G}[${V}="${encodeURIComponent(l[0])}"]`);b==null||b.parentElement.appendChild(b)})}function _(){let r=z().find(f=>f.getAttribute("aria-disabled")!=="true"),s=r==null?void 0:r.getAttribute(V);k.setState("value",s||void 0)}function O(){var r,s,f,l;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=m.current.size;return}t.current.filtered.groups=new Set;let h=0;for(let b of m.current){let I=(s=(r=i.current.get(b))==null?void 0:r.value)!=null?s:"",S=(l=(f=i.current.get(b))==null?void 0:f.keywords)!=null?l:[],X=J(I,S);t.current.filtered.items.set(b,X),X>0&&h++}for(let[b,I]of o.current)for(let S of I)if(t.current.filtered.items.get(S)>0){t.current.filtered.groups.add(b);break}t.current.filtered.count=h}function ie(){var r,s,f;let l=B();l&&(((r=l.parentElement)==null?void 0:r.firstChild)===l&&((f=(s=l.closest(G))==null?void 0:s.querySelector(Oe))==null||f.scrollIntoView({block:"nearest"})),l.scrollIntoView({block:"nearest"}))}function B(){var r;return(r=M.current)==null?void 0:r.querySelector(`${ge}[aria-selected="true"]`)}function z(){var r;return Array.from(((r=M.current)==null?void 0:r.querySelectorAll(ve))||[])}function ee(r){let s=z()[r];s&&k.setState("value",s.getAttribute(V))}function te(r){var s;let f=B(),l=z(),h=l.findIndex(I=>I===f),b=l[h+r];(s=c.current)!=null&&s.loop&&(b=h+r<0?l[l.length-1]:h+r===l.length?l[0]:l[h+r]),b&&k.setState("value",b.getAttribute(V))}function se(r){let s=B(),f=s==null?void 0:s.closest(G),l;for(;f&&!l;)f=r>0?st(f,G):ct(f,G),l=f==null?void 0:f.querySelector(ve);l?k.setState("value",l.getAttribute(V)):te(r)}let ce=()=>ee(z().length-1),de=r=>{r.preventDefault(),r.metaKey?ce():r.altKey?se(1):te(1)},me=r=>{r.preventDefault(),r.metaKey?ee(0):r.altKey?se(-1):te(-1)};return a.createElement(L.div,{ref:n,tabIndex:-1,...F,"cmdk-root":"",onKeyDown:r=>{var s;(s=F.onKeyDown)==null||s.call(F,r);let f=r.nativeEvent.isComposing||r.keyCode===229;if(!(r.defaultPrevented||f))switch(r.key){case"n":case"j":{R&&r.ctrlKey&&de(r);break}case"ArrowDown":{de(r);break}case"p":case"k":{R&&r.ctrlKey&&me(r);break}case"ArrowUp":{me(r);break}case"Home":{r.preventDefault(),ee(0);break}case"End":{r.preventDefault(),ce();break}case"Enter":{r.preventDefault();let l=B();if(l){let h=new Event(oe);l.dispatchEvent(h)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:w.inputId,id:w.labelId,style:ft},y),Y(e,r=>a.createElement(be.Provider,{value:k},a.createElement(xe.Provider,{value:w},r))))}),tt=a.forwardRef((e,n)=>{var t,m;let o=Q(),i=a.useRef(null),d=a.useContext(ye),c=W(),y=Ee(e),u=(m=(t=y.current)==null?void 0:t.forceMount)!=null?m:d==null?void 0:d.forceMount;K(()=>{if(!u)return c.item(o,d==null?void 0:d.id)},[u]);let v=ke(o,i,[e.value,e.children,i],e.keywords),g=ue(),C=$(x=>x.value&&x.value===v.current),E=$(x=>u||c.filter()===!1?!0:x.search?x.filtered.items.get(o)>0:!0);a.useEffect(()=>{let x=i.current;if(!(!x||e.disabled))return x.addEventListener(oe,j),()=>x.removeEventListener(oe,j)},[E,e.onSelect,e.disabled]);function j(){var x,k;P(),(k=(x=y.current).onSelect)==null||k.call(x,v.current)}function P(){g.setState("value",v.current,!0)}if(!E)return null;let{disabled:R,value:F,onSelect:q,forceMount:A,keywords:T,...M}=e;return a.createElement(L.div,{ref:H(i,n),...M,id:o,"cmdk-item":"",role:"option","aria-disabled":!!R,"aria-selected":!!C,"data-disabled":!!R,"data-selected":!!C,onPointerMove:R||c.getDisablePointerSelection()?void 0:P,onClick:R?void 0:j},e.children)}),rt=a.forwardRef((e,n)=>{let{heading:t,children:m,forceMount:o,...i}=e,d=Q(),c=a.useRef(null),y=a.useRef(null),u=Q(),v=W(),g=$(E=>o||v.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);K(()=>v.group(d),[]),ke(d,c,[e.value,e.heading,y]);let C=a.useMemo(()=>({id:d,forceMount:o}),[o]);return a.createElement(L.div,{ref:H(c,n),...i,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&a.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:u},t),Y(e,E=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?u:void 0},a.createElement(ye.Provider,{value:C},E))))}),nt=a.forwardRef((e,n)=>{let{alwaysRender:t,...m}=e,o=a.useRef(null),i=$(d=>!d.search);return!t&&!i?null:a.createElement(L.div,{ref:H(o,n),...m,"cmdk-separator":"",role:"separator"})}),at=a.forwardRef((e,n)=>{let{onValueChange:t,...m}=e,o=e.value!=null,i=ue(),d=$(u=>u.search),c=$(u=>u.selectedItemId),y=W();return a.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),a.createElement(L.input,{ref:n,...m,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":c,id:y.inputId,type:"text",value:o?e.value:d,onChange:u=>{o||i.setState("search",u.target.value),t==null||t(u.target.value)}})}),lt=a.forwardRef((e,n)=>{let{children:t,label:m="Suggestions",...o}=e,i=a.useRef(null),d=a.useRef(null),c=$(u=>u.selectedItemId),y=W();return a.useEffect(()=>{if(d.current&&i.current){let u=d.current,v=i.current,g,C=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let E=u.offsetHeight;v.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return C.observe(u),()=>{cancelAnimationFrame(g),C.unobserve(u)}}},[]),a.createElement(L.div,{ref:H(i,n),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":m,id:y.listId},Y(e,u=>a.createElement("div",{ref:H(d,y.listInnerRef),"cmdk-list-sizer":""},u)))}),ot=a.forwardRef((e,n)=>{let{open:t,onOpenChange:m,overlayClassName:o,contentClassName:i,container:d,...c}=e;return a.createElement(Me,{open:t,onOpenChange:m},a.createElement(De,{container:d},a.createElement($e,{"cmdk-overlay":"",className:o}),a.createElement(Le,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(we,{ref:n,...c}))))}),ut=a.forwardRef((e,n)=>$(t=>t.filtered.count===0)?a.createElement(L.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),it=a.forwardRef((e,n)=>{let{progress:t,children:m,label:o="Loading...",...i}=e;return a.createElement(L.div,{ref:n,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Y(e,d=>a.createElement("div",{"aria-hidden":!0},d)))}),N=Object.assign(we,{List:lt,Item:tt,Input:at,Group:rt,Separator:nt,Dialog:ot,Empty:ut,Loading:it});function st(e,n){let t=e.nextElementSibling;for(;t;){if(t.matches(n))return t;t=t.nextElementSibling}}function ct(e,n){let t=e.previousElementSibling;for(;t;){if(t.matches(n))return t;t=t.previousElementSibling}}function Ee(e){let n=a.useRef(e);return K(()=>{n.current=e}),n}var K=typeof window>"u"?a.useEffect:a.useLayoutEffect;function U(e){let n=a.useRef();return n.current===void 0&&(n.current=e()),n}function $(e){let n=ue(),t=()=>e(n.snapshot());return a.useSyncExternalStore(n.subscribe,t,t)}function ke(e,n,t,m=[]){let o=a.useRef(),i=W();return K(()=>{var d;let c=(()=>{var u;for(let v of t){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(u=v.current.textContent)==null?void 0:u.trim():o.current}})(),y=m.map(u=>u.trim());i.value(e,c,y),(d=n.current)==null||d.setAttribute(V,c),o.current=c}),o}var dt=()=>{let[e,n]=a.useState(),t=U(()=>new Map);return K(()=>{t.current.forEach(m=>m()),t.current=new Map},[e]),(m,o)=>{t.current.set(m,o),n({})}};function mt(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function Y({asChild:e,children:n},t){return e&&a.isValidElement(n)?a.cloneElement(mt(n),{ref:n.ref},t(n.props.children)):t(n)}var ft={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Se=a.forwardRef(({className:e,...n},t)=>p.jsx(N,{ref:t,className:D("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n}));Se.displayName=N.displayName;const Ce=a.forwardRef(({className:e,...n},t)=>p.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[p.jsx(Ue,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),p.jsx(N.Input,{ref:t,className:D("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]}));Ce.displayName=N.Input.displayName;const Ne=a.forwardRef(({className:e,...n},t)=>p.jsx(N.List,{ref:t,className:D("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n}));Ne.displayName=N.List.displayName;const Ie=a.forwardRef((e,n)=>p.jsx(N.Empty,{ref:n,className:"py-6 text-center text-sm",...e}));Ie.displayName=N.Empty.displayName;const je=a.forwardRef(({className:e,...n},t)=>p.jsx(N.Group,{ref:t,className:D("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n}));je.displayName=N.Group.displayName;const pt=a.forwardRef(({className:e,...n},t)=>p.jsx(N.Separator,{ref:t,className:D("-mx-1 h-px bg-border",e),...n}));pt.displayName=N.Separator.displayName;const Re=a.forwardRef(({className:e,...n},t)=>p.jsx(N.Item,{ref:t,className:D("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...n}));Re.displayName=N.Item.displayName;const vt=250;function kt({value:e,onChange:n,placeholder:t="Select...",searchPlaceholder:m="Search...",emptyMessage:o="No results found.",errorMessage:i,disabled:d=!1,selectedOption:c,queryKey:y,queryFn:u,enabled:v=!0,className:g,ariaLabel:C}){const[E,j]=a.useState(!1),[P,R]=a.useState(""),[F,q]=a.useState("");a.useEffect(()=>{const w=window.setTimeout(()=>{q(P.trim())},vt);return()=>window.clearTimeout(w)},[P]),a.useEffect(()=>{E||(R(""),q(""))},[E]);const{data:A=[],isFetching:T,isError:M}=Fe({queryKey:[...y,F],queryFn:()=>u(F),enabled:v&&E}),x=a.useMemo(()=>!e||A.some(w=>w.value===e)?A:(c==null?void 0:c.value)===e?[c,...A]:A,[A,c,e]),k=a.useMemo(()=>{if(!e)return t;const w=x.find(J=>J.value===e)??((c==null?void 0:c.value)===e?c:null);return(w==null?void 0:w.label)??t},[x,t,c,e]);return p.jsxs(qe,{open:E,onOpenChange:j,modal:!0,children:[p.jsx(Be,{asChild:!0,children:p.jsxs(Ke,{type:"button",variant:"outline",role:"combobox","aria-expanded":E,"aria-label":C,disabled:d,className:D("h-8 w-full justify-between px-2 text-sm font-normal",!e&&"text-muted-foreground",g),children:[p.jsx("span",{className:"truncate",children:k}),p.jsx(Te,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),p.jsx(Ve,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:w=>w.stopPropagation(),children:p.jsxs(Se,{shouldFilter:!1,className:"h-full",children:[p.jsx(Ce,{placeholder:m,value:P,onValueChange:R}),p.jsx(Ne,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:T?p.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[p.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):M&&i?p.jsx("div",{className:"px-4 py-6 text-center text-sm text-destructive",role:"alert",children:i}):x.length===0?p.jsx(Ie,{children:o}):p.jsx(je,{children:x.map(w=>p.jsxs(Re,{value:w.value,onSelect:()=>{n(w.value,w),j(!1)},children:[p.jsx(Pe,{className:D("mr-2 h-4 w-4",e===w.value?"opacity-100":"opacity-0")}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate",children:w.label}),w.description?p.jsx("div",{className:"truncate text-xs text-muted-foreground",children:w.description}):null]})]},w.value))})})]})})]})}export{kt as S}; diff --git a/assets/share-2-m8aPY8Vq.js b/assets/share-2-hXe4dX_y.js similarity index 91% rename from assets/share-2-m8aPY8Vq.js rename to assets/share-2-hXe4dX_y.js index 2cfc9c955bdafae244189cb8fb7c659b0639ab99..8e2b539e6a9ee97549caac05dd7261e14145ab33 100644 --- a/assets/share-2-m8aPY8Vq.js +++ b/assets/share-2-hXe4dX_y.js @@ -1,4 +1,4 @@ -import{n as c}from"./index-YwiKC6Po.js";/** +import{n as c}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-CXR1qouH.js b/assets/skeleton-HwvdxvSN.js similarity index 62% rename from assets/skeleton-CXR1qouH.js rename to assets/skeleton-HwvdxvSN.js index d6590259dd878a70b4197e2c611388a6eb987f26..255c969d4368f73d28ec335f19e5c90206ae4dbc 100644 --- a/assets/skeleton-CXR1qouH.js +++ b/assets/skeleton-HwvdxvSN.js @@ -1 +1 @@ -import{j as t,A as n}from"./index-YwiKC6Po.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; +import{j as t,B as n}from"./index-CbgxfyGU.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; diff --git a/assets/sparkles-C3L7JDLC.js b/assets/sparkles-BqBXJPmy.js similarity index 93% rename from assets/sparkles-C3L7JDLC.js rename to assets/sparkles-BqBXJPmy.js index 49b38cedfa0466a01c2661dd88d4ceadfb567757..2b740680f1c0d45eb4c9780fafef2b106f9a8741 100644 --- a/assets/sparkles-C3L7JDLC.js +++ b/assets/sparkles-BqBXJPmy.js @@ -1,4 +1,4 @@ -import{n as a}from"./index-YwiKC6Po.js";/** +import{n as a}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/submissions-BJgYjF7O.js b/assets/submissions-BJgYjF7O.js deleted file mode 100644 index d54d4a6ce4e029381bb8344d0bd53221d570bfee..0000000000000000000000000000000000000000 --- a/assets/submissions-BJgYjF7O.js +++ /dev/null @@ -1 +0,0 @@ -import{a5 as qe}from"./index-YwiKC6Po.js";var v;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},s.getValidEnumValues=n=>{const a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(const i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(v||(v={}));var Te;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Te||(Te={}));const u=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class I extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;ft.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const ue=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,v.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:v.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(s)}return{message:t}};let Fe=ue;function We(){return Fe}const Je=s=>{const{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const f=r.filter(p=>!!p).slice().reverse();for(const p of f)o=p(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function c(s,e){const t=We(),r=Je({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===ue?void 0:ue].filter(n=>!!n)});s.common.issues.push(r)}class C{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const a=await n.key,i=await n.value;r.push({key:a,value:i})}return C.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),W=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Se=s=>s.status==="aborted",Ce=s=>s.status==="dirty",U=s=>s.status==="valid",Q=s=>typeof Promise<"u"&&s instanceof Promise;var h;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));class Z{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Oe=(s,e)=>{if(U(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(s.common.issues);return this._error=t,this._error}}};function y(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:n}}class g{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Q(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Oe(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return U(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>U(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Q(n)?n:Promise.resolve(n));return Oe(r,a)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new z({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return j.create(this,this._def)}nullable(){return L.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return A.create(this)}promise(){return re.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return ee.create(this,e,this._def)}transform(e){return new z({...y(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...y(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new Me({typeName:_.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ae({...y(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ke.create(this,e)}readonly(){return ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ye=/^c[^\s-]{8,}$/i,He=/^[0-9a-z]+$/,Ge=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xe=/^[a-z0-9_-]{21}$/i,Ke=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,et=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,st="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ce;const rt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,at=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,it=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ot=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ie="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ct=new RegExp(`^${Ie}$`);function $e(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ut(s){return new RegExp(`^${$e(s)}$`)}function lt(s){let e=`${Ie}T${$e(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ht(s,e){return!!((e==="v4"||!e)&&rt.test(s)||(e==="v6"||!e)&&at.test(s))}function ft(s,e){if(!Ke.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function pt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&it.test(s))}class E extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.string,received:a.parsedType}),m}const r=new C;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:d.invalid_string,...h.errToObj(r)})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new E({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew E({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});function mt(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=Number.parseInt(s.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class B extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.number,received:a.parsedType}),m}let r;const n=new C;for(const a of this._def.checks)a.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?mt(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,n){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(n)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew B({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class J extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const n=new C;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,n){return new J({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(n)}]})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew J({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});class le extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return O(e.data)}}le.create=s=>new le({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class X extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_date}),m}const r=new C;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):v.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew X({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...y(s)});class Ae extends g{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodSymbol,...y(s)});class he extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodUndefined,...y(s)});class fe extends g{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodNull,...y(s)});class Ne extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ne.create=s=>new Ne({typeName:_.ZodAny,...y(s)});class pe extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodUnknown,...y(s)});class P extends g{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...y(s)});class Ze extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return O(e.data)}}Ze.create=s=>new Ze({typeName:_.ZodVoid,...y(s)});class A extends g{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(c(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new Z(t,i,t.path,o)))).then(i=>C.mergeArray(r,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new Z(t,i,t.path,o)));return C.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new A({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new A({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new A({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}A.create=(s,e)=>new A({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...y(e)});function D(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=j.create(D(r))}return new w({...s._def,shape:()=>e})}else return s instanceof A?new A({...s._def,type:D(s.element)}):s instanceof j?j.create(D(s.unwrap())):s instanceof L?L.create(D(s.unwrap())):s instanceof M?M.create(s.items.map(e=>D(e))):s}class w extends g{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:u.object,received:p.parsedType}),m}const{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in n.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const x=a[p],F=n.data[p];f.push({key:{status:"valid",value:p},value:x._parse(new Z(n,F,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:n.data[x]}});else if(p==="strict")o.length>0&&(c(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const x of o){const F=n.data[x];f.push({key:{status:"valid",value:x},value:p._parse(new Z(n,F,n.path,x)),alwaysSet:x in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const p=[];for(const x of f){const F=await x.key,Be=await x.value;p.push({key:F,value:Be,alwaysSet:x.alwaysSet})}return p}).then(p=>C.mergeObjectSync(r,p)):C.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new w({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new w({...this._def,unknownKeys:"strip"})}passthrough(){return new w({...this._def,unknownKeys:"passthrough"})}extend(e){return new w({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w({...this._def,catchall:e})}pick(e){const t={};for(const r of v.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}omit(e){const t={};for(const r of v.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}deepPartial(){return D(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new w({...this._def,shape:()=>t})}required(e){const t={};for(const r of v.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof j;)a=a._def.innerType;t[r]=a}return new w({...this._def,shape:()=>t})}keyof(){return Pe(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});class K extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new I(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},x=f._parseSync({data:t.data,path:t.path,parent:p});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new I(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}K.create=(s,e)=>new K({options:s,typeName:_.ZodUnion,...y(e)});const R=s=>s instanceof _e?R(s.schema):s instanceof z?R(s.innerType()):s instanceof se?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?R(s._def.innerType):s instanceof he?[void 0]:s instanceof fe?[null]:s instanceof j?[void 0,...R(s.unwrap())]:s instanceof L?[null,...R(s.unwrap())]:s instanceof Me||s instanceof ie?R(s.unwrap()):s instanceof ae?R(s._def.innerType):[];class xe extends g{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return c(t,{code:d.invalid_type,expected:u.object,received:t.parsedType}),m;const r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const i=R(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new xe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(r)})}}function me(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const n=v.objectKeys(e),a=v.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(const o of a){const f=me(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(Se(a)||Se(i))return m;const o=me(a.value,i.value);return o.valid?((Ce(a)||Ce(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ee.create=(s,e,t)=>new ee({left:s,right:e,typeName:_.ZodIntersection,...y(t)});class M extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new Z(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>C.mergeArray(t,i)):C.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new M({...this._def,rest:e})}}M.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new M({items:s,typeName:_.ZodTuple,rest:null,...y(e)})};class te extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:d.invalid_type,expected:u.object,received:r.parsedType}),m;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in r.data)n.push({key:a._parse(new Z(r,o,r.path,o)),value:i._parse(new Z(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?C.mergeObjectAsync(t,n):C.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof g?new te({keyType:e,valueType:t,typeName:_.ZodRecord,...y(r)}):new te({keyType:E.create(),valueType:e,typeName:_.ZodRecord,...y(t)})}}class Re extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:n._parse(new Z(r,o,r.path,[p,"key"])),value:a._parse(new Z(r,f,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const p=await f.key,x=await f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,x=f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}}}}Re.create=(s,e,t)=>new Re({valueType:e,keyType:s,typeName:_.ZodMap,...y(t)});class Y extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const n=this._def;n.minSize!==null&&r.data.sizen.maxSize.value&&(c(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const p=new Set;for(const x of f){if(x.status==="aborted")return m;x.status==="dirty"&&t.dirty(),p.add(x.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>a._parse(new Z(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new Y({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new Y({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Y.create=(s,e)=>new Y({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...y(e)});class _e extends g{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(s,e)=>new _e({getter:s,typeName:_.ZodLazy,...y(e)});class se extends g{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(s,e)=>new se({value:s,typeName:_.ZodLiteral,...y(e)});function Pe(s,e){return new V({values:s,typeName:_.ZodEnum,...y(e)})}class V extends g{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:v.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}V.create=Pe;class ye extends g{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const n=v.objectValues(t);return c(r,{expected:v.joinValues(n),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:n}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...y(e)});class re extends g{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return O(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}re.create=(s,e)=>new re({type:s,typeName:_.ZodPromise,...y(e)});class z extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?W(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?W(o.value):o}}if(n.type==="refinement"){const i=o=>{const f=n.refinement(o,a);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!U(i))return m;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>U(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):m);v.assertNever(n)}}z.create=(s,e,t)=>new z({schema:s,typeName:_.ZodEffects,effect:e,...y(t)});z.createWithPreprocess=(s,e,t)=>new z({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...y(t)});class j extends g{_parse(e){return this._getType(e)===u.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(s,e)=>new j({innerType:s,typeName:_.ZodOptional,...y(e)});class L extends g{_parse(e){return this._getType(e)===u.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}L.create=(s,e)=>new L({innerType:s,typeName:_.ZodNullable,...y(e)});class ne extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ae extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Q(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ae.create=(s,e)=>new ae({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class Ee extends g{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}Ee.create=s=>new Ee({typeName:_.ZodNaN,...y(s)});class Me extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ke extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),W(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new ke({in:e,out:t,typeName:_.ZodPipeline})}}class ie extends g{_parse(e){const t=this._def.innerType._parse(e),r=n=>(U(n)&&(n.value=Object.freeze(n.value)),n);return Q(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodReadonly,...y(e)});var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const l=E.create,b=B.create,oe=le.create,_t=pe.create;P.create;const T=A.create,k=w.create,Ve=K.create,ze=xe.create;ee.create;M.create;const Le=te.create,G=se.create,ge=V.create;re.create;j.create;L.create;const N=Le(_t()),be=k({id:b(),name:l(),slug:l().optional()}).passthrough(),de=k({url:l(),is_official:oe()}),ve=k({task_id:b(),dataset_id:b(),model_name:l().nullish(),harness:l().nullish(),methodology:l().nullish(),metrics:Le(Ve([l(),b()])),uses_additional_data:oe().optional(),is_open:oe().optional(),best_rank:b().nullish(),best_metric:l().nullish(),evaluated_on:l().nullish(),external_source_url:l().nullish(),num_parameters:b().nullish(),hf_model_url:l().nullish()}).passthrough(),yt=ve.partial().extend({id:b().optional()}),gt=ze("op",[k({op:G("create"),data:ve}),k({op:G("update"),evaluation_id:b(),data:ve}),k({op:G("delete"),evaluation_id:b()})]),je=k({hf_models:T(l()),hf_datasets:T(l()),hf_spaces:T(l())}),we=k({file_name:l(),mime_type:l(),data_url:l().optional(),url:l().optional()}),q=k({name:l(),description:l().optional()}),vt=q.extend({image:we.optional(),image_credit:l().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:l().optional()}),xt=q.extend({image:we.optional(),image_credit:l().optional(),source_paper_id:b().optional(),source_url:l().optional(),source_title:l().optional()}),kt=Ve([k({benchmark:l(),task:l(),description:l()}),q.extend({description:l(),task_ids:T(b()),full_name:l().optional(),url:l().optional(),hf_url:l().optional(),paper_url:l().optional(),license_name:l().optional(),license_url:l().optional()})]),bt=q.extend({description:l(),direction:ge(["higher_is_better","lower_is_better"]),full_name:l().optional(),scale:l().optional(),task_id:b(),dataset_id:b()}),wt=q.extend({short_name:l().optional(),venue:l().optional(),location:l().optional(),url:l(),year:b(),start_date:l().optional(),end_date:l().optional()}),Tt=q.extend({hf_slug:l().optional(),website_url:l().optional(),image:we.optional()}),St=k({id:b(),paper_id:b().nullable(),hf_username:l(),hf_subject:l().nullish(),is_author:oe(),status:ge(["pending","approved","rejected"]),applied_payload:N.nullish(),conflict_payload:N.nullish(),result_entity_type:l().nullish(),result_entity_id:l().nullish(),admin_note:l().nullish(),user_review_reason:l().nullish(),reviewed_by:l().nullish(),reviewed_by_kind:ge(["human","codex","auto"]).nullish(),catalog_event_id:l().nullish(),review_evidence:N.nullish(),created_at:l(),updated_at:l(),reviewed_at:l().nullish()});function S(s,e,t){return St.extend({edit_type:G(s),proposed_payload:e,current_payload:t.nullish()})}const Ct=S("tasks",k({task_ids:T(b())}),k({tasks:T(be)})),Ot=S("methods",k({method_ids:T(b())}),k({methods:T(be)})),At=S("evaluations",k({operations:T(gt)}),k({evaluations:T(yt)})),Nt=S("repositories",k({repositories:T(de)}),k({repositories:T(de)})),Zt=S("project_pages",k({project_pages:T(de)}),k({project_pages:T(de)})),Rt=S("source_url",k({source_url:l()}),k({source_url:l().nullish()})),Et=S("hf_artifacts",je,je),jt=S("x_threads",k({x_threads:T(l())}),k({x_threads:T(k({url:l()}))})),It=S("organizations",k({organization_ids:T(b())}),k({organizations:T(be)})),$t=S("new_task",vt,N),Pt=S("new_method",xt,N),Mt=S("new_benchmark",kt,N),Vt=S("new_metric",bt,N),zt=S("new_conference",wt,N),Lt=S("new_organization",Tt,N),Dt=S("new_external_paper",k({title:l().optional(),source_url:l(),authors:T(l()),date_published:l().optional(),abstract:l().optional()}),N),De=ze("edit_type",[Ct,Ot,At,Nt,Zt,Rt,Et,jt,It,$t,Pt,Mt,Vt,zt,Lt,Dt]);function Jt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const Ut=k({count:b(),results:T(De)});class Bt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Ue(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new Bt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const H=s=>Ue(De,s),qt=s=>Ue(Ut,s);class Ft{constructor(e){this.request=e}async submit(e){return H(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[n,a]of Object.entries(e??{}))a!==void 0&&t.set(n,String(a));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(qt)}revertAutoApproved(e,t={}){return this.request(`/admin/submitters/${encodeURIComponent(e)}/revert-auto-approved`,{method:"POST",body:JSON.stringify(t)})}async get(e){return H(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Yt=new Ft(qe);export{Jt as p,Yt as s}; diff --git a/assets/submissions-aWj7YtuZ.js b/assets/submissions-aWj7YtuZ.js new file mode 100644 index 0000000000000000000000000000000000000000..c8b1ef6d7c2b95b8a37769f47c2011de2764b0a0 --- /dev/null +++ b/assets/submissions-aWj7YtuZ.js @@ -0,0 +1 @@ +import{a6 as Fe}from"./index-CbgxfyGU.js";var v;(function(s){s.assertEqual=a=>{};function e(a){}s.assertIs=e;function t(a){throw new Error}s.assertNever=t,s.arrayToEnum=a=>{const n={};for(const i of a)n[i]=i;return n},s.getValidEnumValues=a=>{const n=s.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of n)i[o]=a[o];return s.objectValues(i)},s.objectValues=a=>s.objectKeys(a).map(function(n){return a[n]}),s.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&n.push(i);return n},s.find=(a,n)=>{for(const i of a)if(n(i))return i},s.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,n=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}s.joinValues=r,s.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(v||(v={}));var Se;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const u=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class I extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(n){return n.message},r={_errors:[]},a=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;ft.message){const t={},r=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const le=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,v.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:v.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(s)}return{message:t}};let We=le;function Je(){return We}const Ye=s=>{const{data:e,path:t,errorMaps:r,issueData:a}=s,n=[...t,...a.path||[]],i={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.message};let o="";const f=r.filter(p=>!!p).slice().reverse();for(const p of f)o=p(i,{data:e,defaultError:o}).message;return{...a,path:n,message:o}};function c(s,e){const t=Je(),r=Ye({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===le?void 0:le].filter(a=>!!a)});s.common.issues.push(r)}class C{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if(a.status==="aborted")return m;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const n=await a.key,i=await a.value;r.push({key:n,value:i})}return C.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:n,value:i}=a;if(n.status==="aborted"||i.status==="aborted")return m;n.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[n.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),J=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Ce=s=>s.status==="aborted",Oe=s=>s.status==="dirty",B=s=>s.status==="valid",X=s=>typeof Promise<"u"&&s instanceof Promise;var h;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));class E{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ne=(s,e)=>{if(B(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(s.common.issues);return this._error=t,this._error}}};function g(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:a}}class y{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(X(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Ne(r,a)}"~validate"(e){var r,a;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return B(n)?{value:n.value}:{issues:t.common.issues}}catch(n){(a=(r=n==null?void 0:n.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>B(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},a=this._parse({data:e,path:r.path,parent:r}),n=await(X(a)?a:Promise.resolve(a));return Ne(r,n)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,n)=>{const i=e(a),o=()=>n.addIssue({code:d.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new L({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return j.create(this,this._def)}nullable(){return D.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return ae.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new L({...g(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...g(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new ze({typeName:_.ZodBranded,type:this,...g(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ie({...g(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return be.create(this,e)}readonly(){return oe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const He=/^c[^\s-]{8,}$/i,Ge=/^[0-9a-z]+$/,Qe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ke=/^[a-z0-9_-]{21}$/i,et=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,st=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ue;const at=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,it=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ot=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ct=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$e="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ut=new RegExp(`^${$e}$`);function Pe(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function lt(s){return new RegExp(`^${Pe(s)}$`)}function ht(s){let e=`${$e}T${Pe(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ft(s,e){return!!((e==="v4"||!e)&&at.test(s)||(e==="v6"||!e)&&it.test(s))}function pt(s,e){if(!et.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function mt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&ot.test(s))}class R extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.string,received:n.parsedType}),m}const r=new C;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.lengthn.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=e.data.length>n.value,o=e.data.lengthe.test(a),{validation:t,code:d.invalid_string,...h.errToObj(r)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew R({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...g(s)});function _t(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,n=Number.parseInt(s.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}class q extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.number,received:n.parsedType}),m}let r;const a=new C;for(const n of this._def.checks)n.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?_t(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,a){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew q({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...g(s)});class Y extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const a=new C;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,a){return new Y({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Y({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...g(s)});class he extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...g(s)});class K extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.date,received:n.parsedType}),m}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_date}),m}const r=new C;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):v.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew K({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...g(s)});class Ae extends y{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodSymbol,...g(s)});class fe extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodUndefined,...g(s)});class pe extends y{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodNull,...g(s)});class Ee extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ee.create=s=>new Ee({typeName:_.ZodAny,...g(s)});class me extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}me.create=s=>new me({typeName:_.ZodUnknown,...g(s)});class P extends y{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...g(s)});class Ze extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return O(e.data)}}Ze.create=s=>new Ze({typeName:_.ZodVoid,...g(s)});class N extends y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,o=t.data.lengtha.maxLength.value&&(c(t,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>a.type._parseAsync(new E(t,i,t.path,o)))).then(i=>C.mergeArray(r,i));const n=[...t.data].map((i,o)=>a.type._parseSync(new E(t,i,t.path,o)));return C.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(s,e)=>new N({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...g(e)});function U(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=j.create(U(r))}return new w({...s._def,shape:()=>e})}else return s instanceof N?new N({...s._def,type:U(s.element)}):s instanceof j?j.create(U(s.unwrap())):s instanceof D?D.create(U(s.unwrap())):s instanceof z?z.create(s.items.map(e=>U(e))):s}class w extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:u.object,received:p.parsedType}),m}const{status:r,ctx:a}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in a.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const x=n[p],W=a.data[p];f.push({key:{status:"valid",value:p},value:x._parse(new E(a,W,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:a.data[x]}});else if(p==="strict")o.length>0&&(c(a,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const x of o){const W=a.data[x];f.push({key:{status:"valid",value:x},value:p._parse(new E(a,W,a.path,x)),alwaysSet:x in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const p=[];for(const x of f){const W=await x.key,qe=await x.value;p.push({key:W,value:qe,alwaysSet:x.alwaysSet})}return p}).then(p=>C.mergeObjectSync(r,p)):C.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new w({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var n,i;const a=((i=(n=this._def).errorMap)==null?void 0:i.call(n,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new w({...this._def,unknownKeys:"strip"})}passthrough(){return new w({...this._def,unknownKeys:"passthrough"})}extend(e){return new w({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w({...this._def,catchall:e})}pick(e){const t={};for(const r of v.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}omit(e){const t={};for(const r of v.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}deepPartial(){return U(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new w({...this._def,shape:()=>t})}required(e){const t={};for(const r of v.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let n=this.shape[r];for(;n instanceof j;)n=n._def.innerType;t[r]=n}return new w({...this._def,shape:()=>t})}keyof(){return Me(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...g(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...g(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...g(e)});class ee extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=n.map(o=>new I(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async n=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(a);{let n;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},x=f._parseSync({data:t.data,path:t.path,parent:p});if(x.status==="valid")return x;x.status==="dirty"&&!n&&(n={result:x,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const o=i.map(f=>new I(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}ee.create=(s,e)=>new ee({options:s,typeName:_.ZodUnion,...g(e)});const Z=s=>s instanceof ge?Z(s.schema):s instanceof L?Z(s.innerType()):s instanceof re?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?Z(s._def.innerType):s instanceof fe?[void 0]:s instanceof pe?[null]:s instanceof j?[void 0,...Z(s.unwrap())]:s instanceof D?[null,...Z(s.unwrap())]:s instanceof ze||s instanceof oe?Z(s.unwrap()):s instanceof ie?Z(s._def.innerType):[];class ke extends y{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return c(t,{code:d.invalid_type,expected:u.object,received:t.parsedType}),m;const r=this.discriminator,a=t.data[r],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const n of t){const i=Z(n.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,n)}}return new ke({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...g(r)})}}function _e(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const a=v.objectKeys(e),n=v.objectKeys(s).filter(o=>a.indexOf(o)!==-1),i={...s,...e};for(const o of n){const f=_e(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const a=[];for(let n=0;n{if(Ce(n)||Ce(i))return m;const o=_e(n.value,i.value);return o.valid?((Oe(n)||Oe(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,i])=>a(n,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}te.create=(s,e,t)=>new te({left:s,right:e,typeName:_.ZodIntersection,...g(t)});class z extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new E(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(n).then(i=>C.mergeArray(t,i)):C.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new z({...this._def,rest:e})}}z.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new z({items:s,typeName:_.ZodTuple,rest:null,...g(e)})};class se extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:d.invalid_type,expected:u.object,received:r.parsedType}),m;const a=[],n=this._def.keyType,i=this._def.valueType;for(const o in r.data)a.push({key:n._parse(new E(r,o,r.path,o)),value:i._parse(new E(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?C.mergeObjectAsync(t,a):C.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof y?new se({keyType:e,valueType:t,typeName:_.ZodRecord,...g(r)}):new se({keyType:R.create(),valueType:e,typeName:_.ZodRecord,...g(t)})}}class Re extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:a._parse(new E(r,o,r.path,[p,"key"])),value:n._parse(new E(r,f,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const p=await f.key,x=await f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,x=f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}}}}Re.create=(s,e,t)=>new Re({valueType:e,keyType:s,typeName:_.ZodMap,...g(t)});class H extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const a=this._def;a.minSize!==null&&r.data.sizea.maxSize.value&&(c(r,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function i(f){const p=new Set;for(const x of f){if(x.status==="aborted")return m;x.status==="dirty"&&t.dirty(),p.add(x.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>n._parse(new E(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new H({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new H({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}H.create=(s,e)=>new H({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...g(e)});class ge extends y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ge.create=(s,e)=>new ge({getter:s,typeName:_.ZodLazy,...g(e)});class re extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}re.create=(s,e)=>new re({value:s,typeName:_.ZodLiteral,...g(e)});function Me(s,e){return new V({values:s,typeName:_.ZodEnum,...g(e)})}class V extends y{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:v.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}V.create=Me;class ye extends y{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const a=v.objectValues(t);return c(r,{expected:v.joinValues(a),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:a}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...g(e)});class ae extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return O(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ae.create=(s,e)=>new ae({type:s,typeName:_.ZodPromise,...g(e)});class L extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const i=a.transform(r.data,n);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?J(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?J(o.value):o}}if(a.type==="refinement"){const i=o=>{const f=a.refinement(o,n);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!B(i))return m;const o=a.transform(i.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>B(i)?Promise.resolve(a.transform(i.value,n)).then(o=>({status:t.value,value:o})):m);v.assertNever(a)}}L.create=(s,e,t)=>new L({schema:s,typeName:_.ZodEffects,effect:e,...g(t)});L.createWithPreprocess=(s,e,t)=>new L({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...g(t)});class j extends y{_parse(e){return this._getType(e)===u.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(s,e)=>new j({innerType:s,typeName:_.ZodOptional,...g(e)});class D extends y{_parse(e){return this._getType(e)===u.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}D.create=(s,e)=>new D({innerType:s,typeName:_.ZodNullable,...g(e)});class ne extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...g(e)});class ie extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return X(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...g(e)});class je extends y{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}je.create=s=>new je({typeName:_.ZodNaN,...g(s)});class ze extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class be extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),J(n.value)):this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new be({in:e,out:t,typeName:_.ZodPipeline})}}class oe extends y{_parse(e){const t=this._def.innerType._parse(e),r=a=>(B(a)&&(a.value=Object.freeze(a.value)),a);return X(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}oe.create=(s,e)=>new oe({innerType:s,typeName:_.ZodReadonly,...g(e)});var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const l=R.create,b=q.create,de=he.create,gt=me.create;P.create;const T=N.create,k=w.create,Ve=ee.create,Le=ke.create;te.create;z.create;const De=se.create,Q=re.create,ve=V.create;ae.create;j.create;D.create;const A=De(gt()),we=k({id:b(),name:l(),slug:l().optional()}).passthrough(),ce=k({url:l(),is_official:de()}),xe=k({task_id:b(),dataset_id:b(),model_name:l().nullish(),harness:l().nullish(),methodology:l().nullish(),metrics:De(Ve([l(),b()])),uses_additional_data:de().optional(),is_open:de().optional(),best_rank:b().nullish(),best_metric:l().nullish(),evaluated_on:l().nullish(),external_source_url:l().nullish(),num_parameters:b().nullish(),hf_model_url:l().nullish()}).passthrough(),yt=xe.partial().extend({id:b().optional()}),vt=Le("op",[k({op:Q("create"),data:xe}),k({op:Q("update"),evaluation_id:b(),data:xe}),k({op:Q("delete"),evaluation_id:b()})]),Ie=k({hf_models:T(l()),hf_datasets:T(l()),hf_spaces:T(l())}),Te=k({file_name:l(),mime_type:l(),data_url:l().optional(),url:l().optional()}),F=k({name:l(),description:l().optional()}),xt=F.extend({image:Te.optional(),image_credit:l().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:l().optional()}),kt=F.extend({image:Te.optional(),image_credit:l().optional(),source_paper_id:b().optional(),source_url:l().optional(),source_title:l().optional()}),bt=Ve([k({benchmark:l(),task:l(),description:l()}),F.extend({description:l(),task_ids:T(b()),full_name:l().optional(),url:l().optional(),hf_url:l().optional(),paper_url:l().optional(),license_name:l().optional(),license_url:l().optional()})]),wt=F.extend({description:l(),direction:ve(["higher_is_better","lower_is_better"]),full_name:l().optional(),scale:l().optional(),task_id:b(),dataset_id:b()}),Tt=F.extend({short_name:l().optional(),venue:l().optional(),location:l().optional(),url:l(),year:b(),start_date:l().optional(),end_date:l().optional()}),St=F.extend({hf_slug:l().optional(),website_url:l().optional(),image:Te.optional()}),Ct=k({id:b(),paper_id:b().nullable(),hf_username:l(),hf_subject:l().nullish(),is_author:de(),status:ve(["pending","approved","rejected"]),applied_payload:A.nullish(),conflict_payload:A.nullish(),result_entity_type:l().nullish(),result_entity_id:l().nullish(),admin_note:l().nullish(),user_review_reason:l().nullish(),reviewed_by:l().nullish(),reviewed_by_kind:ve(["human","codex","auto"]).nullish(),catalog_event_id:l().nullish(),review_evidence:A.nullish(),created_at:l(),updated_at:l(),reviewed_at:l().nullish()});function S(s,e,t){return Ct.extend({edit_type:Q(s),proposed_payload:e,current_payload:t.nullish()})}const Ot=S("tasks",k({task_ids:T(b())}),k({tasks:T(we)})),Nt=S("methods",k({method_ids:T(b())}),k({methods:T(we)})),At=S("evaluations",k({operations:T(vt)}),k({evaluations:T(yt)})),Et=S("repositories",k({repositories:T(ce)}),k({repositories:T(ce)})),Zt=S("project_pages",k({project_pages:T(ce)}),k({project_pages:T(ce)})),Rt=S("source_url",k({source_url:l()}),k({source_url:l().nullish()})),jt=S("hf_artifacts",Ie,Ie),It=S("x_threads",k({x_threads:T(l())}),k({x_threads:T(k({url:l()}))})),$t=S("organizations",k({organization_ids:T(b())}),k({organizations:T(we)})),Pt=S("new_task",xt,A),Mt=S("new_method",kt,A),zt=S("new_benchmark",bt,A),Vt=S("new_metric",wt,A),Lt=S("new_conference",Tt,A),Dt=S("new_organization",St,A),Ut=S("new_external_paper",k({title:l().optional(),source_url:l(),authors:T(l()),date_published:l().optional(),abstract:l().optional()}),A),Ue=Le("edit_type",[Ot,Nt,At,Et,Zt,Rt,jt,It,$t,Pt,Mt,zt,Vt,Lt,Dt,Ut]);function Yt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const M=(s,e)=>({directory:{title:s,subtitle:e}}),Ht={tasks:{label:"tasks",administrative:!1},methods:{label:"methods",administrative:!1},evaluations:{label:"evaluations",administrative:!1},repositories:{label:"repositories",administrative:!1},project_pages:{label:"project pages",administrative:!1},source_url:{label:"source url",administrative:!1},x_threads:{label:"x threads",administrative:!1},hf_artifacts:{label:"hf artifacts",administrative:!1},organizations:{label:"organizations",administrative:!1},new_task:{label:"new task",administrative:!0,...M("New task","Task suggestion")},new_method:{label:"new method",administrative:!0,...M("New method","Method suggestion")},new_benchmark:{label:"new benchmark",administrative:!0,...M("New benchmark","Benchmark suggestion")},new_metric:{label:"new metric",administrative:!0,...M("New metric","Metric suggestion")},new_conference:{label:"new conference",administrative:!0,...M("New conference","Conference suggestion")},new_organization:{label:"new organization",administrative:!1,...M("New organization","Organization suggestion")},new_external_paper:{label:"external paper",administrative:!1,...M("External paper","External paper submission")}},Bt=k({count:b(),results:T(Ue)});class qt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Be(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new qt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const G=s=>Be(Ue,s),Ft=s=>Be(Bt,s);class Wt{constructor(e){this.request=e}async submit(e){return G(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[a,n]of Object.entries(e??{}))n!==void 0&&t.set(a,String(n));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(Ft)}revertAutoApproved(e,t={}){return this.request(`/admin/submitters/${encodeURIComponent(e)}/revert-auto-approved`,{method:"POST",body:JSON.stringify(t)})}async get(e){return G(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return G(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return G(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Gt=new Wt(Fe);export{Ht as E,Yt as p,Gt as s}; diff --git a/assets/switch-Crqp0RkL.js b/assets/switch-BSZohE4x.js similarity index 92% rename from assets/switch-Crqp0RkL.js rename to assets/switch-BSZohE4x.js index ca08c5ed361f018995ba6e6c606f1fa5fbdeaeab..457e7acc0dead560989b7702957c2d38a0561224 100644 --- a/assets/switch-Crqp0RkL.js +++ b/assets/switch-BSZohE4x.js @@ -1 +1 @@ -import{r as s,w as C,v as I,j as a,t as y,x as M,y as A,z as H,A as g}from"./index-YwiKC6Po.js";import{u as z}from"./index-BaDZKp6X.js";var b="Switch",[U]=H(b),[q,L]=U(b),P=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),x=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(q,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),x&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),x&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=E;var O="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=z(e),v=A(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:g("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(D,{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S}; +import{r as s,x as C,w as I,j as a,v as y,y as M,z as A,A as H,B as g}from"./index-CbgxfyGU.js";import{u as z}from"./index-CxPKwmVQ.js";var b="Switch",[U]=H(b),[q,L]=U(b),P=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),x=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(q,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),x&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),x&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=E;var O="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=z(e),v=A(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:g("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(D,{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S}; diff --git a/assets/textarea-BPIMGf5w.js b/assets/textarea-Bf06GTSH.js similarity index 86% rename from assets/textarea-BPIMGf5w.js rename to assets/textarea-Bf06GTSH.js index 247cacec8a3ee00fa728a91cf9f58786811f54b3..e458b733674ecc84cb91df31be71e2179c1aa3e1 100644 --- a/assets/textarea-BPIMGf5w.js +++ b/assets/textarea-Bf06GTSH.js @@ -1 +1 @@ -import{r as s,j as a,A as t}from"./index-YwiKC6Po.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; +import{r as s,j as a,B as t}from"./index-CbgxfyGU.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; diff --git a/assets/thumbs-up-D9G2aLNB.js b/assets/thumbs-up-CDCzGuPd.js similarity index 90% rename from assets/thumbs-up-D9G2aLNB.js rename to assets/thumbs-up-CDCzGuPd.js index a3e791c57d21f890c904bb99930193487edcee0d..7fdce474174556af2311f49039504f44eb6d63da 100644 --- a/assets/thumbs-up-D9G2aLNB.js +++ b/assets/thumbs-up-CDCzGuPd.js @@ -1,4 +1,4 @@ -import{n as a}from"./index-YwiKC6Po.js";/** +import{n as a}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/transform-CNg3rvXk.js b/assets/transform-0Udg2p6b.js similarity index 98% rename from assets/transform-CNg3rvXk.js rename to assets/transform-0Udg2p6b.js index 8040921e907cd9da187f5eb7c910f3cbce8ea9f1..7147e8f49dc0afd19430a84e417d5434095eef91 100644 --- a/assets/transform-CNg3rvXk.js +++ b/assets/transform-0Udg2p6b.js @@ -1 +1 @@ -import{Y as _}from"./index-YwiKC6Po.js";function w(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function D(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const A=6048e5,z=864e5,I=6e4,R=36e5;let V={};function W(){return V}function v(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=w(t),i=a.getDay(),o=(i=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function Z(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),S(n)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!K(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function N(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:N({formats:at,defaultWidth:"full"}),time:N({formats:it,defaultWidth:"full"}),dateTime:N({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function O(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:O({values:dt,defaultWidth:"wide"}),quarter:O({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:ft,defaultWidth:"wide"}),day:O({values:ht,defaultWidth:"wide"}),dayPeriod:O({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const kt=/^(\d+)(th|st|nd|rd)?/i,Ot=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},vt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:kt,parsePattern:Ot,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+S(e)-+Z(e);return Math.round(n/A)+1}function Q(t,e){var f,g,l,k;const n=w(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((k=(l=a.locale)==null?void 0:l.options)==null?void 0:k.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=v(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=v(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ut(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),v(i,e)}function Lt(t,e){const n=w(t),r=+v(n,e)-+Ut(n,e);return Math.round(r/A)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=j(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Lt(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+U(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+U(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function U(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(r,e)).replace("{{time}}",X(a,e))},At={p:X,P:Ht},It=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return It.test(t)}function Xt(t){return Rt.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Zt=/[a-zA-Z]/;function Kt(t,e,n){var f,g,l,k;const r=W(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((k=(l=r.locale)==null?void 0:l.options)==null?void 0:k.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const Y=At[h];return Y(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(q[h])return{isToken:!0,value:m};if(h.match(Zt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const Y=q[h[0]];return Y(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function B(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=C(e[1]),r=C(e[2]),a=C(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function C(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function G(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return Kt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function ke(t){return(t||[]).filter(e=>e.best_rank>=1&&e.best_rank<=3).map(e=>{let n=null;if(e.dataset_slug){const r=new URLSearchParams;e.task_slug&&r.set("task",e.task_slug),r.set("eval",e.evaluation_id),n=`/benchmark/${e.dataset_slug}?${r}`}return{name:e.dataset_name,href:n,rank:e.best_rank}})}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=ke(t.leaderboard_ranks);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],authorIds:(t.author_links||[]).map(l=>l.id??null),authorHfProfiles:(t.author_links||[]).map(l=>l.hf_username?{username:l.hf_username,avatarUrl:l.hf_avatar_url??null}:null),tags:s,methods:u,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:_(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=$.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return T.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const T=new Set(["3D","AI","OCR"]),$=new Map([["3d-tracking","3D Tracking"],["point-tracking","2D Point Tracking"],["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function xe(t,e){const n=t||Oe(e||""),r=$.get((e==null?void 0:e.toLowerCase())||Pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&T.has(a)||T.has(i)?i:n.replace(/\b[A-Za-z0-9]+\b/g,s=>/^[A-Z0-9]{2,}$/.test(s)||T.has(s.toUpperCase())?s.toUpperCase():s.charAt(0).toUpperCase()+s.slice(1).toLowerCase())}function Pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{ke as a,xe as d,Oe as h,be as s,ve as t}; +import{Z as _}from"./index-CbgxfyGU.js";function w(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function D(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const A=6048e5,z=864e5,I=6e4,R=36e5;let V={};function W(){return V}function v(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=w(t),i=a.getDay(),o=(i=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Z(t,e){const n=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function J(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),S(n)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!K(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function N(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:N({formats:at,defaultWidth:"full"}),time:N({formats:it,defaultWidth:"full"}),dateTime:N({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function O(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:O({values:dt,defaultWidth:"wide"}),quarter:O({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:ft,defaultWidth:"wide"}),day:O({values:ht,defaultWidth:"wide"}),dayPeriod:O({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const kt=/^(\d+)(th|st|nd|rd)?/i,Ot=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},vt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:kt,parsePattern:Ot,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return Z(e,et(e))+1}function qt(t){const e=w(t),n=+S(e)-+J(e);return Math.round(n/A)+1}function Q(t,e){var f,g,l,k;const n=w(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((k=(l=a.locale)==null?void 0:l.options)==null?void 0:k.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=v(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=v(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ut(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),v(i,e)}function Lt(t,e){const n=w(t),r=+v(n,e)-+Ut(n,e);return Math.round(r/A)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=j(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Lt(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+U(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+U(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function U(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(r,e)).replace("{{time}}",X(a,e))},At={p:X,P:Ht},It=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return It.test(t)}function Xt(t){return Rt.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Zt=/''/g,Jt=/[a-zA-Z]/;function Kt(t,e,n){var f,g,l,k;const r=W(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((k=(l=r.locale)==null?void 0:l.options)==null?void 0:k.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const Y=At[h];return Y(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(q[h])return{isToken:!0,value:m};if(h.match(Jt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const Y=q[h[0]];return Y(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Zt,"'"):t}function B(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=C(e[1]),r=C(e[2]),a=C(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function C(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function G(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return Kt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function ke(t){return(t||[]).filter(e=>e.best_rank>=1&&e.best_rank<=3).map(e=>{let n=null;if(e.dataset_slug){const r=new URLSearchParams;e.task_slug&&r.set("task",e.task_slug),r.set("eval",e.evaluation_id),n=`/benchmark/${e.dataset_slug}?${r}`}return{name:e.dataset_name,href:n,rank:e.best_rank}})}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=ke(t.leaderboard_ranks);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],authorIds:(t.author_links||[]).map(l=>l.id??null),authorHfProfiles:(t.author_links||[]).map(l=>l.hf_username?{username:l.hf_username,avatarUrl:l.hf_avatar_url??null}:null),tags:s,methods:u,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:_(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=$.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return T.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const T=new Set(["3D","AI","OCR"]),$=new Map([["3d-tracking","3D Tracking"],["point-tracking","2D Point Tracking"],["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function xe(t,e){const n=t||Oe(e||""),r=$.get((e==null?void 0:e.toLowerCase())||Pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&T.has(a)||T.has(i)?i:n.replace(/\b[A-Za-z0-9]+\b/g,s=>/^[A-Z0-9]{2,}$/.test(s)||T.has(s.toUpperCase())?s.toUpperCase():s.charAt(0).toUpperCase()+s.slice(1).toLowerCase())}function Pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{ke as a,xe as d,Oe as h,be as s,ve as t}; diff --git a/assets/trending-up-Sm0tkX5g.js b/assets/trending-up-B3K5RlyX.js similarity index 89% rename from assets/trending-up-Sm0tkX5g.js rename to assets/trending-up-B3K5RlyX.js index e5683f62e4d43f81e8dc26b2cf5e70189d87100e..2251c63fb5edf1344db188255da8012de9a9331e 100644 --- a/assets/trending-up-Sm0tkX5g.js +++ b/assets/trending-up-B3K5RlyX.js @@ -1,4 +1,4 @@ -import{n}from"./index-YwiKC6Po.js";/** +import{n}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/triangle-alert-BWObrJc7.js b/assets/triangle-alert-U7T_j3JE.js similarity index 94% rename from assets/triangle-alert-BWObrJc7.js rename to assets/triangle-alert-U7T_j3JE.js index 32ac5f273ce5459298a8c1ac28c2a7d0ca9ef548..00949b2b0ea4d66598f2958b57db27183bf2b765 100644 --- a/assets/triangle-alert-BWObrJc7.js +++ b/assets/triangle-alert-U7T_j3JE.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-YwiKC6Po.js";/** +import{n as e}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/trophy-B60aAfG3.js b/assets/trophy-BQwEH3L7.js similarity index 93% rename from assets/trophy-B60aAfG3.js rename to assets/trophy-BQwEH3L7.js index cc4f518c3937f73293a3a7d4090d563eed8be524..8cea5bef1bc177c1a52d488f17448228313dfc46 100644 --- a/assets/trophy-B60aAfG3.js +++ b/assets/trophy-BQwEH3L7.js @@ -1,4 +1,4 @@ -import{n as a}from"./index-YwiKC6Po.js";/** +import{n as a}from"./index-CbgxfyGU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/useDebounce-BFugPTG4.js b/assets/useDebounce-DkuI5tkx.js similarity index 66% rename from assets/useDebounce-BFugPTG4.js rename to assets/useDebounce-DkuI5tkx.js index b80c66260bdc6bbf7778451569b77c826a9cf9b3..596bdcec81c5df07264b3bb1bae0e1f54cb36e8e 100644 --- a/assets/useDebounce-BFugPTG4.js +++ b/assets/useDebounce-DkuI5tkx.js @@ -1 +1 @@ -import{r as o}from"./index-YwiKC6Po.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; +import{r as o}from"./index-CbgxfyGU.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; diff --git a/assets/useHashScrollOnReady-BKkkyVVX.js b/assets/useHashScrollOnReady-DgB3XFQL.js similarity index 90% rename from assets/useHashScrollOnReady-BKkkyVVX.js rename to assets/useHashScrollOnReady-DgB3XFQL.js index f958df48a12cc69eddc278f7ab37883b3a0064dd..114a7737178db6c80b2e7d508f05819af65259dc 100644 --- a/assets/useHashScrollOnReady-BKkkyVVX.js +++ b/assets/useHashScrollOnReady-DgB3XFQL.js @@ -1 +1 @@ -import{j as s,L as h,r as x}from"./index-YwiKC6Po.js";import{S as p}from"./skeleton-CXR1qouH.js";import{A as j,a as m}from"./alert-Cx5luC5D.js";import{T as d}from"./trending-up-Sm0tkX5g.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:l=180,isLoading:o,error:t,mono:c})=>!o&&!t&&!(e!=null&&e.length)?null:s.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[s.jsxs("div",{className:"taxonomy-trending-header",children:[s.jsxs("h2",{children:[s.jsx(d,{size:22,"aria-hidden":"true"}),"Trending"]}),s.jsxs("p",{className:"taxonomy-trending-note",children:[n==="task"?"Tasks":"Methods"," across all areas whose share of papers in the last ",i," days grew the most against the preceding ",l," days."]})]}),t?s.jsx(j,{variant:"destructive",children:s.jsxs(m,{children:["Failed to load trending ",n,"s."]})}):o?s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((a,r)=>s.jsx(p,{className:"h-20"},r))}):s.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((a,r)=>s.jsxs(h,{to:a.href,className:"tag-cell",children:[s.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[s.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),a.icon&&s.jsx("span",{className:"task-icon",style:{color:a.iconColor},children:s.jsx(a.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),a.name]}),s.jsxs("div",{className:"meta taxonomy-trending-meta",children:[a.areaName&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:a.areaName}),s.jsx("span",{children:"·"})]}),s.jsxs("span",{children:[a.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),s.jsx("span",{children:"·"}),s.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${a.shareLift.toFixed(1)}× its baseline share`,children:[s.jsx(d,{size:12,"aria-hidden":"true"}),a.shareLift.toFixed(1),"×"]})]})]},a.id))})]});function v(n){x.useEffect(()=>{var e;!n||!window.location.hash||(e=document.getElementById(window.location.hash.slice(1)))==null||e.scrollIntoView({block:"start"})},[n])}export{y as T,v as u}; +import{j as s,L as h,r as x}from"./index-CbgxfyGU.js";import{S as p}from"./skeleton-HwvdxvSN.js";import{A as j,a as m}from"./alert-CFDDvdIM.js";import{T as d}from"./trending-up-B3K5RlyX.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:l=180,isLoading:o,error:t,mono:c})=>!o&&!t&&!(e!=null&&e.length)?null:s.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[s.jsxs("div",{className:"taxonomy-trending-header",children:[s.jsxs("h2",{children:[s.jsx(d,{size:22,"aria-hidden":"true"}),"Trending"]}),s.jsxs("p",{className:"taxonomy-trending-note",children:[n==="task"?"Tasks":"Methods"," across all areas whose share of papers in the last ",i," days grew the most against the preceding ",l," days."]})]}),t?s.jsx(j,{variant:"destructive",children:s.jsxs(m,{children:["Failed to load trending ",n,"s."]})}):o?s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((a,r)=>s.jsx(p,{className:"h-20"},r))}):s.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((a,r)=>s.jsxs(h,{to:a.href,className:"tag-cell",children:[s.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[s.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),a.icon&&s.jsx("span",{className:"task-icon",style:{color:a.iconColor},children:s.jsx(a.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),a.name]}),s.jsxs("div",{className:"meta taxonomy-trending-meta",children:[a.areaName&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:a.areaName}),s.jsx("span",{children:"·"})]}),s.jsxs("span",{children:[a.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),s.jsx("span",{children:"·"}),s.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${a.shareLift.toFixed(1)}× its baseline share`,children:[s.jsx(d,{size:12,"aria-hidden":"true"}),a.shareLift.toFixed(1),"×"]})]})]},a.id))})]});function v(n){x.useEffect(()=>{var e;!n||!window.location.hash||(e=document.getElementById(window.location.hash.slice(1)))==null||e.scrollIntoView({block:"start"})},[n])}export{y as T,v as u}; diff --git a/assets/useInfiniteQuery-BEbL80ez.js b/assets/useInfiniteQuery-BAc_4HO5.js similarity index 89% rename from assets/useInfiniteQuery-BEbL80ez.js rename to assets/useInfiniteQuery-BAc_4HO5.js index f2ec43992da6e735d35aff3fbdf906b219e9f46d..65d028e4c3a8d718ee52400160f28f8564eb400d 100644 --- a/assets/useInfiniteQuery-BEbL80ez.js +++ b/assets/useInfiniteQuery-BAc_4HO5.js @@ -1 +1 @@ -import{Q as v,h as p}from"./useQuery-DPH6Mb2w.js";import{aU as x,aV as b}from"./index-YwiKC6Po.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function w(e,t){return p(e,l)}export{w as u}; +import{Q as v,h as p}from"./useQuery-Bx9s5-D2.js";import{aV as x,aW as b}from"./index-CbgxfyGU.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function w(e,t){return p(e,l)}export{w as u}; diff --git a/assets/useIntersectionObserver-Dt36kyjs.js b/assets/useIntersectionObserver-CID9Kkak.js similarity index 86% rename from assets/useIntersectionObserver-Dt36kyjs.js rename to assets/useIntersectionObserver-CID9Kkak.js index 44ebd4a746fb357c3b5e9d81314cb995ac85891e..8aedf0015c8aecb5af066ace7741c99512f6853a 100644 --- a/assets/useIntersectionObserver-Dt36kyjs.js +++ b/assets/useIntersectionObserver-CID9Kkak.js @@ -1 +1 @@ -import{r}from"./index-YwiKC6Po.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u}; +import{r}from"./index-CbgxfyGU.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u}; diff --git a/assets/useMutation-f6iDkf3w.js b/assets/useMutation-P_trTy9i.js similarity index 74% rename from assets/useMutation-f6iDkf3w.js rename to assets/useMutation-P_trTy9i.js index 13670310dd704026083475f120ebacd946c2ac79..23ebd972a71de65c90433655a53cbe52b85f93c1 100644 --- a/assets/useMutation-f6iDkf3w.js +++ b/assets/useMutation-P_trTy9i.js @@ -1 +1 @@ -var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),v=(i,t,s)=>(E(i,t,"access private method"),s);import{at as U,av as k,aB as j,aC as q,au as P,f as D,r as y,ax as L,aD as A}from"./index-YwiKC6Po.js";var a,c,o,h,n,g,S,w,B=(w=class extends U{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),v(this,n,g).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),k(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){v(this,n,g).call(this),v(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),v(this,n,g).call(this),v(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,g=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,C=e(this,c).context,M={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,C,M)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,C,M)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,C,M)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,C,M)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function T(i,t){const s=D(),[r]=y.useState(()=>new B(s,i));y.useEffect(()=>{r.setOptions(i)},[r,i]);const u=y.useSyncExternalStore(y.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=y.useCallback((d,O)=>{r.mutate(d,O).catch(L)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{T as u}; +var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{ax as U,az as k,aC as j,aD as q,ay as P,f as D,r as v,aB as L,aE as z}from"./index-CbgxfyGU.js";var a,c,o,h,n,g,S,w,A=(w=class extends U{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,g).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),k(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,g).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,g).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,g=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,C=e(this,c).context,M={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,C,M)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,C,M)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,C,M)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,C,M)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function Q(i,t){const s=D(),[r]=v.useState(()=>new A(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(L)},[r]);if(u.error&&z(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{Q as u}; diff --git a/assets/usePapers-C1deOZKl.js b/assets/usePapers-CJaWLZ3y.js similarity index 67% rename from assets/usePapers-C1deOZKl.js rename to assets/usePapers-CJaWLZ3y.js index 762d6180fb8ebc49845d711c135afa2d3d43a4a9..17c142491dd846f84734d524061e392b2a45af28 100644 --- a/assets/usePapers-C1deOZKl.js +++ b/assets/usePapers-CJaWLZ3y.js @@ -1 +1 @@ -import{a as u,p as i}from"./paperQueryKeys-C5FMa4Oj.js";import{u as o}from"./useQuery-DPH6Mb2w.js";import{u as f}from"./useInfiniteQuery-BEbL80ez.js";function c(e,t=!0){return o({queryKey:i.detail(e),queryFn:()=>u.get(e),enabled:t&&!!e,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function d(e,t,{enabled:n=!0,initialPage:s=1}={}){return f({queryKey:e,queryFn:({pageParam:a})=>t(a),initialPageParam:s,getNextPageParam:a=>a.next_page??void 0,enabled:n,staleTime:5*60*1e3,placeholderData:(a,r)=>(r==null?void 0:r.queryKey[0])===e[0]?a:void 0,refetchOnWindowFocus:!1})}export{c as a,d as u}; +import{a as u,p as i}from"./paperQueryKeys-B8u1BWlI.js";import{u as o}from"./useQuery-Bx9s5-D2.js";import{u as f}from"./useInfiniteQuery-BAc_4HO5.js";function c(e,t=!0){return o({queryKey:i.detail(e),queryFn:()=>u.get(e),enabled:t&&!!e,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function d(e,t,{enabled:n=!0,initialPage:s=1}={}){return f({queryKey:e,queryFn:({pageParam:a})=>t(a),initialPageParam:s,getNextPageParam:a=>a.next_page??void 0,enabled:n,staleTime:5*60*1e3,placeholderData:(a,r)=>(r==null?void 0:r.queryKey[0])===e[0]?a:void 0,refetchOnWindowFocus:!1})}export{c as a,d as u}; diff --git a/assets/useQuery-DPH6Mb2w.js b/assets/useQuery-Bx9s5-D2.js similarity index 83% rename from assets/useQuery-DPH6Mb2w.js rename to assets/useQuery-Bx9s5-D2.js index 3933537d731c362e8f9966da0a0d63816a969f84..5d8bbff0bbf7a3557bbecc3adcb8c48407b3a03d 100644 --- a/assets/useQuery-DPH6Mb2w.js +++ b/assets/useQuery-Bx9s5-D2.js @@ -1 +1 @@ -var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{at as Mt,aE as gt,aF as S,av as q,aG as H,ax as tt,aH as et,aI as vt,aJ as Tt,aK as J,aL as Qt,aM as xt,aN as mt,au as Ct,r as O,aD as Ot,f as _t}from"./index-YwiKC6Po.js";var v,a,j,g,x,U,C,w,W,P,L,_,F,M,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Mt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,j);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,W);p(this,P);p(this,L);p(this,_);p(this,F);p(this,M);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||H(this.options.staleTime,i(this,a))!==H(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,M))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Ut(this,r)&&(u(this,g,r),u(this,U,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,U),b=t!==r?t.state:i(this,j),{state:E}=t;let d={...E},T=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:m}=d;f=d.data;let z=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,z=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(m="success",f=mt(o==null?void 0:o.data,R,e),T=!0)}if(e.select&&f!==void 0&&!z)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,W))f=i(this,P);else try{u(this,W,e.select),f=e.select(f),f=mt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),B=Date.now(),m="error");const X=d.fetchStatus==="fetching",Y=m==="pending",Z=m==="error",lt=Y&&X,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:m==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:T,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,k=I.status==="error"&&!R,V=G=>{k?G.reject(I.error):R&&G.resolve(I.data)},pt=()=>{const G=u(this,C,I.promise=gt());V(G)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,U,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const D=y;return i(this,g)[D]!==t[D]&&c.has(D)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,j=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,W=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,M=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=H(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Tt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,M,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,M))||i(this,M)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,M)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,j,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Dt(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Dt(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&H(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(H(t.staleTime,s))}function Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),Bt=()=>O.useContext(Nt),kt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},Ht=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),jt=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},Wt=(s,t)=>s.isLoading&&s.isFetching&&!t,zt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var T,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(T=o.getDefaultOptions().queries)==null?void 0:T._experimental_beforeQuery)==null||f.call(T,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jt(c),kt(c,h,y),At(h);const D=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(m=>{const z=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),z},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),zt(c,E))throw yt(c,b,h);if(Ht({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&Wt(E,r)){const m=D?yt(c,b,h):y==null?void 0:y.promise;m==null||m.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Pt as a,Bt as b,kt as c,At as d,jt as e,yt as f,Ht as g,Vt as h,zt as s,Xt as u}; +var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{ax as Mt,aF as gt,aG as S,az as q,aH as H,aB as tt,aI as et,aJ as vt,aK as Tt,aL as J,aM as Qt,aN as xt,aO as mt,ay as Ct,r as O,aE as Ot,f as _t}from"./index-CbgxfyGU.js";var v,a,j,g,x,D,C,w,z,P,L,_,F,M,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Mt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,j);p(this,g);p(this,x);p(this,D);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,F);p(this,M);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||H(this.options.staleTime,i(this,a))!==H(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,M))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Dt(this,r)&&(u(this,g,r),u(this,D,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,D),b=t!==r?t.state:i(this,j),{state:E}=t;let d={...E},T=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:m}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,W=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(m="success",f=mt(o==null?void 0:o.data,R,e),T=!0)}if(e.select&&f!==void 0&&!W)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,z))f=i(this,P);else try{u(this,z,e.select),f=e.select(f),f=mt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),B=Date.now(),m="error");const X=d.fetchStatus==="fetching",Y=m==="pending",Z=m==="error",lt=Y&&X,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:m==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:T,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,k=I.status==="error"&&!R,V=G=>{k?G.reject(I.error):R&&G.resolve(I.data)},pt=()=>{const G=u(this,C,I.promise=gt());V(G)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,D,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const U=y;return i(this,g)[U]!==t[U]&&c.has(U)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,j=new WeakMap,g=new WeakMap,x=new WeakMap,D=new WeakMap,C=new WeakMap,w=new WeakMap,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,M=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=H(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Tt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,M,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,M))||i(this,M)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,M)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,j,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Ut(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Ut(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&H(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(H(t.staleTime,s))}function Dt(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),Bt=()=>O.useContext(Nt),kt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},Ht=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),jt=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},zt=(s,t)=>s.isLoading&&s.isFetching&&!t,Wt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var T,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(T=o.getDefaultOptions().queries)==null?void 0:T._experimental_beforeQuery)==null||f.call(T,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jt(c),kt(c,h,y),At(h);const U=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(m=>{const W=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(Ht({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&zt(E,r)){const m=U?yt(c,b,h):y==null?void 0:y.promise;m==null||m.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Pt as a,Bt as b,kt as c,At as d,jt as e,yt as f,Ht as g,Vt as h,Wt as s,Xt as u}; diff --git a/index.html b/index.html index ff82206840b5a91151084c85e847013b1b8c4c4f..7a5a179ab3455c6aa8037e06c2882f361692e317 100644 --- a/index.html +++ b/index.html @@ -72,7 +72,7 @@ plausible.init(); })(); - +