diff --git a/assets/AgentLogos-e-hYOTh0.js b/assets/AgentLogos-RDfL-mz2.js similarity index 99% rename from assets/AgentLogos-e-hYOTh0.js rename to assets/AgentLogos-RDfL-mz2.js index 41a6757d5ef6ab45c97a5b2201075b1013adf3d2..bb4279826597661f26bbde07c6cf19c01a0d5a9d 100644 --- a/assets/AgentLogos-e-hYOTh0.js +++ b/assets/AgentLogos-RDfL-mz2.js @@ -1 +1 @@ -import{j as e}from"./index-CA09r0fx.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-DGz7IJy3.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-C9Oqhdjq.js b/assets/AiDeadlinesView-DFDzpADq.js similarity index 96% rename from assets/AiDeadlinesView-C9Oqhdjq.js rename to assets/AiDeadlinesView-DFDzpADq.js index 69063f9e9f24c0f37b3436c10f5d4642d1ea0292..86581fae0edd038e6bb4618c29926740b49364d2 100644 --- a/assets/AiDeadlinesView-C9Oqhdjq.js +++ b/assets/AiDeadlinesView-DFDzpADq.js @@ -1,3 +1,3 @@ -import{r as x,j as t}from"./index-CA09r0fx.js";import{u as A}from"./useQuery-GCOPnmOE.js";import{c as B}from"./catalog-C6oGGh8I.js";import{S as U}from"./switch-VPV7aWRb.js";import{S as W}from"./skeleton-CiNN3v7Q.js";import{A as O,a as V}from"./alert-DRS5VQLi.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-BMl1SbyK.js";import"./index-1y8ilIyE.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` +import{r as x,j as t}from"./index-DGz7IJy3.js";import{u as A}from"./useQuery-SnJNmisF.js";import{c as B}from"./catalog-CI50zqwR.js";import{S as U}from"./switch-CwjWc_fX.js";import{S as W}from"./skeleton-Qth9DQSW.js";import{A as O,a as V}from"./alert-CfvggGdB.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-DRb-cMlG.js";import"./index-Bx9aRYc1.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(` `),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},ne=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[m&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:m})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),u!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(u,r)},children:X(u,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:h&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),g=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default}; diff --git a/assets/ApiDocsView-D7YuFEO7.js b/assets/ApiDocsView-CArow2ru.js similarity index 98% rename from assets/ApiDocsView-D7YuFEO7.js rename to assets/ApiDocsView-CArow2ru.js index 5fff2e9916f9aa7adc0ce7aa3b712fbf4521d584..c27e7c8ce097fc65a6767c5a4dc8928c3429de66 100644 --- a/assets/ApiDocsView-D7YuFEO7.js +++ b/assets/ApiDocsView-CArow2ru.js @@ -1,4 +1,4 @@ -import{a1 as m,r as o,j as e}from"./index-CA09r0fx.js";import{u as f}from"./useQuery-GCOPnmOE.js";import{M as g}from"./index-BeqN5AbC.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{a1 as m,r as o,j as e}from"./index-DGz7IJy3.js";import{u as f}from"./useQuery-SnJNmisF.js";import{M as g}from"./index-DyDOGuaE.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/ArtifactWorkspace-BYQbPlsN.js b/assets/ArtifactWorkspace-DI-cB4-t.js similarity index 99% rename from assets/ArtifactWorkspace-BYQbPlsN.js rename to assets/ArtifactWorkspace-DI-cB4-t.js index 10655eee371810f7981e20eefdb013d4fae2f0db..29a57cd524a26d6daf5641ca609fe87a02b37605 100644 --- a/assets/ArtifactWorkspace-BYQbPlsN.js +++ b/assets/ArtifactWorkspace-DI-cB4-t.js @@ -1,4 +1,4 @@ -var iL=Object.defineProperty;var eA=n=>{throw TypeError(n)};var rL=(n,e,t)=>e in n?iL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var oe=(n,e,t)=>rL(n,typeof e!="symbol"?e+"":e,t),B0=(n,e,t)=>e.has(n)||eA("Cannot "+t);var f=(n,e,t)=>(B0(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?eA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),C=(n,e,t,s)=>(B0(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),T=(n,e,t)=>(B0(n,e,"access private method"),t);var ds=(n,e,t,s)=>({set _(i){C(n,e,i,t)},get _(){return f(n,e,s)}});import{g as $c,r as G,j as S,F as ee,L as Fv,V as oL,Z as L_,K as on,_ as sm,$ as Zy,X as D_,a0 as aL,m as TC,l as lL}from"./index-CA09r0fx.js";import{u as PC,P as RC,b as MC,M as cL,R as hL,W as uL,d as j_,A as dL,l as fL,K as pL,L as mL,N as gL,O as IC,Q as yL}from"./chatLaunch-CutMsO9s.js";/* empty css */import{H as Cp,a as $p,b as Tp}from"./hover-card-0saQl8Kd.js";import{u as wo}from"./useQuery-GCOPnmOE.js";import{f as vL,p as bL,T as wL}from"./github-Cto4qly3.js";import{G as Xy}from"./github-D8NiZH3t.js";import{F as OC}from"./file-text-7GwUpKU3.js";import{c as U0}from"./catalog-C6oGGh8I.js";import{r as _L,a as SL,P as F_,c as kL}from"./PaperPreviewLink-DUf7c7wv.js";import{M as AL,d as xL}from"./index-BeqN5AbC.js";import{r as EL}from"./index-qKrWNpd1.js";import{c as tA}from"./chat-XoDxf8nx.js";import{C as CL}from"./copy-BRZnlAd3.js";import{T as $L}from"./thumbs-up-BxkpoAw0.js";import{u as im}from"./useMutation-CUMX1r3q.js";import{E as NC}from"./external-link-b6zNfUPN.js";/** +var iL=Object.defineProperty;var eA=n=>{throw TypeError(n)};var rL=(n,e,t)=>e in n?iL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var oe=(n,e,t)=>rL(n,typeof e!="symbol"?e+"":e,t),B0=(n,e,t)=>e.has(n)||eA("Cannot "+t);var f=(n,e,t)=>(B0(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?eA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),C=(n,e,t,s)=>(B0(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),T=(n,e,t)=>(B0(n,e,"access private method"),t);var ds=(n,e,t,s)=>({set _(i){C(n,e,i,t)},get _(){return f(n,e,s)}});import{g as $c,r as G,j as S,F as ee,L as Fv,V as oL,Z as L_,K as on,_ as sm,$ as Zy,X as D_,a0 as aL,m as TC,l as lL}from"./index-DGz7IJy3.js";import{u as PC,P as RC,b as MC,M as cL,R as hL,W as uL,d as j_,A as dL,l as fL,L as pL,N as mL,O as gL,Q as IC,U as yL}from"./chatLaunch-DVedsuWi.js";/* empty css */import{H as Cp,a as $p,b as Tp}from"./hover-card-32Q2qmuv.js";import{u as wo}from"./useQuery-SnJNmisF.js";import{f as vL,p as bL,T as wL}from"./github-BBO8LC-h.js";import{G as Xy}from"./github-DcSqeKOx.js";import{F as OC}from"./file-text-BHDe9k9N.js";import{c as U0}from"./catalog-CI50zqwR.js";import{r as _L,a as SL,P as F_,c as kL}from"./PaperPreviewLink-DUJYnY2B.js";import{M as AL,d as xL}from"./index-DyDOGuaE.js";import{r as EL}from"./index-CEcXuWDB.js";import{c as tA}from"./chat-C_06RcUY.js";import{C as CL}from"./copy-CDHIGRQI.js";import{T as $L}from"./thumbs-up-C5Gnbt6N.js";import{u as im}from"./useMutation-B1oRtfbH.js";import{E as NC}from"./external-link-ChfVBxLK.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -150,4 +150,4 @@ ${$}`,u++;break;case"id":$.includes("\0")||(c=$);break;case"retry":/^\d+$/.test( `);s>-1&&(t=t.slice(0,s))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),s=e+t.length;for(let i=this.rangeIndex;;){let r=this.ranges[i].to;if(r>=s||(t=t.slice(0,r-(s-t.length)),i++,i==this.ranges.length))break;let o=this.ranges[i].from,a=this.lineAfter(o);t+=a,s=o+a.length}return{line:t,end:s}}skipGapsTo(e,t,s){for(;;){let i=this.ranges[this.rangeIndex].to,r=e+t;if(s>0?i>r:i>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-i}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){i=this.skipGapsTo(t,i,1),t+=i;let a=this.chunk.length;i=this.skipGapsTo(s,i,-1),s+=i,r+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=s:this.chunk.push(e,t,s,r),i}parseLine(e){let{line:t,end:s}=this.nextLine(),i=0,{streamParser:r}=this.lang,o=new eN(t,e?e.state.tabSize:4,e?xc(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=nN(r.token,o,this.state);if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,i)),o.start>1e4)break}this.parsedPos=s,this.moveRangeIndex(),this.parsedPose.start)return i}throw new Error("Stream parser failed to advance stream.")}const Hk=Object.create(null),hf=[js.none],fQ=new Ik(hf),uC=[],dC=Object.create(null),sN=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])sN[n]=rN(Hk,e);class iN{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),sN)}resolve(e){return e?this.table[e]||(this.table[e]=rN(this.extra,e)):0}}const pQ=new iN(Hk);function Nv(n,e){uC.indexOf(n)>-1||(uC.push(n),console.warn(e))}function rN(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let h=n[c]||Fe[c];h?typeof h=="function"?l.length?l=l.map(h):Nv(c,`Modifier ${c} used at start of tag`):l.length?Nv(c,`Tag ${c} used as modifier`):l=Array.isArray(h)?h:[h]:Nv(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let s=e.replace(/ /g,"_"),i=s+" "+t.map(a=>a.id),r=dC[i];if(r)return r.id;let o=dC[i]=js.define({id:hf.length,name:s,props:[jJ({[s]:t})]});return hf.push(o),o.id}function mQ(n,e){let t=js.define({id:hf.length,name:"Document",props:[Cd.add(()=>n),ZO.add(()=>s=>e.getIndent(s))],top:!0});return hf.push(t),t}It.RTL,It.LTR;const gQ=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),s=Uk(n.state,t.from);return s.line?yQ(n):s.block?bQ(n):!1};function Bk(n,e){return({state:t,dispatch:s})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(s(t.update(i)),!0):!1}}const yQ=Bk(SQ,0),vQ=Bk(oN,0),bQ=Bk((n,e)=>oN(n,e,_Q(e)),0);function Uk(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const id=50;function wQ(n,{open:e,close:t},s,i){let r=n.sliceDoc(s-id,s),o=n.sliceDoc(i,i+id),a=/\s*$/.exec(r)[0].length,l=/^\s*/.exec(o)[0].length,c=r.length-a;if(r.slice(c-e.length,c)==e&&o.slice(l,l+t.length)==t)return{open:{pos:s-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let h,u;i-s<=2*id?h=u=n.sliceDoc(s,i):(h=n.sliceDoc(s,s+id),u=n.sliceDoc(i-id,i));let d=/^\s*/.exec(h)[0].length,p=/\s*$/.exec(u)[0].length,m=u.length-p-t.length;return h.slice(d,d+e.length)==e&&u.slice(m,m+t.length)==t?{open:{pos:s+d+e.length,margin:/\s/.test(h.charAt(d+e.length))?1:0},close:{pos:i-p-t.length,margin:/\s/.test(u.charAt(m-1))?1:0}}:null}function _Q(n){let e=[];for(let t of n.selection.ranges){let s=n.doc.lineAt(t.from),i=t.to<=s.to?s:n.doc.lineAt(t.to);i.from>s.from&&i.from==t.to&&(i=t.to==s.to+1?s:n.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>s.from?e[r].to=i.to:e.push({from:s.from+/^\s*/.exec(s.text)[0].length,to:i.to})}return e}function oN(n,e,t=e.selection.ranges){let s=t.map(r=>Uk(e,r.from).block);if(!s.every(r=>r))return null;let i=t.map((r,o)=>wQ(e,s[o],r.from,r.to));if(n!=2&&!i.every(r=>r))return{changes:e.changes(t.map((r,o)=>i[o]?[]:[{from:r.from,insert:s[o].open+" "},{from:r.to,insert:" "+s[o].close}]))};if(n!=1&&i.some(r=>r)){let r=[];for(let o=0,a;oi&&(r==o||o>u.from)){i=u.from;let d=/^\s*/.exec(u.text)[0].length,p=d==u.length,m=u.text.slice(d,d+c.length)==c?d:-1;dr.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:a,token:l,indent:c,empty:h,single:u}of s)(u||!h)&&r.push({from:a.from+c,insert:l+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&s.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:a,token:l}of s)if(a>=0){let c=o.from+a,h=c+l.length;o.text[h-o.from]==" "&&h++,r.push({from:c,to:h})}return{changes:r}}return null}const P_=ja.define(),kQ=ja.define(),AQ=ve.define(),aN=ve.define({combine(n){return Hu(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(s,i)=>e(s,i)||t(s,i)})}}),lN=Fr.define({create(){return Nr.empty},update(n,e){let t=e.state.facet(aN),s=e.annotation(P_);if(s){let l=Ls.fromTransaction(e,s.selection),c=s.side,h=c==0?n.undone:n.done;return l?h=Ey(h,h.length,t.minDepth,l):h=uN(h,e.startState.selection),new Nr(c==0?s.rest:h,c==0?h:s.rest)}let i=e.annotation(kQ);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation(bn.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Ls.fromTransaction(e),o=e.annotation(bn.time),a=e.annotation(bn.userEvent);return r?n=n.addChanges(r,o,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Nr(n.done.map(Ls.fromJSON),n.undone.map(Ls.fromJSON))}});function xQ(n={}){return[lN,aN.of(n),ke.domEventHandlers({beforeinput(e,t){let s=e.inputType=="historyUndo"?cN:e.inputType=="historyRedo"?R_:null;return s?(e.preventDefault(),s(t)):!1}})]}function j0(n,e){return function({state:t,dispatch:s}){if(!e&&t.readOnly)return!1;let i=t.field(lN,!1);if(!i)return!1;let r=i.pop(n,t,e);return r?(s(r),!0):!1}}const cN=j0(0,!1),R_=j0(1,!1),EQ=j0(0,!0),CQ=j0(1,!0);class Ls{constructor(e,t,s,i,r){this.changes=e,this.effects=t,this.mapped=s,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new Ls(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,s;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(s=this.startSelection)===null||s===void 0?void 0:s.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Ls(e.changes&&gn.fromJSON(e.changes),[],e.mapped&&Lr.fromJSON(e.mapped),e.startSelection&&te.fromJSON(e.startSelection),e.selectionsAfter.map(te.fromJSON))}static fromTransaction(e,t){let s=vi;for(let i of e.startState.facet(AQ)){let r=i(e);r.length&&(s=s.concat(r))}return!s.length&&e.changes.empty?null:new Ls(e.changes.invert(e.startState.doc),s,void 0,t||e.startState.selection,vi)}static selection(e){return new Ls(void 0,vi,void 0,void 0,e)}}function Ey(n,e,t,s){let i=e+1>t+20?e-t-1:0,r=n.slice(i,e);return r.push(s),r}function $Q(n,e){let t=[],s=!1;return n.iterChangedRanges((i,r)=>t.push(i,r)),e.iterChangedRanges((i,r,o,a)=>{for(let l=0;l=c&&o<=h&&(s=!0)}}),s}function TQ(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,s)=>t.empty!=e.ranges[s].empty).length===0}function hN(n,e){return n.length?e.length?n.concat(e):n:e}const vi=[],PQ=200;function uN(n,e){if(n.length){let t=n[n.length-1],s=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-PQ));return s.length&&s[s.length-1].eq(e)?n:(s.push(e),Ey(n,n.length-1,1e9,t.setSelAfter(s)))}else return[Ls.selection([e])]}function RQ(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Lv(n,e){if(!n.length)return n;let t=n.length,s=vi;for(;t;){let i=MQ(n[t-1],e,s);if(i.changes&&!i.changes.empty||i.effects.length){let r=n.slice(0,t);return r[t-1]=i,r}else e=i.mapped,t--,s=i.selectionsAfter}return s.length?[Ls.selection(s)]:vi}function MQ(n,e,t){let s=hN(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):vi,t);if(!n.changes)return Ls.selection(s);let i=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Ls(i,wt.mapEffects(n.effects,e),o,n.startSelection.map(r),s)}const IQ=/^(input\.type|delete)($|\.)/;class Nr{constructor(e,t,s=0,i=void 0){this.done=e,this.undone=t,this.prevTime=s,this.prevUserEvent=i}isolate(){return this.prevTime?new Nr(this.done,this.undone):this}addChanges(e,t,s,i,r){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!s||IQ.test(s))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):F0(t,e))}function cs(n){return n.textDirectionAt(n.state.selection.main.head)==It.LTR}const fN=n=>dN(n,!cs(n)),pN=n=>dN(n,cs(n));function mN(n,e){return er(n,t=>t.empty?n.moveByGroup(t,e):F0(t,e))}const NQ=n=>mN(n,!cs(n)),LQ=n=>mN(n,cs(n));function DQ(n,e,t){if(e.type.prop(t))return!0;let s=e.to-e.from;return s&&(s>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function z0(n,e,t){let s=Oa(n).resolveInner(e.head),i=t?nt.closedBy:nt.openedBy;for(let l=e.head;;){let c=t?s.childAfter(l):s.childBefore(l);if(!c)break;DQ(n,c,i)?s=c:l=t?c.to:c.from}let r=s.type.prop(i),o,a;return r&&(o=t?Or(n,s.from,1):Or(n,s.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?s.to:s.from,te.cursor(a,t?-1:1)}const jQ=n=>er(n,e=>z0(n.state,e,!cs(n))),FQ=n=>er(n,e=>z0(n.state,e,cs(n)));function gN(n,e){return er(n,t=>{if(!t.empty)return F0(t,e);let s=n.moveVertically(t,e);return s.head!=t.head?s:n.moveToLineBoundary(t,e)})}const yN=n=>gN(n,!1),vN=n=>gN(n,!0);function bN(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):F0(o,e));if(i.eq(s.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(s.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,c=a.bottom-t.marginBottom;o&&o.top>l&&o.bottomwN(n,!1),M_=n=>wN(n,!0);function Fa(n,e,t){let s=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?s.to:s.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==s.from&&s.length){let r=/^\s*/.exec(n.state.sliceDoc(s.from,Math.min(s.from+100,s.to)))[0].length;r&&e.head!=s.from+r&&(i=te.cursor(s.from+r))}return i}const zQ=n=>er(n,e=>Fa(n,e,!0)),HQ=n=>er(n,e=>Fa(n,e,!1)),BQ=n=>er(n,e=>Fa(n,e,!cs(n))),UQ=n=>er(n,e=>Fa(n,e,cs(n))),qQ=n=>er(n,e=>te.cursor(n.lineBlockAt(e.head).from,1)),VQ=n=>er(n,e=>te.cursor(n.lineBlockAt(e.head).to,-1));function WQ(n,e,t){let s=!1,i=Bu(n.selection,r=>{let o=Or(n,r.head,-1)||Or(n,r.head,1)||r.head>0&&Or(n,r.head-1,1)||r.headWQ(n,e);function Ai(n,e,t){let s=Bu(n.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=e&&(i=te.range(i.head,i.anchor));let r=t(i);return te.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return s.eq(n.state.selection)?!1:(n.dispatch(Qi(n.state,s)),!0)}function _N(n,e){return Ai(n,e,t=>n.moveByChar(t,e))}const SN=n=>_N(n,!cs(n)),kN=n=>_N(n,cs(n));function AN(n,e){return Ai(n,e,t=>n.moveByGroup(t,e))}const KQ=n=>AN(n,!cs(n)),ZQ=n=>AN(n,cs(n)),XQ=n=>{let e=!cs(n);return Ai(n,e,t=>z0(n.state,t,e))},YQ=n=>{let e=cs(n);return Ai(n,e,t=>z0(n.state,t,e))};function xN(n,e){return Ai(n,e,t=>n.moveVertically(t,e))}const EN=n=>xN(n,!1),CN=n=>xN(n,!0);function $N(n,e){return Ai(n,e,t=>n.moveVertically(t,e,bN(n).height))}const pC=n=>$N(n,!1),mC=n=>$N(n,!0),JQ=n=>Ai(n,!0,e=>Fa(n,e,!0)),QQ=n=>Ai(n,!1,e=>Fa(n,e,!1)),eee=n=>{let e=!cs(n);return Ai(n,e,t=>Fa(n,t,e))},tee=n=>{let e=cs(n);return Ai(n,e,t=>Fa(n,t,e))},nee=n=>Ai(n,!1,e=>te.cursor(n.lineBlockAt(e.head).from)),see=n=>Ai(n,!0,e=>te.cursor(n.lineBlockAt(e.head).to)),gC=({state:n,dispatch:e})=>(e(Qi(n,{anchor:0})),!0),yC=({state:n,dispatch:e})=>(e(Qi(n,{anchor:n.doc.length})),!0),vC=({state:n,dispatch:e})=>(e(Qi(n,{anchor:n.selection.main.anchor,head:0})),!0),bC=({state:n,dispatch:e})=>(e(Qi(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),iee=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),ree=({state:n,dispatch:e})=>{let t=H0(n).map(({from:s,to:i})=>te.undirectionalRange(s,Math.min(i+1,n.doc.length)));return e(n.update({selection:te.create(t),userEvent:"select"})),!0},oee=({state:n,dispatch:e})=>{let t=Bu(n.selection,s=>{let i=Oa(n),r=i.resolveStack(s.from,1);if(s.empty){let o=i.resolveStack(s.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:a}=o;if((a.from=s.to||a.to>s.to&&a.from<=s.from)&&o.next)return te.undirectionalRange(a.from,a.to)}return s});return t.eq(n.selection)?!1:(e(Qi(n,t)),!0)};function TN(n,e){let{state:t}=n,s=t.selection,i=t.selection.ranges.slice();for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head);if(e?o.to0)for(let a=r;;){let l=n.moveVertically(a,e);if(l.heado.to){i.some(c=>c.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==s.ranges.length?!1:(n.dispatch(Qi(t,te.create(i,i.length-1))),!0)}const aee=n=>TN(n,!1),lee=n=>TN(n,!0),cee=({state:n,dispatch:e})=>{let t=n.selection,s=null;return t.ranges.length>1?s=te.create([t.main]):t.main.empty||(s=te.create([te.cursor(t.main.head)])),s?(e(Qi(n,s)),!0):!1};function em(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:s}=n,i=s.changeByRange(r=>{let{from:o,to:a}=r;if(o==a){let l=e(r);lo&&(t="delete.forward",l=Bm(n,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=Bm(n,o,!1),a=Bm(n,a,!0);return o==a?{range:r}:{changes:{from:o,to:a},range:te.cursor(o,oi(n)))s.between(e,e,(i,r)=>{ie&&(e=t?r:i)});return e}const PN=(n,e,t)=>em(n,s=>{let i=s.from,{state:r}=n,o=r.doc.lineAt(i),a,l;if(t&&!e&&i>o.from&&iPN(n,!1,!0),RN=n=>PN(n,!0,!1),MN=(n,e)=>em(n,t=>{let s=t.head,{state:i}=n,r=i.doc.lineAt(s),o=i.charCategorizer(s);for(let a=null;;){if(s==(e?r.to:r.from)){s==t.head&&r.number!=(e?i.doc.lines:1)&&(s+=e?1:-1);break}let l=Tn(r.text,s-r.from,e)+r.from,c=r.text.slice(Math.min(s,l)-r.from,Math.max(s,l)-r.from),h=o(c);if(a!=null&&h!=a)break;(c!=" "||s!=t.head)&&(a=h),s=l}return s}),IN=n=>MN(n,!1),hee=n=>MN(n,!0),uee=n=>em(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headem(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),fee=n=>em(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(s=>({changes:{from:s.from,to:s.to,insert:lt.of(["",""])},range:te.cursor(s.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},mee=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(s=>{if(!s.empty||s.from==0||s.from==n.doc.length)return{range:s};let i=s.from,r=n.doc.lineAt(i),o=i==r.from?i-1:Tn(r.text,i-r.from,!1)+r.from,a=i==r.to?i+1:Tn(r.text,i-r.from,!0)+r.from;return{changes:{from:o,to:a,insert:n.doc.slice(i,a).append(n.doc.slice(o,i))},range:te.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function H0(n){let e=[],t=-1;for(let s of n.selection.ranges){let i=n.doc.lineAt(s.from),r=n.doc.lineAt(s.to);if(!s.empty&&s.to==r.from&&(r=n.doc.lineAt(s.to-1)),t>=i.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(s)}else e.push({from:i.from,to:r.to,ranges:[s]});t=r.number+1}return e}function ON(n,e,t){if(n.readOnly)return!1;let s=[],i=[];for(let r of H0(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),a=o.length+1;if(t){s.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let l of r.ranges)i.push(te.range(Math.min(n.doc.length,l.anchor+a),Math.min(n.doc.length,l.head+a)))}else{s.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let l of r.ranges)i.push(te.range(l.anchor-a,l.head-a))}}return s.length?(e(n.update({changes:s,scrollIntoView:!0,selection:te.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const gee=({state:n,dispatch:e})=>ON(n,e,!1),yee=({state:n,dispatch:e})=>ON(n,e,!0);function NN(n,e,t){if(n.readOnly)return!1;let s=[];for(let r of H0(n))t?s.push({from:r.from,insert:n.doc.slice(r.from,r.to)+n.lineBreak}):s.push({from:r.to,insert:n.lineBreak+n.doc.slice(r.from,r.to)});let i=n.changes(s);return e(n.update({changes:i,selection:n.selection.map(i,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const vee=({state:n,dispatch:e})=>NN(n,e,!1),bee=({state:n,dispatch:e})=>NN(n,e,!0),wee=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(H0(e).map(({from:i,to:r})=>(i>0?i--:r{let r;if(n.lineWrapping){let o=n.lineBlockAt(i.head),a=n.coordsAtPos(i.head,i.assoc||1);a&&(r=o.bottom+n.documentTop-a.bottom+n.defaultLineHeight/2)}return n.moveVertically(i,!0,r)}).map(t);return n.dispatch({changes:t,selection:s,scrollIntoView:!0,userEvent:"delete.line"}),!0};function _ee(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Oa(n).resolveInner(e),s=t.childBefore(e),i=t.childAfter(e),r;return s&&i&&s.to<=e&&i.from>=e&&(r=s.type.prop(nt.closedBy))&&r.indexOf(i.name)>-1&&n.doc.lineAt(s.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(s.to,i.from))?{from:s.to,to:i.from}:null}const wC=LN(!1),See=LN(!0);function LN(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let s=e.changeByRange(i=>{let{from:r,to:o}=i,a=e.doc.lineAt(r),l=!n&&r==o&&_ee(e,r);n&&(r=o=(o<=a.to?a:e.doc.lineAt(o)).to);let c=new D0(e,{simulateBreak:r,simulateDoubleBreak:!!l}),h=KO(c,r);for(h==null&&(h=P0(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));oa.from&&r{let i=[];for(let o=s.from;o<=s.to;){let a=n.doc.lineAt(o);a.number>t&&(s.empty||s.to>a.from)&&(e(a,i,s),t=a.number),o=a.to+1}let r=n.changes(i);return{changes:i,range:te.range(r.mapPos(s.anchor,1),r.mapPos(s.head,1))}})}const kee=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),s=new D0(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),i=qk(n,(r,o,a)=>{let l=KO(s,r.from);if(l==null)return;/\S/.test(r.text)||(l=0);let c=/^\s*/.exec(r.text)[0],h=xy(n,l);(c!=h||a.fromn.readOnly?!1:(e(n.update(qk(n,(t,s)=>{s.push({from:t.from,insert:n.facet(Dk)})}),{userEvent:"input.indent"})),!0),jN=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(qk(n,(t,s)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=P0(i,n.tabSize),o=0,a=xy(n,Math.max(0,r-xc(n)));for(;o(n.setTabFocusMode(),!0),xee=[{key:"Ctrl-b",run:fN,shift:SN,preventDefault:!0},{key:"Ctrl-f",run:pN,shift:kN},{key:"Ctrl-p",run:yN,shift:EN},{key:"Ctrl-n",run:vN,shift:CN},{key:"Ctrl-a",run:qQ,shift:nee},{key:"Ctrl-e",run:VQ,shift:see},{key:"Ctrl-d",run:RN},{key:"Ctrl-h",run:I_},{key:"Ctrl-k",run:uee},{key:"Ctrl-Alt-h",run:IN},{key:"Ctrl-o",run:pee},{key:"Ctrl-t",run:mee},{key:"Ctrl-v",run:M_}],Eee=[{key:"ArrowLeft",run:fN,shift:SN,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:NQ,shift:KQ,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:BQ,shift:eee,preventDefault:!0},{key:"ArrowRight",run:pN,shift:kN,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:LQ,shift:ZQ,preventDefault:!0},{mac:"Cmd-ArrowRight",run:UQ,shift:tee,preventDefault:!0},{key:"ArrowUp",run:yN,shift:EN,preventDefault:!0},{mac:"Cmd-ArrowUp",run:gC,shift:vC},{mac:"Ctrl-ArrowUp",run:fC,shift:pC},{key:"ArrowDown",run:vN,shift:CN,preventDefault:!0},{mac:"Cmd-ArrowDown",run:yC,shift:bC},{mac:"Ctrl-ArrowDown",run:M_,shift:mC},{key:"PageUp",run:fC,shift:pC},{key:"PageDown",run:M_,shift:mC},{key:"Home",run:HQ,shift:QQ,preventDefault:!0},{key:"Mod-Home",run:gC,shift:vC},{key:"End",run:zQ,shift:JQ,preventDefault:!0},{key:"Mod-End",run:yC,shift:bC},{key:"Enter",run:wC,shift:wC},{key:"Mod-a",run:iee},{key:"Backspace",run:I_,shift:I_,preventDefault:!0},{key:"Delete",run:RN,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:IN,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:hee,preventDefault:!0},{mac:"Mod-Backspace",run:dee,preventDefault:!0},{mac:"Mod-Delete",run:fee,preventDefault:!0}].concat(xee.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),Cee=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:jQ,shift:XQ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:FQ,shift:YQ},{key:"Alt-ArrowUp",run:gee},{key:"Shift-Alt-ArrowUp",run:vee},{key:"Alt-ArrowDown",run:yee},{key:"Shift-Alt-ArrowDown",run:bee},{key:"Mod-Alt-ArrowUp",run:aee},{key:"Mod-Alt-ArrowDown",run:lee},{key:"Escape",run:cee},{key:"Mod-Enter",run:See},{key:"Alt-l",mac:"Ctrl-l",run:ree},{key:"Mod-i",run:oee,preventDefault:!0},{key:"Mod-[",run:jN},{key:"Mod-]",run:DN},{key:"Mod-Alt-\\",run:kee},{key:"Shift-Mod-k",run:wee},{key:"Shift-Mod-\\",run:GQ},{key:"Mod-/",run:gQ},{key:"Alt-A",mac:"Ctrl-A",run:vQ},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Aee}].concat(Eee),$ee={key:"Tab",run:DN,shift:jN};function FN(n){function e(u,d){u.cmdState.push(d)}function t(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function s(u){var d=u.cmdState.pop();d&&d.closeBracket()}function i(u){for(var d=u.cmdState,p=d.length-1;p>=0;p--){var m=d[p];if(m.name!="DEFAULT")return m}return{styleIdentifier:function(){return null}}}function r(u,d,p){return function(){this.name=u,this.bracketNo=0,this.style=d,this.styles=p,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var o={};o.importmodule=r("importmodule","tag",["string","builtin"]),o.documentclass=r("documentclass","tag",["","atom"]),o.usepackage=r("usepackage","tag",["atom"]),o.begin=r("begin","tag",["atom"]),o.end=r("end","tag",["atom"]),o.label=r("label","tag",["atom"]),o.ref=r("ref","tag",["atom"]),o.eqref=r("eqref","tag",["atom"]),o.cite=r("cite","tag",["atom"]),o.bibitem=r("bibitem","tag",["atom"]),o.Bibitem=r("Bibitem","tag",["atom"]),o.RBibitem=r("RBibitem","tag",["atom"]),o.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function a(u,d){u.f=d}function l(u,d){var p;if(u.match(/^\\[a-zA-Z@\xc0-\u1fff\u2060-\uffff]+/)){var m=u.current().slice(1);return p=o.hasOwnProperty(m)?o[m]:o.DEFAULT,p=new p,e(d,p),a(d,h),p.style}if(u.match(/^\\[$&%#{}_]/)||u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return a(d,function(v,y){return c(v,y,"\\]")}),"keyword";if(u.match("\\("))return a(d,function(v,y){return c(v,y,"\\)")}),"keyword";if(u.match("$$"))return a(d,function(v,y){return c(v,y,"$$")}),"keyword";if(u.match("$"))return a(d,function(v,y){return c(v,y,"$")}),"keyword";var g=u.next();if(g=="%")return u.skipToEnd(),"comment";if(g=="}"||g=="]"){if(p=t(d),p)p.closeBracket(g),a(d,h);else return"error";return"bracket"}else return g=="{"||g=="["?(p=o.DEFAULT,p=new p,e(d,p),"bracket"):/\d/.test(g)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),p=i(d),p.name=="begin"&&(p.argument=u.current()),p.styleIdentifier())}function c(u,d,p){if(u.eatSpace())return null;if(p&&u.match(p))return a(d,l),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variableName.special";if(u.match(/^\\[$&%#{}_]/)||u.match(/^\\[,;!\/]/)||u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var m=u.next();return m=="{"||m=="}"||m=="["||m=="]"||m=="("||m==")"?"bracket":m=="%"?(u.skipToEnd(),"comment"):"error"}function h(u,d){var p=u.peek(),m;return p=="{"||p=="["?(m=t(d),m.openBracket(p),u.eat(p),a(d,l),"bracket"):/[ \t\r]/.test(p)?(u.eat(p),null):(a(d,l),s(d),l(u,d))}return{name:"stex",startState:function(){var u=n?function(d,p){return c(d,p)}:l;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,d){return d.f(u,d)},blankLine:function(u){u.f=l,u.cmdState.length=0},languageData:{commentTokens:{line:"%"}}}}const Tee=FN(!1);FN(!0);const _C=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Iu{constructor(e,t,s=0,i=e.length,r,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(s,i),this.bufferStart=s,this.normalize=r?a=>r(_C(a)):_C,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return SI(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=eY(e),s=this.bufferStart+this.bufferPos;this.bufferPos+=kI(e);let i=this.normalize(t);if(i.length)for(let r=0,o=s,a=!0;;r++){let l=i.charCodeAt(r),c=this.match(l,o,a,this.bufferPos+this.bufferStart,r==i.length-1);if(c)return this.value=c,this;if(r==i.length-1)break;a&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let s=this.curLineStart+t.index,i=s+t[0].length;if(this.matchPos=Cy(this.text,i+(s==i?1:0)),s==this.curLineStart+this.curLine.length&&this.nextLine(),(sthis.value.to)&&(!this.test||this.test(s,i,t)))return this.value={from:s,to:i,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=s||i.to<=t){let a=new vh(t,e.sliceString(t,s));return Dv.set(e,a),a}if(i.from==t&&i.to==s)return i;let{text:r,from:o}=i;return o>t&&(r=e.sliceString(t,o)+r,o=t),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let s=this.flat.from+t.index,i=s+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(s,i,t)))return this.value={from:s,to:i,precise:!0,match:t},this.matchPos=Cy(this.text,i+(s==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=vh.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(HN.prototype[Symbol.iterator]=BN.prototype[Symbol.iterator]=function(){return this});function Pee(n){try{return new RegExp(n,Vk),!0}catch{return!1}}function Cy(n,e){if(e>=n.length)return e;let t=n.lineAt(e),s;for(;e=56320&&s<57344;)e++;return e}const Ree=n=>{let{state:e}=n,t=String(e.doc.lineAt(n.state.selection.main.head).number),{close:s,result:i}=mJ(n,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return i.then(r=>{let o=r&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.elements.line.value);if(!o){n.dispatch({effects:s});return}let a=e.doc.lineAt(e.selection.main.head),[,l,c,h,u]=o,d=h?+h.slice(1):0,p=c?+c:a.number;if(c&&u){let v=p/100;l&&(v=v*(l=="-"?-1:1)+a.number/e.doc.lines),p=Math.round(e.doc.lines*v)}else c&&l&&(p=p*(l=="-"?-1:1)+a.number);let m=e.doc.line(Math.max(1,Math.min(e.doc.lines,p))),g=te.cursor(m.from+Math.max(0,Math.min(d,m.length)));n.dispatch({effects:[s,ke.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},Mee={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Iee=ve.define({combine(n){return Hu(n,Mee,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Oee(n){return[Fee,jee]}const Nee=Qe.mark({class:"cm-selectionMatch"}),Lee=Qe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function SC(n,e,t,s){return(t==0||n(e.sliceDoc(t-1,t))!=tn.Word)&&(s==e.doc.length||n(e.sliceDoc(s,s+1))!=tn.Word)}function Dee(n,e,t,s){return n(e.sliceDoc(t,t+1))==tn.Word&&n(e.sliceDoc(s-1,s))==tn.Word}const jee=si.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Iee),{state:t}=n,s=t.selection;if(s.ranges.length>1)return Qe.none;let i=s.main,r,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return Qe.none;let l=t.wordAt(i.head);if(!l)return Qe.none;o=t.charCategorizer(i.head),r=t.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return Qe.none;if(e.wholeWords){if(r=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(SC(o,t,i.from,i.to)&&Dee(o,t,i.from,i.to)))return Qe.none}else if(r=t.sliceDoc(i.from,i.to),!r)return Qe.none}let a=[];for(let l of n.visibleRanges){let c=new Iu(t.doc,r,l.from,l.to);for(;!c.next().done;){let{from:h,to:u}=c.value;if((!o||SC(o,t,h,u))&&(i.empty&&h<=i.from&&u>=i.to?a.push(Lee.range(h,u)):(h>=i.to||u<=i.from)&&a.push(Nee.range(h,u)),a.length>e.maxMatches))return Qe.none}}return Qe.set(a)}},{decorations:n=>n.decorations}),Fee=ke.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),zee=({state:n,dispatch:e})=>{let{selection:t}=n,s=te.create(t.ranges.map(i=>n.wordAt(i.head)||te.cursor(i.head)),t.mainIndex);return s.eq(t)?!1:(e(n.update({selection:s})),!0)};function Hee(n,e){let{main:t,ranges:s}=n.selection,i=n.wordAt(t.head),r=i&&i.from==t.from&&i.to==t.to;for(let o=!1,a=new Iu(n.doc,e,s[s.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new Iu(n.doc,e,0,Math.max(0,s[s.length-1].from-1)),o=!0}else{if(o&&s.some(l=>l.from==a.value.from))continue;if(r){let l=n.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const Bee=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return zee({state:n,dispatch:e});let s=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=s))return!1;let i=Hee(n,s);return i?(e(n.update({selection:n.selection.addRange(te.range(i.from,i.to),!1),effects:ke.scrollIntoView(i.to)})),!0):!1},Uu=ve.define({combine(n){return Hu(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new nte(e),scrollToMatch:e=>ke.scrollIntoView(e)})}});class UN{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Pee(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,s)=>s=="n"?` `:s=="r"?"\r":s=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Kee(this):new Vee(this)}getCursor(e,t=0,s){let i=e.doc?e:at.create({doc:e});return s==null&&(s=i.doc.length),this.regexp?Qc(this,i,t,s):Jc(this,i,t,s)}}class qN{constructor(e){this.spec=e}}function Uee(n,e,t){return(s,i,r,o)=>{if(t&&!t(s,i,r,o))return!1;let a=s>=o&&i<=o+r.length?r.slice(s-o,i-o):e.doc.sliceString(s,i);return n(a,e,s,i)}}function Jc(n,e,t,s){let i;return n.wholeWord&&(i=qee(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(i=Uee(n.test,e,i)),new Iu(e.doc,n.unquoted,t,s,n.caseSensitive?void 0:r=>r.toLowerCase(),i)}function qee(n,e){return(t,s,i,r)=>((r>t||r+i.length=t)return null;i.push(s.value)}return i}highlight(e,t,s,i){let r=Jc(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(s+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function Wee(n,e,t){return(s,i,r)=>(!t||t(s,i,r))&&n(r[0],e,s,i)}function Qc(n,e,t,s){let i;return n.wholeWord&&(i=Gee(e.charCategorizer(e.selection.main.head))),n.test&&(i=Wee(n.test,e,i)),new HN(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:i},t,s)}function $y(n,e){return n.slice(Tn(n,e,!1),e)}function Ty(n,e){return n.slice(e,Tn(n,e))}function Gee(n){return(e,t,s)=>!s[0].length||(n($y(s.input,s.index))!=tn.Word||n(Ty(s.input,s.index))!=tn.Word)&&(n(Ty(s.input,s.index+s[0].length))!=tn.Word||n($y(s.input,s.index+s[0].length))!=tn.Word)}class Kee extends qN{nextMatch(e,t,s){let i=Qc(this.spec,e,s,e.doc.length).next();return i.done&&(i=Qc(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,s){for(let i=1;;i++){let r=Math.max(t,s-i*1e4),o=Qc(this.spec,e,r,s),a=null;for(;!o.next().done;)a=o.value;if(a&&(r==t||a.from>r+10))return a;if(r==t)return null}}prevMatch(e,t,s){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,s,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,s)=>{if(s=="&")return e.match[0];if(s=="$")return"$";for(let i=s.length;i>0;i--){let r=+s.slice(0,i);if(r>0&&r=t)return null;i.push(s.value)}return i}highlight(e,t,s,i){let r=Qc(this.spec,e,Math.max(0,t-250),Math.min(s+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}const uf=wt.define(),Wk=wt.define(),Ea=Fr.define({create(n){return new jv(O_(n).create(),null)},update(n,e){for(let t of e.effects)t.is(uf)?n=new jv(t.value.create(),n.panel):t.is(Wk)&&(n=new jv(n.query,t.value?Gk:null));return n},provide:n=>Sy.from(n,e=>e.panel)});class jv{constructor(e,t){this.query=e,this.panel=t}}const Zee=Qe.mark({class:"cm-searchMatch"}),Xee=Qe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Yee=si.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(Ea))}update(n){let e=n.state.field(Ea);(e!=n.startState.field(Ea)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Qe.none;let{view:t}=this,s=new nf;for(let i=0,r=t.visibleRanges,o=r.length;ir[i+1].from-2*250;)l=r[++i].to;n.highlight(t.state,a,l,(c,h)=>{let u=t.state.selection.ranges.some(d=>d.from==c&&d.to==h);s.add(c,h,u?Xee:Zee)})}return s.finish()}},{decorations:n=>n.decorations});function tm(n){return e=>{let t=e.state.field(Ea,!1);return t&&t.query.spec.valid?n(e,t):GN(e)}}const Py=tm((n,{query:e})=>{let{to:t}=n.state.selection.main,s=e.nextMatch(n.state,t,t);if(!s)return!1;let i=te.single(s.from,s.to),r=n.state.facet(Uu);return n.dispatch({selection:i,effects:[Kk(n,s),r.scrollToMatch(i.main,n)],userEvent:"select.search"}),WN(n),!0}),Ry=tm((n,{query:e})=>{let{state:t}=n,{from:s}=t.selection.main,i=e.prevMatch(t,s,s);if(!i)return!1;let r=te.single(i.from,i.to),o=n.state.facet(Uu);return n.dispatch({selection:r,effects:[Kk(n,i),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),WN(n),!0}),Jee=tm((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:te.create(t.map(s=>te.range(s.from,s.to))),userEvent:"select.search.matches"}),!0)}),Qee=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:s,to:i}=t.main,r=[],o=0;for(let a=new Iu(n.doc,n.sliceDoc(s,i));!a.next().done;){if(r.length>1e3)return!1;a.value.from==s&&(o=r.length),r.push(te.range(a.value.from,a.value.to))}return e(n.update({selection:te.create(r,o),userEvent:"select.search.matches"})),!0},kC=tm((n,{query:e})=>{let{state:t}=n,{from:s,to:i}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,s,s);if(!r)return!1;let o=r,a=[],l,c,h=[];o.precise?o.from==s&&o.to==i&&(c=t.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(t,o.from,o.to),h.push(ke.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(s).number)+"."))):o=e.nextMatch(t,o.from,o.to);let u=n.state.changes(a);return o&&(l=te.single(o.from,o.to).map(u),h.push(Kk(n,o)),h.push(t.facet(Uu).scrollToMatch(l.main,n))),n.dispatch({changes:u,selection:l,effects:h,userEvent:"input.replace"}),!0}),ete=tm((n,{query:e})=>{if(n.state.readOnly)return!1;let t=[];for(let i of e.matchAll(n.state,1e9)){let{from:r,to:o,precise:a}=i;a&&t.push({from:r,to:o,insert:e.getReplacement(i)})}if(!t.length)return!1;let s=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:ke.announce.of(s),userEvent:"input.replace.all"}),!0});function Gk(n){return n.state.facet(Uu).createPanel(n)}function O_(n,e){var t,s,i,r,o;let a=n.selection.main,l=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=n.facet(Uu);return new UN({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(s=e==null?void 0:e.caseSensitive)!==null&&s!==void 0?s:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:c.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function VN(n){let e=jO(n,Gk);return e&&e.dom.querySelector("[main-field]")}function WN(n){let e=VN(n);e&&e==n.root.activeElement&&e.select()}const GN=n=>{let e=n.state.field(Ea,!1);if(e&&e.panel){let t=VN(n);if(t&&t!=n.root.activeElement){let s=O_(n.state,e.query.spec);s.valid&&n.dispatch({effects:uf.of(s)}),t.focus(),t.select()}}else n.dispatch({effects:[Wk.of(!0),e?uf.of(O_(n.state,e.query.spec)):wt.appendConfig.of(ite)]});return!0},KN=n=>{let e=n.state.field(Ea,!1);if(!e||!e.panel)return!1;let t=jO(n,Gk);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Wk.of(!1)}),!0},tte=[{key:"Mod-f",run:GN,scope:"editor search-panel"},{key:"F3",run:Py,shift:Ry,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Py,shift:Ry,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:KN,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Qee},{key:"Mod-Alt-g",run:Ree},{key:"Mod-d",run:Bee,preventDefault:!0}];class nte{constructor(e){this.view=e;let t=this.query=e.state.field(Ea).query.spec;this.commit=this.commit.bind(this),this.searchField=$n("input",{value:t.search,placeholder:Us(e,"Find"),"aria-label":Us(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=$n("input",{value:t.replace,placeholder:Us(e,"Replace"),"aria-label":Us(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=$n("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=$n("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=$n("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function s(i,r,o){return $n("button",{class:"cm-button",name:i,onclick:r,type:"button"},o)}this.dom=$n("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,s("next",()=>Py(e),[Us(e,"next")]),s("prev",()=>Ry(e),[Us(e,"previous")]),s("select",()=>Jee(e),[Us(e,"all")]),$n("label",null,[this.caseField,Us(e,"match case")]),$n("label",null,[this.reField,Us(e,"regexp")]),$n("label",null,[this.wordField,Us(e,"by word")]),...e.state.readOnly?[]:[$n("br"),this.replaceField,s("replace",()=>kC(e),[Us(e,"replace")]),s("replaceAll",()=>ete(e),[Us(e,"replace all")])],$n("button",{name:"close",onclick:()=>KN(e),"aria-label":Us(e,"close"),type:"button"},["×"])])}commit(){let e=new UN({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:uf.of(e)}))}keydown(e){tJ(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ry:Py)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),kC(this.view))}update(e){for(let t of e.transactions)for(let s of t.effects)s.is(uf)&&!s.value.eq(this.query)&&this.setQuery(s.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Uu).top}}function Us(n,e){return n.state.phrase(e)}const Um=30,qm=/[\s\.,:;?!]/;function Kk(n,{from:e,to:t}){let s=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,r=Math.max(s.from,e-Um),o=Math.min(i,t+Um),a=n.state.sliceDoc(r,o);if(r!=s.from){for(let l=0;la.length-Um;l--)if(!qm.test(a[l-1])&&qm.test(a[l])){a=a.slice(0,l);break}}return ke.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${s.number}.`)}const ste=ke.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ite=[Ea,T0.low(Yee),ste],rte=({path:n,value:e,readOnly:t,onChange:s})=>{const i=ee.useRef(null),r=ee.useRef(null),o=ee.useRef(new Xp),a=ee.useRef(s);return a.current=s,ee.useEffect(()=>{if(!i.current)return;const l=at.create({doc:e,extensions:[xJ(),aJ(),dJ(),xQ(),Oee(),rQ(),Fk.define(Tee),MO.of([...Cee,...OQ,...tte,$ee]),ke.contentAttributes.of({"aria-label":`Editing ${n}`,class:"ph-no-capture","data-ph-no-autocapture":"true","data-ph-no-capture":"true"}),o.current.of(ke.editable.of(!t)),ke.updateListener.of(c=>{c.docChanged&&a.current(c.state.doc.toString())})]});return r.current=new ke({state:l,parent:i.current}),()=>{var c;return(c=r.current)==null?void 0:c.destroy()}},[n]),ee.useEffect(()=>{const l=r.current;!l||l.state.doc.toString()===e||l.dispatch({changes:{from:0,to:l.state.doc.length,insert:e}})},[e]),ee.useEffect(()=>{var l;(l=r.current)==null||l.dispatch({effects:o.current.reconfigure(ke.editable.of(!t))})},[t]),S.jsx("div",{className:"latex-source-editor ph-no-capture","data-ph-no-autocapture":"true","data-ph-no-capture":"true","data-testid":"latex-source-editor",ref:i})},ote="pwc:artifact-navigation";function hne(){return typeof window>"u"?!0:window.dispatchEvent(new Event(ote,{cancelable:!0}))}const ZN=()=>({open:!1,selectedKey:null,selected:null,selectedVersionId:null,tab:"preview",sourceFile:null,panelPercent:55,requestNonce:0,registry:{},autoOpened:{},manuallyClosed:{}});function ate(n,e){if(e.type==="reset")return{...ZN(),panelPercent:n.panelPercent};if(e.type==="register"){const t=n.registry[e.key];if(t&&JSON.stringify(t)===JSON.stringify(e.block))return n;const s={...n.registry,[e.key]:e.block},i=n.selectedKey===e.key?e.block:n.selected,r=(t==null?void 0:t.status)==="generating"&&e.block.status==="ready",o=e.autoOpenOnMount&&!t&&e.block.status==="ready"&&!Object.values(n.autoOpened).some(Boolean);return(r||o)&&!n.autoOpened[e.key]&&!n.manuallyClosed[e.key]?{...n,registry:s,open:!0,selectedKey:e.key,selected:e.block,selectedVersionId:e.block.version_id??null,tab:"preview",sourceFile:null,requestNonce:n.requestNonce+1,autoOpened:{...n.autoOpened,[e.key]:!0}}:{...n,registry:s,selected:i}}return e.type==="unregister"?n:e.type==="open"?{...n,open:!0,selectedKey:e.key,selected:e.block,selectedVersionId:e.block.version_id??null,tab:"preview",sourceFile:null,requestNonce:n.requestNonce+1,manuallyClosed:{...n.manuallyClosed,[e.key]:!1}}:e.type==="close"?{...n,open:!1,manuallyClosed:n.selectedKey?{...n.manuallyClosed,[n.selectedKey]:!0}:n.manuallyClosed}:e.type==="tab"?{...n,tab:e.tab}:e.type==="source"?{...n,sourceFile:e.path}:e.type==="version"?{...n,selectedVersionId:e.versionId,tab:"preview",sourceFile:null}:{...n,panelPercent:e.percent}}function N_(n){return n.publication_id||n.public_capability||n.version_id||`${n.scope}:${n.identifier}:${n.version??"pending"}`}const XN=ee.createContext(null),une=({children:n,workspaceKey:e,autoOpenOnMount:t=!1,onAskAiFix:s})=>{const[i,r]=ee.useReducer(ate,void 0,ZN),o=ee.useRef(null),a=ee.useRef(e);ee.useEffect(()=>{a.current!==e&&(a.current=e,o.current=null,r({type:"reset"}))},[e]);const l=ee.useCallback(()=>{r({type:"close"}),window.setTimeout(()=>{var _;(_=o.current)!=null&&_.isConnected&&o.current.focus()},0)},[]),c=ee.useCallback(_=>r({type:"register",key:N_(_),block:_,autoOpenOnMount:t}),[t]),h=ee.useCallback(_=>r({type:"unregister",key:_}),[]),u=ee.useCallback((_,A)=>{const k=document.activeElement;o.current=A??(k instanceof HTMLElement&&k!==document.body?k:null),r({type:"open",key:N_(_),block:_})},[]),d=ee.useCallback(_=>r({type:"tab",tab:_}),[]),p=ee.useCallback(_=>r({type:"source",path:_}),[]),m=ee.useCallback(_=>r({type:"version",versionId:_}),[]),g=ee.useCallback(_=>r({type:"width",percent:_}),[]),v=ee.useCallback(_=>s==null?void 0:s(_),[s]),y=ee.useCallback(()=>r({type:"reset"}),[]),w=ee.useMemo(()=>({state:i,autoOpenOnMount:t,register:c,unregister:h,open:u,close:l,setTab:d,setSourceFile:p,setVersion:m,setPanelPercent:g,askAiToFix:v,reset:y}),[v,t,l,u,c,y,g,p,d,m,i,h]);return S.jsx(XN.Provider,{value:w,children:n})};function nm(){const n=ee.useContext(XN);if(!n)throw new Error("Poster artifacts require an ArtifactPanelProvider");return n}function lte(n,e,t){return on(`/api/v1/chat/artifacts/${encodeURIComponent(n)}/versions/${encodeURIComponent(e)}/source/${t.split("/").map(encodeURIComponent).join("/")}`)}function cte(n,e,t){return on(`/api/v1/chat/artifacts/${encodeURIComponent(n)}/versions/${encodeURIComponent(e)}/figures/${t.split("/").map(encodeURIComponent).join("/")}`)}function hte(n){return on(`/api/v1/chat/artifacts/${encodeURIComponent(n)}/export/pdf`)}function AC(n,e){return on(`/api/v1/chat/artifacts/${encodeURIComponent(n)}/versions/${encodeURIComponent(e)}/export/source.zip`)}function Vm(n){return`pwc:latex-paper-draft:${n}`}function ute(n,e){const t=Object.keys(n).sort(),s=Object.keys(e).sort();return t.length===s.length&&t.every((i,r)=>i===s[r]&&n[i]===e[i])}function xC(n){return!n.includes("\\")&&/^(?!\/)(?!.*(?:^|\/)\.\.?\/)[^\0]{1,300}\.(?:tex|bib)$/iu.test(n)}function dte(n){var s,i;const e=((s=n.provenance)==null?void 0:s.action)??(n.actor_type==="restore"?"restore":n.actor_type==="ai"?"ai_draft":"human_save"),t={human_save:"Human save",ai_draft:"AI draft",ai_repair:"AI repair",restore:"Restore"}[e];return(i=n.provenance)!=null&&i.model_identity?`${t} · ${n.provenance.model_identity}`:t}const fte=({block:n,forceDialog:e=!1})=>{var Mn,Yn,Kt,Zt,us,cn,In,za,Ic;const t=nm(),s=TC(),i=t.close,[r,o]=ee.useState(()=>{var q;return typeof window<"u"&&((q=window.matchMedia)==null?void 0:q.call(window,"(max-width: 760px)").matches)}),[a,l]=ee.useState({}),[c,h]=ee.useState({}),[u,d]=ee.useState(null),[p,m]=ee.useState(!1),[g,v]=ee.useState(!1),[y,w]=ee.useState(null),[_,A]=ee.useState(!1),[k,$]=ee.useState(null),E=ee.useRef(null),I=ee.useRef(null),L=ee.useRef(!1),B=e||r,N=u!==null&&!ute(a,c);ee.useEffect(()=>{var Pe,Je;const q=(Pe=window.matchMedia)==null?void 0:Pe.call(window,"(max-width: 760px)");if(!q)return;const pe=()=>o(q.matches);return pe(),(Je=q.addEventListener)==null||Je.call(q,"change",pe),()=>{var Et;return(Et=q.removeEventListener)==null?void 0:Et.call(q,"change",pe)}},[]),ee.useEffect(()=>{var Pe,Je;if(!B)return;(Je=(Pe=I.current)==null?void 0:Pe.querySelector("[data-artifact-close]"))==null||Je.focus(),window.history.pushState({...window.history.state,pwcArtifactPanel:!0},""),L.current=!0;const q=()=>{if(N&&!window.confirm("Leave this view? Unsaved paper edits remain in this browser.")){window.history.pushState({...window.history.state,pwcArtifactPanel:!0},""),L.current=!0;return}L.current=!1,i()},pe=Et=>{Et.key==="Escape"&&(Et.preventDefault(),!(N&&!window.confirm("Leave this view? Unsaved paper edits remain in this browser."))&&(i(),L.current&&(L.current=!1,window.history.back())))};return window.addEventListener("popstate",q),document.addEventListener("keydown",pe),()=>{window.removeEventListener("popstate",q),document.removeEventListener("keydown",pe)}},[i,B,N]),ee.useEffect(()=>{if(!B)return;const q=pe=>{if(pe.key!=="Tab"||!I.current)return;const Pe=[...I.current.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])')];if(!Pe.length)return;const Je=Pe[0],Et=Pe.at(-1);pe.shiftKey&&document.activeElement===Je?(pe.preventDefault(),Et.focus()):!pe.shiftKey&&document.activeElement===Et&&(pe.preventDefault(),Je.focus())};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[B]),ee.useEffect(()=>{const q=pe=>{N&&(pe.preventDefault(),pe.returnValue="")};return window.addEventListener("beforeunload",q),()=>window.removeEventListener("beforeunload",q)},[N]),ee.useEffect(()=>{const q=pe=>{N&&!window.confirm("Leave this view? Unsaved paper edits remain in this browser.")&&pe.preventDefault()};return window.addEventListener("pwc:artifact-navigation",q),()=>window.removeEventListener("pwc:artifact-navigation",q)},[N]);const H=wo({queryKey:["chat-latex-paper",n.artifact_id],queryFn:async()=>{const q=await fetch(on(`/api/v1/chat/artifacts/${encodeURIComponent(n.artifact_id)}`),{credentials:"include",cache:"no-store"});if(!q.ok)throw new Error("Could not load paper details");return q.json()},enabled:!!n.artifact_id,staleTime:5e3}),U=H.data,j=U==null?void 0:U.source_head,Y=U==null?void 0:U.preview_head,X=wo({queryKey:["chat-latex-paper-history",n.artifact_id,k],queryFn:async()=>{const q=new URLSearchParams({limit:"20"});k&&q.set("cursor",k);const pe=await fetch(on(`/api/v1/chat/artifacts/${encodeURIComponent(n.artifact_id)}/versions?${q}`),{credentials:"include",cache:"no-store"});if(!pe.ok)throw new Error("Could not load paper history");return pe.json()},enabled:_&&!!n.artifact_id,staleTime:Number.POSITIVE_INFINITY}),Q=wo({queryKey:["chat-latex-paper-manifest",n.artifact_id,j==null?void 0:j.version_id],queryFn:async()=>{const q=await fetch(on(`/api/v1/chat/artifacts/${encodeURIComponent(n.artifact_id)}/versions/${encodeURIComponent(j.version_id)}/manifest`),{credentials:"include",cache:"no-store"});if(!q.ok)throw new Error("Could not load paper files");return q.json()},enabled:t.state.tab==="files"&&!!(j!=null&&j.version_id),staleTime:Number.POSITIVE_INFINITY}),se=((Mn=Q.data)==null?void 0:Mn.files.filter(q=>q.media_type==="text/x-tex"||q.media_type==="application/x-bibtex"))??[],ge=((Yn=Q.data)==null?void 0:Yn.files.filter(q=>q.media_type==="image/png"||q.media_type==="image/jpeg"||q.media_type==="application/pdf"))??[],z=wo({queryKey:["chat-latex-paper-source-files",n.artifact_id,j==null?void 0:j.version_id],queryFn:async()=>Object.fromEntries(await Promise.all(se.map(async q=>{const pe=await fetch(lte(n.artifact_id,j.version_id,q.path),{credentials:"include",cache:"no-store"});if(!pe.ok)throw new Error("Could not load paper source");return[q.path,await pe.text()]}))),enabled:t.state.tab==="files"&&!!(j!=null&&j.version_id&&se.length),staleTime:Number.POSITIVE_INFINITY});ee.useEffect(()=>{m(!1)},[j==null?void 0:j.version_id]),ee.useEffect(()=>{var Et;if(!(j!=null&&j.version_id)||!z.data||E.current===j.version_id)return;const q=z.data;let pe=q,Pe=!1,Je=j.version_id;try{const tr=window.localStorage.getItem(Vm(n.artifact_id)),Hs=tr?JSON.parse(tr):null;Hs!=null&&Hs.files&&typeof Hs.files=="object"&&(pe=Hs.files,Pe=Hs.parentVersionId!==j.version_id,Je=Hs.parentVersionId)}catch{}E.current=j.version_id,l(pe),h(q),d(Je),v(Pe),m(!0),Pe&&w("This local draft is based on an older paper version. Copy or discard it before saving the latest version."),(!t.state.sourceFile||!pe[t.state.sourceFile])&&t.setSourceFile(((Et=Q.data)==null?void 0:Et.root_document)??null)},[n.artifact_id,(Kt=Q.data)==null?void 0:Kt.root_document,t,j==null?void 0:j.version_id,z.data]),ee.useEffect(()=>{if(!u||!n.artifact_id)return;const q=Vm(n.artifact_id);if(!N){window.localStorage.removeItem(q);return}window.localStorage.setItem(q,JSON.stringify({parentVersionId:u,files:a}))},[n.artifact_id,N,u,a]);const P=im({mutationFn:async()=>{var Pe;if(!(j!=null&&j.version_id))throw new Error("Paper source is not ready to save");const q=await fetch(on(`/api/v1/chat/artifacts/${encodeURIComponent(n.artifact_id)}/save-compile`),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({expected_parent_version_id:j.version_id,files:Object.entries(a).map(([Je,Et])=>({path:Je,content:Et}))})}),pe=await q.json().catch(()=>null);if(!q.ok)throw new Error(((Pe=pe==null?void 0:pe.detail)==null?void 0:Pe.message)??"Could not save paper");return pe},onSuccess:q=>{var pe,Pe;s.setQueryData(["chat-latex-paper",n.artifact_id],q),s.invalidateQueries({queryKey:["chat-latex-paper-manifest",n.artifact_id]}),s.invalidateQueries({queryKey:["chat-latex-paper-source-files",n.artifact_id]}),E.current=((pe=q.source_head)==null?void 0:pe.version_id)??null,h(a),d(((Pe=q.source_head)==null?void 0:Pe.version_id)??null),window.localStorage.removeItem(Vm(n.artifact_id)),w(null),v(!1),t.setTab("preview")},onError:q=>w(q instanceof Error?q.message:"Could not save paper")}),D=im({mutationFn:async q=>{var Je;if(!(j!=null&&j.version_id))throw new Error("Paper source is not ready to restore");const pe=await fetch(on(`/api/v1/chat/artifacts/${encodeURIComponent(n.artifact_id)}/versions/restore`),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({source_version_id:q,expected_parent_version_id:j.version_id})}),Pe=await pe.json().catch(()=>null);if(!pe.ok)throw new Error(((Je=Pe==null?void 0:Pe.detail)==null?void 0:Je.message)??"Could not restore paper version");return Pe},onSuccess:q=>{s.setQueryData(["chat-latex-paper",n.artifact_id],q),s.invalidateQueries({queryKey:["chat-latex-paper-history",n.artifact_id]}),s.invalidateQueries({queryKey:["chat-latex-paper-manifest",n.artifact_id]}),s.invalidateQueries({queryKey:["chat-latex-paper-source-files",n.artifact_id]}),E.current=null,m(!1),$(null),w(null),t.setTab("preview")},onError:q=>w(q instanceof Error?q.message:"Could not restore paper version")}),R=im({mutationFn:async q=>{var Et;if(!(j!=null&&j.version_id))throw new Error("Paper source is not ready to upload a figure");if(N)throw new Error("Save or discard text edits before uploading a figure");const pe=new FormData;pe.set("expected_parent_version_id",j.version_id),pe.set("path",`figures/${q.name}`),pe.set("figure",q);const Pe=await fetch(on(`/api/v1/chat/artifacts/${encodeURIComponent(n.artifact_id)}/figures`),{method:"POST",credentials:"include",body:pe}),Je=await Pe.json().catch(()=>null);if(!Pe.ok)throw new Error(((Et=Je==null?void 0:Je.detail)==null?void 0:Et.message)??"Could not upload figure");return Je},onSuccess:q=>{s.setQueryData(["chat-latex-paper",n.artifact_id],q),s.invalidateQueries({queryKey:["chat-latex-paper-manifest",n.artifact_id]}),s.invalidateQueries({queryKey:["chat-latex-paper-source-files",n.artifact_id]}),w(null)},onError:q=>w(q instanceof Error?q.message:"Could not upload figure")}),x=im({mutationFn:async()=>{const q=await fetch(on(`/api/v1/chat/artifacts/${encodeURIComponent(n.artifact_id)}/refresh-compile`),{method:"POST",credentials:"include"});if(!q.ok)throw new Error("Could not refresh paper compilation");return q.json()},onSuccess:q=>s.setQueryData(["chat-latex-paper",n.artifact_id],q)}).mutate,O=j==null?void 0:j.version_id,W=j==null?void 0:j.compile_status;ee.useEffect(()=>{if(!O||!n.artifact_id||!["queued","compiling"].includes(W??""))return;const q=window.setTimeout(()=>x(),2e3);return()=>window.clearTimeout(q)},[n.artifact_id,x,W,O]);const Z=t.state.sourceFile??((Zt=Q.data)==null?void 0:Zt.root_document)??null,ae=(U==null?void 0:U.editing_enabled)===!0&&!!(j!=null&&j.version_id)&&p&&!g&&!P.isPending,ne=new Map(((us=X.data)==null?void 0:us.items.map(q=>[q.version_id,q.version]))??[]),Ee=Y?on(`/api/v1/chat/artifacts/${encodeURIComponent(n.artifact_id)}/versions/${encodeURIComponent(Y.version_id)}/preview`):null,kt=!!(j&&Y&&j.version_id!==Y.version_id),je=()=>!N||window.confirm("Leave this view? Unsaved paper edits remain in this browser."),Be=q=>q!==t.state.tab&&!je()?!1:(t.setTab(q),!0),it=q=>{var Pe,Je;if(!["ArrowLeft","ArrowRight","Home","End"].includes(q.key))return;q.preventDefault();const pe=q.key==="ArrowLeft"||q.key==="Home"?"preview":"files";Be(pe)&&((Je=(Pe=q.currentTarget.parentElement)==null?void 0:Pe.querySelector(`#paper-${pe}-tab`))==null||Je.focus())},rt=q=>{q!==Z&&N&&!window.confirm("Switch files? Unsaved edits stay in this browser.")||t.setSourceFile(q)},Ut=()=>{const q=window.prompt("New TeX or BibTeX file name","section.tex");if(q){if(!xC(q)||a[q]){w("Choose a new safe .tex or .bib filename.");return}if(Object.keys(a).length>=100){w("A paper can contain at most 100 files.");return}l({...a,[q]:""}),w(null),t.setSourceFile(q)}},ln=()=>{var Pe;if(!Z||Z===((Pe=Q.data)==null?void 0:Pe.root_document))return;const q=window.prompt("Rename file",Z);if(!q||q===Z)return;if(!xC(q)||a[q]){w("Choose a new safe .tex or .bib filename.");return}const pe={...a,[q]:a[Z]};delete pe[Z],l(pe),t.setSourceFile(q)},zs=()=>{var pe,Pe;if(!Z||Z===((pe=Q.data)==null?void 0:pe.root_document)||!window.confirm(`Delete ${Z}?`))return;const q={...a};delete q[Z],l(q),t.setSourceFile(((Pe=Q.data)==null?void 0:Pe.root_document)??null)},Rn=()=>{!g||!window.confirm("Discard this stale local draft?")||(window.localStorage.removeItem(Vm(n.artifact_id)),l(c),d((j==null?void 0:j.version_id)??null),v(!1),w(null))},_n=()=>{je()&&(i(),B&&L.current&&(L.current=!1,window.history.back()))},As=()=>{if(!j||j.compile_status!=="failed"||j.repair_exhausted)return;const q=(j.compile_diagnostics??[]).slice(0,20).map(pe=>`${pe.file??"project"}${pe.line?`:${pe.line}`:""}: ${pe.message}`).join(` `);t.askAiToFix(`Repair the failed paper source version ${j.version_id}. Use pwc-paper to inspect and repair it; make no more than three attempts. Compiler diagnostics: -${q||"No compiler diagnostic was available."}`)},hs=q=>{!q||!Be("files")||t.setSourceFile(q)};return S.jsxs("section",{ref:I,className:`chat-artifact-panel${B?" is-dialog":" is-docked"}`,role:B?"dialog":"complementary","aria-modal":B?!0:void 0,"aria-labelledby":"latex-paper-title","data-testid":"latex-paper-panel",children:[S.jsxs("header",{children:[S.jsxs("div",{children:[S.jsx("span",{children:"Private paper"}),S.jsx("h2",{id:"latex-paper-title",children:n.title}),S.jsxs("p",{className:"chat-paper-status",role:"status","aria-live":"polite",children:[j?`Source v${j.version} · ${j.compile_status}`:"Preparing paper source",kt?" · Preview out of date":""]}),S.jsx("p",{className:"chat-paper-privacy-note",children:"This paper is private to this chat. Source, figures, and PDFs are stored privately; AI-authored text needs your review."})]}),S.jsxs("div",{className:"chat-artifact-header-actions",children:[S.jsx("button",{type:"button","aria-expanded":_,"aria-controls":"paper-version-history",onClick:()=>{$(null),A(!_)},children:"Version history"}),S.jsx("button",{type:"button","data-artifact-close":!0,"aria-label":B?"Back to conversation":"Close paper",onClick:_n,children:S.jsx(D_,{})})]})]}),S.jsxs("nav",{"aria-label":"Paper views",role:"tablist",children:[S.jsx("button",{type:"button",id:"paper-preview-tab",role:"tab","aria-selected":t.state.tab==="preview","aria-controls":"paper-preview-panel",tabIndex:t.state.tab==="preview"?0:-1,className:t.state.tab==="preview"?"active":"",onClick:()=>Be("preview"),onKeyDown:it,children:"Preview"}),S.jsx("button",{type:"button",id:"paper-files-tab",role:"tab","aria-selected":t.state.tab==="files","aria-controls":"paper-files-panel",tabIndex:t.state.tab==="files"?0:-1,className:t.state.tab==="files"?"active":"",onClick:()=>Be("files"),onKeyDown:it,children:"Files"})]}),S.jsxs("div",{id:t.state.tab==="preview"?"paper-preview-panel":"paper-files-panel",role:"tabpanel","aria-labelledby":t.state.tab==="preview"?"paper-preview-tab":"paper-files-tab",className:"chat-artifact-panel-body",children:[t.state.tab==="preview"?H.isError?S.jsxs("div",{role:"alert",children:["Could not load paper details. ",S.jsx("button",{type:"button",onClick:()=>void H.refetch(),children:"Retry paper details"})]}):Ee?S.jsx(WX,{url:Ee,downloadUrl:hte(n.artifact_id),paperKey:`${n.artifact_id}:${Y==null?void 0:Y.version_id}`,paperTitle:n.title,paperHref:"/chat",chrome:"canvas"},Y==null?void 0:Y.version_id):j?j.compile_status==="failed"?S.jsx("p",{role:"alert",children:"No compiled preview is available for this failed source version. Review the diagnostics or fix the paper in Files."}):["queued","compiling"].includes(j.compile_status)?S.jsx("p",{role:"status",children:"Preview is compiling. The stored source is available in Files."}):S.jsx("p",{role:"alert",children:"No compiled preview is available for this source version."}):S.jsx("p",{role:"status",children:"Paper source and compiled preview are not available yet."}):S.jsxs("div",{className:"chat-artifact-source-workspace",children:[S.jsxs("nav",{"aria-label":"Paper source files",children:[se.map(q=>S.jsx("button",{type:"button","aria-pressed":Z===q.path,onClick:()=>rt(q.path),children:q.path},q.path)),ae&&S.jsxs("button",{type:"button",className:"latex-file-action","aria-label":"Add TeX file",onClick:Ut,children:[S.jsx(TL,{})," Add file"]}),ae&&S.jsxs("label",{className:"latex-file-action",children:["Upload figure",S.jsx("input",{"aria-label":"Upload figure",type:"file",accept:"image/png,image/jpeg,application/pdf,.png,.jpg,.jpeg,.pdf",disabled:R.isPending,onChange:q=>{var Pe;const pe=(Pe=q.currentTarget.files)==null?void 0:Pe[0];q.currentTarget.value="",pe&&R.mutate(pe)}})]}),ge.map(q=>j&&S.jsx("a",{href:cte(n.artifact_id,j.version_id,q.path),download:!0,children:q.path},q.path))]}),S.jsxs("div",{className:"latex-editor-column",children:[Z&&a[Z]!==void 0?S.jsx(rte,{path:Z,value:a[Z],readOnly:!ae,onChange:q=>l({...a,[Z]:q})}):S.jsx("p",{children:z.isError?"Source could not be loaded.":"Loading source…"}),ae&&Z&&Z!==((cn=Q.data)==null?void 0:cn.root_document)&&S.jsxs("div",{className:"latex-file-buttons",children:[S.jsxs("button",{type:"button",onClick:ln,children:[S.jsx(LC,{})," Rename"]}),S.jsxs("button",{type:"button",onClick:zs,children:[S.jsx(wL,{})," Delete"]})]})]})]}),_&&S.jsxs("section",{id:"paper-version-history",className:"chat-artifact-history","aria-label":"Paper version history",children:[S.jsx("h3",{children:"Version history"}),X.isLoading&&S.jsx("p",{children:"Loading history…"}),X.isError&&S.jsx("p",{role:"alert",children:"Paper history could not be loaded."}),(In=X.data)==null?void 0:In.items.map(q=>{var pe,Pe,Je,Et;return S.jsxs("article",{children:[S.jsxs("strong",{children:["v",q.version," · ",q.compile_status]}),S.jsx("span",{children:dte(q)}),q.created_at&&S.jsx("time",{dateTime:q.created_at,children:q.created_at}),q.parent_version_id&&S.jsxs("span",{children:["Parent ",ne.has(q.parent_version_id)?`v${ne.get(q.parent_version_id)}`:q.parent_version_id]}),(pe=q.provenance)!=null&&pe.changed_files.length?S.jsxs("span",{children:["Changed: ",q.provenance.changed_files.join(", ")]}):null,((Pe=q.provenance)==null?void 0:Pe.restored_from_version_id)&&S.jsxs("span",{children:["Restored from ",q.provenance.restored_from_version_id]}),((Je=q.provenance)==null?void 0:Je.change_summary)&&S.jsx("p",{children:q.provenance.change_summary}),(Et=q.provenance)==null?void 0:Et.reference_changes.map(tr=>S.jsx("p",{children:tr},tr)),S.jsx("a",{href:AC(n.artifact_id,q.version_id),download:!0,children:"Source ZIP"}),(U==null?void 0:U.editing_enabled)&&(j==null?void 0:j.version_id)&&q.version_id!==j.version_id&&S.jsxs("button",{type:"button",disabled:D.isPending||N,onClick:()=>D.mutate(q.version_id),children:["Restore version ",q.version]})]},q.version_id)}),((za=X.data)==null?void 0:za.next_cursor)&&S.jsx("button",{type:"button",onClick:()=>$(X.data.next_cursor??null),children:"Load older versions"})]})]}),S.jsxs("footer",{children:[S.jsxs("div",{className:"chat-artifact-metadata","aria-live":"polite",children:[kt&&S.jsx("strong",{children:"Out of date"}),(Ic=j==null?void 0:j.compile_diagnostics)==null?void 0:Ic.map((q,pe)=>S.jsxs("button",{type:"button",onClick:()=>hs(q.file),className:"latex-compile-diagnostic",children:[q.file?`${q.file}${q.line?`:${q.line}`:""}: `:"",q.message]},`${q.file??"global"}:${q.line??""}:${pe}`)),y&&S.jsx("span",{role:"alert",children:y}),g&&S.jsx("button",{type:"button",onClick:Rn,children:"Discard stale local draft"})]}),S.jsxs("div",{className:"chat-artifact-actions",children:[(j==null?void 0:j.compile_status)==="failed"&&!j.repair_exhausted&&S.jsx("button",{type:"button",onClick:As,children:"Ask AI to fix"}),(j==null?void 0:j.compile_status)==="failed"&&j.repair_exhausted&&S.jsx("span",{role:"status",children:"AI repair attempts exhausted"}),t.state.tab==="files"&&ae&&S.jsxs("button",{type:"button",disabled:!N,onClick:()=>P.mutate(),children:[S.jsx(RL,{}),P.isPending?"Saving…":"Save & Compile"]}),j&&S.jsxs("a",{href:AC(n.artifact_id,j.version_id),download:!0,children:[S.jsx(z_,{})," Source ZIP"]})]})]})]})},pte="https://github.com/Chenruishuo/posterly/tree/b9f42e5578a49a27525a68f85376bb3bb25af86f";function mte(){if(typeof window>"u")return null;const n=window.location.pathname.match(/^\/share\/([^/]+)/u);return n?decodeURIComponent(n[1]):null}function YN(n){if(n.scope==="public"){const s=mte();if(!s||!n.public_capability)return null;const i=`/api/v1/chat/shares/${encodeURIComponent(s)}/artifacts/${encodeURIComponent(n.public_capability)}`;return{preview:on(`${i}/preview`),png:on(`${i}/download/png`),pdf:on(`${i}/download/pdf`),manifest:null,source:null,gate:null,download:null}}if(!n.artifact_id||!n.version_id)return null;const e=`/api/v1/chat/artifacts/${encodeURIComponent(n.artifact_id)}/versions/${encodeURIComponent(n.version_id)}`,t=(s,i)=>on(`${e}/${s}/${i.split("/").map(encodeURIComponent).join("/")}`);return{preview:on(`${e}/preview`),png:t("download","poster.png"),pdf:null,manifest:on(`${e}/manifest`),source:s=>t("source",s),gate:s=>t("source",s),download:s=>t("download",s)}}const JN=n=>({passed:"Passed",warnings:"Passed with warnings",failed:"Draft—checks failed"})[n??"passed"];function gte(){const[n,e]=ee.useState(()=>{var t;return typeof window<"u"&&((t=window.matchMedia)==null?void 0:t.call(window,"(max-width: 760px)").matches)});return ee.useEffect(()=>{var i,r;const t=(i=window.matchMedia)==null?void 0:i.call(window,"(max-width: 760px)");if(!t)return;const s=()=>e(t.matches);return s(),(r=t.addEventListener)==null||r.call(t,"change",s),()=>{var o;return(o=t.removeEventListener)==null?void 0:o.call(t,"change",s)}},[]),n}const yte=({forceDialog:n=!1,readerFallback:e=!1})=>{var k,$,E,I;const t=nm(),s=t.close,{state:i}=t,r=i.selected,o=gte(),a=n||o,l=ee.useRef(null),c=ee.useRef(!1),h=wo({queryKey:["chat-artifact-versions",r==null?void 0:r.artifact_id],queryFn:async()=>{const L=await fetch(on(`/api/v1/chat/artifacts/${encodeURIComponent(r.artifact_id)}`),{credentials:"include",cache:"no-store"});if(!L.ok)throw new Error("Could not load poster versions");return(await L.json()).versions},enabled:i.open&&(r==null?void 0:r.scope)==="owner"&&!!r.artifact_id,staleTime:Number.POSITIVE_INFINITY}),u=(k=h.data)==null?void 0:k.find(L=>L.version_id===i.selectedVersionId),d=r&&u?{...r,version_id:u.version_id,version:u.version,gate_status:u.gate_status,total_bytes:u.total_bytes}:r,p=d?YN(d):null,g=wo({queryKey:["chat-artifact-manifest",d==null?void 0:d.version_id],queryFn:async()=>{const L=await fetch(p.manifest,{credentials:"include",cache:"no-store"});if(!L.ok)throw new Error("Could not load poster details");return L.json()},enabled:i.open&&(d==null?void 0:d.scope)==="owner"&&!!(p!=null&&p.manifest),staleTime:Number.POSITIVE_INFINITY}).data,v=i.sourceFile??(g==null?void 0:g.entrypoint)??null,y=wo({queryKey:["chat-artifact-source",d==null?void 0:d.version_id,v],queryFn:async()=>{const L=await fetch(p.source(v),{credentials:"include",cache:"no-store"});if(!L.ok)throw new Error("Source could not be loaded");return L.text()},enabled:i.open&&i.tab==="source"&&(d==null?void 0:d.scope)==="owner"&&!!(v&&(p!=null&&p.source)),staleTime:Number.POSITIVE_INFINITY});if(ee.useEffect(()=>{var B,N;if(!i.open||!a)return;(N=(B=l.current)==null?void 0:B.querySelector("[data-artifact-close]"))==null||N.focus(),window.history.pushState({...window.history.state,pwcArtifactPanel:!0},""),c.current=!0;const L=()=>{c.current=!1,s()};return window.addEventListener("popstate",L),()=>window.removeEventListener("popstate",L)},[s,a,i.open]),ee.useEffect(()=>{if(!i.open||!a)return;const L=B=>{if(B.key==="Escape"){B.preventDefault(),s(),c.current&&(c.current=!1,window.history.back());return}if(B.key!=="Tab"||!l.current)return;const N=[...l.current.querySelectorAll('button:not([disabled]), a[href], select:not([disabled]), [tabindex]:not([tabindex="-1"])')];if(!N.length)return;const H=N[0],U=N.at(-1);B.shiftKey&&document.activeElement===H?(B.preventDefault(),U.focus()):!B.shiftKey&&document.activeElement===U&&(B.preventDefault(),H.focus())};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[s,a,i.open]),!i.open||!d||!p)return null;const w=()=>{s(),a&&c.current&&(c.current=!1,window.history.back())},_=($=g==null?void 0:g.downloads[0])==null?void 0:$.path,A=d.scope==="public"?p.pdf:_&&p.download?p.download(_):null;return S.jsxs("section",{ref:l,className:`chat-artifact-panel${a?" is-dialog":" is-docked"}${e?" is-reader-fallback":""}`,role:a?"dialog":"complementary","aria-modal":a?!0:void 0,"aria-label":d.title,"data-testid":"artifact-panel",children:[S.jsxs("header",{children:[S.jsxs("div",{children:[S.jsx("span",{children:"Posterly artifact"}),S.jsx("h2",{children:d.title})]}),(((E=h.data)==null?void 0:E.length)??0)>1&&S.jsxs("label",{className:"chat-artifact-version",children:["Version",S.jsx("select",{"aria-label":"Poster version",value:d.version_id,onChange:L=>t.setVersion(L.target.value),children:[...h.data??[]].reverse().map(L=>S.jsxs("option",{value:L.version_id,children:["v",L.version]},L.version_id))})]}),S.jsx("button",{type:"button","data-artifact-close":!0,"aria-label":a?"Back to conversation":"Close poster",onClick:w,children:S.jsx(D_,{})})]}),S.jsxs("nav",{"aria-label":"Poster views",children:[S.jsx("button",{type:"button","aria-pressed":i.tab==="preview",className:i.tab==="preview"?"active":"",onClick:()=>t.setTab("preview"),children:"Preview"}),d.scope==="owner"&&S.jsx("button",{type:"button","aria-pressed":i.tab==="source",className:i.tab==="source"?"active":"",onClick:()=>t.setTab("source"),children:"Source"})]}),S.jsx("div",{className:"chat-artifact-panel-body",children:i.tab==="preview"?S.jsx("img",{src:p.preview,alt:`Full preview of ${d.title}`}):S.jsxs("div",{className:"chat-artifact-source-workspace",children:[(((I=g==null?void 0:g.source_files)==null?void 0:I.length)??0)>1&&S.jsx("nav",{"aria-label":"Poster source files",children:g.source_files.map(L=>S.jsx("button",{type:"button","aria-pressed":v===L,onClick:()=>t.setSourceFile(L),children:L},L))}),S.jsx("pre",{children:S.jsx("code",{children:y.isError?"Source could not be loaded.":y.data??"Loading source…"})})]})}),S.jsxs("footer",{children:[S.jsxs("div",{className:"chat-artifact-metadata",children:[S.jsx("strong",{children:JN(d.gate_status)}),g&&S.jsxs("span",{children:[g.canvas.width," × ",g.canvas.height," ",g.canvas.unit," · ",g.canvas.orientation," · ",g.direction]}),g==null?void 0:g.gate_summary.map(L=>S.jsx("span",{children:L},L))]}),S.jsxs("div",{className:"chat-artifact-actions",children:[S.jsxs("a",{href:p.png,download:!0,children:[S.jsx(nA,{})," PNG"]}),d.gate_status!=="failed"&&A&&S.jsxs("a",{href:A,download:!0,children:[S.jsx(nA,{})," PDF"]}),d.scope==="owner"&&g&&p.source&&S.jsxs("a",{href:p.source(g.entrypoint),download:!0,children:[S.jsx(z_,{})," HTML"]}),d.scope==="owner"&&g&&p.gate&&S.jsx("a",{href:p.gate(g.gate_report),download:!0,children:"Gate report"}),S.jsxs("a",{href:pte,target:"_blank",rel:"noreferrer",children:[S.jsx(NC,{})," Posterly source · AGPL-3.0"]})]})]})]})},EC=n=>{var t;const{state:e}=nm();return((t=e.selected)==null?void 0:t.artifact_kind)==="latex_paper"?S.jsx(fte,{block:e.selected,...n}):S.jsx(yte,{...n})},vte=({block:n})=>{const e=nm(),t=e.register,s=e.unregister,i=N_(n);if(ee.useEffect(()=>{t(n)},[n,t]),ee.useEffect(()=>()=>s(i),[i,s]),n.status==="generating")return S.jsxs("div",{className:"chat-artifact-card chat-artifact-generating",role:"status",children:[S.jsx("span",{className:"chat-artifact-pulse","aria-hidden":"true"}),S.jsxs("span",{children:[S.jsx("strong",{children:n.title}),S.jsx("small",{children:"Publishing Posterly preview…"})]})]});if(n.status==="error")return S.jsxs("div",{className:"chat-artifact-card chat-artifact-error",role:"alert",children:[S.jsx(z_,{"aria-hidden":"true"}),S.jsxs("span",{children:[S.jsx("strong",{children:n.title}),S.jsx("small",{children:n.error_message??"Poster publication failed."})]})]});const r=YN(n);if(!r)return null;const o=e.state.open&&e.state.selectedKey===i;return S.jsxs("button",{type:"button",className:`chat-artifact-card${o?" is-selected":""}`,"aria-pressed":o,onClick:a=>e.open(n,a.currentTarget),children:[S.jsx("img",{src:r.preview,alt:`Preview of ${n.title}`}),S.jsxs("span",{className:"chat-artifact-card-copy",children:[S.jsxs("span",{className:"chat-artifact-kicker",children:[S.jsx(PL,{"aria-hidden":"true"})," Posterly · v",n.version]}),S.jsx("strong",{children:n.title}),S.jsx("small",{className:`chat-artifact-gate chat-artifact-gate-${n.gate_status}`,children:JN(n.gate_status)})]})]})};function bte(n){if(!n.authors.length)return"";const e=n.authors.slice(0,3).map(t=>t.name).join(", ");return n.authors.length>3?`${e}, et al.`:e}function wte(n){var t;if(n.conference)return n.conference;const e=(t=n.published)==null?void 0:t.slice(0,4);if(n.arxiv_id)return e?`arXiv ${e}`:"arXiv";if(n.source_url)try{return new URL(n.source_url).hostname.replace(/^www\./,"")}catch{}return e??"external"}function _te(n,e=240){const t=n.content.trim();return t.length<=e?t:`${t.slice(0,e).trimEnd()}…`}const Ste="https://huggingface.co/pro",kte="https://huggingface.co/docs/inference-providers/pricing",Ate="https://paperswithcode.co/chat",QN=()=>S.jsx("span",{className:"chat-caret"}),xte=n=>{var t;if(!n.streaming)return!1;const e=(t=n.blocks)==null?void 0:t.at(-1);return e?e.kind==="reasoning"?!e.active:e.kind==="tool"?e.status!=="running":!1:!0},Ete=n=>{var p,m;const e=n.currentTarget,t=e.ownerDocument,s=(p=t.caretPositionFromPoint)==null?void 0:p.call(t,n.clientX,n.clientY),i=s?null:(m=t.caretRangeFromPoint)==null?void 0:m.call(t,n.clientX,n.clientY),r=(s==null?void 0:s.offsetNode)??(i==null?void 0:i.startContainer),o=(s==null?void 0:s.offset)??(i==null?void 0:i.startOffset);if(!(r instanceof Text)||o===void 0||!e.contains(r))return;const a=r.data,l=/[\p{L}\p{M}\p{N}_'-]/u;let c=Math.min(o,a.length),h=c;for(;c>0&&l.test(a[c-1]);)c-=1;for(;h{const t=[];let s=0;for(const i of[...e].sort((r,o)=>r.start-o.start)){const r=n.slice(i.start,i.end);i.startn.length||r!==i.title&&r!==`@${i.title}`||(t.push(n.slice(s,i.start)),t.push(S.jsxs("span",{className:"chat-inline-paper-mention",children:[S.jsx(OC,{size:13,"aria-hidden":"true"}),S.jsx(F_,{routeId:i.route_id,className:"chat-inline-paper-link",children:r.startsWith("@")?r.slice(1):r})]},i.key)),s=i.end)}return t.push(n.slice(s)),S.jsx(S.Fragment,{children:t})},$te=({block:n,papers:e,citations:t,webCitations:s,onToggle:i})=>n.active?S.jsxs("div",{className:"chat-reason-live",children:[S.jsxs("div",{className:"chat-reason-live-head",children:[S.jsx(j_,{})," ",S.jsx("span",{children:"Thinking…"})]}),S.jsxs("div",{className:"chat-reason-live-body chat-answer chat-reason-markdown",children:[S.jsx(zv,{text:n.text,streaming:!0,papers:e,citations:t,webCitations:s}),S.jsx(QN,{})]})]}):S.jsxs("div",{className:"chat-reason-done",children:[S.jsxs("button",{type:"button",className:"chat-reason-done-head",onClick:i,"aria-expanded":n.open,children:[S.jsx(gL,{}),S.jsx("span",{children:"Thought for a few seconds"}),S.jsx(IC,{open:n.open})]}),n.open&&S.jsx("div",{className:"chat-reason-done-body chat-answer chat-reason-markdown",children:S.jsx(zv,{text:n.text,papers:e,citations:t,webCitations:s})})]}),Tte=({block:n,papers:e,onToggle:t})=>{var d,p,m,g;const s=n.status==="running",i=s&&n.argumentState==="streaming",r=n.schema_version===2||!!n.content,o=n.status==="error"||n.status==="denied",a=typeof n.args.query=="string"?n.args.query:"",l=typeof n.args.command=="string"?n.args.command:typeof n.args.file_path=="string"?n.args.file_path:a,c=n.name.startsWith("pwc_")?Object.entries(n.args).filter(([,v])=>v!=null&&v!=="").map(([v,y])=>`${v}=${typeof y=="string"?y:JSON.stringify(y)}`).join(" · "):r?l:`("${a}")`,h=((d=n.content)==null?void 0:d.map(v=>v.text).join(""))??"",u=i?"streaming arguments…":s?"running…":r?`${n.status} · ${n.took_ms??0} ms`:`${n.hits} results · ${n.took_ms} ms`;return S.jsxs("div",{className:`chat-tool${s?" chat-tool-running":""}${o?" chat-tool-failed":""}`,children:[S.jsxs("button",{type:"button",className:"chat-tool-head",onClick:t,"aria-expanded":n.open,children:[S.jsxs("span",{className:"chat-tool-head-left",children:[s?S.jsx(j_,{}):S.jsx(yL,{}),S.jsx("code",{className:"chat-tool-name",children:n.name}),S.jsx("span",{className:"chat-tool-query",title:c,children:c})]}),S.jsxs("span",{className:"chat-tool-head-right",children:[S.jsx("span",{className:"chat-tool-status",children:u}),S.jsx(IC,{open:n.open})]})]}),n.open&&S.jsxs("div",{className:"chat-tool-body",children:[S.jsxs("div",{className:"chat-tool-args",children:[S.jsxs("span",{className:"chat-tool-label",children:["arguments",n.arguments_redacted?" · redacted":""]}),S.jsx("pre",{children:n.argumentState==="streaming"&&!n.arguments_redacted&&n.argumentText||JSON.stringify(n.args,null,2)})]}),!s&&r?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"chat-tool-output-head",children:[S.jsx("span",{className:"chat-tool-label",children:"result"}),S.jsx("button",{type:"button",className:"chat-tool-copy",onClick:()=>void navigator.clipboard.writeText(h),children:"Copy"})]}),S.jsx("pre",{className:"chat-tool-output",children:S.jsx("code",{children:h})}),((p=n.metadata)==null?void 0:p.output_truncated)&&S.jsx("div",{className:"chat-tool-truncated",children:"Output was truncated."})]}):s?null:S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"chat-tool-label chat-tool-results-label",children:["returned ",((m=n.results)==null?void 0:m.length)??0," papers"]}),S.jsx("ol",{className:"chat-tool-results",children:(g=n.results)==null?void 0:g.map(v=>S.jsxs("li",{className:"chat-hit",children:[S.jsx("div",{className:"chat-hit-top",children:S.jsx(HC,{routeId:v.route_id,paper:e[v.route_id],className:"chat-hit-title",children:v.title})}),S.jsx("div",{className:"chat-hit-meta",children:[bte(v.metadata),wte(v.metadata)].filter(Boolean).join(" · ")}),S.jsxs("div",{className:"chat-hit-snippet",children:[_te(v),v.content_truncated&&S.jsx("span",{className:"chat-hit-truncated",children:" (truncated)"})]})]},v.route_id))})]})]})]})},Pte=({block:n,papers:e,citations:t,webCitations:s,streaming:i})=>S.jsxs("div",{className:"chat-answer",children:[S.jsx(zv,{text:n.text,streaming:i,papers:e,citations:t,webCitations:s}),i&&!!n.text.trim()&&S.jsx(QN,{})]}),Rte=({block:n})=>S.jsx(y6,{block:n}),eL=n=>{const e=ee.useRef(null),t=ee.useCallback(()=>{const s=e.current;if(!s)return;s.style.height="auto";const i=Math.max(120,window.innerHeight*.4);s.style.height=`${Math.min(s.scrollHeight,i)}px`,s.style.overflowY=s.scrollHeight>i?"auto":"hidden"},[]);return ee.useLayoutEffect(()=>{var s,i;(s=e.current)==null||s.focus(),(i=e.current)==null||i.setSelectionRange(n.length,n.length),t()},[t,n.length]),{textareaRef:e,resize:t}},Mte=({id:n,text:e,paperSelection:t,editNotice:s,onCancel:i,onResend:r,onResendDraft:o})=>{const[a,l]=ee.useState(e),[c,h]=ee.useState(t),[u,d]=ee.useState(!1),{textareaRef:p,resize:m}=eL(e);ee.useLayoutEffect(m,[m,a]);const g=!!a.trim()&&a.length<=8e3,v=()=>{if(!g||u)return;d(!0),((o==null?void 0:o({text:a,paperMentions:[],...c?{paperSelection:c}:{}}))??(r==null?void 0:r(a))??!1)||d(!1)};return S.jsx("div",{className:"chat-msg chat-msg-user chat-msg-user-editing","data-message-id":n,children:S.jsxs("div",{className:"chat-inline-editor",children:[c&&S.jsx(Yy,{selection:c,editable:!0,onRemove:()=>h(void 0)}),S.jsx("textarea",{ref:p,className:"chat-inline-editor-textarea","aria-label":"Edit message",value:a,maxLength:8e3,onChange:y=>l(y.target.value),onKeyDown:y=>{y.key==="Escape"?(y.preventDefault(),i==null||i()):y.key==="Enter"&&!y.shiftKey&&!y.nativeEvent.isComposing&&(y.preventDefault(),v())}}),s&&S.jsx("div",{className:"chat-inline-editor-notice",children:s}),S.jsxs("div",{className:"chat-inline-editor-actions",children:[S.jsx("button",{type:"button",onClick:i,children:"Cancel"}),S.jsx("button",{type:"button",className:"chat-inline-editor-send",disabled:!g||u,onClick:v,children:"Send"})]})]})})},Ite=({id:n,text:e,paperMentions:t,paperSelection:s,enabled:i,editNotice:r,onCancel:o,onResend:a,onResendDraft:l})=>{const[c,h]=ee.useState({text:e,paperMentions:t,...s?{paperSelection:s}:{}}),[u,d]=ee.useState(!1),[p,m]=ee.useState(0),{textareaRef:g,resize:v}=eL(e),y=PC({draft:c,onChange:h,enabled:i,textareaRef:g});ee.useLayoutEffect(v,[v,c.text]);const w=!!c.text.trim()&&c.text.length<=8e3&&(i||c.paperMentions.length===0),_=()=>{if(!w||u)return;d(!0),((l==null?void 0:l(c))??(a==null?void 0:a(c.text))??!1)||d(!1)};return S.jsx("div",{className:"chat-msg chat-msg-user chat-msg-user-editing","data-message-id":n,children:S.jsxs("div",{className:"chat-inline-editor",children:[c.paperSelection&&S.jsx(Yy,{selection:c.paperSelection,editable:!0,onRemove:()=>h({text:c.text,paperMentions:c.paperMentions})}),S.jsxs("div",{className:"chat-inline-editor-textarea-wrap",children:[S.jsx(RC,{text:c.text,mentions:c.paperMentions,scrollTop:p,variant:"editor"}),S.jsx("textarea",{ref:g,className:"chat-inline-editor-textarea","aria-label":"Edit message",value:c.text,maxLength:8e3,role:"combobox","aria-autocomplete":"list","aria-expanded":y.open,"aria-controls":y.open?y.pickerId:void 0,"aria-activedescendant":y.open&&y.results.length?`${y.optionIdPrefix}-${y.activeIndex}`:void 0,onChange:A=>y.updateText(A.target.value,A.target.selectionStart),onSelect:A=>y.refresh(A.currentTarget.selectionStart),onScroll:A=>m(A.currentTarget.scrollTop),onKeyDown:A=>{y.keyDown(A)||(A.key==="Escape"?(A.preventDefault(),o==null||o()):A.key==="Enter"&&!A.shiftKey&&!A.nativeEvent.isComposing&&(A.preventDefault(),_()))}}),S.jsx(MC,{open:y.open,query:y.query,results:y.results,activeIndex:y.activeIndex,loading:y.loading,error:y.error,onSelect:y.select,id:y.pickerId,optionIdPrefix:y.optionIdPrefix})]}),!i&&c.paperMentions.length>0&&S.jsx("div",{className:"chat-inline-editor-notice",role:"status",children:"Paper mentions are currently disabled. Remove them before sending."}),r&&S.jsx("div",{className:"chat-inline-editor-notice",children:r}),S.jsxs("div",{className:"chat-inline-editor-actions",children:[S.jsx("button",{type:"button",onClick:o,children:"Cancel"}),S.jsx("button",{type:"button",className:"chat-inline-editor-send",disabled:!w||u,onClick:_,children:"Send"})]})]})})},dne=({id:n,text:e,paperMentions:t=[],paperSelection:s,paperMentionsEnabled:i=!1,editingAllowed:r=!1,editing:o=!1,editNotice:a,onEdit:l,onCancel:c,onResend:h,onResendDraft:u})=>{const[d,p]=ee.useState(!1),m=ee.useRef(null);ee.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current)},[]);const g=async()=>{var v;if((v=navigator.clipboard)!=null&&v.writeText)try{await navigator.clipboard.writeText(e),p(!0),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>p(!1),1500)}catch{}};return o?!i&&t.length===0?S.jsx(Mte,{id:n,text:e,paperSelection:s,editNotice:a,onCancel:c,onResend:h,onResendDraft:u}):S.jsx(Ite,{id:n,text:e,paperMentions:t,paperSelection:s,enabled:i,editNotice:a,onCancel:c,onResend:h,onResendDraft:u}):S.jsx("div",{className:"chat-msg chat-msg-user","data-message-id":n,children:S.jsxs("div",{className:"chat-user-message-wrap",children:[s&&S.jsx(Yy,{selection:s}),S.jsx("div",{className:"chat-bubble",onDoubleClick:Ete,children:S.jsx(Cte,{text:e,mentions:t})}),S.jsxs("div",{className:"chat-user-actions",children:[S.jsx("button",{type:"button",className:"chat-user-action","aria-label":d?"Message copied":"Copy message",title:d?"Copied":"Copy",onClick:()=>void g(),children:d?S.jsx(lL,{"aria-hidden":"true"}):S.jsx(CL,{"aria-hidden":"true"})}),r&&S.jsx("button",{type:"button",className:"chat-user-action","aria-label":"Edit message",title:"Edit",onClick:l,children:S.jsx(LC,{"aria-hidden":"true"})})]})]})})},fne=({msg:n,papers:e,onToggleBlock:t,onRetryCompaction:s,onRetryWithLuna:i,onArchiveOldChats:r,onArchiveOldestChats:o,archivePending:a=null,hfBilling:l=null,openRouterFallbackEnabled:c=!1,feedbackEnabled:h=!1})=>{var L,B,N,H;const[u,d]=ee.useState(null),[p,m]=ee.useState(!1),[g,v]=ee.useState(!1),[y,w]=ee.useState(!1),[_,A]=ee.useState(""),k=ee.useRef(null),$=`chat-feedback-panel-${n.id}`,E=h&&!n.streaming&&!n.error&&!!((L=n.blocks)!=null&&L.some(U=>U.kind==="answer"&&U.text.trim()));ee.useEffect(()=>{var U;y&&((U=k.current)==null||U.focus())},[y]);const I=async(U,j)=>{if(!p){m(!0),v(!1);try{j===void 0?await tA.reportFeedback(n.id,U):await tA.reportFeedback(n.id,U,j),d(U),w(!1),A("")}catch{v(!0)}finally{m(!1)}}};return S.jsx("div",{className:"chat-msg chat-msg-assistant",children:S.jsxs("div",{className:"chat-msg-blocks",children:[(B=n.blocks)==null?void 0:B.map((U,j)=>{var ge;const Y=`${n.id}-${j}`,X="citations"in U&&U.citations!==void 0?U.citations:n.citations??[],Q=Object.fromEntries(X.filter(z=>(z.kind==="catalog_paper"||z.kind==="paper"||!z.kind&&z.route_id)&&z.route_id).map(z=>[z.route_id,z])),se=Object.fromEntries(X.filter(z=>(z.kind==="external_source"||z.kind==="web")&&z.url).map(z=>[z.url,z]));return U.kind==="reasoning"?S.jsx($te,{block:U,papers:e,citations:Q,webCitations:se,onToggle:()=>t(n.id,j)},Y):U.kind==="tool"?S.jsx(Tte,{block:U,papers:e,onToggle:()=>t(n.id,j)},Y):U.kind==="app"?S.jsx(Rte,{block:U},U.instance_id||Y):U.kind==="artifact"?S.jsx(vte,{block:U},U.publication_id||U.version_id||Y):S.jsx(Pte,{block:U,papers:e,citations:Q,webCitations:se,streaming:!!(n.streaming&&j===(((ge=n.blocks)==null?void 0:ge.length)??0)-1)},Y)}),n.streaming&&n.compacting&&S.jsx(OL,{}),!n.compacting&&xte(n)&&S.jsx("div",{className:"chat-waiting",role:"status","aria-live":"polite",children:S.jsx("span",{className:"chat-thinking",children:(((N=n.blocks)==null?void 0:N.length)??0)===0?n.status??"Thinking…":"Thinking…"})}),n.error&&S.jsxs("div",{className:"chat-error",children:[((H=n.blocks)==null?void 0:H.some(U=>U.kind==="answer"&&U.text.trim()))&&S.jsx("strong",{children:"Incomplete—response interrupted. "}),["context_too_large","provider_error","persistence_error"].includes(n.errorCode??"")&&s&&S.jsx("button",{type:"button",onClick:s,children:"Retry"}),S.jsx("span",{children:n.errorCode==="chat_disabled_interrupted"?"Chat was disabled while this response was running. The partial response is saved. Please try again later.":n.errorCode==="chat_session_quota_exceeded"?n.error:`The assistant hit an error: ${n.error}`}),["hf_inference_billing_required","hf_inference_credential_expired"].includes(n.errorCode??"")&&S.jsx("a",{href:"/settings",children:"Re-sign in with Hugging Face"}),n.errorCode==="hf_inference_billing_exhausted"&&S.jsxs(S.Fragment,{children:[i&&S.jsx("button",{type:"button",onClick:i,children:"Retry with GPT-6 Luna"}),(l==null?void 0:l.account_type)==="Free"&&!l.bill_to?S.jsx("a",{href:Ste,target:"_blank",rel:"noreferrer",children:"Upgrade to Hugging Face PRO — $9/month for 20× more included credits"}):S.jsx("a",{href:(l==null?void 0:l.usage_url)??"/settings",target:l?"_blank":void 0,rel:l?"noreferrer":void 0,children:"Review Hugging Face usage and billing"}),S.jsx("a",{href:kte,target:"_blank",rel:"noreferrer",children:"Inference Providers pricing and billing details"})]}),n.errorCode==="openrouter_monthly_budget_exhausted"&&S.jsxs(S.Fragment,{children:[c?S.jsx("span",{children:"This response started on the shared allowance. Your connected OpenRouter key will be used when you explicitly retry."}):S.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own OpenRouter key"}),S.jsx("span",{children:"Or select a Hugging Face-backed model and explicitly retry."})]}),n.errorCode==="openrouter_staging_funding_disabled"&&S.jsx("a",{href:Ate,children:"Continue on paperswithcode.co"}),n.errorCode==="openrouter_unavailable"&&S.jsxs(S.Fragment,{children:[S.jsx("a",{href:"/settings#openrouter-byok",children:"Bring your own key in Settings"}),S.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback",target:"_blank",rel:"noreferrer",children:"File an issue"})]}),n.errorCode==="openrouter_byok_billing_error"&&S.jsx("a",{href:"https://openrouter.ai/settings/credits",target:"_blank",rel:"noreferrer",children:"Review OpenRouter billing"}),["openrouter_byok_credential_invalid","openrouter_byok_rate_limit"].includes(n.errorCode??"")&&S.jsx("a",{href:"/settings#openrouter-byok",children:"Review OpenRouter settings"}),n.errorCode==="chat_session_quota_exceeded"&&(r||o)&&S.jsxs("span",{className:"chat-error-actions",children:[r&&S.jsx("button",{type:"button",disabled:a!==null,onClick:r,children:a==="old"?"Archiving…":"Archive chats older than 30 days"}),o&&S.jsx("button",{type:"button",disabled:a!==null,onClick:o,children:a==="oldest"?"Archiving…":"Archive oldest 50 chats"})]})]}),!n.streaming&&n.finishReason&&!["success","scope_blocked"].includes(n.finishReason)&&S.jsx("div",{className:"chat-finish-note",children:["tool_limit","max_turns"].includes(n.finishReason)?"The assistant stopped at the execution limit.":`The assistant stopped early (${n.finishReason.replace(/_/g," ")}).`}),E&&S.jsxs("div",{className:"chat-feedback","aria-label":"Rate this response",children:[S.jsx("span",{className:"chat-feedback-label",children:u===null?"Was this helpful?":"Thanks for your feedback"}),S.jsx("button",{type:"button",className:`chat-feedback-action${u===!0?" chat-feedback-action-selected":""}`,"aria-label":"Helpful response","aria-pressed":u===!0,disabled:p,onClick:()=>{w(!1),I(!0)},children:S.jsx($L,{"aria-hidden":"true"})}),S.jsx("button",{type:"button",className:`chat-feedback-action${u===!1?" chat-feedback-action-selected":""}`,"aria-label":"Unhelpful response","aria-pressed":u===!1,"aria-expanded":y,"aria-controls":$,disabled:p,onClick:()=>{v(!1),w(!0)},children:S.jsx(ML,{"aria-hidden":"true"})}),g&&S.jsx("span",{className:"chat-feedback-error",role:"status",children:"Couldn’t send feedback."})]}),E&&y&&S.jsxs("div",{className:"chat-feedback-panel",id:$,role:"group","aria-labelledby":`${$}-title`,children:[S.jsx("div",{className:"chat-feedback-panel-title",id:`${$}-title`,children:"Additional feedback"}),S.jsx("label",{className:"chat-feedback-panel-label",htmlFor:`${$}-comment`,children:"Tell us what went wrong (optional)"}),S.jsx("textarea",{ref:k,id:`${$}-comment`,className:"chat-feedback-comment",value:_,maxLength:500,rows:4,disabled:p,onChange:U=>A(U.target.value),onKeyDown:U=>{U.key==="Escape"&&(U.preventDefault(),w(!1))}}),S.jsxs("div",{className:"chat-feedback-panel-actions",children:[S.jsx("button",{type:"button",className:"chat-feedback-skip",disabled:p,onClick:()=>void I(!1),children:"Skip"}),S.jsx("button",{type:"button",className:"chat-feedback-submit",disabled:p,onClick:()=>void I(!1,_.trim()||void 0),children:p?"Submitting…":"Submit"})]})]})]})})},Ote={chat:{breakpoint:760,left:360,right:360},shared:{breakpoint:760,left:360,right:360},reader:{breakpoint:1260,left:840,right:420}};function Ka(n,e,t,s){if(!n)return Math.max(25,Math.min(75,e));const i=Math.max(25,s/n*100),r=Math.min(75,(n-t)/n*100);return Math.max(i,Math.min(r,e))}const pne=({children:n,variant:e})=>{var w;const t=nm(),s=Ote[e],i=ee.useRef(null),r=ee.useRef(null),o=ee.useRef(null),a=ee.useRef(null),[l,c]=ee.useState(0),h=ee.useRef(!1),u=ee.useRef(t.state.panelPercent);ee.useLayoutEffect(()=>{const _=i.current;if(!_)return;const A=()=>c(_.clientWidth||window.innerWidth);if(A(),typeof ResizeObserver>"u")return;const k=new ResizeObserver(A);return k.observe(_),()=>k.disconnect()},[]);const d=t.state.open&&l>=s.breakpoint,p=Ka(l,t.state.panelPercent,s.left,s.right),m=((w=t.state.selected)==null?void 0:w.artifact_kind)==="latex_paper"?"paper":"poster",g=_=>{var k;const A=Ka(l,_,s.left,s.right);u.current=A,r.current&&(r.current.style.width=`${100-A}%`),o.current&&(o.current.style.width=`${A}%`),(k=a.current)==null||k.setAttribute("aria-valuenow",String(Math.round(A)))},v=_=>{var k;const A=(k=i.current)==null?void 0:k.getBoundingClientRect();A!=null&&A.width&&g((A.right-_)/A.width*100)},y=()=>{h.current&&(h.current=!1,t.setPanelPercent(u.current))};return S.jsxs("div",{ref:i,className:`chat-artifact-workspace chat-artifact-workspace-${e}${d?" has-docked-artifact":""}`,"data-artifact-layout":d?"split":t.state.open?"dialog":"closed",children:[S.jsx("div",{ref:r,className:"chat-artifact-workspace-content",style:d?{width:`${100-p}%`}:void 0,children:n}),d&&S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:a,className:"chat-artifact-resize-handle",role:"separator","aria-label":`Resize conversation and ${m} panels`,"aria-orientation":"vertical","aria-valuemin":Math.ceil(Ka(l,0,s.left,s.right)),"aria-valuemax":Math.floor(Ka(l,100,s.left,s.right)),"aria-valuenow":Math.round(p),tabIndex:0,onPointerDown:_=>{h.current=!0,_.currentTarget.setPointerCapture(_.pointerId),v(_.clientX)},onPointerMove:_=>{h.current&&v(_.clientX)},onPointerUp:y,onPointerCancel:y,onLostPointerCapture:y,onDoubleClick:()=>t.setPanelPercent(55),onKeyDown:_=>{(_.key==="ArrowLeft"||_.key==="ArrowRight")&&(_.preventDefault(),t.setPanelPercent(Ka(l,p+(_.key==="ArrowLeft"?2:-2),s.left,s.right))),_.key==="Home"&&t.setPanelPercent(Ka(l,25,s.left,s.right)),_.key==="End"&&t.setPanelPercent(Ka(l,75,s.left,s.right))}}),S.jsx("div",{ref:o,className:"chat-artifact-workspace-pane",style:{width:`${p}%`},children:S.jsx(EC,{})})]}),t.state.open&&!d&&S.jsx(EC,{forceDialog:!0,readerFallback:e==="reader"})]})};export{une as A,Qte as C,WX as P,_X as R,dne as U,pne as a,fne as b,nm as c,ene as d,XL as e,hne as f,N_ as g,vX as u}; +${q||"No compiler diagnostic was available."}`)},hs=q=>{!q||!Be("files")||t.setSourceFile(q)};return S.jsxs("section",{ref:I,className:`chat-artifact-panel${B?" is-dialog":" is-docked"}`,role:B?"dialog":"complementary","aria-modal":B?!0:void 0,"aria-labelledby":"latex-paper-title","data-testid":"latex-paper-panel",children:[S.jsxs("header",{children:[S.jsxs("div",{children:[S.jsx("span",{children:"Private paper"}),S.jsx("h2",{id:"latex-paper-title",children:n.title}),S.jsxs("p",{className:"chat-paper-status",role:"status","aria-live":"polite",children:[j?`Source v${j.version} · ${j.compile_status}`:"Preparing paper source",kt?" · Preview out of date":""]}),S.jsx("p",{className:"chat-paper-privacy-note",children:"This paper is private to this chat. Source, figures, and PDFs are stored privately; AI-authored text needs your review."})]}),S.jsxs("div",{className:"chat-artifact-header-actions",children:[S.jsx("button",{type:"button","aria-expanded":_,"aria-controls":"paper-version-history",onClick:()=>{$(null),A(!_)},children:"Version history"}),S.jsx("button",{type:"button","data-artifact-close":!0,"aria-label":B?"Back to conversation":"Close paper",onClick:_n,children:S.jsx(D_,{})})]})]}),S.jsxs("nav",{"aria-label":"Paper views",role:"tablist",children:[S.jsx("button",{type:"button",id:"paper-preview-tab",role:"tab","aria-selected":t.state.tab==="preview","aria-controls":"paper-preview-panel",tabIndex:t.state.tab==="preview"?0:-1,className:t.state.tab==="preview"?"active":"",onClick:()=>Be("preview"),onKeyDown:it,children:"Preview"}),S.jsx("button",{type:"button",id:"paper-files-tab",role:"tab","aria-selected":t.state.tab==="files","aria-controls":"paper-files-panel",tabIndex:t.state.tab==="files"?0:-1,className:t.state.tab==="files"?"active":"",onClick:()=>Be("files"),onKeyDown:it,children:"Files"})]}),S.jsxs("div",{id:t.state.tab==="preview"?"paper-preview-panel":"paper-files-panel",role:"tabpanel","aria-labelledby":t.state.tab==="preview"?"paper-preview-tab":"paper-files-tab",className:"chat-artifact-panel-body",children:[t.state.tab==="preview"?H.isError?S.jsxs("div",{role:"alert",children:["Could not load paper details. ",S.jsx("button",{type:"button",onClick:()=>void H.refetch(),children:"Retry paper details"})]}):Ee?S.jsx(WX,{url:Ee,downloadUrl:hte(n.artifact_id),paperKey:`${n.artifact_id}:${Y==null?void 0:Y.version_id}`,paperTitle:n.title,paperHref:"/chat",chrome:"canvas"},Y==null?void 0:Y.version_id):j?j.compile_status==="failed"?S.jsx("p",{role:"alert",children:"No compiled preview is available for this failed source version. Review the diagnostics or fix the paper in Files."}):["queued","compiling"].includes(j.compile_status)?S.jsx("p",{role:"status",children:"Preview is compiling. The stored source is available in Files."}):S.jsx("p",{role:"alert",children:"No compiled preview is available for this source version."}):S.jsx("p",{role:"status",children:"Paper source and compiled preview are not available yet."}):S.jsxs("div",{className:"chat-artifact-source-workspace",children:[S.jsxs("nav",{"aria-label":"Paper source files",children:[se.map(q=>S.jsx("button",{type:"button","aria-pressed":Z===q.path,onClick:()=>rt(q.path),children:q.path},q.path)),ae&&S.jsxs("button",{type:"button",className:"latex-file-action","aria-label":"Add TeX file",onClick:Ut,children:[S.jsx(TL,{})," Add file"]}),ae&&S.jsxs("label",{className:"latex-file-action",children:["Upload figure",S.jsx("input",{"aria-label":"Upload figure",type:"file",accept:"image/png,image/jpeg,application/pdf,.png,.jpg,.jpeg,.pdf",disabled:R.isPending,onChange:q=>{var Pe;const pe=(Pe=q.currentTarget.files)==null?void 0:Pe[0];q.currentTarget.value="",pe&&R.mutate(pe)}})]}),ge.map(q=>j&&S.jsx("a",{href:cte(n.artifact_id,j.version_id,q.path),download:!0,children:q.path},q.path))]}),S.jsxs("div",{className:"latex-editor-column",children:[Z&&a[Z]!==void 0?S.jsx(rte,{path:Z,value:a[Z],readOnly:!ae,onChange:q=>l({...a,[Z]:q})}):S.jsx("p",{children:z.isError?"Source could not be loaded.":"Loading source…"}),ae&&Z&&Z!==((cn=Q.data)==null?void 0:cn.root_document)&&S.jsxs("div",{className:"latex-file-buttons",children:[S.jsxs("button",{type:"button",onClick:ln,children:[S.jsx(LC,{})," Rename"]}),S.jsxs("button",{type:"button",onClick:zs,children:[S.jsx(wL,{})," Delete"]})]})]})]}),_&&S.jsxs("section",{id:"paper-version-history",className:"chat-artifact-history","aria-label":"Paper version history",children:[S.jsx("h3",{children:"Version history"}),X.isLoading&&S.jsx("p",{children:"Loading history…"}),X.isError&&S.jsx("p",{role:"alert",children:"Paper history could not be loaded."}),(In=X.data)==null?void 0:In.items.map(q=>{var pe,Pe,Je,Et;return S.jsxs("article",{children:[S.jsxs("strong",{children:["v",q.version," · ",q.compile_status]}),S.jsx("span",{children:dte(q)}),q.created_at&&S.jsx("time",{dateTime:q.created_at,children:q.created_at}),q.parent_version_id&&S.jsxs("span",{children:["Parent ",ne.has(q.parent_version_id)?`v${ne.get(q.parent_version_id)}`:q.parent_version_id]}),(pe=q.provenance)!=null&&pe.changed_files.length?S.jsxs("span",{children:["Changed: ",q.provenance.changed_files.join(", ")]}):null,((Pe=q.provenance)==null?void 0:Pe.restored_from_version_id)&&S.jsxs("span",{children:["Restored from ",q.provenance.restored_from_version_id]}),((Je=q.provenance)==null?void 0:Je.change_summary)&&S.jsx("p",{children:q.provenance.change_summary}),(Et=q.provenance)==null?void 0:Et.reference_changes.map(tr=>S.jsx("p",{children:tr},tr)),S.jsx("a",{href:AC(n.artifact_id,q.version_id),download:!0,children:"Source ZIP"}),(U==null?void 0:U.editing_enabled)&&(j==null?void 0:j.version_id)&&q.version_id!==j.version_id&&S.jsxs("button",{type:"button",disabled:D.isPending||N,onClick:()=>D.mutate(q.version_id),children:["Restore version ",q.version]})]},q.version_id)}),((za=X.data)==null?void 0:za.next_cursor)&&S.jsx("button",{type:"button",onClick:()=>$(X.data.next_cursor??null),children:"Load older versions"})]})]}),S.jsxs("footer",{children:[S.jsxs("div",{className:"chat-artifact-metadata","aria-live":"polite",children:[kt&&S.jsx("strong",{children:"Out of date"}),(Ic=j==null?void 0:j.compile_diagnostics)==null?void 0:Ic.map((q,pe)=>S.jsxs("button",{type:"button",onClick:()=>hs(q.file),className:"latex-compile-diagnostic",children:[q.file?`${q.file}${q.line?`:${q.line}`:""}: `:"",q.message]},`${q.file??"global"}:${q.line??""}:${pe}`)),y&&S.jsx("span",{role:"alert",children:y}),g&&S.jsx("button",{type:"button",onClick:Rn,children:"Discard stale local draft"})]}),S.jsxs("div",{className:"chat-artifact-actions",children:[(j==null?void 0:j.compile_status)==="failed"&&!j.repair_exhausted&&S.jsx("button",{type:"button",onClick:As,children:"Ask AI to fix"}),(j==null?void 0:j.compile_status)==="failed"&&j.repair_exhausted&&S.jsx("span",{role:"status",children:"AI repair attempts exhausted"}),t.state.tab==="files"&&ae&&S.jsxs("button",{type:"button",disabled:!N,onClick:()=>P.mutate(),children:[S.jsx(RL,{}),P.isPending?"Saving…":"Save & Compile"]}),j&&S.jsxs("a",{href:AC(n.artifact_id,j.version_id),download:!0,children:[S.jsx(z_,{})," Source ZIP"]})]})]})]})},pte="https://github.com/Chenruishuo/posterly/tree/b9f42e5578a49a27525a68f85376bb3bb25af86f";function mte(){if(typeof window>"u")return null;const n=window.location.pathname.match(/^\/share\/([^/]+)/u);return n?decodeURIComponent(n[1]):null}function YN(n){if(n.scope==="public"){const s=mte();if(!s||!n.public_capability)return null;const i=`/api/v1/chat/shares/${encodeURIComponent(s)}/artifacts/${encodeURIComponent(n.public_capability)}`;return{preview:on(`${i}/preview`),png:on(`${i}/download/png`),pdf:on(`${i}/download/pdf`),manifest:null,source:null,gate:null,download:null}}if(!n.artifact_id||!n.version_id)return null;const e=`/api/v1/chat/artifacts/${encodeURIComponent(n.artifact_id)}/versions/${encodeURIComponent(n.version_id)}`,t=(s,i)=>on(`${e}/${s}/${i.split("/").map(encodeURIComponent).join("/")}`);return{preview:on(`${e}/preview`),png:t("download","poster.png"),pdf:null,manifest:on(`${e}/manifest`),source:s=>t("source",s),gate:s=>t("source",s),download:s=>t("download",s)}}const JN=n=>({passed:"Passed",warnings:"Passed with warnings",failed:"Draft—checks failed"})[n??"passed"];function gte(){const[n,e]=ee.useState(()=>{var t;return typeof window<"u"&&((t=window.matchMedia)==null?void 0:t.call(window,"(max-width: 760px)").matches)});return ee.useEffect(()=>{var i,r;const t=(i=window.matchMedia)==null?void 0:i.call(window,"(max-width: 760px)");if(!t)return;const s=()=>e(t.matches);return s(),(r=t.addEventListener)==null||r.call(t,"change",s),()=>{var o;return(o=t.removeEventListener)==null?void 0:o.call(t,"change",s)}},[]),n}const yte=({forceDialog:n=!1,readerFallback:e=!1})=>{var k,$,E,I;const t=nm(),s=t.close,{state:i}=t,r=i.selected,o=gte(),a=n||o,l=ee.useRef(null),c=ee.useRef(!1),h=wo({queryKey:["chat-artifact-versions",r==null?void 0:r.artifact_id],queryFn:async()=>{const L=await fetch(on(`/api/v1/chat/artifacts/${encodeURIComponent(r.artifact_id)}`),{credentials:"include",cache:"no-store"});if(!L.ok)throw new Error("Could not load poster versions");return(await L.json()).versions},enabled:i.open&&(r==null?void 0:r.scope)==="owner"&&!!r.artifact_id,staleTime:Number.POSITIVE_INFINITY}),u=(k=h.data)==null?void 0:k.find(L=>L.version_id===i.selectedVersionId),d=r&&u?{...r,version_id:u.version_id,version:u.version,gate_status:u.gate_status,total_bytes:u.total_bytes}:r,p=d?YN(d):null,g=wo({queryKey:["chat-artifact-manifest",d==null?void 0:d.version_id],queryFn:async()=>{const L=await fetch(p.manifest,{credentials:"include",cache:"no-store"});if(!L.ok)throw new Error("Could not load poster details");return L.json()},enabled:i.open&&(d==null?void 0:d.scope)==="owner"&&!!(p!=null&&p.manifest),staleTime:Number.POSITIVE_INFINITY}).data,v=i.sourceFile??(g==null?void 0:g.entrypoint)??null,y=wo({queryKey:["chat-artifact-source",d==null?void 0:d.version_id,v],queryFn:async()=>{const L=await fetch(p.source(v),{credentials:"include",cache:"no-store"});if(!L.ok)throw new Error("Source could not be loaded");return L.text()},enabled:i.open&&i.tab==="source"&&(d==null?void 0:d.scope)==="owner"&&!!(v&&(p!=null&&p.source)),staleTime:Number.POSITIVE_INFINITY});if(ee.useEffect(()=>{var B,N;if(!i.open||!a)return;(N=(B=l.current)==null?void 0:B.querySelector("[data-artifact-close]"))==null||N.focus(),window.history.pushState({...window.history.state,pwcArtifactPanel:!0},""),c.current=!0;const L=()=>{c.current=!1,s()};return window.addEventListener("popstate",L),()=>window.removeEventListener("popstate",L)},[s,a,i.open]),ee.useEffect(()=>{if(!i.open||!a)return;const L=B=>{if(B.key==="Escape"){B.preventDefault(),s(),c.current&&(c.current=!1,window.history.back());return}if(B.key!=="Tab"||!l.current)return;const N=[...l.current.querySelectorAll('button:not([disabled]), a[href], select:not([disabled]), [tabindex]:not([tabindex="-1"])')];if(!N.length)return;const H=N[0],U=N.at(-1);B.shiftKey&&document.activeElement===H?(B.preventDefault(),U.focus()):!B.shiftKey&&document.activeElement===U&&(B.preventDefault(),H.focus())};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[s,a,i.open]),!i.open||!d||!p)return null;const w=()=>{s(),a&&c.current&&(c.current=!1,window.history.back())},_=($=g==null?void 0:g.downloads[0])==null?void 0:$.path,A=d.scope==="public"?p.pdf:_&&p.download?p.download(_):null;return S.jsxs("section",{ref:l,className:`chat-artifact-panel${a?" is-dialog":" is-docked"}${e?" is-reader-fallback":""}`,role:a?"dialog":"complementary","aria-modal":a?!0:void 0,"aria-label":d.title,"data-testid":"artifact-panel",children:[S.jsxs("header",{children:[S.jsxs("div",{children:[S.jsx("span",{children:"Posterly artifact"}),S.jsx("h2",{children:d.title})]}),(((E=h.data)==null?void 0:E.length)??0)>1&&S.jsxs("label",{className:"chat-artifact-version",children:["Version",S.jsx("select",{"aria-label":"Poster version",value:d.version_id,onChange:L=>t.setVersion(L.target.value),children:[...h.data??[]].reverse().map(L=>S.jsxs("option",{value:L.version_id,children:["v",L.version]},L.version_id))})]}),S.jsx("button",{type:"button","data-artifact-close":!0,"aria-label":a?"Back to conversation":"Close poster",onClick:w,children:S.jsx(D_,{})})]}),S.jsxs("nav",{"aria-label":"Poster views",children:[S.jsx("button",{type:"button","aria-pressed":i.tab==="preview",className:i.tab==="preview"?"active":"",onClick:()=>t.setTab("preview"),children:"Preview"}),d.scope==="owner"&&S.jsx("button",{type:"button","aria-pressed":i.tab==="source",className:i.tab==="source"?"active":"",onClick:()=>t.setTab("source"),children:"Source"})]}),S.jsx("div",{className:"chat-artifact-panel-body",children:i.tab==="preview"?S.jsx("img",{src:p.preview,alt:`Full preview of ${d.title}`}):S.jsxs("div",{className:"chat-artifact-source-workspace",children:[(((I=g==null?void 0:g.source_files)==null?void 0:I.length)??0)>1&&S.jsx("nav",{"aria-label":"Poster source files",children:g.source_files.map(L=>S.jsx("button",{type:"button","aria-pressed":v===L,onClick:()=>t.setSourceFile(L),children:L},L))}),S.jsx("pre",{children:S.jsx("code",{children:y.isError?"Source could not be loaded.":y.data??"Loading source…"})})]})}),S.jsxs("footer",{children:[S.jsxs("div",{className:"chat-artifact-metadata",children:[S.jsx("strong",{children:JN(d.gate_status)}),g&&S.jsxs("span",{children:[g.canvas.width," × ",g.canvas.height," ",g.canvas.unit," · ",g.canvas.orientation," · ",g.direction]}),g==null?void 0:g.gate_summary.map(L=>S.jsx("span",{children:L},L))]}),S.jsxs("div",{className:"chat-artifact-actions",children:[S.jsxs("a",{href:p.png,download:!0,children:[S.jsx(nA,{})," PNG"]}),d.gate_status!=="failed"&&A&&S.jsxs("a",{href:A,download:!0,children:[S.jsx(nA,{})," PDF"]}),d.scope==="owner"&&g&&p.source&&S.jsxs("a",{href:p.source(g.entrypoint),download:!0,children:[S.jsx(z_,{})," HTML"]}),d.scope==="owner"&&g&&p.gate&&S.jsx("a",{href:p.gate(g.gate_report),download:!0,children:"Gate report"}),S.jsxs("a",{href:pte,target:"_blank",rel:"noreferrer",children:[S.jsx(NC,{})," Posterly source · AGPL-3.0"]})]})]})]})},EC=n=>{var t;const{state:e}=nm();return((t=e.selected)==null?void 0:t.artifact_kind)==="latex_paper"?S.jsx(fte,{block:e.selected,...n}):S.jsx(yte,{...n})},vte=({block:n})=>{const e=nm(),t=e.register,s=e.unregister,i=N_(n);if(ee.useEffect(()=>{t(n)},[n,t]),ee.useEffect(()=>()=>s(i),[i,s]),n.status==="generating")return S.jsxs("div",{className:"chat-artifact-card chat-artifact-generating",role:"status",children:[S.jsx("span",{className:"chat-artifact-pulse","aria-hidden":"true"}),S.jsxs("span",{children:[S.jsx("strong",{children:n.title}),S.jsx("small",{children:"Publishing Posterly preview…"})]})]});if(n.status==="error")return S.jsxs("div",{className:"chat-artifact-card chat-artifact-error",role:"alert",children:[S.jsx(z_,{"aria-hidden":"true"}),S.jsxs("span",{children:[S.jsx("strong",{children:n.title}),S.jsx("small",{children:n.error_message??"Poster publication failed."})]})]});const r=YN(n);if(!r)return null;const o=e.state.open&&e.state.selectedKey===i;return S.jsxs("button",{type:"button",className:`chat-artifact-card${o?" is-selected":""}`,"aria-pressed":o,onClick:a=>e.open(n,a.currentTarget),children:[S.jsx("img",{src:r.preview,alt:`Preview of ${n.title}`}),S.jsxs("span",{className:"chat-artifact-card-copy",children:[S.jsxs("span",{className:"chat-artifact-kicker",children:[S.jsx(PL,{"aria-hidden":"true"})," Posterly · v",n.version]}),S.jsx("strong",{children:n.title}),S.jsx("small",{className:`chat-artifact-gate chat-artifact-gate-${n.gate_status}`,children:JN(n.gate_status)})]})]})};function bte(n){if(!n.authors.length)return"";const e=n.authors.slice(0,3).map(t=>t.name).join(", ");return n.authors.length>3?`${e}, et al.`:e}function wte(n){var t;if(n.conference)return n.conference;const e=(t=n.published)==null?void 0:t.slice(0,4);if(n.arxiv_id)return e?`arXiv ${e}`:"arXiv";if(n.source_url)try{return new URL(n.source_url).hostname.replace(/^www\./,"")}catch{}return e??"external"}function _te(n,e=240){const t=n.content.trim();return t.length<=e?t:`${t.slice(0,e).trimEnd()}…`}const Ste="https://huggingface.co/pro",kte="https://huggingface.co/docs/inference-providers/pricing",Ate="https://paperswithcode.co/chat",QN=()=>S.jsx("span",{className:"chat-caret"}),xte=n=>{var t;if(!n.streaming)return!1;const e=(t=n.blocks)==null?void 0:t.at(-1);return e?e.kind==="reasoning"?!e.active:e.kind==="tool"?e.status!=="running":!1:!0},Ete=n=>{var p,m;const e=n.currentTarget,t=e.ownerDocument,s=(p=t.caretPositionFromPoint)==null?void 0:p.call(t,n.clientX,n.clientY),i=s?null:(m=t.caretRangeFromPoint)==null?void 0:m.call(t,n.clientX,n.clientY),r=(s==null?void 0:s.offsetNode)??(i==null?void 0:i.startContainer),o=(s==null?void 0:s.offset)??(i==null?void 0:i.startOffset);if(!(r instanceof Text)||o===void 0||!e.contains(r))return;const a=r.data,l=/[\p{L}\p{M}\p{N}_'-]/u;let c=Math.min(o,a.length),h=c;for(;c>0&&l.test(a[c-1]);)c-=1;for(;h{const t=[];let s=0;for(const i of[...e].sort((r,o)=>r.start-o.start)){const r=n.slice(i.start,i.end);i.startn.length||r!==i.title&&r!==`@${i.title}`||(t.push(n.slice(s,i.start)),t.push(S.jsxs("span",{className:"chat-inline-paper-mention",children:[S.jsx(OC,{size:13,"aria-hidden":"true"}),S.jsx(F_,{routeId:i.route_id,className:"chat-inline-paper-link",children:r.startsWith("@")?r.slice(1):r})]},i.key)),s=i.end)}return t.push(n.slice(s)),S.jsx(S.Fragment,{children:t})},$te=({block:n,papers:e,citations:t,webCitations:s,onToggle:i})=>n.active?S.jsxs("div",{className:"chat-reason-live",children:[S.jsxs("div",{className:"chat-reason-live-head",children:[S.jsx(j_,{})," ",S.jsx("span",{children:"Thinking…"})]}),S.jsxs("div",{className:"chat-reason-live-body chat-answer chat-reason-markdown",children:[S.jsx(zv,{text:n.text,streaming:!0,papers:e,citations:t,webCitations:s}),S.jsx(QN,{})]})]}):S.jsxs("div",{className:"chat-reason-done",children:[S.jsxs("button",{type:"button",className:"chat-reason-done-head",onClick:i,"aria-expanded":n.open,children:[S.jsx(gL,{}),S.jsx("span",{children:"Thought for a few seconds"}),S.jsx(IC,{open:n.open})]}),n.open&&S.jsx("div",{className:"chat-reason-done-body chat-answer chat-reason-markdown",children:S.jsx(zv,{text:n.text,papers:e,citations:t,webCitations:s})})]}),Tte=({block:n,papers:e,onToggle:t})=>{var d,p,m,g;const s=n.status==="running",i=s&&n.argumentState==="streaming",r=n.schema_version===2||!!n.content,o=n.status==="error"||n.status==="denied",a=typeof n.args.query=="string"?n.args.query:"",l=typeof n.args.command=="string"?n.args.command:typeof n.args.file_path=="string"?n.args.file_path:a,c=n.name.startsWith("pwc_")?Object.entries(n.args).filter(([,v])=>v!=null&&v!=="").map(([v,y])=>`${v}=${typeof y=="string"?y:JSON.stringify(y)}`).join(" · "):r?l:`("${a}")`,h=((d=n.content)==null?void 0:d.map(v=>v.text).join(""))??"",u=i?"streaming arguments…":s?"running…":r?`${n.status} · ${n.took_ms??0} ms`:`${n.hits} results · ${n.took_ms} ms`;return S.jsxs("div",{className:`chat-tool${s?" chat-tool-running":""}${o?" chat-tool-failed":""}`,children:[S.jsxs("button",{type:"button",className:"chat-tool-head",onClick:t,"aria-expanded":n.open,children:[S.jsxs("span",{className:"chat-tool-head-left",children:[s?S.jsx(j_,{}):S.jsx(yL,{}),S.jsx("code",{className:"chat-tool-name",children:n.name}),S.jsx("span",{className:"chat-tool-query",title:c,children:c})]}),S.jsxs("span",{className:"chat-tool-head-right",children:[S.jsx("span",{className:"chat-tool-status",children:u}),S.jsx(IC,{open:n.open})]})]}),n.open&&S.jsxs("div",{className:"chat-tool-body",children:[S.jsxs("div",{className:"chat-tool-args",children:[S.jsxs("span",{className:"chat-tool-label",children:["arguments",n.arguments_redacted?" · redacted":""]}),S.jsx("pre",{children:n.argumentState==="streaming"&&!n.arguments_redacted&&n.argumentText||JSON.stringify(n.args,null,2)})]}),!s&&r?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"chat-tool-output-head",children:[S.jsx("span",{className:"chat-tool-label",children:"result"}),S.jsx("button",{type:"button",className:"chat-tool-copy",onClick:()=>void navigator.clipboard.writeText(h),children:"Copy"})]}),S.jsx("pre",{className:"chat-tool-output",children:S.jsx("code",{children:h})}),((p=n.metadata)==null?void 0:p.output_truncated)&&S.jsx("div",{className:"chat-tool-truncated",children:"Output was truncated."})]}):s?null:S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"chat-tool-label chat-tool-results-label",children:["returned ",((m=n.results)==null?void 0:m.length)??0," papers"]}),S.jsx("ol",{className:"chat-tool-results",children:(g=n.results)==null?void 0:g.map(v=>S.jsxs("li",{className:"chat-hit",children:[S.jsx("div",{className:"chat-hit-top",children:S.jsx(HC,{routeId:v.route_id,paper:e[v.route_id],className:"chat-hit-title",children:v.title})}),S.jsx("div",{className:"chat-hit-meta",children:[bte(v.metadata),wte(v.metadata)].filter(Boolean).join(" · ")}),S.jsxs("div",{className:"chat-hit-snippet",children:[_te(v),v.content_truncated&&S.jsx("span",{className:"chat-hit-truncated",children:" (truncated)"})]})]},v.route_id))})]})]})]})},Pte=({block:n,papers:e,citations:t,webCitations:s,streaming:i})=>S.jsxs("div",{className:"chat-answer",children:[S.jsx(zv,{text:n.text,streaming:i,papers:e,citations:t,webCitations:s}),i&&!!n.text.trim()&&S.jsx(QN,{})]}),Rte=({block:n})=>S.jsx(y6,{block:n}),eL=n=>{const e=ee.useRef(null),t=ee.useCallback(()=>{const s=e.current;if(!s)return;s.style.height="auto";const i=Math.max(120,window.innerHeight*.4);s.style.height=`${Math.min(s.scrollHeight,i)}px`,s.style.overflowY=s.scrollHeight>i?"auto":"hidden"},[]);return ee.useLayoutEffect(()=>{var s,i;(s=e.current)==null||s.focus(),(i=e.current)==null||i.setSelectionRange(n.length,n.length),t()},[t,n.length]),{textareaRef:e,resize:t}},Mte=({id:n,text:e,paperSelection:t,editNotice:s,onCancel:i,onResend:r,onResendDraft:o})=>{const[a,l]=ee.useState(e),[c,h]=ee.useState(t),[u,d]=ee.useState(!1),{textareaRef:p,resize:m}=eL(e);ee.useLayoutEffect(m,[m,a]);const g=!!a.trim()&&a.length<=8e3,v=()=>{if(!g||u)return;d(!0),((o==null?void 0:o({text:a,paperMentions:[],...c?{paperSelection:c}:{}}))??(r==null?void 0:r(a))??!1)||d(!1)};return S.jsx("div",{className:"chat-msg chat-msg-user chat-msg-user-editing","data-message-id":n,children:S.jsxs("div",{className:"chat-inline-editor",children:[c&&S.jsx(Yy,{selection:c,editable:!0,onRemove:()=>h(void 0)}),S.jsx("textarea",{ref:p,className:"chat-inline-editor-textarea","aria-label":"Edit message",value:a,maxLength:8e3,onChange:y=>l(y.target.value),onKeyDown:y=>{y.key==="Escape"?(y.preventDefault(),i==null||i()):y.key==="Enter"&&!y.shiftKey&&!y.nativeEvent.isComposing&&(y.preventDefault(),v())}}),s&&S.jsx("div",{className:"chat-inline-editor-notice",children:s}),S.jsxs("div",{className:"chat-inline-editor-actions",children:[S.jsx("button",{type:"button",onClick:i,children:"Cancel"}),S.jsx("button",{type:"button",className:"chat-inline-editor-send",disabled:!g||u,onClick:v,children:"Send"})]})]})})},Ite=({id:n,text:e,paperMentions:t,paperSelection:s,enabled:i,editNotice:r,onCancel:o,onResend:a,onResendDraft:l})=>{const[c,h]=ee.useState({text:e,paperMentions:t,...s?{paperSelection:s}:{}}),[u,d]=ee.useState(!1),[p,m]=ee.useState(0),{textareaRef:g,resize:v}=eL(e),y=PC({draft:c,onChange:h,enabled:i,textareaRef:g});ee.useLayoutEffect(v,[v,c.text]);const w=!!c.text.trim()&&c.text.length<=8e3&&(i||c.paperMentions.length===0),_=()=>{if(!w||u)return;d(!0),((l==null?void 0:l(c))??(a==null?void 0:a(c.text))??!1)||d(!1)};return S.jsx("div",{className:"chat-msg chat-msg-user chat-msg-user-editing","data-message-id":n,children:S.jsxs("div",{className:"chat-inline-editor",children:[c.paperSelection&&S.jsx(Yy,{selection:c.paperSelection,editable:!0,onRemove:()=>h({text:c.text,paperMentions:c.paperMentions})}),S.jsxs("div",{className:"chat-inline-editor-textarea-wrap",children:[S.jsx(RC,{text:c.text,mentions:c.paperMentions,scrollTop:p,variant:"editor"}),S.jsx("textarea",{ref:g,className:"chat-inline-editor-textarea","aria-label":"Edit message",value:c.text,maxLength:8e3,role:"combobox","aria-autocomplete":"list","aria-expanded":y.open,"aria-controls":y.open?y.pickerId:void 0,"aria-activedescendant":y.open&&y.results.length?`${y.optionIdPrefix}-${y.activeIndex}`:void 0,onChange:A=>y.updateText(A.target.value,A.target.selectionStart),onSelect:A=>y.refresh(A.currentTarget.selectionStart),onScroll:A=>m(A.currentTarget.scrollTop),onKeyDown:A=>{y.keyDown(A)||(A.key==="Escape"?(A.preventDefault(),o==null||o()):A.key==="Enter"&&!A.shiftKey&&!A.nativeEvent.isComposing&&(A.preventDefault(),_()))}}),S.jsx(MC,{open:y.open,query:y.query,results:y.results,activeIndex:y.activeIndex,loading:y.loading,error:y.error,onSelect:y.select,id:y.pickerId,optionIdPrefix:y.optionIdPrefix})]}),!i&&c.paperMentions.length>0&&S.jsx("div",{className:"chat-inline-editor-notice",role:"status",children:"Paper mentions are currently disabled. Remove them before sending."}),r&&S.jsx("div",{className:"chat-inline-editor-notice",children:r}),S.jsxs("div",{className:"chat-inline-editor-actions",children:[S.jsx("button",{type:"button",onClick:o,children:"Cancel"}),S.jsx("button",{type:"button",className:"chat-inline-editor-send",disabled:!w||u,onClick:_,children:"Send"})]})]})})},dne=({id:n,text:e,paperMentions:t=[],paperSelection:s,paperMentionsEnabled:i=!1,editingAllowed:r=!1,editing:o=!1,editNotice:a,onEdit:l,onCancel:c,onResend:h,onResendDraft:u})=>{const[d,p]=ee.useState(!1),m=ee.useRef(null);ee.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current)},[]);const g=async()=>{var v;if((v=navigator.clipboard)!=null&&v.writeText)try{await navigator.clipboard.writeText(e),p(!0),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>p(!1),1500)}catch{}};return o?!i&&t.length===0?S.jsx(Mte,{id:n,text:e,paperSelection:s,editNotice:a,onCancel:c,onResend:h,onResendDraft:u}):S.jsx(Ite,{id:n,text:e,paperMentions:t,paperSelection:s,enabled:i,editNotice:a,onCancel:c,onResend:h,onResendDraft:u}):S.jsx("div",{className:"chat-msg chat-msg-user","data-message-id":n,children:S.jsxs("div",{className:"chat-user-message-wrap",children:[s&&S.jsx(Yy,{selection:s}),S.jsx("div",{className:"chat-bubble",onDoubleClick:Ete,children:S.jsx(Cte,{text:e,mentions:t})}),S.jsxs("div",{className:"chat-user-actions",children:[S.jsx("button",{type:"button",className:"chat-user-action","aria-label":d?"Message copied":"Copy message",title:d?"Copied":"Copy",onClick:()=>void g(),children:d?S.jsx(lL,{"aria-hidden":"true"}):S.jsx(CL,{"aria-hidden":"true"})}),r&&S.jsx("button",{type:"button",className:"chat-user-action","aria-label":"Edit message",title:"Edit",onClick:l,children:S.jsx(LC,{"aria-hidden":"true"})})]})]})})},fne=({msg:n,papers:e,onToggleBlock:t,onRetryCompaction:s,onRetryWithLuna:i,onArchiveOldChats:r,onArchiveOldestChats:o,archivePending:a=null,hfBilling:l=null,openRouterFallbackEnabled:c=!1,feedbackEnabled:h=!1})=>{var L,B,N,H;const[u,d]=ee.useState(null),[p,m]=ee.useState(!1),[g,v]=ee.useState(!1),[y,w]=ee.useState(!1),[_,A]=ee.useState(""),k=ee.useRef(null),$=`chat-feedback-panel-${n.id}`,E=h&&!n.streaming&&!n.error&&!!((L=n.blocks)!=null&&L.some(U=>U.kind==="answer"&&U.text.trim()));ee.useEffect(()=>{var U;y&&((U=k.current)==null||U.focus())},[y]);const I=async(U,j)=>{if(!p){m(!0),v(!1);try{j===void 0?await tA.reportFeedback(n.id,U):await tA.reportFeedback(n.id,U,j),d(U),w(!1),A("")}catch{v(!0)}finally{m(!1)}}};return S.jsx("div",{className:"chat-msg chat-msg-assistant",children:S.jsxs("div",{className:"chat-msg-blocks",children:[(B=n.blocks)==null?void 0:B.map((U,j)=>{var ge;const Y=`${n.id}-${j}`,X="citations"in U&&U.citations!==void 0?U.citations:n.citations??[],Q=Object.fromEntries(X.filter(z=>(z.kind==="catalog_paper"||z.kind==="paper"||!z.kind&&z.route_id)&&z.route_id).map(z=>[z.route_id,z])),se=Object.fromEntries(X.filter(z=>(z.kind==="external_source"||z.kind==="web")&&z.url).map(z=>[z.url,z]));return U.kind==="reasoning"?S.jsx($te,{block:U,papers:e,citations:Q,webCitations:se,onToggle:()=>t(n.id,j)},Y):U.kind==="tool"?S.jsx(Tte,{block:U,papers:e,onToggle:()=>t(n.id,j)},Y):U.kind==="app"?S.jsx(Rte,{block:U},U.instance_id||Y):U.kind==="artifact"?S.jsx(vte,{block:U},U.publication_id||U.version_id||Y):S.jsx(Pte,{block:U,papers:e,citations:Q,webCitations:se,streaming:!!(n.streaming&&j===(((ge=n.blocks)==null?void 0:ge.length)??0)-1)},Y)}),n.streaming&&n.compacting&&S.jsx(OL,{}),!n.compacting&&xte(n)&&S.jsx("div",{className:"chat-waiting",role:"status","aria-live":"polite",children:S.jsx("span",{className:"chat-thinking",children:(((N=n.blocks)==null?void 0:N.length)??0)===0?n.status??"Thinking…":"Thinking…"})}),n.error&&S.jsxs("div",{className:"chat-error",children:[((H=n.blocks)==null?void 0:H.some(U=>U.kind==="answer"&&U.text.trim()))&&S.jsx("strong",{children:"Incomplete—response interrupted. "}),["context_too_large","provider_error","persistence_error"].includes(n.errorCode??"")&&s&&S.jsx("button",{type:"button",onClick:s,children:"Retry"}),S.jsx("span",{children:n.errorCode==="chat_disabled_interrupted"?"Chat was disabled while this response was running. The partial response is saved. Please try again later.":n.errorCode==="chat_session_quota_exceeded"?n.error:`The assistant hit an error: ${n.error}`}),["hf_inference_billing_required","hf_inference_credential_expired"].includes(n.errorCode??"")&&S.jsx("a",{href:"/settings",children:"Re-sign in with Hugging Face"}),n.errorCode==="hf_inference_billing_exhausted"&&S.jsxs(S.Fragment,{children:[i&&S.jsx("button",{type:"button",onClick:i,children:"Retry with GPT-6 Luna"}),(l==null?void 0:l.account_type)==="Free"&&!l.bill_to?S.jsx("a",{href:Ste,target:"_blank",rel:"noreferrer",children:"Upgrade to Hugging Face PRO — $9/month for 20× more included credits"}):S.jsx("a",{href:(l==null?void 0:l.usage_url)??"/settings",target:l?"_blank":void 0,rel:l?"noreferrer":void 0,children:"Review Hugging Face usage and billing"}),S.jsx("a",{href:kte,target:"_blank",rel:"noreferrer",children:"Inference Providers pricing and billing details"})]}),n.errorCode==="hf_sponsored_unavailable"&&i&&S.jsx("button",{type:"button",onClick:i,children:"Retry with GPT-6 Luna"}),n.errorCode==="openrouter_monthly_budget_exhausted"&&S.jsxs(S.Fragment,{children:[c?S.jsx("span",{children:"This response started on the shared allowance. Your connected OpenRouter key will be used when you explicitly retry."}):S.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own OpenRouter key"}),S.jsx("span",{children:"Or select a Hugging Face-backed model and explicitly retry."})]}),n.errorCode==="openrouter_staging_funding_disabled"&&S.jsx("a",{href:Ate,children:"Continue on paperswithcode.co"}),n.errorCode==="openrouter_unavailable"&&S.jsxs(S.Fragment,{children:[S.jsx("a",{href:"/settings#openrouter-byok",children:"Bring your own key in Settings"}),S.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback",target:"_blank",rel:"noreferrer",children:"File an issue"})]}),n.errorCode==="openrouter_byok_billing_error"&&S.jsx("a",{href:"https://openrouter.ai/settings/credits",target:"_blank",rel:"noreferrer",children:"Review OpenRouter billing"}),["openrouter_byok_credential_invalid","openrouter_byok_rate_limit"].includes(n.errorCode??"")&&S.jsx("a",{href:"/settings#openrouter-byok",children:"Review OpenRouter settings"}),n.errorCode==="chat_session_quota_exceeded"&&(r||o)&&S.jsxs("span",{className:"chat-error-actions",children:[r&&S.jsx("button",{type:"button",disabled:a!==null,onClick:r,children:a==="old"?"Archiving…":"Archive chats older than 30 days"}),o&&S.jsx("button",{type:"button",disabled:a!==null,onClick:o,children:a==="oldest"?"Archiving…":"Archive oldest 50 chats"})]})]}),!n.streaming&&n.finishReason&&!["success","scope_blocked"].includes(n.finishReason)&&S.jsx("div",{className:"chat-finish-note",children:["tool_limit","max_turns"].includes(n.finishReason)?"The assistant stopped at the execution limit.":`The assistant stopped early (${n.finishReason.replace(/_/g," ")}).`}),E&&S.jsxs("div",{className:"chat-feedback","aria-label":"Rate this response",children:[S.jsx("span",{className:"chat-feedback-label",children:u===null?"Was this helpful?":"Thanks for your feedback"}),S.jsx("button",{type:"button",className:`chat-feedback-action${u===!0?" chat-feedback-action-selected":""}`,"aria-label":"Helpful response","aria-pressed":u===!0,disabled:p,onClick:()=>{w(!1),I(!0)},children:S.jsx($L,{"aria-hidden":"true"})}),S.jsx("button",{type:"button",className:`chat-feedback-action${u===!1?" chat-feedback-action-selected":""}`,"aria-label":"Unhelpful response","aria-pressed":u===!1,"aria-expanded":y,"aria-controls":$,disabled:p,onClick:()=>{v(!1),w(!0)},children:S.jsx(ML,{"aria-hidden":"true"})}),g&&S.jsx("span",{className:"chat-feedback-error",role:"status",children:"Couldn’t send feedback."})]}),E&&y&&S.jsxs("div",{className:"chat-feedback-panel",id:$,role:"group","aria-labelledby":`${$}-title`,children:[S.jsx("div",{className:"chat-feedback-panel-title",id:`${$}-title`,children:"Additional feedback"}),S.jsx("label",{className:"chat-feedback-panel-label",htmlFor:`${$}-comment`,children:"Tell us what went wrong (optional)"}),S.jsx("textarea",{ref:k,id:`${$}-comment`,className:"chat-feedback-comment",value:_,maxLength:500,rows:4,disabled:p,onChange:U=>A(U.target.value),onKeyDown:U=>{U.key==="Escape"&&(U.preventDefault(),w(!1))}}),S.jsxs("div",{className:"chat-feedback-panel-actions",children:[S.jsx("button",{type:"button",className:"chat-feedback-skip",disabled:p,onClick:()=>void I(!1),children:"Skip"}),S.jsx("button",{type:"button",className:"chat-feedback-submit",disabled:p,onClick:()=>void I(!1,_.trim()||void 0),children:p?"Submitting…":"Submit"})]})]})]})})},Ote={chat:{breakpoint:760,left:360,right:360},shared:{breakpoint:760,left:360,right:360},reader:{breakpoint:1260,left:840,right:420}};function Ka(n,e,t,s){if(!n)return Math.max(25,Math.min(75,e));const i=Math.max(25,s/n*100),r=Math.min(75,(n-t)/n*100);return Math.max(i,Math.min(r,e))}const pne=({children:n,variant:e})=>{var w;const t=nm(),s=Ote[e],i=ee.useRef(null),r=ee.useRef(null),o=ee.useRef(null),a=ee.useRef(null),[l,c]=ee.useState(0),h=ee.useRef(!1),u=ee.useRef(t.state.panelPercent);ee.useLayoutEffect(()=>{const _=i.current;if(!_)return;const A=()=>c(_.clientWidth||window.innerWidth);if(A(),typeof ResizeObserver>"u")return;const k=new ResizeObserver(A);return k.observe(_),()=>k.disconnect()},[]);const d=t.state.open&&l>=s.breakpoint,p=Ka(l,t.state.panelPercent,s.left,s.right),m=((w=t.state.selected)==null?void 0:w.artifact_kind)==="latex_paper"?"paper":"poster",g=_=>{var k;const A=Ka(l,_,s.left,s.right);u.current=A,r.current&&(r.current.style.width=`${100-A}%`),o.current&&(o.current.style.width=`${A}%`),(k=a.current)==null||k.setAttribute("aria-valuenow",String(Math.round(A)))},v=_=>{var k;const A=(k=i.current)==null?void 0:k.getBoundingClientRect();A!=null&&A.width&&g((A.right-_)/A.width*100)},y=()=>{h.current&&(h.current=!1,t.setPanelPercent(u.current))};return S.jsxs("div",{ref:i,className:`chat-artifact-workspace chat-artifact-workspace-${e}${d?" has-docked-artifact":""}`,"data-artifact-layout":d?"split":t.state.open?"dialog":"closed",children:[S.jsx("div",{ref:r,className:"chat-artifact-workspace-content",style:d?{width:`${100-p}%`}:void 0,children:n}),d&&S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:a,className:"chat-artifact-resize-handle",role:"separator","aria-label":`Resize conversation and ${m} panels`,"aria-orientation":"vertical","aria-valuemin":Math.ceil(Ka(l,0,s.left,s.right)),"aria-valuemax":Math.floor(Ka(l,100,s.left,s.right)),"aria-valuenow":Math.round(p),tabIndex:0,onPointerDown:_=>{h.current=!0,_.currentTarget.setPointerCapture(_.pointerId),v(_.clientX)},onPointerMove:_=>{h.current&&v(_.clientX)},onPointerUp:y,onPointerCancel:y,onLostPointerCapture:y,onDoubleClick:()=>t.setPanelPercent(55),onKeyDown:_=>{(_.key==="ArrowLeft"||_.key==="ArrowRight")&&(_.preventDefault(),t.setPanelPercent(Ka(l,p+(_.key==="ArrowLeft"?2:-2),s.left,s.right))),_.key==="Home"&&t.setPanelPercent(Ka(l,25,s.left,s.right)),_.key==="End"&&t.setPanelPercent(Ka(l,75,s.left,s.right))}}),S.jsx("div",{ref:o,className:"chat-artifact-workspace-pane",style:{width:`${p}%`},children:S.jsx(EC,{})})]}),t.state.open&&!d&&S.jsx(EC,{forceDialog:!0,readerFallback:e==="reader"})]})};export{une as A,Qte as C,WX as P,_X as R,dne as U,pne as a,fne as b,nm as c,ene as d,XL as e,hne as f,N_ as g,vX as u}; diff --git a/assets/AstraForRoboticsView-CMNvenQE.js b/assets/AstraForRoboticsView-CJuXw7rp.js similarity index 92% rename from assets/AstraForRoboticsView-CMNvenQE.js rename to assets/AstraForRoboticsView-CJuXw7rp.js index adaa7721dfc68136db7f908ac4bc8bc3d422eb47..0795e8fa0fa59a63051db1b6ad94f1f9abf04912 100644 --- a/assets/AstraForRoboticsView-CMNvenQE.js +++ b/assets/AstraForRoboticsView-CJuXw7rp.js @@ -1 +1 @@ -import{d as v,r as h,j as a,L as n}from"./index-CA09r0fx.js";import{P as N}from"./components-CHZvyPkS.js";import{P}from"./PaperFeedFilters-Ci7HUJiL.js";import{A as k,a as A}from"./alert-DRS5VQLi.js";import{S as w}from"./skeleton-CiNN3v7Q.js";import{u as S}from"./useIntersectionObserver-jfqowp0n.js";import{u as R}from"./usePapers-Bb48_cnL.js";import{f as L,D as T}from"./latexPlainText-DI8YEXVe.js";import{t as F}from"./colors-C6t5MKud.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-U9FJMhfb.js";import"./papers-2SfezChA.js";import"./safeExternalHref-CkBrsh84.js";import"./useQuery-GCOPnmOE.js";import"./useInfiniteQuery-TrlVUjws.js";const f="robotics",b="gpt-6-astra",I="https://x.com/YuXiang_IRVL/status/2100395131924840570",C=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],O=[{handle:"Frame_Robotics",author:"Frame Robotics",summary:"Real-arm control that fixes grip angle and carry height on the next try after a miss.",url:"https://x.com/Frame_Robotics/status/2099900836273090614"},{handle:"qineng_wang",author:"Qineng Wang",summary:"Dual-ALOHA spatial-constraint puzzles: unlocking interlocked parts and threading a rope through three rings.",url:"https://x.com/qineng_wang/status/2099893504658866561"},{handle:"__Rhodium__",author:"Lucas",summary:"In-context learning of the controls and the workspace, reaching the task goal in three tries.",url:"https://x.com/__Rhodium__/status/2099521054678925534"},{handle:"SuveenE",author:"Suveen Ellawela",summary:"Picking up a pipette and fitting a 5 mm tip on a MolmoAct2 real-world eval, using the free hand for a better view.",url:"https://x.com/SuveenE/status/2099448450341605672"},{handle:"cdngdev",author:"thijs",summary:"A robot arm with a paintbrush painting the Golden Gate Bridge, improving across attempts from camera feedback.",url:"https://x.com/cdngdev/status/2097339677128982873"},{handle:"IsaacSin12",author:"Isaac Sin",summary:"Zero-shot sorting of irregularly shaped blocks into cups by color.",url:"https://x.com/IsaacSin12/status/2096715382166098302"},{handle:"chooi_jeq",author:"Jay Chooi",summary:"Robocurve's robot-control comparison: 95% task completion versus 40% for Fable 5.1 at lower cost.",url:"https://x.com/chooi_jeq/status/2096064315115839904"}],G=[{handle:"Lingjun_Mao",author:"Lingjun Mao",summary:"Adapting to a new embodiment to put a cake into an air fryer through CuRobo motion-planning tool APIs.",url:"https://x.com/Lingjun_Mao/status/2100294902672462176"},{handle:"walterzhu8",author:"Wentao Zhu",summary:"A day-and-a-half autonomous run that builds and trains pen spinning on a Sharpa hand in Isaac Lab.",url:"https://x.com/walterzhu8/status/2100212420840989112"},{handle:"mishig25",author:"Mishig",summary:"Painting the Eiffel Tower in MuJoCo with an SO-101 and a brush, with the full experiment shared on Hugging Face.",url:"https://x.com/mishig25/status/2099611674793668676"},{handle:"RunpeiDong",author:"Runpei Dong",summary:"Getting a humanoid into a Tesla in MuJoCo: learning from feedback, then reusing that experience with egocentric perception.",url:"https://x.com/RunpeiDong/status/2099604536327614717"},{handle:"frankzydou",author:"Zhiyang (Frank) Dou",summary:"A LeRobot SO-101 real-world pickup from a third-person RGB camera, where the arm has to bend back to reach the pen.",url:"https://x.com/frankzydou/status/2099338127915512297"},{handle:"Parvkpr",author:"Parv Kapoor",summary:"Real-to-sim: building an interactive simulation environment from a single image or video.",url:"https://x.com/Parvkpr/status/2098847963867238597"},{handle:"z_code68632",author:"code_z",summary:"One demo per task: unscrewing a bottle cap, inserting a plug, clearing obstacles, and imitating a dance on a real robot.",url:"https://x.com/z_code68632/status/2098397364725895387"}],j=({posts:s,label:i})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:i}),a.jsx("ul",{children:s.map(o=>a.jsxs("li",{children:[a.jsxs("a",{href:o.url,target:"_blank",rel:"noreferrer",children:["@",o.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",o.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",o.summary]})]},o.url))})]}),E=s=>s==="date_published"||s==="citation_count"?s:"trending",W=()=>{var g,x;const[s,i]=v(),o=E(s.get("order_by")),d=s.get("has_code")==="true",m=s.get("has_hf_artifacts")==="true",t=R({task:f,method:b,page_size:12,order_by:o,order_dir:"desc",include_resources:!0,has_code:d,has_hf_artifacts:m}),{targetRef:_,isIntersecting:u}=S({rootMargin:"200px"});h.useEffect(()=>(document.title=L("GPT-6 Astra for Robotics"),()=>{document.title=T}),[]),h.useEffect(()=>{u&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[u,t.hasNextPage,t.isFetchingNextPage]);const p=h.useMemo(()=>{var e;return(((e=t.data)==null?void 0:e.pages)??[]).flatMap(r=>r.results.map(F))},[t.data]),y=((x=(g=t.data)==null?void 0:g.pages[0])==null?void 0:x.count)??0,c=(e,r)=>{const l=new URLSearchParams(s);r===null?l.delete(e):l.set(e,r),i(l)};return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(n,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"GPT-6 Astra for Robotics"})]}),a.jsx("header",{className:"feed-header",children:a.jsxs("div",{children:[a.jsx("div",{className:"astra-eyebrow",children:"Collection"}),a.jsxs("h1",{className:"feed-title",children:["GPT-6 Astra ",a.jsx("em",{children:"for Robotics"})]}),a.jsx("div",{className:"feed-subtitle",children:"Papers, technical reports, and evaluations that put OpenAI’s frontier model in control of real and simulated robots."}),a.jsxs("p",{className:"astra-lede",children:["The GPT-6 Astra launch never mentioned robots, yet within days the model was driving arms, hands, and humanoids. As"," ",a.jsx("a",{href:I,target:"_blank",rel:"noreferrer",children:"Yu Xiang"})," ","framed it, the work splits into two families: Astra acting as the robot policy itself, and Astra acting as an agent that orchestrates everything else."]})]})}),a.jsxs("section",{className:"astra-approaches","aria-label":"How GPT-6 Astra is used for robots",children:[a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"01 / Robot policy"}),a.jsx("h2",{children:"Astra as the policy, like a VLA"}),a.jsx("p",{children:"The model looks at camera frames and robot state and directly emits actions: end-effector poses, joint targets, or gripper commands, closing the control loop step by step with no task-specific training."}),a.jsx(j,{posts:O,label:"Seen on X"})]}),a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"02 / Agent"}),a.jsx("h2",{children:"Astra as the agent"}),a.jsx("p",{children:"The model reasons about the scene, writes and runs code, calls planners and tools, or delegates low-level motion to pretrained policies such as VLAs, and keeps the robot on task over long horizons."}),a.jsx(j,{posts:G,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(n,{to:`/tasks/${f}`,children:"Robotics"})," task and the"," ",a.jsx(n,{to:`/methods/${b}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(n,{to:"/submit",children:"Submit it"}),"."]}),a.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[a.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),a.jsxs("div",{className:"task-section-title",children:["Papers ",a.jsxs("span",{className:"meta",children:["[",y.toLocaleString(),"]"]})]})]}),a.jsx("div",{className:"sort-bar",children:a.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a.jsx("div",{className:"sort-options",children:C.map(([e,r])=>a.jsx("button",{type:"button",className:`sort-btn ${o===e?"active":""}`,onClick:()=>c("order_by",e==="trending"?null:e),children:r},e))}),a.jsx(P,{hasCode:d,hasHfArtifacts:m,onHasCodeChange:e=>c("has_code",e?"true":null),onHasHfArtifactsChange:e=>c("has_hf_artifacts",e?"true":null)})]})}),t.error?a.jsx(k,{variant:"destructive",children:a.jsx(A,{children:"Failed to load the collection. Please try again."})}):t.isLoading?a.jsx("div",{className:"paper-list",children:Array.from({length:3}).map((e,r)=>a.jsx(w,{className:"h-40 w-full"},r))}):p.length===0?a.jsx("div",{className:"no-results",children:"No papers match this selection yet."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"paper-list",children:p.map((e,r)=>a.jsx(N,{paper:e,rank:r+1},e.id))}),a.jsx("div",{ref:_,style:{height:1}}),t.isFetchingNextPage&&a.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{W as default}; +import{d as v,r as h,j as a,L as n}from"./index-DGz7IJy3.js";import{P as N}from"./components-C75Gxt6c.js";import{P}from"./PaperFeedFilters-BIXkRwGe.js";import{A as k,a as A}from"./alert-CfvggGdB.js";import{S as w}from"./skeleton-Qth9DQSW.js";import{u as S}from"./useIntersectionObserver-B7kBuOiP.js";import{u as R}from"./usePapers-knk68Pd9.js";import{f as L,D as T}from"./latexPlainText-DI8YEXVe.js";import{t as F}from"./colors-YtiKVy3X.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DtD88QQA.js";import"./papers-CgK5TA59.js";import"./safeExternalHref-CkBrsh84.js";import"./useQuery-SnJNmisF.js";import"./useInfiniteQuery-Bix5WR2s.js";const f="robotics",b="gpt-6-astra",I="https://x.com/YuXiang_IRVL/status/2100395131924840570",C=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],O=[{handle:"Frame_Robotics",author:"Frame Robotics",summary:"Real-arm control that fixes grip angle and carry height on the next try after a miss.",url:"https://x.com/Frame_Robotics/status/2099900836273090614"},{handle:"qineng_wang",author:"Qineng Wang",summary:"Dual-ALOHA spatial-constraint puzzles: unlocking interlocked parts and threading a rope through three rings.",url:"https://x.com/qineng_wang/status/2099893504658866561"},{handle:"__Rhodium__",author:"Lucas",summary:"In-context learning of the controls and the workspace, reaching the task goal in three tries.",url:"https://x.com/__Rhodium__/status/2099521054678925534"},{handle:"SuveenE",author:"Suveen Ellawela",summary:"Picking up a pipette and fitting a 5 mm tip on a MolmoAct2 real-world eval, using the free hand for a better view.",url:"https://x.com/SuveenE/status/2099448450341605672"},{handle:"cdngdev",author:"thijs",summary:"A robot arm with a paintbrush painting the Golden Gate Bridge, improving across attempts from camera feedback.",url:"https://x.com/cdngdev/status/2097339677128982873"},{handle:"IsaacSin12",author:"Isaac Sin",summary:"Zero-shot sorting of irregularly shaped blocks into cups by color.",url:"https://x.com/IsaacSin12/status/2096715382166098302"},{handle:"chooi_jeq",author:"Jay Chooi",summary:"Robocurve's robot-control comparison: 95% task completion versus 40% for Fable 5.1 at lower cost.",url:"https://x.com/chooi_jeq/status/2096064315115839904"}],G=[{handle:"Lingjun_Mao",author:"Lingjun Mao",summary:"Adapting to a new embodiment to put a cake into an air fryer through CuRobo motion-planning tool APIs.",url:"https://x.com/Lingjun_Mao/status/2100294902672462176"},{handle:"walterzhu8",author:"Wentao Zhu",summary:"A day-and-a-half autonomous run that builds and trains pen spinning on a Sharpa hand in Isaac Lab.",url:"https://x.com/walterzhu8/status/2100212420840989112"},{handle:"mishig25",author:"Mishig",summary:"Painting the Eiffel Tower in MuJoCo with an SO-101 and a brush, with the full experiment shared on Hugging Face.",url:"https://x.com/mishig25/status/2099611674793668676"},{handle:"RunpeiDong",author:"Runpei Dong",summary:"Getting a humanoid into a Tesla in MuJoCo: learning from feedback, then reusing that experience with egocentric perception.",url:"https://x.com/RunpeiDong/status/2099604536327614717"},{handle:"frankzydou",author:"Zhiyang (Frank) Dou",summary:"A LeRobot SO-101 real-world pickup from a third-person RGB camera, where the arm has to bend back to reach the pen.",url:"https://x.com/frankzydou/status/2099338127915512297"},{handle:"Parvkpr",author:"Parv Kapoor",summary:"Real-to-sim: building an interactive simulation environment from a single image or video.",url:"https://x.com/Parvkpr/status/2098847963867238597"},{handle:"z_code68632",author:"code_z",summary:"One demo per task: unscrewing a bottle cap, inserting a plug, clearing obstacles, and imitating a dance on a real robot.",url:"https://x.com/z_code68632/status/2098397364725895387"}],j=({posts:s,label:i})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:i}),a.jsx("ul",{children:s.map(o=>a.jsxs("li",{children:[a.jsxs("a",{href:o.url,target:"_blank",rel:"noreferrer",children:["@",o.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",o.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",o.summary]})]},o.url))})]}),E=s=>s==="date_published"||s==="citation_count"?s:"trending",W=()=>{var g,x;const[s,i]=v(),o=E(s.get("order_by")),d=s.get("has_code")==="true",m=s.get("has_hf_artifacts")==="true",t=R({task:f,method:b,page_size:12,order_by:o,order_dir:"desc",include_resources:!0,has_code:d,has_hf_artifacts:m}),{targetRef:_,isIntersecting:u}=S({rootMargin:"200px"});h.useEffect(()=>(document.title=L("GPT-6 Astra for Robotics"),()=>{document.title=T}),[]),h.useEffect(()=>{u&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[u,t.hasNextPage,t.isFetchingNextPage]);const p=h.useMemo(()=>{var e;return(((e=t.data)==null?void 0:e.pages)??[]).flatMap(r=>r.results.map(F))},[t.data]),y=((x=(g=t.data)==null?void 0:g.pages[0])==null?void 0:x.count)??0,c=(e,r)=>{const l=new URLSearchParams(s);r===null?l.delete(e):l.set(e,r),i(l)};return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(n,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"GPT-6 Astra for Robotics"})]}),a.jsx("header",{className:"feed-header",children:a.jsxs("div",{children:[a.jsx("div",{className:"astra-eyebrow",children:"Collection"}),a.jsxs("h1",{className:"feed-title",children:["GPT-6 Astra ",a.jsx("em",{children:"for Robotics"})]}),a.jsx("div",{className:"feed-subtitle",children:"Papers, technical reports, and evaluations that put OpenAI’s frontier model in control of real and simulated robots."}),a.jsxs("p",{className:"astra-lede",children:["The GPT-6 Astra launch never mentioned robots, yet within days the model was driving arms, hands, and humanoids. As"," ",a.jsx("a",{href:I,target:"_blank",rel:"noreferrer",children:"Yu Xiang"})," ","framed it, the work splits into two families: Astra acting as the robot policy itself, and Astra acting as an agent that orchestrates everything else."]})]})}),a.jsxs("section",{className:"astra-approaches","aria-label":"How GPT-6 Astra is used for robots",children:[a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"01 / Robot policy"}),a.jsx("h2",{children:"Astra as the policy, like a VLA"}),a.jsx("p",{children:"The model looks at camera frames and robot state and directly emits actions: end-effector poses, joint targets, or gripper commands, closing the control loop step by step with no task-specific training."}),a.jsx(j,{posts:O,label:"Seen on X"})]}),a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"02 / Agent"}),a.jsx("h2",{children:"Astra as the agent"}),a.jsx("p",{children:"The model reasons about the scene, writes and runs code, calls planners and tools, or delegates low-level motion to pretrained policies such as VLAs, and keeps the robot on task over long horizons."}),a.jsx(j,{posts:G,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(n,{to:`/tasks/${f}`,children:"Robotics"})," task and the"," ",a.jsx(n,{to:`/methods/${b}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(n,{to:"/submit",children:"Submit it"}),"."]}),a.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[a.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),a.jsxs("div",{className:"task-section-title",children:["Papers ",a.jsxs("span",{className:"meta",children:["[",y.toLocaleString(),"]"]})]})]}),a.jsx("div",{className:"sort-bar",children:a.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a.jsx("div",{className:"sort-options",children:C.map(([e,r])=>a.jsx("button",{type:"button",className:`sort-btn ${o===e?"active":""}`,onClick:()=>c("order_by",e==="trending"?null:e),children:r},e))}),a.jsx(P,{hasCode:d,hasHfArtifacts:m,onHasCodeChange:e=>c("has_code",e?"true":null),onHasHfArtifactsChange:e=>c("has_hf_artifacts",e?"true":null)})]})}),t.error?a.jsx(k,{variant:"destructive",children:a.jsx(A,{children:"Failed to load the collection. Please try again."})}):t.isLoading?a.jsx("div",{className:"paper-list",children:Array.from({length:3}).map((e,r)=>a.jsx(w,{className:"h-40 w-full"},r))}):p.length===0?a.jsx("div",{className:"no-results",children:"No papers match this selection yet."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"paper-list",children:p.map((e,r)=>a.jsx(N,{paper:e,rank:r+1},e.id))}),a.jsx("div",{ref:_,style:{height:1}}),t.isFetchingNextPage&&a.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{W as default}; diff --git a/assets/AuthorDetailView-Bv11V4WZ.js b/assets/AuthorDetailView-bU4ydLti.js similarity index 79% rename from assets/AuthorDetailView-Bv11V4WZ.js rename to assets/AuthorDetailView-bU4ydLti.js index dd5d4582e7f51a7b3698b3d4800414bd1e580b6a..b530a23aa0962e62bdb9b76592142934657c5c84 100644 --- a/assets/AuthorDetailView-Bv11V4WZ.js +++ b/assets/AuthorDetailView-bU4ydLti.js @@ -1 +1 @@ -import{u as C,j as e,d as R,r as v,L as S}from"./index-CA09r0fx.js";import{u as w}from"./useQuery-GCOPnmOE.js";import{A as H,P as k}from"./components-CHZvyPkS.js";import{a as L,P as O,b as B}from"./PaperDateFilter-DhUC4jzf.js";import{P as I}from"./PaperFeedFilters-Ci7HUJiL.js";import{R as T}from"./ResearchFollowButton-BAC_HrTd.js";import{A as $,a as E}from"./alert-DRS5VQLi.js";import{S as y}from"./skeleton-CiNN3v7Q.js";import{u as M}from"./useIntersectionObserver-jfqowp0n.js";import{u as q}from"./usePapers-Bb48_cnL.js";import{p as z}from"./papers-2SfezChA.js";import{t as U}from"./colors-C6t5MKud.js";import A from"./NotFound-Br7ty259.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-U9FJMhfb.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D6rzCRBR.js";import"./useMutation-CUMX1r3q.js";import"./research-CAknkOM8.js";import"./plus-BGozleiT.js";import"./useInfiniteQuery-TrlVUjws.js";const K=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Q=s=>s==="date_published"||s==="citation_count"?s:"trending",V=({authorId:s})=>{var f,x,j,_,N,b,P;const[o,h]=R(),p=Q(o.get("order_by")),m=o.get("has_code")==="true",u=o.get("has_hf_artifacts")==="true",i=L(o),t=w({queryKey:["author",s],queryFn:()=>z.getAuthor(s)}),r=q({author:s,page_size:12,order_by:p,order_dir:"desc",include_resources:!0,has_code:m,has_hf_artifacts:u,start_date:i.startDate,end_date:i.endDate}),{targetRef:F,isIntersecting:g}=M({rootMargin:"200px"}),c=v.useMemo(()=>{var a;return(((a=r.data)==null?void 0:a.pages)??[]).flatMap(n=>n.results.map(U))},[r.data]);v.useEffect(()=>{g&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[g,r.hasNextPage,r.isFetchingNextPage,c.length]);const D=((x=(f=r.data)==null?void 0:f.pages[0])==null?void 0:x.count)??0,d=(a,n)=>{const l=new URLSearchParams(o);n?l.set(a,n):l.delete(a),h(l)};return((j=t.error)==null?void 0:j.status)===404?e.jsx(A,{}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(S,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:"Authors"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:((_=t.data)==null?void 0:_.full_name)??s})]}),e.jsxs("header",{className:"author-hero",children:[e.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),e.jsxs("div",{className:"author-hero-title",children:[((N=t.data)==null?void 0:N.hf_username)&&e.jsx(H,{className:"author-avatar",url:t.data.hf_avatar_url,href:`https://huggingface.co/${t.data.hf_username}`,label:`@${t.data.hf_username} on Hugging Face`}),e.jsx("h1",{className:"feed-title",children:((b=t.data)==null?void 0:b.full_name)??e.jsx(y,{className:"h-12 w-64 inline-block"})})]}),t.data&&e.jsxs("div",{className:"feed-subtitle",children:[t.data.paper_count.toLocaleString()," ",t.data.paper_count===1?"paper":"papers",t.data.hf_username&&e.jsxs(e.Fragment,{children:[" · ",e.jsxs("a",{href:`https://huggingface.co/${t.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",t.data.hf_username," on Hugging Face ↗"]})]})]}),t.data&&e.jsx(T,{kind:"author",entityId:t.data.id})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:K.map(([a,n])=>e.jsx("button",{type:"button",className:`sort-btn ${p===a?"active":""}`,onClick:()=>d("order_by",a==="trending"?null:a),children:n},a))}),e.jsx(I,{hasCode:m,hasHfArtifacts:u,onHasCodeChange:a=>d("has_code",a?"true":null),onHasHfArtifactsChange:a=>d("has_hf_artifacts",a?"true":null)})]}),e.jsx(O,{startDate:i.startDate,endDate:i.endDate,onChange:a=>h(B(o,a))}),e.jsxs("div",{className:"results-count",children:[D.toLocaleString()," papers"]})]}),r.error?e.jsx($,{variant:"destructive",children:e.jsxs(E,{children:["Failed to load papers."," ",e.jsx("button",{type:"button",onClick:()=>void r.refetch(),children:"Try again"})]})}):r.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,n)=>e.jsx(y,{className:"h-40 w-full"},n))}):c.length===0?e.jsx("div",{className:"no-results",children:((P=t.data)==null?void 0:P.paper_count)===0?"No public papers are available.":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:c.map((a,n)=>e.jsx(k,{paper:a,rank:n+1},a.id))}),e.jsx("div",{ref:F,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})},ge=()=>{const{authorId:s}=C();return s?e.jsx(V,{authorId:s},s):e.jsx(A,{})};export{ge as default}; +import{u as C,j as e,d as R,r as v,L as S}from"./index-DGz7IJy3.js";import{u as w}from"./useQuery-SnJNmisF.js";import{A as H,P as k}from"./components-C75Gxt6c.js";import{a as L,P as O,b as B}from"./PaperDateFilter-C6KBd0r-.js";import{P as I}from"./PaperFeedFilters-BIXkRwGe.js";import{R as T}from"./ResearchFollowButton-_BF37169.js";import{A as $,a as E}from"./alert-CfvggGdB.js";import{S as y}from"./skeleton-Qth9DQSW.js";import{u as M}from"./useIntersectionObserver-B7kBuOiP.js";import{u as q}from"./usePapers-knk68Pd9.js";import{p as z}from"./papers-CgK5TA59.js";import{t as U}from"./colors-YtiKVy3X.js";import A from"./NotFound-CK9eyj2q.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DtD88QQA.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-VInL7Z23.js";import"./useMutation-B1oRtfbH.js";import"./research-C0oNhyj8.js";import"./plus-v7R1dHou.js";import"./useInfiniteQuery-Bix5WR2s.js";const K=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Q=s=>s==="date_published"||s==="citation_count"?s:"trending",V=({authorId:s})=>{var f,x,j,_,N,b,P;const[o,h]=R(),p=Q(o.get("order_by")),m=o.get("has_code")==="true",u=o.get("has_hf_artifacts")==="true",i=L(o),t=w({queryKey:["author",s],queryFn:()=>z.getAuthor(s)}),r=q({author:s,page_size:12,order_by:p,order_dir:"desc",include_resources:!0,has_code:m,has_hf_artifacts:u,start_date:i.startDate,end_date:i.endDate}),{targetRef:F,isIntersecting:g}=M({rootMargin:"200px"}),c=v.useMemo(()=>{var a;return(((a=r.data)==null?void 0:a.pages)??[]).flatMap(n=>n.results.map(U))},[r.data]);v.useEffect(()=>{g&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[g,r.hasNextPage,r.isFetchingNextPage,c.length]);const D=((x=(f=r.data)==null?void 0:f.pages[0])==null?void 0:x.count)??0,d=(a,n)=>{const l=new URLSearchParams(o);n?l.set(a,n):l.delete(a),h(l)};return((j=t.error)==null?void 0:j.status)===404?e.jsx(A,{}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(S,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:"Authors"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:((_=t.data)==null?void 0:_.full_name)??s})]}),e.jsxs("header",{className:"author-hero",children:[e.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),e.jsxs("div",{className:"author-hero-title",children:[((N=t.data)==null?void 0:N.hf_username)&&e.jsx(H,{className:"author-avatar",url:t.data.hf_avatar_url,href:`https://huggingface.co/${t.data.hf_username}`,label:`@${t.data.hf_username} on Hugging Face`}),e.jsx("h1",{className:"feed-title",children:((b=t.data)==null?void 0:b.full_name)??e.jsx(y,{className:"h-12 w-64 inline-block"})})]}),t.data&&e.jsxs("div",{className:"feed-subtitle",children:[t.data.paper_count.toLocaleString()," ",t.data.paper_count===1?"paper":"papers",t.data.hf_username&&e.jsxs(e.Fragment,{children:[" · ",e.jsxs("a",{href:`https://huggingface.co/${t.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",t.data.hf_username," on Hugging Face ↗"]})]})]}),t.data&&e.jsx(T,{kind:"author",entityId:t.data.id})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:K.map(([a,n])=>e.jsx("button",{type:"button",className:`sort-btn ${p===a?"active":""}`,onClick:()=>d("order_by",a==="trending"?null:a),children:n},a))}),e.jsx(I,{hasCode:m,hasHfArtifacts:u,onHasCodeChange:a=>d("has_code",a?"true":null),onHasHfArtifactsChange:a=>d("has_hf_artifacts",a?"true":null)})]}),e.jsx(O,{startDate:i.startDate,endDate:i.endDate,onChange:a=>h(B(o,a))}),e.jsxs("div",{className:"results-count",children:[D.toLocaleString()," papers"]})]}),r.error?e.jsx($,{variant:"destructive",children:e.jsxs(E,{children:["Failed to load papers."," ",e.jsx("button",{type:"button",onClick:()=>void r.refetch(),children:"Try again"})]})}):r.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,n)=>e.jsx(y,{className:"h-40 w-full"},n))}):c.length===0?e.jsx("div",{className:"no-results",children:((P=t.data)==null?void 0:P.paper_count)===0?"No public papers are available.":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:c.map((a,n)=>e.jsx(k,{paper:a,rank:n+1},a.id))}),e.jsx("div",{ref:F,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})},ge=()=>{const{authorId:s}=C();return s?e.jsx(V,{authorId:s},s):e.jsx(A,{})};export{ge as default}; diff --git a/assets/AuthorizePaperEditView-CmLofDOW.js b/assets/AuthorizePaperEditView-BT467XuQ.js similarity index 87% rename from assets/AuthorizePaperEditView-CmLofDOW.js rename to assets/AuthorizePaperEditView-BT467XuQ.js index a4c766da02a988b0d826c670df231a7dc0b94a58..b4692c27d88364b7c8dcbc4ccb9d7b0269233bdc 100644 --- a/assets/AuthorizePaperEditView-CmLofDOW.js +++ b/assets/AuthorizePaperEditView-BT467XuQ.js @@ -1 +1 @@ -import{u,a as d,j as e,L as l,H as p}from"./index-CA09r0fx.js";import{u as c}from"./useQuery-GCOPnmOE.js";import{u as h}from"./useMutation-CUMX1r3q.js";import{B as m}from"./button-BkpxXw_S.js";import{p as n}from"./paperEdits-BaXeJ-Bi.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-DGz7IJy3.js";import{u as c}from"./useQuery-SnJNmisF.js";import{u as h}from"./useMutation-B1oRtfbH.js";import{B as m}from"./button-DEdvni-v.js";import{p as n}from"./paperEdits-BtAPUkKl.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-B9YSXne8.js b/assets/AutonomousOperations-BTR1Cddl.js similarity index 94% rename from assets/AutonomousOperations-B9YSXne8.js rename to assets/AutonomousOperations-BTR1Cddl.js index 888c02423074db35128eb5f037e036af5e8e4d54..c5341532539b07a40dbf4ac1604bab93b53f6356 100644 --- a/assets/AutonomousOperations-B9YSXne8.js +++ b/assets/AutonomousOperations-BTR1Cddl.js @@ -1,4 +1,4 @@ -import{g as R,a as B,m as q,r as m,j as e,L as H}from"./index-CA09r0fx.js";import{u as I}from"./useQuery-GCOPnmOE.js";import{u as Q}from"./useMutation-CUMX1r3q.js";import{B as P}from"./badge-CkrPEkl0.js";import{B as x}from"./button-BkpxXw_S.js";import{C as n,d as i,a as t,b as r,f as h,o as u}from"./operations-CpjCuL3Z.js";import{I as j}from"./input-CtSl48Mp.js";import{A as D}from"./activity-CKk220MX.js";import{S as $}from"./shield-alert-DFYdQl7U.js";/** +import{g as R,a as B,m as q,r as m,j as e,L as H}from"./index-DGz7IJy3.js";import{u as I}from"./useQuery-SnJNmisF.js";import{u as Q}from"./useMutation-B1oRtfbH.js";import{B as P}from"./badge-CE-3yZlW.js";import{B as x}from"./button-DEdvni-v.js";import{C as n,d as i,a as t,b as r,f as h,o as u}from"./operations-C37-eWov.js";import{I as j}from"./input-DVdOE4Xl.js";import{A as D}from"./activity-zaQ-sruD.js";import{S as $}from"./shield-alert-BJn-Krlm.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/BenchmarkDetailView-BnI8cNM6.js b/assets/BenchmarkDetailView-D9CMxLQx.js similarity index 98% rename from assets/BenchmarkDetailView-BnI8cNM6.js rename to assets/BenchmarkDetailView-D9CMxLQx.js index d6c8d4277d2318dd470e01aa983c30c943dc56db..12fd79c0f633936e8de76dc7af472d4fab63f10b 100644 --- a/assets/BenchmarkDetailView-BnI8cNM6.js +++ b/assets/BenchmarkDetailView-D9CMxLQx.js @@ -1,2 +1,2 @@ -import{r as F,j as a,y as le,L as ne,b as ot,h as ct,u as dt,d as ut,k as mt}from"./index-CA09r0fx.js";import{R as ht}from"./ResearchFollowButton-BAC_HrTd.js";import{u as te}from"./useQuery-GCOPnmOE.js";import{c as re}from"./catalog-C6oGGh8I.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-C5MLELvC.js";import{L as oe}from"./LatexTitle-U9FJMhfb.js";import{S as Ke}from"./switch-VPV7aWRb.js";import{I as xt}from"./components-CHZvyPkS.js";import{S as ce}from"./skeleton-CiNN3v7Q.js";import{A as bt,a as yt}from"./alert-DRS5VQLi.js";import{B as wt}from"./BenchmarkTrendSparkline-g8mg75No.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import"./useMutation-CUMX1r3q.js";import"./research-CAknkOM8.js";import"./plus-BGozleiT.js";import"./papers-2SfezChA.js";import"./hover-card-0saQl8Kd.js";import"./index-1y8ilIyE.js";import"./paperQueryKeys-BP2E-0yf.js";import"./colors-C6t5MKud.js";function _t(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],n=s.filter(l=>l.is_open===!1),i=n.reduce((l,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}function ie(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}const Ge=[{label:"All",maxParametersExclusive:void 0},{label:"<10M",maxParametersExclusive:1e7},{label:"<100M",maxParametersExclusive:1e8},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function St(e){const t=e===null?void 0:Number(e);return Ge.some(r=>r.maxParametersExclusive===t)?t:void 0}function kt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Ct(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Et(e){const t=new Map;for(const r of e){const s=Ct(r),n=t.get(s);if(!n){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}n.metrics={...n.metrics,...r.metrics||{}},n.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(n.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!n.hasParameterConflict&&(n.parameterCount===null?n.parameterCount=r.num_parameters:n.parameterCount!==r.num_parameters&&(n.parameterCount=null,n.hasParameterConflict=!0))}return Array.from(t.values())}function Le(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCounts+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function $t(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==Rt(e.updated_at)?r:e.paper_published_date||""}function Mt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Pt(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:$t(u,s)}}).filter(u=>u.value!==null&&!!u.date).sort((u,h)=>u.date.localeCompare(h.date)),i=[];let l=null;for(const u of n){const h=l==null?!0:r==="↓"?u.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 Qe(e,t,r,s){const n=t.find(i=>i.id===s);if(e.length===0)return null;if(n!=null&&n.task_id&&e.some(i=>i.id===n.task_id))return n.task_id;if(r){const i=e.find(l=>l.slug===r);if(i)return i.id}if(e.length===1)return e[0].id;if(t.length>0){const i=new Map;for(const d of t)i.set(d.task_id,(i.get(d.task_id)||0)+1);let l=null,c=-1;for(const d of e){const f=i.get(d.id)||0;f>c&&(c=f,l=d.id)}if(l)return l}return e[0].id}function Tt(e){var _,X,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:c=1}=e,d=Qe(r,t,s,n),f=r.find(o=>o.id===d)||r[0]||null,x=t.find(o=>o.id===n),u=_t(t,d,e.hideClosed),h=Et(u.visible),R=Le(h,i),E=e.configuredMetrics.map(o=>o.metric_name),L=Array.from(new Set(h.flatMap(o=>[...o.best_metric?[o.best_metric]:[],...Object.keys(o.metrics||{})]))),S=E.length?E:L,g=new Map;for(const o of h){const m=o.best_metric;!m||ie(o.metrics[m])===null||E.length&&!S.includes(m)||g.set(m,(g.get(m)||0)+1)}const k=((_=[...g].sort((o,m)=>m[1]-o[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(o=>{var m;return o.toLocaleLowerCase()===((m=e.metric)==null?void 0:m.trim().toLocaleLowerCase())})||(x==null?void 0:x.best_metric)||k,D=((X=e.directions)==null?void 0:X.directions[j])==="lower_is_better"?"↓":"↑",W=j&&S.includes(j)?[j,...S.filter(o=>o!==j)]:S,w=W.length?l?W:W.slice(0,Math.max(1,c)):j?[j]:[],q=R.slice().sort((o,m)=>{const p=ie(o.metrics[j]),y=ie(m.metrics[j]);return p!==null&&y!==null?D==="↓"?p-y:y-p:p!==null?-1:y!==null?1:Ie(o,j)-Ie(m,j)});let I=null,N=0;const Q=q.map((o,m)=>{const p=ie(o.metrics[j]);return p!==null&&p!==I&&(I=p,N=m+1),{evaluation:o,rank:p===null?null:N,isHighlighted:Nt(o,n)}}),{points:z,sota:ee,sotaModel:O}=Mt(R,j,D),$=i===void 0?e.initialSummary:void 0,U=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),K={parameter_coverage_known:h.filter(o=>o.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:D,allowedMetrics:S,orderedMetrics:W,visibleMetrics:w,rows:Q,chartPoints:z,highlightedEval:((Y=Q.find(o=>o.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:u.hiddenClosed,hiddenClosedTopEval:u.topHiddenClosed,parameterBound:i,parameterCoverage:K,hasParameterMetadata:K.parameter_coverage_known>0,parameterFilters:Ge.map(o=>({...o,selected:i===o.maxParametersExclusive,disabled:i!==o.maxParametersExclusive&&Le(h,o.maxParametersExclusive).length===0})),displayedMetric:U?j:$==null?void 0:$.metric,displayedSota:U?ee:$==null?void 0:$.value,displayedSotaModel:U?O:$==null?void 0:$.model_name,isSummaryLoading:!U&&!$,isInitialFilteredViewLoading:i!==void 0&&!U}}function Ft(e,t,r,s=1,n=0){const i=e-t.fixed-(r?t.harness:0);if(t.metric<=0)return 1;const l=Math.floor(i/t.metric);if(lr+he(t,s),0),harness:he(t,"--bm-harness-width"),metric:he(t,"--bm-metric-width")}}const It=20;function Ae(e,t){return e?a.jsx(oe,{title:e}):t||"—"}function At({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:c,arrow:d}=e,[f,x]=F.useState(null);return F.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const E=f.clientWidth,L=Lt(R),S=document.documentElement,g=S.scrollHeight>S.clientHeight?0:It;n(k=>Ft(E,L,t,k,g))},h=new ResizeObserver(u);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),u(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:x,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:a.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":l.length,"--bm-harness-count":t?1:0},children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"bm-width-rank"}),a.jsx("col",{className:"bm-width-model"}),a.jsx("col",{className:"bm-width-parameters"}),t&&a.jsx("col",{className:"bm-width-harness"}),l.map(u=>a.jsx("col",{className:"bm-width-metric"},u)),a.jsx("col",{}),a.jsx("col",{className:"bm-width-year"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"col-rank",children:"Rank"}),a.jsx("th",{className:"col-model",children:"Model"}),a.jsx("th",{className:"col-parameters",children:"Parameters"}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),l.map(u=>{const h=u===c;return a.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?d==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${d}`:""]})},u)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:u,rank:h,isHighlighted:R})=>{var S;const E=u.paper_arxiv_id||u.paper_id,L=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:R?s:void 0,className:R?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[R&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?a.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&a.jsx(ft,{}),(u.external??u.is_external)&&a.jsx(pt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),a.jsx("td",{className:"col-parameters",title:u.parameterCount===null?void 0:u.parameterCount.toLocaleString("en-US"),"aria-label":u.parameterCount===null?"Parameters unknown":`${u.parameterCount.toLocaleString("en-US")} parameters`,children:u.parameterCount===null?"—":kt(u.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:u.harness||"—"}),l.map(g=>{var j;const k=g===c,B=(j=u.metrics)==null?void 0:j[g];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:B!=null&&B!==""?le(B):"—"},g)}),a.jsx("td",{className:"col-paper",children:E?a.jsx(ne,{to:`/paper/${E}`,title:u.paper_title||L||void 0,children:Ae(u.paper_title,L)}):Ae(u.paper_title,L)}),a.jsx("td",{className:"col-year",children:((S=u.evaluated_on||u.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},u.id)})})]})})}function Be(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const fe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Bt(e,t){if(e===t){const{year:d,month:f}=pe(e);return[{timestamp:new Date(d,f,1).getTime(),key:`${d}-${f}`,label:`${fe[f]} ${d}`}]}const r=pe(e),s=pe(t);if(r.year===s.year){const d=s.month-r.month+1;let f=1;const x=12;d>x&&(f=Math.ceil(d/x));const u=[];for(let h=r.month;h<=s.month;h+=f)u.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${fe[h]} ${r.year}`:fe[h]});return u}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const c=[];for(let d=r.year;d<=s.year;d+=i)c.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return c}const Dt=({points:e,metric:t})=>{const r=ot(),[s,n]=F.useState(null),i=880,l=320,c=60,d=30,f=40,x=50,u=e.map(o=>o.value),h=Math.min(...u),E=Math.max(...u)-h||1,L=i-c-d,S=l-f-x,g=e.map(o=>Be(o.date)),k=Math.min(...g),B=Math.max(...g),j=B-k||1,D=o=>k===B?c+L/2:c+(o-k)/j*L,W=e.map((o,m)=>{const p=D(Be(o.date)),y=(o.value-h)/E,P=f+S*(1-y);return{x:p,y:P,data:o,idx:m}}),w=W.filter(o=>o.data.isSota);let q="";if(w.length>=2){q=`M${w[0].x},${w[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const p=m.length>22?m.slice(0,21)+"…":m,y=p.length*I;let P=o.x-y/2,C=o.x+y/2,v="middle";return Pi-d&&(C=i-d,P=C-y,v="end"),{x:v==="start"?c:v==="end"?i-d:o.x,y:o.y-Q,text:p,anchor:v,left:P,right:C}},ee=[],O=w.length>0?z(w[w.length-1]):null;let $=-1/0;for(let o=0;oO.left-N||($=m.right,ee.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}O&&ee.push({x:O.x,y:O.y,text:O.text,anchor:O.anchor});const U=Bt(k,B),K=5,_=o=>n(m=>m===o?null:m),X=o=>{o&&r(`/paper/${o}`)},Y=(o,m)=>{const y=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${le(o.data.value)} on ${o.data.dateLabel}`,P=!!o.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:P?"pointer":"default",outline:"none"},tabIndex:0,role:P?"link":"img","aria-label":y,onMouseEnter:()=>n(o.idx),onMouseLeave:()=>_(o.idx),onFocus:()=>n(o.idx),onBlur:()=>_(o.idx),onClick:()=>X(o.data.paperRouteId),onKeyDown:C=>{P&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),X(o.data.paperRouteId))},children:a.jsx("title",{children:y})})]},o.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:c-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${f+S/2})`,children:t}),Array.from({length:K}).map((o,m)=>{const p=m/(K-1),y=f+S*(1-p),P=h+E*p;return a.jsxs("g",{children:[a.jsx("line",{x1:c,y1:y,x2:i-d,y2:y,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:c-10,y:y+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(P)})]},m)}),U.map(o=>{const m=D(o.timestamp);return a.jsx("text",{x:m,y:l-x+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),W.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),q&&a.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((o,m)=>a.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&W[s]&&(()=>{const o=W[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",y=`${m.length>40?m.slice(0,39)+"…":m}: ${le(o.data.value)}`,C=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=o.x-C/2;Hi-d&&(H=i-d-C);const G=o.y-v-14>=f?o.y-v-12:o.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:H,y:G,width:C,height:v,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:H+12,y:G+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:y})]})})()]})};function Ht(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(n),t&&(s.href=t),n.href=e,n.href}const Vt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Z(e){const t=[];for(let r=0,s=e.length;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 zt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=s.length,i=new Uint8Array(n);for(let l=0;l{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Kt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Gt(e,t,r){const s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),n.appendChild(i),i.appendChild(e),Kt(n)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function Qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Xt(e,t){return Xe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Yt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?Qt(r):Xt(r,s);return document.createTextNode(`${n}{${i}}`)}function De(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=Vt();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Yt(l,r,n,s)),t.appendChild(c)}function Jt(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const He="application/font-woff",Ve="image/jpeg",Zt={woff:He,woff2:He,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ve,jpeg:Ve,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function er(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=er(e).toLowerCase();return Zt[t]||""}function tr(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function rr(e,t){return`data:${t};base64,${e}`}async function Je(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const n=await s.blob();return new Promise((i,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(n)})}const ge={};function ar(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function we(e,t,r){const s=ar(e,t,r.includeQueryParams);if(ge[s]!=null)return ge[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Je(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),tr(c)));n=rr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return ge[s]=n,n}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ue(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const c=i.toDataURL();return ue(c)}const r=e.poster,s=ye(r),n=await we(r,s,t);return ue(n)}async function ir(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await me(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function lr(e,t){return A(e,HTMLCanvasElement)?sr(e):A(e,HTMLVideoElement)?nr(e,t):A(e,HTMLIFrameElement)?ir(e,t):e.cloneNode(Ze(e))}const or=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function cr(e,t,r){var s,n;if(Ze(t))return t;let i=[];return or(e)&&e.assignedNodes?i=Z(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=Z(e.contentDocument.body.childNodes):i=Z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>me(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function dr(e,t,r){const s=t.style;if(!s)return;const n=window.getComputedStyle(e);n.cssText?(s.cssText=n.cssText,s.transformOrigin=n.transformOrigin):Xe(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,n.getPropertyPriority(i))})}function ur(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function mr(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function hr(e,t,r){return A(t,Element)&&(dr(e,t,r),Jt(e,t,r),ur(e,t),mr(e,t)),t}async function fr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;ilr(s,t)).then(s=>cr(e,s,t)).then(s=>hr(e,s,t)).then(s=>fr(s,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function xr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function br(e){const t=[];return e.replace(et,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function yr(e,t,r,s,n){try{const i=r?Ht(t,r):t,l=ye(t);let c;return n||(c=await we(i,l,s)),e.replace(xr(t),`$1${c}$3`)}catch{}return e}function wr(e,{preferredFontFormat:t}){return t?e.replace(gr,r=>{for(;;){const[s,,n]=pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function tt(e){return e.search(et)!==-1}async function rt(e,t,r){if(!tt(e))return e;const s=wr(e,r);return br(s).reduce((i,l)=>i.then(c=>yr(c,l,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const n=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(n){const i=await rt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function vr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function jr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(A(e,SVGImageElement)&&!xe(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,n=await we(s,ye(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(f){l(f)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function _r(e,t){const s=Z(e.childNodes).map(n=>at(n,t));await Promise.all(s).then(()=>e)}async function at(e,t){A(e,Element)&&(await vr(e,t),await jr(e,t),await _r(e,t))}function Sr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(n=>{r[n]=s[n]}),e}const We={};async function Oe(e){let t=We[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},We[e]=t,t}async function Ue(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),Je(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function qe(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=n.exec(s);if(d===null)break;t.push(d[0])}s=s.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=c.exec(s),d===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(d[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const d=i.href,f=Oe(d).then(x=>Ue(x,t)).then(x=>qe(x).forEach(u=>{try{n.insertRule(u,u.startsWith("@import")?c+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:u,error:h})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(f)}})}catch(i){const l=e.find(c=>c.href==null)||document.styleSheets[0];n.href!=null&&s.push(Oe(n.href).then(c=>Ue(c,t)).then(c=>qe(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function Cr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function Er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await kr(r,t);return Cr(s)}function st(e){return e.trim().replace(/["']/g,"")}function Nr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(st(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Rr(e,t){const r=await Er(e,t),s=Nr(e);return(await Promise.all(r.filter(i=>s.has(st(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return rt(i.cssText,l,t)}))).join(` +import{r as F,j as a,y as le,L as ne,b as ot,h as ct,u as dt,d as ut,k as mt}from"./index-DGz7IJy3.js";import{R as ht}from"./ResearchFollowButton-_BF37169.js";import{u as te}from"./useQuery-SnJNmisF.js";import{c as re}from"./catalog-CI50zqwR.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-ChPSpdTg.js";import{L as oe}from"./LatexTitle-DtD88QQA.js";import{S as Ke}from"./switch-CwjWc_fX.js";import{I as xt}from"./components-C75Gxt6c.js";import{S as ce}from"./skeleton-Qth9DQSW.js";import{A as bt,a as yt}from"./alert-CfvggGdB.js";import{B as wt}from"./BenchmarkTrendSparkline-CT9c4wG-.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import"./useMutation-B1oRtfbH.js";import"./research-C0oNhyj8.js";import"./plus-v7R1dHou.js";import"./papers-CgK5TA59.js";import"./hover-card-32Q2qmuv.js";import"./index-Bx9aRYc1.js";import"./paperQueryKeys-BP2E-0yf.js";import"./colors-YtiKVy3X.js";function _t(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],n=s.filter(l=>l.is_open===!1),i=n.reduce((l,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}function ie(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}const Ge=[{label:"All",maxParametersExclusive:void 0},{label:"<10M",maxParametersExclusive:1e7},{label:"<100M",maxParametersExclusive:1e8},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function St(e){const t=e===null?void 0:Number(e);return Ge.some(r=>r.maxParametersExclusive===t)?t:void 0}function kt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Ct(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Et(e){const t=new Map;for(const r of e){const s=Ct(r),n=t.get(s);if(!n){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}n.metrics={...n.metrics,...r.metrics||{}},n.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(n.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!n.hasParameterConflict&&(n.parameterCount===null?n.parameterCount=r.num_parameters:n.parameterCount!==r.num_parameters&&(n.parameterCount=null,n.hasParameterConflict=!0))}return Array.from(t.values())}function Le(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCounts+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function $t(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==Rt(e.updated_at)?r:e.paper_published_date||""}function Mt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Pt(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:$t(u,s)}}).filter(u=>u.value!==null&&!!u.date).sort((u,h)=>u.date.localeCompare(h.date)),i=[];let l=null;for(const u of n){const h=l==null?!0:r==="↓"?u.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 Qe(e,t,r,s){const n=t.find(i=>i.id===s);if(e.length===0)return null;if(n!=null&&n.task_id&&e.some(i=>i.id===n.task_id))return n.task_id;if(r){const i=e.find(l=>l.slug===r);if(i)return i.id}if(e.length===1)return e[0].id;if(t.length>0){const i=new Map;for(const d of t)i.set(d.task_id,(i.get(d.task_id)||0)+1);let l=null,c=-1;for(const d of e){const f=i.get(d.id)||0;f>c&&(c=f,l=d.id)}if(l)return l}return e[0].id}function Tt(e){var _,X,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:c=1}=e,d=Qe(r,t,s,n),f=r.find(o=>o.id===d)||r[0]||null,x=t.find(o=>o.id===n),u=_t(t,d,e.hideClosed),h=Et(u.visible),R=Le(h,i),E=e.configuredMetrics.map(o=>o.metric_name),L=Array.from(new Set(h.flatMap(o=>[...o.best_metric?[o.best_metric]:[],...Object.keys(o.metrics||{})]))),S=E.length?E:L,g=new Map;for(const o of h){const m=o.best_metric;!m||ie(o.metrics[m])===null||E.length&&!S.includes(m)||g.set(m,(g.get(m)||0)+1)}const k=((_=[...g].sort((o,m)=>m[1]-o[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(o=>{var m;return o.toLocaleLowerCase()===((m=e.metric)==null?void 0:m.trim().toLocaleLowerCase())})||(x==null?void 0:x.best_metric)||k,D=((X=e.directions)==null?void 0:X.directions[j])==="lower_is_better"?"↓":"↑",W=j&&S.includes(j)?[j,...S.filter(o=>o!==j)]:S,w=W.length?l?W:W.slice(0,Math.max(1,c)):j?[j]:[],q=R.slice().sort((o,m)=>{const p=ie(o.metrics[j]),y=ie(m.metrics[j]);return p!==null&&y!==null?D==="↓"?p-y:y-p:p!==null?-1:y!==null?1:Ie(o,j)-Ie(m,j)});let I=null,N=0;const Q=q.map((o,m)=>{const p=ie(o.metrics[j]);return p!==null&&p!==I&&(I=p,N=m+1),{evaluation:o,rank:p===null?null:N,isHighlighted:Nt(o,n)}}),{points:z,sota:ee,sotaModel:O}=Mt(R,j,D),$=i===void 0?e.initialSummary:void 0,U=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),K={parameter_coverage_known:h.filter(o=>o.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:D,allowedMetrics:S,orderedMetrics:W,visibleMetrics:w,rows:Q,chartPoints:z,highlightedEval:((Y=Q.find(o=>o.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:u.hiddenClosed,hiddenClosedTopEval:u.topHiddenClosed,parameterBound:i,parameterCoverage:K,hasParameterMetadata:K.parameter_coverage_known>0,parameterFilters:Ge.map(o=>({...o,selected:i===o.maxParametersExclusive,disabled:i!==o.maxParametersExclusive&&Le(h,o.maxParametersExclusive).length===0})),displayedMetric:U?j:$==null?void 0:$.metric,displayedSota:U?ee:$==null?void 0:$.value,displayedSotaModel:U?O:$==null?void 0:$.model_name,isSummaryLoading:!U&&!$,isInitialFilteredViewLoading:i!==void 0&&!U}}function Ft(e,t,r,s=1,n=0){const i=e-t.fixed-(r?t.harness:0);if(t.metric<=0)return 1;const l=Math.floor(i/t.metric);if(lr+he(t,s),0),harness:he(t,"--bm-harness-width"),metric:he(t,"--bm-metric-width")}}const It=20;function Ae(e,t){return e?a.jsx(oe,{title:e}):t||"—"}function At({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:c,arrow:d}=e,[f,x]=F.useState(null);return F.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const E=f.clientWidth,L=Lt(R),S=document.documentElement,g=S.scrollHeight>S.clientHeight?0:It;n(k=>Ft(E,L,t,k,g))},h=new ResizeObserver(u);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),u(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:x,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:a.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":l.length,"--bm-harness-count":t?1:0},children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"bm-width-rank"}),a.jsx("col",{className:"bm-width-model"}),a.jsx("col",{className:"bm-width-parameters"}),t&&a.jsx("col",{className:"bm-width-harness"}),l.map(u=>a.jsx("col",{className:"bm-width-metric"},u)),a.jsx("col",{}),a.jsx("col",{className:"bm-width-year"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"col-rank",children:"Rank"}),a.jsx("th",{className:"col-model",children:"Model"}),a.jsx("th",{className:"col-parameters",children:"Parameters"}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),l.map(u=>{const h=u===c;return a.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?d==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${d}`:""]})},u)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:u,rank:h,isHighlighted:R})=>{var S;const E=u.paper_arxiv_id||u.paper_id,L=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:R?s:void 0,className:R?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[R&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?a.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&a.jsx(ft,{}),(u.external??u.is_external)&&a.jsx(pt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),a.jsx("td",{className:"col-parameters",title:u.parameterCount===null?void 0:u.parameterCount.toLocaleString("en-US"),"aria-label":u.parameterCount===null?"Parameters unknown":`${u.parameterCount.toLocaleString("en-US")} parameters`,children:u.parameterCount===null?"—":kt(u.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:u.harness||"—"}),l.map(g=>{var j;const k=g===c,B=(j=u.metrics)==null?void 0:j[g];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:B!=null&&B!==""?le(B):"—"},g)}),a.jsx("td",{className:"col-paper",children:E?a.jsx(ne,{to:`/paper/${E}`,title:u.paper_title||L||void 0,children:Ae(u.paper_title,L)}):Ae(u.paper_title,L)}),a.jsx("td",{className:"col-year",children:((S=u.evaluated_on||u.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},u.id)})})]})})}function Be(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const fe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Bt(e,t){if(e===t){const{year:d,month:f}=pe(e);return[{timestamp:new Date(d,f,1).getTime(),key:`${d}-${f}`,label:`${fe[f]} ${d}`}]}const r=pe(e),s=pe(t);if(r.year===s.year){const d=s.month-r.month+1;let f=1;const x=12;d>x&&(f=Math.ceil(d/x));const u=[];for(let h=r.month;h<=s.month;h+=f)u.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${fe[h]} ${r.year}`:fe[h]});return u}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const c=[];for(let d=r.year;d<=s.year;d+=i)c.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return c}const Dt=({points:e,metric:t})=>{const r=ot(),[s,n]=F.useState(null),i=880,l=320,c=60,d=30,f=40,x=50,u=e.map(o=>o.value),h=Math.min(...u),E=Math.max(...u)-h||1,L=i-c-d,S=l-f-x,g=e.map(o=>Be(o.date)),k=Math.min(...g),B=Math.max(...g),j=B-k||1,D=o=>k===B?c+L/2:c+(o-k)/j*L,W=e.map((o,m)=>{const p=D(Be(o.date)),y=(o.value-h)/E,P=f+S*(1-y);return{x:p,y:P,data:o,idx:m}}),w=W.filter(o=>o.data.isSota);let q="";if(w.length>=2){q=`M${w[0].x},${w[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const p=m.length>22?m.slice(0,21)+"…":m,y=p.length*I;let P=o.x-y/2,C=o.x+y/2,v="middle";return Pi-d&&(C=i-d,P=C-y,v="end"),{x:v==="start"?c:v==="end"?i-d:o.x,y:o.y-Q,text:p,anchor:v,left:P,right:C}},ee=[],O=w.length>0?z(w[w.length-1]):null;let $=-1/0;for(let o=0;oO.left-N||($=m.right,ee.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}O&&ee.push({x:O.x,y:O.y,text:O.text,anchor:O.anchor});const U=Bt(k,B),K=5,_=o=>n(m=>m===o?null:m),X=o=>{o&&r(`/paper/${o}`)},Y=(o,m)=>{const y=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${le(o.data.value)} on ${o.data.dateLabel}`,P=!!o.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:P?"pointer":"default",outline:"none"},tabIndex:0,role:P?"link":"img","aria-label":y,onMouseEnter:()=>n(o.idx),onMouseLeave:()=>_(o.idx),onFocus:()=>n(o.idx),onBlur:()=>_(o.idx),onClick:()=>X(o.data.paperRouteId),onKeyDown:C=>{P&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),X(o.data.paperRouteId))},children:a.jsx("title",{children:y})})]},o.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:c-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${f+S/2})`,children:t}),Array.from({length:K}).map((o,m)=>{const p=m/(K-1),y=f+S*(1-p),P=h+E*p;return a.jsxs("g",{children:[a.jsx("line",{x1:c,y1:y,x2:i-d,y2:y,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:c-10,y:y+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(P)})]},m)}),U.map(o=>{const m=D(o.timestamp);return a.jsx("text",{x:m,y:l-x+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),W.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),q&&a.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((o,m)=>a.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&W[s]&&(()=>{const o=W[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",y=`${m.length>40?m.slice(0,39)+"…":m}: ${le(o.data.value)}`,C=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=o.x-C/2;Hi-d&&(H=i-d-C);const G=o.y-v-14>=f?o.y-v-12:o.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:H,y:G,width:C,height:v,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:H+12,y:G+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:y})]})})()]})};function Ht(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(n),t&&(s.href=t),n.href=e,n.href}const Vt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Z(e){const t=[];for(let r=0,s=e.length;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 zt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=s.length,i=new Uint8Array(n);for(let l=0;l{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Kt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Gt(e,t,r){const s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),n.appendChild(i),i.appendChild(e),Kt(n)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function Qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Xt(e,t){return Xe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Yt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?Qt(r):Xt(r,s);return document.createTextNode(`${n}{${i}}`)}function De(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=Vt();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Yt(l,r,n,s)),t.appendChild(c)}function Jt(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const He="application/font-woff",Ve="image/jpeg",Zt={woff:He,woff2:He,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ve,jpeg:Ve,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function er(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=er(e).toLowerCase();return Zt[t]||""}function tr(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function rr(e,t){return`data:${t};base64,${e}`}async function Je(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const n=await s.blob();return new Promise((i,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(n)})}const ge={};function ar(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function we(e,t,r){const s=ar(e,t,r.includeQueryParams);if(ge[s]!=null)return ge[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Je(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),tr(c)));n=rr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return ge[s]=n,n}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ue(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const c=i.toDataURL();return ue(c)}const r=e.poster,s=ye(r),n=await we(r,s,t);return ue(n)}async function ir(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await me(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function lr(e,t){return A(e,HTMLCanvasElement)?sr(e):A(e,HTMLVideoElement)?nr(e,t):A(e,HTMLIFrameElement)?ir(e,t):e.cloneNode(Ze(e))}const or=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function cr(e,t,r){var s,n;if(Ze(t))return t;let i=[];return or(e)&&e.assignedNodes?i=Z(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=Z(e.contentDocument.body.childNodes):i=Z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>me(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function dr(e,t,r){const s=t.style;if(!s)return;const n=window.getComputedStyle(e);n.cssText?(s.cssText=n.cssText,s.transformOrigin=n.transformOrigin):Xe(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,n.getPropertyPriority(i))})}function ur(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function mr(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function hr(e,t,r){return A(t,Element)&&(dr(e,t,r),Jt(e,t,r),ur(e,t),mr(e,t)),t}async function fr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;ilr(s,t)).then(s=>cr(e,s,t)).then(s=>hr(e,s,t)).then(s=>fr(s,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function xr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function br(e){const t=[];return e.replace(et,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function yr(e,t,r,s,n){try{const i=r?Ht(t,r):t,l=ye(t);let c;return n||(c=await we(i,l,s)),e.replace(xr(t),`$1${c}$3`)}catch{}return e}function wr(e,{preferredFontFormat:t}){return t?e.replace(gr,r=>{for(;;){const[s,,n]=pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function tt(e){return e.search(et)!==-1}async function rt(e,t,r){if(!tt(e))return e;const s=wr(e,r);return br(s).reduce((i,l)=>i.then(c=>yr(c,l,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const n=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(n){const i=await rt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function vr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function jr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(A(e,SVGImageElement)&&!xe(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,n=await we(s,ye(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(f){l(f)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function _r(e,t){const s=Z(e.childNodes).map(n=>at(n,t));await Promise.all(s).then(()=>e)}async function at(e,t){A(e,Element)&&(await vr(e,t),await jr(e,t),await _r(e,t))}function Sr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(n=>{r[n]=s[n]}),e}const We={};async function Oe(e){let t=We[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},We[e]=t,t}async function Ue(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),Je(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function qe(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=n.exec(s);if(d===null)break;t.push(d[0])}s=s.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=c.exec(s),d===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(d[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const d=i.href,f=Oe(d).then(x=>Ue(x,t)).then(x=>qe(x).forEach(u=>{try{n.insertRule(u,u.startsWith("@import")?c+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:u,error:h})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(f)}})}catch(i){const l=e.find(c=>c.href==null)||document.styleSheets[0];n.href!=null&&s.push(Oe(n.href).then(c=>Ue(c,t)).then(c=>qe(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function Cr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function Er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await kr(r,t);return Cr(s)}function st(e){return e.trim().replace(/["']/g,"")}function Nr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(st(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Rr(e,t){const r=await Er(e,t),s=Nr(e);return(await Promise.all(r.filter(i=>s.has(st(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return rt(i.cssText,l,t)}))).join(` `)}async function Pr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Rr(e,t);if(r){const s=document.createElement("style"),n=document.createTextNode(r);s.appendChild(n),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function $r(e,t={}){const{width:r,height:s}=Ye(e,t),n=await me(e,t,!0);return await Pr(n,t),await at(n,t),Sr(n,t),await Gt(n,r,s)}async function Mr(e,t={}){const{width:r,height:s}=Ye(e,t),n=await $r(e,t),i=await ue(n),l=document.createElement("canvas"),c=l.getContext("2d"),d=t.pixelRatio||Ut(),f=t.canvasWidth||r,x=t.canvasHeight||s;return l.width=f*d,l.height=x*d,t.skipAutoScale||qt(l),l.style.width=`${f}`,l.style.height=`${x}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function Tr(e,t={}){const r=await Mr(e,t);return await zt(r)}const be="#ffffff";function Fr(){return typeof window>"u"?be:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||be}function Lr(e){if(typeof window>"u")return be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Fr():t}async function Ir(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Tr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Lr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const nt=({targetRef:e,label:t})=>{const{toast:r}=ct(),[s,n]=F.useState("idle"),i=F.useRef(null);F.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=F.useCallback(async()=>{const d=e.current;if(d){n("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(f=>window.requestAnimationFrame(()=>f()));try{await Ir(d),n("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>n("idle"),1500)}catch(f){n("idle"),r({title:"Copy failed",description:f instanceof Error&&f.message?f.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),c=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return a.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[a.jsx(xt,{name:"copy",size:11}),c]})};function Ar({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:n}){const i=F.useRef(null),{isInitialFilteredViewLoading:l,chartPoints:c,activeMetric:d,allowedMetrics:f,orderedMetrics:x,parameterBound:u}=e;return l||c.length===0?null:a.jsxs("div",{className:"bm-card",ref:i,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:t})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),a.jsxs("div",{className:"bm-card-actions",children:[f.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:d,onChange:h=>n(h.target.value),children:x.map(h=>a.jsx("option",{value:h,children:h},h))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!r,onCheckedChange:h=>{s(!h)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),a.jsx(nt,{targetRef:i,label:"SOTA chart"})]})]}),a.jsx("div",{className:"bm-chart-wrap",children:a.jsx(Dt,{points:c,metric:d})}),a.jsxs("div",{className:"bm-chart-foot",children:[a.jsx("span",{className:"legend-dot"}),u===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]})}function Br(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function ze(e,t){return e?a.jsx(oe,{title:e}):t||"—"}const ia=()=>{var ve,je,_e,Se,ke,Ce,Ee,Ne,Re,Pe,$e;const{datasetSlug:e}=dt(),[t,r]=ut(),s=t.get("task")||void 0,n=t.get("eval")||void 0,i=St(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:c}=mt(),d=F.useRef(null),f=F.useRef(!1),x=F.useRef(null),[u,h]=F.useState(null),R=`${e}:${s||""}`,E=u===R,[L,S]=F.useState(1),g=te({queryKey:["dataset",e,"with-paper",s,l.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:s,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),k=te({queryKey:["dataset-evals",(ve=g.data)==null?void 0:ve.id],queryFn:()=>gt.byDataset(g.data.id),enabled:!!((je=g.data)!=null&&je.id),staleTime:5*60*1e3}),B=te({queryKey:["dataset-tasks",(_e=g.data)==null?void 0:_e.id],queryFn:()=>re.datasetTasks(g.data.id),enabled:!!((Se=g.data)!=null&&Se.id),staleTime:10*60*1e3}),j=te({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),D=Qe(B.data||[],k.data||[],s,n),W=te({queryKey:["task-benchmark-trends",D,l.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(D,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!D&&!!((ke=g.data)!=null&&ke.id),staleTime:10*60*1e3}),w=F.useMemo(()=>{var b;return(((b=W.data)==null?void 0:b.results)||[]).find(M=>{var T;return M.id===((T=g.data)==null?void 0:T.id)})||null},[W.data,(Ce=g.data)==null?void 0:Ce.id]),q=te({queryKey:["leaderboard-metrics",(Ee=g.data)==null?void 0:Ee.id,D],queryFn:()=>re.leaderboardMetrics(g.data.id,D),enabled:!!((Ne=g.data)!=null&&Ne.id)&&!!D,staleTime:10*60*1e3}),I=Tt({evaluations:k.data||[],tasks:B.data||[],configuredMetrics:q.data||[],directions:j.data,initialSummary:(Re=g.data)==null?void 0:Re.leaderboard_summary,taskSlug:s,highlightEvalId:n,metric:t.get("metric")||void 0,hideClosed:l.hide_closed_source_evals,parameterBound:i,showMoreMetrics:E,fittingMetricCount:L,ready:{evaluations:k.isSuccess,tasks:B.isSuccess,directions:j.isSuccess,metrics:q.isSuccess}}),{primaryTask:N,hiddenClosedEvals:Q,hiddenClosedTopEval:z,isSummaryLoading:ee,displayedMetric:O,displayedSota:$,displayedSotaModel:U,isInitialFilteredViewLoading:K,highlightedEval:_,hasParameterMetadata:X,parameterCoverage:Y,orderedMetrics:o}=I;F.useEffect(()=>{if(f.current||!n||!k.data||k.data.length===0)return;const b=d.current;b&&(f.current=!0,b.scrollIntoView({behavior:"smooth",block:"start"}))},[n,k.data]);const m=te({queryKey:["area",N==null?void 0:N.area_id],queryFn:()=>re.getArea(N.area_id),enabled:!!(N!=null&&N.area_id),staleTime:10*60*1e3});if(g.isLoading)return a.jsxs("div",{className:"page",children:[a.jsx(ce,{className:"h-12 w-1/2 mb-6"}),a.jsx(ce,{className:"h-64 w-full"})]});if(g.error||!g.data)return a.jsx("div",{className:"page",children:a.jsx(bt,{variant:"destructive",children:a.jsx(yt,{children:"Benchmark not found."})})});const p=g.data,y=!!p.supports_harness,P=b=>{r(M=>{const T=new URLSearchParams(M);return b===void 0?T.delete("max_parameters_exclusive"):T.set("max_parameters_exclusive",String(b)),T})},C=b=>{r(M=>{const T=new URLSearchParams(M);return T.set("metric",b),T})},v=p.introducing_paper??void 0,H=(v==null?void 0:v.arxiv_id)||(v==null?void 0:v.id)||Br(p.paper_url),J=(v==null?void 0:v.title)||p.introducing_paper_title||null,G=((Pe=v==null?void 0:v.published)==null?void 0:Pe.slice(0,4))||p.introduced_year||null,it=!!H||!!p.paper_url||!!J,lt=v!=null&&v.arxiv_id||($e=p.paper_url)!=null&&$e.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${H}`:`Paper ${H}`;return a.jsx("div",{className:"page",children:a.jsxs("div",{className:"bm-page",children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(ne,{to:"/tasks",children:"Tasks"}),m.data&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks#area-${jt(m.data.name)}`,children:m.data.name})]}),N&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks/${N.slug||N.id}`,children:N.name})]}),a.jsx("span",{className:"sep",children:"/"}),a.jsx("span",{style:{color:"var(--accent-text)"},children:p.name})]}),a.jsxs("div",{className:"bm-title-row",children:[a.jsx("h1",{className:"bm-title",children:p.name}),w&&a.jsxs("div",{className:"bm-title-trend","aria-label":`${p.name} reporting trend`,children:[a.jsx(wt,{history:w.history,benchmarkName:w.name}),a.jsxs("span",{className:"bm-title-trend-summary",children:[a.jsx("strong",{children:w.recent_paper_count})," ",w.recent_paper_count===1?"paper":"papers",w.rate_change==null?w.recent_paper_count>0&&a.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):a.jsxs("span",{className:`benchmark-trend-change ${w.rate_change>=1?"is-up":"is-down"}`,children:[w.rate_change>=1?"↑":"↓"," ",w.rate_change.toFixed(1),"×"]})]})]})]}),a.jsx(ht,{kind:"benchmark",entityId:p.id}),a.jsxs("div",{className:"bm-subtitle",children:[ee?a.jsx(ce,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):a.jsxs("span",{children:[O&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"metric-tag",children:O}),a.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),U?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:le($)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:U})]}):a.jsxs("span",{children:[I.rows.length," evaluations"]})]}),p.hf_url&&a.jsxs("a",{className:"bm-action-btn",href:p.hf_url,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),p.description&&a.jsx("p",{className:"bm-description",children:p.description}),l.hide_closed_source_evals&&Q.length>0&&a.jsxs("div",{className:"bm-hidden-closed-notice",children:[a.jsxs("span",{children:[Q.length," closed-source ",Q.length===1?"row is":"rows are"," hidden",z!=null&&z.model_name?a.jsxs(a.Fragment,{children:[", including ",a.jsx("strong",{children:z.model_name})]}):null,"."]}),a.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{c(!1)},children:"Show closed-source"})]}),it&&a.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[a.jsx("span",{className:"method-source-label",children:"Source"}),H?a.jsxs(ne,{to:`/paper/${H}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(oe,{title:J}):lt}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):p.paper_url?a.jsxs("a",{href:vt(p.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(oe,{title:J}):p.paper_url}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):a.jsxs("div",{className:"method-source-link is-static",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(oe,{title:J}):null}),G&&a.jsx("span",{className:"method-source-meta",children:G})]})]}),a.jsx(Ar,{model:I,datasetName:p.name,hideClosed:l.hide_closed_source_evals,setHideClosed:c,setMetric:C}),_&&(()=>{var Te,Fe;const b=_.paper_arxiv_id||_.paper_id,M=_.paper_title||(_.paper_arxiv_id?`arXiv:${_.paper_arxiv_id}`:null),T=_.best_metric&&((Te=_.metrics)==null?void 0:Te[_.best_metric])!==void 0?_.best_metric:I.activeMetric,Me=(Fe=_.metrics)==null?void 0:Fe[T];return a.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[a.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),a.jsxs("div",{className:"bm-highlight-text",children:[a.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),a.jsxs("span",{className:"bm-highlight-paper",children:[_.model_name||M||"—",_.harness?` · ${_.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Me!==void 0&&T?a.jsxs(a.Fragment,{children:[T,": ",le(Me),M?" · ":""]}):null,b?a.jsx(ne,{to:`/paper/${b}`,children:ze(_.paper_title,M)}):ze(_.paper_title,M)]})]})]})})(),a.jsxs("div",{className:"bm-card",ref:x,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:p.name})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),a.jsxs("div",{className:"bm-card-actions",children:[I.allowedMetrics.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:I.activeMetric,onChange:b=>C(b.target.value),children:o.map(b=>a.jsx("option",{value:b,children:b},b))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:b=>{c(!b)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!K&&!X&&k.isSuccess?a.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,a.jsx(nt,{targetRef:x,label:"leaderboard"})]})]}),!K&&X&&a.jsxs("div",{className:"bm-parameter-filter-bar",children:[a.jsx("span",{className:"bm-parameter-filter-label",children:"Parameters Size"}),a.jsx("div",{className:"bm-parameter-filter-options",role:"group","aria-label":"Filter leaderboard by parameter size",children:I.parameterFilters.map(b=>{const{selected:M,disabled:T}=b;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${M?" is-active":""}`,"aria-pressed":M,disabled:T,onClick:()=>P(b.maxParametersExclusive),children:b.label},b.label)})}),a.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",Y.parameter_coverage_known," of ",Y.parameter_coverage_total," entries"]})]}),k.isLoading||K?a.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((b,M)=>a.jsx(ce,{className:"h-10 w-full mb-2"},M))}):I.rows.length===0?i?a.jsxs("div",{className:"no-results",children:["No known parameter counts match this filter. "," ",a.jsx("button",{type:"button",className:"bm-empty-filter-action",onClick:()=>P(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[o.length>L&&a.jsxs("div",{className:"bm-metric-columns-control",children:[a.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":E,"aria-controls":"benchmark-leaderboard",onClick:()=>h(E?null:R),children:E?"Show fewer metrics":`Show more metrics (${o.length-L})`}),E&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(At,{model:I,showHarness:y,setMetric:C,highlightRowRef:d,onFittingMetricCountChange:S})]})]})]})})};export{ia as default}; diff --git a/assets/BenchmarkTrendSparkline-g8mg75No.js b/assets/BenchmarkTrendSparkline-CT9c4wG-.js similarity index 97% rename from assets/BenchmarkTrendSparkline-g8mg75No.js rename to assets/BenchmarkTrendSparkline-CT9c4wG-.js index 1f6a4cd3c0c2bb35b31442493fd25d0b2aaab5c2..b0fa889780d2700fed0d3e66f146680bd9307df4 100644 --- a/assets/BenchmarkTrendSparkline-g8mg75No.js +++ b/assets/BenchmarkTrendSparkline-CT9c4wG-.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-CA09r0fx.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-DGz7IJy3.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/ChatView-BWOmR-sr.js b/assets/ChatView-BWOmR-sr.js new file mode 100644 index 0000000000000000000000000000000000000000..2fd13aeec5a6fa3454a7c6552823f1ec8338253b --- /dev/null +++ b/assets/ChatView-BWOmR-sr.js @@ -0,0 +1,11 @@ +var br=Object.defineProperty;var wr=(t,e,r)=>e in t?br(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Z=(t,e,r)=>wr(t,typeof e!="symbol"?e+"":e,r);import{r as d,A as zt,W as vr,j as a,X as Sr,h as Gt,F as ot,a as Qt,u as xr,b as Rr,d as Er,m as Tr,Y as Cr,L as Nt,f as kr}from"./index-DGz7IJy3.js";import{u as ze}from"./useQuery-SnJNmisF.js";import{C as Ir,U as Mt,b as Ar,f as We,c as Or,g as jr,A as Dr,a as Nr}from"./ArtifactWorkspace-DI-cB4-t.js";import{c as qe}from"./chat-C_06RcUY.js";import{e as Mr,f as Jt,h as Lr,T as Fr,d as Xt,i as qr,j as Pr,k as Yr,l as Ge,m as Br,t as Lt,n as mt,o as Zt,r as Wr,s as Hr,S as Ur,a as Kr,D as ct,v as $r,w as Vr,x as st,y as et,z as zr,B as Gr,E as tt,F as rt,G as Qr,H as Jr,I as Xr,J as lt,K as Zr}from"./chatLaunch-DVedsuWi.js";import{M as es,S as ts}from"./chatPrompts-BwvjFuiO.js";import{S as rs}from"./share-2-Byoooou-.js";import{u as ss,O as ns}from"./openrouter-yE0IuBaT.js";import{q as er}from"./queryOptions-C9woPjwX.js";/* empty css */import"./hover-card-32Q2qmuv.js";import"./github-BBO8LC-h.js";import"./github-DcSqeKOx.js";import"./file-text-BHDe9k9N.js";import"./catalog-CI50zqwR.js";import"./PaperPreviewLink-DUJYnY2B.js";import"./index-DyDOGuaE.js";import"./index-CEcXuWDB.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-CgK5TA59.js";import"./useMutation-B1oRtfbH.js";import"./copy-CDHIGRQI.js";import"./thumbs-up-C5Gnbt6N.js";import"./external-link-ChfVBxLK.js";import"./chevron-down-CzLvLwcd.js";import"./earth-BQV4xejs.js";import"./AgentLogos-RDfL-mz2.js";function as(t){const[e,r]=d.useState("calc(100dvh - 60px)");return d.useLayoutEffect(()=>{if(!t)return;const s=document.querySelector(".app-header"),i=window.visualViewport,c=()=>{const n=(i==null?void 0:i.height)??window.innerHeight;r(`${Math.max(0,n-((s==null?void 0:s.offsetHeight)??0))}px`)};c();const p=new ResizeObserver(c);return s&&p.observe(s),i==null||i.addEventListener("resize",c),window.addEventListener("resize",c),()=>{p.disconnect(),i==null||i.removeEventListener("resize",c),window.removeEventListener("resize",c)}},[t]),t?e:"100%"}const me=(t,e)=>new Promise(r=>{const s=setTimeout(i,t);function i(){e==null||e.removeEventListener("abort",i),clearTimeout(s),r()}e==null||e.addEventListener("abort",i)}),ke=t=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...t}),Ie={name:"Object Detection",slug:"object-detection"},Le={name:"Real-Time Object Detection",slug:"real-time-object-detection"},is={"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:ke({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[Ie,Le],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:ke({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[Ie,Le],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:ke({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:[Ie,Le],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:ke({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[Ie,Le],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:ke({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:[Ie,Le],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:ke({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:[Ie,Le],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:ke({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"},Ie],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:ke({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[Ie,Le],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},tr=t=>t.map(e=>is[e]),Ft=tr(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),qt=tr(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),Pt="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.",Yt="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.",Bt=`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.`,os=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*cs(t,e){const r=()=>(e==null?void 0:e.aborted)===!0,s=t.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 me(350,e),!r()){yield{type:"reasoning_start"};for(let i=0;i{const e=String("0").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"},ls=()=>!0;class Ue extends Error{constructor(e,r,s,i){super(e),this.code=r,this.status=s,this.retryAfterSeconds=i,this.name="ChatStreamError"}}class nt extends Error{constructor(e="The assistant stream was interrupted."){super(e),this.name="ChatTransportError"}}function us(t,e){if(Pe())try{qe.reportLatency(t,e).catch(()=>{})}catch{}}function ds(t,e={}){return Pe()?fs(t,e):cs(t.message,e.signal)}function rr(t,e={}){return ps(t,e)}async function*fs(t,e){try{const r=await qe.stream(t,e.signal);yield*nr(r,e)}catch(r){throw sr(r)}}async function*ps(t,e){try{const r=await qe.resumeStream(t,e.signal,e.afterSequence);yield*nr(r,e)}catch(r){throw sr(r)}}function sr(t){return t instanceof Ue||t instanceof nt?t:t instanceof SyntaxError?new Ue("The assistant returned an invalid stream event.","invalid_stream_event"):new nt(t instanceof Error?t.message:"The assistant stream was interrupted.")}function hs(t){let e=null,r="message";const s=[];for(const i of t.split(` +`))if(i.startsWith("id:")){const c=i.slice(3).trim();/^[1-9]\d*$/.test(c)&&(e=Number(c))}else i.startsWith("event:")?r=i.slice(6).trimStart():i.startsWith("data:")&&s.push(i.slice(5).trimStart());return{sequence:e,event:r,data:s.join(` +`)}}async function*nr(t,e){var p;if(!t.ok||!t.body){const n=t.ok?null:new zt(t,await t.text());n&&vr(n);const h=n==null?void 0:n.detail,A=typeof h=="object"&&h!==null?h:null,f=t.status===403&&!h,C=Number(t.headers.get("Retry-After")),k=Number.isFinite(C)&&C>=0?Math.min(300,Math.ceil(C)):void 0;throw new Ue(f?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(n==null?void 0:n.message)||`Chat stream failed (${t.status})`,A&&"code"in A&&typeof A.code=="string"?A.code:f?"staging_access_required":void 0,t.status,k)}const r=t.body.getReader(),s=new TextDecoder;let i="",c=e.afterSequence&&e.afterSequence>0?e.afterSequence:0;try{for(;;){const{done:n,value:h}=await r.read();if(n)break;i+=s.decode(h,{stream:!0});let A;for(;(A=i.indexOf(` + +`))!==-1;){const f=i.slice(0,A);i=i.slice(A+2);const C=hs(f);if(!C.data||C.data==="[DONE]"||C.sequence!==null&&C.sequence<=c)continue;const k=JSON.parse(C.data);C.sequence!==null&&(c=C.sequence,(p=e.onSequence)==null||p.call(e,C.sequence)),yield k}}}finally{r.releaseLock()}}const ms="https://huggingface.co/settings/inference-providers",Wt="pwc.chat.billing-notice-dismissed.v1";function gs({provider:t}){const[e,r]=d.useState(()=>localStorage.getItem(Wt)==="1");return!Pe()||e||t!=="huggingface"?null:a.jsxs("div",{className:"chat-billing-notice",role:"note",children:[a.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),a.jsxs("div",{className:"chat-billing-notice-actions",children:[a.jsx("a",{href:"/settings",children:"Review billing"}),a.jsx("a",{href:ms,target:"_blank",rel:"noreferrer",children:"Review usage"}),a.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(Wt,"1"),r(!0)},children:a.jsx(Sr,{size:15,"aria-hidden":"true"})})]})]})}function Ht({variant:t,composerProps:e,provider:r,sponsored:s=!1,paused:i,error:c,suggestions:p=[]}){var h;const n=a.jsxs(a.Fragment,{children:[!s&&a.jsx(gs,{provider:r}),i&&a.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),c&&a.jsx("div",{className:"chat-composer-error",role:"alert",children:c}),a.jsx(Ir,{...e,...t==="empty"?{autoFocus:!0}:{placeholder:(h=e.draft)!=null&&h.text?"Edit and send again…":"Ask a follow-up…"}}),t==="empty"&&a.jsx("div",{className:"chat-examples",children:p.map(A=>a.jsx("button",{type:"button",className:"chat-example",disabled:i,onClick:()=>{var f;return e.onSend({text:A,paperMentions:[],...(f=e.draft)!=null&&f.paperSelection?{paperSelection:e.draft.paperSelection}:{}})},children:A},A))})]});return t==="empty"?n:a.jsx("div",{className:"chat-composer-wrap",children:a.jsxs("div",{className:"chat-composer-inner",children:[n,a.jsx("div",{className:"chat-composer-foot",children:Pe()?a.jsxs(a.Fragment,{children:[r==="huggingface"&&a.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",a.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),r==="openrouter"&&a.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",a.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}),r==="openai"&&a.jsx("span",{className:"chat-provider-attribution",children:"Powered by OpenAI."}),a.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):a.jsx(a.Fragment,{children:"Assistant preview — responses are simulated."})})]})})}function ys({messages:t,papers:e,busy:r,queuedDraft:s,paperMentionsEnabled:i,archivePending:c,openRouterFallbackEnabled:p,onToggleBlock:n,onEditAndResend:h,onRetryFromProgress:A,onRetryWithLuna:f,onArchiveOld:C,onArchiveOldest:k}){var m,O;const[Y,E]=d.useState(null),M=d.useRef(null),L=d.useRef(null),K=d.useRef("bottom"),$=d.useRef(0),V=d.useRef(0),[se,v]=d.useState(!1),N=d.useRef(null),I=d.useCallback(l=>{K.current=l},[]),w=d.useCallback(()=>{const l=M.current;l&&v(l.scrollHeight-l.scrollTop-l.clientHeight>1)},[]),z=t.filter(l=>l.role==="user"),q=z.length,F=d.useRef(q),Q=d.useRef(!1),te=(m=z[0])==null?void 0:m.id,X=(O=z.at(-1))==null?void 0:O.id;d.useEffect(()=>{r&&E(null)},[r]),d.useLayoutEffect(()=>{const l=M.current;if(l){if(q>F.current||r&&!Q.current){const D=Array.from(l.querySelectorAll("[data-message-id]")).at(-1);if(D){const P=l.getBoundingClientRect().top;$.current=l.scrollTop+D.getBoundingClientRect().top-P-24,I("question")}}if(F.current=q,Q.current=r,L.current!==null){l.scrollTop=L.current,L.current=null;return}K.current==="bottom"&&(l.scrollTop=l.scrollHeight),K.current==="question"&&(l.scrollTop=$.current,V.current=l.scrollTop)}},[t,q,r,I]),d.useLayoutEffect(w),d.useEffect(()=>{const l=M.current;if(!l)return;const D=new ResizeObserver(w);return D.observe(l),l.firstElementChild&&D.observe(l.firstElementChild),()=>D.disconnect()},[w]);const J=(l,D)=>{var P;L.current=((P=M.current)==null?void 0:P.scrollTop)??null,n(l,D)};return a.jsxs("div",{className:"chat-conversation-viewport",children:[a.jsx("div",{className:"chat-conversation",ref:M,tabIndex:0,role:"region","aria-label":"Conversation",onWheel:l=>{(l.deltaY<0||K.current==="question")&&I("free")},onTouchStart:l=>{var D;N.current=((D=l.touches[0])==null?void 0:D.clientY)??null},onTouchMove:l=>{var P;const D=(P=l.touches[0])==null?void 0:P.clientY;D!==void 0&&N.current!==null&&(D>N.current||K.current==="question")&&I("free"),N.current=D??null},onKeyDown:l=>{l.target===l.currentTarget&&((["ArrowUp","PageUp","Home"].includes(l.key)||l.key===" "&&l.shiftKey)&&I("free"),["ArrowDown","PageDown","End"," "].includes(l.key)&&K.current==="question"&&I("free"))},onScroll:l=>{const{scrollHeight:D,scrollTop:P,clientHeight:ne}=l.currentTarget,ae=D-P-ne<=1;K.current==="bottom"&&!ae&&I("free");const ge=P-V.current;K.current==="question"&&(ge>1||ge<-1&&!ae)&&I("free"),w()},children:a.jsxs("div",{className:"chat-conversation-inner",children:[t.length===0&&(s==null?void 0:s.text)&&a.jsx(Mt,{id:"queued-launch-preview",text:s.text,paperMentions:s.paperMentions,paperSelection:s.paperSelection,isInitial:!0}),t.map(l=>{var D,P,ne,ae;return l.role==="user"?a.jsx(Mt,{id:l.id,text:l.text??"",paperMentions:l.paperMentions??[],paperSelection:l.paperSelection,paperMentionsEnabled:i,isInitial:l.id===te,editingAllowed:!r&&!!l.revision,editing:Y===l.id,editNotice:l.id===te?"Sending will replace this conversation.":l.id===X?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>E(l.id),onCancel:()=>E(null),onResendDraft:ge=>{const we=h(l.id,ge);return we&&E(null),we}},l.id):a.jsx(Ar,{msg:l,papers:e,onToggleBlock:J,onRetryCompaction:!r&&l.id===((D=t.at(-1))==null?void 0:D.id)&&((P=z.at(-1))!=null&&P.revision)?A:void 0,onRetryWithLuna:!r&&l.id===((ne=t.at(-1))==null?void 0:ne.id)&&((ae=z.at(-1))!=null&&ae.revision)?f:void 0,onArchiveOldChats:C,onArchiveOldestChats:k,archivePending:c,hfBilling:null,openRouterFallbackEnabled:p,feedbackEnabled:!0},l.id)})]})}),se&&a.jsx("button",{type:"button",className:"chat-jump-latest",onClick:()=>{I("bottom");const l=M.current;l&&(l.focus({preventScroll:!0}),l.scrollTop=l.scrollHeight,w())},children:"Jump to latest"})]})}function _s({retryAt:t,onRetry:e,onCancel:r}){const[s,i]=d.useState(()=>Math.max(0,Math.ceil((t-Date.now())/1e3))),c=d.useRef(null);return d.useEffect(()=>{var A;const p=document.activeElement instanceof HTMLElement?document.activeElement:null;(A=c.current)==null||A.focus();const n=()=>i(Math.max(0,Math.ceil((t-Date.now())/1e3)));n();const h=window.setInterval(n,250);return()=>{window.clearInterval(h),p==null||p.focus()}},[t]),a.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:a.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),r())},children:[a.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),a.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),a.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:s>0?`Try again available in ${s} second${s===1?"":"s"}.`:"You can try again now."}),a.jsxs("div",{className:"chat-capacity-dialog-actions",children:[a.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:c,onClick:r,children:"Cancel"}),a.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:s>0,onClick:e,children:"Try again"})]})]})})}function bs({onClose:t}){const e=d.useRef(null);return d.useEffect(()=>{var s;const r=document.activeElement instanceof HTMLElement?document.activeElement:null;return(s=e.current)==null||s.focus(),()=>r==null?void 0:r.focus()},[]),a.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:a.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:r=>{r.key==="Escape"&&(r.preventDefault(),t())},children:[a.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),a.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),a.jsx("div",{className:"chat-capacity-dialog-actions",children:a.jsx("button",{ref:e,type:"button",className:"chat-capacity-cancel",onClick:t,children:"Keep editing"})})]})})}function ws({url:t,onClose:e}){return t?a.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:e,children:a.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:r=>r.stopPropagation(),children:[a.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),a.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),a.jsx("input",{readOnly:!0,value:t,"aria-label":"Public conversation link",autoFocus:!0,onFocus:r=>r.currentTarget.select()}),a.jsx("button",{type:"button",onClick:e,children:"Close"})]})}):null}const ut="pwc:chat:sidebar-width",dt=280,ft=200,pt=480,vs=12,ht=t=>Math.max(ft,Math.min(pt,t)),Ss=()=>{if(typeof window>"u")return dt;const t=Number(localStorage.getItem(ut));return Number.isFinite(t)&&t>0?ht(t):dt};function xs({sessions:t,activeSessionId:e,loading:r,error:s,open:i,onClose:c,onNew:p,onNavigate:n,onRename:h,onDelete:A}){const[f,C]=d.useState(Ss),k=d.useRef(null),Y=d.useRef(f),[E,M]=d.useState(null),[L,K]=d.useState(""),[$,V]=d.useState(null),[se,v]=d.useState(!1),N=[...t].sort((m,O)=>Date.parse(O.updated_at)-Date.parse(m.updated_at)),I=N.filter((m,O)=>O{if(!$)return;const m=()=>V(null),O=l=>{l.key==="Escape"&&m()};return window.addEventListener("click",m),window.addEventListener("keydown",O),()=>{window.removeEventListener("click",m),window.removeEventListener("keydown",O)}},[$]);const q=m=>{M(m.id),K(m.title)},F=async m=>{const O=L.trim();O&&await h(m,O)&&M(null)},Q=(m,O,l)=>V({id:m,x:O,y:l}),te=m=>{if(!k.current)return;const O=ht(k.current.width+m-k.current.x);Y.current=O,C(O)},X=()=>{k.current&&(k.current=null,localStorage.setItem(ut,String(Y.current)))},J=m=>{const O=ht(m);Y.current=O,C(O),localStorage.setItem(ut,String(O))};return a.jsxs("aside",{className:`chat-sidebar${i?"":" chat-sidebar-closed"}`,style:{"--chat-sidebar-width":`${f}px`},children:[a.jsxs("div",{className:"chat-sidebar-top",children:[a.jsxs("button",{type:"button",className:"chat-new-chat",onClick:()=>{We()&&p()},children:[a.jsx(Mr,{})," New chat"]}),a.jsx("button",{type:"button",className:"icon-btn",onClick:c,title:"Collapse sidebar",children:a.jsx(Jt,{})})]}),a.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[r&&a.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!r&&s&&a.jsx("div",{className:"chat-sessions-empty",children:s}),!r&&!s&&t.length===0&&a.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Lr(w).map(m=>a.jsxs("div",{className:"chat-session-group",children:[a.jsx("div",{className:"chat-session-group-label",children:m.label}),m.items.map(O=>a.jsxs("div",{className:`chat-session${O.id===e?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>{We()&&n(O.id)},onKeyDown:l=>{if(l.key==="Enter"&&We()&&n(O.id),l.key==="F2"&&q(O),l.key==="ContextMenu"||l.shiftKey&&l.key==="F10"){l.preventDefault();const D=l.currentTarget.getBoundingClientRect();Q(O.id,D.right-150,D.bottom)}},onContextMenu:l=>{l.preventDefault(),Q(O.id,l.clientX,l.clientY)},children:[E===O.id?a.jsx("input",{className:"chat-session-title-input",value:L,autoFocus:!0,maxLength:80,onClick:l=>l.stopPropagation(),onChange:l=>K(l.target.value),onBlur:()=>void F(O.id),onKeyDown:l=>{l.stopPropagation(),l.key==="Enter"&&F(O.id),l.key==="Escape"&&M(null)}}):a.jsx("span",{className:"chat-session-title",children:O.title}),a.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:l=>{l.stopPropagation();const D=l.currentTarget.getBoundingClientRect();Q(O.id,D.right-150,D.bottom)},children:"⋯"}),a.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:l=>{l.stopPropagation(),We()&&A(O.id)},children:a.jsx(Fr,{})})]},O.id))]},m.label)),z>0&&a.jsx("button",{type:"button",className:"chat-sessions-toggle","aria-expanded":se,onClick:()=>v(m=>!m),children:se?"Show less":`Show ${z} older ${z===1?"chat":"chats"}`})]}),a.jsx(es,{className:"chat-sidebar-tools",canNavigate:We}),a.jsx("div",{className:"chat-sidebar-resize-handle",role:"separator","aria-label":"Resize chat history","aria-orientation":"vertical","aria-valuemin":ft,"aria-valuemax":pt,"aria-valuenow":f,title:"Drag to resize; double-click to reset",tabIndex:0,onPointerDown:m=>{m.button===0&&(k.current={x:m.clientX,width:f},Y.current=f,m.currentTarget.setPointerCapture(m.pointerId))},onPointerMove:m=>te(m.clientX),onPointerUp:X,onPointerCancel:X,onLostPointerCapture:X,onDoubleClick:()=>J(dt),onKeyDown:m=>{(m.key==="ArrowLeft"||m.key==="ArrowRight")&&(m.preventDefault(),J(f+(m.key==="ArrowRight"?10:-10))),(m.key==="Home"||m.key==="End")&&(m.preventDefault(),J(m.key==="Home"?ft:pt))}}),$&&a.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:$.x,top:$.y},onClick:m=>m.stopPropagation(),children:a.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const m=t.find(O=>O.id===$.id);m&&q(m),V(null)},children:"Rename chat"})})]})}function Rs({sessionId:t,busy:e,loading:r,hasPaperSelection:s=!1,onError:i}){const{toast:c}=Gt(),[p,n]=d.useState(!1),[h,A]=d.useState(""),f=async()=>{var C;if(!(e||p)&&!(s&&!window.confirm("This public link will include the selected paper passage. Anyone with the link can read that passage. Continue?"))){n(!0);try{const k=await qr(t),Y=new URL(k.public_path,window.location.origin).toString();try{if(!((C=navigator.clipboard)!=null&&C.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(Y),c({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{A(Y)}}catch(k){const Y=k instanceof Error?k.message:"Could not share this conversation";i(Y),c({variant:"destructive",title:"Share failed",description:Y})}finally{n(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void f(),disabled:e||p||r,"aria-label":"Share conversation",children:[p?a.jsx(Xt,{}):a.jsx(rs,{"aria-hidden":"true"}),a.jsx("span",{children:"Share"})]}),a.jsx(ws,{url:h,onClose:()=>A("")})]})}const Es=({descriptor:t})=>{const e=Or(),{open:r,register:s,unregister:i}=e,c=ot.useRef(null),p=t.source_head??t.preview_head,n=ot.useMemo(()=>p?{kind:"artifact",schema_version:1,scope:"owner",artifact_id:t.artifact_id,version_id:p.version_id,identifier:"latex-paper",version:p.version,artifact_kind:"latex_paper",title:t.title,status:"ready",preview_mime:"application/pdf",source_language:"latex",total_bytes:0}:null,[t.artifact_id,t.title,p]),h=n?jr(n):null;return ot.useEffect(()=>{if(!(!n||!h))return s(n),c.current!==h&&(c.current=h,r(n)),()=>i(h)},[n,h,r,s,i]),null};function Ts({messages:t,refreshSessions:e,resetChat:r,restoreDraft:s}){const{toast:i}=Gt(),[c,p]=d.useState(null),n=()=>{const f=[...t].reverse().find(C=>C.role==="user");r(),s({text:(f==null?void 0:f.text)??"",paperMentions:(f==null?void 0:f.paperMentions)??[],...f!=null&&f.paperSelection?{paperSelection:f.paperSelection}:{}})};return{pending:c,archiveOld:async()=>{if(c===null){p("old");try{const f=await Yr();if(await e(),f.archived_count===0){i({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}n(),i({title:`${f.archived_count} ${f.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(f){i({variant:"destructive",title:"Could not archive old chats",description:f instanceof Error?f.message:"Try again."})}finally{p(null)}}},archiveOldest:async()=>{if(c===null){p("oldest");try{const f=await Pr();await e(),n(),i({title:`${f.archived_count} ${f.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(f){i({variant:"destructive",title:"Could not archive chats",description:f instanceof Error?f.message:"Try again."})}finally{p(null)}}}}}class Cs{constructor(e,r=us){Z(this,"requestId");Z(this,"firstVisibleAt");Z(this,"streamStartReported",!1);Z(this,"firstVisibleReported",!1);Z(this,"terminalReported",!1);Z(this,"semanticReported",new Set);this.submittedAt=e,this.report=r}recordStreamStart(e,r){this.requestId=e,this.streamStartReported||(this.streamStartReported=!0,this.send({submission_to_stream_start_ms:Math.max(0,r-this.submittedAt)})),this.reportFirstVisible()}recordFirstVisible(e){this.firstVisibleAt===void 0&&(this.firstVisibleAt=e,this.reportFirstVisible())}recordSemantic(e,r){if(this.semanticReported.has(e))return;this.semanticReported.add(e);const s=Math.max(0,r-this.submittedAt);this.send(e==="reasoning"?{submission_to_first_reasoning_delta_ms:s}:e==="tool"?{submission_to_first_tool_call_ms:s}:{submission_to_first_answer_delta_ms:s})}recordTerminal(e){this.terminalReported||(this.terminalReported=!0,this.send({terminal_classification:e}))}reportFirstVisible(){!this.requestId||this.firstVisibleAt===void 0||this.firstVisibleReported||(this.firstVisibleReported=!0,this.send({submission_to_first_visible_delta_ms:Math.max(0,this.firstVisibleAt-this.submittedAt)}))}send(e){this.requestId&&this.report(this.requestId,e)}}const ar="Preparing research workspace…",ir={preparing_workspace:"Preparing secure workspace…",starting_agent:"Starting research agent…",connecting_model:"Connecting to model…"},or=()=>({messages:[],sessionId:null,title:"",phase:"idle"});function Ut(t,e){for(let r=t.length-1;r>=0;r-=1)if(e(t[r]))return r;return-1}function je(t){if(t.status!==ar&&!Object.values(ir).includes(t.status))return t;const{status:e,...r}=t;return r}function ee(t,e){if(!t.length)return t;const r=t.slice();return r[r.length-1]=e(r[r.length-1]),r}function Fe(t,e,r){return ee(t,s=>{const i=je(s),c=i.blocks??[];return{...i,blocks:c.map((p,n)=>e(p,n,c)?r(p):p)}})}function ks(t,e){switch(e.type){case"stream_start":return e.session_id?{...t,sessionId:e.session_id}:t;case"sandbox_start":case"sandbox_ready":case"workspace_ready":return t;case"lifecycle":return{...t,messages:ee(t.messages,r=>{var s;return r.role==="assistant"&&r.streaming&&(((s=r.blocks)==null?void 0:s.length)??0)===0?{...r,status:ir[e.phase]}:r})};case"session_title_start":return{...t,title:""};case"session_title_delta":return{...t,title:`${t.title}${e.text}`.replace(/\s+/g," ").slice(0,80)};case"session_title_done":return{...t,title:e.title};case"compaction_status":return{...t,messages:ee(t.messages,r=>({...r,compacting:!!(r.streaming&&e.state==="started")}))};case"reasoning_start":return{...t,messages:ee(t.messages,r=>{const s=je(r);return{...s,blocks:[...(s.blocks??[]).map(i=>i.kind==="reasoning"&&i.active?{...i,active:!1,open:!1}:i),{kind:"reasoning",text:"",active:!0,open:!0}]}})};case"reasoning_delta":return{...t,messages:Fe(t.messages,(r,s,i)=>r.kind==="reasoning"&&Ut(i,c=>c.kind==="reasoning")===s,r=>r.kind==="reasoning"?{...r,text:r.text+e.text}:r)};case"reasoning_end":return{...t,messages:ee(t.messages,r=>{const s=r.blocks??[],i=Ut(s,n=>n.kind==="reasoning"&&n.active);if(i<0)return r;const c=s[i];if(c.kind!=="reasoning")return r;const p=s[i-1];return(p==null?void 0:p.kind)==="reasoning"&&p.text===c.text?{...r,blocks:s.filter((n,h)=>h!==i)}:{...r,blocks:s.map((n,h)=>h===i?{...c,active:!1,open:!1}:n)}})};case"tool_call":return{...t,messages:ee(t.messages,r=>{const s=je(r);return{...s,blocks:[...s.blocks??[],{kind:"tool",id:e.id,name:e.name,args:e.args,status:"running",open:!1}]}})};case"tool_call_start":return{...t,messages:ee(t.messages,r=>{const s=je(r);return{...s,blocks:[...s.blocks??[],{kind:"tool",schema_version:2,id:e.id,name:e.name,args:{},argumentText:"",argumentState:"streaming",arguments_redacted:e.redacted,status:"running",open:!1}]}})};case"tool_call_arguments_delta":return{...t,messages:Fe(t.messages,r=>r.kind==="tool"&&r.id===e.id,r=>r.kind==="tool"?{...r,args:e.partial_args,argumentText:e.snapshot?e.delta:`${r.argumentText??""}${e.delta}`,arguments_redacted:r.arguments_redacted||e.redacted}:r)};case"tool_call_arguments_done":return{...t,messages:Fe(t.messages,r=>r.kind==="tool"&&r.id===e.id,r=>r.kind==="tool"?{...r,args:e.args,argumentText:JSON.stringify(e.args),argumentState:"done",arguments_redacted:r.arguments_redacted||e.redacted}:r)};case"app_start":return{...t,messages:ee(t.messages,r=>{const s=je(r);return{...s,blocks:[...s.blocks??[],{kind:"app",schema_version:1,instance_id:e.instance_id,provider:e.provider,server:e.server,tool:e.tool,resource_uri:e.resource_uri,status:"loading",input:e.input,result:{content:[],structuredContent:{},isError:!1},csp:{},permissions:{clipboardWrite:!0},height:525}]}})};case"app_result":return{...t,messages:Fe(t.messages,r=>r.kind==="app"&&r.instance_id===e.id,r=>r.kind==="app"?{...r,status:e.status,result:e.result}:r)};case"tool_result":return{...t,messages:Fe(t.messages,r=>r.kind==="tool"&&r.id===e.id,r=>r.kind!=="tool"?r:e.status?{...r,schema_version:2,status:e.status,took_ms:e.took_ms,content:e.content,metadata:e.metadata,open:e.status!=="success"}:{...r,status:"done",hits:e.hits,took_ms:e.took_ms,results:e.results})};case"artifact_start":return{...t,messages:ee(t.messages,r=>{const s=je(r);return{...s,blocks:[...s.blocks??[],{kind:"artifact",schema_version:1,scope:"owner",publication_id:e.publication_id,identifier:e.identifier,artifact_kind:"posterly",title:e.title,status:"generating",phase:"publishing_poster"}]}})};case"artifact_ready":return{...t,messages:Fe(t.messages,r=>r.kind==="artifact"&&r.publication_id===e.publication_id,r=>r.kind==="artifact"?{...r,artifact_id:e.artifact_id,version_id:e.version_id,identifier:e.identifier,version:e.version,title:e.title,status:"ready",preview_mime:e.preview_mime,source_language:e.source_language,gate_status:e.gate_status,total_bytes:e.total_bytes,phase:void 0}:r)};case"artifact_error":return{...t,messages:Fe(t.messages,r=>r.kind==="artifact"&&r.publication_id===e.publication_id,r=>r.kind==="artifact"?{...r,status:"error",phase:void 0,error_code:e.code,error_message:e.message}:r)};case"answer_delta":return{...t,messages:ee(t.messages,r=>{const s=je(r),i=s.blocks??[],c=i.at(-1);return(c==null?void 0:c.kind)==="answer"&&!c.done?{...s,blocks:[...i.slice(0,-1),{...c,text:c.text+e.text}]}:{...s,blocks:[...i,{kind:"answer",text:e.text,done:!1}]}})};case"done":return{...t,phase:"complete",messages:ee(t.messages,r=>({...r,streaming:!1,compacting:!1,followups:e.followups,finishReason:e.finish_reason,citations:e.citations,blocks:(r.blocks??[]).map(s=>s.kind==="answer"?{...s,done:!0}:s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}))};case"error":return{...t,phase:"failed",messages:ee(t.messages,r=>({...r,streaming:!1,compacting:!1,error:e.message,errorCode:e.code,blocks:(r.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s.kind==="tool"&&s.status==="running"?{...s,status:"error",open:!0}:s)}))};default:return t}}function Is(t){return ee(t,e=>{if(e.role!=="assistant")return e;const r=(e.blocks??[]).flatMap(s=>s.kind==="tool"&&s.status==="running"?[{...s,status:"error",open:!0}]:s.kind==="reasoning"&&s.active?s.text?[{...s,active:!1,open:!1}]:[]:s.kind==="answer"?[{...s,done:!0}]:[s]);return{...e,blocks:r,streaming:!1,compacting:!1,finishReason:"stopped"}})}function As(t,e){switch(e.type){case"start":return{messages:e.messages,sessionId:e.sessionId,title:"",phase:"streaming"};case"event":return ks(t,e.event);case"load":return{messages:e.messages,sessionId:e.sessionId,title:t.title,phase:"idle"};case"workspace_status":return{...t,messages:ee(t.messages,r=>{var s;return r.role==="assistant"&&r.streaming&&(((s=r.blocks)==null?void 0:s.length)??0)===0&&!r.error?{...r,status:ar}:r})};case"clear_workspace_status":return{...t,messages:ee(t.messages,je)};case"settle":return{...t,phase:"idle",messages:ee(t.messages,r=>r.streaming?{...r,streaming:!1,compacting:!1}:r)};case"stop":return{...t,messages:Is(t.messages),phase:"stopped"};case"toggle_block":return{...t,messages:cr(t.messages,e.messageId,e.blockIndex)};case"reset":return or()}}function cr(t,e,r){return t.map(s=>{var i;return s.id!==e?s:{...s,blocks:(i=s.blocks)==null?void 0:i.map((c,p)=>p===r&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}})}const Oe={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},Os={now:()=>performance.now(),sleep:(t,e)=>new Promise(r=>{if(e!=null&&e.aborted||t<=0){r();return}const s=window.setTimeout(i,t);function i(){e==null||e.removeEventListener("abort",i),window.clearTimeout(s),r()}e==null||e.addEventListener("abort",i,{once:!0})})};function js(t){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(t.type)}function Ds(t,e=!1,r=Oe.maxPendingChars){var i;if(!t)return{pieces:[],pending:""};if(e)return{pieces:[t],pending:""};const s=Intl.Segmenter;if(s){const p=[...new s(void 0,{granularity:"word"}).segment(t)].filter(h=>h.isWordLike);let n=0;if(p.length>1&&(n=p.at(-1).index),p.length&&/\s$/u.test(t)&&(n=t.length),n>0){const h=t.slice(0,n),A=[],C=[...new s(void 0,{granularity:"word"}).segment(h)].filter(k=>k.isWordLike);for(let k=0;kY&&A.push(h.slice(Y,E))}return C.length||A.push(h),{pieces:A,pending:t.slice(n)}}}else{const c=[...t.matchAll(/\s+/gu)];if(c.length){const p=[];let n=0;for(const h of c){const A=h.index+h[0].length;p.push(t.slice(n,A)),n=A}return{pieces:p,pending:t.slice(n)}}}return t.length>=r?{pieces:[t.slice(0,r)],pending:t.slice(r)}:{pieces:[],pending:t}}function Ns(t,e={}){const r={minDelayMs:e.minDelayMs??Oe.minDelayMs,maxDelayMs:e.maxDelayMs??Oe.maxDelayMs,minRateCharsPerMs:e.minRateCharsPerMs??Oe.minRateCharsPerMs,maxBufferedMs:e.maxBufferedMs??Oe.maxBufferedMs,arrivalRateTauMs:e.arrivalRateTauMs??Oe.arrivalRateTauMs,arrivalRateHeadroom:e.arrivalRateHeadroom??Oe.arrivalRateHeadroom,maxPendingChars:e.maxPendingChars??Oe.maxPendingChars},s=e.clock??Os,i=[];let c="",p=null,n=0,h=!0,A=!1,f=null,C=0,k=s.now(),Y=!1;const E=()=>{f==null||f(),f=null},M=(v,N)=>{const I=v.type==="reasoning_delta"||v.type==="answer_delta"?v.text.length:0;i.push({kind:"event",event:v,arrivedAt:N,chars:I}),E()},L=v=>{if(!p||!c)return;const N=Ds(c,v,r.maxPendingChars);for(const I of N.pieces)I&&M({type:p,text:I},n),n=s.now();c=N.pending,c||(p=null)},K=v=>{if(!h)return;const N=s.now();if(v.type==="reasoning_delta"||v.type==="answer_delta"){const I=v.type;if(!v.text)return;if(!Y){Y=!0,C+=v.text.length,k=N;const z=Array.from(v.text)[0];M({type:I,text:z},N);const q=v.text.slice(z.length);if(q)for(p=I,c=q,n=N,L(!1);c.length>=r.maxPendingChars;)L(!1);return}p&&p!==I&&L(!0),p||(p=I,n=N),c+=v.text;const w=Math.max(0,N-k);for(C*=Math.exp(-w/r.arrivalRateTauMs),C+=v.text.length,k=N,L(!1);c.length>=r.maxPendingChars;)L(!1);return}js(v)&&L(!0),M(v,N)},$=(async()=>{var v;try{for await(const N of t)K(N);h&&L(!0)}catch(N){h&&!((v=e.signal)!=null&&v.aborted)&&(L(!0),i.push({kind:"error",error:N,arrivedAt:s.now(),chars:0}))}finally{A=!0,E()}})(),V=()=>i.length||A?Promise.resolve():new Promise(v=>{f=v});return{events:async function*(){var N,I,w,z;let v=Number.NEGATIVE_INFINITY;try{for(;;){if(await V(),!i.length){if(A||!h)return;continue}const q=i[0];if(q.kind==="error")throw i.shift(),q.error;if(q.chars&&!((N=e.isHidden)!=null&&N.call(e))){const F=s.now(),Q=i.reduce((ne,ae)=>ne+ae.chars,0),te=((I=i.find(ne=>ne.chars))==null?void 0:I.arrivedAt)??F,X=Math.max(0,r.maxBufferedMs-(F-te)),J=C*Math.exp(-Math.max(0,F-k)/r.arrivalRateTauMs)/r.arrivalRateTauMs,m=X>0?Q/X:Number.POSITIVE_INFINITY,O=Math.max(r.minRateCharsPerMs,J*r.arrivalRateHeadroom,m),l=Math.min(r.maxDelayMs,Math.max(r.minDelayMs,q.chars/O)),D=Math.max(0,q.arrivedAt+r.maxBufferedMs-F),P=Math.max(q.arrivedAt,v+Math.min(l,D));if(await s.sleep(Math.max(0,P-s.now()),e.signal),!h||(w=e.signal)!=null&&w.aborted)return}i.shift(),v=s.now(),yield q.event}}finally{h&&(h=!1,E(),await((z=t.return)==null?void 0:z.call(t,void 0))),await $}}(),takeAcceptedForStop(){var N;if(!h)return[];h=!1,p&&c&&(M({type:p,text:c},n),c="",p=null);const v=i.flatMap(I=>I.kind==="event"&&I.event.type!=="done"&&I.event.type!=="error"?[I.event]:[]);return i.length=0,E(),(N=t.return)==null||N.call(t,void 0),v}}}const Kt=[250,500,1e3],Ms=(t,e)=>new Promise(r=>{const s=()=>{window.clearTimeout(i),e.removeEventListener("abort",s),r()},i=window.setTimeout(s,t);e.addEventListener("abort",s,{once:!0})});async function*Ls(t,e){let r=t,s=0;for(;;){let i=!1;try{for await(const c of r)(c.type==="done"||c.type==="error")&&(i=!0),yield c;if(i||e.signal.aborted)return;throw new nt}catch(c){e.onDisconnect();const p=e.getSessionId();if(e.signal.aborted||i||!(c instanceof nt)||!p||s>=Kt.length)throw c;if(await Ms(Kt[s],e.signal),e.signal.aborted)return;s+=1,r=rr(p,{signal:e.signal,afterSequence:e.getAfterSequence(),onSequence:e.onSequence})}}}const $t=new Set(["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"]),Fs=new Set(["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","paper_selection_disabled","paper_selection_requires_reader","paper_selection_paper_mismatch","paper_selection_version_mismatch","paper_selection_page_invalid","paper_selection_too_large","chat_storage_quota_exceeded"]);class qs{constructor(){Z(this,"configuration");Z(this,"lifecycle",or());Z(this,"_busy",!1);Z(this,"_pendingCapacity",null);Z(this,"_sawStreamStart",!1);Z(this,"_providerExecuted",!1);Z(this,"_providerStatusChanged",!1);Z(this,"terminal","pending");Z(this,"rejection",null)}get busy(){return this._busy}get pendingCapacity(){return this._pendingCapacity}get sawStreamStart(){return this._sawStreamStart}get sawTerminalEvent(){return this.terminal==="complete"||this.terminal==="error"}get streamFailed(){return this.terminal==="error"||this.terminal==="transport_error"}get admissionRejected(){return this.rejection!==null}get shouldRefreshProvider(){return this._sawStreamStart&&this._providerExecuted||this._providerStatusChanged}finish(){this._busy=!1}queueCapacity(e){this._pendingCapacity=e}cancelCapacity(){this._pendingCapacity=null}projectSession(e){return this._busy&&e===this.sessionId?this.messages:null}get state(){return this.lifecycle}get messages(){return this.lifecycle.messages}get sessionId(){return this.lifecycle.sessionId}transition(e){return this.lifecycle=As(this.lifecycle,e),this.lifecycle}start(e,r,s){this.configuration=s,this._busy=!0,this._sawStreamStart=this._providerExecuted=this._providerStatusChanged=!1,this.terminal="pending",this.rejection=null,this.transition({type:"start",messages:e,sessionId:r})}restore(e,r=this.sessionId){return this.transition({type:"load",messages:e,sessionId:r})}observe(e){return e.type==="stream_start"&&(this._sawStreamStart=!0,this._providerExecuted=e.provider_execution!==!1),(e.type==="done"||e.type==="error")&&(this.terminal=e.type==="done"?"complete":"error"),e.type==="error"&&$t.has(e.code??"")?(this._providerStatusChanged=!0,!0):!1}reject(e,r){const s=e instanceof Ue?e.code:void 0,i=r&&s==="chat_not_busy"?"completed":s==="chat_temporarily_disabled"?"disabled":s==="chat_capacity"?"capacity":Fs.has(s??"")?"draft":$t.has(s??"")?"provider":"network";return this.terminal=i==="completed"?"already_complete":"transport_error",this.rejection=i==="disabled"||i==="capacity"||i==="draft"?i:null,this._providerStatusChanged||(this._providerStatusChanged=i==="provider"),i}reset(){this._busy=!1,this._pendingCapacity=null,this.transition({type:"reset"})}}const Ps=750;function Ys(t,e){for(let r=t.length-1;r>=0;r-=1)if(e(t[r]))return r;return-1}function Ae(t){const e=d.useRef(t);return d.useLayoutEffect(()=>{e.current=t}),d.useCallback((...r)=>e.current(...r),[])}function Bs(t){const[e,r]=d.useState([]),[s,i]=d.useState(!1),[c,p]=d.useState(""),[n]=d.useState(()=>new qs),h=d.useRef(null),A=d.useRef(null),f=d.useRef(null),C=d.useRef(null),k=d.useRef(!1),Y=d.useRef(null),E=d.useRef(null),M=d.useRef("cleared"),L=d.useRef(null),[K,$]=d.useState(null),[V,se]=d.useState(null),v=d.useRef([]),N=d.useRef(null),I=d.useRef(!1),w=d.useRef(t),z=d.useRef(Ge()),q=d.useRef(0),F=d.useRef(0),Q=d.useRef(t.sessionId);if(Q.current!==t.sessionId){Q.current=t.sessionId;const u=n.projectSession(t.sessionId);u&&r(u),n.sessionId!==t.sessionId&&(F.current+=1,L.current=null)}w.current=t,v.current=e,d.useEffect(()=>()=>{var u;E.current!==null&&window.clearTimeout(E.current),(u=h.current)==null||u.abort(),A.current=null,f.current!==null&&cancelAnimationFrame(f.current),C.current!==null&&window.clearTimeout(C.current),n.cancelCapacity()},[n]),d.useEffect(()=>{n.busy||n.restore(n.messages,t.sessionId)},[t.sessionId,n]),d.useEffect(()=>{const u=n.projectSession(t.sessionId);I.current=u!==null,u&&(r(u),v.current=u)},[t.sessionId,n]);const te=d.useMemo(()=>{const u={};for(const g of e)for(const R of g.blocks??[])if(R.kind==="tool")for(const S of R.results??[])u[S.route_id]=S;return u},[e]),X=()=>`m${++q.current}_${Date.now().toString(36)}`,J=(u,g=!0)=>{const R=n.state,S=n.transition(u),y=u.type==="event"&&u.event.type==="stream_start"?u.event.session_id:null;return y?w.current.onSessionId(y,R.sessionId,n.configuration):S.sessionId&&S.sessionId!==R.sessionId&&w.current.onSessionId(S.sessionId,R.sessionId,n.configuration),S.title!==R.title&&w.current.onTitle(S.title,S.sessionId),g&&(v.current=S.messages,r(S.messages)),S},m=()=>N.current===F.current||I.current,O=()=>{f.current!==null&&(cancelAnimationFrame(f.current),f.current=null),C.current!==null&&(window.clearTimeout(C.current),C.current=null)},l=()=>{O(),document.visibilityState!=="hidden"&&I.current&&(k.current=!1,v.current=n.messages,r(n.messages))},D=()=>{if(!I.current||document.visibilityState==="hidden"||f.current!==null||C.current!==null)return;const u=()=>{f.current=null,C.current=null,l()};typeof requestAnimationFrame=="function"?f.current=requestAnimationFrame(u):C.current=window.setTimeout(u,0)};d.useEffect(()=>{const u=()=>{document.visibilityState==="visible"&&k.current&&D()};return document.addEventListener("visibilitychange",u),()=>document.removeEventListener("visibilitychange",u)});const P=u=>{if(h.current!==u||(E.current!==null&&(window.clearTimeout(E.current),E.current=null),M.current==="cleared"))return;const g=M.current==="shown";M.current="cleared",g&&J({type:"clear_workspace_status"},m())},ne=(u,g)=>{E.current!==null&&window.clearTimeout(E.current),M.current="armed",E.current=window.setTimeout(()=>{E.current=null,!(M.current!=="armed"||h.current!==u||u.signal.aborted||F.current!==g)&&(M.current="shown",J({type:"workspace_status"},m()))},Ps)},ae=(u,g)=>{const R=L.current;!R||R.controller!==u||R.tracker.recordStreamStart(g,performance.now())},ge=(u,g)=>{const R=L.current;!R||R.controller!==u||R.tracker.recordTerminal(g)};d.useLayoutEffect(()=>{const u=L.current;if(!u)return;const g=e.at(-1);if((g==null?void 0:g.role)!=="assistant"||!(g.blocks??[]).some(y=>y.kind==="tool"||y.kind==="reasoning"&&!!y.text.trim()||y.kind==="answer"&&!!y.text.trim()))return;const S=performance.now();u.tracker.recordFirstVisible(S);for(const y of g.blocks??[])y.kind==="reasoning"&&y.text.trim()?u.tracker.recordSemantic("reasoning",S):y.kind==="tool"?u.tracker.recordSemantic("tool",S):y.kind==="answer"&&y.text.trim()&&u.tracker.recordSemantic("answer",S)},[e]);const we=(u,g=!0)=>{J({type:"event",event:u},g)},Qe=async(u,g)=>{var y;const R=await(w.current.loadSession??mt)(u);let S=Zt(R);return((y=Y.current)==null?void 0:y.sessionId)===u&&(S=Y.current.messages,Y.current=null),F.current!==g&&!(N.current===g&&I.current&&w.current.sessionId===u)?null:(r(S),v.current=S,n.restore(S,u),S)},De=(u,g,R,S,y,W,U)=>{const H=++F.current;N.current=H,I.current=!0;const j=new AbortController;h.current=j;const ie=u.text;return z.current=u,p(""),r(R),n.start(R,g.session_id,U??{model:w.current.initialModel,webSearchEnabled:!!g.web_search_enabled,reasoningEffort:g.reasoning_effort??"low"}),i(!0),L.current=W?null:{controller:j,tracker:new Cs(performance.now())},M.current="cleared",(async()=>{var pe,G,ye,re,_e,Ke;let T=0;const fe=B=>{B>T&&(T=B)};try{const B=W?rr(W,{signal:j.signal,onSequence:fe}):ds(g,{signal:j.signal,onSequence:fe}),ue=Ls(B,{signal:j.signal,getSessionId:()=>n.sessionId,onDisconnect:()=>{!j.signal.aborted&&h.current===j&&we({type:"compaction_status",state:"finished"},m())},getAfterSequence:()=>T,onSequence:fe}),de=!W&&Pe()&&ls(),oe=de?Ns(ue,{signal:j.signal,isHidden:()=>document.visibilityState==="hidden"}):null;oe&&(A.current={controller:j,stream:oe});for await(const x of(oe==null?void 0:oe.events)??ue){if(j.signal.aborted||h.current!==j)break;x.type==="paper_artifact"&&((G=(pe=w.current).onPaperArtifact)==null||G.call(pe,x,n.sessionId)),x.type==="stream_start"&&ae(j,x.request_id),x.type==="sandbox_start"&&ne(j,H),(x.type==="sandbox_ready"||x.type==="workspace_ready"||x.type==="lifecycle")&&P(j),(x.type==="reasoning_start"||x.type==="reasoning_delta"||x.type==="tool_call"||x.type==="tool_call_start"||x.type==="tool_call_arguments_delta"||x.type==="tool_call_arguments_done"||x.type==="app_start"||x.type==="app_result"||x.type==="artifact_start"||x.type==="artifact_ready"||x.type==="artifact_error"||x.type==="answer_delta"||x.type==="done"||x.type==="error")&&P(j),n.observe(x)&&m()&&w.current.onInterrupted(u),(x.type==="done"||x.type==="error")&&ge(j,x.type==="error"?"error":"complete");const xe=m(),$e=xe&&!(de&&document.visibilityState==="hidden"),Xe=x.type==="reasoning_delta"||x.type==="answer_delta"||x.type==="tool_call_arguments_delta",Ve=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta","tool_call_arguments_delta"].includes(x.type);de&&Ve&&l(),de&&Xe?(we(x,!1),k.current||(k.current=xe),D()):(we(x,$e),de&&xe&&!$e&&(k.current=!0))}}catch(B){if(!j.signal.aborted&&h.current===j){const ue=n.reject(B,!!W),de=ue==="completed";if(P(j),!de)if(ue==="disabled")se({question:ie,draft:u}),n.restore(S),F.current===H&&(r(S),v.current=S,p(""));else if(ue==="capacity"){const oe=B instanceof Ue?B.retryAfterSeconds??5:5,x={question:ie,draft:u,request:g,optimistic:R,original:S,edit:y,retryAfterSeconds:oe,retryAt:Date.now()+oe*1e3};n.queueCapacity(x),$({question:ie,draft:u,retryAt:x.retryAt,retryAfterSeconds:oe}),n.restore(S),F.current===H&&(r(S),v.current=S,p(""))}else ge(j,"network_error"),ue==="draft"&&(m()&&w.current.onInterrupted(u),n.restore(S),F.current===H&&(r(S),v.current=S,p(B instanceof Error?B.message:"The assistant stream failed."))),ue==="provider"&&m()&&w.current.onInterrupted(u);!de&&!n.admissionRejected&&F.current===H&&we({type:"error",message:B instanceof Error?B.message:"The assistant stream failed.",code:B instanceof Ue?B.code:void 0})}}finally{if(h.current===j){if(((ye=A.current)==null?void 0:ye.controller)===j&&(l(),A.current=null),P(j),!n.sawTerminalEvent&&!j.signal.aborted&&ge(j,"network_error"),n.finish(),i(!1),n.admissionRejected)w.current.onSettled(g.session_id);else if(!j.signal.aborted){n.shouldRefreshProvider&&((_e=(re=w.current).onProviderTerminal)==null||_e.call(re));const B=n.sessionId;if(y&&!n.sawStreamStart)n.restore(y.snapshot),F.current===H&&(r(y.snapshot),v.current=y.snapshot,p("Couldn’t resend this message. Your original conversation was restored."));else if(B){F.current===H&&y&&(n.streamFailed||!n.sawTerminalEvent)&&(n.restore(y.snapshot),r(y.snapshot),v.current=y.snapshot);try{const ue=await Qe(B,H);ue&&y&&ue.some(de=>de.id===y.targetId)&&p("Couldn’t resend this message. Your original conversation was restored.")}catch{F.current===H&&J({type:"settle"})}}else F.current===H&&J({type:"settle"});(!h.current||h.current===j)&&w.current.onSettled(B)}((Ke=L.current)==null?void 0:Ke.controller)===j&&(L.current=null)}}})(),!0},Ye=Ae(u=>{var fe,pe;const g=typeof u=="string"?Ge(u.trim()):u,R=g.text;if(!R||R.length>8e3||n.busy||n.pendingCapacity)return!1;const S=v.current,y=[...S].reverse().find(G=>G.role==="user"),W=y!=null&&y.status&&y.status!=="complete"&&y.revision?{replace_message_id:y.id,prior_revision:y.revision}:null,U={id:X(),role:"user",text:R,paperMentions:g.paperMentions,paperSelection:g.paperSelection},H={id:X(),role:"assistant",streaming:!0,blocks:[]},j=W&&y?Ys(S,G=>G.id===y.id):-1,ie=j<0?[...S,U,H]:[...S.slice(0,j),U,H],T=(pe=(fe=w.current).viewerContext)==null?void 0:pe.call(fe);return De(g,{message:R,paper_mentions:g.paperMentions.map(({route_id:G,title:ye,start:re,end:_e})=>({route_id:G,title:ye,start:re,end:_e})),session_id:w.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!w.current.webSearchEnabled,reasoning_effort:w.current.reasoningEffort??"low",...w.current.primaryPaperRouteId?{primary_paper_route_id:w.current.primaryPaperRouteId}:{},...T?{viewer_context:T}:{},...g.paperSelection?{paper_selection:Lt(g.paperSelection)}:{},...!w.current.sessionId&&w.current.initialModel?{initial_model:w.current.initialModel}:{},...W??{}},ie,S)}),Ee=Ae((u,g)=>{var fe,pe;const R=typeof g=="string"?Ge(g.trim()):g,S=R.text;if(!S||S.length>8e3||n.busy||n.pendingCapacity)return!1;const y=v.current.slice(),W=y.findIndex(G=>G.id===u&&G.role==="user");if(W<0)return!1;const U=y[W];if(!w.current.sessionId||!U.revision)return!1;const H={id:U.id,role:"user",text:S,paperMentions:R.paperMentions,paperSelection:R.paperSelection,revision:U.revision+1,status:"generating"},j={id:X(),role:"assistant",streaming:!0,blocks:[]},ie=[...y.slice(0,W),H,j],T=(pe=(fe=w.current).viewerContext)==null?void 0:pe.call(fe);return De(R,{message:S,paper_mentions:R.paperMentions.map(({route_id:G,title:ye,start:re,end:_e})=>({route_id:G,title:ye,start:re,end:_e})),session_id:w.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!w.current.webSearchEnabled,reasoning_effort:w.current.reasoningEffort??"low",...w.current.primaryPaperRouteId?{primary_paper_route_id:w.current.primaryPaperRouteId}:{},...T?{viewer_context:T}:{},...R.paperSelection?{paper_selection:Lt(R.paperSelection)}:{},replace_message_id:U.id,prior_revision:U.revision},ie,y,{targetId:U.id,snapshot:y})}),le=Ae(()=>{const u=v.current.slice(),g=[...u].reverse().find(y=>y.role==="user");if(!w.current.sessionId||!(g!=null&&g.revision)||n.busy||n.pendingCapacity)return!1;const R=Ge(g.text??"Continue the interrupted response from saved progress."),S=[...u,{id:X(),role:"user",text:R.text,paperMentions:[]},{id:X(),role:"assistant",streaming:!0,blocks:[]}];return De(R,{message:R.text,session_id:w.current.sessionId,client_message_id:crypto.randomUUID(),retry_message_id:g.id,...w.current.primaryPaperRouteId?{primary_paper_route_id:w.current.primaryPaperRouteId}:{},web_search_enabled:!!w.current.webSearchEnabled,reasoning_effort:w.current.reasoningEffort??"low"},S,u)}),ve=Ae(()=>{const u=[...v.current].reverse().find(g=>g.role==="user");return u!=null&&u.text?Ee(u.id,{text:u.text,paperMentions:u.paperMentions??[],...u.paperSelection?{paperSelection:u.paperSelection}:{}}):!1}),Ne=d.useCallback(()=>{n.cancelCapacity(),$(null)},[n]),Te=Ae(()=>{const u=n.pendingCapacity;return!u||Date.now(){var U,H;if(!h.current)return;const u=h.current;P(u),ge(u,"stopped"),u.abort();const g=((U=A.current)==null?void 0:U.controller)===u?A.current.stream.takeAcceptedForStop():[];A.current=null;for(const j of g)we(j,!1);l(),h.current=null,((H=L.current)==null?void 0:H.controller)===u&&(L.current=null),n.finish(),i(!1);const R=m(),S=J({type:"stop"},!1).messages;R&&(v.current=S,r(S),w.current.onInterrupted(z.current));const y=n.sessionId;y&&(Y.current={sessionId:y,messages:S}),y&&Br(y).catch(()=>{});const W=++F.current;window.setTimeout(()=>{y&&R&&F.current===W?Qe(y,W).catch(()=>{}).finally(()=>{h.current||w.current.onSettled(y)}):h.current||w.current.onSettled(y)},450)}),Je=Ae((u,g)=>{const R=I.current?n.transition({type:"toggle_block",messageId:u,blockIndex:g}).messages:cr(v.current,u,g);v.current=R,r(R)}),Se=d.useCallback(()=>{var u;F.current+=1,E.current!==null&&(window.clearTimeout(E.current),E.current=null),M.current="cleared",(u=h.current)==null||u.abort(),h.current=null,A.current=null,O(),k.current=!1,Y.current=null,L.current=null,$(null),n.reset(),N.current=null,I.current=!1,r([]),i(!1),p("")},[n]),Be=Ae((u,g,R=!1,S)=>{var y;if(F.current+=1,E.current!==null&&(window.clearTimeout(E.current),E.current=null),M.current="cleared",O(),k.current=!1,L.current=null,n.cancelCapacity(),$(null),n.busy&&g!==void 0&&g===n.sessionId){I.current=!0,r(n.messages),v.current=n.messages,p("");return}if(I.current=!1,n.busy||((y=h.current)==null||y.abort(),h.current=null,N.current=null,I.current=!1),R&&g&&!n.busy){const W=[...u].reverse().find(U=>U.role==="user");if(W){const U={text:W.text??"",paperMentions:W.paperMentions??[],...W.paperSelection?{paperSelection:W.paperSelection}:{}},H=[...u,{id:`${W.id}-active`,role:"assistant",streaming:!0,blocks:[]}];De(U,{message:U.text,session_id:g,client_message_id:"reconnect",web_search_enabled:!!w.current.webSearchEnabled,reasoning_effort:w.current.reasoningEffort??"low"},H,u,void 0,g,S);return}}r(u),v.current=u,n.busy||n.restore(u,g??w.current.sessionId),n.busy||i(!1),p("")});return{messages:e,busy:s,activeSessionId:s?n.sessionId:null,activeTitle:n.state.title,activeConfiguration:n.configuration,selectedBusy:s&&n.sessionId===t.sessionId,papers:te,sessionError:c,capacityRequest:K,disabledRequest:V,send:Ye,editAndResend:Ee,retryFromProgress:le,retryLatest:ve,retryCapacity:Te,cancelCapacity:Ne,dismissDisabled:()=>se(null),stop:Ce,toggleBlock:Je,reset:Se,load:Be}}const lr=["chat","openai","usage"],Ws=90,ur="pwc:chat:openai-credits-notice:dismissed";function Hs(t=!0){return ze({queryKey:lr,queryFn:()=>qe.getOpenAIUsage(),enabled:t,staleTime:3e4,retry:!1,refetchOnWindowFocus:!0})}function Us(t,e,r){if(!t||e!=="openai"||t.used_percent["chatSessions",t],detail:(t,e)=>["chatSession",t,e]},Vs=t=>er({queryKey:He.list(t),queryFn:Wr,staleTime:0,refetchOnWindowFocus:!1,retry:!1}),Vt=(t,e)=>er({queryKey:He.detail(t,e),queryFn:()=>{if(!e)throw new Error("A saved conversation is required");return mt(e)},staleTime:0,refetchOnWindowFocus:!1,retry:!1}),be=Ge,zs=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],Gs=()=>{const t=sessionStorage.getItem(st);if(!t)return null;try{return Xr(JSON.parse(t),t)}catch{}return be(t)},Qs=({enabled:t,workspaceKey:e,children:r,onAskAiFix:s})=>t?a.jsx(Dr,{workspaceKey:e,onAskAiFix:s,children:r}):a.jsx(a.Fragment,{children:r}),Js=({enabled:t,children:e})=>t?a.jsx(Nr,{variant:"chat",children:e}):a.jsx(a.Fragment,{children:e}),Xs=({mode:t="general",routeSessionId:e,primaryPaper:r,currentPage:s,paperSelection:i,onPaperSelectionChange:c,onSessionId:p,onReaderSubmit:n,onReaderNewChat:h})=>{var wt,vt,St,xt,Rt,Et,Tt,Ct,kt,It,At,Ot,jt,Dt;const{sessionId:A}=xr(),f=e??(t==="general"?A:void 0),C=Rr(),[k,Y]=Er(),{user:E,isLoading:M}=Qt(),L=Tr(),K=(E==null?void 0:E.hf_subject)??null,$=kr(),V=ze({queryKey:["chatAvailability"],queryFn:()=>qe.getAvailability(),refetchInterval:3e4,retry:!1,enabled:Pe()&&!!E}),se=((wt=V.data)==null?void 0:wt.status)==="paused"||t==="paper"&&((vt=V.data)==null?void 0:vt.paper_reader_chat_enabled)===!1,v=ze({...Vs(K),enabled:!!E&&!M}),N=v.data??[],[I,w]=d.useState(null),[z,q]=d.useState(""),F=o=>{L.setQueryData(He.list(K),_=>o(_??[]))},Q=(o,_)=>{F(b=>b.map(ce=>ce.id===o?{...ce,..._}:ce)),L.setQueryData(He.detail(K,o),b=>b&&{...b,..._})},te=d.useRef(Hr()),X=d.useRef(f??null),J=d.useRef(k.get("model")||((St=te.current)==null?void 0:St.model)),[m,O]=d.useState($?Ur:Kr),[l,D]=d.useState(J.current||ct),P=$r(m,l),ne=Vr(m,l),ae=P==="huggingface"&&!ne,ge=ss(!!(E&&P==="openrouter")),we=Hs(Pe()&&!!E&&P==="openai"),[Qe,De]=d.useState(()=>Ks()),Ye=Us(we.data,P,Qe),[Ee,le]=d.useState(()=>be()),[ve,Ne]=d.useState(()=>{var o;return((o=te.current)==null?void 0:o.webSearchEnabled)??!0}),[Te,Ce]=d.useState(()=>{var o;return((o=te.current)==null?void 0:o.reasoningEffort)??"low"}),Je=!!((xt=V.data)!=null&&xt.web_search_available),[Se,Be]=d.useState(()=>{var _,b;const o=(_=k.get("q"))==null?void 0:_.trim();return o?be(o):((b=te.current)==null?void 0:b.draft)??be()}),u=d.useRef(!1),g=d.useRef(!1),R=d.useRef(!1),[S,y]=d.useState(()=>typeof window>"u"||window.innerWidth>900),W=d.useRef(new Set),U=d.useRef(f);U.current=f;const[H,j]=d.useState(void 0),ie=d.useCallback(async()=>{await L.invalidateQueries({queryKey:He.list(K)})},[L,K]),T=Bs({sessionId:f??null,initialModel:l,webSearchEnabled:Je&&ve,reasoningEffort:Te,primaryPaperRouteId:t==="paper"?r==null?void 0:r.routeId:void 0,viewerContext:t==="paper"&&s?()=>({page:Math.max(1,Math.min(1e4,s()))}):void 0,loadSession:async o=>{const _=await L.fetchQuery(Vt(K,o));return w(b=>(b==null?void 0:b.sessionId)===o?null:b),_},onSessionId:(o,_,b)=>{L.cancelQueries({queryKey:He.list(K)});const ce=new Date().toISOString();F(Re=>Re.some(Me=>Me.id===o)?Re.map(Me=>Me.id===o?{...Me,is_busy:!0}:Me):[{id:o,title:"New chat",selected_model:(b==null?void 0:b.model)??l,created_at:ce,updated_at:ce,message_count:1,is_busy:!0,web_search_enabled:(b==null?void 0:b.webSearchEnabled)??ve,reasoning_effort:(b==null?void 0:b.reasoningEffort)??Te},...Re]),(U.current??null)===_&&o!==_&&(t==="paper"?p==null||p(o):C(`/chat/${o}`,{replace:!0}))},onTitle:(o,_)=>{_&&!W.current.has(_)&&Q(_,{title:o})},onSettled:o=>{o&&Q(o,{is_busy:!1}),L.invalidateQueries({queryKey:lr}),ie()},onProviderTerminal:()=>{L.invalidateQueries({queryKey:ns})},onPaperArtifact:(o,_)=>{_&&w({sessionId:_,descriptor:o.descriptor})},onInterrupted:o=>{le(o),c==null||c(o.paperSelection)}}),fe=T.send;d.useEffect(()=>{T.capacityRequest&&(le(T.capacityRequest.draft),c==null||c(T.capacityRequest.draft.paperSelection))},[T.capacityRequest,c]);const pe=d.useCallback(o=>{sessionStorage.setItem(st,JSON.stringify(o)),sessionStorage.setItem(et,l),sessionStorage.setItem(zr,Te),sessionStorage.setItem(Gr,ve?"1":"0"),sessionStorage.setItem(tt,"1"),sessionStorage.setItem(rt,"1");const _=t==="paper"&&r?`/pdf/${r.routeId}`:U.current?`/chat/${U.current}`:"/chat";window.location.href=Cr(_,ae)},[t,r,Te,l,ae,ve]),G=d.useCallback((o,_)=>{sessionStorage.setItem(st,JSON.stringify(o)),sessionStorage.setItem(et,l),sessionStorage.removeItem(tt),sessionStorage.removeItem(rt),Be(be()),le(o),c==null||c(o.paperSelection),q(_)},[c,l]),ye=d.useCallback(async o=>{const _=c?i?{...o,paperSelection:i}:{text:o.text,paperMentions:o.paperMentions}:o;if(!E){pe(_);return}if(ae&&!g.current){if(R.current)return;R.current=!0;try{if(!(await qe.getInferenceBilling()).connected){if(sessionStorage.getItem(rt)==="1"){G(_,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}pe(_);return}g.current=!0}catch(b){G(_,b instanceof Error?b.message:"Could not check Hugging Face authorization.");return}finally{R.current=!1}}if(sessionStorage.removeItem(tt),!fe(_)){G(_,"Your prompt was not sent. It is ready to retry.");return}sessionStorage.removeItem(st),sessionStorage.removeItem(et),sessionStorage.removeItem(rt),Qr(),te.current=null,le(be()),c==null||c(void 0),t==="paper"&&(n==null||n())},[pe,t,c,n,i,G,fe,E,ae]);d.useEffect(()=>{if(M||!E)return;const o=sessionStorage.getItem(et);o&&D(o),Jr().then(ce=>{if(O(ce.items),!U.current){const Re=J.current||o;D(Re&&ce.items.some(Me=>Me.id===Re)?Re:ce.default_model)}});const _=Gs(),b=sessionStorage.getItem(tt)==="1";_&&(c==null||c(_.paperSelection),b?Be(_):le(_))},[M,c,ie,E]);const re=T.selectedBusy,{load:_e,activeConfiguration:Ke}=T,B=ze({...Vt(K,f??null),enabled:!!(f&&E&&!M&&!re),refetchOnMount:"always"}),ue=!M&&(!E||B.error instanceof zt&&B.error.status===404),de=ze({queryKey:["chatSessionPublicShare",f],queryFn:()=>qe.getSessionPublicShare(f??""),enabled:t==="general"&&!!f&&ue,retry:!1}),oe=(Rt=de.data)==null?void 0:Rt.public_path;d.useEffect(()=>{oe&&C(oe,{replace:!0})},[C,oe]);const x=B.data,xe=re||H===(f??null),$e=I&&I.sessionId===f?I.descriptor:x==null?void 0:x.latex_paper,Xe=(Tt=(Et=[...(x==null?void 0:x.messages)??[]].reverse().find(o=>o.role==="user"&&o.viewer_context))==null?void 0:Et.viewer_context)==null?void 0:Tt.page;d.useLayoutEffect(()=>{const o=f??null;if(H===o)return;if(re){j(o);const b=Ke;b&&(b.model&&D(b.model),Ne(b.webSearchEnabled),Ce(b.reasoningEffort));return}if(!o){_e([],null),H!==void 0&&(Ne(!0),Ce("low")),j(null);return}if(!x||B.isFetching)return;j(o),_e(Zt(x),o,x.is_busy,{model:x.selected_model,webSearchEnabled:x.web_search_enabled,reasoningEffort:x.reasoning_effort??"high"}),q(""),D(x.selected_model);const _=o===X.current?te.current:null;Ne(_?_.webSearchEnabled:x.web_search_enabled),Ce(_?_.reasoningEffort:x.reasoning_effort??"high")},[f,re,x,_e,Ke,B.isFetching,H]),d.useEffect(()=>{var ce;if(M)return;const o=(ce=k.get("q"))==null?void 0:ce.trim();if(!o)return;u.current=!1;const _=k.get("model");_&&D(_),Be(be(o));const b=new URLSearchParams(k);b.delete("q"),b.delete("model"),Y(b,{replace:!0})},[M,k,Y]),d.useEffect(()=>{if(M||T.busy||!Se.text||u.current||E&&ve&&V.isFetching||f&&!xe)return;const o=window.setTimeout(()=>{if(u.current)return;u.current=!0,ye(Se).finally(()=>Be(be()))},0);return()=>window.clearTimeout(o)},[M,V.isFetching,T.busy,Se,f,xe,ye,E,ve]),d.useEffect(()=>{const o=()=>{!E||T.busy||ie()};return window.addEventListener("focus",o),()=>window.removeEventListener("focus",o)},[T.busy,ie,E]);const Ve=()=>{window.innerWidth<=900&&y(!1),_e([],null),j(null),le(be()),c==null||c(void 0),Ne(!0),Ce("low"),t==="paper"?h==null||h():C("/chat")},dr=async(o,_)=>{try{const b=await lt(o,{title:_});return W.current.add(o),Q(o,b),!0}catch(b){return q(b instanceof Error?b.message:"Rename failed"),!1}},fr=async o=>{const _=T.busy&&o===T.activeSessionId;if(window.confirm(_?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){_&&T.stop();try{if(_){const b=Date.now()+3e3;for(;(await mt(o)).is_busy;){if(Date.now()>=b)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(Re=>window.setTimeout(Re,150))}}await Zr(o),o===f&&Ve(),await ie()}catch(b){q(b instanceof Error?b.message:"Delete failed")}}},at=Ts({messages:T.messages,refreshSessions:ie,resetChat:T.reset,restoreDraft:le}),gt=async o=>{const _=l;if(D(o),!f)return!0;try{const b=await lt(f,{selected_model:o});return Q(f,{selected_model:b.selected_model}),q(""),!0}catch(b){return D(_),q(b instanceof Error?b.message:"Model change failed"),!1}},pr=m.some(o=>o.id===ct),hr=async()=>{await gt(ct)&&T.retryLatest()},mr=async o=>{const _=Te;if(Ce(o),!!f)try{const b=await lt(f,{reasoning_effort:o});Q(f,b)}catch(b){Ce(_),q(b instanceof Error?b.message:"Effort change failed")}},gr=as(t==="general"),yt=N.map(o=>o.id===T.activeSessionId&&T.busy?{...o,is_busy:!0,title:W.current.has(o.id)?o.title:T.activeTitle||o.title}:o),he=yt.find(o=>o.id===f),it=T.messages.length===0,Ze=!!(f&&(M||E&&!xe&&!B.isError||de.isFetching||oe)),_t=!xe&&!Ze&&((Ct=B.error)==null?void 0:Ct.message),yr=!!((kt=ge.data)!=null&&kt.fallback_enabled),_r=c?i?{...Ee,paperSelection:i}:{text:Ee.text,paperMentions:Ee.paperMentions}:Ee,bt={onSend:ye,busy:re,onStop:T.stop,draft:_r,onDraftChange:o=>{c?(le({text:o.text,paperMentions:o.paperMentions}),o.paperSelection!==i&&c(o.paperSelection)):le(o)},models:m,selectedModel:l,onModelChange:o=>void gt(o),disabled:se||M||T.busy&&!re,describedBy:se?"chat-paused-description":void 0,paperMentionsEnabled:!!((It=V.data)!=null&&It.paper_mentions_enabled),paperSelectionEnabled:((At=V.data)==null?void 0:At.paper_reader_selection_enabled)===!0,paperArtifactsEnabled:t==="general"&&((Ot=V.data)==null?void 0:Ot.paper_artifacts_enabled)===!0,webSearchAvailable:Je,webSearchEnabled:ve,onWebSearchChange:Ne,reasoningEffort:Te,onReasoningEffortChange:o=>void mr(o)};return a.jsx(Qs,{enabled:t==="general",workspaceKey:f??"new-chat",onAskAiFix:o=>{ye(be(o))},children:a.jsxs("div",{className:`chat-page${t==="paper"?" chat-page--reader":""}`,style:{height:gr},children:[t==="general"&&a.jsx(xs,{sessions:yt,activeSessionId:f,loading:v.isLoading,error:z||((jt=v.error)==null?void 0:jt.message)||"",open:S,onClose:()=>y(!1),onNew:Ve,onNavigate:o=>{window.innerWidth<=900&&y(!1),C(`/chat/${o}`)},onRename:dr,onDelete:o=>void fr(o)}),a.jsx(Js,{enabled:t==="general",children:a.jsxs("section",{className:"chat-main","data-testid":"active-chat-pane",children:[a.jsxs("div",{className:"chat-topbar",children:[t==="general"&&!S&&a.jsx("button",{type:"button",className:"icon-btn",onClick:()=>y(!0),title:"Open sidebar",children:a.jsx(Jt,{})}),t==="paper"&&a.jsx("button",{type:"button",className:"chat-reader-action",onClick:Ve,children:"New chat"}),a.jsx("span",{className:"chat-topbar-title",children:Ze?(he==null?void 0:he.title)||"":(he==null?void 0:he.title)||(x==null?void 0:x.title)||(it?"":"New chat")}),$&&a.jsx("span",{className:"chat-staging-badge",children:"Staging"}),t==="paper"&&a.jsx(Nt,{className:"chat-reader-action",to:"/chat",children:"All chats"}),t==="general"&&(he==null?void 0:he.primary_paper)&&a.jsx(Nt,{className:"chat-reader-action",to:`/pdf/${he.primary_paper.route_id}`,onClick:o=>{if(!We()){o.preventDefault();return}const _=he.primary_paper.route_id;sessionStorage.setItem(`pwc:reader:session:${_}`,he.id),Xe&&sessionStorage.setItem(`pwc:reader:page:${_}`,String(Xe))},children:"Open reader"}),f&&xe&&!it&&a.jsx(Rs,{sessionId:f,busy:re,loading:Ze,hasPaperSelection:T.messages.some(o=>!!o.paperSelection),onError:q})]}),Ye&&a.jsxs("div",{className:"chat-credits-notice",role:"status",children:[a.jsx("span",{children:Ye.message}),a.jsx("button",{type:"button",className:"chat-credits-notice-close","aria-label":"Dismiss credits notice",onClick:()=>{$s(Ye.resetsAt),De(Ye.resetsAt)},children:"×"})]}),t==="general"&&$e&&a.jsx(Es,{descriptor:$e}),Ze&&!Se.text?a.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[a.jsx(Xt,{}),a.jsx("span",{children:"Loading conversation…"})]}):_t?a.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[a.jsx("p",{children:_t}),a.jsx("button",{type:"button",onClick:()=>{B.refetch()},children:"Try again"})]}):it&&!Se.text?a.jsx("div",{className:"chat-empty",children:a.jsxs("div",{className:"chat-empty-inner",children:[a.jsx("div",{className:"chat-empty-eyebrow",children:t==="paper"?"Paper chat":"Research chat"}),a.jsx("h1",{className:"chat-empty-title",children:t==="paper"?"Ask about this paper":a.jsxs(a.Fragment,{children:["Ask ",a.jsx("em",{children:"Papers With Code"})]})}),a.jsx("p",{className:"chat-empty-sub",children:t==="paper"?"Questions are grounded in the open paper. Add up to three other papers with @.":"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),$&&a.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),a.jsx(Ht,{variant:"empty",composerProps:bt,provider:P,sponsored:ne,paused:se,error:T.sessionError,suggestions:t==="paper"?zs:ts})]})}):a.jsxs(a.Fragment,{children:[a.jsx(ys,{messages:T.messages,papers:T.papers,busy:re,queuedDraft:Se.text?Se:void 0,paperMentionsEnabled:!!((Dt=V.data)!=null&&Dt.paper_mentions_enabled),archivePending:at.pending,openRouterFallbackEnabled:yr,onToggleBlock:T.toggleBlock,onEditAndResend:T.editAndResend,onRetryFromProgress:T.retryFromProgress,onRetryWithLuna:pr?()=>void hr():void 0,onArchiveOld:()=>void at.archiveOld(),onArchiveOldest:()=>void at.archiveOldest()}),a.jsx(Ht,{variant:"followup",composerProps:bt,provider:P,sponsored:ne,paused:se,error:T.sessionError})]})]})}),T.capacityRequest&&a.jsx(_s,{retryAt:T.capacityRequest.retryAt,onCancel:T.cancelCapacity,onRetry:()=>{T.retryCapacity()&&(le(be()),c==null||c(void 0))}}),T.disabledRequest&&a.jsx(bs,{onClose:()=>{var _;const o=((_=T.disabledRequest)==null?void 0:_.draft)??Ee;le(o),c==null||c(o.paperSelection),T.dismissDisabled(),V.refetch()}})]})})},Zs=t=>{const{user:e}=Qt();return a.jsx(Xs,{...t},(e==null?void 0:e.hf_subject)??"guest")},An=()=>a.jsx(Zs,{});export{Zs as ChatExperience,An as default}; diff --git a/assets/ChatView-DCUOQn_a.js b/assets/ChatView-DCUOQn_a.js deleted file mode 100644 index 4f13bbb5919eb32b80162b44754ac5b1770a67f2..0000000000000000000000000000000000000000 --- a/assets/ChatView-DCUOQn_a.js +++ /dev/null @@ -1,11 +0,0 @@ -var yr=Object.defineProperty;var _r=(t,e,r)=>e in t?yr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ee=(t,e,r)=>_r(t,typeof e!="symbol"?e+"":e,r);import{r as d,A as zt,W as br,j as a,X as wr,h as Gt,F as ot,a as Qt,u as vr,b as Sr,d as xr,m as Rr,Y as Er,L as Nt,f as Tr}from"./index-CA09r0fx.js";import{u as $e}from"./useQuery-GCOPnmOE.js";import{C as Cr,U as Mt,b as kr,f as He,c as Ir,g as Ar,A as Or,a as jr}from"./ArtifactWorkspace-BYQbPlsN.js";import{c as Fe}from"./chat-XoDxf8nx.js";import{e as Dr,f as Jt,h as Nr,T as Mr,d as Xt,i as Lr,j as Fr,k as qr,l as Ve,m as Pr,t as Lt,n as mt,o as Zt,r as Yr,s as Br,S as Wr,a as Hr,D as ct,v as Ur,w as tt,x as Xe,y as Kr,z as $r,B as Ze,E as et,F as Vr,G as zr,H as Gr,I as lt,J as Qr}from"./chatLaunch-CutMsO9s.js";import{M as Jr,S as Xr}from"./chatPrompts-BzPGjXPj.js";import{S as Zr}from"./share-2-B8SQJ4QE.js";import{u as es,O as ts}from"./openrouter-B__IMcd_.js";import{q as er}from"./queryOptions-C9woPjwX.js";/* empty css */import"./hover-card-0saQl8Kd.js";import"./github-Cto4qly3.js";import"./github-D8NiZH3t.js";import"./file-text-7GwUpKU3.js";import"./catalog-C6oGGh8I.js";import"./PaperPreviewLink-DUf7c7wv.js";import"./index-BeqN5AbC.js";import"./index-qKrWNpd1.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-2SfezChA.js";import"./useMutation-CUMX1r3q.js";import"./copy-BRZnlAd3.js";import"./thumbs-up-BxkpoAw0.js";import"./external-link-b6zNfUPN.js";import"./chevron-down-MPck50eR.js";import"./earth-gRrLiaVn.js";import"./AgentLogos-e-hYOTh0.js";function rs(t){const[e,r]=d.useState("calc(100dvh - 60px)");return d.useLayoutEffect(()=>{if(!t)return;const s=document.querySelector(".app-header"),i=window.visualViewport,c=()=>{const n=(i==null?void 0:i.height)??window.innerHeight;r(`${Math.max(0,n-((s==null?void 0:s.offsetHeight)??0))}px`)};c();const p=new ResizeObserver(c);return s&&p.observe(s),i==null||i.addEventListener("resize",c),window.addEventListener("resize",c),()=>{p.disconnect(),i==null||i.removeEventListener("resize",c),window.removeEventListener("resize",c)}},[t]),t?e:"100%"}const pe=(t,e)=>new Promise(r=>{const s=setTimeout(i,t);function i(){e==null||e.removeEventListener("abort",i),clearTimeout(s),r()}e==null||e.addEventListener("abort",i)}),Ce=t=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...t}),ke={name:"Object Detection",slug:"object-detection"},Me={name:"Real-Time Object Detection",slug:"real-time-object-detection"},ss={"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:Ce({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[ke,Me],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:Ce({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[ke,Me],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:Ce({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:[ke,Me],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:Ce({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[ke,Me],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:Ce({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:[ke,Me],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:Ce({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:[ke,Me],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:Ce({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"},ke],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:Ce({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[ke,Me],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},tr=t=>t.map(e=>ss[e]),Ft=tr(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),qt=tr(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),Pt="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.",Yt="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.",Bt=`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.`,ns=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*as(t,e){const r=()=>(e==null?void 0:e.aborted)===!0,s=t.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 pe(350,e),!r()){yield{type:"reasoning_start"};for(let i=0;i{const e=String("0").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"},is=()=>!0;class Ke extends Error{constructor(e,r,s,i){super(e),this.code=r,this.status=s,this.retryAfterSeconds=i,this.name="ChatStreamError"}}class rt extends Error{constructor(e="The assistant stream was interrupted."){super(e),this.name="ChatTransportError"}}function os(t,e){if(qe())try{Fe.reportLatency(t,e).catch(()=>{})}catch{}}function cs(t,e={}){return qe()?ls(t,e):as(t.message,e.signal)}function rr(t,e={}){return us(t,e)}async function*ls(t,e){try{const r=await Fe.stream(t,e.signal);yield*nr(r,e)}catch(r){throw sr(r)}}async function*us(t,e){try{const r=await Fe.resumeStream(t,e.signal,e.afterSequence);yield*nr(r,e)}catch(r){throw sr(r)}}function sr(t){return t instanceof Ke||t instanceof rt?t:t instanceof SyntaxError?new Ke("The assistant returned an invalid stream event.","invalid_stream_event"):new rt(t instanceof Error?t.message:"The assistant stream was interrupted.")}function ds(t){let e=null,r="message";const s=[];for(const i of t.split(` -`))if(i.startsWith("id:")){const c=i.slice(3).trim();/^[1-9]\d*$/.test(c)&&(e=Number(c))}else i.startsWith("event:")?r=i.slice(6).trimStart():i.startsWith("data:")&&s.push(i.slice(5).trimStart());return{sequence:e,event:r,data:s.join(` -`)}}async function*nr(t,e){var p;if(!t.ok||!t.body){const n=t.ok?null:new zt(t,await t.text());n&&br(n);const m=n==null?void 0:n.detail,A=typeof m=="object"&&m!==null?m:null,f=t.status===403&&!m,T=Number(t.headers.get("Retry-After")),C=Number.isFinite(T)&&T>=0?Math.min(300,Math.ceil(T)):void 0;throw new Ke(f?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(n==null?void 0:n.message)||`Chat stream failed (${t.status})`,A&&"code"in A&&typeof A.code=="string"?A.code:f?"staging_access_required":void 0,t.status,C)}const r=t.body.getReader(),s=new TextDecoder;let i="",c=e.afterSequence&&e.afterSequence>0?e.afterSequence:0;try{for(;;){const{done:n,value:m}=await r.read();if(n)break;i+=s.decode(m,{stream:!0});let A;for(;(A=i.indexOf(` - -`))!==-1;){const f=i.slice(0,A);i=i.slice(A+2);const T=ds(f);if(!T.data||T.data==="[DONE]"||T.sequence!==null&&T.sequence<=c)continue;const C=JSON.parse(T.data);T.sequence!==null&&(c=T.sequence,(p=e.onSequence)==null||p.call(e,T.sequence)),yield C}}}finally{r.releaseLock()}}const fs="https://huggingface.co/settings/inference-providers",Wt="pwc.chat.billing-notice-dismissed.v1";function ps({provider:t}){const[e,r]=d.useState(()=>localStorage.getItem(Wt)==="1");return!qe()||e||t!=="huggingface"?null:a.jsxs("div",{className:"chat-billing-notice",role:"note",children:[a.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),a.jsxs("div",{className:"chat-billing-notice-actions",children:[a.jsx("a",{href:"/settings",children:"Review billing"}),a.jsx("a",{href:fs,target:"_blank",rel:"noreferrer",children:"Review usage"}),a.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(Wt,"1"),r(!0)},children:a.jsx(wr,{size:15,"aria-hidden":"true"})})]})]})}function Ht({variant:t,composerProps:e,provider:r,paused:s,error:i,suggestions:c=[]}){var n;const p=a.jsxs(a.Fragment,{children:[a.jsx(ps,{provider:r}),s&&a.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),i&&a.jsx("div",{className:"chat-composer-error",role:"alert",children:i}),a.jsx(Cr,{...e,...t==="empty"?{autoFocus:!0}:{placeholder:(n=e.draft)!=null&&n.text?"Edit and send again…":"Ask a follow-up…"}}),t==="empty"&&a.jsx("div",{className:"chat-examples",children:c.map(m=>a.jsx("button",{type:"button",className:"chat-example",disabled:s,onClick:()=>{var A;return e.onSend({text:m,paperMentions:[],...(A=e.draft)!=null&&A.paperSelection?{paperSelection:e.draft.paperSelection}:{}})},children:m},m))})]});return t==="empty"?p:a.jsx("div",{className:"chat-composer-wrap",children:a.jsxs("div",{className:"chat-composer-inner",children:[p,a.jsx("div",{className:"chat-composer-foot",children:qe()?a.jsxs(a.Fragment,{children:[r==="huggingface"&&a.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",a.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),r==="openrouter"&&a.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",a.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}),r==="openai"&&a.jsx("span",{className:"chat-provider-attribution",children:"Powered by OpenAI."}),a.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):a.jsx(a.Fragment,{children:"Assistant preview — responses are simulated."})})]})})}function hs({messages:t,papers:e,busy:r,queuedDraft:s,paperMentionsEnabled:i,archivePending:c,openRouterFallbackEnabled:p,onToggleBlock:n,onEditAndResend:m,onRetryFromProgress:A,onRetryWithLuna:f,onArchiveOld:T,onArchiveOldest:C}){var _,I;const[B,E]=d.useState(null),N=d.useRef(null),M=d.useRef(null),H=d.useRef("bottom"),$=d.useRef(0),V=d.useRef(0),[ae,x]=d.useState(!1),j=d.useRef(null),k=d.useCallback(l=>{H.current=l},[]),v=d.useCallback(()=>{const l=N.current;l&&x(l.scrollHeight-l.scrollTop-l.clientHeight>1)},[]),G=t.filter(l=>l.role==="user"),P=G.length,L=d.useRef(P),Q=d.useRef(!1),re=(_=G[0])==null?void 0:_.id,X=(I=G.at(-1))==null?void 0:I.id;d.useEffect(()=>{r&&E(null)},[r]),d.useLayoutEffect(()=>{const l=N.current;if(l){if(P>L.current||r&&!Q.current){const O=Array.from(l.querySelectorAll("[data-message-id]")).at(-1);if(O){const F=l.getBoundingClientRect().top;$.current=l.scrollTop+O.getBoundingClientRect().top-F-24,k("question")}}if(L.current=P,Q.current=r,M.current!==null){l.scrollTop=M.current,M.current=null;return}H.current==="bottom"&&(l.scrollTop=l.scrollHeight),H.current==="question"&&(l.scrollTop=$.current,V.current=l.scrollTop)}},[t,P,r,k]),d.useLayoutEffect(v),d.useEffect(()=>{const l=N.current;if(!l)return;const O=new ResizeObserver(v);return O.observe(l),l.firstElementChild&&O.observe(l.firstElementChild),()=>O.disconnect()},[v]);const J=(l,O)=>{var F;M.current=((F=N.current)==null?void 0:F.scrollTop)??null,n(l,O)};return a.jsxs("div",{className:"chat-conversation-viewport",children:[a.jsx("div",{className:"chat-conversation",ref:N,tabIndex:0,role:"region","aria-label":"Conversation",onWheel:l=>{(l.deltaY<0||H.current==="question")&&k("free")},onTouchStart:l=>{var O;j.current=((O=l.touches[0])==null?void 0:O.clientY)??null},onTouchMove:l=>{var F;const O=(F=l.touches[0])==null?void 0:F.clientY;O!==void 0&&j.current!==null&&(O>j.current||H.current==="question")&&k("free"),j.current=O??null},onKeyDown:l=>{l.target===l.currentTarget&&((["ArrowUp","PageUp","Home"].includes(l.key)||l.key===" "&&l.shiftKey)&&k("free"),["ArrowDown","PageDown","End"," "].includes(l.key)&&H.current==="question"&&k("free"))},onScroll:l=>{const{scrollHeight:O,scrollTop:F,clientHeight:de}=l.currentTarget,he=O-F-de<=1;H.current==="bottom"&&!he&&k("free");const me=F-V.current;H.current==="question"&&(me>1||me<-1&&!he)&&k("free"),v()},children:a.jsxs("div",{className:"chat-conversation-inner",children:[t.length===0&&(s==null?void 0:s.text)&&a.jsx(Mt,{id:"queued-launch-preview",text:s.text,paperMentions:s.paperMentions,paperSelection:s.paperSelection,isInitial:!0}),t.map(l=>{var O,F,de,he;return l.role==="user"?a.jsx(Mt,{id:l.id,text:l.text??"",paperMentions:l.paperMentions??[],paperSelection:l.paperSelection,paperMentionsEnabled:i,isInitial:l.id===re,editingAllowed:!r&&!!l.revision,editing:B===l.id,editNotice:l.id===re?"Sending will replace this conversation.":l.id===X?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>E(l.id),onCancel:()=>E(null),onResendDraft:me=>{const be=m(l.id,me);return be&&E(null),be}},l.id):a.jsx(kr,{msg:l,papers:e,onToggleBlock:J,onRetryCompaction:!r&&l.id===((O=t.at(-1))==null?void 0:O.id)&&((F=G.at(-1))!=null&&F.revision)?A:void 0,onRetryWithLuna:!r&&l.id===((de=t.at(-1))==null?void 0:de.id)&&((he=G.at(-1))!=null&&he.revision)?f:void 0,onArchiveOldChats:T,onArchiveOldestChats:C,archivePending:c,hfBilling:null,openRouterFallbackEnabled:p,feedbackEnabled:!0},l.id)})]})}),ae&&a.jsx("button",{type:"button",className:"chat-jump-latest",onClick:()=>{k("bottom");const l=N.current;l&&(l.focus({preventScroll:!0}),l.scrollTop=l.scrollHeight,v())},children:"Jump to latest"})]})}function ms({retryAt:t,onRetry:e,onCancel:r}){const[s,i]=d.useState(()=>Math.max(0,Math.ceil((t-Date.now())/1e3))),c=d.useRef(null);return d.useEffect(()=>{var A;const p=document.activeElement instanceof HTMLElement?document.activeElement:null;(A=c.current)==null||A.focus();const n=()=>i(Math.max(0,Math.ceil((t-Date.now())/1e3)));n();const m=window.setInterval(n,250);return()=>{window.clearInterval(m),p==null||p.focus()}},[t]),a.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:a.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),r())},children:[a.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),a.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),a.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:s>0?`Try again available in ${s} second${s===1?"":"s"}.`:"You can try again now."}),a.jsxs("div",{className:"chat-capacity-dialog-actions",children:[a.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:c,onClick:r,children:"Cancel"}),a.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:s>0,onClick:e,children:"Try again"})]})]})})}function gs({onClose:t}){const e=d.useRef(null);return d.useEffect(()=>{var s;const r=document.activeElement instanceof HTMLElement?document.activeElement:null;return(s=e.current)==null||s.focus(),()=>r==null?void 0:r.focus()},[]),a.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:a.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:r=>{r.key==="Escape"&&(r.preventDefault(),t())},children:[a.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),a.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),a.jsx("div",{className:"chat-capacity-dialog-actions",children:a.jsx("button",{ref:e,type:"button",className:"chat-capacity-cancel",onClick:t,children:"Keep editing"})})]})})}function ys({url:t,onClose:e}){return t?a.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:e,children:a.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:r=>r.stopPropagation(),children:[a.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),a.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),a.jsx("input",{readOnly:!0,value:t,"aria-label":"Public conversation link",autoFocus:!0,onFocus:r=>r.currentTarget.select()}),a.jsx("button",{type:"button",onClick:e,children:"Close"})]})}):null}const ut="pwc:chat:sidebar-width",dt=280,ft=200,pt=480,_s=12,ht=t=>Math.max(ft,Math.min(pt,t)),bs=()=>{if(typeof window>"u")return dt;const t=Number(localStorage.getItem(ut));return Number.isFinite(t)&&t>0?ht(t):dt};function ws({sessions:t,activeSessionId:e,loading:r,error:s,open:i,onClose:c,onNew:p,onNavigate:n,onRename:m,onDelete:A}){const[f,T]=d.useState(bs),C=d.useRef(null),B=d.useRef(f),[E,N]=d.useState(null),[M,H]=d.useState(""),[$,V]=d.useState(null),[ae,x]=d.useState(!1),j=[...t].sort((_,I)=>Date.parse(I.updated_at)-Date.parse(_.updated_at)),k=j.filter((_,I)=>I<_s||_.id===e),v=ae?j:k,G=t.length-k.length;d.useEffect(()=>{if(!$)return;const _=()=>V(null),I=l=>{l.key==="Escape"&&_()};return window.addEventListener("click",_),window.addEventListener("keydown",I),()=>{window.removeEventListener("click",_),window.removeEventListener("keydown",I)}},[$]);const P=_=>{N(_.id),H(_.title)},L=async _=>{const I=M.trim();I&&await m(_,I)&&N(null)},Q=(_,I,l)=>V({id:_,x:I,y:l}),re=_=>{if(!C.current)return;const I=ht(C.current.width+_-C.current.x);B.current=I,T(I)},X=()=>{C.current&&(C.current=null,localStorage.setItem(ut,String(B.current)))},J=_=>{const I=ht(_);B.current=I,T(I),localStorage.setItem(ut,String(I))};return a.jsxs("aside",{className:`chat-sidebar${i?"":" chat-sidebar-closed"}`,style:{"--chat-sidebar-width":`${f}px`},children:[a.jsxs("div",{className:"chat-sidebar-top",children:[a.jsxs("button",{type:"button",className:"chat-new-chat",onClick:()=>{He()&&p()},children:[a.jsx(Dr,{})," New chat"]}),a.jsx("button",{type:"button",className:"icon-btn",onClick:c,title:"Collapse sidebar",children:a.jsx(Jt,{})})]}),a.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[r&&a.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!r&&s&&a.jsx("div",{className:"chat-sessions-empty",children:s}),!r&&!s&&t.length===0&&a.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Nr(v).map(_=>a.jsxs("div",{className:"chat-session-group",children:[a.jsx("div",{className:"chat-session-group-label",children:_.label}),_.items.map(I=>a.jsxs("div",{className:`chat-session${I.id===e?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>{He()&&n(I.id)},onKeyDown:l=>{if(l.key==="Enter"&&He()&&n(I.id),l.key==="F2"&&P(I),l.key==="ContextMenu"||l.shiftKey&&l.key==="F10"){l.preventDefault();const O=l.currentTarget.getBoundingClientRect();Q(I.id,O.right-150,O.bottom)}},onContextMenu:l=>{l.preventDefault(),Q(I.id,l.clientX,l.clientY)},children:[E===I.id?a.jsx("input",{className:"chat-session-title-input",value:M,autoFocus:!0,maxLength:80,onClick:l=>l.stopPropagation(),onChange:l=>H(l.target.value),onBlur:()=>void L(I.id),onKeyDown:l=>{l.stopPropagation(),l.key==="Enter"&&L(I.id),l.key==="Escape"&&N(null)}}):a.jsx("span",{className:"chat-session-title",children:I.title}),a.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:l=>{l.stopPropagation();const O=l.currentTarget.getBoundingClientRect();Q(I.id,O.right-150,O.bottom)},children:"⋯"}),a.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:l=>{l.stopPropagation(),He()&&A(I.id)},children:a.jsx(Mr,{})})]},I.id))]},_.label)),G>0&&a.jsx("button",{type:"button",className:"chat-sessions-toggle","aria-expanded":ae,onClick:()=>x(_=>!_),children:ae?"Show less":`Show ${G} older ${G===1?"chat":"chats"}`})]}),a.jsx(Jr,{className:"chat-sidebar-tools",canNavigate:He}),a.jsx("div",{className:"chat-sidebar-resize-handle",role:"separator","aria-label":"Resize chat history","aria-orientation":"vertical","aria-valuemin":ft,"aria-valuemax":pt,"aria-valuenow":f,title:"Drag to resize; double-click to reset",tabIndex:0,onPointerDown:_=>{_.button===0&&(C.current={x:_.clientX,width:f},B.current=f,_.currentTarget.setPointerCapture(_.pointerId))},onPointerMove:_=>re(_.clientX),onPointerUp:X,onPointerCancel:X,onLostPointerCapture:X,onDoubleClick:()=>J(dt),onKeyDown:_=>{(_.key==="ArrowLeft"||_.key==="ArrowRight")&&(_.preventDefault(),J(f+(_.key==="ArrowRight"?10:-10))),(_.key==="Home"||_.key==="End")&&(_.preventDefault(),J(_.key==="Home"?ft:pt))}}),$&&a.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:$.x,top:$.y},onClick:_=>_.stopPropagation(),children:a.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const _=t.find(I=>I.id===$.id);_&&P(_),V(null)},children:"Rename chat"})})]})}function vs({sessionId:t,busy:e,loading:r,hasPaperSelection:s=!1,onError:i}){const{toast:c}=Gt(),[p,n]=d.useState(!1),[m,A]=d.useState(""),f=async()=>{var T;if(!(e||p)&&!(s&&!window.confirm("This public link will include the selected paper passage. Anyone with the link can read that passage. Continue?"))){n(!0);try{const C=await Lr(t),B=new URL(C.public_path,window.location.origin).toString();try{if(!((T=navigator.clipboard)!=null&&T.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(B),c({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{A(B)}}catch(C){const B=C instanceof Error?C.message:"Could not share this conversation";i(B),c({variant:"destructive",title:"Share failed",description:B})}finally{n(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void f(),disabled:e||p||r,"aria-label":"Share conversation",children:[p?a.jsx(Xt,{}):a.jsx(Zr,{"aria-hidden":"true"}),a.jsx("span",{children:"Share"})]}),a.jsx(ys,{url:m,onClose:()=>A("")})]})}const Ss=({descriptor:t})=>{const e=Ir(),{open:r,register:s,unregister:i}=e,c=ot.useRef(null),p=t.source_head??t.preview_head,n=ot.useMemo(()=>p?{kind:"artifact",schema_version:1,scope:"owner",artifact_id:t.artifact_id,version_id:p.version_id,identifier:"latex-paper",version:p.version,artifact_kind:"latex_paper",title:t.title,status:"ready",preview_mime:"application/pdf",source_language:"latex",total_bytes:0}:null,[t.artifact_id,t.title,p]),m=n?Ar(n):null;return ot.useEffect(()=>{if(!(!n||!m))return s(n),c.current!==m&&(c.current=m,r(n)),()=>i(m)},[n,m,r,s,i]),null};function xs({messages:t,refreshSessions:e,resetChat:r,restoreDraft:s}){const{toast:i}=Gt(),[c,p]=d.useState(null),n=()=>{const f=[...t].reverse().find(T=>T.role==="user");r(),s({text:(f==null?void 0:f.text)??"",paperMentions:(f==null?void 0:f.paperMentions)??[],...f!=null&&f.paperSelection?{paperSelection:f.paperSelection}:{}})};return{pending:c,archiveOld:async()=>{if(c===null){p("old");try{const f=await qr();if(await e(),f.archived_count===0){i({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}n(),i({title:`${f.archived_count} ${f.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(f){i({variant:"destructive",title:"Could not archive old chats",description:f instanceof Error?f.message:"Try again."})}finally{p(null)}}},archiveOldest:async()=>{if(c===null){p("oldest");try{const f=await Fr();await e(),n(),i({title:`${f.archived_count} ${f.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(f){i({variant:"destructive",title:"Could not archive chats",description:f instanceof Error?f.message:"Try again."})}finally{p(null)}}}}}class Rs{constructor(e,r=os){ee(this,"requestId");ee(this,"firstVisibleAt");ee(this,"streamStartReported",!1);ee(this,"firstVisibleReported",!1);ee(this,"terminalReported",!1);ee(this,"semanticReported",new Set);this.submittedAt=e,this.report=r}recordStreamStart(e,r){this.requestId=e,this.streamStartReported||(this.streamStartReported=!0,this.send({submission_to_stream_start_ms:Math.max(0,r-this.submittedAt)})),this.reportFirstVisible()}recordFirstVisible(e){this.firstVisibleAt===void 0&&(this.firstVisibleAt=e,this.reportFirstVisible())}recordSemantic(e,r){if(this.semanticReported.has(e))return;this.semanticReported.add(e);const s=Math.max(0,r-this.submittedAt);this.send(e==="reasoning"?{submission_to_first_reasoning_delta_ms:s}:e==="tool"?{submission_to_first_tool_call_ms:s}:{submission_to_first_answer_delta_ms:s})}recordTerminal(e){this.terminalReported||(this.terminalReported=!0,this.send({terminal_classification:e}))}reportFirstVisible(){!this.requestId||this.firstVisibleAt===void 0||this.firstVisibleReported||(this.firstVisibleReported=!0,this.send({submission_to_first_visible_delta_ms:Math.max(0,this.firstVisibleAt-this.submittedAt)}))}send(e){this.requestId&&this.report(this.requestId,e)}}const ar="Preparing research workspace…",ir={preparing_workspace:"Preparing secure workspace…",starting_agent:"Starting research agent…",connecting_model:"Connecting to model…"},or=()=>({messages:[],sessionId:null,title:"",phase:"idle"});function Ut(t,e){for(let r=t.length-1;r>=0;r-=1)if(e(t[r]))return r;return-1}function Oe(t){if(t.status!==ar&&!Object.values(ir).includes(t.status))return t;const{status:e,...r}=t;return r}function te(t,e){if(!t.length)return t;const r=t.slice();return r[r.length-1]=e(r[r.length-1]),r}function Le(t,e,r){return te(t,s=>{const i=Oe(s),c=i.blocks??[];return{...i,blocks:c.map((p,n)=>e(p,n,c)?r(p):p)}})}function Es(t,e){switch(e.type){case"stream_start":return e.session_id?{...t,sessionId:e.session_id}:t;case"sandbox_start":case"sandbox_ready":case"workspace_ready":return t;case"lifecycle":return{...t,messages:te(t.messages,r=>{var s;return r.role==="assistant"&&r.streaming&&(((s=r.blocks)==null?void 0:s.length)??0)===0?{...r,status:ir[e.phase]}:r})};case"session_title_start":return{...t,title:""};case"session_title_delta":return{...t,title:`${t.title}${e.text}`.replace(/\s+/g," ").slice(0,80)};case"session_title_done":return{...t,title:e.title};case"compaction_status":return{...t,messages:te(t.messages,r=>({...r,compacting:!!(r.streaming&&e.state==="started")}))};case"reasoning_start":return{...t,messages:te(t.messages,r=>{const s=Oe(r);return{...s,blocks:[...(s.blocks??[]).map(i=>i.kind==="reasoning"&&i.active?{...i,active:!1,open:!1}:i),{kind:"reasoning",text:"",active:!0,open:!0}]}})};case"reasoning_delta":return{...t,messages:Le(t.messages,(r,s,i)=>r.kind==="reasoning"&&Ut(i,c=>c.kind==="reasoning")===s,r=>r.kind==="reasoning"?{...r,text:r.text+e.text}:r)};case"reasoning_end":return{...t,messages:te(t.messages,r=>{const s=r.blocks??[],i=Ut(s,n=>n.kind==="reasoning"&&n.active);if(i<0)return r;const c=s[i];if(c.kind!=="reasoning")return r;const p=s[i-1];return(p==null?void 0:p.kind)==="reasoning"&&p.text===c.text?{...r,blocks:s.filter((n,m)=>m!==i)}:{...r,blocks:s.map((n,m)=>m===i?{...c,active:!1,open:!1}:n)}})};case"tool_call":return{...t,messages:te(t.messages,r=>{const s=Oe(r);return{...s,blocks:[...s.blocks??[],{kind:"tool",id:e.id,name:e.name,args:e.args,status:"running",open:!1}]}})};case"tool_call_start":return{...t,messages:te(t.messages,r=>{const s=Oe(r);return{...s,blocks:[...s.blocks??[],{kind:"tool",schema_version:2,id:e.id,name:e.name,args:{},argumentText:"",argumentState:"streaming",arguments_redacted:e.redacted,status:"running",open:!1}]}})};case"tool_call_arguments_delta":return{...t,messages:Le(t.messages,r=>r.kind==="tool"&&r.id===e.id,r=>r.kind==="tool"?{...r,args:e.partial_args,argumentText:e.snapshot?e.delta:`${r.argumentText??""}${e.delta}`,arguments_redacted:r.arguments_redacted||e.redacted}:r)};case"tool_call_arguments_done":return{...t,messages:Le(t.messages,r=>r.kind==="tool"&&r.id===e.id,r=>r.kind==="tool"?{...r,args:e.args,argumentText:JSON.stringify(e.args),argumentState:"done",arguments_redacted:r.arguments_redacted||e.redacted}:r)};case"app_start":return{...t,messages:te(t.messages,r=>{const s=Oe(r);return{...s,blocks:[...s.blocks??[],{kind:"app",schema_version:1,instance_id:e.instance_id,provider:e.provider,server:e.server,tool:e.tool,resource_uri:e.resource_uri,status:"loading",input:e.input,result:{content:[],structuredContent:{},isError:!1},csp:{},permissions:{clipboardWrite:!0},height:525}]}})};case"app_result":return{...t,messages:Le(t.messages,r=>r.kind==="app"&&r.instance_id===e.id,r=>r.kind==="app"?{...r,status:e.status,result:e.result}:r)};case"tool_result":return{...t,messages:Le(t.messages,r=>r.kind==="tool"&&r.id===e.id,r=>r.kind!=="tool"?r:e.status?{...r,schema_version:2,status:e.status,took_ms:e.took_ms,content:e.content,metadata:e.metadata,open:e.status!=="success"}:{...r,status:"done",hits:e.hits,took_ms:e.took_ms,results:e.results})};case"artifact_start":return{...t,messages:te(t.messages,r=>{const s=Oe(r);return{...s,blocks:[...s.blocks??[],{kind:"artifact",schema_version:1,scope:"owner",publication_id:e.publication_id,identifier:e.identifier,artifact_kind:"posterly",title:e.title,status:"generating",phase:"publishing_poster"}]}})};case"artifact_ready":return{...t,messages:Le(t.messages,r=>r.kind==="artifact"&&r.publication_id===e.publication_id,r=>r.kind==="artifact"?{...r,artifact_id:e.artifact_id,version_id:e.version_id,identifier:e.identifier,version:e.version,title:e.title,status:"ready",preview_mime:e.preview_mime,source_language:e.source_language,gate_status:e.gate_status,total_bytes:e.total_bytes,phase:void 0}:r)};case"artifact_error":return{...t,messages:Le(t.messages,r=>r.kind==="artifact"&&r.publication_id===e.publication_id,r=>r.kind==="artifact"?{...r,status:"error",phase:void 0,error_code:e.code,error_message:e.message}:r)};case"answer_delta":return{...t,messages:te(t.messages,r=>{const s=Oe(r),i=s.blocks??[],c=i.at(-1);return(c==null?void 0:c.kind)==="answer"&&!c.done?{...s,blocks:[...i.slice(0,-1),{...c,text:c.text+e.text}]}:{...s,blocks:[...i,{kind:"answer",text:e.text,done:!1}]}})};case"done":return{...t,phase:"complete",messages:te(t.messages,r=>({...r,streaming:!1,compacting:!1,followups:e.followups,finishReason:e.finish_reason,citations:e.citations,blocks:(r.blocks??[]).map(s=>s.kind==="answer"?{...s,done:!0}:s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}))};case"error":return{...t,phase:"failed",messages:te(t.messages,r=>({...r,streaming:!1,compacting:!1,error:e.message,errorCode:e.code,blocks:(r.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s.kind==="tool"&&s.status==="running"?{...s,status:"error",open:!0}:s)}))};default:return t}}function Ts(t){return te(t,e=>{if(e.role!=="assistant")return e;const r=(e.blocks??[]).flatMap(s=>s.kind==="tool"&&s.status==="running"?[{...s,status:"error",open:!0}]:s.kind==="reasoning"&&s.active?s.text?[{...s,active:!1,open:!1}]:[]:s.kind==="answer"?[{...s,done:!0}]:[s]);return{...e,blocks:r,streaming:!1,compacting:!1,finishReason:"stopped"}})}function Cs(t,e){switch(e.type){case"start":return{messages:e.messages,sessionId:e.sessionId,title:"",phase:"streaming"};case"event":return Es(t,e.event);case"load":return{messages:e.messages,sessionId:e.sessionId,title:t.title,phase:"idle"};case"workspace_status":return{...t,messages:te(t.messages,r=>{var s;return r.role==="assistant"&&r.streaming&&(((s=r.blocks)==null?void 0:s.length)??0)===0&&!r.error?{...r,status:ar}:r})};case"clear_workspace_status":return{...t,messages:te(t.messages,Oe)};case"settle":return{...t,phase:"idle",messages:te(t.messages,r=>r.streaming?{...r,streaming:!1,compacting:!1}:r)};case"stop":return{...t,messages:Ts(t.messages),phase:"stopped"};case"toggle_block":return{...t,messages:cr(t.messages,e.messageId,e.blockIndex)};case"reset":return or()}}function cr(t,e,r){return t.map(s=>{var i;return s.id!==e?s:{...s,blocks:(i=s.blocks)==null?void 0:i.map((c,p)=>p===r&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}})}const Ae={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},ks={now:()=>performance.now(),sleep:(t,e)=>new Promise(r=>{if(e!=null&&e.aborted||t<=0){r();return}const s=window.setTimeout(i,t);function i(){e==null||e.removeEventListener("abort",i),window.clearTimeout(s),r()}e==null||e.addEventListener("abort",i,{once:!0})})};function Is(t){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(t.type)}function As(t,e=!1,r=Ae.maxPendingChars){var i;if(!t)return{pieces:[],pending:""};if(e)return{pieces:[t],pending:""};const s=Intl.Segmenter;if(s){const p=[...new s(void 0,{granularity:"word"}).segment(t)].filter(m=>m.isWordLike);let n=0;if(p.length>1&&(n=p.at(-1).index),p.length&&/\s$/u.test(t)&&(n=t.length),n>0){const m=t.slice(0,n),A=[],T=[...new s(void 0,{granularity:"word"}).segment(m)].filter(C=>C.isWordLike);for(let C=0;CB&&A.push(m.slice(B,E))}return T.length||A.push(m),{pieces:A,pending:t.slice(n)}}}else{const c=[...t.matchAll(/\s+/gu)];if(c.length){const p=[];let n=0;for(const m of c){const A=m.index+m[0].length;p.push(t.slice(n,A)),n=A}return{pieces:p,pending:t.slice(n)}}}return t.length>=r?{pieces:[t.slice(0,r)],pending:t.slice(r)}:{pieces:[],pending:t}}function Os(t,e={}){const r={minDelayMs:e.minDelayMs??Ae.minDelayMs,maxDelayMs:e.maxDelayMs??Ae.maxDelayMs,minRateCharsPerMs:e.minRateCharsPerMs??Ae.minRateCharsPerMs,maxBufferedMs:e.maxBufferedMs??Ae.maxBufferedMs,arrivalRateTauMs:e.arrivalRateTauMs??Ae.arrivalRateTauMs,arrivalRateHeadroom:e.arrivalRateHeadroom??Ae.arrivalRateHeadroom,maxPendingChars:e.maxPendingChars??Ae.maxPendingChars},s=e.clock??ks,i=[];let c="",p=null,n=0,m=!0,A=!1,f=null,T=0,C=s.now(),B=!1;const E=()=>{f==null||f(),f=null},N=(x,j)=>{const k=x.type==="reasoning_delta"||x.type==="answer_delta"?x.text.length:0;i.push({kind:"event",event:x,arrivedAt:j,chars:k}),E()},M=x=>{if(!p||!c)return;const j=As(c,x,r.maxPendingChars);for(const k of j.pieces)k&&N({type:p,text:k},n),n=s.now();c=j.pending,c||(p=null)},H=x=>{if(!m)return;const j=s.now();if(x.type==="reasoning_delta"||x.type==="answer_delta"){const k=x.type;if(!x.text)return;if(!B){B=!0,T+=x.text.length,C=j;const G=Array.from(x.text)[0];N({type:k,text:G},j);const P=x.text.slice(G.length);if(P)for(p=k,c=P,n=j,M(!1);c.length>=r.maxPendingChars;)M(!1);return}p&&p!==k&&M(!0),p||(p=k,n=j),c+=x.text;const v=Math.max(0,j-C);for(T*=Math.exp(-v/r.arrivalRateTauMs),T+=x.text.length,C=j,M(!1);c.length>=r.maxPendingChars;)M(!1);return}Is(x)&&M(!0),N(x,j)},$=(async()=>{var x;try{for await(const j of t)H(j);m&&M(!0)}catch(j){m&&!((x=e.signal)!=null&&x.aborted)&&(M(!0),i.push({kind:"error",error:j,arrivedAt:s.now(),chars:0}))}finally{A=!0,E()}})(),V=()=>i.length||A?Promise.resolve():new Promise(x=>{f=x});return{events:async function*(){var j,k,v,G;let x=Number.NEGATIVE_INFINITY;try{for(;;){if(await V(),!i.length){if(A||!m)return;continue}const P=i[0];if(P.kind==="error")throw i.shift(),P.error;if(P.chars&&!((j=e.isHidden)!=null&&j.call(e))){const L=s.now(),Q=i.reduce((de,he)=>de+he.chars,0),re=((k=i.find(de=>de.chars))==null?void 0:k.arrivedAt)??L,X=Math.max(0,r.maxBufferedMs-(L-re)),J=T*Math.exp(-Math.max(0,L-C)/r.arrivalRateTauMs)/r.arrivalRateTauMs,_=X>0?Q/X:Number.POSITIVE_INFINITY,I=Math.max(r.minRateCharsPerMs,J*r.arrivalRateHeadroom,_),l=Math.min(r.maxDelayMs,Math.max(r.minDelayMs,P.chars/I)),O=Math.max(0,P.arrivedAt+r.maxBufferedMs-L),F=Math.max(P.arrivedAt,x+Math.min(l,O));if(await s.sleep(Math.max(0,F-s.now()),e.signal),!m||(v=e.signal)!=null&&v.aborted)return}i.shift(),x=s.now(),yield P.event}}finally{m&&(m=!1,E(),await((G=t.return)==null?void 0:G.call(t,void 0))),await $}}(),takeAcceptedForStop(){var j;if(!m)return[];m=!1,p&&c&&(N({type:p,text:c},n),c="",p=null);const x=i.flatMap(k=>k.kind==="event"&&k.event.type!=="done"&&k.event.type!=="error"?[k.event]:[]);return i.length=0,E(),(j=t.return)==null||j.call(t,void 0),x}}}const Kt=[250,500,1e3],js=(t,e)=>new Promise(r=>{const s=()=>{window.clearTimeout(i),e.removeEventListener("abort",s),r()},i=window.setTimeout(s,t);e.addEventListener("abort",s,{once:!0})});async function*Ds(t,e){let r=t,s=0;for(;;){let i=!1;try{for await(const c of r)(c.type==="done"||c.type==="error")&&(i=!0),yield c;if(i||e.signal.aborted)return;throw new rt}catch(c){e.onDisconnect();const p=e.getSessionId();if(e.signal.aborted||i||!(c instanceof rt)||!p||s>=Kt.length)throw c;if(await js(Kt[s],e.signal),e.signal.aborted)return;s+=1,r=rr(p,{signal:e.signal,afterSequence:e.getAfterSequence(),onSequence:e.onSequence})}}}const $t=new Set(["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"]),Ns=new Set(["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","paper_selection_disabled","paper_selection_requires_reader","paper_selection_paper_mismatch","paper_selection_version_mismatch","paper_selection_page_invalid","paper_selection_too_large","chat_storage_quota_exceeded"]);class Ms{constructor(){ee(this,"configuration");ee(this,"lifecycle",or());ee(this,"_busy",!1);ee(this,"_pendingCapacity",null);ee(this,"_sawStreamStart",!1);ee(this,"_providerExecuted",!1);ee(this,"_providerStatusChanged",!1);ee(this,"terminal","pending");ee(this,"rejection",null)}get busy(){return this._busy}get pendingCapacity(){return this._pendingCapacity}get sawStreamStart(){return this._sawStreamStart}get sawTerminalEvent(){return this.terminal==="complete"||this.terminal==="error"}get streamFailed(){return this.terminal==="error"||this.terminal==="transport_error"}get admissionRejected(){return this.rejection!==null}get shouldRefreshProvider(){return this._sawStreamStart&&this._providerExecuted||this._providerStatusChanged}finish(){this._busy=!1}queueCapacity(e){this._pendingCapacity=e}cancelCapacity(){this._pendingCapacity=null}projectSession(e){return this._busy&&e===this.sessionId?this.messages:null}get state(){return this.lifecycle}get messages(){return this.lifecycle.messages}get sessionId(){return this.lifecycle.sessionId}transition(e){return this.lifecycle=Cs(this.lifecycle,e),this.lifecycle}start(e,r,s){this.configuration=s,this._busy=!0,this._sawStreamStart=this._providerExecuted=this._providerStatusChanged=!1,this.terminal="pending",this.rejection=null,this.transition({type:"start",messages:e,sessionId:r})}restore(e,r=this.sessionId){return this.transition({type:"load",messages:e,sessionId:r})}observe(e){return e.type==="stream_start"&&(this._sawStreamStart=!0,this._providerExecuted=e.provider_execution!==!1),(e.type==="done"||e.type==="error")&&(this.terminal=e.type==="done"?"complete":"error"),e.type==="error"&&$t.has(e.code??"")?(this._providerStatusChanged=!0,!0):!1}reject(e,r){const s=e instanceof Ke?e.code:void 0,i=r&&s==="chat_not_busy"?"completed":s==="chat_temporarily_disabled"?"disabled":s==="chat_capacity"?"capacity":Ns.has(s??"")?"draft":$t.has(s??"")?"provider":"network";return this.terminal=i==="completed"?"already_complete":"transport_error",this.rejection=i==="disabled"||i==="capacity"||i==="draft"?i:null,this._providerStatusChanged||(this._providerStatusChanged=i==="provider"),i}reset(){this._busy=!1,this._pendingCapacity=null,this.transition({type:"reset"})}}const Ls=750;function Fs(t,e){for(let r=t.length-1;r>=0;r-=1)if(e(t[r]))return r;return-1}function Ie(t){const e=d.useRef(t);return d.useLayoutEffect(()=>{e.current=t}),d.useCallback((...r)=>e.current(...r),[])}function qs(t){const[e,r]=d.useState([]),[s,i]=d.useState(!1),[c,p]=d.useState(""),[n]=d.useState(()=>new Ms),m=d.useRef(null),A=d.useRef(null),f=d.useRef(null),T=d.useRef(null),C=d.useRef(!1),B=d.useRef(null),E=d.useRef(null),N=d.useRef("cleared"),M=d.useRef(null),[H,$]=d.useState(null),[V,ae]=d.useState(null),x=d.useRef([]),j=d.useRef(null),k=d.useRef(!1),v=d.useRef(t),G=d.useRef(Ve()),P=d.useRef(0),L=d.useRef(0),Q=d.useRef(t.sessionId);if(Q.current!==t.sessionId){Q.current=t.sessionId;const u=n.projectSession(t.sessionId);u&&r(u),n.sessionId!==t.sessionId&&(L.current+=1,M.current=null)}v.current=t,x.current=e,d.useEffect(()=>()=>{var u;E.current!==null&&window.clearTimeout(E.current),(u=m.current)==null||u.abort(),A.current=null,f.current!==null&&cancelAnimationFrame(f.current),T.current!==null&&window.clearTimeout(T.current),n.cancelCapacity()},[n]),d.useEffect(()=>{n.busy||n.restore(n.messages,t.sessionId)},[t.sessionId,n]),d.useEffect(()=>{const u=n.projectSession(t.sessionId);k.current=u!==null,u&&(r(u),x.current=u)},[t.sessionId,n]);const re=d.useMemo(()=>{const u={};for(const y of e)for(const R of y.blocks??[])if(R.kind==="tool")for(const S of R.results??[])u[S.route_id]=S;return u},[e]),X=()=>`m${++P.current}_${Date.now().toString(36)}`,J=(u,y=!0)=>{const R=n.state,S=n.transition(u),g=u.type==="event"&&u.event.type==="stream_start"?u.event.session_id:null;return g?v.current.onSessionId(g,R.sessionId,n.configuration):S.sessionId&&S.sessionId!==R.sessionId&&v.current.onSessionId(S.sessionId,R.sessionId,n.configuration),S.title!==R.title&&v.current.onTitle(S.title,S.sessionId),y&&(x.current=S.messages,r(S.messages)),S},_=()=>j.current===L.current||k.current,I=()=>{f.current!==null&&(cancelAnimationFrame(f.current),f.current=null),T.current!==null&&(window.clearTimeout(T.current),T.current=null)},l=()=>{I(),document.visibilityState!=="hidden"&&k.current&&(C.current=!1,x.current=n.messages,r(n.messages))},O=()=>{if(!k.current||document.visibilityState==="hidden"||f.current!==null||T.current!==null)return;const u=()=>{f.current=null,T.current=null,l()};typeof requestAnimationFrame=="function"?f.current=requestAnimationFrame(u):T.current=window.setTimeout(u,0)};d.useEffect(()=>{const u=()=>{document.visibilityState==="visible"&&C.current&&O()};return document.addEventListener("visibilitychange",u),()=>document.removeEventListener("visibilitychange",u)});const F=u=>{if(m.current!==u||(E.current!==null&&(window.clearTimeout(E.current),E.current=null),N.current==="cleared"))return;const y=N.current==="shown";N.current="cleared",y&&J({type:"clear_workspace_status"},_())},de=(u,y)=>{E.current!==null&&window.clearTimeout(E.current),N.current="armed",E.current=window.setTimeout(()=>{E.current=null,!(N.current!=="armed"||m.current!==u||u.signal.aborted||L.current!==y)&&(N.current="shown",J({type:"workspace_status"},_()))},Ls)},he=(u,y)=>{const R=M.current;!R||R.controller!==u||R.tracker.recordStreamStart(y,performance.now())},me=(u,y)=>{const R=M.current;!R||R.controller!==u||R.tracker.recordTerminal(y)};d.useLayoutEffect(()=>{const u=M.current;if(!u)return;const y=e.at(-1);if((y==null?void 0:y.role)!=="assistant"||!(y.blocks??[]).some(g=>g.kind==="tool"||g.kind==="reasoning"&&!!g.text.trim()||g.kind==="answer"&&!!g.text.trim()))return;const S=performance.now();u.tracker.recordFirstVisible(S);for(const g of y.blocks??[])g.kind==="reasoning"&&g.text.trim()?u.tracker.recordSemantic("reasoning",S):g.kind==="tool"?u.tracker.recordSemantic("tool",S):g.kind==="answer"&&g.text.trim()&&u.tracker.recordSemantic("answer",S)},[e]);const be=(u,y=!0)=>{J({type:"event",event:u},y)},je=async(u,y)=>{var g;const R=await(v.current.loadSession??mt)(u);let S=Zt(R);return((g=B.current)==null?void 0:g.sessionId)===u&&(S=B.current.messages,B.current=null),L.current!==y&&!(j.current===y&&k.current&&v.current.sessionId===u)?null:(r(S),x.current=S,n.restore(S,u),S)},ge=(u,y,R,S,g,W,U)=>{const Y=++L.current;j.current=Y,k.current=!0;const h=new AbortController;m.current=h;const ve=u.text;return G.current=u,p(""),r(R),n.start(R,y.session_id,U??{model:v.current.initialModel,webSearchEnabled:!!y.web_search_enabled,reasoningEffort:y.reasoning_effort??"low"}),i(!0),M.current=W?null:{controller:h,tracker:new Rs(performance.now())},N.current="cleared",(async()=>{var ue,K,ye,xe,se,Qe;let le=0;const ie=z=>{z>le&&(le=z)};try{const z=W?rr(W,{signal:h.signal,onSequence:ie}):cs(y,{signal:h.signal,onSequence:ie}),Z=Ds(z,{signal:h.signal,getSessionId:()=>n.sessionId,onDisconnect:()=>{!h.signal.aborted&&m.current===h&&be({type:"compaction_status",state:"finished"},_())},getAfterSequence:()=>le,onSequence:ie}),q=!W&&qe()&&is(),ne=q?Os(Z,{signal:h.signal,isHidden:()=>document.visibilityState==="hidden"}):null;ne&&(A.current={controller:h,stream:ne});for await(const D of(ne==null?void 0:ne.events)??Z){if(h.signal.aborted||m.current!==h)break;D.type==="paper_artifact"&&((K=(ue=v.current).onPaperArtifact)==null||K.call(ue,D,n.sessionId)),D.type==="stream_start"&&he(h,D.request_id),D.type==="sandbox_start"&&de(h,Y),(D.type==="sandbox_ready"||D.type==="workspace_ready"||D.type==="lifecycle")&&F(h),(D.type==="reasoning_start"||D.type==="reasoning_delta"||D.type==="tool_call"||D.type==="tool_call_start"||D.type==="tool_call_arguments_delta"||D.type==="tool_call_arguments_done"||D.type==="app_start"||D.type==="app_result"||D.type==="artifact_start"||D.type==="artifact_ready"||D.type==="artifact_error"||D.type==="answer_delta"||D.type==="done"||D.type==="error")&&F(h),n.observe(D)&&_()&&v.current.onInterrupted(u),(D.type==="done"||D.type==="error")&&me(h,D.type==="error"?"error":"complete");const Be=_(),We=Be&&!(q&&document.visibilityState==="hidden"),st=D.type==="reasoning_delta"||D.type==="answer_delta"||D.type==="tool_call_arguments_delta",nt=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta","tool_call_arguments_delta"].includes(D.type);q&&nt&&l(),q&&st?(be(D,!1),C.current||(C.current=Be),O()):(be(D,We),q&&Be&&!We&&(C.current=!0))}}catch(z){if(!h.signal.aborted&&m.current===h){const Z=n.reject(z,!!W),q=Z==="completed";if(F(h),!q)if(Z==="disabled")ae({question:ve,draft:u}),n.restore(S),L.current===Y&&(r(S),x.current=S,p(""));else if(Z==="capacity"){const ne=z instanceof Ke?z.retryAfterSeconds??5:5,D={question:ve,draft:u,request:y,optimistic:R,original:S,edit:g,retryAfterSeconds:ne,retryAt:Date.now()+ne*1e3};n.queueCapacity(D),$({question:ve,draft:u,retryAt:D.retryAt,retryAfterSeconds:ne}),n.restore(S),L.current===Y&&(r(S),x.current=S,p(""))}else me(h,"network_error"),Z==="draft"&&(_()&&v.current.onInterrupted(u),n.restore(S),L.current===Y&&(r(S),x.current=S,p(z instanceof Error?z.message:"The assistant stream failed."))),Z==="provider"&&_()&&v.current.onInterrupted(u);!q&&!n.admissionRejected&&L.current===Y&&be({type:"error",message:z instanceof Error?z.message:"The assistant stream failed.",code:z instanceof Ke?z.code:void 0})}}finally{if(m.current===h){if(((ye=A.current)==null?void 0:ye.controller)===h&&(l(),A.current=null),F(h),!n.sawTerminalEvent&&!h.signal.aborted&&me(h,"network_error"),n.finish(),i(!1),n.admissionRejected)v.current.onSettled(y.session_id);else if(!h.signal.aborted){n.shouldRefreshProvider&&((se=(xe=v.current).onProviderTerminal)==null||se.call(xe));const z=n.sessionId;if(g&&!n.sawStreamStart)n.restore(g.snapshot),L.current===Y&&(r(g.snapshot),x.current=g.snapshot,p("Couldn’t resend this message. Your original conversation was restored."));else if(z){L.current===Y&&g&&(n.streamFailed||!n.sawTerminalEvent)&&(n.restore(g.snapshot),r(g.snapshot),x.current=g.snapshot);try{const Z=await je(z,Y);Z&&g&&Z.some(q=>q.id===g.targetId)&&p("Couldn’t resend this message. Your original conversation was restored.")}catch{L.current===Y&&J({type:"settle"})}}else L.current===Y&&J({type:"settle"});(!m.current||m.current===h)&&v.current.onSettled(z)}((Qe=M.current)==null?void 0:Qe.controller)===h&&(M.current=null)}}})(),!0},ce=Ie(u=>{var ie,ue;const y=typeof u=="string"?Ve(u.trim()):u,R=y.text;if(!R||R.length>8e3||n.busy||n.pendingCapacity)return!1;const S=x.current,g=[...S].reverse().find(K=>K.role==="user"),W=g!=null&&g.status&&g.status!=="complete"&&g.revision?{replace_message_id:g.id,prior_revision:g.revision}:null,U={id:X(),role:"user",text:R,paperMentions:y.paperMentions,paperSelection:y.paperSelection},Y={id:X(),role:"assistant",streaming:!0,blocks:[]},h=W&&g?Fs(S,K=>K.id===g.id):-1,ve=h<0?[...S,U,Y]:[...S.slice(0,h),U,Y],le=(ue=(ie=v.current).viewerContext)==null?void 0:ue.call(ie);return ge(y,{message:R,paper_mentions:y.paperMentions.map(({route_id:K,title:ye,start:xe,end:se})=>({route_id:K,title:ye,start:xe,end:se})),session_id:v.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!v.current.webSearchEnabled,reasoning_effort:v.current.reasoningEffort??"low",...v.current.primaryPaperRouteId?{primary_paper_route_id:v.current.primaryPaperRouteId}:{},...le?{viewer_context:le}:{},...y.paperSelection?{paper_selection:Lt(y.paperSelection)}:{},...!v.current.sessionId&&v.current.initialModel?{initial_model:v.current.initialModel}:{},...W??{}},ve,S)}),we=Ie((u,y)=>{var ie,ue;const R=typeof y=="string"?Ve(y.trim()):y,S=R.text;if(!S||S.length>8e3||n.busy||n.pendingCapacity)return!1;const g=x.current.slice(),W=g.findIndex(K=>K.id===u&&K.role==="user");if(W<0)return!1;const U=g[W];if(!v.current.sessionId||!U.revision)return!1;const Y={id:U.id,role:"user",text:S,paperMentions:R.paperMentions,paperSelection:R.paperSelection,revision:U.revision+1,status:"generating"},h={id:X(),role:"assistant",streaming:!0,blocks:[]},ve=[...g.slice(0,W),Y,h],le=(ue=(ie=v.current).viewerContext)==null?void 0:ue.call(ie);return ge(R,{message:S,paper_mentions:R.paperMentions.map(({route_id:K,title:ye,start:xe,end:se})=>({route_id:K,title:ye,start:xe,end:se})),session_id:v.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!v.current.webSearchEnabled,reasoning_effort:v.current.reasoningEffort??"low",...v.current.primaryPaperRouteId?{primary_paper_route_id:v.current.primaryPaperRouteId}:{},...le?{viewer_context:le}:{},...R.paperSelection?{paper_selection:Lt(R.paperSelection)}:{},replace_message_id:U.id,prior_revision:U.revision},ve,g,{targetId:U.id,snapshot:g})}),De=Ie(()=>{const u=x.current.slice(),y=[...u].reverse().find(g=>g.role==="user");if(!v.current.sessionId||!(y!=null&&y.revision)||n.busy||n.pendingCapacity)return!1;const R=Ve(y.text??"Continue the interrupted response from saved progress."),S=[...u,{id:X(),role:"user",text:R.text,paperMentions:[]},{id:X(),role:"assistant",streaming:!0,blocks:[]}];return ge(R,{message:R.text,session_id:v.current.sessionId,client_message_id:crypto.randomUUID(),retry_message_id:y.id,...v.current.primaryPaperRouteId?{primary_paper_route_id:v.current.primaryPaperRouteId}:{},web_search_enabled:!!v.current.webSearchEnabled,reasoning_effort:v.current.reasoningEffort??"low"},S,u)}),Ee=Ie(()=>{const u=[...x.current].reverse().find(y=>y.role==="user");return u!=null&&u.text?we(u.id,{text:u.text,paperMentions:u.paperMentions??[],...u.paperSelection?{paperSelection:u.paperSelection}:{}}):!1}),Te=d.useCallback(()=>{n.cancelCapacity(),$(null)},[n]),ze=Ie(()=>{const u=n.pendingCapacity;return!u||Date.now(){var U,Y;if(!m.current)return;const u=m.current;F(u),me(u,"stopped"),u.abort();const y=((U=A.current)==null?void 0:U.controller)===u?A.current.stream.takeAcceptedForStop():[];A.current=null;for(const h of y)be(h,!1);l(),m.current=null,((Y=M.current)==null?void 0:Y.controller)===u&&(M.current=null),n.finish(),i(!1);const R=_(),S=J({type:"stop"},!1).messages;R&&(x.current=S,r(S),v.current.onInterrupted(G.current));const g=n.sessionId;g&&(B.current={sessionId:g,messages:S}),g&&Pr(g).catch(()=>{});const W=++L.current;window.setTimeout(()=>{g&&R&&L.current===W?je(g,W).catch(()=>{}).finally(()=>{m.current||v.current.onSettled(g)}):m.current||v.current.onSettled(g)},450)}),Pe=Ie((u,y)=>{const R=k.current?n.transition({type:"toggle_block",messageId:u,blockIndex:y}).messages:cr(x.current,u,y);x.current=R,r(R)}),Ye=d.useCallback(()=>{var u;L.current+=1,E.current!==null&&(window.clearTimeout(E.current),E.current=null),N.current="cleared",(u=m.current)==null||u.abort(),m.current=null,A.current=null,I(),C.current=!1,B.current=null,M.current=null,$(null),n.reset(),j.current=null,k.current=!1,r([]),i(!1),p("")},[n]),Ge=Ie((u,y,R=!1,S)=>{var g;if(L.current+=1,E.current!==null&&(window.clearTimeout(E.current),E.current=null),N.current="cleared",I(),C.current=!1,M.current=null,n.cancelCapacity(),$(null),n.busy&&y!==void 0&&y===n.sessionId){k.current=!0,r(n.messages),x.current=n.messages,p("");return}if(k.current=!1,n.busy||((g=m.current)==null||g.abort(),m.current=null,j.current=null,k.current=!1),R&&y&&!n.busy){const W=[...u].reverse().find(U=>U.role==="user");if(W){const U={text:W.text??"",paperMentions:W.paperMentions??[],...W.paperSelection?{paperSelection:W.paperSelection}:{}},Y=[...u,{id:`${W.id}-active`,role:"assistant",streaming:!0,blocks:[]}];ge(U,{message:U.text,session_id:y,client_message_id:"reconnect",web_search_enabled:!!v.current.webSearchEnabled,reasoning_effort:v.current.reasoningEffort??"low"},Y,u,void 0,y,S);return}}r(u),x.current=u,n.busy||n.restore(u,y??v.current.sessionId),n.busy||i(!1),p("")});return{messages:e,busy:s,activeSessionId:s?n.sessionId:null,activeTitle:n.state.title,activeConfiguration:n.configuration,selectedBusy:s&&n.sessionId===t.sessionId,papers:re,sessionError:c,capacityRequest:H,disabledRequest:V,send:ce,editAndResend:we,retryFromProgress:De,retryLatest:Ee,retryCapacity:ze,cancelCapacity:Te,dismissDisabled:()=>ae(null),stop:Se,toggleBlock:Pe,reset:Ye,load:Ge}}const lr=["chat","openai","usage"],Ps=90,ur="pwc:chat:openai-credits-notice:dismissed";function Ys(t=!0){return $e({queryKey:lr,queryFn:()=>Fe.getOpenAIUsage(),enabled:t,staleTime:3e4,retry:!1,refetchOnWindowFocus:!0})}function Bs(t,e,r){if(!t||e!=="openai"||t.used_percent["chatSessions",t],detail:(t,e)=>["chatSession",t,e]},Us=t=>er({queryKey:Ue.list(t),queryFn:Yr,staleTime:0,refetchOnWindowFocus:!1,retry:!1}),Vt=(t,e)=>er({queryKey:Ue.detail(t,e),queryFn:()=>{if(!e)throw new Error("A saved conversation is required");return mt(e)},staleTime:0,refetchOnWindowFocus:!1,retry:!1}),_e=Ve,Ks=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],$s=()=>{const t=sessionStorage.getItem(tt);if(!t)return null;try{return Gr(JSON.parse(t),t)}catch{}return _e(t)},Vs=({enabled:t,workspaceKey:e,children:r,onAskAiFix:s})=>t?a.jsx(Or,{workspaceKey:e,onAskAiFix:s,children:r}):a.jsx(a.Fragment,{children:r}),zs=({enabled:t,children:e})=>t?a.jsx(jr,{variant:"chat",children:e}):a.jsx(a.Fragment,{children:e}),Gs=({mode:t="general",routeSessionId:e,primaryPaper:r,currentPage:s,paperSelection:i,onPaperSelectionChange:c,onSessionId:p,onReaderSubmit:n,onReaderNewChat:m})=>{var wt,vt,St,xt,Rt,Et,Tt,Ct,kt,It,At,Ot,jt,Dt;const{sessionId:A}=vr(),f=e??(t==="general"?A:void 0),T=Sr(),[C,B]=xr(),{user:E,isLoading:N}=Qt(),M=Rr(),H=(E==null?void 0:E.hf_subject)??null,$=Tr(),V=$e({queryKey:["chatAvailability"],queryFn:()=>Fe.getAvailability(),refetchInterval:3e4,retry:!1,enabled:qe()&&!!E}),ae=((wt=V.data)==null?void 0:wt.status)==="paused"||t==="paper"&&((vt=V.data)==null?void 0:vt.paper_reader_chat_enabled)===!1,x=$e({...Us(H),enabled:!!E&&!N}),j=x.data??[],[k,v]=d.useState(null),[G,P]=d.useState(""),L=o=>{M.setQueryData(Ue.list(H),b=>o(b??[]))},Q=(o,b)=>{L(w=>w.map(oe=>oe.id===o?{...oe,...b}:oe)),M.setQueryData(Ue.detail(H,o),w=>w&&{...w,...b})},re=d.useRef(Br()),X=d.useRef(f??null),J=d.useRef(C.get("model")||((St=re.current)==null?void 0:St.model)),[_,I]=d.useState($?Wr:Hr),[l,O]=d.useState(J.current||ct),F=Ur(_,l),de=es(!!(E&&F==="openrouter")),he=Ys(qe()&&!!E&&F==="openai"),[me,be]=d.useState(()=>Ws()),je=Bs(he.data,F,me),[ge,ce]=d.useState(()=>_e()),[we,De]=d.useState(()=>{var o;return((o=re.current)==null?void 0:o.webSearchEnabled)??!0}),[Ee,Te]=d.useState(()=>{var o;return((o=re.current)==null?void 0:o.reasoningEffort)??"low"}),ze=!!((xt=V.data)!=null&&xt.web_search_available),[Se,Pe]=d.useState(()=>{var b,w;const o=(b=C.get("q"))==null?void 0:b.trim();return o?_e(o):((w=re.current)==null?void 0:w.draft)??_e()}),Ye=d.useRef(!1),Ge=d.useRef(!1),u=d.useRef(!1),[y,R]=d.useState(()=>typeof window>"u"||window.innerWidth>900),S=d.useRef(new Set),g=d.useRef(f);g.current=f;const[W,U]=d.useState(void 0),Y=d.useCallback(async()=>{await M.invalidateQueries({queryKey:Ue.list(H)})},[M,H]),h=qs({sessionId:f??null,initialModel:l,webSearchEnabled:ze&&we,reasoningEffort:Ee,primaryPaperRouteId:t==="paper"?r==null?void 0:r.routeId:void 0,viewerContext:t==="paper"&&s?()=>({page:Math.max(1,Math.min(1e4,s()))}):void 0,loadSession:async o=>{const b=await M.fetchQuery(Vt(H,o));return v(w=>(w==null?void 0:w.sessionId)===o?null:w),b},onSessionId:(o,b,w)=>{M.cancelQueries({queryKey:Ue.list(H)});const oe=new Date().toISOString();L(Re=>Re.some(Ne=>Ne.id===o)?Re.map(Ne=>Ne.id===o?{...Ne,is_busy:!0}:Ne):[{id:o,title:"New chat",selected_model:(w==null?void 0:w.model)??l,created_at:oe,updated_at:oe,message_count:1,is_busy:!0,web_search_enabled:(w==null?void 0:w.webSearchEnabled)??we,reasoning_effort:(w==null?void 0:w.reasoningEffort)??Ee},...Re]),(g.current??null)===b&&o!==b&&(t==="paper"?p==null||p(o):T(`/chat/${o}`,{replace:!0}))},onTitle:(o,b)=>{b&&!S.current.has(b)&&Q(b,{title:o})},onSettled:o=>{o&&Q(o,{is_busy:!1}),M.invalidateQueries({queryKey:lr}),Y()},onProviderTerminal:()=>{M.invalidateQueries({queryKey:ts})},onPaperArtifact:(o,b)=>{b&&v({sessionId:b,descriptor:o.descriptor})},onInterrupted:o=>{ce(o),c==null||c(o.paperSelection)}}),ve=h.send;d.useEffect(()=>{h.capacityRequest&&(ce(h.capacityRequest.draft),c==null||c(h.capacityRequest.draft.paperSelection))},[h.capacityRequest,c]);const le=d.useCallback(o=>{sessionStorage.setItem(tt,JSON.stringify(o)),sessionStorage.setItem(Xe,l),sessionStorage.setItem(Kr,Ee),sessionStorage.setItem($r,we?"1":"0"),sessionStorage.setItem(Ze,"1"),sessionStorage.setItem(et,"1");const b=t==="paper"&&r?`/pdf/${r.routeId}`:g.current?`/chat/${g.current}`:"/chat";window.location.href=Er(b,F==="huggingface")},[t,r,Ee,l,F,we]),ie=d.useCallback((o,b)=>{sessionStorage.setItem(tt,JSON.stringify(o)),sessionStorage.setItem(Xe,l),sessionStorage.removeItem(Ze),sessionStorage.removeItem(et),Pe(_e()),ce(o),c==null||c(o.paperSelection),P(b)},[c,l]),ue=d.useCallback(async o=>{const b=c?i?{...o,paperSelection:i}:{text:o.text,paperMentions:o.paperMentions}:o;if(!E){le(b);return}if(F==="huggingface"&&!Ge.current){if(u.current)return;u.current=!0;try{if(!(await Fe.getInferenceBilling()).connected){if(sessionStorage.getItem(et)==="1"){ie(b,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}le(b);return}Ge.current=!0}catch(w){ie(b,w instanceof Error?w.message:"Could not check Hugging Face authorization.");return}finally{u.current=!1}}if(sessionStorage.removeItem(Ze),!ve(b)){ie(b,"Your prompt was not sent. It is ready to retry.");return}sessionStorage.removeItem(tt),sessionStorage.removeItem(Xe),sessionStorage.removeItem(et),Vr(),re.current=null,ce(_e()),c==null||c(void 0),t==="paper"&&(n==null||n())},[le,t,c,n,i,ie,F,ve,E]);d.useEffect(()=>{if(N||!E)return;const o=sessionStorage.getItem(Xe);o&&O(o),zr().then(oe=>{if(I(oe.items),!g.current){const Re=J.current||o;O(Re&&oe.items.some(Ne=>Ne.id===Re)?Re:oe.default_model)}});const b=$s(),w=sessionStorage.getItem(Ze)==="1";b&&(c==null||c(b.paperSelection),w?Pe(b):ce(b))},[N,c,Y,E]);const K=h.selectedBusy,{load:ye,activeConfiguration:xe}=h,se=$e({...Vt(H,f??null),enabled:!!(f&&E&&!N&&!K),refetchOnMount:"always"}),Qe=!N&&(!E||se.error instanceof zt&&se.error.status===404),z=$e({queryKey:["chatSessionPublicShare",f],queryFn:()=>Fe.getSessionPublicShare(f??""),enabled:t==="general"&&!!f&&Qe,retry:!1}),Z=(Rt=z.data)==null?void 0:Rt.public_path;d.useEffect(()=>{Z&&T(Z,{replace:!0})},[T,Z]);const q=se.data,ne=K||W===(f??null),D=k&&k.sessionId===f?k.descriptor:q==null?void 0:q.latex_paper,Be=(Tt=(Et=[...(q==null?void 0:q.messages)??[]].reverse().find(o=>o.role==="user"&&o.viewer_context))==null?void 0:Et.viewer_context)==null?void 0:Tt.page;d.useLayoutEffect(()=>{const o=f??null;if(W===o)return;if(K){U(o);const w=xe;w&&(w.model&&O(w.model),De(w.webSearchEnabled),Te(w.reasoningEffort));return}if(!o){ye([],null),W!==void 0&&(De(!0),Te("low")),U(null);return}if(!q||se.isFetching)return;U(o),ye(Zt(q),o,q.is_busy,{model:q.selected_model,webSearchEnabled:q.web_search_enabled,reasoningEffort:q.reasoning_effort??"high"}),P(""),O(q.selected_model);const b=o===X.current?re.current:null;De(b?b.webSearchEnabled:q.web_search_enabled),Te(b?b.reasoningEffort:q.reasoning_effort??"high")},[f,K,q,ye,xe,se.isFetching,W]),d.useEffect(()=>{var oe;if(N)return;const o=(oe=C.get("q"))==null?void 0:oe.trim();if(!o)return;Ye.current=!1;const b=C.get("model");b&&O(b),Pe(_e(o));const w=new URLSearchParams(C);w.delete("q"),w.delete("model"),B(w,{replace:!0})},[N,C,B]),d.useEffect(()=>{if(N||h.busy||!Se.text||Ye.current||E&&we&&V.isFetching||f&&!ne)return;const o=window.setTimeout(()=>{if(Ye.current)return;Ye.current=!0,ue(Se).finally(()=>Pe(_e()))},0);return()=>window.clearTimeout(o)},[N,V.isFetching,h.busy,Se,f,ne,ue,E,we]),d.useEffect(()=>{const o=()=>{!E||h.busy||Y()};return window.addEventListener("focus",o),()=>window.removeEventListener("focus",o)},[h.busy,Y,E]);const We=()=>{window.innerWidth<=900&&R(!1),ye([],null),U(null),ce(_e()),c==null||c(void 0),De(!0),Te("low"),t==="paper"?m==null||m():T("/chat")},st=async(o,b)=>{try{const w=await lt(o,{title:b});return S.current.add(o),Q(o,w),!0}catch(w){return P(w instanceof Error?w.message:"Rename failed"),!1}},nt=async o=>{const b=h.busy&&o===h.activeSessionId;if(window.confirm(b?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){b&&h.stop();try{if(b){const w=Date.now()+3e3;for(;(await mt(o)).is_busy;){if(Date.now()>=w)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(Re=>window.setTimeout(Re,150))}}await Qr(o),o===f&&We(),await Y()}catch(w){P(w instanceof Error?w.message:"Delete failed")}}},at=xs({messages:h.messages,refreshSessions:Y,resetChat:h.reset,restoreDraft:ce}),gt=async o=>{const b=l;if(O(o),!f)return!0;try{const w=await lt(f,{selected_model:o});return Q(f,{selected_model:w.selected_model}),P(""),!0}catch(w){return O(b),P(w instanceof Error?w.message:"Model change failed"),!1}},dr=_.some(o=>o.id===ct),fr=async()=>{await gt(ct)&&h.retryLatest()},pr=async o=>{const b=Ee;if(Te(o),!!f)try{const w=await lt(f,{reasoning_effort:o});Q(f,w)}catch(w){Te(b),P(w instanceof Error?w.message:"Effort change failed")}},hr=rs(t==="general"),yt=j.map(o=>o.id===h.activeSessionId&&h.busy?{...o,is_busy:!0,title:S.current.has(o.id)?o.title:h.activeTitle||o.title}:o),fe=yt.find(o=>o.id===f),it=h.messages.length===0,Je=!!(f&&(N||E&&!ne&&!se.isError||z.isFetching||Z)),_t=!ne&&!Je&&((Ct=se.error)==null?void 0:Ct.message),mr=!!((kt=de.data)!=null&&kt.fallback_enabled),gr=c?i?{...ge,paperSelection:i}:{text:ge.text,paperMentions:ge.paperMentions}:ge,bt={onSend:ue,busy:K,onStop:h.stop,draft:gr,onDraftChange:o=>{c?(ce({text:o.text,paperMentions:o.paperMentions}),o.paperSelection!==i&&c(o.paperSelection)):ce(o)},models:_,selectedModel:l,onModelChange:o=>void gt(o),disabled:ae||N||h.busy&&!K,describedBy:ae?"chat-paused-description":void 0,paperMentionsEnabled:!!((It=V.data)!=null&&It.paper_mentions_enabled),paperSelectionEnabled:((At=V.data)==null?void 0:At.paper_reader_selection_enabled)===!0,paperArtifactsEnabled:t==="general"&&((Ot=V.data)==null?void 0:Ot.paper_artifacts_enabled)===!0,webSearchAvailable:ze,webSearchEnabled:we,onWebSearchChange:De,reasoningEffort:Ee,onReasoningEffortChange:o=>void pr(o)};return a.jsx(Vs,{enabled:t==="general",workspaceKey:f??"new-chat",onAskAiFix:o=>{ue(_e(o))},children:a.jsxs("div",{className:`chat-page${t==="paper"?" chat-page--reader":""}`,style:{height:hr},children:[t==="general"&&a.jsx(ws,{sessions:yt,activeSessionId:f,loading:x.isLoading,error:G||((jt=x.error)==null?void 0:jt.message)||"",open:y,onClose:()=>R(!1),onNew:We,onNavigate:o=>{window.innerWidth<=900&&R(!1),T(`/chat/${o}`)},onRename:st,onDelete:o=>void nt(o)}),a.jsx(zs,{enabled:t==="general",children:a.jsxs("section",{className:"chat-main","data-testid":"active-chat-pane",children:[a.jsxs("div",{className:"chat-topbar",children:[t==="general"&&!y&&a.jsx("button",{type:"button",className:"icon-btn",onClick:()=>R(!0),title:"Open sidebar",children:a.jsx(Jt,{})}),t==="paper"&&a.jsx("button",{type:"button",className:"chat-reader-action",onClick:We,children:"New chat"}),a.jsx("span",{className:"chat-topbar-title",children:Je?(fe==null?void 0:fe.title)||"":(fe==null?void 0:fe.title)||(q==null?void 0:q.title)||(it?"":"New chat")}),$&&a.jsx("span",{className:"chat-staging-badge",children:"Staging"}),t==="paper"&&a.jsx(Nt,{className:"chat-reader-action",to:"/chat",children:"All chats"}),t==="general"&&(fe==null?void 0:fe.primary_paper)&&a.jsx(Nt,{className:"chat-reader-action",to:`/pdf/${fe.primary_paper.route_id}`,onClick:o=>{if(!He()){o.preventDefault();return}const b=fe.primary_paper.route_id;sessionStorage.setItem(`pwc:reader:session:${b}`,fe.id),Be&&sessionStorage.setItem(`pwc:reader:page:${b}`,String(Be))},children:"Open reader"}),f&&ne&&!it&&a.jsx(vs,{sessionId:f,busy:K,loading:Je,hasPaperSelection:h.messages.some(o=>!!o.paperSelection),onError:P})]}),je&&a.jsxs("div",{className:"chat-credits-notice",role:"status",children:[a.jsx("span",{children:je.message}),a.jsx("button",{type:"button",className:"chat-credits-notice-close","aria-label":"Dismiss credits notice",onClick:()=>{Hs(je.resetsAt),be(je.resetsAt)},children:"×"})]}),t==="general"&&D&&a.jsx(Ss,{descriptor:D}),Je&&!Se.text?a.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[a.jsx(Xt,{}),a.jsx("span",{children:"Loading conversation…"})]}):_t?a.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[a.jsx("p",{children:_t}),a.jsx("button",{type:"button",onClick:()=>{se.refetch()},children:"Try again"})]}):it&&!Se.text?a.jsx("div",{className:"chat-empty",children:a.jsxs("div",{className:"chat-empty-inner",children:[a.jsx("div",{className:"chat-empty-eyebrow",children:t==="paper"?"Paper chat":"Research chat"}),a.jsx("h1",{className:"chat-empty-title",children:t==="paper"?"Ask about this paper":a.jsxs(a.Fragment,{children:["Ask ",a.jsx("em",{children:"Papers With Code"})]})}),a.jsx("p",{className:"chat-empty-sub",children:t==="paper"?"Questions are grounded in the open paper. Add up to three other papers with @.":"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),$&&a.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),a.jsx(Ht,{variant:"empty",composerProps:bt,provider:F,paused:ae,error:h.sessionError,suggestions:t==="paper"?Ks:Xr})]})}):a.jsxs(a.Fragment,{children:[a.jsx(hs,{messages:h.messages,papers:h.papers,busy:K,queuedDraft:Se.text?Se:void 0,paperMentionsEnabled:!!((Dt=V.data)!=null&&Dt.paper_mentions_enabled),archivePending:at.pending,openRouterFallbackEnabled:mr,onToggleBlock:h.toggleBlock,onEditAndResend:h.editAndResend,onRetryFromProgress:h.retryFromProgress,onRetryWithLuna:dr?()=>void fr():void 0,onArchiveOld:()=>void at.archiveOld(),onArchiveOldest:()=>void at.archiveOldest()}),a.jsx(Ht,{variant:"followup",composerProps:bt,provider:F,paused:ae,error:h.sessionError})]})]})}),h.capacityRequest&&a.jsx(ms,{retryAt:h.capacityRequest.retryAt,onCancel:h.cancelCapacity,onRetry:()=>{h.retryCapacity()&&(ce(_e()),c==null||c(void 0))}}),h.disabledRequest&&a.jsx(gs,{onClose:()=>{var b;const o=((b=h.disabledRequest)==null?void 0:b.draft)??ge;ce(o),c==null||c(o.paperSelection),h.dismissDisabled(),V.refetch()}})]})})},Qs=t=>{const{user:e}=Qt();return a.jsx(Gs,{...t},(e==null?void 0:e.hf_subject)??"guest")},Cn=()=>a.jsx(Qs,{});export{Qs as ChatExperience,Cn as default}; diff --git a/assets/ConferenceDetailView-C7dSxojX.js b/assets/ConferenceDetailView-B6czFOLF.js similarity index 91% rename from assets/ConferenceDetailView-C7dSxojX.js rename to assets/ConferenceDetailView-B6czFOLF.js index b5a6cf159b039598d9b05b53915f90f355861d55..29ba66f5f1ed689b075f2f276b4f3a7ba45d28c4 100644 --- a/assets/ConferenceDetailView-C7dSxojX.js +++ b/assets/ConferenceDetailView-B6czFOLF.js @@ -1 +1 @@ -import{u as L,r as D,j as e,L as p}from"./index-CA09r0fx.js";import{u as T}from"./useQuery-GCOPnmOE.js";import{M as F}from"./MarkdownText-B-6pg9rW.js";import{c as A}from"./catalog-C6oGGh8I.js";import{c as B,h as C,d as E}from"./colors-C6t5MKud.js";import{S as f}from"./skeleton-CiNN3v7Q.js";import{A as P,a as z}from"./alert-DRS5VQLi.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";/* empty css */import"./PaperPreviewLink-DUf7c7wv.js";import"./index-BeqN5AbC.js";import"./index-qKrWNpd1.js";import"./katex-DkKDou_j.js";import"./hover-card-0saQl8Kd.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-2SfezChA.js";import"./useMutation-CUMX1r3q.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},re=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?O(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{re as default}; +import{u as L,r as D,j as e,L as p}from"./index-DGz7IJy3.js";import{u as T}from"./useQuery-SnJNmisF.js";import{M as F}from"./MarkdownText-CswmrT4z.js";import{c as A}from"./catalog-CI50zqwR.js";import{c as B,h as C,d as E}from"./colors-YtiKVy3X.js";import{S as f}from"./skeleton-Qth9DQSW.js";import{A as P,a as z}from"./alert-CfvggGdB.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";/* empty css */import"./PaperPreviewLink-DUJYnY2B.js";import"./index-DyDOGuaE.js";import"./index-CEcXuWDB.js";import"./katex-DkKDou_j.js";import"./hover-card-32Q2qmuv.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-CgK5TA59.js";import"./useMutation-B1oRtfbH.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},re=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?O(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{re as default}; diff --git a/assets/ConferenceTaskView-DFHaiufu.js b/assets/ConferenceTaskView-WdW5o_l9.js similarity index 84% rename from assets/ConferenceTaskView-DFHaiufu.js rename to assets/ConferenceTaskView-WdW5o_l9.js index b12f69740777f02376928c5ed33de15619b28731..ed1fda618572a17941aadb0b86686619963efa28 100644 --- a/assets/ConferenceTaskView-DFHaiufu.js +++ b/assets/ConferenceTaskView-WdW5o_l9.js @@ -1 +1 @@ -import{u as $,d as W,r as P,j as e,L as y,F as G}from"./index-CA09r0fx.js";import{u as M}from"./useQuery-GCOPnmOE.js";import{P as J}from"./components-CHZvyPkS.js";import{P as X}from"./PaperFeedFilters-Ci7HUJiL.js";import{a as Y,P as Z,b as ee}from"./PaperDateFilter-DhUC4jzf.js";import{M as h}from"./MarkdownText-B-6pg9rW.js";import{c as z}from"./catalog-C6oGGh8I.js";import{t as se,d as ae}from"./colors-C6t5MKud.js";import{d as te}from"./usePapers-Bb48_cnL.js";import{u as re}from"./useIntersectionObserver-jfqowp0n.js";import{S as ne}from"./skeleton-CiNN3v7Q.js";import{A as ie,a as oe}from"./alert-DRS5VQLi.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-U9FJMhfb.js";import"./papers-2SfezChA.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D6rzCRBR.js";/* empty css */import"./PaperPreviewLink-DUf7c7wv.js";import"./index-BeqN5AbC.js";import"./index-qKrWNpd1.js";import"./katex-DkKDou_j.js";import"./hover-card-0saQl8Kd.js";import"./useMutation-CUMX1r3q.js";import"./useInfiniteQuery-TrlVUjws.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Be=()=>{var A,L,O,T,B,D;const{confSlug:t,taskSlug:n}=$(),[o,u]=W(),w=le(o.get("order_by")),S=o.get("has_code")==="true",k=o.get("has_hf_artifacts")==="true",f=Y(o),I=a=>{const s=new URLSearchParams(o);s.set("order_by",a),u(s)},q=a=>{const s=new URLSearchParams(o);a?s.set("has_code","true"):s.delete("has_code"),u(s)},Q=a=>{const s=new URLSearchParams(o);a?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),u(s)},R=n==="all",N=n==="oral",_=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",x=l||d,p=R||N||_||l||d,K=p?void 0:n,U=N?"oral":_?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",t],queryFn:()=>z.getConference(t),enabled:!!t,staleTime:10*60*1e3}),j=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=te({conferenceSlug:t||"",taskSlug:K,presentation:U,page_size:12,order_by:w,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:k,start_date:f.startDate,end_date:f.endDate,enabled:!!t}),{targetRef:V,isIntersecting:C}=re({rootMargin:"200px"});P.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),P.useEffect(()=>{window.scrollTo(0,0)},[t,n]);const v=P.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(c=>c.results)},[i.data]),b=P.useMemo(()=>v.map(se),[v]),g=R?"All papers":N?"Oral papers":_?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":ae(((A=j.data)==null?void 0:A.name)||n||"",((L=j.data)==null?void 0:L.slug)||n),F=((T=(O=i.data)==null?void 0:O.pages[0])==null?void 0:T.count)??((B=m.data)==null?void 0:B.paper_count)??0,r=j.data;return m.error||j.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(oe,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(y,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:`/conferences/${t}`,children:((D=m.data)==null?void 0:D.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&t==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&t==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&t==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:F.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:a=>{var s,c;(c=(s=a.currentTarget.parentElement)==null?void 0:s.parentElement)==null||c.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:x?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",F.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!x&&e.jsx("div",{className:"sort-options",children:ce.map(([a,s])=>e.jsx("button",{className:`sort-btn ${w===a?"active":""}`,onClick:()=>I(a),children:s},a))}),e.jsx(X,{hasCode:S,hasHfArtifacts:k,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!x})]}),e.jsx(Z,{startDate:f.startDate,endDate:f.endDate,onChange:a=>u(ee(o,a))}),!x&&e.jsxs("div",{className:"results-count",children:[b.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,s)=>e.jsx(ne,{className:"h-40 w-full"},s))}):b.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,s)=>{var E;const c=(E=v[s])==null?void 0:E.conference_award,H=c==="outstanding"?"Outstanding Paper":c==="honorable_mention"?"Honorable Mention":c==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(G.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(J,{paper:a,rank:s+1})]},a.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Be as default}; +import{u as $,d as W,r as P,j as e,L as y,F as G}from"./index-DGz7IJy3.js";import{u as M}from"./useQuery-SnJNmisF.js";import{P as J}from"./components-C75Gxt6c.js";import{P as X}from"./PaperFeedFilters-BIXkRwGe.js";import{a as Y,P as Z,b as ee}from"./PaperDateFilter-C6KBd0r-.js";import{M as h}from"./MarkdownText-CswmrT4z.js";import{c as z}from"./catalog-CI50zqwR.js";import{t as se,d as ae}from"./colors-YtiKVy3X.js";import{d as te}from"./usePapers-knk68Pd9.js";import{u as re}from"./useIntersectionObserver-B7kBuOiP.js";import{S as ne}from"./skeleton-Qth9DQSW.js";import{A as ie,a as oe}from"./alert-CfvggGdB.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DtD88QQA.js";import"./papers-CgK5TA59.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-VInL7Z23.js";/* empty css */import"./PaperPreviewLink-DUJYnY2B.js";import"./index-DyDOGuaE.js";import"./index-CEcXuWDB.js";import"./katex-DkKDou_j.js";import"./hover-card-32Q2qmuv.js";import"./useMutation-B1oRtfbH.js";import"./useInfiniteQuery-Bix5WR2s.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Be=()=>{var A,L,O,T,B,D;const{confSlug:t,taskSlug:n}=$(),[o,u]=W(),w=le(o.get("order_by")),S=o.get("has_code")==="true",k=o.get("has_hf_artifacts")==="true",f=Y(o),I=a=>{const s=new URLSearchParams(o);s.set("order_by",a),u(s)},q=a=>{const s=new URLSearchParams(o);a?s.set("has_code","true"):s.delete("has_code"),u(s)},Q=a=>{const s=new URLSearchParams(o);a?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),u(s)},R=n==="all",N=n==="oral",_=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",x=l||d,p=R||N||_||l||d,K=p?void 0:n,U=N?"oral":_?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",t],queryFn:()=>z.getConference(t),enabled:!!t,staleTime:10*60*1e3}),j=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=te({conferenceSlug:t||"",taskSlug:K,presentation:U,page_size:12,order_by:w,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:k,start_date:f.startDate,end_date:f.endDate,enabled:!!t}),{targetRef:V,isIntersecting:C}=re({rootMargin:"200px"});P.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),P.useEffect(()=>{window.scrollTo(0,0)},[t,n]);const v=P.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(c=>c.results)},[i.data]),b=P.useMemo(()=>v.map(se),[v]),g=R?"All papers":N?"Oral papers":_?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":ae(((A=j.data)==null?void 0:A.name)||n||"",((L=j.data)==null?void 0:L.slug)||n),F=((T=(O=i.data)==null?void 0:O.pages[0])==null?void 0:T.count)??((B=m.data)==null?void 0:B.paper_count)??0,r=j.data;return m.error||j.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(oe,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(y,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:`/conferences/${t}`,children:((D=m.data)==null?void 0:D.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&t==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&t==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&t==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:F.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:a=>{var s,c;(c=(s=a.currentTarget.parentElement)==null?void 0:s.parentElement)==null||c.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:x?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",F.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!x&&e.jsx("div",{className:"sort-options",children:ce.map(([a,s])=>e.jsx("button",{className:`sort-btn ${w===a?"active":""}`,onClick:()=>I(a),children:s},a))}),e.jsx(X,{hasCode:S,hasHfArtifacts:k,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!x})]}),e.jsx(Z,{startDate:f.startDate,endDate:f.endDate,onChange:a=>u(ee(o,a))}),!x&&e.jsxs("div",{className:"results-count",children:[b.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,s)=>e.jsx(ne,{className:"h-40 w-full"},s))}):b.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,s)=>{var E;const c=(E=v[s])==null?void 0:E.conference_award,H=c==="outstanding"?"Outstanding Paper":c==="honorable_mention"?"Honorable Mention":c==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(G.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(J,{paper:a,rank:s+1})]},a.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Be as default}; diff --git a/assets/ConferencesIndexView-CXqn0qBf.js b/assets/ConferencesIndexView-DKn6lpPt.js similarity index 85% rename from assets/ConferencesIndexView-CXqn0qBf.js rename to assets/ConferencesIndexView-DKn6lpPt.js index 412b938450193258bc30127e1282386677f28396..53c7351b41ef7b295f47176f81f135a84998e4b8 100644 --- a/assets/ConferencesIndexView-CXqn0qBf.js +++ b/assets/ConferencesIndexView-DKn6lpPt.js @@ -1 +1 @@ -import{r as p,j as e,L as d}from"./index-CA09r0fx.js";import{u}from"./useQuery-GCOPnmOE.js";import{c as f}from"./catalog-C6oGGh8I.js";import{S as m}from"./skeleton-CiNN3v7Q.js";import{A as h,a as g}from"./alert-DRS5VQLi.js";import{T as x}from"./TaxonomySuggestionTile-Dc-tCzey.js";import"./SignInToEditDialog-Ub_UIzh4.js";import"./button-BkpxXw_S.js";import"./input-CtSl48Mp.js";import"./textarea-FDLjm_7X.js";import"./searchable-select-CNl4nXvO.js";import"./popover-D6rzCRBR.js";import"./dialog-BMl1SbyK.js";import"./loader-circle-DTsjFZ6p.js";import"./useMutation-CUMX1r3q.js";import"./submissions-CERjLe5i.js";import"./plus-BGozleiT.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},z=()=>{const r=u({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=p.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{z as default}; +import{r as p,j as e,L as d}from"./index-DGz7IJy3.js";import{u}from"./useQuery-SnJNmisF.js";import{c as f}from"./catalog-CI50zqwR.js";import{S as m}from"./skeleton-Qth9DQSW.js";import{A as h,a as g}from"./alert-CfvggGdB.js";import{T as x}from"./TaxonomySuggestionTile-BM3W4_sv.js";import"./SignInToEditDialog-POB2dswN.js";import"./button-DEdvni-v.js";import"./input-DVdOE4Xl.js";import"./textarea-BC6nB3vb.js";import"./searchable-select-C2BNEPyI.js";import"./popover-VInL7Z23.js";import"./dialog-DRb-cMlG.js";import"./loader-circle-DZdOKwBN.js";import"./useMutation-B1oRtfbH.js";import"./submissions-0YkeXTxt.js";import"./plus-v7R1dHou.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},z=()=>{const r=u({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=p.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{z as default}; diff --git a/assets/CronDashboard-C1SJZEYw.js b/assets/CronDashboard-ax5sO8xp.js similarity index 98% rename from assets/CronDashboard-C1SJZEYw.js rename to assets/CronDashboard-ax5sO8xp.js index 9ae7255dca3573a3539cfdfbb4c73ced9510ba70..53d9b03c456b5bf048ef72c5fa8c420a1c4384b9 100644 --- a/assets/CronDashboard-C1SJZEYw.js +++ b/assets/CronDashboard-ax5sO8xp.js @@ -1,4 +1,4 @@ -import{g as J,r as h,z as rs,q as ns,j as e,p as le,a4 as ts,R as is,I as cs,t as me,P as ls,w as os,B as Re,x as A,m as Fe,L as xe,a as ds,f as ms}from"./index-CA09r0fx.js";import{u as X}from"./useQuery-GCOPnmOE.js";import{f as _,C as v,a as b,b as y,c as q,d as f,o as ve}from"./operations-CpjCuL3Z.js";import{B as S}from"./badge-CkrPEkl0.js";import{B as C}from"./button-BkpxXw_S.js";import{C as us}from"./chevron-down-MPck50eR.js";import{D as fe}from"./database-CzCP8SRb.js";import{T as hs}from"./trending-up-DpdmhQm9.js";import{A as ie}from"./activity-CKk220MX.js";import{F as _e}from"./file-text-7GwUpKU3.js";import{T as Te,I as xs}from"./triangle-alert-CFbLex2p.js";import{S as Ae}from"./shield-alert-DFYdQl7U.js";import{E as ee}from"./external-link-b6zNfUPN.js";import{C as se,R as Ne}from"./refresh-cw-D8COsQ3x.js";import{L as I}from"./loader-circle-DTsjFZ6p.js";import{C as pe}from"./circle-check-CO6G-kzo.js";import{u as D}from"./useMutation-CUMX1r3q.js";import{r as ps,f as gs,h as js,j as vs,p as fs,k as _s,A as Ns,l as bs}from"./codexAddEvals-CBVUQwDQ.js";import{u as ys}from"./useInfiniteQuery-TrlVUjws.js";import{p as Ee}from"./paperEdits-BaXeJ-Bi.js";import{c as ue}from"./catalog-C6oGGh8I.js";import{c as be}from"./chat-XoDxf8nx.js";/** +import{g as J,r as h,z as rs,q as ns,j as e,p as le,a4 as ts,R as is,I as cs,t as me,P as ls,w as os,B as Re,x as A,m as Fe,L as xe,a as ds,f as ms}from"./index-DGz7IJy3.js";import{u as X}from"./useQuery-SnJNmisF.js";import{f as _,C as v,a as b,b as y,c as q,d as f,o as ve}from"./operations-C37-eWov.js";import{B as S}from"./badge-CE-3yZlW.js";import{B as C}from"./button-DEdvni-v.js";import{C as us}from"./chevron-down-CzLvLwcd.js";import{D as fe}from"./database-7GRYiOb3.js";import{T as hs}from"./trending-up-E7e_PcEb.js";import{A as ie}from"./activity-zaQ-sruD.js";import{F as _e}from"./file-text-BHDe9k9N.js";import{T as Te,I as xs}from"./triangle-alert-C4uGz6dq.js";import{S as Ae}from"./shield-alert-BJn-Krlm.js";import{E as ee}from"./external-link-ChfVBxLK.js";import{C as se,R as Ne}from"./refresh-cw-By5_OblM.js";import{L as I}from"./loader-circle-DZdOKwBN.js";import{C as pe}from"./circle-check-vSqohmZs.js";import{u as D}from"./useMutation-B1oRtfbH.js";import{r as ps,f as gs,h as js,j as vs,p as fs,k as _s,A as Ns,l as bs}from"./codexAddEvals-BRqTpMyJ.js";import{u as ys}from"./useInfiniteQuery-Bix5WR2s.js";import{p as Ee}from"./paperEdits-BtAPUkKl.js";import{c as ue}from"./catalog-CI50zqwR.js";import{c as be}from"./chat-C_06RcUY.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ExternalSourceEvalBadge-C5MLELvC.js b/assets/ExternalSourceEvalBadge-ChPSpdTg.js similarity index 94% rename from assets/ExternalSourceEvalBadge-C5MLELvC.js rename to assets/ExternalSourceEvalBadge-ChPSpdTg.js index dcd52159ffcb6d7fb868fde684813e409b6659b7..8b88ab34ae94e9eb4d4d0698e396acf5c64dae38 100644 --- a/assets/ExternalSourceEvalBadge-C5MLELvC.js +++ b/assets/ExternalSourceEvalBadge-ChPSpdTg.js @@ -1 +1 @@ -import{b as o}from"./papers-2SfezChA.js";import{a1 as g,j as a,L as l}from"./index-CA09r0fx.js";import{H as u,a as c,b as d}from"./hover-card-0saQl8Kd.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{b as o}from"./papers-CgK5TA59.js";import{a1 as g,j as a,L as l}from"./index-DGz7IJy3.js";import{H as u,a as c,b as d}from"./hover-card-32Q2qmuv.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-B8_X5TkM.js b/assets/FeedView-DmNv9H2e.js similarity index 91% rename from assets/FeedView-B8_X5TkM.js rename to assets/FeedView-DmNv9H2e.js index a65873e5ec09bfa68d3807196adfe8801ff8dd18..162fdbc54c1475cabaa635079f3c52bc93ec341e 100644 --- a/assets/FeedView-B8_X5TkM.js +++ b/assets/FeedView-DmNv9H2e.js @@ -1 +1 @@ -import{j as e,H as te,L as p,b as ee,c as re,d as ne,r as h,i as z,e as se,C as ie,f as oe}from"./index-CA09r0fx.js";import{d as U,t as Y}from"./colors-C6t5MKud.js";import{L as le,F as ce,B as de,M as he}from"./mail-DhwziyiT.js";import{P as me}from"./plus-BGozleiT.js";import{r as Q}from"./research-CAknkOM8.js";import{P as pe}from"./components-CHZvyPkS.js";import{M as ue,S as L}from"./chatPrompts-BzPGjXPj.js";import{P as ge}from"./PaperFeedFilters-Ci7HUJiL.js";import{r as fe,P as xe,w as je}from"./PaperDateFilter-DhUC4jzf.js";import{D as be,u as we,P as ye,M as ve,S as Ne,a as ke,R as _e,W as Se,A as Pe,b as Le,q as Ae,c as Te}from"./chatLaunch-CutMsO9s.js";import{c as Ce}from"./chat-XoDxf8nx.js";import{c as V}from"./catalog-C6oGGh8I.js";import{u as Fe}from"./usePapers-Bb48_cnL.js";import{u as Ee}from"./useIntersectionObserver-jfqowp0n.js";import{S as _}from"./skeleton-CiNN3v7Q.js";import{A as Me,a as De}from"./alert-DRS5VQLi.js";import{u as I}from"./useQuery-GCOPnmOE.js";import{u as Re}from"./useInfiniteQuery-TrlVUjws.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-U9FJMhfb.js";import"./papers-2SfezChA.js";import"./safeExternalHref-CkBrsh84.js";import"./AgentLogos-e-hYOTh0.js";import"./popover-D6rzCRBR.js";import"./chevron-down-MPck50eR.js";import"./earth-gRrLiaVn.js";function X({signedIn:r,popularTasks:u=[]}){const o=[...r?[]:[e.jsx(e.Fragment,{children:"Sign in with your Hugging Face account. Your follows stay private."})],e.jsxs(e.Fragment,{children:["Open any task, method, benchmark, author, or organization page and click"," ",e.jsxs("span",{className:"following-intro-pill",children:[e.jsx(me,{"aria-hidden":"true"}),"Follow"]}),"."]}),e.jsxs(e.Fragment,{children:["New papers and benchmark results from everything you follow appear here, ranked like the trending feed. You can also get them as a weekly email from ",e.jsx(p,{to:"/settings",children:"Settings"}),"."]})];return e.jsxs("section",{className:"following-intro","aria-labelledby":"following-intro-title",children:[e.jsx("h2",{id:"following-intro-title",children:"Build your personal research feed"}),e.jsx("p",{className:"following-intro-lead",children:"Follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),e.jsx("ol",{className:"following-intro-steps",children:o.map((i,l)=>e.jsxs("li",{children:[e.jsx("span",{"aria-hidden":"true",children:l+1}),e.jsx("p",{children:i})]},l))}),!r&&e.jsx("div",{className:"following-intro-signin",children:e.jsx(te,{returnTo:"/following",label:"Sign in to start following"})}),e.jsxs("div",{className:"following-intro-browse",children:[e.jsxs(p,{to:"/tasks",children:[e.jsx(le,{"aria-hidden":"true"}),"Browse tasks"]}),e.jsxs(p,{to:"/methods",children:[e.jsx(ce,{"aria-hidden":"true"}),"Browse methods"]}),e.jsxs(p,{to:"/organizations",children:[e.jsx(de,{"aria-hidden":"true"}),"Browse organizations"]}),r&&e.jsxs(p,{to:"/settings",children:[e.jsx(he,{"aria-hidden":"true"}),"Weekly email"]})]}),u.length>0&&e.jsxs("div",{className:"following-intro-popular",children:[e.jsx("h3",{children:"Popular tasks to follow"}),e.jsx("div",{children:u.map(i=>e.jsx(p,{to:`/tasks/${i.slug}`,children:U(i.name,i.slug)},i.id))})]})]})}const He=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],J=45,Oe=1800,Ie=25,qe=350,Be=r=>{const[u,o]=h.useState(L[0].slice(0,1));return h.useEffect(()=>{var f,b;if(!r)return;if((b=(f=window.matchMedia)==null?void 0:f.call(window,"(prefers-reduced-motion: reduce)"))!=null&&b.matches){o(L[0]);return}let i=0,l=1,c=!1,g;o(L[0].slice(0,l));const m=()=>{const w=L[i];if(!c){if(l+=1,o(w.slice(0,l)),l===w.length){c=!0,g=window.setTimeout(m,Oe);return}g=window.setTimeout(m,J);return}if(l-=1,o(w.slice(0,l)),l===0){c=!1,i=(i+1)%L.length,g=window.setTimeout(m,qe);return}g=window.setTimeout(m,Ie)};return g=window.setTimeout(m,J),()=>window.clearTimeout(g)},[r]),u},$e=r=>r==="trending"||r==="date_published"||r==="citation_count"?r:"trending",ze=()=>{var R,M;const r=ee(),u=se(),o=oe()?Ne:ke,[i,l]=h.useState({text:"",paperMentions:[]}),c=i.text,[g,m]=h.useState(0),[f,b]=h.useState(be),[w,q]=h.useState(!0),[A,T]=h.useState("low"),[j,C]=h.useState(!1),[F,S]=h.useState(null),y=Be(!c),P=h.useRef(null),D=I({queryKey:["chatAvailability"],queryFn:()=>Ce.getAvailability(),retry:!1,enabled:z()}),B=!!((R=D.data)!=null&&R.web_search_available),v=z()&&((M=D.data)==null?void 0:M.paper_mentions_enabled)!==!1,a=we({draft:i,onChange:l,enabled:v,textareaRef:P});h.useLayoutEffect(()=>{const n=P.current;if(!n)return;const d=()=>{if(n.style.height="auto",c){n.style.height=`${Math.min(n.scrollHeight,160)}px`;return}const x=n.placeholder,N=L.reduce((k,H)=>(n.placeholder=H,Math.max(k,n.scrollHeight)),0);n.placeholder=x,n.style.height=`${Math.min(N,160)}px`};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[c]);const E=async(n=i)=>{const d=n.text.trim();if(!(!d||j)){if(u){const x=new URLSearchParams({q:d,model:f}),N=`${ie}?${x}`,k=window.open(N,"_blank");if(!k){S(N);return}k.opener=null,S(null),l({text:"",paperMentions:[]});return}C(!0),Ae(n,f,{webSearchEnabled:w,reasoningEffort:A});try{const x=await Te(f,A);r(`/chat/${x.id}`)}catch{r("/chat")}}};return e.jsxs(e.Fragment,{children:[!u&&e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(ye,{text:i.text,mentions:i.paperMentions,scrollTop:g,variant:"home"}),e.jsx("textarea",{ref:P,rows:1,value:c,placeholder:y,"aria-label":"Ask the assistant",disabled:j,onChange:n=>a.updateText(n.target.value,n.target.selectionStart),onSelect:n=>a.refresh(n.currentTarget.selectionStart),onClick:n=>a.refresh(n.currentTarget.selectionStart),onScroll:n=>m(n.currentTarget.scrollTop),onBlur:n=>{var d,x;(x=(d=n.relatedTarget)==null?void 0:d.closest)!=null&&x.call(d,".chat-paper-picker")||window.setTimeout(a.close,0)},onKeyDown:n=>{a.keyDown(n)||n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),E())},role:v?"combobox":void 0,"aria-expanded":v?a.open:void 0,"aria-controls":a.open?a.pickerId:void 0,"aria-activedescendant":a.open&&a.results.length?`${a.optionIdPrefix}-${a.activeIndex}`:void 0,"aria-autocomplete":v?"list":void 0,"aria-describedby":a.message?"ask-home-paper-mention-message":void 0})]}),F&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:F,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),a.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:a.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(ve,{models:o,selectedModel:f,onModelChange:b}),!u&&e.jsx(_e,{value:A,onChange:T,disabled:j}),B&&e.jsx(Se,{enabled:w,onChange:q,disabled:j})]}),e.jsx("button",{type:"button",className:`chat-send${c.trim()?" chat-send-on":""}`,onClick:()=>void E(),disabled:!c.trim()||j,"aria-label":"Ask the assistant",children:e.jsx(Pe,{})})]}),e.jsx(Le,{open:a.open,query:a.query,results:a.results,activeIndex:a.activeIndex,loading:a.loading,error:a.error,onSelect:a.select,id:a.pickerId,optionIdPrefix:a.optionIdPrefix})]})]})},ae={task:"Task",method:"Method",benchmark:"Benchmark",author:"Author",organization:"Org"},Z=Object.keys(ae),fs=({following:r=!1})=>{var x,N,k,H,K,W,G;const u=ee(),o=re(),i=o==null?void 0:o.user,[l,c]=ne(),g=$e(l.get("order_by")),m=fe(l,void 0,r?"month":"week"),f=l.get("has_code")==="true",b=l.get("has_hf_artifacts")==="true",w=s=>{const t=new URLSearchParams(l);t.set("order_by",s),r?u(`/?${t}`):c(t)},q=s=>{const t=new URLSearchParams(l);s?t.set("has_code","true"):t.delete("has_code"),c(t)},A=s=>{const t=new URLSearchParams(l);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),c(t)},T=I({queryKey:["top-tasks-sidebar"],queryFn:()=>V.topTasks(8),staleTime:10*60*1e3}),j=I({queryKey:["trending-tasks-sidebar"],queryFn:()=>V.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),C=Fe({enabled:!r,page_size:30,order_by:g,order_dir:"desc",start_date:m.startDate,end_date:m.endDate,include_resources:!0,has_code:f,has_hf_artifacts:b}),F={...m,hasCode:f,hasHfArtifacts:b},S=Re({queryKey:["research-feed",i==null?void 0:i.hf_subject,F],queryFn:({pageParam:s})=>Q.following(s,F),initialPageParam:0,getNextPageParam:(s,t)=>s.length===40?t.length*40:void 0,enabled:r&&!!i}),y=I({queryKey:["research-follows",i==null?void 0:i.hf_subject],queryFn:Q.follows,enabled:r&&!!i}),P=r&&!!i&&((x=y.data)==null?void 0:x.length)===0,D=h.useMemo(()=>r&&y.data?[...y.data].sort((s,t)=>Z.indexOf(s.kind)-Z.indexOf(t.kind)):[],[r,y.data]),B=r&&(!!(o!=null&&o.isLoading)||!!i&&!P),v=(N=T.data)==null?void 0:N.slice(0,8),a=r?S:C,E=h.useMemo(()=>{var s,t;return r?((s=S.data)==null?void 0:s.pages.flatMap($=>$.map(O=>({...Y(O.paper),followReasons:O.reasons}))))??[]:((t=C.data)==null?void 0:t.pages.flatMap($=>$.results.map(O=>({...Y(O),followReasons:void 0}))))??[]},[r,S.data,C.data]),{targetRef:R,isIntersecting:M}=Ee({rootMargin:"400px"});h.useEffect(()=>{M&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[M,a.hasNextPage,a.isFetchingNextPage]);const n=a.isLoading||r&&(o==null?void 0:o.isLoading),d=a.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[B?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((o==null?void 0:o.isLoading)||y.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,t)=>e.jsx(_,{className:"h-5 w-full"},t))}),y.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),D.map(s=>e.jsxs(p,{to:s.url,className:"sidebar-link sidebar-follow-link",children:[e.jsx("span",{className:"sidebar-follow-kind",children:ae[s.kind]}),e.jsx("span",{className:"sidebar-follow-name",children:s.name})]},`${s.kind}-${s.entity_id}`))]}):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"}),T.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(_,{className:"h-5 w-full"},t))}),(k=T.data)==null?void 0:k.map(s=>e.jsxs(p,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[U(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(p,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(_,{className:"h-5 w-full"},t))}),((K=(H=j.data)==null?void 0:H.results)==null?void 0:K.length)===0&&!j.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(G=(W=j.data)==null?void 0:W.results)==null?void 0:G.map(s=>e.jsxs(p,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[U(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsx(ue,{})]}),e.jsxs("div",{className:"feed-main",children:[(z()||se())&&e.jsx("div",{className:"feed-chat",children:e.jsx(ze,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsxs("div",{className:"sort-options",children:[He.map(([s,t])=>e.jsx("button",{className:`sort-btn ${!r&&g===s?"active":""}`,onClick:()=>w(s),children:t},s)),e.jsx("button",{className:`sort-btn ${r?"active":""}`,onClick:()=>{const s=new URLSearchParams(l);s.delete("order_by");const t=s.toString();u(t?`/following?${t}`:"/following")},children:"following"})]}),e.jsx(ge,{hasCode:f,hasHfArtifacts:b,onHasCodeChange:q,onHasHfArtifactsChange:A})]}),e.jsx(xe,{startDate:m.startDate,endDate:m.endDate,onChange:s=>c(je(l,s))})]}),d&&e.jsx(Me,{variant:"destructive",className:"mb-4",children:e.jsxs(De,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void a.refetch(),children:"Try again"})]})}),r&&!(o!=null&&o.isLoading)&&!i?e.jsx(X,{signedIn:!1,popularTasks:v}):P?e.jsx(X,{signedIn:!0,popularTasks:v}):n?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(_,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},t))}):E.length===0?d?null:e.jsx("div",{className:"no-results",children:r?e.jsxs(e.Fragment,{children:["No papers from your follows match these filters. Widen the date range, or follow more from ",e.jsx(p,{to:"/tasks",children:"tasks"}),", ",e.jsx(p,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:E.map((s,t)=>e.jsx(pe,{paper:s,rank:t+1,followReasons:s.followReasons},s.id))}),e.jsx("div",{ref:R,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{ze as AskAssistant,fs as default}; +import{j as e,H as te,L as p,b as ee,c as re,d as ne,r as h,i as z,e as se,C as ie,f as oe}from"./index-DGz7IJy3.js";import{d as U,t as Y}from"./colors-YtiKVy3X.js";import{L as le,F as ce,B as de,M as he}from"./mail-Dydp9Gj0.js";import{P as me}from"./plus-v7R1dHou.js";import{r as Q}from"./research-C0oNhyj8.js";import{P as pe}from"./components-C75Gxt6c.js";import{M as ue,S as L}from"./chatPrompts-BwvjFuiO.js";import{P as ge}from"./PaperFeedFilters-BIXkRwGe.js";import{r as fe,P as xe,w as je}from"./PaperDateFilter-C6KBd0r-.js";import{D as be,u as we,P as ye,M as ve,S as Ne,a as ke,R as _e,W as Se,A as Pe,b as Le,q as Ae,c as Te}from"./chatLaunch-DVedsuWi.js";import{c as Ce}from"./chat-C_06RcUY.js";import{c as V}from"./catalog-CI50zqwR.js";import{u as Fe}from"./usePapers-knk68Pd9.js";import{u as Ee}from"./useIntersectionObserver-B7kBuOiP.js";import{S as _}from"./skeleton-Qth9DQSW.js";import{A as Me,a as De}from"./alert-CfvggGdB.js";import{u as I}from"./useQuery-SnJNmisF.js";import{u as Re}from"./useInfiniteQuery-Bix5WR2s.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DtD88QQA.js";import"./papers-CgK5TA59.js";import"./safeExternalHref-CkBrsh84.js";import"./AgentLogos-RDfL-mz2.js";import"./popover-VInL7Z23.js";import"./chevron-down-CzLvLwcd.js";import"./earth-BQV4xejs.js";function X({signedIn:r,popularTasks:u=[]}){const o=[...r?[]:[e.jsx(e.Fragment,{children:"Sign in with your Hugging Face account. Your follows stay private."})],e.jsxs(e.Fragment,{children:["Open any task, method, benchmark, author, or organization page and click"," ",e.jsxs("span",{className:"following-intro-pill",children:[e.jsx(me,{"aria-hidden":"true"}),"Follow"]}),"."]}),e.jsxs(e.Fragment,{children:["New papers and benchmark results from everything you follow appear here, ranked like the trending feed. You can also get them as a weekly email from ",e.jsx(p,{to:"/settings",children:"Settings"}),"."]})];return e.jsxs("section",{className:"following-intro","aria-labelledby":"following-intro-title",children:[e.jsx("h2",{id:"following-intro-title",children:"Build your personal research feed"}),e.jsx("p",{className:"following-intro-lead",children:"Follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),e.jsx("ol",{className:"following-intro-steps",children:o.map((i,l)=>e.jsxs("li",{children:[e.jsx("span",{"aria-hidden":"true",children:l+1}),e.jsx("p",{children:i})]},l))}),!r&&e.jsx("div",{className:"following-intro-signin",children:e.jsx(te,{returnTo:"/following",label:"Sign in to start following"})}),e.jsxs("div",{className:"following-intro-browse",children:[e.jsxs(p,{to:"/tasks",children:[e.jsx(le,{"aria-hidden":"true"}),"Browse tasks"]}),e.jsxs(p,{to:"/methods",children:[e.jsx(ce,{"aria-hidden":"true"}),"Browse methods"]}),e.jsxs(p,{to:"/organizations",children:[e.jsx(de,{"aria-hidden":"true"}),"Browse organizations"]}),r&&e.jsxs(p,{to:"/settings",children:[e.jsx(he,{"aria-hidden":"true"}),"Weekly email"]})]}),u.length>0&&e.jsxs("div",{className:"following-intro-popular",children:[e.jsx("h3",{children:"Popular tasks to follow"}),e.jsx("div",{children:u.map(i=>e.jsx(p,{to:`/tasks/${i.slug}`,children:U(i.name,i.slug)},i.id))})]})]})}const He=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],J=45,Oe=1800,Ie=25,qe=350,Be=r=>{const[u,o]=h.useState(L[0].slice(0,1));return h.useEffect(()=>{var f,b;if(!r)return;if((b=(f=window.matchMedia)==null?void 0:f.call(window,"(prefers-reduced-motion: reduce)"))!=null&&b.matches){o(L[0]);return}let i=0,l=1,c=!1,g;o(L[0].slice(0,l));const m=()=>{const w=L[i];if(!c){if(l+=1,o(w.slice(0,l)),l===w.length){c=!0,g=window.setTimeout(m,Oe);return}g=window.setTimeout(m,J);return}if(l-=1,o(w.slice(0,l)),l===0){c=!1,i=(i+1)%L.length,g=window.setTimeout(m,qe);return}g=window.setTimeout(m,Ie)};return g=window.setTimeout(m,J),()=>window.clearTimeout(g)},[r]),u},$e=r=>r==="trending"||r==="date_published"||r==="citation_count"?r:"trending",ze=()=>{var R,M;const r=ee(),u=se(),o=oe()?Ne:ke,[i,l]=h.useState({text:"",paperMentions:[]}),c=i.text,[g,m]=h.useState(0),[f,b]=h.useState(be),[w,q]=h.useState(!0),[A,T]=h.useState("low"),[j,C]=h.useState(!1),[F,S]=h.useState(null),y=Be(!c),P=h.useRef(null),D=I({queryKey:["chatAvailability"],queryFn:()=>Ce.getAvailability(),retry:!1,enabled:z()}),B=!!((R=D.data)!=null&&R.web_search_available),v=z()&&((M=D.data)==null?void 0:M.paper_mentions_enabled)!==!1,a=we({draft:i,onChange:l,enabled:v,textareaRef:P});h.useLayoutEffect(()=>{const n=P.current;if(!n)return;const d=()=>{if(n.style.height="auto",c){n.style.height=`${Math.min(n.scrollHeight,160)}px`;return}const x=n.placeholder,N=L.reduce((k,H)=>(n.placeholder=H,Math.max(k,n.scrollHeight)),0);n.placeholder=x,n.style.height=`${Math.min(N,160)}px`};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[c]);const E=async(n=i)=>{const d=n.text.trim();if(!(!d||j)){if(u){const x=new URLSearchParams({q:d,model:f}),N=`${ie}?${x}`,k=window.open(N,"_blank");if(!k){S(N);return}k.opener=null,S(null),l({text:"",paperMentions:[]});return}C(!0),Ae(n,f,{webSearchEnabled:w,reasoningEffort:A});try{const x=await Te(f,A);r(`/chat/${x.id}`)}catch{r("/chat")}}};return e.jsxs(e.Fragment,{children:[!u&&e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(ye,{text:i.text,mentions:i.paperMentions,scrollTop:g,variant:"home"}),e.jsx("textarea",{ref:P,rows:1,value:c,placeholder:y,"aria-label":"Ask the assistant",disabled:j,onChange:n=>a.updateText(n.target.value,n.target.selectionStart),onSelect:n=>a.refresh(n.currentTarget.selectionStart),onClick:n=>a.refresh(n.currentTarget.selectionStart),onScroll:n=>m(n.currentTarget.scrollTop),onBlur:n=>{var d,x;(x=(d=n.relatedTarget)==null?void 0:d.closest)!=null&&x.call(d,".chat-paper-picker")||window.setTimeout(a.close,0)},onKeyDown:n=>{a.keyDown(n)||n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),E())},role:v?"combobox":void 0,"aria-expanded":v?a.open:void 0,"aria-controls":a.open?a.pickerId:void 0,"aria-activedescendant":a.open&&a.results.length?`${a.optionIdPrefix}-${a.activeIndex}`:void 0,"aria-autocomplete":v?"list":void 0,"aria-describedby":a.message?"ask-home-paper-mention-message":void 0})]}),F&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:F,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),a.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:a.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(ve,{models:o,selectedModel:f,onModelChange:b}),!u&&e.jsx(_e,{value:A,onChange:T,disabled:j}),B&&e.jsx(Se,{enabled:w,onChange:q,disabled:j})]}),e.jsx("button",{type:"button",className:`chat-send${c.trim()?" chat-send-on":""}`,onClick:()=>void E(),disabled:!c.trim()||j,"aria-label":"Ask the assistant",children:e.jsx(Pe,{})})]}),e.jsx(Le,{open:a.open,query:a.query,results:a.results,activeIndex:a.activeIndex,loading:a.loading,error:a.error,onSelect:a.select,id:a.pickerId,optionIdPrefix:a.optionIdPrefix})]})]})},ae={task:"Task",method:"Method",benchmark:"Benchmark",author:"Author",organization:"Org"},Z=Object.keys(ae),fs=({following:r=!1})=>{var x,N,k,H,K,W,G;const u=ee(),o=re(),i=o==null?void 0:o.user,[l,c]=ne(),g=$e(l.get("order_by")),m=fe(l,void 0,r?"month":"week"),f=l.get("has_code")==="true",b=l.get("has_hf_artifacts")==="true",w=s=>{const t=new URLSearchParams(l);t.set("order_by",s),r?u(`/?${t}`):c(t)},q=s=>{const t=new URLSearchParams(l);s?t.set("has_code","true"):t.delete("has_code"),c(t)},A=s=>{const t=new URLSearchParams(l);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),c(t)},T=I({queryKey:["top-tasks-sidebar"],queryFn:()=>V.topTasks(8),staleTime:10*60*1e3}),j=I({queryKey:["trending-tasks-sidebar"],queryFn:()=>V.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),C=Fe({enabled:!r,page_size:30,order_by:g,order_dir:"desc",start_date:m.startDate,end_date:m.endDate,include_resources:!0,has_code:f,has_hf_artifacts:b}),F={...m,hasCode:f,hasHfArtifacts:b},S=Re({queryKey:["research-feed",i==null?void 0:i.hf_subject,F],queryFn:({pageParam:s})=>Q.following(s,F),initialPageParam:0,getNextPageParam:(s,t)=>s.length===40?t.length*40:void 0,enabled:r&&!!i}),y=I({queryKey:["research-follows",i==null?void 0:i.hf_subject],queryFn:Q.follows,enabled:r&&!!i}),P=r&&!!i&&((x=y.data)==null?void 0:x.length)===0,D=h.useMemo(()=>r&&y.data?[...y.data].sort((s,t)=>Z.indexOf(s.kind)-Z.indexOf(t.kind)):[],[r,y.data]),B=r&&(!!(o!=null&&o.isLoading)||!!i&&!P),v=(N=T.data)==null?void 0:N.slice(0,8),a=r?S:C,E=h.useMemo(()=>{var s,t;return r?((s=S.data)==null?void 0:s.pages.flatMap($=>$.map(O=>({...Y(O.paper),followReasons:O.reasons}))))??[]:((t=C.data)==null?void 0:t.pages.flatMap($=>$.results.map(O=>({...Y(O),followReasons:void 0}))))??[]},[r,S.data,C.data]),{targetRef:R,isIntersecting:M}=Ee({rootMargin:"400px"});h.useEffect(()=>{M&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[M,a.hasNextPage,a.isFetchingNextPage]);const n=a.isLoading||r&&(o==null?void 0:o.isLoading),d=a.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[B?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((o==null?void 0:o.isLoading)||y.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,t)=>e.jsx(_,{className:"h-5 w-full"},t))}),y.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),D.map(s=>e.jsxs(p,{to:s.url,className:"sidebar-link sidebar-follow-link",children:[e.jsx("span",{className:"sidebar-follow-kind",children:ae[s.kind]}),e.jsx("span",{className:"sidebar-follow-name",children:s.name})]},`${s.kind}-${s.entity_id}`))]}):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"}),T.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(_,{className:"h-5 w-full"},t))}),(k=T.data)==null?void 0:k.map(s=>e.jsxs(p,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[U(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(p,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(_,{className:"h-5 w-full"},t))}),((K=(H=j.data)==null?void 0:H.results)==null?void 0:K.length)===0&&!j.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(G=(W=j.data)==null?void 0:W.results)==null?void 0:G.map(s=>e.jsxs(p,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[U(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsx(ue,{})]}),e.jsxs("div",{className:"feed-main",children:[(z()||se())&&e.jsx("div",{className:"feed-chat",children:e.jsx(ze,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsxs("div",{className:"sort-options",children:[He.map(([s,t])=>e.jsx("button",{className:`sort-btn ${!r&&g===s?"active":""}`,onClick:()=>w(s),children:t},s)),e.jsx("button",{className:`sort-btn ${r?"active":""}`,onClick:()=>{const s=new URLSearchParams(l);s.delete("order_by");const t=s.toString();u(t?`/following?${t}`:"/following")},children:"following"})]}),e.jsx(ge,{hasCode:f,hasHfArtifacts:b,onHasCodeChange:q,onHasHfArtifactsChange:A})]}),e.jsx(xe,{startDate:m.startDate,endDate:m.endDate,onChange:s=>c(je(l,s))})]}),d&&e.jsx(Me,{variant:"destructive",className:"mb-4",children:e.jsxs(De,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void a.refetch(),children:"Try again"})]})}),r&&!(o!=null&&o.isLoading)&&!i?e.jsx(X,{signedIn:!1,popularTasks:v}):P?e.jsx(X,{signedIn:!0,popularTasks:v}):n?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(_,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},t))}):E.length===0?d?null:e.jsx("div",{className:"no-results",children:r?e.jsxs(e.Fragment,{children:["No papers from your follows match these filters. Widen the date range, or follow more from ",e.jsx(p,{to:"/tasks",children:"tasks"}),", ",e.jsx(p,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:E.map((s,t)=>e.jsx(pe,{paper:s,rank:t+1,followReasons:s.followReasons},s.id))}),e.jsx("div",{ref:R,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{ze as AskAssistant,fs as default}; diff --git a/assets/FollowingView-CwCG1Am-.js b/assets/FollowingView-CwCG1Am-.js new file mode 100644 index 0000000000000000000000000000000000000000..63dabf6ca31f3826004b84ae672971b90de86af6 --- /dev/null +++ b/assets/FollowingView-CwCG1Am-.js @@ -0,0 +1 @@ +import{j as o}from"./index-DGz7IJy3.js";import r from"./FeedView-DmNv9H2e.js";import"./colors-YtiKVy3X.js";import"./mail-Dydp9Gj0.js";import"./plus-v7R1dHou.js";import"./research-C0oNhyj8.js";import"./components-C75Gxt6c.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DtD88QQA.js";import"./papers-CgK5TA59.js";import"./safeExternalHref-CkBrsh84.js";import"./chatPrompts-BwvjFuiO.js";import"./AgentLogos-RDfL-mz2.js";import"./PaperFeedFilters-BIXkRwGe.js";import"./PaperDateFilter-C6KBd0r-.js";import"./popover-VInL7Z23.js";import"./chatLaunch-DVedsuWi.js";import"./chat-C_06RcUY.js";import"./chevron-down-CzLvLwcd.js";import"./useQuery-SnJNmisF.js";import"./earth-BQV4xejs.js";import"./catalog-CI50zqwR.js";import"./usePapers-knk68Pd9.js";import"./useInfiniteQuery-Bix5WR2s.js";import"./useIntersectionObserver-B7kBuOiP.js";import"./skeleton-Qth9DQSW.js";import"./alert-CfvggGdB.js";function z(){return o.jsx(r,{following:!0})}export{z as default}; diff --git a/assets/FollowingView-DKH_R2lt.js b/assets/FollowingView-DKH_R2lt.js deleted file mode 100644 index df1ab5b7f20e20958989482ba428abdcdf2e1bd3..0000000000000000000000000000000000000000 --- a/assets/FollowingView-DKH_R2lt.js +++ /dev/null @@ -1 +0,0 @@ -import{j as o}from"./index-CA09r0fx.js";import r from"./FeedView-B8_X5TkM.js";import"./colors-C6t5MKud.js";import"./mail-DhwziyiT.js";import"./plus-BGozleiT.js";import"./research-CAknkOM8.js";import"./components-CHZvyPkS.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-U9FJMhfb.js";import"./papers-2SfezChA.js";import"./safeExternalHref-CkBrsh84.js";import"./chatPrompts-BzPGjXPj.js";import"./AgentLogos-e-hYOTh0.js";import"./PaperFeedFilters-Ci7HUJiL.js";import"./PaperDateFilter-DhUC4jzf.js";import"./popover-D6rzCRBR.js";import"./chatLaunch-CutMsO9s.js";import"./chat-XoDxf8nx.js";import"./chevron-down-MPck50eR.js";import"./useQuery-GCOPnmOE.js";import"./earth-gRrLiaVn.js";import"./catalog-C6oGGh8I.js";import"./usePapers-Bb48_cnL.js";import"./useInfiniteQuery-TrlVUjws.js";import"./useIntersectionObserver-jfqowp0n.js";import"./skeleton-CiNN3v7Q.js";import"./alert-DRS5VQLi.js";function z(){return o.jsx(r,{following:!0})}export{z as default}; diff --git a/assets/FrameworksIndexView-VQ1ZCNea.js b/assets/FrameworksIndexView-BHbIG7KF.js similarity index 92% rename from assets/FrameworksIndexView-VQ1ZCNea.js rename to assets/FrameworksIndexView-BHbIG7KF.js index dd8d30572b7cf09e60395ee31651cfaccf98ad4a..bf47872e1da65340bbf878962c6ace0694a3b1af 100644 --- a/assets/FrameworksIndexView-VQ1ZCNea.js +++ b/assets/FrameworksIndexView-BHbIG7KF.js @@ -1 +1 @@ -import{b as d,j as e,L as o,F as m}from"./index-CA09r0fx.js";import{u as p}from"./useQuery-GCOPnmOE.js";import{I as h}from"./components-CHZvyPkS.js";import{c as u}from"./catalog-C6oGGh8I.js";import{c as g,h as f}from"./colors-C6t5MKud.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-U9FJMhfb.js";import"./papers-2SfezChA.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,E as default}; +import{b as d,j as e,L as o,F as m}from"./index-DGz7IJy3.js";import{u as p}from"./useQuery-SnJNmisF.js";import{I as h}from"./components-C75Gxt6c.js";import{c as u}from"./catalog-CI50zqwR.js";import{c as g,h as f}from"./colors-YtiKVy3X.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DtD88QQA.js";import"./papers-CgK5TA59.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,E as default}; diff --git a/assets/LatexTitle-U9FJMhfb.js b/assets/LatexTitle-DtD88QQA.js similarity index 98% rename from assets/LatexTitle-U9FJMhfb.js rename to assets/LatexTitle-DtD88QQA.js index 55c8d2860bbd1c91fb2c2ff2de0b986e35d606c5..230e9666dffbe0bfaeb1d624f12ecf6b3460caea 100644 --- a/assets/LatexTitle-U9FJMhfb.js +++ b/assets/LatexTitle-DtD88QQA.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,_ as L}from"./index-CA09r0fx.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,_ as L}from"./index-DGz7IJy3.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-B-6pg9rW.js b/assets/MarkdownText-CswmrT4z.js similarity index 86% rename from assets/MarkdownText-B-6pg9rW.js rename to assets/MarkdownText-CswmrT4z.js index eaca0da9e7f275492f942737712dc13322aca358..d6a8d7b79e3c69bb24d2dd38a4fb18158732deb5 100644 --- a/assets/MarkdownText-B-6pg9rW.js +++ b/assets/MarkdownText-CswmrT4z.js @@ -1 +1 @@ -import{n as c,j as o,L as u}from"./index-CA09r0fx.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-DUf7c7wv.js";import{M as h}from"./index-BeqN5AbC.js";import{r as f}from"./index-qKrWNpd1.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),s=/^[1-9]\d*$/.test(r);return!n&&!s?null:c(r)}const M=({text:e,className:a=""})=>o.jsx("div",{className:a,children:o.jsx(h,{remarkPlugins:[f,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:n,...s})=>{const i=k(t);if(i){const l=I(i);return l?o.jsx(d,{routeId:l,to:i,...s,children:r}):o.jsx(u,{to:i,...s,children:r})}return o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...s,children:r})}},children:e})});export{M,k as r}; +import{n as c,j as o,L as u}from"./index-DGz7IJy3.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-DUJYnY2B.js";import{M as h}from"./index-DyDOGuaE.js";import{r as f}from"./index-CEcXuWDB.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),s=/^[1-9]\d*$/.test(r);return!n&&!s?null:c(r)}const M=({text:e,className:a=""})=>o.jsx("div",{className:a,children:o.jsx(h,{remarkPlugins:[f,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:n,...s})=>{const i=k(t);if(i){const l=I(i);return l?o.jsx(d,{routeId:l,to:i,...s,children:r}):o.jsx(u,{to:i,...s,children:r})}return o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...s,children:r})}},children:e})});export{M,k as r}; diff --git a/assets/McpView-DURAZUEI.js b/assets/McpView-D287q6AU.js similarity index 97% rename from assets/McpView-DURAZUEI.js rename to assets/McpView-D287q6AU.js index dde24304e0f3a0c222c5a632b44d5f586c7d9943..76eaaaabd9b5b6b002210550e802fcbb53ca4179 100644 --- a/assets/McpView-DURAZUEI.js +++ b/assets/McpView-D287q6AU.js @@ -1,4 +1,4 @@ -import{g as b,F as h,j as e,l as x}from"./index-CA09r0fx.js";import{u as j}from"./useQuery-GCOPnmOE.js";import{f,D as g}from"./latexPlainText-DI8YEXVe.js";import{q as y}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-D8NiZH3t.js";import{E as i}from"./external-link-b6zNfUPN.js";import{C as w}from"./copy-BRZnlAd3.js";/** +import{g as b,F as h,j as e,l as x}from"./index-DGz7IJy3.js";import{u as j}from"./useQuery-SnJNmisF.js";import{f,D as g}from"./latexPlainText-DI8YEXVe.js";import{q as y}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-DcSqeKOx.js";import{E as i}from"./external-link-ChfVBxLK.js";import{C as w}from"./copy-CDHIGRQI.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/MethodDetailView-0qBqvuwa.js b/assets/MethodDetailView-BesJdFsW.js similarity index 92% rename from assets/MethodDetailView-0qBqvuwa.js rename to assets/MethodDetailView-BesJdFsW.js index 74f4c3f6c2372ee7c1fa472f26a0af6aa3b4408f..05ded09a8913f33f6e26fdce384d86f164aa1c17 100644 --- a/assets/MethodDetailView-0qBqvuwa.js +++ b/assets/MethodDetailView-BesJdFsW.js @@ -1 +1 @@ -import{j as e,r as A,u as Q,d as O,L,ad as U}from"./index-CA09r0fx.js";import{R as G}from"./ResearchFollowButton-BAC_HrTd.js";import{p as W}from"./paperQueryKeys-BP2E-0yf.js";import{u as w}from"./useQuery-GCOPnmOE.js";import{u as Z}from"./useInfiniteQuery-TrlVUjws.js";import{M as V,P as X}from"./components-CHZvyPkS.js";import{P as Y}from"./PaperFeedFilters-Ci7HUJiL.js";import{a as J,P as ee,b as te}from"./PaperDateFilter-DhUC4jzf.js";import{r as se,M as R}from"./MarkdownText-B-6pg9rW.js";import{c as F}from"./catalog-C6oGGh8I.js";import{p as ae}from"./papers-2SfezChA.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./colors-C6t5MKud.js";import{u as ie}from"./useIntersectionObserver-jfqowp0n.js";import{S as M}from"./skeleton-CiNN3v7Q.js";import{A as le,a as oe}from"./alert-DRS5VQLi.js";import{s as ce}from"./safeExternalHref-CkBrsh84.js";import"./useMutation-CUMX1r3q.js";import"./research-CAknkOM8.js";import"./plus-BGozleiT.js";import"./LatexTitle-U9FJMhfb.js";import"./popover-D6rzCRBR.js";/* empty css */import"./PaperPreviewLink-DUf7c7wv.js";import"./index-BeqN5AbC.js";import"./index-qKrWNpd1.js";import"./katex-DkKDou_j.js";import"./hover-card-0saQl8Kd.js";const s={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},f=({x:t,y:r,w:c,h:d,fill:g,stroke:u,label:h,fontSize:l=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:r,width:c,height:d,rx:"3",ry:"3",fill:g,stroke:u,strokeWidth:"1"}),e.jsx("text",{x:t+c/2,y:r+d/2,fontSize:l,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:h})]}),de=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(f,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(f,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(f,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(f,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(f,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(f,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(f,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(f,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),me=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),me.map(([t,r],c)=>{const d=92+c*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:d,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),r?e.jsx("text",{x:"138",y:d,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:r}):null]},t)})]}),pe={attention:de,"agent-skills":he},ue=({method:t})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(f,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(f,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(f,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),xe=({method:t})=>{const r=(t.slug||"").toLowerCase(),c=pe[r];if(c)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(c,{})});if(t.image_url){const d=r==="transformer"||r==="gpt-4"||r==="gpt-4o"||r==="multi-head-attention"?" method-figure-svg--compact":r==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${d}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(ue,{method:t})})},C=720,I=138,p={top:8,right:10,bottom:25,left:36},H=56,ge=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),fe=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),T=t=>ge.format(new Date(`${t}T00:00:00Z`)),je=(t,r)=>{if(t===0)return new Set;const c=t>48?12:t>36?6:t>18?3:2,d=Math.max(1,Math.ceil(H/r)),g=Math.max(c,d),u=t-1,h=new Set([0,u]);for(let l=g;l=H&&h.add(l);return h},q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const r=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${r}`},_e=({history:t,methodName:r})=>{const[c,d]=A.useState(null),g=Math.max(1,...t.map(o=>o.paper_count)),u=C-p.left-p.right,h=I-p.top-p.bottom,l=t.length?u/t.length:u,S=Math.max(2,l*.68),D=je(t.length,l),_=Array.from(new Set([0,Math.ceil(g/2),g])),j=c==null?null:t[c],x=j?q(j):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${C} ${I}`,role:"group","aria-label":`${r}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[r,": papers mentioning this method by publication month"]}),_.map(o=>{const i=p.top+h-o/g*h;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:p.left,x2:C-p.right,y1:i,y2:i}),e.jsx("text",{className:"method-usage-y-label",x:p.left-8,y:i+3,textAnchor:"end",children:o})]},o)}),t.map((o,i)=>{const k=o.paper_count/g*h,y=o.paper_count>0?Math.max(1,k):0,P=p.left+l*i+(l-S)/2,b=p.top+h-y,a=c===i,N=i===t.length-1,v=q(o);return e.jsxs("g",{className:`method-usage-bar${a?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${T(o.start_date)}: ${o.paper_count} ${o.paper_count===1?"paper":"papers"}${v?`. ${v}`:""}`,onMouseEnter:()=>d(i),onMouseLeave:()=>d(null),onFocus:()=>d(i),onBlur:()=>d(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:p.left+l*i,y:p.top,width:l,height:h}),e.jsx("rect",{className:"method-usage-bar-mark",x:P,y:b,width:S,height:y,rx:"1.5"})]},o.start_date)}),t.map((o,i)=>D.has(i)?e.jsx("text",{className:"method-usage-x-label",x:p.left+l*(i+.5),y:I-11,textAnchor:"middle",children:t.length>48?fe.format(new Date(`${o.start_date}T00:00:00Z`)):T(o.start_date)},o.start_date):null)]}),j&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:T(j.start_date)}),e.jsxs("span",{children:[j.paper_count," ",j.paper_count===1?"paper":"papers",c===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(j.catalog_share??0).toFixed(2),"% of"," ",(j.catalog_paper_count??0).toLocaleString()," catalog papers"]}),x&&e.jsx("span",{children:x})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Ze=()=>{var B,E,$;const{methodSlug:t}=Q(),[r,c]=O(),[d,g]=A.useState("trending"),u=r.get("has_code")==="true",h=r.get("has_hf_artifacts")==="true",l=J(r),S=n=>{const m=new URLSearchParams(r);n?m.set("has_code","true"):m.delete("has_code"),c(m)},D=n=>{const m=new URLSearchParams(r);n?m.set("has_hf_artifacts","true"):m.delete("has_hf_artifacts"),c(m)},_=w({queryKey:["method",t],queryFn:()=>F.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),j=w({queryKey:["areas-all"],queryFn:()=>F.listAreas({page_size:50,ordering:"name"}),enabled:!!((B=_.data)!=null&&B.area_id),staleTime:10*60*1e3}),x=w({queryKey:["method-trend",t],queryFn:()=>F.methodTrend(t),enabled:!!t,staleTime:10*60*1e3}),o=d==="trending"?"trending":d==="cited"?"citation_count":"date_published",i=Z({queryKey:[...W.feeds.method,t,o,u,h,l.startDate,l.endDate],queryFn:({pageParam:n=1})=>ae.forMethod(t,{page:n,page_size:20,order_by:o,order_dir:"desc",include_resources:!0,repository_limit:1,has_code:u,has_hf_artifacts:h,start_date:l.startDate,end_date:l.endDate}),getNextPageParam:n=>n.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:U}),k=w({queryKey:["related-methods",t],queryFn:()=>F.relatedMethods(t),enabled:!!t,staleTime:10*60*1e3}),y=A.useMemo(()=>{var m;return(((m=i.data)==null?void 0:m.pages.flatMap(K=>K.results))||[]).map(ne)},[i.data]),{targetRef:P,isIntersecting:b}=ie({rootMargin:"200px"});if(A.useEffect(()=>{b&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[b,i.hasNextPage,i.isFetchingNextPage]),_.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(_.error||!_.data)return e.jsx("div",{className:"page",children:e.jsx(le,{variant:"destructive",children:e.jsx(oe,{children:"Method not found."})})});const a=_.data,N=(E=j.data)==null?void 0:E.results.find(n=>n.id===a.area_id),v=se(a.source_url),z=v?null:ce(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(L,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(L,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),e.jsx(G,{kind:"method",entityId:a.id}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(R,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),v?e.jsxs(L,{className:"method-source-link",to:v,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):z?e.jsxs("a",{className:"method-source-link",href:z,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(x.data.recent_paper_count*30/x.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!x.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(_e,{history:x.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(xe,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(R,{className:"method-image-credit",text:a.image_credit})})]})]}),((($=k.data)==null?void 0:$.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),k.data.results.map(n=>e.jsx(V,{method:{slug:n.slug,name:n.name}},n.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([n,m])=>e.jsx("button",{className:`sort-btn ${d===n?"active":""}`,onClick:()=>g(n),children:m},n))}),e.jsx(Y,{hasCode:u,hasHfArtifacts:h,onHasCodeChange:S,onHasHfArtifactsChange:D})]}),e.jsx(ee,{startDate:l.startDate,endDate:l.endDate,onChange:n=>c(te(r,n))}),e.jsxs("div",{className:"results-count",children:[y.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((n,m)=>e.jsx(M,{className:"h-40 w-full"},m))}):y.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((n,m)=>e.jsx(X,{paper:n,rank:m+1},n.id))}),e.jsx("div",{ref:P,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Ze as default}; +import{j as e,r as A,u as Q,d as O,L,ad as U}from"./index-DGz7IJy3.js";import{R as G}from"./ResearchFollowButton-_BF37169.js";import{p as W}from"./paperQueryKeys-BP2E-0yf.js";import{u as w}from"./useQuery-SnJNmisF.js";import{u as Z}from"./useInfiniteQuery-Bix5WR2s.js";import{M as V,P as X}from"./components-C75Gxt6c.js";import{P as Y}from"./PaperFeedFilters-BIXkRwGe.js";import{a as J,P as ee,b as te}from"./PaperDateFilter-C6KBd0r-.js";import{r as se,M as R}from"./MarkdownText-CswmrT4z.js";import{c as F}from"./catalog-CI50zqwR.js";import{p as ae}from"./papers-CgK5TA59.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./colors-YtiKVy3X.js";import{u as ie}from"./useIntersectionObserver-B7kBuOiP.js";import{S as M}from"./skeleton-Qth9DQSW.js";import{A as le,a as oe}from"./alert-CfvggGdB.js";import{s as ce}from"./safeExternalHref-CkBrsh84.js";import"./useMutation-B1oRtfbH.js";import"./research-C0oNhyj8.js";import"./plus-v7R1dHou.js";import"./LatexTitle-DtD88QQA.js";import"./popover-VInL7Z23.js";/* empty css */import"./PaperPreviewLink-DUJYnY2B.js";import"./index-DyDOGuaE.js";import"./index-CEcXuWDB.js";import"./katex-DkKDou_j.js";import"./hover-card-32Q2qmuv.js";const s={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},f=({x:t,y:r,w:c,h:d,fill:g,stroke:u,label:h,fontSize:l=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:r,width:c,height:d,rx:"3",ry:"3",fill:g,stroke:u,strokeWidth:"1"}),e.jsx("text",{x:t+c/2,y:r+d/2,fontSize:l,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:h})]}),de=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(f,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(f,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(f,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(f,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(f,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(f,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(f,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(f,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),me=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),me.map(([t,r],c)=>{const d=92+c*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:d,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),r?e.jsx("text",{x:"138",y:d,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:r}):null]},t)})]}),pe={attention:de,"agent-skills":he},ue=({method:t})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(f,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(f,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(f,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),xe=({method:t})=>{const r=(t.slug||"").toLowerCase(),c=pe[r];if(c)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(c,{})});if(t.image_url){const d=r==="transformer"||r==="gpt-4"||r==="gpt-4o"||r==="multi-head-attention"?" method-figure-svg--compact":r==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${d}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(ue,{method:t})})},C=720,I=138,p={top:8,right:10,bottom:25,left:36},H=56,ge=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),fe=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),T=t=>ge.format(new Date(`${t}T00:00:00Z`)),je=(t,r)=>{if(t===0)return new Set;const c=t>48?12:t>36?6:t>18?3:2,d=Math.max(1,Math.ceil(H/r)),g=Math.max(c,d),u=t-1,h=new Set([0,u]);for(let l=g;l=H&&h.add(l);return h},q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const r=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${r}`},_e=({history:t,methodName:r})=>{const[c,d]=A.useState(null),g=Math.max(1,...t.map(o=>o.paper_count)),u=C-p.left-p.right,h=I-p.top-p.bottom,l=t.length?u/t.length:u,S=Math.max(2,l*.68),D=je(t.length,l),_=Array.from(new Set([0,Math.ceil(g/2),g])),j=c==null?null:t[c],x=j?q(j):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${C} ${I}`,role:"group","aria-label":`${r}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[r,": papers mentioning this method by publication month"]}),_.map(o=>{const i=p.top+h-o/g*h;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:p.left,x2:C-p.right,y1:i,y2:i}),e.jsx("text",{className:"method-usage-y-label",x:p.left-8,y:i+3,textAnchor:"end",children:o})]},o)}),t.map((o,i)=>{const k=o.paper_count/g*h,y=o.paper_count>0?Math.max(1,k):0,P=p.left+l*i+(l-S)/2,b=p.top+h-y,a=c===i,N=i===t.length-1,v=q(o);return e.jsxs("g",{className:`method-usage-bar${a?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${T(o.start_date)}: ${o.paper_count} ${o.paper_count===1?"paper":"papers"}${v?`. ${v}`:""}`,onMouseEnter:()=>d(i),onMouseLeave:()=>d(null),onFocus:()=>d(i),onBlur:()=>d(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:p.left+l*i,y:p.top,width:l,height:h}),e.jsx("rect",{className:"method-usage-bar-mark",x:P,y:b,width:S,height:y,rx:"1.5"})]},o.start_date)}),t.map((o,i)=>D.has(i)?e.jsx("text",{className:"method-usage-x-label",x:p.left+l*(i+.5),y:I-11,textAnchor:"middle",children:t.length>48?fe.format(new Date(`${o.start_date}T00:00:00Z`)):T(o.start_date)},o.start_date):null)]}),j&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:T(j.start_date)}),e.jsxs("span",{children:[j.paper_count," ",j.paper_count===1?"paper":"papers",c===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(j.catalog_share??0).toFixed(2),"% of"," ",(j.catalog_paper_count??0).toLocaleString()," catalog papers"]}),x&&e.jsx("span",{children:x})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Ze=()=>{var B,E,$;const{methodSlug:t}=Q(),[r,c]=O(),[d,g]=A.useState("trending"),u=r.get("has_code")==="true",h=r.get("has_hf_artifacts")==="true",l=J(r),S=n=>{const m=new URLSearchParams(r);n?m.set("has_code","true"):m.delete("has_code"),c(m)},D=n=>{const m=new URLSearchParams(r);n?m.set("has_hf_artifacts","true"):m.delete("has_hf_artifacts"),c(m)},_=w({queryKey:["method",t],queryFn:()=>F.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),j=w({queryKey:["areas-all"],queryFn:()=>F.listAreas({page_size:50,ordering:"name"}),enabled:!!((B=_.data)!=null&&B.area_id),staleTime:10*60*1e3}),x=w({queryKey:["method-trend",t],queryFn:()=>F.methodTrend(t),enabled:!!t,staleTime:10*60*1e3}),o=d==="trending"?"trending":d==="cited"?"citation_count":"date_published",i=Z({queryKey:[...W.feeds.method,t,o,u,h,l.startDate,l.endDate],queryFn:({pageParam:n=1})=>ae.forMethod(t,{page:n,page_size:20,order_by:o,order_dir:"desc",include_resources:!0,repository_limit:1,has_code:u,has_hf_artifacts:h,start_date:l.startDate,end_date:l.endDate}),getNextPageParam:n=>n.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:U}),k=w({queryKey:["related-methods",t],queryFn:()=>F.relatedMethods(t),enabled:!!t,staleTime:10*60*1e3}),y=A.useMemo(()=>{var m;return(((m=i.data)==null?void 0:m.pages.flatMap(K=>K.results))||[]).map(ne)},[i.data]),{targetRef:P,isIntersecting:b}=ie({rootMargin:"200px"});if(A.useEffect(()=>{b&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[b,i.hasNextPage,i.isFetchingNextPage]),_.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(_.error||!_.data)return e.jsx("div",{className:"page",children:e.jsx(le,{variant:"destructive",children:e.jsx(oe,{children:"Method not found."})})});const a=_.data,N=(E=j.data)==null?void 0:E.results.find(n=>n.id===a.area_id),v=se(a.source_url),z=v?null:ce(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(L,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(L,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),e.jsx(G,{kind:"method",entityId:a.id}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(R,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),v?e.jsxs(L,{className:"method-source-link",to:v,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):z?e.jsxs("a",{className:"method-source-link",href:z,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(x.data.recent_paper_count*30/x.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!x.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(_e,{history:x.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(xe,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(R,{className:"method-image-credit",text:a.image_credit})})]})]}),((($=k.data)==null?void 0:$.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),k.data.results.map(n=>e.jsx(V,{method:{slug:n.slug,name:n.name}},n.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([n,m])=>e.jsx("button",{className:`sort-btn ${d===n?"active":""}`,onClick:()=>g(n),children:m},n))}),e.jsx(Y,{hasCode:u,hasHfArtifacts:h,onHasCodeChange:S,onHasHfArtifactsChange:D})]}),e.jsx(ee,{startDate:l.startDate,endDate:l.endDate,onChange:n=>c(te(r,n))}),e.jsxs("div",{className:"results-count",children:[y.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((n,m)=>e.jsx(M,{className:"h-40 w-full"},m))}):y.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((n,m)=>e.jsx(X,{paper:n,rank:m+1},n.id))}),e.jsx("div",{ref:P,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Ze as default}; diff --git a/assets/MethodsIndexView-BLhOffBh.js b/assets/MethodsIndexView-CwAFmNPM.js similarity index 85% rename from assets/MethodsIndexView-BLhOffBh.js rename to assets/MethodsIndexView-CwAFmNPM.js index 7e9d4f3bc7ecf9d33861533b7fc41b889adda409..ae9bcf9c8fb1e0386591592ce7433e5a79e073a5 100644 --- a/assets/MethodsIndexView-BLhOffBh.js +++ b/assets/MethodsIndexView-CwAFmNPM.js @@ -1,4 +1,4 @@ -import{g as _,r as d,j as e,L as v}from"./index-CA09r0fx.js";import{u as c}from"./useQuery-GCOPnmOE.js";import{c as m}from"./catalog-C6oGGh8I.js";import{s as N}from"./slug-BpH-Nkvz.js";import{S as x}from"./skeleton-CiNN3v7Q.js";import{A as w,a as F}from"./alert-DRS5VQLi.js";import{T as L}from"./TaxonomySuggestionTile-Dc-tCzey.js";import{T}from"./TaxonomyTrending-WzrBk28T.js";import"./SignInToEditDialog-Ub_UIzh4.js";import"./button-BkpxXw_S.js";import"./input-CtSl48Mp.js";import"./textarea-FDLjm_7X.js";import"./searchable-select-CNl4nXvO.js";import"./popover-D6rzCRBR.js";import"./dialog-BMl1SbyK.js";import"./loader-circle-DTsjFZ6p.js";import"./useMutation-CUMX1r3q.js";import"./submissions-CERjLe5i.js";import"./plus-BGozleiT.js";import"./trending-up-DpdmhQm9.js";/** +import{g as _,r as d,j as e,L as v}from"./index-DGz7IJy3.js";import{u as c}from"./useQuery-SnJNmisF.js";import{c as m}from"./catalog-CI50zqwR.js";import{s as N}from"./slug-BpH-Nkvz.js";import{S as x}from"./skeleton-Qth9DQSW.js";import{A as w,a as F}from"./alert-CfvggGdB.js";import{T as L}from"./TaxonomySuggestionTile-BM3W4_sv.js";import{T}from"./TaxonomyTrending-DZnt22Vd.js";import"./SignInToEditDialog-POB2dswN.js";import"./button-DEdvni-v.js";import"./input-DVdOE4Xl.js";import"./textarea-BC6nB3vb.js";import"./searchable-select-C2BNEPyI.js";import"./popover-VInL7Z23.js";import"./dialog-DRb-cMlG.js";import"./loader-circle-DZdOKwBN.js";import"./useMutation-B1oRtfbH.js";import"./submissions-0YkeXTxt.js";import"./plus-v7R1dHou.js";import"./trending-up-E7e_PcEb.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-Br7ty259.js b/assets/NotFound-CK9eyj2q.js similarity index 89% rename from assets/NotFound-Br7ty259.js rename to assets/NotFound-CK9eyj2q.js index 5bb507100fbf86ada1465243d7f67df264b706c8..7fbaece2caaa9288344142c76066fb3ef331b8be 100644 --- a/assets/NotFound-Br7ty259.js +++ b/assets/NotFound-CK9eyj2q.js @@ -1 +1 @@ -import{ap as o,r as a,j as t,L as s}from"./index-CA09r0fx.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; +import{ap as o,r as a,j as t,L as s}from"./index-DGz7IJy3.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; diff --git a/assets/OrganizationContributionGraph-BeFV3fZe.js b/assets/OrganizationContributionGraph-hzEKhL7-.js similarity index 94% rename from assets/OrganizationContributionGraph-BeFV3fZe.js rename to assets/OrganizationContributionGraph-hzEKhL7-.js index 4024dc46bd142772337de7f1dfed3ffe4a784c9e..2f914689d7eba3a597abe2f569a28119834a2913 100644 --- a/assets/OrganizationContributionGraph-BeFV3fZe.js +++ b/assets/OrganizationContributionGraph-hzEKhL7-.js @@ -1 +1 @@ -import{r as b,j as o}from"./index-CA09r0fx.js";import{u as z}from"./useQuery-GCOPnmOE.js";import{S as T}from"./skeleton-CiNN3v7Q.js";import{c as w}from"./catalog-C6oGGh8I.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-DGz7IJy3.js";import{u as z}from"./useQuery-SnJNmisF.js";import{S as T}from"./skeleton-Qth9DQSW.js";import{c as w}from"./catalog-CI50zqwR.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-DMyQ2Izc.js b/assets/OrganizationDetailView-DMyQ2Izc.js deleted file mode 100644 index 9ccfb1606ad5a212d07f88a73723a7ceee167b67..0000000000000000000000000000000000000000 --- a/assets/OrganizationDetailView-DMyQ2Izc.js +++ /dev/null @@ -1 +0,0 @@ -import{u as t,j as r}from"./index-CA09r0fx.js";import{O as i}from"./OrganizationPaperFeed-CW49kI0y.js";import m from"./NotFound-Br7ty259.js";import"./ResearchFollowButton-BAC_HrTd.js";import"./useQuery-GCOPnmOE.js";import"./useMutation-CUMX1r3q.js";import"./research-CAknkOM8.js";import"./plus-BGozleiT.js";import"./components-CHZvyPkS.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-U9FJMhfb.js";import"./colors-C6t5MKud.js";import"./papers-2SfezChA.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-B-6pg9rW.js";/* empty css */import"./PaperPreviewLink-DUf7c7wv.js";import"./index-BeqN5AbC.js";import"./index-qKrWNpd1.js";import"./katex-DkKDou_j.js";import"./hover-card-0saQl8Kd.js";import"./OrganizationContributionGraph-BeFV3fZe.js";import"./skeleton-CiNN3v7Q.js";import"./catalog-C6oGGh8I.js";import"./PaperFeedFilters-Ci7HUJiL.js";import"./PaperDateFilter-DhUC4jzf.js";import"./popover-D6rzCRBR.js";import"./alert-DRS5VQLi.js";import"./searchable-select-CNl4nXvO.js";import"./button-BkpxXw_S.js";import"./dialog-BMl1SbyK.js";import"./loader-circle-DTsjFZ6p.js";import"./useIntersectionObserver-jfqowp0n.js";import"./usePapers-Bb48_cnL.js";import"./useInfiniteQuery-TrlVUjws.js";const I=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{I as default}; diff --git a/assets/OrganizationDetailView-DejGNmp9.js b/assets/OrganizationDetailView-DejGNmp9.js new file mode 100644 index 0000000000000000000000000000000000000000..2734aef9d5bc86e0a9fee17c14eb4f785d48a20c --- /dev/null +++ b/assets/OrganizationDetailView-DejGNmp9.js @@ -0,0 +1 @@ +import{u as t,j as r}from"./index-DGz7IJy3.js";import{O as i}from"./OrganizationPaperFeed-BEfCIaxI.js";import m from"./NotFound-CK9eyj2q.js";import"./ResearchFollowButton-_BF37169.js";import"./useQuery-SnJNmisF.js";import"./useMutation-B1oRtfbH.js";import"./research-C0oNhyj8.js";import"./plus-v7R1dHou.js";import"./components-C75Gxt6c.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DtD88QQA.js";import"./colors-YtiKVy3X.js";import"./papers-CgK5TA59.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-CswmrT4z.js";/* empty css */import"./PaperPreviewLink-DUJYnY2B.js";import"./index-DyDOGuaE.js";import"./index-CEcXuWDB.js";import"./katex-DkKDou_j.js";import"./hover-card-32Q2qmuv.js";import"./OrganizationContributionGraph-hzEKhL7-.js";import"./skeleton-Qth9DQSW.js";import"./catalog-CI50zqwR.js";import"./PaperFeedFilters-BIXkRwGe.js";import"./PaperDateFilter-C6KBd0r-.js";import"./popover-VInL7Z23.js";import"./alert-CfvggGdB.js";import"./searchable-select-C2BNEPyI.js";import"./button-DEdvni-v.js";import"./dialog-DRb-cMlG.js";import"./loader-circle-DZdOKwBN.js";import"./useIntersectionObserver-B7kBuOiP.js";import"./usePapers-knk68Pd9.js";import"./useInfiniteQuery-Bix5WR2s.js";const I=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{I as default}; diff --git a/assets/OrganizationPaperFeed-CW49kI0y.js b/assets/OrganizationPaperFeed-BEfCIaxI.js similarity index 87% rename from assets/OrganizationPaperFeed-CW49kI0y.js rename to assets/OrganizationPaperFeed-BEfCIaxI.js index b60cac934035cc0913714064233a3c899244716b..737c0d06ee2868d0f4b67b86cd4406f89ac3cf4f 100644 --- a/assets/OrganizationPaperFeed-CW49kI0y.js +++ b/assets/OrganizationPaperFeed-BEfCIaxI.js @@ -1 +1 @@ -import{b as E,d as B,r as d,j as e,L as A}from"./index-CA09r0fx.js";import{R as Q}from"./ResearchFollowButton-BAC_HrTd.js";import{u as C}from"./useQuery-GCOPnmOE.js";import{P as U}from"./components-CHZvyPkS.js";import{M as G}from"./MarkdownText-B-6pg9rW.js";import{O as K}from"./OrganizationContributionGraph-BeFV3fZe.js";import{P as W}from"./PaperFeedFilters-Ci7HUJiL.js";import{a as Z,P as J,b as V}from"./PaperDateFilter-DhUC4jzf.js";import{A as X,a as Y}from"./alert-DRS5VQLi.js";import{S as z}from"./searchable-select-CNl4nXvO.js";import{S as $}from"./skeleton-CiNN3v7Q.js";import{u as ee}from"./useIntersectionObserver-jfqowp0n.js";import{e as se}from"./usePapers-Bb48_cnL.js";import{c as R}from"./catalog-C6oGGh8I.js";import{d as D,t as ae}from"./colors-C6t5MKud.js";import re from"./NotFound-Br7ty259.js";const te=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=n=>n==="date_published"||n==="citation_count"?n:"trending",ye=({organizationSlug:n,taskSlug:p})=>{var y,P,v,F,L,k,w,O;const T=E(),[o,h]=B(),[I,u]=d.useState(!1),g=ne(o.get("order_by")),f=o.get("has_code")==="true",_=o.get("has_hf_artifacts")==="true",m=Z(o),x=C({queryKey:["organization",n],queryFn:()=>R.getOrganization(n),staleTime:10*60*1e3}),c=C({queryKey:["organization-areas-with-tasks",n],queryFn:()=>R.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=se({organizationSlug:n,taskSlug:p,page_size:12,order_by:g,order_dir:"desc",include_resources:!0,has_code:f,has_hf_artifacts:_,start_date:m.startDate,end_date:m.endDate,enabled:!!n}),{targetRef:M,isIntersecting:j}=ee({rootMargin:"200px"});d.useEffect(()=>{j&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[j,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{u(!1)},[n,p]);const b=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:D(t.name,t.slug)})))},[c.data]),l=b.find(a=>a.slug===p),N=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(ae))},[i.data]),s=x.data??((y=c.data)==null?void 0:y.organization),H=((v=(P=i.data)==null?void 0:P.pages[0])==null?void 0:v.count)??0;if(((F=x.error)==null?void 0:F.status)===404||((L=c.error)==null?void 0:L.status)===404||((k=i.error)==null?void 0:k.status)===404)return e.jsx(re,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(X,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load organization papers. Please try again."})})});const q=a=>{const r=a.trim().toLocaleLowerCase();return b.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},S=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=o.toString();T({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(A,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:D(l.name,l.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[s!=null&&s.logo_url&&!I?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>u(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx($,{className:"h-12 w-64"})]}),s&&e.jsx(Q,{kind:"organization",entityId:s.id}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((w=s.paper_count)==null?void 0:w.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(G,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),e.jsx(K,{organizationSlug:n,organizationName:(s==null?void 0:s.name)??n})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:S,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:l?{value:l.slug,label:l.label,description:`${l.paper_count.toLocaleString()} ${l.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...q(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:te.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${g===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(o);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:f,hasHfArtifacts:_,onHasCodeChange:a=>{const r=new URLSearchParams(o);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(o);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsx(J,{startDate:m.startDate,endDate:m.endDate,onChange:a=>h(V(o,a))}),e.jsxs("div",{className:"results-count",children:[H.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx($,{className:"h-40 w-full"},r))}):N.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:M,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ye as O}; +import{b as E,d as B,r as d,j as e,L as A}from"./index-DGz7IJy3.js";import{R as Q}from"./ResearchFollowButton-_BF37169.js";import{u as C}from"./useQuery-SnJNmisF.js";import{P as U}from"./components-C75Gxt6c.js";import{M as G}from"./MarkdownText-CswmrT4z.js";import{O as K}from"./OrganizationContributionGraph-hzEKhL7-.js";import{P as W}from"./PaperFeedFilters-BIXkRwGe.js";import{a as Z,P as J,b as V}from"./PaperDateFilter-C6KBd0r-.js";import{A as X,a as Y}from"./alert-CfvggGdB.js";import{S as z}from"./searchable-select-C2BNEPyI.js";import{S as $}from"./skeleton-Qth9DQSW.js";import{u as ee}from"./useIntersectionObserver-B7kBuOiP.js";import{e as se}from"./usePapers-knk68Pd9.js";import{c as R}from"./catalog-CI50zqwR.js";import{d as D,t as ae}from"./colors-YtiKVy3X.js";import re from"./NotFound-CK9eyj2q.js";const te=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=n=>n==="date_published"||n==="citation_count"?n:"trending",ye=({organizationSlug:n,taskSlug:p})=>{var y,P,v,F,L,k,w,O;const T=E(),[o,h]=B(),[I,u]=d.useState(!1),g=ne(o.get("order_by")),f=o.get("has_code")==="true",_=o.get("has_hf_artifacts")==="true",m=Z(o),x=C({queryKey:["organization",n],queryFn:()=>R.getOrganization(n),staleTime:10*60*1e3}),c=C({queryKey:["organization-areas-with-tasks",n],queryFn:()=>R.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=se({organizationSlug:n,taskSlug:p,page_size:12,order_by:g,order_dir:"desc",include_resources:!0,has_code:f,has_hf_artifacts:_,start_date:m.startDate,end_date:m.endDate,enabled:!!n}),{targetRef:M,isIntersecting:j}=ee({rootMargin:"200px"});d.useEffect(()=>{j&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[j,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{u(!1)},[n,p]);const b=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:D(t.name,t.slug)})))},[c.data]),l=b.find(a=>a.slug===p),N=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(ae))},[i.data]),s=x.data??((y=c.data)==null?void 0:y.organization),H=((v=(P=i.data)==null?void 0:P.pages[0])==null?void 0:v.count)??0;if(((F=x.error)==null?void 0:F.status)===404||((L=c.error)==null?void 0:L.status)===404||((k=i.error)==null?void 0:k.status)===404)return e.jsx(re,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(X,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load organization papers. Please try again."})})});const q=a=>{const r=a.trim().toLocaleLowerCase();return b.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},S=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=o.toString();T({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(A,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:D(l.name,l.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[s!=null&&s.logo_url&&!I?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>u(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx($,{className:"h-12 w-64"})]}),s&&e.jsx(Q,{kind:"organization",entityId:s.id}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((w=s.paper_count)==null?void 0:w.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(G,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),e.jsx(K,{organizationSlug:n,organizationName:(s==null?void 0:s.name)??n})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:S,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:l?{value:l.slug,label:l.label,description:`${l.paper_count.toLocaleString()} ${l.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...q(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:te.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${g===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(o);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:f,hasHfArtifacts:_,onHasCodeChange:a=>{const r=new URLSearchParams(o);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(o);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsx(J,{startDate:m.startDate,endDate:m.endDate,onChange:a=>h(V(o,a))}),e.jsxs("div",{className:"results-count",children:[H.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx($,{className:"h-40 w-full"},r))}):N.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:M,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ye as O}; diff --git a/assets/OrganizationTaskView-DWeNl8Ej.js b/assets/OrganizationTaskView-DWeNl8Ej.js deleted file mode 100644 index 4014347c906a712f5e8500bd863e67c3544646d3..0000000000000000000000000000000000000000 --- a/assets/OrganizationTaskView-DWeNl8Ej.js +++ /dev/null @@ -1 +0,0 @@ -import{u as i,j as t}from"./index-CA09r0fx.js";import{O as m}from"./OrganizationPaperFeed-CW49kI0y.js";import p from"./NotFound-Br7ty259.js";import"./ResearchFollowButton-BAC_HrTd.js";import"./useQuery-GCOPnmOE.js";import"./useMutation-CUMX1r3q.js";import"./research-CAknkOM8.js";import"./plus-BGozleiT.js";import"./components-CHZvyPkS.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-U9FJMhfb.js";import"./colors-C6t5MKud.js";import"./papers-2SfezChA.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-B-6pg9rW.js";/* empty css */import"./PaperPreviewLink-DUf7c7wv.js";import"./index-BeqN5AbC.js";import"./index-qKrWNpd1.js";import"./katex-DkKDou_j.js";import"./hover-card-0saQl8Kd.js";import"./OrganizationContributionGraph-BeFV3fZe.js";import"./skeleton-CiNN3v7Q.js";import"./catalog-C6oGGh8I.js";import"./PaperFeedFilters-Ci7HUJiL.js";import"./PaperDateFilter-DhUC4jzf.js";import"./popover-D6rzCRBR.js";import"./alert-DRS5VQLi.js";import"./searchable-select-CNl4nXvO.js";import"./button-BkpxXw_S.js";import"./dialog-BMl1SbyK.js";import"./loader-circle-DTsjFZ6p.js";import"./useIntersectionObserver-jfqowp0n.js";import"./usePapers-Bb48_cnL.js";import"./useInfiniteQuery-TrlVUjws.js";const I=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{I as default}; diff --git a/assets/OrganizationTaskView-DqRaxVTK.js b/assets/OrganizationTaskView-DqRaxVTK.js new file mode 100644 index 0000000000000000000000000000000000000000..ac17c386857707fd32e23f72ef6a2386758f0825 --- /dev/null +++ b/assets/OrganizationTaskView-DqRaxVTK.js @@ -0,0 +1 @@ +import{u as i,j as t}from"./index-DGz7IJy3.js";import{O as m}from"./OrganizationPaperFeed-BEfCIaxI.js";import p from"./NotFound-CK9eyj2q.js";import"./ResearchFollowButton-_BF37169.js";import"./useQuery-SnJNmisF.js";import"./useMutation-B1oRtfbH.js";import"./research-C0oNhyj8.js";import"./plus-v7R1dHou.js";import"./components-C75Gxt6c.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DtD88QQA.js";import"./colors-YtiKVy3X.js";import"./papers-CgK5TA59.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-CswmrT4z.js";/* empty css */import"./PaperPreviewLink-DUJYnY2B.js";import"./index-DyDOGuaE.js";import"./index-CEcXuWDB.js";import"./katex-DkKDou_j.js";import"./hover-card-32Q2qmuv.js";import"./OrganizationContributionGraph-hzEKhL7-.js";import"./skeleton-Qth9DQSW.js";import"./catalog-CI50zqwR.js";import"./PaperFeedFilters-BIXkRwGe.js";import"./PaperDateFilter-C6KBd0r-.js";import"./popover-VInL7Z23.js";import"./alert-CfvggGdB.js";import"./searchable-select-C2BNEPyI.js";import"./button-DEdvni-v.js";import"./dialog-DRb-cMlG.js";import"./loader-circle-DZdOKwBN.js";import"./useIntersectionObserver-B7kBuOiP.js";import"./usePapers-knk68Pd9.js";import"./useInfiniteQuery-Bix5WR2s.js";const I=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{I as default}; diff --git a/assets/OrganizationsIndexView-BFMUnAB5.js b/assets/OrganizationsIndexView-CvT2PFcr.js similarity index 94% rename from assets/OrganizationsIndexView-BFMUnAB5.js rename to assets/OrganizationsIndexView-CvT2PFcr.js index 943516a42018276d9dce4876836a0ba6b146701f..8b120d788e1e92deb469a50865ba38c95ed03da9 100644 --- a/assets/OrganizationsIndexView-BFMUnAB5.js +++ b/assets/OrganizationsIndexView-CvT2PFcr.js @@ -1 +1 @@ -import{d as u,r as g,j as e,L as x}from"./index-CA09r0fx.js";import{u as j}from"./useQuery-GCOPnmOE.js";import{A as y,a as f}from"./alert-DRS5VQLi.js";import{S as _}from"./skeleton-CiNN3v7Q.js";import{c as N}from"./catalog-C6oGGh8I.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizationIndex(),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{A as default}; +import{d as u,r as g,j as e,L as x}from"./index-DGz7IJy3.js";import{u as j}from"./useQuery-SnJNmisF.js";import{A as y,a as f}from"./alert-CfvggGdB.js";import{S as _}from"./skeleton-Qth9DQSW.js";import{c as N}from"./catalog-CI50zqwR.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizationIndex(),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{A as default}; diff --git a/assets/PaperDateFilter-DhUC4jzf.js b/assets/PaperDateFilter-C6KBd0r-.js similarity index 98% rename from assets/PaperDateFilter-DhUC4jzf.js rename to assets/PaperDateFilter-C6KBd0r-.js index 7cfea36eaf07daa6c68d1d629addd542d5e17c1d..9efff53d54dd4f78be49cd1523fd4d664b979782 100644 --- a/assets/PaperDateFilter-DhUC4jzf.js +++ b/assets/PaperDateFilter-C6KBd0r-.js @@ -1 +1 @@ -import{r as p,j as n}from"./index-CA09r0fx.js";import{P as q,a as G,b as Q}from"./popover-D6rzCRBR.js";const E=(e,t)=>{const a=new Date(t),s=new Date(a);return s.setUTCDate(a.getUTCDate()-(e==="week"?6:29)),{startDate:s.toISOString().slice(0,10),endDate:a.toISOString().slice(0,10)}},z=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),oe=(e,t=new Date,a="week")=>{const s=z(e);if(s.startDate||s.endDate||e.get("time")==="all_time")return s;const c=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));return E(a,c)},J=(e,t)=>{const a=new URLSearchParams(e);return t.startDate?a.set("start_date",t.startDate):a.delete("start_date"),t.endDate?a.set("end_date",t.endDate):a.delete("end_date"),a.delete("time"),a},ie=(e,t)=>{const a=J(e,t);return!t.startDate&&!t.endDate&&a.set("time","all_time"),a},K=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),O=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),L="(max-width: 640px)",X=()=>{const[e,t]=p.useState(()=>typeof window<"u"&&window.matchMedia(L).matches);return p.useEffect(()=>{const a=window.matchMedia(L),s=c=>t(c.matches);return t(a.matches),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e},V=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ee=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},R=(e,t)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),M=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),te=(e,t)=>new Date(Date.UTC(t,e.getUTCMonth(),1)),w=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate,ae=(e,t)=>{const a=b(e),s=b(t),c=O.format(a),l=O.format(s),g=a.getUTCDate(),d=s.getUTCDate(),o=a.getUTCFullYear(),u=s.getUTCFullYear();return e===t?`${c} ${g}, ${o}`:o===u&&a.getUTCMonth()===s.getUTCMonth()?`${c} ${g}–${d}, ${o}`:o===u?`${c} ${g}–${l} ${d}, ${o}`:`${c} ${g}, ${o}–${l} ${d}, ${u}`},ne=e=>{const t=e.getUTCFullYear(),a=e.getUTCMonth(),s=new Date(Date.UTC(t,a,1)),c=(s.getUTCDay()+6)%7,l=new Date(s);return l.setUTCDate(s.getUTCDate()-c),Array.from({length:42},(g,d)=>{const o=new Date(l);return o.setUTCDate(l.getUTCDate()+d),{iso:V(o),day:o.getUTCDate(),outsideMonth:o.getUTCMonth()!==a}})},A=({month:e,today:t,startDate:a,endDate:s,onSelect:c,yearLabel:l,yearValue:g,onYearChange:d,secondary:o=!1})=>{const u=p.useMemo(()=>ne(e),[e]);return n.jsxs("section",{className:`paper-date-calendar${o?" paper-date-calendar-secondary":""}`,children:[n.jsxs("label",{className:"paper-date-year",children:[n.jsx("span",{children:l}),n.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:t.slice(0,4),step:"1",value:g,onChange:r=>d(r.target.value)})]}),n.jsx("h3",{children:K.format(e)}),n.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(r=>n.jsx("span",{children:r},r))}),n.jsx("div",{className:"paper-date-days",children:u.map(r=>{const h=r.iso===a||r.iso===s,T=!!(a&&s&&r.iso>a&&r.isot;return n.jsx("button",{type:"button","aria-label":r.iso,"aria-selected":h,disabled:m,className:["paper-date-day",r.outsideMonth?"outside":"",h?"selected":"",T?"in-range":"",r.iso===t?"today":""].filter(Boolean).join(" "),onClick:()=>c(r.iso),children:r.day},r.iso)})})]})},I=({calendar:e,onPrevious:t,onNext:a,secondary:s=!1})=>n.jsxs("div",{className:`paper-date-navigation-group${s?" paper-date-navigation-group-secondary":""}`,children:[n.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:t,children:"←"}),n.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:a,children:"→"})]}),ce=({startDate:e,endDate:t,onChange:a,currentDate:s})=>{const c=X(),l=s?b(s):ee(),[g,d]=p.useState(!1),[o,u]=p.useState(),[r,h]=p.useState(),[T,m]=p.useState(()=>M(l)),[$,D]=p.useState(()=>R(M(l),1)),[H,y]=p.useState(()=>String(l.getUTCFullYear())),[B,U]=p.useState(()=>String(l.getUTCFullYear())),f={startDate:e,endDate:t},N=E("week",l),Y=E("month",l),P=V(l),v=!!(e&&t&&!w(f,N)&&!w(f,Y)),Z=()=>{u(e),h(t);const i=M(e?b(e):l),C=M(t?b(t):R(i,1));m(i),D(C),y(String(i.getUTCFullYear())),U(String(C.getUTCFullYear())),d(!0)},k=(i,C,F)=>{if(C(i),!/^\d{4}$/.test(i))return;const x=Number(i);x>=1900&&x<=l.getUTCFullYear()&&F(j=>te(j,x))},S=(i,C,F,x)=>{const j=R(i,C);F(j),x(String(j.getUTCFullYear()))},_=i=>{!o||r?(u(i),h(void 0)):i{a({}),d(!1)};return n.jsxs("div",{className:`paper-date-filter${c?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,N)?" active":""}`,onClick:()=>a(N),children:"Last Week"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,Y)?" active":""}`,onClick:()=>a(Y),children:"Last Month"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!t?" active":""}`,onClick:()=>a({}),children:"All Time"}),n.jsxs(q,{open:g,onOpenChange:i=>{i?Z():d(!1)},children:[n.jsx(G,{asChild:!0,children:n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v?" active":""}`,"aria-label":v?"Change date range":"Select a range",children:v&&e&&t?ae(e,t):"Select a range"})}),n.jsxs(Q,{align:"end",className:`paper-date-popover${c?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[n.jsxs("div",{className:"paper-date-popover-header",children:[n.jsx("h2",{children:"Select a date range"}),n.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),n.jsxs("div",{className:"paper-date-navigation",children:[n.jsx(I,{calendar:"start",onPrevious:()=>S(T,-1,m,y),onNext:()=>S(T,1,m,y)}),!c&&n.jsx(I,{calendar:"end",onPrevious:()=>S($,-1,D,U),onNext:()=>S($,1,D,U),secondary:!0})]}),n.jsxs("div",{className:"paper-date-calendars",children:[n.jsx(A,{month:T,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:c?"Year":"Start year",yearValue:H,onYearChange:i=>k(i,y,m)}),!c&&n.jsx(A,{month:$,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:"End year",yearValue:B,onYearChange:i=>k(i,U,D),secondary:!0})]}),n.jsxs("div",{className:"paper-date-actions",children:[n.jsx("button",{type:"button",className:"paper-date-clear",onClick:W,children:"Clear range"}),n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:()=>d(!1),children:"Cancel"}),n.jsx("button",{type:"button",className:"paper-date-apply",disabled:!o||!r,onClick:()=>{o&&r&&a({startDate:o,endDate:r}),d(!1)},children:"Apply"})]})]})]})]})]})};export{ce as P,z as a,J as b,oe as r,ie as w}; +import{r as p,j as n}from"./index-DGz7IJy3.js";import{P as q,a as G,b as Q}from"./popover-VInL7Z23.js";const E=(e,t)=>{const a=new Date(t),s=new Date(a);return s.setUTCDate(a.getUTCDate()-(e==="week"?6:29)),{startDate:s.toISOString().slice(0,10),endDate:a.toISOString().slice(0,10)}},z=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),oe=(e,t=new Date,a="week")=>{const s=z(e);if(s.startDate||s.endDate||e.get("time")==="all_time")return s;const c=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));return E(a,c)},J=(e,t)=>{const a=new URLSearchParams(e);return t.startDate?a.set("start_date",t.startDate):a.delete("start_date"),t.endDate?a.set("end_date",t.endDate):a.delete("end_date"),a.delete("time"),a},ie=(e,t)=>{const a=J(e,t);return!t.startDate&&!t.endDate&&a.set("time","all_time"),a},K=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),O=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),L="(max-width: 640px)",X=()=>{const[e,t]=p.useState(()=>typeof window<"u"&&window.matchMedia(L).matches);return p.useEffect(()=>{const a=window.matchMedia(L),s=c=>t(c.matches);return t(a.matches),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e},V=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ee=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},R=(e,t)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),M=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),te=(e,t)=>new Date(Date.UTC(t,e.getUTCMonth(),1)),w=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate,ae=(e,t)=>{const a=b(e),s=b(t),c=O.format(a),l=O.format(s),g=a.getUTCDate(),d=s.getUTCDate(),o=a.getUTCFullYear(),u=s.getUTCFullYear();return e===t?`${c} ${g}, ${o}`:o===u&&a.getUTCMonth()===s.getUTCMonth()?`${c} ${g}–${d}, ${o}`:o===u?`${c} ${g}–${l} ${d}, ${o}`:`${c} ${g}, ${o}–${l} ${d}, ${u}`},ne=e=>{const t=e.getUTCFullYear(),a=e.getUTCMonth(),s=new Date(Date.UTC(t,a,1)),c=(s.getUTCDay()+6)%7,l=new Date(s);return l.setUTCDate(s.getUTCDate()-c),Array.from({length:42},(g,d)=>{const o=new Date(l);return o.setUTCDate(l.getUTCDate()+d),{iso:V(o),day:o.getUTCDate(),outsideMonth:o.getUTCMonth()!==a}})},A=({month:e,today:t,startDate:a,endDate:s,onSelect:c,yearLabel:l,yearValue:g,onYearChange:d,secondary:o=!1})=>{const u=p.useMemo(()=>ne(e),[e]);return n.jsxs("section",{className:`paper-date-calendar${o?" paper-date-calendar-secondary":""}`,children:[n.jsxs("label",{className:"paper-date-year",children:[n.jsx("span",{children:l}),n.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:t.slice(0,4),step:"1",value:g,onChange:r=>d(r.target.value)})]}),n.jsx("h3",{children:K.format(e)}),n.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(r=>n.jsx("span",{children:r},r))}),n.jsx("div",{className:"paper-date-days",children:u.map(r=>{const h=r.iso===a||r.iso===s,T=!!(a&&s&&r.iso>a&&r.isot;return n.jsx("button",{type:"button","aria-label":r.iso,"aria-selected":h,disabled:m,className:["paper-date-day",r.outsideMonth?"outside":"",h?"selected":"",T?"in-range":"",r.iso===t?"today":""].filter(Boolean).join(" "),onClick:()=>c(r.iso),children:r.day},r.iso)})})]})},I=({calendar:e,onPrevious:t,onNext:a,secondary:s=!1})=>n.jsxs("div",{className:`paper-date-navigation-group${s?" paper-date-navigation-group-secondary":""}`,children:[n.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:t,children:"←"}),n.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:a,children:"→"})]}),ce=({startDate:e,endDate:t,onChange:a,currentDate:s})=>{const c=X(),l=s?b(s):ee(),[g,d]=p.useState(!1),[o,u]=p.useState(),[r,h]=p.useState(),[T,m]=p.useState(()=>M(l)),[$,D]=p.useState(()=>R(M(l),1)),[H,y]=p.useState(()=>String(l.getUTCFullYear())),[B,U]=p.useState(()=>String(l.getUTCFullYear())),f={startDate:e,endDate:t},N=E("week",l),Y=E("month",l),P=V(l),v=!!(e&&t&&!w(f,N)&&!w(f,Y)),Z=()=>{u(e),h(t);const i=M(e?b(e):l),C=M(t?b(t):R(i,1));m(i),D(C),y(String(i.getUTCFullYear())),U(String(C.getUTCFullYear())),d(!0)},k=(i,C,F)=>{if(C(i),!/^\d{4}$/.test(i))return;const x=Number(i);x>=1900&&x<=l.getUTCFullYear()&&F(j=>te(j,x))},S=(i,C,F,x)=>{const j=R(i,C);F(j),x(String(j.getUTCFullYear()))},_=i=>{!o||r?(u(i),h(void 0)):i{a({}),d(!1)};return n.jsxs("div",{className:`paper-date-filter${c?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,N)?" active":""}`,onClick:()=>a(N),children:"Last Week"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,Y)?" active":""}`,onClick:()=>a(Y),children:"Last Month"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!t?" active":""}`,onClick:()=>a({}),children:"All Time"}),n.jsxs(q,{open:g,onOpenChange:i=>{i?Z():d(!1)},children:[n.jsx(G,{asChild:!0,children:n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v?" active":""}`,"aria-label":v?"Change date range":"Select a range",children:v&&e&&t?ae(e,t):"Select a range"})}),n.jsxs(Q,{align:"end",className:`paper-date-popover${c?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[n.jsxs("div",{className:"paper-date-popover-header",children:[n.jsx("h2",{children:"Select a date range"}),n.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),n.jsxs("div",{className:"paper-date-navigation",children:[n.jsx(I,{calendar:"start",onPrevious:()=>S(T,-1,m,y),onNext:()=>S(T,1,m,y)}),!c&&n.jsx(I,{calendar:"end",onPrevious:()=>S($,-1,D,U),onNext:()=>S($,1,D,U),secondary:!0})]}),n.jsxs("div",{className:"paper-date-calendars",children:[n.jsx(A,{month:T,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:c?"Year":"Start year",yearValue:H,onYearChange:i=>k(i,y,m)}),!c&&n.jsx(A,{month:$,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:"End year",yearValue:B,onYearChange:i=>k(i,U,D),secondary:!0})]}),n.jsxs("div",{className:"paper-date-actions",children:[n.jsx("button",{type:"button",className:"paper-date-clear",onClick:W,children:"Clear range"}),n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:()=>d(!1),children:"Cancel"}),n.jsx("button",{type:"button",className:"paper-date-apply",disabled:!o||!r,onClick:()=>{o&&r&&a({startDate:o,endDate:r}),d(!1)},children:"Apply"})]})]})]})]})]})};export{ce as P,z as a,J as b,oe as r,ie as w}; diff --git a/assets/PaperDetailView-DNUhr9yL.js b/assets/PaperDetailView-CeJ8lQ5x.js similarity index 98% rename from assets/PaperDetailView-DNUhr9yL.js rename to assets/PaperDetailView-CeJ8lQ5x.js index f66d622f2940a012d01595412f53746f58b1362d..57cf2a74137b07712a3aa225d104005f84867f75 100644 --- a/assets/PaperDetailView-DNUhr9yL.js +++ b/assets/PaperDetailView-CeJ8lQ5x.js @@ -1,4 +1,4 @@ -import{g as qe,n as Us,b as Wt,h as oe,k as Ds,r as u,j as e,l as me,m as he,o as fe,P as Yt,p as ke,q as Jt,s as Le,t as Re,v as Zt,w as vt,x as He,X as yt,L as ue,y as Bs,z as zs,R as Hs,I as Ms,B as es,D as qs,E as Os,T as Ks,A as ht,i as Gs,a as Oe,F as Me,G as pt,J as ts,K as Xs,u as Qs,M as Lt,N as Vs,f as Ft,O as Ws,Q as Ys,S as Js,U as Zs,V as ea}from"./index-CA09r0fx.js";import{I as Y,T as ta,M as sa,A as aa,S as ra,a as na}from"./components-CHZvyPkS.js";import{L as ze,a as ia}from"./LatexTitle-U9FJMhfb.js";import{e as Ke,C as oa,E as la}from"./ExternalSourceEvalBadge-C5MLELvC.js";import{p as W}from"./papers-2SfezChA.js";import{r as ss,p as ca}from"./paperReader-BIpQD5HO.js";import{p as ye}from"./paperQueryKeys-BP2E-0yf.js";import{u as ne}from"./useQuery-GCOPnmOE.js";import{b as da}from"./usePapers-Bb48_cnL.js";import{f as ua,D as ma}from"./latexPlainText-DI8YEXVe.js";import{s as we}from"./safeExternalHref-CkBrsh84.js";import{s as ha}from"./colors-C6t5MKud.js";import{S as Ie}from"./skeleton-CiNN3v7Q.js";import{A as pa,a as fa}from"./alert-DRS5VQLi.js";import{B as L}from"./button-BkpxXw_S.js";import{D as ee,a as te,b as se,c as ae,d as re,e as le}from"./dialog-BMl1SbyK.js";import{u as ga}from"./useInfiniteQuery-TrlVUjws.js";import{A as xa,a as ba}from"./AgentLogos-e-hYOTh0.js";import{p as ja}from"./paperEdits-BaXeJ-Bi.js";import{C as va}from"./copy-BRZnlAd3.js";import{I as V}from"./input-CtSl48Mp.js";import{S as Tt,a as Ae}from"./searchable-select-CNl4nXvO.js";import{u as ce}from"./useMutation-CUMX1r3q.js";import{c as _e}from"./catalog-C6oGGh8I.js";import{s as pe,p as ya}from"./submissions-CERjLe5i.js";import{e as wa,r as _a,a as je}from"./evaluationQueryInvalidation-CC5JhGiX.js";import{S as wt,L as de,a as ka}from"./SignInToEditDialog-Ub_UIzh4.js";import{L as ie}from"./loader-circle-DTsjFZ6p.js";import{T as Fe,n as Je,g as Ut}from"./github-Cto4qly3.js";import{D as Na}from"./database-CzCP8SRb.js";import{P as Te}from"./plus-BGozleiT.js";import{u as as}from"./index-1y8ilIyE.js";import{B as rs}from"./badge-CkrPEkl0.js";import{G as Dt}from"./globe-CfxFS7Am.js";import{G as Bt}from"./github-D8NiZH3t.js";import{c as Ca,g as Ea,s as Sa,a as Pa,b as $a,d as Ia,A as Ra,i as Aa,e as La}from"./codexAddEvals-CBVUQwDQ.js";import{M as Fa}from"./index-BeqN5AbC.js";import{r as Ta}from"./index-qKrWNpd1.js";import{u as Ua}from"./useIntersectionObserver-jfqowp0n.js";import{S as zt,s as Da}from"./savedPapersAuth-WTp5kQxS.js";import"./hover-card-0saQl8Kd.js";import"./popover-D6rzCRBR.js";import"./textarea-FDLjm_7X.js";/** +import{g as qe,n as Us,b as Wt,h as oe,k as Ds,r as u,j as e,l as me,m as he,o as fe,P as Yt,p as ke,q as Jt,s as Le,t as Re,v as Zt,w as vt,x as He,X as yt,L as ue,y as Bs,z as zs,R as Hs,I as Ms,B as es,D as qs,E as Os,T as Ks,A as ht,i as Gs,a as Oe,F as Me,G as pt,J as ts,K as Xs,u as Qs,M as Lt,N as Vs,f as Ft,O as Ws,Q as Ys,S as Js,U as Zs,V as ea}from"./index-DGz7IJy3.js";import{I as Y,T as ta,M as sa,A as aa,S as ra,a as na}from"./components-C75Gxt6c.js";import{L as ze,a as ia}from"./LatexTitle-DtD88QQA.js";import{e as Ke,C as oa,E as la}from"./ExternalSourceEvalBadge-ChPSpdTg.js";import{p as W}from"./papers-CgK5TA59.js";import{r as ss,p as ca}from"./paperReader-BIpQD5HO.js";import{p as ye}from"./paperQueryKeys-BP2E-0yf.js";import{u as ne}from"./useQuery-SnJNmisF.js";import{b as da}from"./usePapers-knk68Pd9.js";import{f as ua,D as ma}from"./latexPlainText-DI8YEXVe.js";import{s as we}from"./safeExternalHref-CkBrsh84.js";import{s as ha}from"./colors-YtiKVy3X.js";import{S as Ie}from"./skeleton-Qth9DQSW.js";import{A as pa,a as fa}from"./alert-CfvggGdB.js";import{B as L}from"./button-DEdvni-v.js";import{D as ee,a as te,b as se,c as ae,d as re,e as le}from"./dialog-DRb-cMlG.js";import{u as ga}from"./useInfiniteQuery-Bix5WR2s.js";import{A as xa,a as ba}from"./AgentLogos-RDfL-mz2.js";import{p as ja}from"./paperEdits-BtAPUkKl.js";import{C as va}from"./copy-CDHIGRQI.js";import{I as V}from"./input-DVdOE4Xl.js";import{S as Tt,a as Ae}from"./searchable-select-C2BNEPyI.js";import{u as ce}from"./useMutation-B1oRtfbH.js";import{c as _e}from"./catalog-CI50zqwR.js";import{s as pe,p as ya}from"./submissions-0YkeXTxt.js";import{e as wa,r as _a,a as je}from"./evaluationQueryInvalidation-CC5JhGiX.js";import{S as wt,L as de,a as ka}from"./SignInToEditDialog-POB2dswN.js";import{L as ie}from"./loader-circle-DZdOKwBN.js";import{T as Fe,n as Je,g as Ut}from"./github-BBO8LC-h.js";import{D as Na}from"./database-7GRYiOb3.js";import{P as Te}from"./plus-v7R1dHou.js";import{u as as}from"./index-Bx9aRYc1.js";import{B as rs}from"./badge-CE-3yZlW.js";import{G as Dt}from"./globe-_StJzQkx.js";import{G as Bt}from"./github-DcSqeKOx.js";import{c as Ca,g as Ea,s as Sa,a as Pa,b as $a,d as Ia,A as Ra,i as Aa,e as La}from"./codexAddEvals-BRqTpMyJ.js";import{M as Fa}from"./index-DyDOGuaE.js";import{r as Ta}from"./index-CEcXuWDB.js";import{u as Ua}from"./useIntersectionObserver-B7kBuOiP.js";import{S as zt,s as Da}from"./savedPapersAuth-BLCvmsFl.js";import"./hover-card-32Q2qmuv.js";import"./popover-VInL7Z23.js";import"./textarea-BC6nB3vb.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/PaperFeedFilters-Ci7HUJiL.js b/assets/PaperFeedFilters-BIXkRwGe.js similarity index 90% rename from assets/PaperFeedFilters-Ci7HUJiL.js rename to assets/PaperFeedFilters-BIXkRwGe.js index 8632318dfa60e5e491b42f992fff059c816a2968..f74adbdaf8855ac2ef6619978692e66252dd9b43 100644 --- a/assets/PaperFeedFilters-Ci7HUJiL.js +++ b/assets/PaperFeedFilters-BIXkRwGe.js @@ -1 +1 @@ -import{j as e}from"./index-CA09r0fx.js";import{I as n}from"./components-CHZvyPkS.js";const t=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),h=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0,showHasCode:i=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[i&&e.jsx(l,{checked:s,icon:e.jsx(n,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(t,{}),label:"Has artifacts",onChange:o})]})]});export{h as P}; +import{j as e}from"./index-DGz7IJy3.js";import{I as n}from"./components-C75Gxt6c.js";const t=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),h=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0,showHasCode:i=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[i&&e.jsx(l,{checked:s,icon:e.jsx(n,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(t,{}),label:"Has artifacts",onChange:o})]})]});export{h as P}; diff --git a/assets/PaperPreviewLink-DUf7c7wv.js b/assets/PaperPreviewLink-DUJYnY2B.js similarity index 97% rename from assets/PaperPreviewLink-DUf7c7wv.js rename to assets/PaperPreviewLink-DUJYnY2B.js index 342957d03553cb672c002ce6f062f535087fcd25..1423790973edb0518d7f3862bd3632aa4175fc99 100644 --- a/assets/PaperPreviewLink-DUf7c7wv.js +++ b/assets/PaperPreviewLink-DUJYnY2B.js @@ -1,4 +1,4 @@ -import{o as k,f as F,m as b,a as oe,p as L,b as O,n as z,h as le,s as ce,c as ue,v as he,S as pe}from"./index-BeqN5AbC.js";import{l as me}from"./index-qKrWNpd1.js";import D from"./katex-DkKDou_j.js";import{j as m,F as M,V as fe,n as j,c as de,m as ge,L as E,A as xe}from"./index-CA09r0fx.js";import{u as ye}from"./useQuery-GCOPnmOE.js";import{H as we,a as be,b as Ne}from"./hover-card-0saQl8Kd.js";import{p as ve}from"./paperQueryKeys-BP2E-0yf.js";import{p as P}from"./papers-2SfezChA.js";import{u as ke}from"./useMutation-CUMX1r3q.js";function Fe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:s},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:r,mathFlowValue:l,mathText:o,mathTextData:l}};function e(a){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},a)}function t(){this.buffer()}function r(){const a=this.resume(),c=this.stack[this.stack.length-1];k(c.type==="math"),c.meta=a}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];k(h.type==="math"),this.exit(a),h.value=c;const f=h.data.hChildren[0];k(f.type==="element"),k(f.tagName==="code"),f.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function o(a){const c=this.resume(),h=this.stack[this.stack.length-1];k(h.type==="inlineMath"),this.exit(a),h.value=c,h.data.hChildren.push({type:"text",value:c})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function je(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +import{o as k,f as F,m as b,a as oe,p as L,b as O,n as z,h as le,s as ce,c as ue,v as he,S as pe}from"./index-DyDOGuaE.js";import{l as me}from"./index-CEcXuWDB.js";import D from"./katex-DkKDou_j.js";import{j as m,F as M,V as fe,n as j,c as de,m as ge,L as E,A as xe}from"./index-DGz7IJy3.js";import{u as ye}from"./useQuery-SnJNmisF.js";import{H as we,a as be,b as Ne}from"./hover-card-32Q2qmuv.js";import{p as ve}from"./paperQueryKeys-BP2E-0yf.js";import{p as P}from"./papers-CgK5TA59.js";import{u as ke}from"./useMutation-B1oRtfbH.js";function Fe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:s},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:r,mathFlowValue:l,mathText:o,mathTextData:l}};function e(a){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},a)}function t(){this.buffer()}function r(){const a=this.resume(),c=this.stack[this.stack.length-1];k(c.type==="math"),c.meta=a}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];k(h.type==="math"),this.exit(a),h.value=c;const f=h.data.hChildren[0];k(f.type==="element"),k(f.tagName==="code"),f.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function o(a){const c=this.resume(),h=this.stack[this.stack.length-1];k(h.type==="inlineMath"),this.exit(a),h.value=c,h.data.hChildren.push({type:"text",value:c})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function je(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(s,o,l,a){const c=s.value||"",h=l.createTracker(a),f="$".repeat(Math.max(me(c,"$")+1,2)),g=l.enter("mathFlow");let x=h.move(f);if(s.meta){const d=l.enter("mathFlowMeta");x+=h.move(l.safe(s.meta,{after:` `,before:x,encode:["$"],...h.current()})),d()}return x+=h.move(` `),c&&(x+=h.move(c+` diff --git a/assets/PaperReaderView-C0PN93t_.js b/assets/PaperReaderView-B5hOVSoX.js similarity index 90% rename from assets/PaperReaderView-C0PN93t_.js rename to assets/PaperReaderView-B5hOVSoX.js index 2527c82293124002b29e8393e3b7b12ae7aeeb2a..484bdc7e0a017bcd1bb396d57e5d74d6338cf917 100644 --- a/assets/PaperReaderView-C0PN93t_.js +++ b/assets/PaperReaderView-B5hOVSoX.js @@ -1 +1 @@ -import{r as s,j as a,A as Y,u as xe,b as He,n as Be,V as Pe,N as Fe,L as V}from"./index-CA09r0fx.js";import{u as Z}from"./useQuery-GCOPnmOE.js";import{u as qe,R as Ke,A as Ue,c as De,d as Oe,a as Ve,P as Qe,e as Xe}from"./ArtifactWorkspace-BYQbPlsN.js";import{M as Ye}from"./MarkdownText-B-6pg9rW.js";import{g as Ze,a as Ge}from"./papers-2SfezChA.js";import{w as Je,e as et}from"./paperReader-BIpQD5HO.js";import{b as tt}from"./usePapers-Bb48_cnL.js";import{c as rt}from"./chat-XoDxf8nx.js";import{s as G}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as at}from"./ChatView-DCUOQn_a.js";import"./chatLaunch-CutMsO9s.js";import"./chevron-down-MPck50eR.js";import"./earth-gRrLiaVn.js";/* empty css */import"./hover-card-0saQl8Kd.js";import"./github-Cto4qly3.js";import"./github-D8NiZH3t.js";import"./file-text-7GwUpKU3.js";import"./catalog-C6oGGh8I.js";import"./PaperPreviewLink-DUf7c7wv.js";import"./index-BeqN5AbC.js";import"./index-qKrWNpd1.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./useMutation-CUMX1r3q.js";import"./copy-BRZnlAd3.js";import"./thumbs-up-BxkpoAw0.js";import"./external-link-b6zNfUPN.js";import"./useInfiniteQuery-TrlVUjws.js";import"./chatPrompts-BzPGjXPj.js";import"./AgentLogos-e-hYOTh0.js";import"./share-2-B8SQJ4QE.js";import"./openrouter-B__IMcd_.js";import"./queryOptions-C9woPjwX.js";function st(r){return r instanceof Y&&r.status===422?"This page could not be turned into a readable paper.":r instanceof Y&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function nt({paperId:r,paperKey:i,paperTitle:o,paperHref:b,sourceUrl:d,resources:t,paperVersion:p="",selectionEnabled:v=!1,onReady:g,onPaperSelection:N,onPaperSelectionError:c}){const $=s.useRef(null),f=Z({queryKey:["paperWebMarkdown",r],queryFn:()=>Ze(r),staleTime:5*6e4,retry:(S,u)=>S<2&&!(u instanceof Y&&u.status<500),retryDelay:3e3}),w=f.isSuccess;s.useEffect(()=>{w&&(g==null||g())},[g,w]),qe({enabled:v&&!!p&&w,pagesRoot:$,routeId:i,paperVersion:p,numPages:1,onSelect:N,onError:c});const x=f.data?Je(f.data):"";return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Ke,{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:f.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):f.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:st(f.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void f.refetch(),children:"Retry"})," ",a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:$,className:"reader-web-document","data-page":"1",children:[!x.startsWith("# ")&&a.jsx("h1",{children:o}),a.jsx(Ye,{text:x})]})})})]})}const we=66,ot=240,J="pwc:reader:split-ratio",z=r=>`pwc:reader:session:${r}`,Q=r=>`pwc:reader:assistant-collapsed:${r}`,ye=r=>`pwc:reader:page:${r}`;function X(r){const i=Number(sessionStorage.getItem(ye(r)));return Number.isInteger(i)&&i>0?i:1}function it(){const r=Number(localStorage.getItem(J));return Number.isFinite(r)&&r>=45&&r<=75?r:we}function ct(r){const i=G(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 lt=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function dt(r){const i=new URL(r),o=i.pathname.match(lt);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&o&&!i.search?Pe(`/paper-assets/arxiv-pdf/${o[1]}`)??r:r}function ut(r){return new URL(r).hostname.replace(/^www\./,"")}function pt(r){if(!r)return{};const i={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=G(d.url);if(!t)continue;const p=new URL(t),v=p.pathname.split("/").filter(Boolean);if((p.hostname==="github.com"||p.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=G(d.url);if(t){i.projectPage={href:t,label:ut(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 ft(){var me,he,ge,be,ve;const r=He(),{paperId:i}=xe(),o=Be(i??"").replace(/v\d+$/i,""),b=tt(o,!!o),d=Z({queryKey:["chatAvailability"],queryFn:()=>rt.getAvailability(),refetchInterval:3e4,retry:!1}),t=b.data,p=t?et(t):null,v=p?null:(t==null?void 0:t.source)==="external"?Pe(`/paper-assets/external/${t.id}/paper.pdf`):ct(t==null?void 0:t.url_pdf),g=v&&(t==null?void 0:t.source)!=="external"?dt(v):v,N=pt(t),c=((me=t==null?void 0:t.arxiv_id)==null?void 0:me.replace(/v\d+$/i,""))||o,$=s.useCallback(()=>r(`/paper/${c}`),[c,r]),[f,w]=s.useState(()=>sessionStorage.getItem(z(o))||void 0),[x,S]=s.useState(it),[u,ee]=s.useState(()=>sessionStorage.getItem(Q(o))==="1"),[P,j]=s.useState("paper"),[L,C]=s.useState(),[Re,te]=s.useState(),[Se,re]=s.useState(!1),je=s.useCallback(()=>re(!0),[]),[Ce,y]=s.useState(""),[_e,ke]=s.useState(()=>X(o)),[_,Ne]=s.useState(0),[ae,se]=s.useState(!1),[$e,H]=s.useState(!1),A=s.useRef(null),B=s.useRef(null),F=s.useRef(null),ne=s.useRef(null),I=s.useRef(!1),E=s.useRef(0),R=s.useRef(0),q=s.useRef(0),k=s.useRef(x),K=s.useRef(X(o)),U=s.useRef(t==null?void 0:t.version),oe=De().reset,ie=s.useRef(`${o}:${f??"new"}`),m=_>=840;s.useEffect(()=>{const e=`${o}:${f??"new"}`;ie.current!==e&&(ie.current=e,oe())},[f,oe,o]),s.useEffect(()=>{t!=null&&t.version&&U.current&&t.version!==U.current&&(C(void 0),y("")),U.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(E.current),H(!1);const e=sessionStorage.getItem(z(o));w(e||void 0),ee(sessionStorage.getItem(Q(o))==="1"),j("paper"),re(!1),C(void 0),te(void 0),y("");const n=X(o);K.current=n,ke(n)},[o]),s.useEffect(()=>()=>{window.clearTimeout(E.current),cancelAnimationFrame(R.current)},[]),s.useLayoutEffect(()=>{const e=A.current;if(!e)return;const n=()=>Ne(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 h=document.querySelector('link[rel="canonical"]');const ze=!h;h||(h=document.createElement("link"),h.rel="canonical",document.head.appendChild(h));const Le=h.href;return h.href=`${window.location.origin}/paper/${c}`,()=>{document.title="Papers With Code",n?e==null||e.remove():e&&(e.content=l),ze?h==null||h.remove():h&&(h.href=Le)}},[c,t]);const T=s.useCallback(e=>{if(!_)return Math.max(45,Math.min(75,e));const n=480/_*100,l=100-360/_*100;return Math.max(n,Math.min(l,e))},[_]);s.useEffect(()=>S(e=>{const n=T(e);return k.current=n,n}),[T]);const M=e=>{const n=T(e);k.current=n,S(n),localStorage.setItem(J,String(n))},ce=e=>{var l;const n=T(e);k.current=n,B.current&&(B.current.style.width=`${n}%`),F.current&&(F.current.style.width=`${100-n}%`),(l=ne.current)==null||l.setAttribute("aria-valuenow",String(Math.round(n)))},le=e=>{q.current=e,!R.current&&(R.current=requestAnimationFrame(()=>{var l;R.current=0;const n=(l=A.current)==null?void 0:l.getBoundingClientRect();n!=null&&n.width&&ce((q.current-n.left)/n.width*100)}))},Ae=e=>{I.current=!0,se(!0),e.currentTarget.setPointerCapture(e.pointerId),le(e.clientX)},D=()=>{var e;if(I.current){if(R.current){cancelAnimationFrame(R.current),R.current=0;const n=(e=A.current)==null?void 0:e.getBoundingClientRect();n!=null&&n.width&&ce((q.current-n.left)/n.width*100)}I.current=!1,S(k.current),localStorage.setItem(J,String(k.current)),se(!1)}},de=e=>{window.clearTimeout(E.current),H(!0),ee(e),sessionStorage.setItem(Q(o),e?"1":"0"),E.current=window.setTimeout(()=>H(!1),ot+40)},Ie=e=>{w(e),sessionStorage.setItem(z(o),e)},Ee=()=>{w(void 0),sessionStorage.removeItem(z(o)),C(void 0),y("")},ue=((he=d.data)==null?void 0:he.paper_reader_selection_enabled)===!0,pe=e=>{C(e),y(`Selection from page ${e.page} added to chat`),m&&u&&de(!1)},Te=s.useCallback(e=>{C(e),e||y("")},[]),O=((ge=d.data)==null?void 0:ge.paper_reader_citations_enabled)===!0&&!!g,W=Z({queryKey:["paper-layout",c],queryFn:()=>Ge(c),enabled:O&&!!c,staleTime:5*6e4}).data,Me=s.useMemo(()=>O?{layout:W,open:e=>{const n=W?Oe(W,e):[];n.length&&(te(l=>({boxes:n,nonce:((l==null?void 0:l.nonce)??0)+1})),j("paper"))}}:null,[O,W]),fe=Fe()&&((be=d.data)==null?void 0:be.paper_reader_chat_enabled)!==!1,We=t&&fe&&p&&!Se?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&fe?a.jsx(at,{mode:"paper",routeSessionId:f,primaryPaper:{id:t.id,routeId:c,title:t.title},currentPage:()=>K.current,paperSelection:L,onPaperSelectionChange:Te,onSessionId:Ie,onReaderSubmit:()=>j("assistant"),onReaderNewChat:Ee}):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(V,{to:"/papers",children:"Browse papers"})]}):((ve=d.data)==null?void 0:ve.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(V,{to:`/paper/${c}`,children:"Back to paper"})]}):!g&&!p?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(V,{to:`/paper/${c}`,children:"Back to paper"})]}):a.jsxs("div",{className:"paper-reader-shell",children:[!m&&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:()=>j("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":P==="assistant","aria-label":L&&P!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>j("assistant"),children:["Chat",L&&P!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(Ve,{variant:"reader",children:a.jsxs("div",{ref:A,className:`reader-workspace${m?" is-desktop":" is-tabs"}${u?" is-assistant-collapsed":""}${ae?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:B,className:`reader-paper-pane${!m&&P!=="paper"?" is-hidden":""}`,style:m?{width:u?"100%":`${x}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!m&&P!=="paper",children:p?a.jsx(nt,{paperId:t.id,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,sourceUrl:p,resources:N,paperVersion:t.version,selectionEnabled:ue,onReady:je,onPaperSelection:pe,onPaperSelectionError:y}):g&&a.jsx(Qe,{url:g,downloadUrl:v??g,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,onClose:$,resources:N,initialPage:_e,resizeActive:ae||$e,selectionEnabled:ue,paperVersion:t.version,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:pe,onPaperSelectionError:y,highlight:Re,onPageChange:e=>{K.current=e,sessionStorage.setItem(ye(o),String(e))}})}),m&&!u&&a.jsx("div",{ref:ne,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(x),tabIndex:0,onPointerDown:Ae,onPointerMove:e=>{I.current&&le(e.clientX)},onPointerUp:D,onPointerCancel:D,onLostPointerCapture:D,onDoubleClick:()=>M(we),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),M(x+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&M(45),e.key==="End"&&M(75)}}),a.jsx("aside",{ref:F,id:"reader-chat-panel",className:`reader-assistant-pane${!m&&P!=="assistant"?" is-hidden":""}${m&&u?" is-collapsed":""}`,style:m?{width:u?0:`${100-x}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!m&&P!=="assistant"||u,children:a.jsx(Xe.Provider,{value:Me,children:We})}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:Ce}),m&&a.jsx("button",{type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!u,onClick:()=>de(!u),children:u?"Open chat":"Hide chat"})]})})]})}function Yt(){const{paperId:r=""}=xe();return a.jsx(Ue,{workspaceKey:`reader:${r}`,children:a.jsx(ft,{})})}export{Yt as default,pt as readerToolbarResources}; +import{r as s,j as a,A as Y,u as xe,b as He,n as Be,V as Pe,N as Fe,L as V}from"./index-DGz7IJy3.js";import{u as Z}from"./useQuery-SnJNmisF.js";import{u as qe,R as Ke,A as Ue,c as De,d as Oe,a as Ve,P as Qe,e as Xe}from"./ArtifactWorkspace-DI-cB4-t.js";import{M as Ye}from"./MarkdownText-CswmrT4z.js";import{g as Ze,a as Ge}from"./papers-CgK5TA59.js";import{w as Je,e as et}from"./paperReader-BIpQD5HO.js";import{b as tt}from"./usePapers-knk68Pd9.js";import{c as rt}from"./chat-C_06RcUY.js";import{s as G}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as at}from"./ChatView-BWOmR-sr.js";import"./chatLaunch-DVedsuWi.js";import"./chevron-down-CzLvLwcd.js";import"./earth-BQV4xejs.js";/* empty css */import"./hover-card-32Q2qmuv.js";import"./github-BBO8LC-h.js";import"./github-DcSqeKOx.js";import"./file-text-BHDe9k9N.js";import"./catalog-CI50zqwR.js";import"./PaperPreviewLink-DUJYnY2B.js";import"./index-DyDOGuaE.js";import"./index-CEcXuWDB.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./useMutation-B1oRtfbH.js";import"./copy-CDHIGRQI.js";import"./thumbs-up-C5Gnbt6N.js";import"./external-link-ChfVBxLK.js";import"./useInfiniteQuery-Bix5WR2s.js";import"./chatPrompts-BwvjFuiO.js";import"./AgentLogos-RDfL-mz2.js";import"./share-2-Byoooou-.js";import"./openrouter-yE0IuBaT.js";import"./queryOptions-C9woPjwX.js";function st(r){return r instanceof Y&&r.status===422?"This page could not be turned into a readable paper.":r instanceof Y&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function nt({paperId:r,paperKey:i,paperTitle:o,paperHref:b,sourceUrl:d,resources:t,paperVersion:p="",selectionEnabled:v=!1,onReady:g,onPaperSelection:N,onPaperSelectionError:c}){const $=s.useRef(null),f=Z({queryKey:["paperWebMarkdown",r],queryFn:()=>Ze(r),staleTime:5*6e4,retry:(S,u)=>S<2&&!(u instanceof Y&&u.status<500),retryDelay:3e3}),w=f.isSuccess;s.useEffect(()=>{w&&(g==null||g())},[g,w]),qe({enabled:v&&!!p&&w,pagesRoot:$,routeId:i,paperVersion:p,numPages:1,onSelect:N,onError:c});const x=f.data?Je(f.data):"";return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Ke,{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:f.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):f.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:st(f.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void f.refetch(),children:"Retry"})," ",a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:$,className:"reader-web-document","data-page":"1",children:[!x.startsWith("# ")&&a.jsx("h1",{children:o}),a.jsx(Ye,{text:x})]})})})]})}const we=66,ot=240,J="pwc:reader:split-ratio",z=r=>`pwc:reader:session:${r}`,Q=r=>`pwc:reader:assistant-collapsed:${r}`,ye=r=>`pwc:reader:page:${r}`;function X(r){const i=Number(sessionStorage.getItem(ye(r)));return Number.isInteger(i)&&i>0?i:1}function it(){const r=Number(localStorage.getItem(J));return Number.isFinite(r)&&r>=45&&r<=75?r:we}function ct(r){const i=G(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 lt=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function dt(r){const i=new URL(r),o=i.pathname.match(lt);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&o&&!i.search?Pe(`/paper-assets/arxiv-pdf/${o[1]}`)??r:r}function ut(r){return new URL(r).hostname.replace(/^www\./,"")}function pt(r){if(!r)return{};const i={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=G(d.url);if(!t)continue;const p=new URL(t),v=p.pathname.split("/").filter(Boolean);if((p.hostname==="github.com"||p.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=G(d.url);if(t){i.projectPage={href:t,label:ut(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 ft(){var me,he,ge,be,ve;const r=He(),{paperId:i}=xe(),o=Be(i??"").replace(/v\d+$/i,""),b=tt(o,!!o),d=Z({queryKey:["chatAvailability"],queryFn:()=>rt.getAvailability(),refetchInterval:3e4,retry:!1}),t=b.data,p=t?et(t):null,v=p?null:(t==null?void 0:t.source)==="external"?Pe(`/paper-assets/external/${t.id}/paper.pdf`):ct(t==null?void 0:t.url_pdf),g=v&&(t==null?void 0:t.source)!=="external"?dt(v):v,N=pt(t),c=((me=t==null?void 0:t.arxiv_id)==null?void 0:me.replace(/v\d+$/i,""))||o,$=s.useCallback(()=>r(`/paper/${c}`),[c,r]),[f,w]=s.useState(()=>sessionStorage.getItem(z(o))||void 0),[x,S]=s.useState(it),[u,ee]=s.useState(()=>sessionStorage.getItem(Q(o))==="1"),[P,j]=s.useState("paper"),[L,C]=s.useState(),[Re,te]=s.useState(),[Se,re]=s.useState(!1),je=s.useCallback(()=>re(!0),[]),[Ce,y]=s.useState(""),[_e,ke]=s.useState(()=>X(o)),[_,Ne]=s.useState(0),[ae,se]=s.useState(!1),[$e,H]=s.useState(!1),A=s.useRef(null),B=s.useRef(null),F=s.useRef(null),ne=s.useRef(null),I=s.useRef(!1),E=s.useRef(0),R=s.useRef(0),q=s.useRef(0),k=s.useRef(x),K=s.useRef(X(o)),U=s.useRef(t==null?void 0:t.version),oe=De().reset,ie=s.useRef(`${o}:${f??"new"}`),m=_>=840;s.useEffect(()=>{const e=`${o}:${f??"new"}`;ie.current!==e&&(ie.current=e,oe())},[f,oe,o]),s.useEffect(()=>{t!=null&&t.version&&U.current&&t.version!==U.current&&(C(void 0),y("")),U.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(E.current),H(!1);const e=sessionStorage.getItem(z(o));w(e||void 0),ee(sessionStorage.getItem(Q(o))==="1"),j("paper"),re(!1),C(void 0),te(void 0),y("");const n=X(o);K.current=n,ke(n)},[o]),s.useEffect(()=>()=>{window.clearTimeout(E.current),cancelAnimationFrame(R.current)},[]),s.useLayoutEffect(()=>{const e=A.current;if(!e)return;const n=()=>Ne(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 h=document.querySelector('link[rel="canonical"]');const ze=!h;h||(h=document.createElement("link"),h.rel="canonical",document.head.appendChild(h));const Le=h.href;return h.href=`${window.location.origin}/paper/${c}`,()=>{document.title="Papers With Code",n?e==null||e.remove():e&&(e.content=l),ze?h==null||h.remove():h&&(h.href=Le)}},[c,t]);const T=s.useCallback(e=>{if(!_)return Math.max(45,Math.min(75,e));const n=480/_*100,l=100-360/_*100;return Math.max(n,Math.min(l,e))},[_]);s.useEffect(()=>S(e=>{const n=T(e);return k.current=n,n}),[T]);const M=e=>{const n=T(e);k.current=n,S(n),localStorage.setItem(J,String(n))},ce=e=>{var l;const n=T(e);k.current=n,B.current&&(B.current.style.width=`${n}%`),F.current&&(F.current.style.width=`${100-n}%`),(l=ne.current)==null||l.setAttribute("aria-valuenow",String(Math.round(n)))},le=e=>{q.current=e,!R.current&&(R.current=requestAnimationFrame(()=>{var l;R.current=0;const n=(l=A.current)==null?void 0:l.getBoundingClientRect();n!=null&&n.width&&ce((q.current-n.left)/n.width*100)}))},Ae=e=>{I.current=!0,se(!0),e.currentTarget.setPointerCapture(e.pointerId),le(e.clientX)},D=()=>{var e;if(I.current){if(R.current){cancelAnimationFrame(R.current),R.current=0;const n=(e=A.current)==null?void 0:e.getBoundingClientRect();n!=null&&n.width&&ce((q.current-n.left)/n.width*100)}I.current=!1,S(k.current),localStorage.setItem(J,String(k.current)),se(!1)}},de=e=>{window.clearTimeout(E.current),H(!0),ee(e),sessionStorage.setItem(Q(o),e?"1":"0"),E.current=window.setTimeout(()=>H(!1),ot+40)},Ie=e=>{w(e),sessionStorage.setItem(z(o),e)},Ee=()=>{w(void 0),sessionStorage.removeItem(z(o)),C(void 0),y("")},ue=((he=d.data)==null?void 0:he.paper_reader_selection_enabled)===!0,pe=e=>{C(e),y(`Selection from page ${e.page} added to chat`),m&&u&&de(!1)},Te=s.useCallback(e=>{C(e),e||y("")},[]),O=((ge=d.data)==null?void 0:ge.paper_reader_citations_enabled)===!0&&!!g,W=Z({queryKey:["paper-layout",c],queryFn:()=>Ge(c),enabled:O&&!!c,staleTime:5*6e4}).data,Me=s.useMemo(()=>O?{layout:W,open:e=>{const n=W?Oe(W,e):[];n.length&&(te(l=>({boxes:n,nonce:((l==null?void 0:l.nonce)??0)+1})),j("paper"))}}:null,[O,W]),fe=Fe()&&((be=d.data)==null?void 0:be.paper_reader_chat_enabled)!==!1,We=t&&fe&&p&&!Se?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&fe?a.jsx(at,{mode:"paper",routeSessionId:f,primaryPaper:{id:t.id,routeId:c,title:t.title},currentPage:()=>K.current,paperSelection:L,onPaperSelectionChange:Te,onSessionId:Ie,onReaderSubmit:()=>j("assistant"),onReaderNewChat:Ee}):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(V,{to:"/papers",children:"Browse papers"})]}):((ve=d.data)==null?void 0:ve.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(V,{to:`/paper/${c}`,children:"Back to paper"})]}):!g&&!p?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(V,{to:`/paper/${c}`,children:"Back to paper"})]}):a.jsxs("div",{className:"paper-reader-shell",children:[!m&&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:()=>j("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":P==="assistant","aria-label":L&&P!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>j("assistant"),children:["Chat",L&&P!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(Ve,{variant:"reader",children:a.jsxs("div",{ref:A,className:`reader-workspace${m?" is-desktop":" is-tabs"}${u?" is-assistant-collapsed":""}${ae?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:B,className:`reader-paper-pane${!m&&P!=="paper"?" is-hidden":""}`,style:m?{width:u?"100%":`${x}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!m&&P!=="paper",children:p?a.jsx(nt,{paperId:t.id,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,sourceUrl:p,resources:N,paperVersion:t.version,selectionEnabled:ue,onReady:je,onPaperSelection:pe,onPaperSelectionError:y}):g&&a.jsx(Qe,{url:g,downloadUrl:v??g,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,onClose:$,resources:N,initialPage:_e,resizeActive:ae||$e,selectionEnabled:ue,paperVersion:t.version,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:pe,onPaperSelectionError:y,highlight:Re,onPageChange:e=>{K.current=e,sessionStorage.setItem(ye(o),String(e))}})}),m&&!u&&a.jsx("div",{ref:ne,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(x),tabIndex:0,onPointerDown:Ae,onPointerMove:e=>{I.current&&le(e.clientX)},onPointerUp:D,onPointerCancel:D,onLostPointerCapture:D,onDoubleClick:()=>M(we),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),M(x+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&M(45),e.key==="End"&&M(75)}}),a.jsx("aside",{ref:F,id:"reader-chat-panel",className:`reader-assistant-pane${!m&&P!=="assistant"?" is-hidden":""}${m&&u?" is-collapsed":""}`,style:m?{width:u?0:`${100-x}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!m&&P!=="assistant"||u,children:a.jsx(Xe.Provider,{value:Me,children:We})}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:Ce}),m&&a.jsx("button",{type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!u,onClick:()=>de(!u),children:u?"Open chat":"Hide chat"})]})})]})}function Yt(){const{paperId:r=""}=xe();return a.jsx(Ue,{workspaceKey:`reader:${r}`,children:a.jsx(ft,{})})}export{Yt as default,pt as readerToolbarResources}; diff --git a/assets/PapersListView-Bitwo62b.js b/assets/PapersListView-DmAF2yfX.js similarity index 90% rename from assets/PapersListView-Bitwo62b.js rename to assets/PapersListView-DmAF2yfX.js index 7d50f59388903fc88e32ce2bb84488ac4c90634b..86f90d03171d7faa43711c09330751ed34d0d0d0 100644 --- a/assets/PapersListView-Bitwo62b.js +++ b/assets/PapersListView-DmAF2yfX.js @@ -1 +1 @@ -import{d as X,r as x,A as J,j as e,L as j,i as W}from"./index-CA09r0fx.js";import{I as U,T as Y,P as Z}from"./components-CHZvyPkS.js";import{c as ee}from"./catalog-C6oGGh8I.js";import{t as se,d as ae}from"./colors-C6t5MKud.js";import{u as re,a as te}from"./usePapers-Bb48_cnL.js";import{u as ne}from"./useDebounce-D9TiKPXO.js";import{u as ie}from"./useIntersectionObserver-jfqowp0n.js";import{S as _}from"./skeleton-CiNN3v7Q.js";import{A as oe,a as ce}from"./alert-DRS5VQLi.js";import{u as le}from"./useQuery-GCOPnmOE.js";import{P as de}from"./PaperFeedFilters-Ci7HUJiL.js";import{a as me,P as he,b as pe}from"./PaperDateFilter-DhUC4jzf.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-U9FJMhfb.js";import"./papers-2SfezChA.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-TrlVUjws.js";import"./popover-D6rzCRBR.js";const v=360;function ue(a,o){const m=a.toLocaleLowerCase();return o.trim().split(/\s+/).filter(Boolean).reduce((c,t)=>{const l=m.indexOf(t.toLocaleLowerCase());return l>=0&&(c<0||l=0?t+1:o}function fe(a,o){if(a.length<=v)return a;const m=ue(a,o);if(m<0||m0?"…":""}${a.slice(c,t).trim()}${tnew Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Oe=()=>{var I,$,T,O,B,H,M,q,G;const[a,o]=X(),m=a.get("framework")||void 0,c=a.get("repository")||void 0,t=!!(m||c),l=a.get("search")||"",[F,C]=x.useState(l),p=ne(F,300),n=!t&&l.trim().length>0;x.useEffect(()=>C(l),[l]),x.useEffect(()=>{if(p===l)return;const s=new URLSearchParams(a);p?s.set("search",p):s.delete("search"),o(s,{replace:!0})},[p]),x.useEffect(()=>{const s=a.get("order_by"),i=new URLSearchParams(a);n&&!["relevance","date_published","citation_count"].includes(s||"")?(i.set("order_by","relevance"),o(i,{replace:!0})):!n&&s==="relevance"&&(i.delete("order_by"),o(i,{replace:!0}))},[n,a,o]);const L=a.get("order_by"),g=L==="citation_count"?"cited":L==="date_published"?"new":n?"relevance":"trending",u=me(a),w=a.get("has_hf_artifacts")==="true",k=!t&&a.get("has_code")==="true",y=(s,i)=>{const h=new URLSearchParams(a);i?h.set(s,i):h.delete(s),o(h)},Q=s=>{y("order_by",s==="cited"?"citation_count":s==="new"?"date_published":s)},b=re({page_size:20,order_by:g==="trending"?"trending":g==="cited"?"citation_count":"date_published",order_dir:"desc",search:t&&p||void 0,start_date:u.startDate,end_date:u.endDate,include_resources:!0,conference:a.get("conference")||void 0,latest_only:a.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:m,repository:c,enabled:!n}),R=te({q:p.trim(),order_by:g==="cited"?"citation_count":g==="new"?"date_published":"relevance",start_date:u.startDate,end_date:u.endDate,has_code:k,has_hf_artifacts:w,enabled:n}),d=n?R:b,A=le({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),enabled:!t&&!n,staleTime:10*60*1e3}),N=x.useMemo(()=>{var i;return(((i=d.data)==null?void 0:i.pages.flatMap(h=>h.results))||[]).map(h=>{const S=se(h);return n?{...S,abstract:fe(S.abstract,l)}:S})},[d.data,n,l]),{targetRef:K,isIntersecting:D}=ie({rootMargin:"200px"});x.useEffect(()=>{D&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[D,d.hasNextPage,d.isFetchingNextPage]);const f=((T=($=(I=b.data)==null?void 0:I.pages)==null?void 0:$[0])==null?void 0:T.count)??0,r=(H=(B=(O=b.data)==null?void 0:O.pages)==null?void 0:B[0])==null?void 0:H.scope,P=(q=(M=R.data)==null?void 0:M.pages)==null?void 0:q.at(-1),E=m&&d.error instanceof J&&d.error.status===404,V=(r==null?void 0:r.kind)==="framework"?r.framework_name:r==null?void 0:r.repository;return e.jsxs("div",{className:"page",children:[(r==null?void 0:r.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(j,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(j,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:r.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:t?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:V||m||c})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",l,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:t?(r==null?void 0:r.kind)==="framework"?f>0&&`${f.toLocaleString()} papers.`:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",f>0&&`${f.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${N.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",f>0&&`${f.toLocaleString()} papers indexed.`]})}),t&&r&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:r.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(U,{name:"github",size:13}),r.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r.repository||"GitHub"}),r.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",je(r.num_stars)]})]}):"GitHub"]}),r.kind==="framework"&&r.introducing_paper_arxiv_id&&e.jsx(j,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),r.kind==="framework"&&r.recommended_tasks&&r.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:r.recommended_tasks.map(s=>s.slug?e.jsx(Y,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx(he,{startDate:u.startDate,endDate:u.endDate,onChange:s=>o(pe(a,s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(U,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:F,onChange:s=>C(s.target.value)})]})}),e.jsxs("div",{className:t||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!t&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(_,{className:"h-5 w-full"},i))}),(G=A.data)==null?void 0:G.map(s=>e.jsxs(j,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ae(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:(n?ge:xe).map(([s,i])=>e.jsx("button",{className:`sort-btn ${g===s?"active":""}`,onClick:()=>Q(s),children:i},s))}),e.jsx(de,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>y("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>y("has_hf_artifacts",s?"true":void 0),showHasCode:!t})]}),e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})]}),E?e.jsx("div",{className:"no-results",children:"Framework not found."}):d.error&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsx(ce,{children:"Failed to load papers. Please try again."})}),!E&&(d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(_,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},i))}):N.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("p",{children:"No matching papers."}),n&&W()&&e.jsx(j,{to:`/chat?q=${encodeURIComponent(l.trim())}`,children:"Ask the assistant instead"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,i)=>e.jsx(Z,{paper:s,rank:i+1,highlightQuery:n?l:void 0},s.id))}),e.jsx("div",{ref:K,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),!d.hasNextPage&&!d.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:P!=null&&P.cap_reached?"End of the top 100 results":"End of results"})]}))]})]})]})};export{Oe as default}; +import{d as X,r as x,A as J,j as e,L as j,i as W}from"./index-DGz7IJy3.js";import{I as U,T as Y,P as Z}from"./components-C75Gxt6c.js";import{c as ee}from"./catalog-CI50zqwR.js";import{t as se,d as ae}from"./colors-YtiKVy3X.js";import{u as re,a as te}from"./usePapers-knk68Pd9.js";import{u as ne}from"./useDebounce-CZ3fZlNX.js";import{u as ie}from"./useIntersectionObserver-B7kBuOiP.js";import{S as _}from"./skeleton-Qth9DQSW.js";import{A as oe,a as ce}from"./alert-CfvggGdB.js";import{u as le}from"./useQuery-SnJNmisF.js";import{P as de}from"./PaperFeedFilters-BIXkRwGe.js";import{a as me,P as he,b as pe}from"./PaperDateFilter-C6KBd0r-.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DtD88QQA.js";import"./papers-CgK5TA59.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-Bix5WR2s.js";import"./popover-VInL7Z23.js";const v=360;function ue(a,o){const m=a.toLocaleLowerCase();return o.trim().split(/\s+/).filter(Boolean).reduce((c,t)=>{const l=m.indexOf(t.toLocaleLowerCase());return l>=0&&(c<0||l=0?t+1:o}function fe(a,o){if(a.length<=v)return a;const m=ue(a,o);if(m<0||m0?"…":""}${a.slice(c,t).trim()}${tnew Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Oe=()=>{var I,$,T,O,B,H,M,q,G;const[a,o]=X(),m=a.get("framework")||void 0,c=a.get("repository")||void 0,t=!!(m||c),l=a.get("search")||"",[F,C]=x.useState(l),p=ne(F,300),n=!t&&l.trim().length>0;x.useEffect(()=>C(l),[l]),x.useEffect(()=>{if(p===l)return;const s=new URLSearchParams(a);p?s.set("search",p):s.delete("search"),o(s,{replace:!0})},[p]),x.useEffect(()=>{const s=a.get("order_by"),i=new URLSearchParams(a);n&&!["relevance","date_published","citation_count"].includes(s||"")?(i.set("order_by","relevance"),o(i,{replace:!0})):!n&&s==="relevance"&&(i.delete("order_by"),o(i,{replace:!0}))},[n,a,o]);const L=a.get("order_by"),g=L==="citation_count"?"cited":L==="date_published"?"new":n?"relevance":"trending",u=me(a),w=a.get("has_hf_artifacts")==="true",k=!t&&a.get("has_code")==="true",y=(s,i)=>{const h=new URLSearchParams(a);i?h.set(s,i):h.delete(s),o(h)},Q=s=>{y("order_by",s==="cited"?"citation_count":s==="new"?"date_published":s)},b=re({page_size:20,order_by:g==="trending"?"trending":g==="cited"?"citation_count":"date_published",order_dir:"desc",search:t&&p||void 0,start_date:u.startDate,end_date:u.endDate,include_resources:!0,conference:a.get("conference")||void 0,latest_only:a.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:m,repository:c,enabled:!n}),R=te({q:p.trim(),order_by:g==="cited"?"citation_count":g==="new"?"date_published":"relevance",start_date:u.startDate,end_date:u.endDate,has_code:k,has_hf_artifacts:w,enabled:n}),d=n?R:b,A=le({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),enabled:!t&&!n,staleTime:10*60*1e3}),N=x.useMemo(()=>{var i;return(((i=d.data)==null?void 0:i.pages.flatMap(h=>h.results))||[]).map(h=>{const S=se(h);return n?{...S,abstract:fe(S.abstract,l)}:S})},[d.data,n,l]),{targetRef:K,isIntersecting:D}=ie({rootMargin:"200px"});x.useEffect(()=>{D&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[D,d.hasNextPage,d.isFetchingNextPage]);const f=((T=($=(I=b.data)==null?void 0:I.pages)==null?void 0:$[0])==null?void 0:T.count)??0,r=(H=(B=(O=b.data)==null?void 0:O.pages)==null?void 0:B[0])==null?void 0:H.scope,P=(q=(M=R.data)==null?void 0:M.pages)==null?void 0:q.at(-1),E=m&&d.error instanceof J&&d.error.status===404,V=(r==null?void 0:r.kind)==="framework"?r.framework_name:r==null?void 0:r.repository;return e.jsxs("div",{className:"page",children:[(r==null?void 0:r.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(j,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(j,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:r.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:t?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:V||m||c})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",l,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:t?(r==null?void 0:r.kind)==="framework"?f>0&&`${f.toLocaleString()} papers.`:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",f>0&&`${f.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${N.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",f>0&&`${f.toLocaleString()} papers indexed.`]})}),t&&r&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:r.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(U,{name:"github",size:13}),r.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r.repository||"GitHub"}),r.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",je(r.num_stars)]})]}):"GitHub"]}),r.kind==="framework"&&r.introducing_paper_arxiv_id&&e.jsx(j,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),r.kind==="framework"&&r.recommended_tasks&&r.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:r.recommended_tasks.map(s=>s.slug?e.jsx(Y,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx(he,{startDate:u.startDate,endDate:u.endDate,onChange:s=>o(pe(a,s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(U,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:F,onChange:s=>C(s.target.value)})]})}),e.jsxs("div",{className:t||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!t&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(_,{className:"h-5 w-full"},i))}),(G=A.data)==null?void 0:G.map(s=>e.jsxs(j,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ae(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:(n?ge:xe).map(([s,i])=>e.jsx("button",{className:`sort-btn ${g===s?"active":""}`,onClick:()=>Q(s),children:i},s))}),e.jsx(de,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>y("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>y("has_hf_artifacts",s?"true":void 0),showHasCode:!t})]}),e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})]}),E?e.jsx("div",{className:"no-results",children:"Framework not found."}):d.error&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsx(ce,{children:"Failed to load papers. Please try again."})}),!E&&(d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(_,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},i))}):N.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("p",{children:"No matching papers."}),n&&W()&&e.jsx(j,{to:`/chat?q=${encodeURIComponent(l.trim())}`,children:"Ask the assistant instead"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,i)=>e.jsx(Z,{paper:s,rank:i+1,highlightQuery:n?l:void 0},s.id))}),e.jsx("div",{ref:K,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),!d.hasNextPage&&!d.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:P!=null&&P.cap_reached?"End of the top 100 results":"End of results"})]}))]})]})]})};export{Oe as default}; diff --git a/assets/PrivacyView-BrhRqIBn.js b/assets/PrivacyView-BY3HWUzu.js similarity index 99% rename from assets/PrivacyView-BrhRqIBn.js rename to assets/PrivacyView-BY3HWUzu.js index 537d0d3f3aea622c27d135d5a2acfd409d7d69d9..aaeefaa9b5ee2a74693e78f40f75754f217463ab 100644 --- a/assets/PrivacyView-BrhRqIBn.js +++ b/assets/PrivacyView-BY3HWUzu.js @@ -1 +1 @@ -import{F as s,j as e}from"./index-CA09r0fx.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{F as s,j as e}from"./index-DGz7IJy3.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-Dgq2KKl4.js b/assets/RateLimitsView-ksu7TvSj.js similarity index 87% rename from assets/RateLimitsView-Dgq2KKl4.js rename to assets/RateLimitsView-ksu7TvSj.js index 4de268e38688c9df3a4b7ce3a674c692e5441542..a2221b47b30b1eacfbf11bb019142cd50c66ca2f 100644 --- a/assets/RateLimitsView-Dgq2KKl4.js +++ b/assets/RateLimitsView-ksu7TvSj.js @@ -1 +1 @@ -import{j as e,G as t}from"./index-CA09r0fx.js";import{u as s}from"./useQuery-GCOPnmOE.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,G as t}from"./index-DGz7IJy3.js";import{u as s}from"./useQuery-SnJNmisF.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-BAC_HrTd.js b/assets/ResearchFollowButton-_BF37169.js similarity index 89% rename from assets/ResearchFollowButton-BAC_HrTd.js rename to assets/ResearchFollowButton-_BF37169.js index 31c211536e253004c3150f9840098ee51e5ab4e3..a1446f123784eb74f572a6662fa0c5ff7ac4dc66 100644 --- a/assets/ResearchFollowButton-BAC_HrTd.js +++ b/assets/ResearchFollowButton-_BF37169.js @@ -1 +1 @@ -import{c as y,ap as F,m as N,r as S,J as L,j as e,Y as v,l as C,L as i}from"./index-CA09r0fx.js";import{u as G}from"./useQuery-GCOPnmOE.js";import{u as k}from"./useMutation-CUMX1r3q.js";import{r as m}from"./research-CAknkOM8.js";import{P as p}from"./plus-BGozleiT.js";const j={task:"Get new papers on this task",method:"Get new papers using this method",benchmark:"Get new results on this benchmark",author:"Get new papers by this author",organization:"Get new papers from this organization"};function R({kind:a,entityId:n}){var f;const l=y(),s=l==null?void 0:l.user,c=F(),h=N(),[x,g]=S.useState(null),u=`${a}:${n}`,d=["research-follows",s==null?void 0:s.hf_subject],r=G({queryKey:d,queryFn:m.follows,enabled:!!s}),o=((f=r.data)==null?void 0:f.some(w=>w.kind===a&&String(w.entity_id)===String(n)))??!1,t=k({mutationFn:()=>m.setFollow(a,n,!o),onSuccess:async()=>{g(o?null:u),await h.invalidateQueries({queryKey:d}),await h.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]})}});if(!l||!s&&L())return null;if(!s)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:v(c.pathname+c.search),children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]}),e.jsxs("span",{className:"research-follow-hint",children:["Sign in to ",j[a].toLowerCase(),"."]})]});const b=t.error||r.error;return e.jsxs("div",{className:"research-follow",children:[e.jsx("button",{type:"button",className:o?"research-follow-btn is-following":"research-follow-btn",disabled:r.isLoading||!!r.error||t.isPending,"aria-pressed":o,"aria-label":o?"Unfollow":"Follow",onClick:()=>t.mutate(),children:o?e.jsxs(e.Fragment,{children:[e.jsx(C,{"aria-hidden":"true"}),e.jsx("span",{className:"research-follow-label",children:"Following"}),e.jsx("span",{className:"research-follow-label-hover",children:"Unfollow"})]}):e.jsxs(e.Fragment,{children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]})}),b?e.jsx("span",{className:"research-follow-hint is-error",role:"alert",children:"Could not update follows. Please try again."}):o?x===u&&e.jsxs("span",{className:"research-follow-hint",role:"status",children:["Added to ",e.jsx(i,{to:"/following",children:"your Following feed"})," · ",e.jsx(i,{to:"/settings",children:"Manage in Settings"})]}):e.jsxs("span",{className:"research-follow-hint",children:[j[a]," in ",e.jsx(i,{to:"/following",children:"your Following feed"}),"."]})]})}export{R}; +import{c as y,ap as F,m as N,r as S,J as L,j as e,Y as v,l as C,L as i}from"./index-DGz7IJy3.js";import{u as G}from"./useQuery-SnJNmisF.js";import{u as k}from"./useMutation-B1oRtfbH.js";import{r as m}from"./research-C0oNhyj8.js";import{P as p}from"./plus-v7R1dHou.js";const j={task:"Get new papers on this task",method:"Get new papers using this method",benchmark:"Get new results on this benchmark",author:"Get new papers by this author",organization:"Get new papers from this organization"};function R({kind:a,entityId:n}){var f;const l=y(),s=l==null?void 0:l.user,c=F(),h=N(),[x,g]=S.useState(null),u=`${a}:${n}`,d=["research-follows",s==null?void 0:s.hf_subject],r=G({queryKey:d,queryFn:m.follows,enabled:!!s}),o=((f=r.data)==null?void 0:f.some(w=>w.kind===a&&String(w.entity_id)===String(n)))??!1,t=k({mutationFn:()=>m.setFollow(a,n,!o),onSuccess:async()=>{g(o?null:u),await h.invalidateQueries({queryKey:d}),await h.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]})}});if(!l||!s&&L())return null;if(!s)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:v(c.pathname+c.search),children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]}),e.jsxs("span",{className:"research-follow-hint",children:["Sign in to ",j[a].toLowerCase(),"."]})]});const b=t.error||r.error;return e.jsxs("div",{className:"research-follow",children:[e.jsx("button",{type:"button",className:o?"research-follow-btn is-following":"research-follow-btn",disabled:r.isLoading||!!r.error||t.isPending,"aria-pressed":o,"aria-label":o?"Unfollow":"Follow",onClick:()=>t.mutate(),children:o?e.jsxs(e.Fragment,{children:[e.jsx(C,{"aria-hidden":"true"}),e.jsx("span",{className:"research-follow-label",children:"Following"}),e.jsx("span",{className:"research-follow-label-hover",children:"Unfollow"})]}):e.jsxs(e.Fragment,{children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]})}),b?e.jsx("span",{className:"research-follow-hint is-error",role:"alert",children:"Could not update follows. Please try again."}):o?x===u&&e.jsxs("span",{className:"research-follow-hint",role:"status",children:["Added to ",e.jsx(i,{to:"/following",children:"your Following feed"})," · ",e.jsx(i,{to:"/settings",children:"Manage in Settings"})]}):e.jsxs("span",{className:"research-follow-hint",children:[j[a]," in ",e.jsx(i,{to:"/following",children:"your Following feed"}),"."]})]})}export{R}; diff --git a/assets/SavedPapersView-BCiUyr2H.js b/assets/SavedPapersView-Cz0s6dJz.js similarity index 88% rename from assets/SavedPapersView-BCiUyr2H.js rename to assets/SavedPapersView-Cz0s6dJz.js index 7170f0f1e8f3661863b2e5f8e992810726dad231..305b8722736022cb2f13f350c2b6ff3d5668f51a 100644 --- a/assets/SavedPapersView-BCiUyr2H.js +++ b/assets/SavedPapersView-Cz0s6dJz.js @@ -1 +1 @@ -import{a as h,A as g,j as e,H as v,L as x,G as j}from"./index-CA09r0fx.js";import{p as f}from"./paperQueryKeys-BP2E-0yf.js";import{u as N}from"./useQuery-GCOPnmOE.js";import{T as b,P as k}from"./components-CHZvyPkS.js";import{S as r}from"./skeleton-CiNN3v7Q.js";import{A as y,a as w}from"./alert-DRS5VQLi.js";import{t as A}from"./colors-C6t5MKud.js";import{s as B}from"./savedPapersAuth-WTp5kQxS.js";import"./LatexTitle-U9FJMhfb.js";import"./papers-2SfezChA.js";import"./safeExternalHref-CkBrsh84.js";const W=()=>{var c,o;const{user:t,isLoading:u}=h(),a=N({queryKey:[...f.feeds.saved],queryFn:()=>j.getBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,d=()=>{window.location.assign(B())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(c=a.data)!=null&&c.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:d,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(y,{variant:"destructive",className:"mb-4",children:e.jsx(w,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:d,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(k,{paper:A(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{W as default}; +import{a as h,A as g,j as e,H as v,L as x,G as j}from"./index-DGz7IJy3.js";import{p as f}from"./paperQueryKeys-BP2E-0yf.js";import{u as N}from"./useQuery-SnJNmisF.js";import{T as b,P as k}from"./components-C75Gxt6c.js";import{S as r}from"./skeleton-Qth9DQSW.js";import{A as y,a as w}from"./alert-CfvggGdB.js";import{t as A}from"./colors-YtiKVy3X.js";import{s as B}from"./savedPapersAuth-BLCvmsFl.js";import"./LatexTitle-DtD88QQA.js";import"./papers-CgK5TA59.js";import"./safeExternalHref-CkBrsh84.js";const W=()=>{var c,o;const{user:t,isLoading:u}=h(),a=N({queryKey:[...f.feeds.saved],queryFn:()=>j.getBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,d=()=>{window.location.assign(B())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(c=a.data)!=null&&c.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:d,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(y,{variant:"destructive",className:"mb-4",children:e.jsx(w,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:d,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(k,{paper:A(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{W as default}; diff --git a/assets/SearchOverlay-V0kUCUuz.js b/assets/SearchOverlay-C1MdC-eB.js similarity index 93% rename from assets/SearchOverlay-V0kUCUuz.js rename to assets/SearchOverlay-C1MdC-eB.js index 3ae593a927c7b794e430b033102ff18544f1e436..9ea4e7f2c645db34ff3b1b71bf8db4987e6248c3 100644 --- a/assets/SearchOverlay-V0kUCUuz.js +++ b/assets/SearchOverlay-C1MdC-eB.js @@ -1 +1 @@ -import{r as C,b as Q,F as S,i as D,j as e}from"./index-CA09r0fx.js";import{p as K}from"./paperQueryKeys-BP2E-0yf.js";import{u}from"./useQuery-GCOPnmOE.js";import{L as $}from"./LatexTitle-U9FJMhfb.js";import{c as j}from"./catalog-C6oGGh8I.js";import{p as L}from"./papers-2SfezChA.js";import{u as M}from"./useDebounce-D9TiKPXO.js";import{c as I,h as z,d as B}from"./colors-C6t5MKud.js";const H=10,O=350,y=3,ss=({open:t,onClose:i})=>{var E,F,q,w;const v=C.useRef(null),T=Q(),[r,A]=S.useState(""),a=M(r,O),p=r.trim(),c=a.length>=y,x=D();C.useEffect(()=>{var n;if(!t)return;(n=v.current)==null||n.focus();const s=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),i())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,i]);const f=u({queryKey:[...K.feeds.searchOverlay,a],queryFn:()=>L.search(a,1,H),enabled:t&&c,staleTime:6e4,retry:!1}),k=u({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:t&&c,staleTime:6e4,retry:!1}),N=u({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:t&&c,staleTime:6e4,retry:!1}),b=u({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({q:a,page_size:6}),enabled:t&&c,staleTime:6e4,retry:!1});if(!t)return null;const o=((E=k.data)==null?void 0:E.results)||[],h=((F=N.data)==null?void 0:F.results)||[],d=((q=b.data)==null?void 0:q.results)||[],m=((w=f.data)==null?void 0:w.results)||[],P=f.isFetching||k.isFetching||N.isFetching||b.isFetching,R=o.length||m.length||h.length||d.length,l=s=>{i(),T(s)},_=()=>{const s=r.trim();s&&l(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:i,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:r,onChange:s=>A(s.target.value),onKeyDown:s=>{x&&s.key==="Enter"&&(s.preventDefault(),_())}}),e.jsxs("div",{className:"search-results",children:[x&&r.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:_,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",r.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!c&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",y," characters."]}),c&&!P&&!R&&e.jsxs("div",{className:"search-empty",children:['No matches for "',r,'"']}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(s=>{const n=I(z(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>l(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:n.dot}}),e.jsx("span",{className:"name",children:B(s.name,s.slug)}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id)})]}),h.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Methods · ",h.length]}),h.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>l(`/methods/${s.slug||s.id}`),children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:s.name}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",d.length]}),d.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>l(`/benchmark/${s.slug||s.id}`),children:[e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," entries"]})]},s.id))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",m.length]}),m.map(s=>{var n;return e.jsxs("div",{className:"search-result",onClick:()=>l(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx($,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((n=s.authors)==null?void 0:n[0])&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.authors[0],s.authors.length>1?" et al.":""]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["↑ ",s.citation_count.toLocaleString()]})]})]})]},s.id)})]}),p.length>=y&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>l(`/papers?search=${encodeURIComponent(p)}`),children:["View all paper results for “",p,"”"]})]})]})})};export{ss as default}; +import{r as C,b as Q,F as S,i as D,j as e}from"./index-DGz7IJy3.js";import{p as K}from"./paperQueryKeys-BP2E-0yf.js";import{u}from"./useQuery-SnJNmisF.js";import{L as $}from"./LatexTitle-DtD88QQA.js";import{c as j}from"./catalog-CI50zqwR.js";import{p as L}from"./papers-CgK5TA59.js";import{u as M}from"./useDebounce-CZ3fZlNX.js";import{c as I,h as z,d as B}from"./colors-YtiKVy3X.js";const H=10,O=350,y=3,ss=({open:t,onClose:i})=>{var E,F,q,w;const v=C.useRef(null),T=Q(),[r,A]=S.useState(""),a=M(r,O),p=r.trim(),c=a.length>=y,x=D();C.useEffect(()=>{var n;if(!t)return;(n=v.current)==null||n.focus();const s=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),i())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,i]);const f=u({queryKey:[...K.feeds.searchOverlay,a],queryFn:()=>L.search(a,1,H),enabled:t&&c,staleTime:6e4,retry:!1}),k=u({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:t&&c,staleTime:6e4,retry:!1}),N=u({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:t&&c,staleTime:6e4,retry:!1}),b=u({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({q:a,page_size:6}),enabled:t&&c,staleTime:6e4,retry:!1});if(!t)return null;const o=((E=k.data)==null?void 0:E.results)||[],h=((F=N.data)==null?void 0:F.results)||[],d=((q=b.data)==null?void 0:q.results)||[],m=((w=f.data)==null?void 0:w.results)||[],P=f.isFetching||k.isFetching||N.isFetching||b.isFetching,R=o.length||m.length||h.length||d.length,l=s=>{i(),T(s)},_=()=>{const s=r.trim();s&&l(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:i,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:r,onChange:s=>A(s.target.value),onKeyDown:s=>{x&&s.key==="Enter"&&(s.preventDefault(),_())}}),e.jsxs("div",{className:"search-results",children:[x&&r.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:_,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",r.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!c&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",y," characters."]}),c&&!P&&!R&&e.jsxs("div",{className:"search-empty",children:['No matches for "',r,'"']}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(s=>{const n=I(z(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>l(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:n.dot}}),e.jsx("span",{className:"name",children:B(s.name,s.slug)}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id)})]}),h.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Methods · ",h.length]}),h.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>l(`/methods/${s.slug||s.id}`),children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:s.name}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",d.length]}),d.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>l(`/benchmark/${s.slug||s.id}`),children:[e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," entries"]})]},s.id))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",m.length]}),m.map(s=>{var n;return e.jsxs("div",{className:"search-result",onClick:()=>l(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx($,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((n=s.authors)==null?void 0:n[0])&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.authors[0],s.authors.length>1?" et al.":""]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["↑ ",s.citation_count.toLocaleString()]})]})]})]},s.id)})]}),p.length>=y&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>l(`/papers?search=${encodeURIComponent(p)}`),children:["View all paper results for “",p,"”"]})]})]})})};export{ss as default}; diff --git a/assets/SettingsView-9QN1I95Q.js b/assets/SettingsView-Bk7rZu9X.js similarity index 97% rename from assets/SettingsView-9QN1I95Q.js rename to assets/SettingsView-Bk7rZu9X.js index 796177b8a285f37b244ba7b9d2cce07c3a4e0d77..c94a0aed7e10b4a757ab680a737900104203e342 100644 --- a/assets/SettingsView-9QN1I95Q.js +++ b/assets/SettingsView-Bk7rZu9X.js @@ -1,4 +1,4 @@ -import{g as H,a as B,m as Y,j as e,L as Q,H as w,Y as le,r as re,k as oe,aq as ce,i as de,F as k,A as ee}from"./index-CA09r0fx.js";import{u as P}from"./useQuery-GCOPnmOE.js";import{u as N}from"./useMutation-CUMX1r3q.js";import{r as O}from"./research-CAknkOM8.js";import{S as U}from"./switch-VPV7aWRb.js";import{A as he}from"./arrow-right-DVe4s0sr.js";import{M as ue,L as ge,F as me,B as pe}from"./mail-DhwziyiT.js";import{T as xe}from"./trophy-C7Evgy5l.js";import{c as v}from"./chat-XoDxf8nx.js";import{f as je,D as be}from"./latexPlainText-DI8YEXVe.js";import{a as ye,u as fe,r as ve,O as D}from"./openrouter-B__IMcd_.js";import{E as Z}from"./external-link-b6zNfUPN.js";import{M as we}from"./moon-Cn0WCdQ9.js";import"./index-1y8ilIyE.js";/** +import{g as H,a as B,m as Y,j as e,L as Q,H as w,Y as le,r as re,k as oe,aq as ce,i as de,F as k,A as ee}from"./index-DGz7IJy3.js";import{u as P}from"./useQuery-SnJNmisF.js";import{u as N}from"./useMutation-B1oRtfbH.js";import{r as O}from"./research-C0oNhyj8.js";import{S as U}from"./switch-CwjWc_fX.js";import{A as he}from"./arrow-right-B6-s6W60.js";import{M as ue,L as ge,F as me,B as pe}from"./mail-Dydp9Gj0.js";import{T as xe}from"./trophy-B1w2ILFe.js";import{c as v}from"./chat-C_06RcUY.js";import{f as je,D as be}from"./latexPlainText-DI8YEXVe.js";import{a as ye,u as fe,r as ve,O as D}from"./openrouter-yE0IuBaT.js";import{E as Z}from"./external-link-ChfVBxLK.js";import{M as we}from"./moon-BTUByzSL.js";import"./index-Bx9aRYc1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SharedChatView-NuSCzJsx.js b/assets/SharedChatView-rTXZ7eaT.js similarity index 80% rename from assets/SharedChatView-NuSCzJsx.js rename to assets/SharedChatView-rTXZ7eaT.js index 9eb1303813486fdb34cd3dae20706043c69cc345..5f5c8f35b1b76728d20e34321bf27804cdf9f736 100644 --- a/assets/SharedChatView-NuSCzJsx.js +++ b/assets/SharedChatView-rTXZ7eaT.js @@ -1 +1 @@ -import{u as f,b as x,r as h,j as e,f as g}from"./index-CA09r0fx.js";import{u as v}from"./useQuery-GCOPnmOE.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-BYQbPlsN.js";import{C as m,d as w,p as N,q as C,g as q}from"./chatLaunch-CutMsO9s.js";/* empty css */import"./hover-card-0saQl8Kd.js";import"./github-Cto4qly3.js";import"./github-D8NiZH3t.js";import"./file-text-7GwUpKU3.js";import"./catalog-C6oGGh8I.js";import"./PaperPreviewLink-DUf7c7wv.js";import"./index-BeqN5AbC.js";import"./index-qKrWNpd1.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-2SfezChA.js";import"./useMutation-CUMX1r3q.js";import"./chat-XoDxf8nx.js";import"./copy-BRZnlAd3.js";import"./thumbs-up-BxkpoAw0.js";import"./external-link-b6zNfUPN.js";import"./chevron-down-MPck50eR.js";import"./earth-gRrLiaVn.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},X=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):t.isError||!t.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),l&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{X as default}; +import{u as f,b as x,r as h,j as e,f as g}from"./index-DGz7IJy3.js";import{u as v}from"./useQuery-SnJNmisF.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-DI-cB4-t.js";import{C as m,d as w,p as N,q as C,g as q}from"./chatLaunch-DVedsuWi.js";/* empty css */import"./hover-card-32Q2qmuv.js";import"./github-BBO8LC-h.js";import"./github-DcSqeKOx.js";import"./file-text-BHDe9k9N.js";import"./catalog-CI50zqwR.js";import"./PaperPreviewLink-DUJYnY2B.js";import"./index-DyDOGuaE.js";import"./index-CEcXuWDB.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-CgK5TA59.js";import"./useMutation-B1oRtfbH.js";import"./chat-C_06RcUY.js";import"./copy-CDHIGRQI.js";import"./thumbs-up-C5Gnbt6N.js";import"./external-link-ChfVBxLK.js";import"./chevron-down-CzLvLwcd.js";import"./earth-BQV4xejs.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},X=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):t.isError||!t.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),l&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{X as default}; diff --git a/assets/SignInToEditDialog-Ub_UIzh4.js b/assets/SignInToEditDialog-POB2dswN.js similarity index 95% rename from assets/SignInToEditDialog-Ub_UIzh4.js rename to assets/SignInToEditDialog-POB2dswN.js index d040ac2831b636f28d41974658b55792e18cd3db..f73c5f1375cbe6b2e19cd63b88476b46567cdaee 100644 --- a/assets/SignInToEditDialog-Ub_UIzh4.js +++ b/assets/SignInToEditDialog-POB2dswN.js @@ -1,4 +1,4 @@ -import{g as be,r as a,j as e,a2 as je,x as fe,a3 as ye,h as Ne,o as we,X as Se,l as _e,H as ke}from"./index-CA09r0fx.js";import{B as P}from"./button-BkpxXw_S.js";import{I as u}from"./input-CtSl48Mp.js";import{T as Ce}from"./textarea-FDLjm_7X.js";import{S as se}from"./searchable-select-CNl4nXvO.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as De}from"./dialog-BMl1SbyK.js";import{u as Ie}from"./useMutation-CUMX1r3q.js";import{s as b,p as j}from"./submissions-CERjLe5i.js";import{c as te}from"./catalog-C6oGGh8I.js";import{L as Ee}from"./loader-circle-DTsjFZ6p.js";/** +import{g as be,r as a,j as e,a2 as je,x as fe,a3 as ye,h as Ne,o as we,X as Se,l as _e,H as ke}from"./index-DGz7IJy3.js";import{B as P}from"./button-DEdvni-v.js";import{I as u}from"./input-DVdOE4Xl.js";import{T as Ce}from"./textarea-BC6nB3vb.js";import{S as se}from"./searchable-select-C2BNEPyI.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as De}from"./dialog-DRb-cMlG.js";import{u as Ie}from"./useMutation-B1oRtfbH.js";import{s as b,p as j}from"./submissions-0YkeXTxt.js";import{c as te}from"./catalog-CI50zqwR.js";import{L as Ee}from"./loader-circle-DZdOKwBN.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/StagingAccessRequestView--9rXbvGS.js b/assets/StagingAccessRequestView-_VYsleyo.js similarity index 95% rename from assets/StagingAccessRequestView--9rXbvGS.js rename to assets/StagingAccessRequestView-_VYsleyo.js index a2ea3c62b66c79815f0066b4cc0492bc7989df89..79bf0a9b2e7cd4554ec4283e164481d4f523166a 100644 --- a/assets/StagingAccessRequestView--9rXbvGS.js +++ b/assets/StagingAccessRequestView-_VYsleyo.js @@ -1 +1 @@ -import{a as m,F as a,j as e,H as g,aS as p}from"./index-CA09r0fx.js";import{C as j}from"./circle-check-CO6G-kzo.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,F as a,j as e,H as g,aS as p}from"./index-DGz7IJy3.js";import{C as j}from"./circle-check-vSqohmZs.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-BRu8KXRt.js b/assets/SubmissionsDashboard-CVsy2Di_.js similarity index 98% rename from assets/SubmissionsDashboard-BRu8KXRt.js rename to assets/SubmissionsDashboard-CVsy2Di_.js index 25fc1616da1c3f8d316ed3fd2547825cd56bc8a7..29f5fa1ecb93fa00874167c3240253501b855fc4 100644 --- a/assets/SubmissionsDashboard-BRu8KXRt.js +++ b/assets/SubmissionsDashboard-CVsy2Di_.js @@ -1,4 +1,4 @@ -var be=s=>{throw TypeError(s)};var ne=(s,t,i)=>t.has(s)||be("Cannot "+i);var g=(s,t,i)=>(ne(s,t,"read from private field"),i?i.call(s):t.get(s)),R=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(ne(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),O=(s,t,i)=>(ne(s,t,"access private method"),i);import{au as Oe,aH as ae,ax as Me,aN as Te,m as we,r as P,az as Ie,g as Ae,j as e,V as Se,x as L,F as w,a as Fe,h as Ee,aO as Ue,aP as Le,aQ as Qe}from"./index-CA09r0fx.js";import{i as De,r as qe,e as ze,b as $e}from"./evaluationQueryInvalidation-CC5JhGiX.js";import{p as He}from"./paperQueryKeys-BP2E-0yf.js";import{Q as Ce,b as Be,c as Pe,e as Je,d as Ke,f as Ge,s as xe,g as Ve,h as We,u as oe}from"./useQuery-GCOPnmOE.js";import{u as je}from"./useMutation-CUMX1r3q.js";import{c as Q}from"./catalog-C6oGGh8I.js";import{s as q}from"./safeExternalHref-CkBrsh84.js";import{p as Ye}from"./papers-2SfezChA.js";import{s as G}from"./submissions-CERjLe5i.js";import{R as Xe,C as Ze}from"./refresh-cw-D8COsQ3x.js";import{L as V}from"./loader-circle-DTsjFZ6p.js";import{S as es}from"./shield-alert-DFYdQl7U.js";import{C as ss}from"./circle-check-CO6G-kzo.js";function _e(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var $,E,H,D,C,U,W,Y,X,Z,N,le,ce,Re,de,ue,me,ke,is=(ke=class extends Oe{constructor(t,i,n){super();R(this,N);R(this,$);R(this,E);R(this,H);R(this,D);R(this,C);R(this,U);R(this,W);R(this,Y);R(this,X);R(this,Z,[]);k(this,$,t),k(this,D,n),k(this,H,[]),k(this,C,[]),k(this,E,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&g(this,C).forEach(t=>{t.subscribe(i=>{O(this,N,ue).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,g(this,C).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,H,t),k(this,D,i),ae.batch(()=>{const n=g(this,C),r=O(this,N,de).call(this,g(this,H));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const l=r.map(a=>a.observer),o=l.map(a=>a.getCurrentResult()),d=n.length!==l.length,m=l.some((a,h)=>a!==n[h]),f=d||m,_=f?!0:o.some((a,h)=>{const c=g(this,E)[h];return!c||!Me(a,c)});!f&&!_||(f&&(k(this,Z,r),k(this,C,l)),k(this,E,o),this.hasListeners()&&(f&&(_e(n,l).forEach(a=>{a.destroy()}),_e(l,n).forEach(a=>{a.subscribe(h=>{O(this,N,ue).call(this,a,h)})})),O(this,N,me).call(this)))})}getCurrentResult(){return g(this,E)}getQueries(){return g(this,C).map(t=>t.getCurrentQuery())}getObservers(){return g(this,C)}getOptimisticResult(t,i){const n=O(this,N,de).call(this,t),r=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>O(this,N,ce).call(this,o??r,i,l),()=>O(this,N,le).call(this,r,n)]}},$=new WeakMap,E=new WeakMap,H=new WeakMap,D=new WeakMap,C=new WeakMap,U=new WeakMap,W=new WeakMap,Y=new WeakMap,X=new WeakMap,Z=new WeakMap,N=new WeakSet,le=function(t,i){return i.map((n,r)=>{const l=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},ce=function(t,i,n){if(i){const r=g(this,X),l=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((o,d)=>o!==r[d]));return(!g(this,U)||g(this,E)!==g(this,Y)||l||i!==g(this,W))&&(k(this,W,i),k(this,Y,g(this,E)),n!==void 0&&k(this,X,n),k(this,U,Te(g(this,U),i(t)))),g(this,U)}return t},Re=function(){var t;return((t=g(this,D))==null?void 0:t.combine)!==void 0&&g(this,C).some((i,n)=>{var r;return i.options.suspense&&((r=g(this,E)[n])==null?void 0:r.data)===void 0})},de=function(t){const i=new Map;g(this,C).forEach(r=>{const l=r.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(r):i.set(l,[r])});const n=[];return t.forEach(r=>{var m;const l=g(this,$).defaultQueryOptions(r),d=((m=i.get(l.queryHash))==null?void 0:m.shift())??new Ce(g(this,$),l);n.push({defaultedQueryOptions:l,observer:d})}),n},ue=function(t,i){const n=g(this,C).indexOf(t);n!==-1&&(k(this,E,ts(g(this,E),n,i)),O(this,N,me).call(this))},me=function(){var t;if(this.hasListeners()){const i=O(this,N,le).call(this,g(this,E),g(this,Z)),n=O(this,N,Re).call(this),r=g(this,U),l=n?r:O(this,N,ce).call(this,i,(t=g(this,D))==null?void 0:t.combine);(n||r!==l)&&ae.batch(()=>{this.listeners.forEach(o=>{o(g(this,E))})})}},ke);function te({queries:s,...t},i){const n=we(),r=Be(),l=Pe(),o=P.useMemo(()=>s.map(u=>{const v=n.defaultQueryOptions(u);return v._optimisticResults=r?"isRestoring":"optimistic",v}),[s,n,r]);o.forEach(u=>{Je(u);const v=n.getQueryCache().get(u.queryHash);Ke(u,l,v)}),Ge(l);const[d]=P.useState(()=>new is(n,o,t)),[m,f,_]=d.getOptimisticResult(o,t.combine),a=!r&&t.subscribed!==!1;P.useSyncExternalStore(P.useCallback(u=>a?d.subscribe(ae.batchCalls(u)):Ie,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),P.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=m.some((u,v)=>xe(o[v],u))?m.flatMap((u,v)=>{const S=o[v];if(S&&xe(S,u)){const M=new Ce(n,S);return Ve(S,M,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const p=m.find((u,v)=>{const S=o[v];return S&&We({result:u,errorResetBoundary:l,throwOnError:S.throwOnError,query:n.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(p!=null&&p.error)throw p.error;return f(_())}/** +var be=s=>{throw TypeError(s)};var ne=(s,t,i)=>t.has(s)||be("Cannot "+i);var g=(s,t,i)=>(ne(s,t,"read from private field"),i?i.call(s):t.get(s)),R=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(ne(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),O=(s,t,i)=>(ne(s,t,"access private method"),i);import{au as Oe,aH as ae,ax as Me,aN as Te,m as we,r as P,az as Ie,g as Ae,j as e,V as Se,x as L,F as w,a as Fe,h as Ee,aO as Ue,aP as Le,aQ as Qe}from"./index-DGz7IJy3.js";import{i as De,r as qe,e as ze,b as $e}from"./evaluationQueryInvalidation-CC5JhGiX.js";import{p as He}from"./paperQueryKeys-BP2E-0yf.js";import{Q as Ce,b as Be,c as Pe,e as Je,d as Ke,f as Ge,s as xe,g as Ve,h as We,u as oe}from"./useQuery-SnJNmisF.js";import{u as je}from"./useMutation-B1oRtfbH.js";import{c as Q}from"./catalog-CI50zqwR.js";import{s as q}from"./safeExternalHref-CkBrsh84.js";import{p as Ye}from"./papers-CgK5TA59.js";import{s as G}from"./submissions-0YkeXTxt.js";import{R as Xe,C as Ze}from"./refresh-cw-By5_OblM.js";import{L as V}from"./loader-circle-DZdOKwBN.js";import{S as es}from"./shield-alert-BJn-Krlm.js";import{C as ss}from"./circle-check-vSqohmZs.js";function _e(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var $,E,H,D,C,U,W,Y,X,Z,N,le,ce,Re,de,ue,me,ke,is=(ke=class extends Oe{constructor(t,i,n){super();R(this,N);R(this,$);R(this,E);R(this,H);R(this,D);R(this,C);R(this,U);R(this,W);R(this,Y);R(this,X);R(this,Z,[]);k(this,$,t),k(this,D,n),k(this,H,[]),k(this,C,[]),k(this,E,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&g(this,C).forEach(t=>{t.subscribe(i=>{O(this,N,ue).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,g(this,C).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,H,t),k(this,D,i),ae.batch(()=>{const n=g(this,C),r=O(this,N,de).call(this,g(this,H));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const l=r.map(a=>a.observer),o=l.map(a=>a.getCurrentResult()),d=n.length!==l.length,m=l.some((a,h)=>a!==n[h]),f=d||m,_=f?!0:o.some((a,h)=>{const c=g(this,E)[h];return!c||!Me(a,c)});!f&&!_||(f&&(k(this,Z,r),k(this,C,l)),k(this,E,o),this.hasListeners()&&(f&&(_e(n,l).forEach(a=>{a.destroy()}),_e(l,n).forEach(a=>{a.subscribe(h=>{O(this,N,ue).call(this,a,h)})})),O(this,N,me).call(this)))})}getCurrentResult(){return g(this,E)}getQueries(){return g(this,C).map(t=>t.getCurrentQuery())}getObservers(){return g(this,C)}getOptimisticResult(t,i){const n=O(this,N,de).call(this,t),r=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>O(this,N,ce).call(this,o??r,i,l),()=>O(this,N,le).call(this,r,n)]}},$=new WeakMap,E=new WeakMap,H=new WeakMap,D=new WeakMap,C=new WeakMap,U=new WeakMap,W=new WeakMap,Y=new WeakMap,X=new WeakMap,Z=new WeakMap,N=new WeakSet,le=function(t,i){return i.map((n,r)=>{const l=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},ce=function(t,i,n){if(i){const r=g(this,X),l=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((o,d)=>o!==r[d]));return(!g(this,U)||g(this,E)!==g(this,Y)||l||i!==g(this,W))&&(k(this,W,i),k(this,Y,g(this,E)),n!==void 0&&k(this,X,n),k(this,U,Te(g(this,U),i(t)))),g(this,U)}return t},Re=function(){var t;return((t=g(this,D))==null?void 0:t.combine)!==void 0&&g(this,C).some((i,n)=>{var r;return i.options.suspense&&((r=g(this,E)[n])==null?void 0:r.data)===void 0})},de=function(t){const i=new Map;g(this,C).forEach(r=>{const l=r.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(r):i.set(l,[r])});const n=[];return t.forEach(r=>{var m;const l=g(this,$).defaultQueryOptions(r),d=((m=i.get(l.queryHash))==null?void 0:m.shift())??new Ce(g(this,$),l);n.push({defaultedQueryOptions:l,observer:d})}),n},ue=function(t,i){const n=g(this,C).indexOf(t);n!==-1&&(k(this,E,ts(g(this,E),n,i)),O(this,N,me).call(this))},me=function(){var t;if(this.hasListeners()){const i=O(this,N,le).call(this,g(this,E),g(this,Z)),n=O(this,N,Re).call(this),r=g(this,U),l=n?r:O(this,N,ce).call(this,i,(t=g(this,D))==null?void 0:t.combine);(n||r!==l)&&ae.batch(()=>{this.listeners.forEach(o=>{o(g(this,E))})})}},ke);function te({queries:s,...t},i){const n=we(),r=Be(),l=Pe(),o=P.useMemo(()=>s.map(u=>{const v=n.defaultQueryOptions(u);return v._optimisticResults=r?"isRestoring":"optimistic",v}),[s,n,r]);o.forEach(u=>{Je(u);const v=n.getQueryCache().get(u.queryHash);Ke(u,l,v)}),Ge(l);const[d]=P.useState(()=>new is(n,o,t)),[m,f,_]=d.getOptimisticResult(o,t.combine),a=!r&&t.subscribed!==!1;P.useSyncExternalStore(P.useCallback(u=>a?d.subscribe(ae.batchCalls(u)):Ie,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),P.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=m.some((u,v)=>xe(o[v],u))?m.flatMap((u,v)=>{const S=o[v];if(S&&xe(S,u)){const M=new Ce(n,S);return Ve(S,M,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const p=m.find((u,v)=>{const S=o[v];return S&&We({result:u,errorResetBoundary:l,throwOnError:S.throwOnError,query:n.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(p!=null&&p.error)throw p.error;return f(_())}/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmitView-CY9aqVy-.js b/assets/SubmitView-DOOIhPRA.js similarity index 94% rename from assets/SubmitView-CY9aqVy-.js rename to assets/SubmitView-DOOIhPRA.js index b5d13bf0dae376cc5ff9ed85bdb5334579184f2b..a49d17707e0e33240836631eaab058aa1658f6f9 100644 --- a/assets/SubmitView-CY9aqVy-.js +++ b/assets/SubmitView-DOOIhPRA.js @@ -1 +1 @@ -import{b as k,m as C,h as F,a as L,d as z,F as d,j as e,E as X}from"./index-CA09r0fx.js";import{u as q}from"./useMutation-CUMX1r3q.js";import{A as N,a as U}from"./alert-DRS5VQLi.js";import{B as P}from"./button-BkpxXw_S.js";import{I as g}from"./input-CtSl48Mp.js";import{T as $}from"./textarea-FDLjm_7X.js";import{p as O}from"./papers-2SfezChA.js";const S="pwc:paper-submit-draft",B=/^\d{4}\.\d{4,5}(v\d+)?$/i,J=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,V=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function R(n){const i=n.trim();return i?B.test(i)||J.test(i)||V.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function K(n,i){const a=n.trim();if(R(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},c=i.title.trim();c&&(o.title=c);const u=i.abstract.trim();u&&(o.abstract=u);const l=i.authors.split(/[,\n]/).map(m=>m.trim()).filter(Boolean);return l.length>0&&(o.authors=l),i.datePublished&&(o.date_published=i.datePublished),o}function M(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const te=()=>{const n=k(),i=C(),{toast:a}=F(),{user:s,isLoading:o}=L(),[c]=z(),u=c.get("arxiv_id")??"",[l,m]=d.useState(u),[f,j]=d.useState(""),[x,w]=d.useState(""),[b,I]=d.useState(""),[y,_]=d.useState(""),[A,v]=d.useState(null);d.useEffect(()=>{if(u)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const r=JSON.parse(t);m(r.input??""),j(r.title??""),w(r.abstract??""),I(r.authors??""),_(r.datePublished??"")}catch{}}},[u]);const h=R(l),T=h==="external",p=q({mutationFn:t=>O.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),p.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{v(M(t))}}),D=t=>{if(t.preventDefault(),v(null),h==="empty"){v("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(S,JSON.stringify({input:l,title:f,abstract:x,authors:b,datePublished:y}));const E=X("/api/v1/auth/hf/login");window.location.assign(`${E}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=K(l,{title:f,abstract:x,authors:b,datePublished:y});p.mutate(r)};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:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:D,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(g,{id:"submit-input",value:l,onChange:t=>m(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:h==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":h==="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."})]}),T&&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(g,{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($,{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(g,{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(g,{id:"submit-date",type:"date",value:y,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(N,{variant:"destructive",children:e.jsx(U,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:p.isPending||o,children:o?"Checking sign-in…":p.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:p.isPending,children:"Cancel"})]})]})]})};export{te as default}; +import{b as k,m as C,h as F,a as L,d as z,F as d,j as e,E as X}from"./index-DGz7IJy3.js";import{u as q}from"./useMutation-B1oRtfbH.js";import{A as N,a as U}from"./alert-CfvggGdB.js";import{B as P}from"./button-DEdvni-v.js";import{I as g}from"./input-DVdOE4Xl.js";import{T as $}from"./textarea-BC6nB3vb.js";import{p as O}from"./papers-CgK5TA59.js";const S="pwc:paper-submit-draft",B=/^\d{4}\.\d{4,5}(v\d+)?$/i,J=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,V=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function R(n){const i=n.trim();return i?B.test(i)||J.test(i)||V.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function K(n,i){const a=n.trim();if(R(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},c=i.title.trim();c&&(o.title=c);const u=i.abstract.trim();u&&(o.abstract=u);const l=i.authors.split(/[,\n]/).map(m=>m.trim()).filter(Boolean);return l.length>0&&(o.authors=l),i.datePublished&&(o.date_published=i.datePublished),o}function M(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const te=()=>{const n=k(),i=C(),{toast:a}=F(),{user:s,isLoading:o}=L(),[c]=z(),u=c.get("arxiv_id")??"",[l,m]=d.useState(u),[f,j]=d.useState(""),[x,w]=d.useState(""),[b,I]=d.useState(""),[y,_]=d.useState(""),[A,v]=d.useState(null);d.useEffect(()=>{if(u)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const r=JSON.parse(t);m(r.input??""),j(r.title??""),w(r.abstract??""),I(r.authors??""),_(r.datePublished??"")}catch{}}},[u]);const h=R(l),T=h==="external",p=q({mutationFn:t=>O.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),p.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{v(M(t))}}),D=t=>{if(t.preventDefault(),v(null),h==="empty"){v("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(S,JSON.stringify({input:l,title:f,abstract:x,authors:b,datePublished:y}));const E=X("/api/v1/auth/hf/login");window.location.assign(`${E}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=K(l,{title:f,abstract:x,authors:b,datePublished:y});p.mutate(r)};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:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:D,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(g,{id:"submit-input",value:l,onChange:t=>m(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:h==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":h==="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."})]}),T&&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(g,{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($,{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(g,{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(g,{id:"submit-date",type:"date",value:y,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(N,{variant:"destructive",children:e.jsx(U,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:p.isPending||o,children:o?"Checking sign-in…":p.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:p.isPending,children:"Cancel"})]})]})]})};export{te as default}; diff --git a/assets/TagBrowseView-RxEnzLQJ.js b/assets/TagBrowseView-Bdloff_M.js similarity index 93% rename from assets/TagBrowseView-RxEnzLQJ.js rename to assets/TagBrowseView-Bdloff_M.js index 99bb0f06d7ccadb1b7651e9a550284999c9e64e4..f22a4d0df96b6cace2bc092a897bf03784d98d2b 100644 --- a/assets/TagBrowseView-RxEnzLQJ.js +++ b/assets/TagBrowseView-Bdloff_M.js @@ -1 +1 @@ -import{j as e,L as g,F as xe,u as be,b as je,d as ke,r as _,k as _e,V as fe}from"./index-CA09r0fx.js";import{R as Ne}from"./ResearchFollowButton-BAC_HrTd.js";import{u as W}from"./useQuery-GCOPnmOE.js";import{P as we,M as ve}from"./components-CHZvyPkS.js";import{A as I}from"./arrow-right-DVe4s0sr.js";import{B as ye}from"./BenchmarkTrendSparkline-g8mg75No.js";import{P as Se}from"./PaperFeedFilters-Ci7HUJiL.js";import{a as Pe,P as Ee,b as Ce}from"./PaperDateFilter-DhUC4jzf.js";import{M as J}from"./MarkdownText-B-6pg9rW.js";import{c as X}from"./catalog-C6oGGh8I.js";import{s as Te}from"./slug-BpH-Nkvz.js";import{d as N,t as Be}from"./colors-C6t5MKud.js";import{c as $e}from"./usePapers-Bb48_cnL.js";import{u as Fe}from"./useIntersectionObserver-jfqowp0n.js";import{S as E}from"./skeleton-CiNN3v7Q.js";import{A as Re,a as Ae}from"./alert-DRS5VQLi.js";import{T as Me}from"./trophy-C7Evgy5l.js";import{G as Ie}from"./github-D8NiZH3t.js";import"./useMutation-CUMX1r3q.js";import"./research-CAknkOM8.js";import"./plus-BGozleiT.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-U9FJMhfb.js";import"./papers-2SfezChA.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-D6rzCRBR.js";/* empty css */import"./PaperPreviewLink-DUf7c7wv.js";import"./index-BeqN5AbC.js";import"./index-qKrWNpd1.js";import"./katex-DkKDou_j.js";import"./hover-card-0saQl8Kd.js";import"./useInfiniteQuery-TrlVUjws.js";const Le=()=>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(I,{size:14,"aria-hidden":"true"})]})]}),Y=r=>{const c=r.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(l=>l.trim()).filter(Boolean):[]};function De(r,c){const l=Y(r);if(c===void 0)return"standard";const i=new Set(Y(c).map(o=>o.toLowerCase())),m=l.filter(o=>!i.has(o.toLowerCase()));return m.length?m.join(", "):r}function He(r,c){const l=new Map(r.map(o=>[o.id,o])),i=o=>{const b=new Set([o.id]);let j=o;for(;;){const w=c(j),f=w?l.get(w):void 0;if(!f)return j.id;if(b.has(f.id))return o.id;b.add(f.id),j=f}},m=new Map;return r.forEach(o=>{const b=i(o);m.set(b,[...m.get(b)||[],o])}),[...m].map(([o,b])=>({key:o,members:[l.get(o),...b.filter(j=>j.id!==o)]}))}const qe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Oe=r=>r==="trending"||r==="date_published"||r==="citation_count"?r:"trending",M=3,Ue=[{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"}],Ve=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),ze=({frameworks:r})=>r.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),r.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:["★ ",Ve(c.num_stars)]})]},c.framework_id))]}),Ge=({task:r,area:c,parents:l})=>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-${Te(c.name)}`,children:c.name})]}),[...l].reverse().map(i=>e.jsxs(xe.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(r.name,r.slug)})]}),Qe=({task:r,relatedTasks:c})=>{const l=new Map([r,...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:Ue.map(i=>{const m=l.get(i.slug),o=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(I,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:o},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:o},i.slug)})})]})},Ke=r=>[...r].sort((c,l)=>{const i=c.slug==="classic-language-modeling",m=l.slug==="classic-language-modeling";return i!==m?i?1:-1:0}),Es=()=>{var G,Q,K;const{taskSlug:r}=be(),c=je(),[l,i]=ke(),m=Oe(l.get("order_by")),o=l.get("has_code")==="true",b=l.get("has_hf_artifacts")==="true",j=Pe(l),w=s=>{const a=new URLSearchParams(l);a.set("order_by",s),i(a)},f=s=>{const a=new URLSearchParams(l);s?a.set("has_code","true"):a.delete("has_code"),i(a)},Z=s=>{const a=new URLSearchParams(l);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),i(a)},[L,ee]=_.useState(!1),[se,ae]=_.useState({}),[re,te]=_.useState(()=>new Set),{preferences:ne}=_e(),C=(s,a)=>{const n=s||"";return a?`/benchmark/${n}?task=${encodeURIComponent(a)}`:`/benchmark/${n}`},v=ne.hide_closed_source_evals?!0:void 0,h=W({queryKey:["task-page",r,v],queryFn:()=>X.taskPage(r,{is_open:v}),enabled:!!r,staleTime:10*60*1e3});_.useEffect(()=>{var n;const s=(n=h.data)==null?void 0:n.task.slug;if(!r||!s||s===r)return;const a=l.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(G=h.data)==null?void 0:G.task.slug,l,r]);const D=W({queryKey:["task-benchmark-trends",r,v],queryFn:()=>X.trendingBenchmarks(r,{limit:100,min_recent_papers:0,is_open:v}),enabled:!!r,staleTime:10*60*1e3}),y=_.useMemo(()=>{var s;return Ke(((s=h.data)==null?void 0:s.children)||[])},[h.data]),T=_.useMemo(()=>{var a;const s=new Map;return(((a=h.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(n=>{s.set(n.subtask_id,n.benchmarks||[])}),s},[h.data]),x=$e({taskId:r||"",page_size:20,order_by:m,order_dir:"desc",include_resources:!0,has_code:o,has_hf_artifacts:b,start_date:j.startDate,end_date:j.endDate,enabled:!!r}),H=_.useMemo(()=>{var a;return(((a=x.data)==null?void 0:a.pages.flatMap(n=>n.results))||[]).map(Be)},[x.data]),B=_.useMemo(()=>{var a;const s={};return(a=x.data)==null||a.pages.forEach(n=>n.results.forEach(k=>(k.methods||[]).forEach(u=>{const t=u.slug||u.id;s[t]||(s[t]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[t].count++}))),Object.values(s).sort((n,k)=>k.count-n.count).slice(0,8)},[x.data]),{targetRef:ie,isIntersecting:q}=Fe({rootMargin:"200px"});if(_.useEffect(()=>{q&&x.hasNextPage&&!x.isFetchingNextPage&&x.fetchNextPage()},[q,x.hasNextPage,x.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(E,{className:"h-12 w-1/2 mb-4"}),e.jsx(E,{className:"h-6 w-1/3 mb-8"}),e.jsx(E,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(Re,{variant:"destructive",children:e.jsx(Ae,{children:"Task not found."})})});const d=h.data.task,ce=h.data.parents||[],$=N(d.name,d.slug),F=(h.data.sisters||[]).filter(s=>s.id!==d.id),le=h.data.recommended_frameworks||[],S=h.data.benchmarks||[],O=new Map(S.map(s=>[s.id,s])),oe=new Set(S.map(s=>s.id)),U=(((Q=D.data)==null?void 0:Q.results)||[]).filter(s=>oe.has(s.id)).map(s=>{const a=O.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}}),R=U.length?U: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:[]})),P=He(R,s=>{var a;return(a=O.get(s.id))==null?void 0:a.parent_dataset_id}),de=L?P:P.slice(0,5),me=P.slice(5).reduce((s,a)=>s+a.members.length,0),V=((K=D.data)==null?void 0:K.recent_days)||90,he=y.some(s=>(T.get(s.id)||[]).length>0),pe=y.length>0,z=R.length>0,ue=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),T.forEach(a=>a.forEach(n=>s.add(n.id))),s.size})(),ge=s=>{te(a=>{const n=new Set(a);return n.has(s)?n.delete(s):n.add(s),n})};return e.jsxs("div",{className:"page",children:[e.jsx(Ge,{task:d,area:h.data.area,parents:ce}),e.jsxs("div",{className:d.image_url?`task-hero-grid${d.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:$}),e.jsx(Ne,{kind:"task",entityId:d.id}),d.description&&e.jsx(J,{className:"task-explainer",text:d.description}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(d.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:ue}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[B.length,"+"]}),"METHODS USED"]})]}),e.jsx(ze,{frameworks:le})]}),d.image_url&&e.jsxs("figure",{className:`task-figure-card${d.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:fe(d.image_url)??void 0,alt:`${$} schematic`,onError:s=>{var a,n;(n=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||n.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",$,d.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(J,{className:"task-image-credit",text:d.image_credit})]})]})]})]}),d.slug==="healthcare"&&e.jsx(Qe,{task:d,relatedTasks:F}),d.slug==="robotics"&&e.jsx(Le,{}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[V,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",R.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"})]}),de.map(({key:s,members:a})=>{const n=a[0],k=p=>p===n?"standard":De(p.name,n.name),u=[n,...a.slice(1).sort((p,A)=>k(p).localeCompare(k(A),void 0,{sensitivity:"base"}))],t=u.find(p=>p.id===se[s])??n;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ye,{history:t.history,benchmarkName:t.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:t.recent_paper_count})," ",t.recent_paper_count===1?"paper":"papers"," /"," ",V,"d"]}),t.rate_change==null?t.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${t.rate_change>=1?"is-up":"is-down"}`,children:[t.rate_change>=1?"↑":"↓"," ",t.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:C(t.slug||t.id,r),children:t.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${n.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===t.id,title:p.name,onClick:()=>ae(A=>({...A,[s]:p.id})),children:k(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:t.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:t.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(Me,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:t.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:t.best_paper_route&&t.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(t.best_paper_route)}`,children:t.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:t.best_code_url?e.jsx("a",{href:t.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${t.best_paper_title||t.best_model_name}`,children:e.jsx(Ie,{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:C(t.slug||t.id,r),"aria-label":`Compare ${t.best_model_name||"the best model"} with all results on ${t.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(I,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),P.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ee(s=>!s),children:L?"− show top 5":`+ show ${me} more benchmarks`})]}),pe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:z?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:he?"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=T.get(s.id)||[],n=re.has(s.id),k=n?a:a.slice(0,M),u=a.length-M;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]`})]}),k.length>0?k.map((t,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(C(t.slug||t.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:t.name}),e.jsx("div",{className:"bench-row-sub",children:t.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:t.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},t.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:()=>ge(s.id),children:n?`− show top ${M}`:`+ 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:["[",(d.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:qe.map(([s,a])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>w(s),children:a},s))}),e.jsx(Se,{hasCode:o,hasHfArtifacts:b,onHasCodeChange:f,onHasHfArtifactsChange:Z})]}),e.jsx(Ee,{startDate:j.startDate,endDate:j.endDate,onChange:s=>i(Ce(l,s))})]}),x.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,a)=>e.jsx(E,{className:"h-40 w-full"},a))}):H.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:H.map((s,a)=>e.jsx(we,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:ie,style:{height:1}}),x.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[F.length>0&&d.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"}),F.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(ve,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Qe as HealthcareMedicalAiHub,ze as RecommendedFrameworkLinks,Ge as TaskBreadcrumb,Es as default}; +import{j as e,L as g,F as xe,u as be,b as je,d as ke,r as _,k as _e,V as fe}from"./index-DGz7IJy3.js";import{R as Ne}from"./ResearchFollowButton-_BF37169.js";import{u as W}from"./useQuery-SnJNmisF.js";import{P as we,M as ve}from"./components-C75Gxt6c.js";import{A as I}from"./arrow-right-B6-s6W60.js";import{B as ye}from"./BenchmarkTrendSparkline-CT9c4wG-.js";import{P as Se}from"./PaperFeedFilters-BIXkRwGe.js";import{a as Pe,P as Ee,b as Ce}from"./PaperDateFilter-C6KBd0r-.js";import{M as J}from"./MarkdownText-CswmrT4z.js";import{c as X}from"./catalog-CI50zqwR.js";import{s as Te}from"./slug-BpH-Nkvz.js";import{d as N,t as Be}from"./colors-YtiKVy3X.js";import{c as $e}from"./usePapers-knk68Pd9.js";import{u as Fe}from"./useIntersectionObserver-B7kBuOiP.js";import{S as E}from"./skeleton-Qth9DQSW.js";import{A as Re,a as Ae}from"./alert-CfvggGdB.js";import{T as Me}from"./trophy-B1w2ILFe.js";import{G as Ie}from"./github-DcSqeKOx.js";import"./useMutation-B1oRtfbH.js";import"./research-C0oNhyj8.js";import"./plus-v7R1dHou.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-DtD88QQA.js";import"./papers-CgK5TA59.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-VInL7Z23.js";/* empty css */import"./PaperPreviewLink-DUJYnY2B.js";import"./index-DyDOGuaE.js";import"./index-CEcXuWDB.js";import"./katex-DkKDou_j.js";import"./hover-card-32Q2qmuv.js";import"./useInfiniteQuery-Bix5WR2s.js";const Le=()=>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(I,{size:14,"aria-hidden":"true"})]})]}),Y=r=>{const c=r.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(l=>l.trim()).filter(Boolean):[]};function De(r,c){const l=Y(r);if(c===void 0)return"standard";const i=new Set(Y(c).map(o=>o.toLowerCase())),m=l.filter(o=>!i.has(o.toLowerCase()));return m.length?m.join(", "):r}function He(r,c){const l=new Map(r.map(o=>[o.id,o])),i=o=>{const b=new Set([o.id]);let j=o;for(;;){const w=c(j),f=w?l.get(w):void 0;if(!f)return j.id;if(b.has(f.id))return o.id;b.add(f.id),j=f}},m=new Map;return r.forEach(o=>{const b=i(o);m.set(b,[...m.get(b)||[],o])}),[...m].map(([o,b])=>({key:o,members:[l.get(o),...b.filter(j=>j.id!==o)]}))}const qe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Oe=r=>r==="trending"||r==="date_published"||r==="citation_count"?r:"trending",M=3,Ue=[{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"}],Ve=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),ze=({frameworks:r})=>r.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),r.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:["★ ",Ve(c.num_stars)]})]},c.framework_id))]}),Ge=({task:r,area:c,parents:l})=>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-${Te(c.name)}`,children:c.name})]}),[...l].reverse().map(i=>e.jsxs(xe.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(r.name,r.slug)})]}),Qe=({task:r,relatedTasks:c})=>{const l=new Map([r,...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:Ue.map(i=>{const m=l.get(i.slug),o=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(I,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:o},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:o},i.slug)})})]})},Ke=r=>[...r].sort((c,l)=>{const i=c.slug==="classic-language-modeling",m=l.slug==="classic-language-modeling";return i!==m?i?1:-1:0}),Es=()=>{var G,Q,K;const{taskSlug:r}=be(),c=je(),[l,i]=ke(),m=Oe(l.get("order_by")),o=l.get("has_code")==="true",b=l.get("has_hf_artifacts")==="true",j=Pe(l),w=s=>{const a=new URLSearchParams(l);a.set("order_by",s),i(a)},f=s=>{const a=new URLSearchParams(l);s?a.set("has_code","true"):a.delete("has_code"),i(a)},Z=s=>{const a=new URLSearchParams(l);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),i(a)},[L,ee]=_.useState(!1),[se,ae]=_.useState({}),[re,te]=_.useState(()=>new Set),{preferences:ne}=_e(),C=(s,a)=>{const n=s||"";return a?`/benchmark/${n}?task=${encodeURIComponent(a)}`:`/benchmark/${n}`},v=ne.hide_closed_source_evals?!0:void 0,h=W({queryKey:["task-page",r,v],queryFn:()=>X.taskPage(r,{is_open:v}),enabled:!!r,staleTime:10*60*1e3});_.useEffect(()=>{var n;const s=(n=h.data)==null?void 0:n.task.slug;if(!r||!s||s===r)return;const a=l.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(G=h.data)==null?void 0:G.task.slug,l,r]);const D=W({queryKey:["task-benchmark-trends",r,v],queryFn:()=>X.trendingBenchmarks(r,{limit:100,min_recent_papers:0,is_open:v}),enabled:!!r,staleTime:10*60*1e3}),y=_.useMemo(()=>{var s;return Ke(((s=h.data)==null?void 0:s.children)||[])},[h.data]),T=_.useMemo(()=>{var a;const s=new Map;return(((a=h.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(n=>{s.set(n.subtask_id,n.benchmarks||[])}),s},[h.data]),x=$e({taskId:r||"",page_size:20,order_by:m,order_dir:"desc",include_resources:!0,has_code:o,has_hf_artifacts:b,start_date:j.startDate,end_date:j.endDate,enabled:!!r}),H=_.useMemo(()=>{var a;return(((a=x.data)==null?void 0:a.pages.flatMap(n=>n.results))||[]).map(Be)},[x.data]),B=_.useMemo(()=>{var a;const s={};return(a=x.data)==null||a.pages.forEach(n=>n.results.forEach(k=>(k.methods||[]).forEach(u=>{const t=u.slug||u.id;s[t]||(s[t]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[t].count++}))),Object.values(s).sort((n,k)=>k.count-n.count).slice(0,8)},[x.data]),{targetRef:ie,isIntersecting:q}=Fe({rootMargin:"200px"});if(_.useEffect(()=>{q&&x.hasNextPage&&!x.isFetchingNextPage&&x.fetchNextPage()},[q,x.hasNextPage,x.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(E,{className:"h-12 w-1/2 mb-4"}),e.jsx(E,{className:"h-6 w-1/3 mb-8"}),e.jsx(E,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(Re,{variant:"destructive",children:e.jsx(Ae,{children:"Task not found."})})});const d=h.data.task,ce=h.data.parents||[],$=N(d.name,d.slug),F=(h.data.sisters||[]).filter(s=>s.id!==d.id),le=h.data.recommended_frameworks||[],S=h.data.benchmarks||[],O=new Map(S.map(s=>[s.id,s])),oe=new Set(S.map(s=>s.id)),U=(((Q=D.data)==null?void 0:Q.results)||[]).filter(s=>oe.has(s.id)).map(s=>{const a=O.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}}),R=U.length?U: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:[]})),P=He(R,s=>{var a;return(a=O.get(s.id))==null?void 0:a.parent_dataset_id}),de=L?P:P.slice(0,5),me=P.slice(5).reduce((s,a)=>s+a.members.length,0),V=((K=D.data)==null?void 0:K.recent_days)||90,he=y.some(s=>(T.get(s.id)||[]).length>0),pe=y.length>0,z=R.length>0,ue=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),T.forEach(a=>a.forEach(n=>s.add(n.id))),s.size})(),ge=s=>{te(a=>{const n=new Set(a);return n.has(s)?n.delete(s):n.add(s),n})};return e.jsxs("div",{className:"page",children:[e.jsx(Ge,{task:d,area:h.data.area,parents:ce}),e.jsxs("div",{className:d.image_url?`task-hero-grid${d.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:$}),e.jsx(Ne,{kind:"task",entityId:d.id}),d.description&&e.jsx(J,{className:"task-explainer",text:d.description}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(d.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:ue}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[B.length,"+"]}),"METHODS USED"]})]}),e.jsx(ze,{frameworks:le})]}),d.image_url&&e.jsxs("figure",{className:`task-figure-card${d.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:fe(d.image_url)??void 0,alt:`${$} schematic`,onError:s=>{var a,n;(n=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||n.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",$,d.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(J,{className:"task-image-credit",text:d.image_credit})]})]})]})]}),d.slug==="healthcare"&&e.jsx(Qe,{task:d,relatedTasks:F}),d.slug==="robotics"&&e.jsx(Le,{}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[V,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",R.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"})]}),de.map(({key:s,members:a})=>{const n=a[0],k=p=>p===n?"standard":De(p.name,n.name),u=[n,...a.slice(1).sort((p,A)=>k(p).localeCompare(k(A),void 0,{sensitivity:"base"}))],t=u.find(p=>p.id===se[s])??n;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ye,{history:t.history,benchmarkName:t.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:t.recent_paper_count})," ",t.recent_paper_count===1?"paper":"papers"," /"," ",V,"d"]}),t.rate_change==null?t.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${t.rate_change>=1?"is-up":"is-down"}`,children:[t.rate_change>=1?"↑":"↓"," ",t.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:C(t.slug||t.id,r),children:t.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${n.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===t.id,title:p.name,onClick:()=>ae(A=>({...A,[s]:p.id})),children:k(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:t.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:t.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(Me,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:t.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:t.best_paper_route&&t.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(t.best_paper_route)}`,children:t.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:t.best_code_url?e.jsx("a",{href:t.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${t.best_paper_title||t.best_model_name}`,children:e.jsx(Ie,{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:C(t.slug||t.id,r),"aria-label":`Compare ${t.best_model_name||"the best model"} with all results on ${t.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(I,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),P.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ee(s=>!s),children:L?"− show top 5":`+ show ${me} more benchmarks`})]}),pe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:z?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:he?"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=T.get(s.id)||[],n=re.has(s.id),k=n?a:a.slice(0,M),u=a.length-M;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]`})]}),k.length>0?k.map((t,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(C(t.slug||t.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:t.name}),e.jsx("div",{className:"bench-row-sub",children:t.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:t.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},t.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:()=>ge(s.id),children:n?`− show top ${M}`:`+ 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:["[",(d.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:qe.map(([s,a])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>w(s),children:a},s))}),e.jsx(Se,{hasCode:o,hasHfArtifacts:b,onHasCodeChange:f,onHasHfArtifactsChange:Z})]}),e.jsx(Ee,{startDate:j.startDate,endDate:j.endDate,onChange:s=>i(Ce(l,s))})]}),x.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,a)=>e.jsx(E,{className:"h-40 w-full"},a))}):H.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:H.map((s,a)=>e.jsx(we,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:ie,style:{height:1}}),x.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[F.length>0&&d.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"}),F.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(ve,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Qe as HealthcareMedicalAiHub,ze as RecommendedFrameworkLinks,Ge as TaskBreadcrumb,Es as default}; diff --git a/assets/TagsIndexView-CYhpgaLv.js b/assets/TagsIndexView-CHHNusue.js similarity index 97% rename from assets/TagsIndexView-CYhpgaLv.js rename to assets/TagsIndexView-CHHNusue.js index 92994fb9cd4df41ecc12e28ee8dd092873bd15e5..18fe5a6ba99140b82880441865875620ffa63ad7 100644 --- a/assets/TagsIndexView-CYhpgaLv.js +++ b/assets/TagsIndexView-CHHNusue.js @@ -1,4 +1,4 @@ -import{g as e,r as p,j as a,L as j}from"./index-CA09r0fx.js";import{u as k}from"./useQuery-GCOPnmOE.js";import{c as l}from"./catalog-C6oGGh8I.js";import{c as v,h as u,d as f}from"./colors-C6t5MKud.js";import{s as L}from"./slug-BpH-Nkvz.js";import{a as S}from"./searchable-select-CNl4nXvO.js";import{I as C,T as A}from"./triangle-alert-CFbLex2p.js";import{S as V}from"./share-2-B8SQJ4QE.js";import{T as H}from"./trending-up-DpdmhQm9.js";import{M as T}from"./moon-Cn0WCdQ9.js";import{T as F}from"./thumbs-up-BxkpoAw0.js";import{D as Z}from"./database-CzCP8SRb.js";import{E as B}from"./earth-gRrLiaVn.js";import{T as P}from"./trophy-C7Evgy5l.js";import{F as N}from"./file-text-7GwUpKU3.js";import{A as _}from"./activity-CKk220MX.js";import{G as E}from"./globe-CfxFS7Am.js";import{S as w}from"./skeleton-CiNN3v7Q.js";import{A as I,a as D}from"./alert-DRS5VQLi.js";import{T as G}from"./TaxonomySuggestionTile-Dc-tCzey.js";import{T as W}from"./TaxonomyTrending-WzrBk28T.js";import"./button-BkpxXw_S.js";import"./popover-D6rzCRBR.js";import"./dialog-BMl1SbyK.js";import"./loader-circle-DTsjFZ6p.js";import"./SignInToEditDialog-Ub_UIzh4.js";import"./input-CtSl48Mp.js";import"./textarea-FDLjm_7X.js";import"./useMutation-CUMX1r3q.js";import"./submissions-CERjLe5i.js";import"./plus-BGozleiT.js";/** +import{g as e,r as p,j as a,L as j}from"./index-DGz7IJy3.js";import{u as k}from"./useQuery-SnJNmisF.js";import{c as l}from"./catalog-CI50zqwR.js";import{c as v,h as u,d as f}from"./colors-YtiKVy3X.js";import{s as L}from"./slug-BpH-Nkvz.js";import{a as S}from"./searchable-select-C2BNEPyI.js";import{I as C,T as A}from"./triangle-alert-C4uGz6dq.js";import{S as V}from"./share-2-Byoooou-.js";import{T as H}from"./trending-up-E7e_PcEb.js";import{M as T}from"./moon-BTUByzSL.js";import{T as F}from"./thumbs-up-C5Gnbt6N.js";import{D as Z}from"./database-7GRYiOb3.js";import{E as B}from"./earth-BQV4xejs.js";import{T as P}from"./trophy-B1w2ILFe.js";import{F as N}from"./file-text-BHDe9k9N.js";import{A as _}from"./activity-zaQ-sruD.js";import{G as E}from"./globe-_StJzQkx.js";import{S as w}from"./skeleton-Qth9DQSW.js";import{A as I,a as D}from"./alert-CfvggGdB.js";import{T as G}from"./TaxonomySuggestionTile-BM3W4_sv.js";import{T as W}from"./TaxonomyTrending-DZnt22Vd.js";import"./button-DEdvni-v.js";import"./popover-VInL7Z23.js";import"./dialog-DRb-cMlG.js";import"./loader-circle-DZdOKwBN.js";import"./SignInToEditDialog-POB2dswN.js";import"./input-DVdOE4Xl.js";import"./textarea-BC6nB3vb.js";import"./useMutation-B1oRtfbH.js";import"./submissions-0YkeXTxt.js";import"./plus-v7R1dHou.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TaxonomySuggestionTile-Dc-tCzey.js b/assets/TaxonomySuggestionTile-BM3W4_sv.js similarity index 76% rename from assets/TaxonomySuggestionTile-Dc-tCzey.js rename to assets/TaxonomySuggestionTile-BM3W4_sv.js index 0aea2301b9d92031c616a1afb49527d94955331e..693fedf74cbb6bd1f3f5ce3b9afcbaf0013ad583 100644 --- a/assets/TaxonomySuggestionTile-Dc-tCzey.js +++ b/assets/TaxonomySuggestionTile-BM3W4_sv.js @@ -1 +1 @@ -import{a as u,r as t,j as e}from"./index-CA09r0fx.js";import{S as c,a as m}from"./SignInToEditDialog-Ub_UIzh4.js";import{P as p}from"./plus-BGozleiT.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-DGz7IJy3.js";import{S as c,a as m}from"./SignInToEditDialog-POB2dswN.js";import{P as p}from"./plus-v7R1dHou.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/TaxonomyTrending-WzrBk28T.js b/assets/TaxonomyTrending-DZnt22Vd.js similarity index 90% rename from assets/TaxonomyTrending-WzrBk28T.js rename to assets/TaxonomyTrending-DZnt22Vd.js index 5f61acb1f8e3729ae41a2ebfbf6870beac059e83..4dd3ef5b1a3216e9ea6f44ee5e99145b4bddda61 100644 --- a/assets/TaxonomyTrending-WzrBk28T.js +++ b/assets/TaxonomyTrending-DZnt22Vd.js @@ -1 +1 @@ -import{j as a,L as h}from"./index-CA09r0fx.js";import{S as x}from"./skeleton-CiNN3v7Q.js";import{A as p,a as j}from"./alert-DRS5VQLi.js";import{T as o}from"./trending-up-DpdmhQm9.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:t=180,isLoading:d,error:l,mono:c})=>!d&&!l&&!(e!=null&&e.length)?null:a.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[a.jsxs("div",{className:"taxonomy-trending-header",children:[a.jsxs("h2",{children:[a.jsx(o,{size:22,"aria-hidden":"true"}),"Trending"]}),a.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 ",t," days."]})]}),l?a.jsx(p,{variant:"destructive",children:a.jsxs(j,{children:["Failed to load trending ",n,"s."]})}):d?a.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((s,r)=>a.jsx(x,{className:"h-20"},r))}):a.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((s,r)=>a.jsxs(h,{to:s.href,className:"tag-cell",children:[a.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[a.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),s.icon&&a.jsx("span",{className:"task-icon",style:{color:s.iconColor},children:a.jsx(s.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),s.name]}),a.jsxs("div",{className:"meta taxonomy-trending-meta",children:[s.areaName&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:s.areaName}),a.jsx("span",{children:"·"})]}),a.jsxs("span",{children:[s.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),a.jsx("span",{children:"·"}),a.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${s.shareLift.toFixed(1)}× its baseline share`,children:[a.jsx(o,{size:12,"aria-hidden":"true"}),s.shareLift.toFixed(1),"×"]})]})]},s.id))})]});export{y as T}; +import{j as a,L as h}from"./index-DGz7IJy3.js";import{S as x}from"./skeleton-Qth9DQSW.js";import{A as p,a as j}from"./alert-CfvggGdB.js";import{T as o}from"./trending-up-E7e_PcEb.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:t=180,isLoading:d,error:l,mono:c})=>!d&&!l&&!(e!=null&&e.length)?null:a.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[a.jsxs("div",{className:"taxonomy-trending-header",children:[a.jsxs("h2",{children:[a.jsx(o,{size:22,"aria-hidden":"true"}),"Trending"]}),a.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 ",t," days."]})]}),l?a.jsx(p,{variant:"destructive",children:a.jsxs(j,{children:["Failed to load trending ",n,"s."]})}):d?a.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((s,r)=>a.jsx(x,{className:"h-20"},r))}):a.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((s,r)=>a.jsxs(h,{to:s.href,className:"tag-cell",children:[a.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[a.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),s.icon&&a.jsx("span",{className:"task-icon",style:{color:s.iconColor},children:a.jsx(s.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),s.name]}),a.jsxs("div",{className:"meta taxonomy-trending-meta",children:[s.areaName&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:s.areaName}),a.jsx("span",{children:"·"})]}),a.jsxs("span",{children:[s.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),a.jsx("span",{children:"·"}),a.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${s.shareLift.toFixed(1)}× its baseline share`,children:[a.jsx(o,{size:12,"aria-hidden":"true"}),s.shareLift.toFixed(1),"×"]})]})]},s.id))})]});export{y as T}; diff --git a/assets/TrendsView-YtH_23zk.js b/assets/TrendsView-VYiOkhSO.js similarity index 97% rename from assets/TrendsView-YtH_23zk.js rename to assets/TrendsView-VYiOkhSO.js index 96cb1f03c9c3f79a39a5c5bc031937330f177f85..82571378fa1ea6b1a6cd2ca8d1e20807195a35a4 100644 --- a/assets/TrendsView-YtH_23zk.js +++ b/assets/TrendsView-VYiOkhSO.js @@ -1 +1 @@ -import{a1 as I,F as X,j as e}from"./index-CA09r0fx.js";import{u as G}from"./useQuery-GCOPnmOE.js";import{A as J,a as E}from"./alert-DRS5VQLi.js";import{S as P}from"./skeleton-CiNN3v7Q.js";class Q{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const V=new Q(I),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)}`},Y=()=>V.trends(),f=980,j=400,x=62,B=26,g=30,K=58,u=f-x-B,F=j-g-K,v=g+F,Z=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]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+F*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),A=Z(R),_=`${A} 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:A,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+F/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))})]})]})]})},$={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},re=()=>{const t=G({queryKey:["research-trends"],queryFn:Y,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{re as default}; +import{a1 as I,F as X,j as e}from"./index-DGz7IJy3.js";import{u as G}from"./useQuery-SnJNmisF.js";import{A as J,a as E}from"./alert-CfvggGdB.js";import{S as P}from"./skeleton-Qth9DQSW.js";class Q{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const V=new Q(I),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)}`},Y=()=>V.trends(),f=980,j=400,x=62,B=26,g=30,K=58,u=f-x-B,F=j-g-K,v=g+F,Z=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]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+F*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),A=Z(R),_=`${A} 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:A,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+F/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))})]})]})]})},$={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},re=()=>{const t=G({queryKey:["research-trends"],queryFn:Y,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{re as default}; diff --git a/assets/UserProfileView-CphSsA_F.js b/assets/UserProfileView-DCfF3CNW.js similarity index 87% rename from assets/UserProfileView-CphSsA_F.js rename to assets/UserProfileView-DCfF3CNW.js index 2134097d136cb53c9ad1fc2e4e53aff7b7a74eb2..0bf36f4f75702c78ab4aa43519cbf5737f8c878f 100644 --- a/assets/UserProfileView-CphSsA_F.js +++ b/assets/UserProfileView-DCfF3CNW.js @@ -1 +1 @@ -import{as as i,A as n,u as o,j as e,aR as d}from"./index-CA09r0fx.js";import{u as l}from"./useQuery-GCOPnmOE.js";import{C as c}from"./OrganizationContributionGraph-BeFV3fZe.js";import"./skeleton-CiNN3v7Q.js";import"./catalog-C6oGGh8I.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},f=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{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(c,{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{f as default}; +import{as as i,A as n,u as o,j as e,aR as d}from"./index-DGz7IJy3.js";import{u as l}from"./useQuery-SnJNmisF.js";import{C as c}from"./OrganizationContributionGraph-hzEKhL7-.js";import"./skeleton-Qth9DQSW.js";import"./catalog-CI50zqwR.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},f=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{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(c,{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{f as default}; diff --git a/assets/activity-CKk220MX.js b/assets/activity-zaQ-sruD.js similarity index 89% rename from assets/activity-CKk220MX.js rename to assets/activity-zaQ-sruD.js index bb3db170b5c294826a185017caf25e060868bc8c..69532e1c0130559bf4993e879ff4412334867aa1 100644 --- a/assets/activity-CKk220MX.js +++ b/assets/activity-zaQ-sruD.js @@ -1,4 +1,4 @@ -import{g as t}from"./index-CA09r0fx.js";/** +import{g as t}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/alert-DRS5VQLi.js b/assets/alert-CfvggGdB.js similarity index 92% rename from assets/alert-DRS5VQLi.js rename to assets/alert-CfvggGdB.js index 042ebe7775322e1c68be4caf0d376350637aea91..47476f820a7cbc041af85c0b551df7aab964cedc 100644 --- a/assets/alert-DRS5VQLi.js +++ b/assets/alert-CfvggGdB.js @@ -1 +1 @@ -import{r as a,j as s,x as l,a3 as i}from"./index-CA09r0fx.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,x as l,a3 as i}from"./index-DGz7IJy3.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/arrow-right-DVe4s0sr.js b/assets/arrow-right-B6-s6W60.js similarity index 86% rename from assets/arrow-right-DVe4s0sr.js rename to assets/arrow-right-B6-s6W60.js index 73274a9510759adaca3f054daae1ce40174e5381..d8b289ca4681a44e00d210ed25d1423032c36ca0 100644 --- a/assets/arrow-right-DVe4s0sr.js +++ b/assets/arrow-right-B6-s6W60.js @@ -1,4 +1,4 @@ -import{g as r}from"./index-CA09r0fx.js";/** +import{g as r}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/badge-CkrPEkl0.js b/assets/badge-CE-3yZlW.js similarity index 90% rename from assets/badge-CkrPEkl0.js rename to assets/badge-CE-3yZlW.js index 222d97e19ea97348cfc3e15dd8cc3223eeab264d..8ed2b3a8b839a6be55cfdcd5158354ae8ea07265 100644 --- a/assets/badge-CkrPEkl0.js +++ b/assets/badge-CE-3yZlW.js @@ -1 +1 @@ -import{j as n,x as o,a3 as a}from"./index-CA09r0fx.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,x as o,a3 as a}from"./index-DGz7IJy3.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-BkpxXw_S.js b/assets/button-DEdvni-v.js similarity index 89% rename from assets/button-BkpxXw_S.js rename to assets/button-DEdvni-v.js index 1fe2432273d5a5a56d5e6694bfe9fb31d42b9c7a..a50dad696f5f43a759b815fc900e7e638e96641b 100644 --- a/assets/button-BkpxXw_S.js +++ b/assets/button-DEdvni-v.js @@ -1 +1 @@ -import{r as a,j as d,at as u,x as c,a3 as f}from"./index-CA09r0fx.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,x as c,a3 as f}from"./index-DGz7IJy3.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-C6oGGh8I.js b/assets/catalog-CI50zqwR.js similarity index 97% rename from assets/catalog-C6oGGh8I.js rename to assets/catalog-CI50zqwR.js index efd9301dc608e556a1233b70fae8ec97295bc0db..bc619421e0c617bf29baacf8384ab975511dda71 100644 --- a/assets/catalog-C6oGGh8I.js +++ b/assets/catalog-CI50zqwR.js @@ -1 +1 @@ -import{a1 as o}from"./index-CA09r0fx.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":""}`)}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{a1 as o}from"./index-DGz7IJy3.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":""}`)}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-XoDxf8nx.js b/assets/chat-C_06RcUY.js similarity index 97% rename from assets/chat-XoDxf8nx.js rename to assets/chat-C_06RcUY.js index 5bf22f8bc63f90f62405539bb3a138f6778b1013..7d38c70391bef71950f4e2c500f5d035849970db 100644 --- a/assets/chat-XoDxf8nx.js +++ b/assets/chat-C_06RcUY.js @@ -1 +1 @@ -import{a1 as n,as as r}from"./index-CA09r0fx.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"})}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{a1 as n,as as r}from"./index-DGz7IJy3.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"})}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/chatLaunch-CutMsO9s.js b/assets/chatLaunch-CutMsO9s.js deleted file mode 100644 index 6479d4e5f2256023fd13daf8bad22481762e30e2..0000000000000000000000000000000000000000 --- a/assets/chatLaunch-CutMsO9s.js +++ /dev/null @@ -1,4 +0,0 @@ -import{j as a,A as ae,r as T,l as ce,F as h}from"./index-CA09r0fx.js";import{c as m}from"./chat-XoDxf8nx.js";import{C as le}from"./chevron-down-MPck50eR.js";import{u as ue}from"./useQuery-GCOPnmOE.js";import{p as pe}from"./papers-2SfezChA.js";import{E as de}from"./earth-gRrLiaVn.js";const Pe=({light:e})=>a.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),Ae=({open:e})=>a.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:a.jsx("path",{d:"m6 9 6 6 6-6"})}),Te=()=>a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]}),je=({size:e=14})=>a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7"}),a.jsx("path",{d:"m21 21-4.3-4.3"})]}),Me=()=>a.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:a.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Oe=()=>a.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M12 5v14M5 12h14"})}),De=()=>a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),a.jsx("path",{d:"M9 4v16"})]}),Ne=()=>a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.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"})}),F="gpt-5.6-luna@openai",he="deepseek-ai/DeepSeek-V4-Flash-0731",V="openai/gpt-5.6-luna";function Re(e,r){var n;return((n=e.find(t=>t.id===r))==null?void 0:n.provider)??(r===V?"openrouter":r===F?"openai":"huggingface")}function fe(e,r){var n;return((n=e.find(t=>t.id===r))==null?void 0:n.label)??(r===V?"GPT-5.6 Luna (Legacy OpenRouter)":r===F?"GPT-6 Luna":`${r} (unavailable)`)}const Le=[{id:F,label:"GPT-6 Luna",provider:"openai"}],Fe=[{id:he,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 ge extends Error{constructor(r,n){super(r),this.status=n}}async function $e(){const e=[];let r=null;do{const n=await m.listSessions(r);e.push(...n.items),r=n.next_cursor}while(r&&e.length<100);return e}function He(e,r="low"){return m.createSession(e,r)}function Be(e){return m.getSession(e)}function We(e,r){return m.updateSession(e,r)}function qe(e){return m.removeSession(e)}function Ye(){return m.archiveOldChats()}function Ke(){return m.archiveOldestChats()}function Ue(e){return m.cancelSession(e)}function Ve(e){return m.createOrRefreshShare(e)}async function Ge(e){try{return await m.getSharedChat(e)}catch(r){throw r instanceof ae?new ge(r.message,r.status):r}}async function ze(){return m.getModels()}function G(e,r){return e.display_blocks.length===0&&e.content?[{kind:"answer",text:e.content,done:!0}]:z(e.display_blocks,r)}function z(e,r){const n=e.map(t=>t.kind==="reasoning"?{...t,active:!1,open:!1}:t.kind==="tool"?{...t,status:t.status==="running"?"error":t.status,open:r&&(t.status==="error"||t.status==="denied"||t.status==="running")}:t.kind==="app"?{...t,schema_version:1,result:t.result??{content:[],structuredContent:{},isError:!1},csp:t.csp??{},permissions:t.permissions??{clipboardWrite:!0},height:t.height||525,public_fork:!!t.public_fork}:t.kind==="artifact"?{...t}:{...t,done:!0});return n.filter((t,i)=>{const c=n[i-1];return!(t.kind==="reasoning"&&(c==null?void 0:c.kind)==="reasoning"&&t.text===c.text)})}function Q(e){if(e!=null&&e.text)return{routeId:e.route_id,paperVersion:e.paper_version,page:e.page,text:e.text}}function Qe(e){const r=t=>t==="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.":t==="hf_inference_credential_expired"?"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.":t==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":t==="provider_timeout"?"The model provider timed out. Try again shortly.":t==="openrouter_monthly_budget_exhausted"?"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.":t==="openrouter_staging_funding_disabled"?"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.":t==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":t==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":t==="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.":t==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":t==="openai_budget_exhausted"?"The Papers With Code direct OpenAI allowance is exhausted. Select another model or try again later.":t==="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(t??"")?"The model provider failed before completing the response. You can edit and retry your question.":t==="persistence_error"?"The response could not be saved. You can edit and retry your question.":t==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":t==="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=t=>t==null||["cancelled","interrupted","stopped"].includes(t);return e.messages.flatMap(t=>{if(t.role==="assistant")return[{id:t.id,role:"assistant",blocks:G(t,!0),followups:t.followups,citations:t.citations,finishReason:t.finish_reason??void 0,streaming:!1}];const i={id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(o=>({...o,key:o.occurrence_id})),paperSelection:Q(t.paper_selection),revision:t.revision,status:t.status,error:t.status==="complete"?void 0:t.error_code||t.status};if(!["error","interrupted"].includes(t.status))return[i];const c=t.status==="interrupted"&&n(t.error_code);return[i,{id:`${t.id}-${t.status==="interrupted"?"interrupted":"error"}`,role:"assistant",blocks:z(t.display_blocks,!0),streaming:!1,finishReason:c?"stopped":void 0,error:c?void 0:r(t.error_code),errorCode:c?void 0:t.error_code??void 0}]})}function Xe(e){return e.messages.map(r=>r.role==="user"?{id:r.id,role:"user",text:r.content,paperMentions:(r.paper_mentions??[]).map(n=>({...n,key:n.occurrence_id})),paperSelection:Q(r.paper_selection)}:{id:r.id,role:"assistant",blocks:G(r,!1),citations:r.citations,finishReason:r.finish_reason??void 0,error:r.error??void 0,streaming:!1})}function Je(e){const r=Date.now(),n=new Date().setHours(0,0,0,0),t=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const i of[...e].sort((c,o)=>Date.parse(o.updated_at)-Date.parse(c.updated_at))){const c=Date.parse(i.updated_at),o=r-c;c>=n?t[0].items.push(i):o<7*864e5?t[1].items.push(i):o<30*864e5?t[2].items.push(i):t[3].items.push(i)}return t.filter(i=>i.items.length>0)}const me=[{provider:"huggingface",label:"Hugging Face Inference Providers"},{provider:"openrouter",label:"OpenRouter"},{provider:"openai",label:"OpenAI"}],Ze=({models:e,selectedModel:r,onModelChange:n,disabled:t})=>{var o;const i=fe(e,r),c=e.filter(s=>!s.provider);return e.length===1&&((o=e[0])==null?void 0:o.id)===r?a.jsx("span",{className:"chat-model-label","aria-label":"Research model",children:i}):a.jsxs("span",{className:`chat-model-picker${t?" is-disabled":""}`,children:[a.jsx("span",{className:"chat-model-picker-sizer","aria-hidden":"true",children:i}),a.jsxs("select",{className:"chat-model-select",value:r,disabled:t,onChange:s=>n(s.target.value),"aria-label":"Research model",children:[!e.some(s=>s.id===r)&&a.jsx("option",{value:r,disabled:!0,children:i}),c.map(s=>a.jsx("option",{value:s.id,children:s.label},s.id)),me.map(({provider:s,label:p})=>{const d=e.filter(u=>u.provider===s);return d.length===0?null:a.jsx("optgroup",{label:p,children:d.map(u=>a.jsx("option",{value:u.id,children:u.label},u.id))},s)})]}),a.jsx("svg",{className:"chat-model-picker-chevron",viewBox:"0 0 12 8","aria-hidden":"true",children:a.jsx("path",{d:"m1 1 5 5 5-5"})})]})},L=[{value:"low",label:"Low",description:"Faster and more concise"},{value:"high",label:"High",description:"More thorough"},{value:"max",label:"Max",description:"Deepest and slowest"}],et=({value:e,onChange:r,disabled:n=!1})=>{const[t,i]=T.useState(!1),c=T.useRef(null),o=L.find(s=>s.value===e)??L[0];return T.useEffect(()=>{if(!t)return;const s=d=>{var u;(u=c.current)!=null&&u.contains(d.target)||i(!1)},p=d=>{d.key==="Escape"&&i(!1)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",p)}},[t]),T.useEffect(()=>{n&&i(!1)},[n]),a.jsxs("div",{className:"chat-effort-picker",ref:c,children:[a.jsxs("button",{type:"button",className:"chat-effort-trigger","aria-label":`Reasoning effort: ${o.label}`,"aria-haspopup":"listbox","aria-expanded":t,disabled:n,onClick:()=>i(s=>!s),children:[a.jsx("span",{children:o.label}),a.jsx(le,{size:13,"aria-hidden":"true"})]}),t&&a.jsxs("div",{className:"chat-effort-menu",role:"listbox","aria-label":"Reasoning effort",children:[a.jsx("div",{className:"chat-effort-menu-label","aria-hidden":"true",children:"Reasoning effort"}),L.map(s=>a.jsxs("button",{type:"button",className:`chat-effort-option${s.value===e?" is-selected":""}`,role:"option","aria-selected":s.value===e,onClick:()=>{r(s.value),i(!1)},children:[a.jsxs("span",{className:"chat-effort-option-copy",children:[a.jsx("strong",{children:s.label}),a.jsx("small",{children:s.description})]}),s.value===e&&a.jsx(ce,{size:15,"aria-hidden":"true"})]},s.value))]})]})},tt=({text:e,mentions:r,scrollTop:n=0,variant:t="composer"})=>{const i=[];let c=0;for(const o of[...r].sort((s,p)=>s.start-p.start)){const s=e.slice(o.start,o.end),p=s===o.title||s===`@${o.title}`;o.starte.length||!p||(i.push(e.slice(c,o.start)),i.push(a.jsx("span",{className:`chat-paper-inline-highlight${o.unavailable?" is-unavailable":""}`,"data-paper-route-id":o.route_id,children:s},o.key)),c=o.end)}return i.push(e.slice(c)),e.endsWith(` -`)&&i.push("​"),a.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${t}`,children:a.jsx("div",{style:{transform:`translateY(-${n}px)`},children:i})})},rt=({open:e,query:r,results:n,activeIndex:t,loading:i,error:c,onSelect:o,id:s="chat-paper-picker",optionIdPrefix:p="chat-paper-option"})=>{if(!e)return null;const d=r.trim()?i?"Searching papers…":c?"Paper search is unavailable":n.length?`${n.length} paper${n.length===1?"":"s"} found`:"No papers found":"Type to search papers";return a.jsxs("div",{className:"chat-paper-picker",id:s,role:"listbox","aria-label":"Paper results",children:[a.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:d}),n.map((u,g)=>{const N=u.arxiv_id||u.id,E=u.arxiv_id||(()=>{try{return u.source_url?new URL(u.source_url).hostname:"External resource"}catch{return"External resource"}})();return a.jsxs("button",{type:"button",id:`${p}-${g}`,role:"option","aria-selected":g===t,className:`chat-paper-option${g===t?" is-active":""}`,onMouseDown:P=>{P.preventDefault(),o(u)},children:[a.jsx("span",{className:"chat-paper-option-title",children:u.title}),a.jsx("span",{className:"chat-paper-option-meta",children:E})]},N)})]})},X=8e3,J=16384,Z=1e4,S={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 ee(e){return new TextEncoder().encode(e).length}function te(e){return e.replace(/\r\n/g,` -`).replace(/\r/g,` -`).replace(/\u00a0/g," ").replace(/[^\S\n]+/g," ").trim()}function nt(e){return`${e.routeId}\0${e.paperVersion}\0${e.page}\0${e.text}`}function st(e){return{route_id:e.routeId,paper_version:e.paperVersion,page:e.page,text:e.text}}function I(e="",r){return r?{text:e,paperMentions:[],paperSelection:r}:{text:e,paperMentions:[]}}function q(e,r,n){return e.paperSelection?{text:r,paperMentions:n,paperSelection:e.paperSelection}:{text:r,paperMentions:n}}function ve(e){if(!e||typeof e!="object")return;const r=e;if(typeof r.routeId!="string"||!r.routeId.trim()||typeof r.paperVersion!="string"||!r.paperVersion.trim())return;const n=r.page;if(typeof n!="number"||!Number.isInteger(n)||n<1||n>Z||typeof r.text!="string")return;const t=te(r.text);if(t&&!(t.length>X)&&!(ee(t)>J))return{routeId:r.routeId.trim(),paperVersion:r.paperVersion.trim(),page:n,text:t}}function xe(e,r){if(typeof e=="string")return I(e);if(!e||typeof e!="object")return r===void 0?null:I(r);const n=e;if(typeof n.text!="string"||!Array.isArray(n.paperMentions))return r===void 0?null:I(r);const t=ve(n.paperSelection);return t?{text:n.text,paperMentions:n.paperMentions,paperSelection:t}:{text:n.text,paperMentions:n.paperMentions}}function re(e){return e?e instanceof Element?e:e.parentElement:null}function Y(e,r){const n=re(e);if(!n||!r.contains(n)||!n.closest(".textLayer, .reader-web-document"))return null;const t=n.closest(".pdf-page[data-page], .reader-web-document[data-page]");if(!t||!r.contains(t))return null;const i=Number(t.dataset.page);return!Number.isInteger(i)||i<1||i>Z?null:i}function ot(e){const{selection:r,pagesRoot:n,routeId:t,paperVersion:i,numPages:c}=e;if(!n||!r||r.rangeCount!==1)return r&&r.rangeCount>1?{ok:!1,error:S.crossPage}:{ok:!1,error:null};const o=r.getRangeAt(0);if(o.collapsed)return{ok:!1,error:null};const s=Y(o.startContainer,n),p=Y(o.endContainer,n),d=re(o.commonAncestorContainer);if(!d||!n.contains(d))return{ok:!1,error:S.outside};if(s===null||p===null)return{ok:!1,error:S.outside};if(s!==p)return{ok:!1,error:S.crossPage};if(c&&(s<1||s>c))return{ok:!1,error:S.crossPage};const u=r.toString(),g=te(u);return g?g.length>X||ee(g)>J?{ok:!1,error:S.tooLarge}:{ok:!0,selection:{routeId:t,paperVersion:i,page:s,text:g}}:{ok:!1,error:S.crossPage}}const ye=10,_e=3;function K(e,r){const t=e.slice(0,r).lastIndexOf("@");if(t<0)return null;const i=t>0?e[t-1]:"";if(i&&/[\p{L}\p{M}\p{N}_@]/u.test(i))return null;const c=e.slice(t+1,r);return/[\n\r@]/.test(c)?null:{start:t,end:r,query:c}}function U(e,r,n){let t=0;for(;ts.end<=t?[s]:s.start>=c?[{...s,start:s.start+o,end:s.end+o}]:[])}function it({draft:e,onChange:r,enabled:n,textareaRef:t}){var H;const i=`chat-paper-picker-${h.useId().replace(/:/g,"")}`,c=`${i}-option`,[o,s]=h.useState(null),[p,d]=h.useState(""),[u,g]=h.useState(0),[N,E]=h.useState(""),P=h.useRef(new Set);h.useEffect(()=>{n||s(null)},[n]),h.useEffect(()=>{const l=window.setTimeout(()=>d((o==null?void 0:o.query.trim())??""),150);return()=>window.clearTimeout(l)},[o==null?void 0:o.query]);const w=ue({queryKey:["chat-paper-mention-search",p.toLowerCase()],queryFn:({signal:l})=>pe.search(p,1,10,"hybrid",l),enabled:n&&!!o&&p.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),v=h.useMemo(()=>{var l;return((l=w.data)==null?void 0:l.results)??[]},[(H=w.data)==null?void 0:H.results]);h.useEffect(()=>g(0),[p]),h.useEffect(()=>{var l;(l=document.getElementById(`${c}-${u}`))==null||l.scrollIntoView({block:"nearest"})},[u,c]);const ne=h.useCallback(l=>{var x;if(!n){s(null);return}const f=l??((x=t.current)==null?void 0:x.selectionStart)??e.text.length;if(e.paperMentions.some(y=>f>y.start&&f<=y.end)){s(null);return}s(K(e.text,f))},[e.paperMentions,e.text,n,t]),se=h.useCallback((l,f)=>{var k;const x=U(e.text,l,e.paperMentions),y=q(e,l,x);r(y);const _=f??((k=t.current)==null?void 0:k.selectionStart)??l.length;n&&!x.some(C=>_>C.start&&_<=C.end)?s(K(l,_)):s(null)},[e,n,r,t]),R=h.useCallback(l=>{if(!o)return!1;const f=l.arxiv_id||l.id,x=new Set(e.paperMentions.map(b=>b.route_id));if(e.paperMentions.length>=ye)return E("A message can contain at most 10 paper mentions."),!1;if(!x.has(f)&&x.size>=_e)return E("A message can attach at most 3 distinct papers."),!1;const y=l.title,_=e.text.slice(o.end),k=_.length===0,C=e.text.slice(0,o.start)+y+(k?" ":"")+_,ie=U(e.text,C,e.paperMentions),B={key:crypto.randomUUID(),route_id:f,title:l.title,source:l.source==="external"?"external":"arxiv",start:o.start,end:o.start+y.length};return r(q(e,C,[...ie,B].sort((b,A)=>b.start-A.start))),s(null),E(""),window.requestAnimationFrame(()=>{var A,W;const b=B.end+(k||_.startsWith(" ")?1:0);(A=t.current)==null||A.focus(),(W=t.current)==null||W.setSelectionRange(b,b)}),P.current.has(f)||(P.current.add(f),m.prewarmPaperContext(f).catch(()=>{})),!0},[o,e,r,t]),oe=h.useCallback(l=>!o||l.nativeEvent.isComposing?!1:l.key==="Tab"?(s(null),!1):l.key==="Escape"?(l.preventDefault(),s(null),!0):l.key==="ArrowDown"||l.key==="ArrowUp"?(l.preventDefault(),v.length&&g(f=>l.key==="ArrowDown"?(f+1)%v.length:(f-1+v.length)%v.length),!0):l.key==="Home"&&v.length?(l.preventDefault(),g(0),!0):l.key==="End"&&v.length?(l.preventDefault(),g(v.length-1),!0):l.key==="Enter"&&!l.shiftKey?(l.preventDefault(),v[u]?R(v[u]):w.isFetching||s(null),!0):!1,[o,u,v,w.isFetching,R]);return{open:!!o,query:(o==null?void 0:o.query)??"",results:v,activeIndex:u,loading:w.isFetching,error:w.isError,message:N,pickerId:i,optionIdPrefix:c,updateText:se,refresh:ne,select:R,keyDown:oe,close:()=>s(null)}}const at=({enabled:e,onChange:r,disabled:n=!1})=>a.jsxs("button",{type:"button",className:`chat-web-search-toggle${e?" is-enabled":""}`,role:"switch","aria-checked":e,"aria-label":"Web search",title:"Allow public-web search when useful; enabled search queries are processed by Exa",disabled:n,onClick:()=>r(!e),children:[a.jsx(de,{size:15,"aria-hidden":"true"}),a.jsx("span",{children:"Web"})]}),$="pwc:chat-oauth-draft",j="pwc:chat-oauth-model",M="pwc:chat-oauth-auto-send",Se="pwc:chat-oauth-attempted",O="pwc:chat-web-search-enabled",D="pwc:chat-reasoning-effort";function ct(e,r,n={}){const t=typeof e=="string"?e:e.text,i=t.length-t.trimStart().length,c=t.trim();if(!c)return;const o=i+c.length,s=typeof e=="string"?[]:e.paperMentions.filter(d=>d.start>=i&&d.end<=o).map(d=>({...d,start:d.start-i,end:d.end-i})),p={text:c,paperMentions:s,...typeof e!="string"&&e.paperSelection?{paperSelection:e.paperSelection}:{}};sessionStorage.setItem($,p.paperMentions.length||p.paperSelection?JSON.stringify(p):c),n.autoSend===!1?sessionStorage.removeItem(M):sessionStorage.setItem(M,"1"),r?sessionStorage.setItem(j,r):sessionStorage.removeItem(j),n.webSearchEnabled===void 0?sessionStorage.removeItem(O):sessionStorage.setItem(O,n.webSearchEnabled?"1":"0"),sessionStorage.setItem(D,n.reasoningEffort??"low")}function lt(){var t;if(typeof window>"u"||sessionStorage.getItem(M)!=="1")return null;const e=(t=sessionStorage.getItem($))==null?void 0:t.trim();if(!e)return null;let r=I(e);try{r=xe(JSON.parse(e),e)??I(e)}catch{}const n=r.text.trim();return n?{prompt:n,draft:{...r,text:n},model:sessionStorage.getItem(j),webSearchEnabled:sessionStorage.getItem(O)!=="0",reasoningEffort:["low","high","max"].includes(sessionStorage.getItem(D)??"")?sessionStorage.getItem(D):"low"}:null}function ut(){sessionStorage.removeItem($),sessionStorage.removeItem(j),sessionStorage.removeItem(M),sessionStorage.removeItem(Se),sessionStorage.removeItem(O),sessionStorage.removeItem(D)}export{Me as A,M as B,ge as C,F as D,Se as E,ut as F,ze as G,xe as H,We as I,qe as J,ot as K,nt as L,Ze as M,Te as N,Ae as O,tt as P,je as Q,et as R,Fe as S,Ne as T,at as W,Le as a,rt as b,He as c,Pe as d,Oe as e,De as f,Ge as g,Je as h,Ve as i,Ke as j,Ye as k,I as l,Ue as m,Be as n,Qe as o,Xe as p,ct as q,$e as r,lt as s,st as t,it as u,Re as v,$ as w,j as x,D as y,O as z}; diff --git a/assets/chatLaunch-DVedsuWi.js b/assets/chatLaunch-DVedsuWi.js new file mode 100644 index 0000000000000000000000000000000000000000..ae1f88340d50b6322cb03365ce2a015abdb58aa1 --- /dev/null +++ b/assets/chatLaunch-DVedsuWi.js @@ -0,0 +1,4 @@ +import{j as a,A as ae,r as T,l as ce,F as h}from"./index-DGz7IJy3.js";import{c as m}from"./chat-C_06RcUY.js";import{C as le}from"./chevron-down-CzLvLwcd.js";import{u as ue}from"./useQuery-SnJNmisF.js";import{p as pe}from"./papers-CgK5TA59.js";import{E as de}from"./earth-BQV4xejs.js";const Ae=({light:e})=>a.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),Te=({open:e})=>a.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:a.jsx("path",{d:"m6 9 6 6 6-6"})}),je=()=>a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]}),Me=({size:e=14})=>a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7"}),a.jsx("path",{d:"m21 21-4.3-4.3"})]}),Oe=()=>a.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:a.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),De=()=>a.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M12 5v14M5 12h14"})}),Ne=()=>a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),a.jsx("path",{d:"M9 4v16"})]}),Re=()=>a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.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"})}),F="gpt-5.6-luna@openai",he="deepseek-ai/DeepSeek-V4-Flash-0731",V="openai/gpt-5.6-luna",fe="deepseek-ai/DeepSeek-V4.1-Flash-1017";function Le(e,r){var n;return((n=e.find(t=>t.id===r))==null?void 0:n.provider)??(r===V?"openrouter":r===F?"openai":"huggingface")}function Fe(e,r){const n=e.find(t=>t.id===r);return n?n.sponsored===!0:r===fe}function ge(e,r){var n;return((n=e.find(t=>t.id===r))==null?void 0:n.label)??(r===V?"GPT-5.6 Luna (Legacy OpenRouter)":r===F?"GPT-6 Luna":`${r} (unavailable)`)}const $e=[{id:F,label:"GPT-6 Luna",provider:"openai"}],He=[{id:he,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 me extends Error{constructor(r,n){super(r),this.status=n}}async function Be(){const e=[];let r=null;do{const n=await m.listSessions(r);e.push(...n.items),r=n.next_cursor}while(r&&e.length<100);return e}function We(e,r="low"){return m.createSession(e,r)}function qe(e){return m.getSession(e)}function Ye(e,r){return m.updateSession(e,r)}function Ke(e){return m.removeSession(e)}function Ue(){return m.archiveOldChats()}function Ve(){return m.archiveOldestChats()}function Ge(e){return m.cancelSession(e)}function ze(e){return m.createOrRefreshShare(e)}async function Qe(e){try{return await m.getSharedChat(e)}catch(r){throw r instanceof ae?new me(r.message,r.status):r}}async function Xe(){return m.getModels()}function G(e,r){return e.display_blocks.length===0&&e.content?[{kind:"answer",text:e.content,done:!0}]:z(e.display_blocks,r)}function z(e,r){const n=e.map(t=>t.kind==="reasoning"?{...t,active:!1,open:!1}:t.kind==="tool"?{...t,status:t.status==="running"?"error":t.status,open:r&&(t.status==="error"||t.status==="denied"||t.status==="running")}:t.kind==="app"?{...t,schema_version:1,result:t.result??{content:[],structuredContent:{},isError:!1},csp:t.csp??{},permissions:t.permissions??{clipboardWrite:!0},height:t.height||525,public_fork:!!t.public_fork}:t.kind==="artifact"?{...t}:{...t,done:!0});return n.filter((t,i)=>{const c=n[i-1];return!(t.kind==="reasoning"&&(c==null?void 0:c.kind)==="reasoning"&&t.text===c.text)})}function Q(e){if(e!=null&&e.text)return{routeId:e.route_id,paperVersion:e.paper_version,page:e.page,text:e.text}}function Je(e){const r=t=>t==="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.":t==="hf_inference_credential_expired"?"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.":t==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":t==="provider_timeout"?"The model provider timed out. Try again shortly.":t==="openrouter_monthly_budget_exhausted"?"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.":t==="openrouter_staging_funding_disabled"?"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.":t==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":t==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":t==="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.":t==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":t==="openai_budget_exhausted"?"The Papers With Code direct OpenAI allowance is exhausted. Select another model or try again later.":t==="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(t??"")?"The model provider failed before completing the response. You can edit and retry your question.":t==="persistence_error"?"The response could not be saved. You can edit and retry your question.":t==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":t==="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=t=>t==null||["cancelled","interrupted","stopped"].includes(t);return e.messages.flatMap(t=>{if(t.role==="assistant")return[{id:t.id,role:"assistant",blocks:G(t,!0),followups:t.followups,citations:t.citations,finishReason:t.finish_reason??void 0,streaming:!1}];const i={id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(o=>({...o,key:o.occurrence_id})),paperSelection:Q(t.paper_selection),revision:t.revision,status:t.status,error:t.status==="complete"?void 0:t.error_code||t.status};if(!["error","interrupted"].includes(t.status))return[i];const c=t.status==="interrupted"&&n(t.error_code);return[i,{id:`${t.id}-${t.status==="interrupted"?"interrupted":"error"}`,role:"assistant",blocks:z(t.display_blocks,!0),streaming:!1,finishReason:c?"stopped":void 0,error:c?void 0:r(t.error_code),errorCode:c?void 0:t.error_code??void 0}]})}function Ze(e){return e.messages.map(r=>r.role==="user"?{id:r.id,role:"user",text:r.content,paperMentions:(r.paper_mentions??[]).map(n=>({...n,key:n.occurrence_id})),paperSelection:Q(r.paper_selection)}:{id:r.id,role:"assistant",blocks:G(r,!1),citations:r.citations,finishReason:r.finish_reason??void 0,error:r.error??void 0,streaming:!1})}function et(e){const r=Date.now(),n=new Date().setHours(0,0,0,0),t=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const i of[...e].sort((c,o)=>Date.parse(o.updated_at)-Date.parse(c.updated_at))){const c=Date.parse(i.updated_at),o=r-c;c>=n?t[0].items.push(i):o<7*864e5?t[1].items.push(i):o<30*864e5?t[2].items.push(i):t[3].items.push(i)}return t.filter(i=>i.items.length>0)}const ve=[{provider:"huggingface",label:"Hugging Face Inference Providers"},{provider:"openrouter",label:"OpenRouter"},{provider:"openai",label:"OpenAI"}],tt=({models:e,selectedModel:r,onModelChange:n,disabled:t})=>{var o;const i=ge(e,r),c=e.filter(s=>!s.provider);return e.length===1&&((o=e[0])==null?void 0:o.id)===r?a.jsx("span",{className:"chat-model-label","aria-label":"Research model",children:i}):a.jsxs("span",{className:`chat-model-picker${t?" is-disabled":""}`,children:[a.jsx("span",{className:"chat-model-picker-sizer","aria-hidden":"true",children:i}),a.jsxs("select",{className:"chat-model-select",value:r,disabled:t,onChange:s=>n(s.target.value),"aria-label":"Research model",children:[!e.some(s=>s.id===r)&&a.jsx("option",{value:r,disabled:!0,children:i}),c.map(s=>a.jsx("option",{value:s.id,children:s.label},s.id)),ve.map(({provider:s,label:p})=>{const d=e.filter(u=>u.provider===s);return d.length===0?null:a.jsx("optgroup",{label:p,children:d.map(u=>a.jsx("option",{value:u.id,children:u.label},u.id))},s)})]}),a.jsx("svg",{className:"chat-model-picker-chevron",viewBox:"0 0 12 8","aria-hidden":"true",children:a.jsx("path",{d:"m1 1 5 5 5-5"})})]})},L=[{value:"low",label:"Low",description:"Faster and more concise"},{value:"high",label:"High",description:"More thorough"},{value:"max",label:"Max",description:"Deepest and slowest"}],rt=({value:e,onChange:r,disabled:n=!1})=>{const[t,i]=T.useState(!1),c=T.useRef(null),o=L.find(s=>s.value===e)??L[0];return T.useEffect(()=>{if(!t)return;const s=d=>{var u;(u=c.current)!=null&&u.contains(d.target)||i(!1)},p=d=>{d.key==="Escape"&&i(!1)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",p)}},[t]),T.useEffect(()=>{n&&i(!1)},[n]),a.jsxs("div",{className:"chat-effort-picker",ref:c,children:[a.jsxs("button",{type:"button",className:"chat-effort-trigger","aria-label":`Reasoning effort: ${o.label}`,"aria-haspopup":"listbox","aria-expanded":t,disabled:n,onClick:()=>i(s=>!s),children:[a.jsx("span",{children:o.label}),a.jsx(le,{size:13,"aria-hidden":"true"})]}),t&&a.jsxs("div",{className:"chat-effort-menu",role:"listbox","aria-label":"Reasoning effort",children:[a.jsx("div",{className:"chat-effort-menu-label","aria-hidden":"true",children:"Reasoning effort"}),L.map(s=>a.jsxs("button",{type:"button",className:`chat-effort-option${s.value===e?" is-selected":""}`,role:"option","aria-selected":s.value===e,onClick:()=>{r(s.value),i(!1)},children:[a.jsxs("span",{className:"chat-effort-option-copy",children:[a.jsx("strong",{children:s.label}),a.jsx("small",{children:s.description})]}),s.value===e&&a.jsx(ce,{size:15,"aria-hidden":"true"})]},s.value))]})]})},nt=({text:e,mentions:r,scrollTop:n=0,variant:t="composer"})=>{const i=[];let c=0;for(const o of[...r].sort((s,p)=>s.start-p.start)){const s=e.slice(o.start,o.end),p=s===o.title||s===`@${o.title}`;o.starte.length||!p||(i.push(e.slice(c,o.start)),i.push(a.jsx("span",{className:`chat-paper-inline-highlight${o.unavailable?" is-unavailable":""}`,"data-paper-route-id":o.route_id,children:s},o.key)),c=o.end)}return i.push(e.slice(c)),e.endsWith(` +`)&&i.push("​"),a.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${t}`,children:a.jsx("div",{style:{transform:`translateY(-${n}px)`},children:i})})},st=({open:e,query:r,results:n,activeIndex:t,loading:i,error:c,onSelect:o,id:s="chat-paper-picker",optionIdPrefix:p="chat-paper-option"})=>{if(!e)return null;const d=r.trim()?i?"Searching papers…":c?"Paper search is unavailable":n.length?`${n.length} paper${n.length===1?"":"s"} found`:"No papers found":"Type to search papers";return a.jsxs("div",{className:"chat-paper-picker",id:s,role:"listbox","aria-label":"Paper results",children:[a.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:d}),n.map((u,g)=>{const N=u.arxiv_id||u.id,E=u.arxiv_id||(()=>{try{return u.source_url?new URL(u.source_url).hostname:"External resource"}catch{return"External resource"}})();return a.jsxs("button",{type:"button",id:`${p}-${g}`,role:"option","aria-selected":g===t,className:`chat-paper-option${g===t?" is-active":""}`,onMouseDown:P=>{P.preventDefault(),o(u)},children:[a.jsx("span",{className:"chat-paper-option-title",children:u.title}),a.jsx("span",{className:"chat-paper-option-meta",children:E})]},N)})]})},X=8e3,J=16384,Z=1e4,S={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 ee(e){return new TextEncoder().encode(e).length}function te(e){return e.replace(/\r\n/g,` +`).replace(/\r/g,` +`).replace(/\u00a0/g," ").replace(/[^\S\n]+/g," ").trim()}function ot(e){return`${e.routeId}\0${e.paperVersion}\0${e.page}\0${e.text}`}function it(e){return{route_id:e.routeId,paper_version:e.paperVersion,page:e.page,text:e.text}}function I(e="",r){return r?{text:e,paperMentions:[],paperSelection:r}:{text:e,paperMentions:[]}}function q(e,r,n){return e.paperSelection?{text:r,paperMentions:n,paperSelection:e.paperSelection}:{text:r,paperMentions:n}}function xe(e){if(!e||typeof e!="object")return;const r=e;if(typeof r.routeId!="string"||!r.routeId.trim()||typeof r.paperVersion!="string"||!r.paperVersion.trim())return;const n=r.page;if(typeof n!="number"||!Number.isInteger(n)||n<1||n>Z||typeof r.text!="string")return;const t=te(r.text);if(t&&!(t.length>X)&&!(ee(t)>J))return{routeId:r.routeId.trim(),paperVersion:r.paperVersion.trim(),page:n,text:t}}function ye(e,r){if(typeof e=="string")return I(e);if(!e||typeof e!="object")return r===void 0?null:I(r);const n=e;if(typeof n.text!="string"||!Array.isArray(n.paperMentions))return r===void 0?null:I(r);const t=xe(n.paperSelection);return t?{text:n.text,paperMentions:n.paperMentions,paperSelection:t}:{text:n.text,paperMentions:n.paperMentions}}function re(e){return e?e instanceof Element?e:e.parentElement:null}function Y(e,r){const n=re(e);if(!n||!r.contains(n)||!n.closest(".textLayer, .reader-web-document"))return null;const t=n.closest(".pdf-page[data-page], .reader-web-document[data-page]");if(!t||!r.contains(t))return null;const i=Number(t.dataset.page);return!Number.isInteger(i)||i<1||i>Z?null:i}function at(e){const{selection:r,pagesRoot:n,routeId:t,paperVersion:i,numPages:c}=e;if(!n||!r||r.rangeCount!==1)return r&&r.rangeCount>1?{ok:!1,error:S.crossPage}:{ok:!1,error:null};const o=r.getRangeAt(0);if(o.collapsed)return{ok:!1,error:null};const s=Y(o.startContainer,n),p=Y(o.endContainer,n),d=re(o.commonAncestorContainer);if(!d||!n.contains(d))return{ok:!1,error:S.outside};if(s===null||p===null)return{ok:!1,error:S.outside};if(s!==p)return{ok:!1,error:S.crossPage};if(c&&(s<1||s>c))return{ok:!1,error:S.crossPage};const u=r.toString(),g=te(u);return g?g.length>X||ee(g)>J?{ok:!1,error:S.tooLarge}:{ok:!0,selection:{routeId:t,paperVersion:i,page:s,text:g}}:{ok:!1,error:S.crossPage}}const _e=10,Se=3;function K(e,r){const t=e.slice(0,r).lastIndexOf("@");if(t<0)return null;const i=t>0?e[t-1]:"";if(i&&/[\p{L}\p{M}\p{N}_@]/u.test(i))return null;const c=e.slice(t+1,r);return/[\n\r@]/.test(c)?null:{start:t,end:r,query:c}}function U(e,r,n){let t=0;for(;ts.end<=t?[s]:s.start>=c?[{...s,start:s.start+o,end:s.end+o}]:[])}function ct({draft:e,onChange:r,enabled:n,textareaRef:t}){var H;const i=`chat-paper-picker-${h.useId().replace(/:/g,"")}`,c=`${i}-option`,[o,s]=h.useState(null),[p,d]=h.useState(""),[u,g]=h.useState(0),[N,E]=h.useState(""),P=h.useRef(new Set);h.useEffect(()=>{n||s(null)},[n]),h.useEffect(()=>{const l=window.setTimeout(()=>d((o==null?void 0:o.query.trim())??""),150);return()=>window.clearTimeout(l)},[o==null?void 0:o.query]);const w=ue({queryKey:["chat-paper-mention-search",p.toLowerCase()],queryFn:({signal:l})=>pe.search(p,1,10,"hybrid",l),enabled:n&&!!o&&p.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),v=h.useMemo(()=>{var l;return((l=w.data)==null?void 0:l.results)??[]},[(H=w.data)==null?void 0:H.results]);h.useEffect(()=>g(0),[p]),h.useEffect(()=>{var l;(l=document.getElementById(`${c}-${u}`))==null||l.scrollIntoView({block:"nearest"})},[u,c]);const ne=h.useCallback(l=>{var x;if(!n){s(null);return}const f=l??((x=t.current)==null?void 0:x.selectionStart)??e.text.length;if(e.paperMentions.some(y=>f>y.start&&f<=y.end)){s(null);return}s(K(e.text,f))},[e.paperMentions,e.text,n,t]),se=h.useCallback((l,f)=>{var k;const x=U(e.text,l,e.paperMentions),y=q(e,l,x);r(y);const _=f??((k=t.current)==null?void 0:k.selectionStart)??l.length;n&&!x.some(C=>_>C.start&&_<=C.end)?s(K(l,_)):s(null)},[e,n,r,t]),R=h.useCallback(l=>{if(!o)return!1;const f=l.arxiv_id||l.id,x=new Set(e.paperMentions.map(b=>b.route_id));if(e.paperMentions.length>=_e)return E("A message can contain at most 10 paper mentions."),!1;if(!x.has(f)&&x.size>=Se)return E("A message can attach at most 3 distinct papers."),!1;const y=l.title,_=e.text.slice(o.end),k=_.length===0,C=e.text.slice(0,o.start)+y+(k?" ":"")+_,ie=U(e.text,C,e.paperMentions),B={key:crypto.randomUUID(),route_id:f,title:l.title,source:l.source==="external"?"external":"arxiv",start:o.start,end:o.start+y.length};return r(q(e,C,[...ie,B].sort((b,A)=>b.start-A.start))),s(null),E(""),window.requestAnimationFrame(()=>{var A,W;const b=B.end+(k||_.startsWith(" ")?1:0);(A=t.current)==null||A.focus(),(W=t.current)==null||W.setSelectionRange(b,b)}),P.current.has(f)||(P.current.add(f),m.prewarmPaperContext(f).catch(()=>{})),!0},[o,e,r,t]),oe=h.useCallback(l=>!o||l.nativeEvent.isComposing?!1:l.key==="Tab"?(s(null),!1):l.key==="Escape"?(l.preventDefault(),s(null),!0):l.key==="ArrowDown"||l.key==="ArrowUp"?(l.preventDefault(),v.length&&g(f=>l.key==="ArrowDown"?(f+1)%v.length:(f-1+v.length)%v.length),!0):l.key==="Home"&&v.length?(l.preventDefault(),g(0),!0):l.key==="End"&&v.length?(l.preventDefault(),g(v.length-1),!0):l.key==="Enter"&&!l.shiftKey?(l.preventDefault(),v[u]?R(v[u]):w.isFetching||s(null),!0):!1,[o,u,v,w.isFetching,R]);return{open:!!o,query:(o==null?void 0:o.query)??"",results:v,activeIndex:u,loading:w.isFetching,error:w.isError,message:N,pickerId:i,optionIdPrefix:c,updateText:se,refresh:ne,select:R,keyDown:oe,close:()=>s(null)}}const lt=({enabled:e,onChange:r,disabled:n=!1})=>a.jsxs("button",{type:"button",className:`chat-web-search-toggle${e?" is-enabled":""}`,role:"switch","aria-checked":e,"aria-label":"Web search",title:"Allow public-web search when useful; enabled search queries are processed by Exa",disabled:n,onClick:()=>r(!e),children:[a.jsx(de,{size:15,"aria-hidden":"true"}),a.jsx("span",{children:"Web"})]}),$="pwc:chat-oauth-draft",j="pwc:chat-oauth-model",M="pwc:chat-oauth-auto-send",we="pwc:chat-oauth-attempted",O="pwc:chat-web-search-enabled",D="pwc:chat-reasoning-effort";function ut(e,r,n={}){const t=typeof e=="string"?e:e.text,i=t.length-t.trimStart().length,c=t.trim();if(!c)return;const o=i+c.length,s=typeof e=="string"?[]:e.paperMentions.filter(d=>d.start>=i&&d.end<=o).map(d=>({...d,start:d.start-i,end:d.end-i})),p={text:c,paperMentions:s,...typeof e!="string"&&e.paperSelection?{paperSelection:e.paperSelection}:{}};sessionStorage.setItem($,p.paperMentions.length||p.paperSelection?JSON.stringify(p):c),n.autoSend===!1?sessionStorage.removeItem(M):sessionStorage.setItem(M,"1"),r?sessionStorage.setItem(j,r):sessionStorage.removeItem(j),n.webSearchEnabled===void 0?sessionStorage.removeItem(O):sessionStorage.setItem(O,n.webSearchEnabled?"1":"0"),sessionStorage.setItem(D,n.reasoningEffort??"low")}function pt(){var t;if(typeof window>"u"||sessionStorage.getItem(M)!=="1")return null;const e=(t=sessionStorage.getItem($))==null?void 0:t.trim();if(!e)return null;let r=I(e);try{r=ye(JSON.parse(e),e)??I(e)}catch{}const n=r.text.trim();return n?{prompt:n,draft:{...r,text:n},model:sessionStorage.getItem(j),webSearchEnabled:sessionStorage.getItem(O)!=="0",reasoningEffort:["low","high","max"].includes(sessionStorage.getItem(D)??"")?sessionStorage.getItem(D):"low"}:null}function dt(){sessionStorage.removeItem($),sessionStorage.removeItem(j),sessionStorage.removeItem(M),sessionStorage.removeItem(we),sessionStorage.removeItem(O),sessionStorage.removeItem(D)}export{Oe as A,O as B,me as C,F as D,M as E,we as F,dt as G,Xe as H,ye as I,Ye as J,Ke as K,at as L,tt as M,ot as N,je as O,nt as P,Te as Q,rt as R,He as S,Re as T,Me as U,lt as W,$e as a,st as b,We as c,Ae as d,De as e,Ne as f,Qe as g,et as h,ze as i,Ve as j,Ue as k,I as l,Ge as m,qe as n,Je as o,Ze as p,ut as q,Be as r,pt as s,it as t,ct as u,Le as v,Fe as w,$ as x,j as y,D as z}; diff --git a/assets/chatPrompts-BzPGjXPj.js b/assets/chatPrompts-BwvjFuiO.js similarity index 86% rename from assets/chatPrompts-BzPGjXPj.js rename to assets/chatPrompts-BwvjFuiO.js index f6153db3adaea935db70acd0f6ac5e68e9f50e6e..f84874269d7c90fb08d2def5a87ef64174db75cb 100644 --- a/assets/chatPrompts-BzPGjXPj.js +++ b/assets/chatPrompts-BwvjFuiO.js @@ -1 +1 @@ -import{j as e,L as o}from"./index-CA09r0fx.js";import{A as a}from"./AgentLogos-e-hYOTh0.js";function c({className:r="",canNavigate:s}){return e.jsxs("div",{className:`sidebar-section sidebar-section-tools ${r}`.trim(),children:[e.jsx("div",{className:"sidebar-label",children:"Use PwC with your agent"}),e.jsxs(o,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",onClick:t=>{s&&!s()&&t.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"]}),"."]})]})}const l=["What are decision models?","Find relevant papers on RLVR","What's the state-of-the-art for real-time object detection?"];export{c as M,l as S}; +import{j as e,L as o}from"./index-DGz7IJy3.js";import{A as a}from"./AgentLogos-RDfL-mz2.js";function c({className:r="",canNavigate:s}){return e.jsxs("div",{className:`sidebar-section sidebar-section-tools ${r}`.trim(),children:[e.jsx("div",{className:"sidebar-label",children:"Use PwC with your agent"}),e.jsxs(o,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",onClick:t=>{s&&!s()&&t.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"]}),"."]})]})}const l=["What are decision models?","Find relevant papers on RLVR","What's the state-of-the-art for real-time object detection?"];export{c as M,l as S}; diff --git a/assets/chevron-down-MPck50eR.js b/assets/chevron-down-CzLvLwcd.js similarity index 85% rename from assets/chevron-down-MPck50eR.js rename to assets/chevron-down-CzLvLwcd.js index c03ddad31b8eb9a608f29d30ff5cc6613222d9e5..27de01e0f66661eb7f064bc7c90dfbdd250353db 100644 --- a/assets/chevron-down-MPck50eR.js +++ b/assets/chevron-down-CzLvLwcd.js @@ -1,4 +1,4 @@ -import{g as o}from"./index-CA09r0fx.js";/** +import{g as o}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-CO6G-kzo.js b/assets/circle-check-vSqohmZs.js similarity index 87% rename from assets/circle-check-CO6G-kzo.js rename to assets/circle-check-vSqohmZs.js index ef805cb5c88844c32d73b3175f4b60e2f9eba6df..9ad3ec9e65bd5d6e7b6baafbacf89e0a40f8df5f 100644 --- a/assets/circle-check-CO6G-kzo.js +++ b/assets/circle-check-vSqohmZs.js @@ -1,4 +1,4 @@ -import{g as c}from"./index-CA09r0fx.js";/** +import{g as c}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codexAddEvals-CBVUQwDQ.js b/assets/codexAddEvals-BRqTpMyJ.js similarity index 98% rename from assets/codexAddEvals-CBVUQwDQ.js rename to assets/codexAddEvals-BRqTpMyJ.js index 46257785c78138bb88e4a7cadc6792c2831f0fe8..e524b5e257e1f1f479e18bf9a5197a3a1d3b63ad 100644 --- a/assets/codexAddEvals-CBVUQwDQ.js +++ b/assets/codexAddEvals-BRqTpMyJ.js @@ -1 +1 @@ -import{K as n}from"./index-CA09r0fx.js";const l="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.";async function u(e,a){const t=await fetch(n(`/api/v1/admin/codex-curation/jobs/benchmark-candidates/${e}/promote`),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!t.ok){const o=await t.json().catch(()=>null);throw new Error((o==null?void 0:o.detail)??`Could not promote benchmark candidate (${t.status}).`)}}async function p(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/benchmark-candidates/${e}/rollback`),{method:"POST",credentials:"include"});if(!a.ok){const t=await a.json().catch(()=>null);throw new Error((t==null?void 0:t.detail)??`Could not roll back benchmark candidate (${a.status}).`)}}function h(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function f(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var o;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((o=a==null?void 0:a.detail)==null?void 0:o.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function m(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function w(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function b(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function x(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function y(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function C(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function E(e=100,a={}){const t=new URLSearchParams({limit:String(e)});Object.entries(a).forEach(([i,s])=>{s&&t.set(i,s)});const o=await fetch(n(`/api/v1/admin/codex-curation/jobs?${t}`),{credentials:"include",cache:"no-store"});if(o.ok)return await o.json();const c=new Error(`Could not load Codex jobs (${o.status}).`);throw Object.assign(c,{status:o.status}),c}async function j(e){return r(await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}/retry`),{method:"POST",credentials:"include"}))}async function v(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}/retry-trace`),{method:"POST",credentials:"include"});if(!a.ok)throw new Error(`Could not retry trace upload (${a.status}).`)}async function k(e){return r(await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function S(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/scheduler/${e}`),{method:"POST",credentials:"include"});if(!a.ok)throw new Error(`Could not ${e} scheduled curation (${a.status}).`)}export{l as A,b as a,w as b,C as c,m as d,f as e,k as f,y as g,v as h,h as i,S as j,p as k,E as l,u as p,j as r,x as s}; +import{K as n}from"./index-DGz7IJy3.js";const l="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.";async function u(e,a){const t=await fetch(n(`/api/v1/admin/codex-curation/jobs/benchmark-candidates/${e}/promote`),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!t.ok){const o=await t.json().catch(()=>null);throw new Error((o==null?void 0:o.detail)??`Could not promote benchmark candidate (${t.status}).`)}}async function p(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/benchmark-candidates/${e}/rollback`),{method:"POST",credentials:"include"});if(!a.ok){const t=await a.json().catch(()=>null);throw new Error((t==null?void 0:t.detail)??`Could not roll back benchmark candidate (${a.status}).`)}}function h(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function f(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var o;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((o=a==null?void 0:a.detail)==null?void 0:o.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function m(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function w(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function b(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function x(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function y(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function C(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function E(e=100,a={}){const t=new URLSearchParams({limit:String(e)});Object.entries(a).forEach(([i,s])=>{s&&t.set(i,s)});const o=await fetch(n(`/api/v1/admin/codex-curation/jobs?${t}`),{credentials:"include",cache:"no-store"});if(o.ok)return await o.json();const c=new Error(`Could not load Codex jobs (${o.status}).`);throw Object.assign(c,{status:o.status}),c}async function j(e){return r(await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}/retry`),{method:"POST",credentials:"include"}))}async function v(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}/retry-trace`),{method:"POST",credentials:"include"});if(!a.ok)throw new Error(`Could not retry trace upload (${a.status}).`)}async function k(e){return r(await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function S(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/scheduler/${e}`),{method:"POST",credentials:"include"});if(!a.ok)throw new Error(`Could not ${e} scheduled curation (${a.status}).`)}export{l as A,b as a,w as b,C as c,m as d,f as e,k as f,y as g,v as h,h as i,S as j,p as k,E as l,u as p,j as r,x as s}; diff --git a/assets/colors-C6t5MKud.js b/assets/colors-YtiKVy3X.js similarity index 99% rename from assets/colors-C6t5MKud.js rename to assets/colors-YtiKVy3X.js index b94960188cb84cd467cd245424ff46ed7481c749..40cd1777163fa5fd95a771810b65475fe82850e2 100644 --- a/assets/colors-C6t5MKud.js +++ b/assets/colors-YtiKVy3X.js @@ -1 +1 @@ -import{V as _}from"./index-CA09r0fx.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 I=6048e5,z=864e5,A=6e4,R=36e5;let V={};function W(){return V}function v(t,e){var s,u,l,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=(l=n.locale)==null?void 0:l.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 C(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:C({formats:at,defaultWidth:"full"}),time:C({formats:it,defaultWidth:"full"}),dateTime:C({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 l;l=t.valueCallback?t.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const f=e.slice(o.length);return{value:l,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]},Ct={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},Nt={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:Ct,defaultMatchWidth:"any",parsePatterns:Nt,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/I)+1}function Q(t,e){var f,g,d,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=(d=a.locale)==null?void 0:d.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 l=v(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function Ut(t,e){var s,u,l,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=(l=n.locale)==null?void 0:l.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/I)+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))},It={p:X,P:Ht},At=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return At.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,d,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=(d=r.locale)==null?void 0:d.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=It[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 l={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,l)}).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),l=new Date(0);return l.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),l.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),l}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 l=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(l.setUTCFullYear(e,i,Math.max(a,o)),l)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*A+a*1e3:NaN}function N(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*A):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 pe(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(d=>d.slug||"").filter(Boolean),u=(t.methods||[]).map(d=>({id:d.id,name:d.name,slug:d.slug})),l=(t.leaderboard_ranks||[]).filter(d=>d.best_rank>=1&&d.best_rank<=3).map(d=>({name:d.dataset_name,slug:d.dataset_slug||null,rank:d.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],authorIds:(t.author_links||[]).map(d=>d.id??null),authorHfProfiles:(t.author_links||[]).map(d=>d.hf_username?{username:d.hf_username,avatarUrl:d.hf_avatar_url??null}:null),tags:s,methods:u,organizations:(t.organizations||[]).map(d=>({name:d.name,slug:d.slug,logoUrl:_(d.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:l}}function ke(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 ve(t,e){const n=t||ke(e||""),r=$.get((e==null?void 0:e.toLowerCase())||Oe(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.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()).replace(/\b[A-Za-z0-9]+\b/g,s=>T.has(s.toUpperCase())?s.toUpperCase():s)}function Oe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}function xe(t){let e=2166136261;const n=t||"";for(let r=0;r=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 C(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:C({formats:at,defaultWidth:"full"}),time:C({formats:it,defaultWidth:"full"}),dateTime:C({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 l;l=t.valueCallback?t.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const f=e.slice(o.length);return{value:l,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]},Ct={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},Nt={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:Ct,defaultMatchWidth:"any",parsePatterns:Nt,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/I)+1}function Q(t,e){var f,g,d,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=(d=a.locale)==null?void 0:d.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 l=v(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function Ut(t,e){var s,u,l,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=(l=n.locale)==null?void 0:l.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/I)+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))},It={p:X,P:Ht},At=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return At.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,d,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=(d=r.locale)==null?void 0:d.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=It[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 l={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,l)}).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),l=new Date(0);return l.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),l.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),l}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 l=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(l.setUTCFullYear(e,i,Math.max(a,o)),l)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*A+a*1e3:NaN}function N(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*A):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 pe(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(d=>d.slug||"").filter(Boolean),u=(t.methods||[]).map(d=>({id:d.id,name:d.name,slug:d.slug})),l=(t.leaderboard_ranks||[]).filter(d=>d.best_rank>=1&&d.best_rank<=3).map(d=>({name:d.dataset_name,slug:d.dataset_slug||null,rank:d.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],authorIds:(t.author_links||[]).map(d=>d.id??null),authorHfProfiles:(t.author_links||[]).map(d=>d.hf_username?{username:d.hf_username,avatarUrl:d.hf_avatar_url??null}:null),tags:s,methods:u,organizations:(t.organizations||[]).map(d=>({name:d.name,slug:d.slug,logoUrl:_(d.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:l}}function ke(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 ve(t,e){const n=t||ke(e||""),r=$.get((e==null?void 0:e.toLowerCase())||Oe(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.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()).replace(/\b[A-Za-z0-9]+\b/g,s=>T.has(s.toUpperCase())?s.toUpperCase():s)}function Oe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}function xe(t){let e=2166136261;const n=t||"";for(let r=0;rt!=null&&t.startsWith("https://")&&!t.startsWith("https://huggingface.co/avatars/")?t:null,K=({url:t,className:s,href:r,label:a})=>{const[x,l]=E.useState(!1),h=x?null:O(t);if(!h)return null;const i=e.jsx("img",{className:`author-avatar-base ${s}`,src:h,alt:"",loading:"lazy",onError:()=>l(!0)});return r?e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer","aria-label":a,children:i}):i},U=({slug:t,label:s,onClick:r})=>{const a=S(),x=H(t),l=G(x),h=i=>{if(i.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:l.bg,color:l.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),B(s||D(t),t)]})},_=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const x=l=>{if(l.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=m.useRef(null),a=m.useRef(null),[x,l]=m.useState(t.length);if(m.useLayoutEffect(()=>{const n=r.current,g=a.current;if(!n||!g||t.length===0)return;const f=d=>(g.textContent=d,g.scrollWidth),j=()=>{const d=n.clientWidth;if(d<=0)return;let c=0,u=0;for(const y of t){const p=f(y.measureText);if(c+p<=d)c+=p,u+=1;else break}if(u0&&c+f(` · +${t.length-u} more`)>d;)u-=1,c-=f(t[u].measureText);u===0&&(u=1)}l(u)};j();const o=new ResizeObserver(j);return o.observe(n),()=>o.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,g)=>e.jsxs(m.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[g>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:$[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:f=>f.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${g}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},V=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=m.useMemo(()=>{const l=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(g=>g.rank===i);n.forEach((g,f)=>{const j=f===0,o=j?`${h?"":" · "}${$[i]} on `:", ";l.push({name:g.name,slug:g.slug,rank:i,isGroupStart:j,measureText:o+g.name})}),n.length>0&&(h=!1)}return l},[t]),x=m.useMemo(()=>[1,2,3].map(l=>t.filter(i=>i.rank===l).map((i,n)=>({name:i.name,slug:i.slug,rank:l,isGroupStart:n===0,measureText:(n===0?`${$[l]} on `:", ")+i.name}))).filter(l=>l.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(l=>e.jsx(F,{units:l,paperHref:s},l[0].rank))}):a.length===0?null:e.jsx(F,{units:a,paperHref:s})},q=({name:t,size:s=14})=>{const r={search:e.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:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.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:e.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:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.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:e.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:e.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:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},Y=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.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"}),e.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"}),e.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"}),e.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"}),e.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"}),e.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"}),e.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"}),e.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"}),e.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"})]}),Q=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)},J=({paperId:t})=>{const s=Q(t),r=160,a=220,x=[.85+s()*.1,.55+s()*.25],l=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let v=0;v.3,g=Math.floor(s()*3),f=[],j=6+Math.floor(s()*3);for(let v=0;ve.jsx("rect",{x:c+(r-c*2)*(1-v)/2,y:A+M*2.4,width:(r-c*2)*v,height:1.4,fill:d,rx:.3},`t${M}`)),e.jsx("rect",{x:c+(r-c*2)*(1-l)/2,y:W,width:(r-c*2)*l,height:.9,fill:o,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:z,width:6,height:1,fill:d,opacity:.6}),h.map((v,M)=>{const C=k+M*2.1;return C>a-c-1?null:e.jsx("rect",{x:y,y:C,width:u*v,height:.8,fill:o,opacity:.55,rx:.2},`l${M}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:k,width:u,height:14,fill:"#F0EBE0",stroke:o,strokeWidth:.3,opacity:.9}),g===0&&e.jsx("g",{stroke:d,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${k+11} ${p+6},${k+8} ${p+10},${k+9} ${p+14},${k+5} ${p+18},${k+6} ${p+22},${k+3}`})}),g===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+u/2,cy:k+7,r:3.5,fill:d}),e.jsx("rect",{x:p+2,y:k+11,width:u-4,height:1.5,fill:o})]}),g===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:k+5,width:u-6,height:1,fill:d}),e.jsx("rect",{x:p+6,y:k+8,width:u-12,height:.8,fill:d})]})]}),f.map((v,M)=>{const C=k+(n?16:0)+M*2.1;return C>a-c-1?null:e.jsx("rect",{x:p,y:C,width:u*v,height:.8,fill:o,opacity:.55,rx:.2},`r${M}`)})]})})},X=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[x,l]=m.useState(!1),[h,i]=m.useState(0),[n,g]=m.useState(a),f=m.useRef(null);m.useEffect(()=>{l(!1),i(0)},[r]);const j=m.useMemo(()=>{if(!r)return null;if(h===0)return r;const o=r.includes("?")?"&":"?";return`${r}${o}retry=${h}`},[r,h]);return m.useEffect(()=>{if(a||n)return;const o=f.current;if(!o)return;const d=new IntersectionObserver(([c])=>{c.isIntersecting&&(g(!0),d.disconnect())},{rootMargin:"250px"});return d.observe(o),()=>d.disconnect()},[a,n]),r&&!x?e.jsx("div",{ref:f,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)&&j&&e.jsx("img",{src:j,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(h<1){i(o=>o+1);return}l(!0)}},j)}):e.jsx(J,{paperId:t})};function ee(t){const s=[...new Set(t.map(a=>a.replace(/ \(subtask\)$/,"")))],r=s.length>3?[...s.slice(0,2),`${s.length-2} more`]:s;return r.length>1?`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`:r[0]}const te="language-modeling";function w(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function se(t){return w(t.slug)==="large language model"||w(t.name)==="large language model"}function re(t){return t.tags.includes(te)?t.methods.filter(s=>!se(s)):t.methods}const oe=({name:t,slug:s,logoUrl:r})=>{const[a,x]=m.useState(!1);return!r||a?null:e.jsx(L,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>x(!0)})})},ue=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a,highlightQuery:x,followReasons:l})=>{const h=R(),i=`/paper/${t.id}`,n=m.useCallback(()=>{h.prefetchQuery({queryKey:T.detail(t.id),queryFn:()=>I.get(t.id,!0),staleTime:10*60*1e3})},[t.id,h]),g=t.authors.slice(0,3).map((o,d)=>{var y,p;const c=(y=t.authorIds)==null?void 0:y[d],u=(p=t.authorHfProfiles)==null?void 0:p[d];return e.jsxs(m.Fragment,{children:[d>0&&", ",u&&e.jsx(K,{className:"paper-card-author-avatar",url:u.avatarUrl}),c?e.jsx(L,{to:`/authors/${c}`,children:o}):o]},d)}),f=t.authors.length,j=re(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:i,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:e.jsx(X,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[l&&l.length>0&&e.jsxs("div",{className:"paper-follow-reason",children:["Because you follow ",ee(l)]}),e.jsxs("h3",{className:"paper-title",children:[e.jsx(L,{to:i,onFocus:n,onMouseEnter:n,children:e.jsx(P,{title:t.title,highlight:x})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(o=>e.jsx(oe,{...o},o.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[g,f>3&&e.jsxs("span",{children:[", ","+",f-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[f>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[f>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(Z,{text:t.abstract,highlight:x})}),t.sotaRanks.length>0&&e.jsx(V,{ranks:t.sotaRanks,paperHref:i}),(t.tags.length>0||j.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(o=>e.jsx(U,{slug:o,onClick:a},o)),j.map(o=>e.jsx(_,{method:o},o.id||o.slug||o.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[N(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:o=>o.stopPropagation(),children:[e.jsx(q,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),ne(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),N(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:o=>o.stopPropagation(),children:[e.jsx(Y,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function ne(t){return t.toFixed(1)}export{K as A,q as I,_ as M,ue as P,V as S,U as T,X as a}; +import{r as E,j as e,m as R,F as m,L,b as S}from"./index-DGz7IJy3.js";import{p as T}from"./paperQueryKeys-BP2E-0yf.js";import{L as P,a as Z}from"./LatexTitle-DtD88QQA.js";import{h as H,d as B,a as D,c as G}from"./colors-YtiKVy3X.js";import{p as I}from"./papers-CgK5TA59.js";import{s as N}from"./safeExternalHref-CkBrsh84.js";const O=t=>t!=null&&t.startsWith("https://")&&!t.startsWith("https://huggingface.co/avatars/")?t:null,K=({url:t,className:s,href:r,label:a})=>{const[x,l]=E.useState(!1),h=x?null:O(t);if(!h)return null;const i=e.jsx("img",{className:`author-avatar-base ${s}`,src:h,alt:"",loading:"lazy",onError:()=>l(!0)});return r?e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer","aria-label":a,children:i}):i},U=({slug:t,label:s,onClick:r})=>{const a=S(),x=H(t),l=G(x),h=i=>{if(i.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:l.bg,color:l.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),B(s||D(t),t)]})},_=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const x=l=>{if(l.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=m.useRef(null),a=m.useRef(null),[x,l]=m.useState(t.length);if(m.useLayoutEffect(()=>{const n=r.current,g=a.current;if(!n||!g||t.length===0)return;const f=d=>(g.textContent=d,g.scrollWidth),j=()=>{const d=n.clientWidth;if(d<=0)return;let c=0,u=0;for(const y of t){const p=f(y.measureText);if(c+p<=d)c+=p,u+=1;else break}if(u0&&c+f(` · +${t.length-u} more`)>d;)u-=1,c-=f(t[u].measureText);u===0&&(u=1)}l(u)};j();const o=new ResizeObserver(j);return o.observe(n),()=>o.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,g)=>e.jsxs(m.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[g>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:$[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:f=>f.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${g}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},V=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=m.useMemo(()=>{const l=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(g=>g.rank===i);n.forEach((g,f)=>{const j=f===0,o=j?`${h?"":" · "}${$[i]} on `:", ";l.push({name:g.name,slug:g.slug,rank:i,isGroupStart:j,measureText:o+g.name})}),n.length>0&&(h=!1)}return l},[t]),x=m.useMemo(()=>[1,2,3].map(l=>t.filter(i=>i.rank===l).map((i,n)=>({name:i.name,slug:i.slug,rank:l,isGroupStart:n===0,measureText:(n===0?`${$[l]} on `:", ")+i.name}))).filter(l=>l.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(l=>e.jsx(F,{units:l,paperHref:s},l[0].rank))}):a.length===0?null:e.jsx(F,{units:a,paperHref:s})},q=({name:t,size:s=14})=>{const r={search:e.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:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.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:e.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:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.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:e.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:e.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:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},Y=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.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"}),e.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"}),e.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"}),e.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"}),e.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"}),e.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"}),e.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"}),e.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"}),e.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"})]}),Q=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)},J=({paperId:t})=>{const s=Q(t),r=160,a=220,x=[.85+s()*.1,.55+s()*.25],l=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let v=0;v.3,g=Math.floor(s()*3),f=[],j=6+Math.floor(s()*3);for(let v=0;ve.jsx("rect",{x:c+(r-c*2)*(1-v)/2,y:A+M*2.4,width:(r-c*2)*v,height:1.4,fill:d,rx:.3},`t${M}`)),e.jsx("rect",{x:c+(r-c*2)*(1-l)/2,y:W,width:(r-c*2)*l,height:.9,fill:o,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:z,width:6,height:1,fill:d,opacity:.6}),h.map((v,M)=>{const C=k+M*2.1;return C>a-c-1?null:e.jsx("rect",{x:y,y:C,width:u*v,height:.8,fill:o,opacity:.55,rx:.2},`l${M}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:k,width:u,height:14,fill:"#F0EBE0",stroke:o,strokeWidth:.3,opacity:.9}),g===0&&e.jsx("g",{stroke:d,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${k+11} ${p+6},${k+8} ${p+10},${k+9} ${p+14},${k+5} ${p+18},${k+6} ${p+22},${k+3}`})}),g===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+u/2,cy:k+7,r:3.5,fill:d}),e.jsx("rect",{x:p+2,y:k+11,width:u-4,height:1.5,fill:o})]}),g===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:k+5,width:u-6,height:1,fill:d}),e.jsx("rect",{x:p+6,y:k+8,width:u-12,height:.8,fill:d})]})]}),f.map((v,M)=>{const C=k+(n?16:0)+M*2.1;return C>a-c-1?null:e.jsx("rect",{x:p,y:C,width:u*v,height:.8,fill:o,opacity:.55,rx:.2},`r${M}`)})]})})},X=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[x,l]=m.useState(!1),[h,i]=m.useState(0),[n,g]=m.useState(a),f=m.useRef(null);m.useEffect(()=>{l(!1),i(0)},[r]);const j=m.useMemo(()=>{if(!r)return null;if(h===0)return r;const o=r.includes("?")?"&":"?";return`${r}${o}retry=${h}`},[r,h]);return m.useEffect(()=>{if(a||n)return;const o=f.current;if(!o)return;const d=new IntersectionObserver(([c])=>{c.isIntersecting&&(g(!0),d.disconnect())},{rootMargin:"250px"});return d.observe(o),()=>d.disconnect()},[a,n]),r&&!x?e.jsx("div",{ref:f,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)&&j&&e.jsx("img",{src:j,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(h<1){i(o=>o+1);return}l(!0)}},j)}):e.jsx(J,{paperId:t})};function ee(t){const s=[...new Set(t.map(a=>a.replace(/ \(subtask\)$/,"")))],r=s.length>3?[...s.slice(0,2),`${s.length-2} more`]:s;return r.length>1?`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`:r[0]}const te="language-modeling";function w(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function se(t){return w(t.slug)==="large language model"||w(t.name)==="large language model"}function re(t){return t.tags.includes(te)?t.methods.filter(s=>!se(s)):t.methods}const oe=({name:t,slug:s,logoUrl:r})=>{const[a,x]=m.useState(!1);return!r||a?null:e.jsx(L,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>x(!0)})})},ue=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a,highlightQuery:x,followReasons:l})=>{const h=R(),i=`/paper/${t.id}`,n=m.useCallback(()=>{h.prefetchQuery({queryKey:T.detail(t.id),queryFn:()=>I.get(t.id,!0),staleTime:10*60*1e3})},[t.id,h]),g=t.authors.slice(0,3).map((o,d)=>{var y,p;const c=(y=t.authorIds)==null?void 0:y[d],u=(p=t.authorHfProfiles)==null?void 0:p[d];return e.jsxs(m.Fragment,{children:[d>0&&", ",u&&e.jsx(K,{className:"paper-card-author-avatar",url:u.avatarUrl}),c?e.jsx(L,{to:`/authors/${c}`,children:o}):o]},d)}),f=t.authors.length,j=re(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:i,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:e.jsx(X,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[l&&l.length>0&&e.jsxs("div",{className:"paper-follow-reason",children:["Because you follow ",ee(l)]}),e.jsxs("h3",{className:"paper-title",children:[e.jsx(L,{to:i,onFocus:n,onMouseEnter:n,children:e.jsx(P,{title:t.title,highlight:x})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(o=>e.jsx(oe,{...o},o.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[g,f>3&&e.jsxs("span",{children:[", ","+",f-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[f>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[f>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(Z,{text:t.abstract,highlight:x})}),t.sotaRanks.length>0&&e.jsx(V,{ranks:t.sotaRanks,paperHref:i}),(t.tags.length>0||j.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(o=>e.jsx(U,{slug:o,onClick:a},o)),j.map(o=>e.jsx(_,{method:o},o.id||o.slug||o.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[N(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:o=>o.stopPropagation(),children:[e.jsx(q,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),ne(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),N(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:o=>o.stopPropagation(),children:[e.jsx(Y,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function ne(t){return t.toFixed(1)}export{K as A,q as I,_ as M,ue as P,V as S,U as T,X as a}; diff --git a/assets/copy-BRZnlAd3.js b/assets/copy-CDHIGRQI.js similarity index 89% rename from assets/copy-BRZnlAd3.js rename to assets/copy-CDHIGRQI.js index 8c8ac2e830ba3521e45c99a875757d9c709f4c60..abe71cdefac3c208cf47bd18b71aed0a497fc36c 100644 --- a/assets/copy-BRZnlAd3.js +++ b/assets/copy-CDHIGRQI.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-CA09r0fx.js";/** +import{g as e}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/database-CzCP8SRb.js b/assets/database-7GRYiOb3.js similarity index 89% rename from assets/database-CzCP8SRb.js rename to assets/database-7GRYiOb3.js index c01cf04a77e668c5de0c8c28ffc9ff3273f92ad3..d34191c4a1288a69feb445078177d234dad7e6d7 100644 --- a/assets/database-CzCP8SRb.js +++ b/assets/database-7GRYiOb3.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-CA09r0fx.js";/** +import{g as e}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/dialog-BMl1SbyK.js b/assets/dialog-DRb-cMlG.js similarity index 96% rename from assets/dialog-BMl1SbyK.js rename to assets/dialog-DRb-cMlG.js index 257b279f3df1dd5f20d733a77332c83a50b99e09..a9ad6456b67bd6b543a56e3634afe2b869607239 100644 --- a/assets/dialog-BMl1SbyK.js +++ b/assets/dialog-DRb-cMlG.js @@ -1 +1 @@ -import{a5 as f,r as l,j as t,a6 as p,a8 as d,aa as g,X as x,x as o,ab as n,ac as i,a7 as r}from"./index-CA09r0fx.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{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=r.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(n,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=n.displayName;const b=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=i.displayName;export{w as D,y as a,N as b,D as c,b as d,j as e}; +import{a5 as f,r as l,j as t,a6 as p,a8 as d,aa as g,X as x,x as o,ab as n,ac as i,a7 as r}from"./index-DGz7IJy3.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{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=r.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(n,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=n.displayName;const b=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=i.displayName;export{w as D,y as a,N as b,D as c,b as d,j as e}; diff --git a/assets/earth-gRrLiaVn.js b/assets/earth-BQV4xejs.js similarity index 92% rename from assets/earth-gRrLiaVn.js rename to assets/earth-BQV4xejs.js index 2f32ebbda9e55669a868c3ad7e720f3ec0433865..d52bba43626af4c20f2c5556a1cd39e61b7d3aa8 100644 --- a/assets/earth-gRrLiaVn.js +++ b/assets/earth-BQV4xejs.js @@ -1,4 +1,4 @@ -import{g as a}from"./index-CA09r0fx.js";/** +import{g as a}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/external-link-b6zNfUPN.js b/assets/external-link-ChfVBxLK.js similarity index 89% rename from assets/external-link-b6zNfUPN.js rename to assets/external-link-ChfVBxLK.js index 8b6d973695bbe88bb1acbcaf43cd328c0320c8c5..226376ecc8a3d3ba0b78e0abcb26e1a59b7fdc33 100644 --- a/assets/external-link-b6zNfUPN.js +++ b/assets/external-link-ChfVBxLK.js @@ -1,4 +1,4 @@ -import{g as a}from"./index-CA09r0fx.js";/** +import{g as a}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-7GwUpKU3.js b/assets/file-text-BHDe9k9N.js similarity index 91% rename from assets/file-text-7GwUpKU3.js rename to assets/file-text-BHDe9k9N.js index 4bfad0167c6ed443691ac0d1c6ce3a8148a3132b..9be255830911058fd7decbcf26f0756ec7395a1c 100644 --- a/assets/file-text-7GwUpKU3.js +++ b/assets/file-text-BHDe9k9N.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-CA09r0fx.js";/** +import{g as e}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-Cto4qly3.js b/assets/github-BBO8LC-h.js similarity index 97% rename from assets/github-Cto4qly3.js rename to assets/github-BBO8LC-h.js index 8f44bfec4555a6486120f088ebbd0deab866f533..e5d3f37c115f57a556eb21e4175f5b496d1bd16e 100644 --- a/assets/github-Cto4qly3.js +++ b/assets/github-BBO8LC-h.js @@ -1,4 +1,4 @@ -import{g as l,K as u}from"./index-CA09r0fx.js";/** +import{g as l,K as u}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-D8NiZH3t.js b/assets/github-DcSqeKOx.js similarity index 92% rename from assets/github-D8NiZH3t.js rename to assets/github-DcSqeKOx.js index b37279fab1d3965ea2284a7e07bb6b8b802a6fb1..c4f674e7f997558433c645b75c759573f211ecc4 100644 --- a/assets/github-D8NiZH3t.js +++ b/assets/github-DcSqeKOx.js @@ -1,4 +1,4 @@ -import{g as c}from"./index-CA09r0fx.js";/** +import{g as c}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/globe-CfxFS7Am.js b/assets/globe-_StJzQkx.js similarity index 89% rename from assets/globe-CfxFS7Am.js rename to assets/globe-_StJzQkx.js index b36a978e04335aca34c5e1e6f0bb230cb87cf223..be9646afdf71f9bb08c2ca075d9f43cc00e85fce 100644 --- a/assets/globe-CfxFS7Am.js +++ b/assets/globe-_StJzQkx.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-CA09r0fx.js";/** +import{g as e}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-0saQl8Kd.js b/assets/hover-card-32Q2qmuv.js similarity index 98% rename from assets/hover-card-0saQl8Kd.js rename to assets/hover-card-32Q2qmuv.js index 800af5d7859db1b16bbfbc84d4ec4b1bcd8f1336..ced9a17d6ca223c74ec5cbc70848503f1b9d24c6 100644 --- a/assets/hover-card-0saQl8Kd.js +++ b/assets/hover-card-32Q2qmuv.js @@ -1 +1 @@ -import{r as n,q as k,j as c,ae as F,af as I,p as U,t as l,ag as T,P as O,ah as $,w as W,s as z,am as B,an as G,ao as K,x as q}from"./index-CA09r0fx.js";var E,w="HoverCard",[y]=W(w,[T]),b=T(),[V,S]=y(w),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=b(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=k({prop:s,defaultProp:a??!1,onChange:i,caller:w}),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]),M=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=w;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=b(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,g(a.onOpen)),onPointerLeave:l(e.onPointerLeave,g(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,i=S(H,o);return c.jsx(J,{scope:o,forceMount:r,children:c.jsx(O,{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(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,g(i.onOpen)),onPointerLeave:l(e.onPointerLeave,g(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=b(r),u=n.useRef(null),h=z(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(B,{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=b(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function g(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:q("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}; +import{r as n,q as k,j as c,ae as F,af as I,p as U,t as l,ag as T,P as O,ah as $,w as W,s as z,am as B,an as G,ao as K,x as q}from"./index-DGz7IJy3.js";var E,w="HoverCard",[y]=W(w,[T]),b=T(),[V,S]=y(w),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=b(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=k({prop:s,defaultProp:a??!1,onChange:i,caller:w}),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]),M=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=w;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=b(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,g(a.onOpen)),onPointerLeave:l(e.onPointerLeave,g(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,i=S(H,o);return c.jsx(J,{scope:o,forceMount:r,children:c.jsx(O,{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(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,g(i.onOpen)),onPointerLeave:l(e.onPointerLeave,g(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=b(r),u=n.useRef(null),h=z(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(B,{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=b(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function g(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:q("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-1y8ilIyE.js b/assets/index-Bx9aRYc1.js similarity index 72% rename from assets/index-1y8ilIyE.js rename to assets/index-Bx9aRYc1.js index 5addfeb78ebc0994fcae9b9d56f81968a502a026..3359d8ee7791b1fd96210d99ed89fc57369ef6b7 100644 --- a/assets/index-1y8ilIyE.js +++ b/assets/index-Bx9aRYc1.js @@ -1 +1 @@ -import{r as u}from"./index-CA09r0fx.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-DGz7IJy3.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-qKrWNpd1.js b/assets/index-CEcXuWDB.js similarity index 99% rename from assets/index-qKrWNpd1.js rename to assets/index-CEcXuWDB.js index 4e8a24360cdfda0c56e1f9e31da0bbc1945c3b0b..4967079337c9dd390ee296cb519e3780751a2f89 100644 --- a/assets/index-qKrWNpd1.js +++ b/assets/index-CEcXuWDB.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-BeqN5AbC.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-DyDOGuaE.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-BT467XuQ.js","assets/useQuery-SnJNmisF.js","assets/useMutation-B1oRtfbH.js","assets/button-DEdvni-v.js","assets/paperEdits-BtAPUkKl.js","assets/FollowingView-CwCG1Am-.js","assets/FeedView-DmNv9H2e.js","assets/colors-YtiKVy3X.js","assets/mail-Dydp9Gj0.js","assets/plus-v7R1dHou.js","assets/research-C0oNhyj8.js","assets/components-C75Gxt6c.js","assets/paperQueryKeys-BP2E-0yf.js","assets/LatexTitle-DtD88QQA.js","assets/papers-CgK5TA59.js","assets/safeExternalHref-CkBrsh84.js","assets/components-o5W6pl_W.css","assets/chatPrompts-BwvjFuiO.js","assets/AgentLogos-RDfL-mz2.js","assets/PaperFeedFilters-BIXkRwGe.js","assets/PaperDateFilter-C6KBd0r-.js","assets/popover-VInL7Z23.js","assets/chatLaunch-DVedsuWi.js","assets/chat-C_06RcUY.js","assets/chevron-down-CzLvLwcd.js","assets/earth-BQV4xejs.js","assets/catalog-CI50zqwR.js","assets/usePapers-knk68Pd9.js","assets/useInfiniteQuery-Bix5WR2s.js","assets/useIntersectionObserver-B7kBuOiP.js","assets/skeleton-Qth9DQSW.js","assets/alert-CfvggGdB.js","assets/ChatView-BWOmR-sr.js","assets/ArtifactWorkspace-DI-cB4-t.js","assets/hover-card-32Q2qmuv.js","assets/github-BBO8LC-h.js","assets/github-DcSqeKOx.js","assets/file-text-BHDe9k9N.js","assets/PaperPreviewLink-DUJYnY2B.js","assets/index-DyDOGuaE.js","assets/index-CEcXuWDB.js","assets/katex-DkKDou_j.js","assets/copy-CDHIGRQI.js","assets/thumbs-up-C5Gnbt6N.js","assets/external-link-ChfVBxLK.js","assets/ArtifactWorkspace-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/share-2-Byoooou-.js","assets/openrouter-yE0IuBaT.js","assets/queryOptions-C9woPjwX.js","assets/SharedChatView-rTXZ7eaT.js","assets/PapersListView-DmAF2yfX.js","assets/useDebounce-CZ3fZlNX.js","assets/PaperDetailView-CeJ8lQ5x.js","assets/ExternalSourceEvalBadge-ChPSpdTg.js","assets/ExternalSourceEvalBadge-DXfuqNnO.css","assets/paperReader-BIpQD5HO.js","assets/latexPlainText-DI8YEXVe.js","assets/dialog-DRb-cMlG.js","assets/input-DVdOE4Xl.js","assets/searchable-select-C2BNEPyI.js","assets/loader-circle-DZdOKwBN.js","assets/submissions-0YkeXTxt.js","assets/evaluationQueryInvalidation-CC5JhGiX.js","assets/SignInToEditDialog-POB2dswN.js","assets/textarea-BC6nB3vb.js","assets/database-7GRYiOb3.js","assets/index-Bx9aRYc1.js","assets/badge-CE-3yZlW.js","assets/globe-_StJzQkx.js","assets/codexAddEvals-BRqTpMyJ.js","assets/savedPapersAuth-BLCvmsFl.js","assets/PaperDetailView-gEwMf3J2.css","assets/PaperReaderView-B5hOVSoX.js","assets/MarkdownText-CswmrT4z.js","assets/TagsIndexView-CHHNusue.js","assets/slug-BpH-Nkvz.js","assets/triangle-alert-C4uGz6dq.js","assets/trending-up-E7e_PcEb.js","assets/moon-BTUByzSL.js","assets/trophy-B1w2ILFe.js","assets/activity-zaQ-sruD.js","assets/TaxonomySuggestionTile-BM3W4_sv.js","assets/TaxonomyTrending-DZnt22Vd.js","assets/TagBrowseView-Bdloff_M.js","assets/ResearchFollowButton-_BF37169.js","assets/arrow-right-B6-s6W60.js","assets/BenchmarkTrendSparkline-CT9c4wG-.js","assets/MethodsIndexView-CwAFmNPM.js","assets/FrameworksIndexView-BHbIG7KF.js","assets/TrendsView-VYiOkhSO.js","assets/ConferencesIndexView-DKn6lpPt.js","assets/AiDeadlinesView-DFDzpADq.js","assets/switch-CwjWc_fX.js","assets/ConferenceDetailView-B6czFOLF.js","assets/ConferenceTaskView-WdW5o_l9.js","assets/OrganizationsIndexView-CvT2PFcr.js","assets/OrganizationsIndexView-dniuSNch.css","assets/OrganizationDetailView-DejGNmp9.js","assets/OrganizationPaperFeed-BEfCIaxI.js","assets/OrganizationContributionGraph-hzEKhL7-.js","assets/NotFound-CK9eyj2q.js","assets/OrganizationTaskView-DqRaxVTK.js","assets/AuthorDetailView-bU4ydLti.js","assets/MethodDetailView-BesJdFsW.js","assets/BenchmarkDetailView-D9CMxLQx.js","assets/BenchmarkDetailView-qL8oJ-Im.css","assets/SavedPapersView-Cz0s6dJz.js","assets/SettingsView-Bk7rZu9X.js","assets/PrivacyView-BY3HWUzu.js","assets/ApiDocsView-CArow2ru.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-D287q6AU.js","assets/McpView-EGeqkP46.css","assets/SubmitView-DOOIhPRA.js","assets/CronDashboard-ax5sO8xp.js","assets/operations-C37-eWov.js","assets/shield-alert-BJn-Krlm.js","assets/refresh-cw-By5_OblM.js","assets/circle-check-vSqohmZs.js","assets/CronDashboard-DwChfW9h.css","assets/AutonomousOperations-BTR1Cddl.js","assets/SubmissionsDashboard-CVsy2Di_.js","assets/SubmissionsDashboard-2iSRk_ue.css","assets/UserProfileView-DCfF3CNW.js","assets/RateLimitsView-ksu7TvSj.js","assets/AstraForRoboticsView-CJuXw7rp.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-C1MdC-eB.js","assets/StagingAccessRequestView-_VYsleyo.js"])))=>i.map(i=>d[i]); var tP=Object.defineProperty;var vm=t=>{throw TypeError(t)};var nP=(t,e,n)=>e in t?tP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Fr=(t,e,n)=>nP(t,typeof e!="symbol"?e+"":e,n),jd=(t,e,n)=>e.has(t)||vm("Cannot "+n);var A=(t,e,n)=>(jd(t,e,"read from private field"),n?n.call(t):e.get(t)),fe=(t,e,n)=>e.has(t)?vm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ne=(t,e,n,r)=>(jd(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ut=(t,e,n)=>(jd(t,e,"access private method"),n);var Rl=(t,e,n,r)=>({set _(s){ne(t,e,s,n)},get _(){return A(t,e,r)}});function rP(t,e){for(var n=0;nr[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Zz=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function iw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ow={exports:{}},Wc={},aw={exports:{}},de={};/** * @license React * react.production.min.js @@ -160,4 +160,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 cD=Id("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),dD=tD,fD=nD,hD=g.forwardRef(({className:t,inset:e,children:n,...r},s)=>w.jsxs(ik,{ref:s,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(lD,{className:"ml-auto h-4 w-4"})]}));hD.displayName=ik.displayName;const pD=g.forwardRef(({className:t,...e},n)=>w.jsx(ok,{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}));pD.displayName=ok.displayName;const lk=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(rD,{children:w.jsx(JC,{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})}));lk.displayName=JC.displayName;const lr=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(ek,{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}));lr.displayName=ek.displayName;const vD=g.forwardRef(({className:t,children:e,checked:n,...r},s)=>w.jsxs(tk,{ref:s,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(rk,{children:w.jsx(aD,{className:"h-4 w-4"})})}),e]}));vD.displayName=tk.displayName;const gD=g.forwardRef(({className:t,children:e,...n},r)=>w.jsxs(nk,{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(rk,{children:w.jsx(uD,{className:"h-2 w-2 fill-current"})})}),e]}));gD.displayName=nk.displayName;const uk=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(ZC,{ref:r,className:at("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));uk.displayName=ZC.displayName;const sv=g.forwardRef(({className:t,...e},n)=>w.jsx(sk,{ref:n,className:at("-mx-1 my-1 h-px bg-muted",t),...e}));sv.displayName=sk.displayName;function mD(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 yD=({user:t,onLogout:e})=>w.jsxs(dD,{children:[w.jsx(fD,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:w.jsxs(AS,{className:"h-8 w-8",children:[t.avatar_url&&w.jsx($S,{src:t.avatar_url,alt:t.username}),w.jsx(LS,{className:"text-xs",children:mD(t)})]})})}),w.jsxs(lk,{align:"end",className:"w-56",children:[w.jsxs(uk,{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(sv,{}),w.jsx(lr,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/frameworks",children:"Frameworks"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/trends",children:"Trends"})}),t.is_admin&&w.jsxs(w.Fragment,{children:[w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/admin-dashboard",children:"Admin dashboard"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/submissions",children:"Review submissions"})})]}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/settings",children:"Settings"})}),w.jsx(sv,{}),w.jsx(lr,{onSelect:n=>{n.preventDefault(),e()},children:"Log out"})]})]}),_D="cronAdminToken";function wD(){var t;return typeof window>"u"?"":((t=window.localStorage.getItem(_D))==null?void 0:t.trim())??""}const xD=!1;class sm extends Error{constructor(n,r){var s;super(`API request failed: ${n.status} ${n.statusText}`);Fr(this,"status");Fr(this,"statusText");Fr(this,"response");Fr(this,"detail");Fr(this,"code");Fr(this,"displayMessage");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(s=JSON.parse(r))==null?void 0:s.detail,typeof this.detail=="string"&&(this.message=this.detail),Array.isArray(this.detail)){const i=this.detail[0];typeof i=="object"&&i!==null&&"msg"in i&&typeof i.msg=="string"&&(this.message=i.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 i="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${i}`}}catch{this.detail=void 0,this.displayMessage=r||this.message;return}this.displayMessage=this.message}}function g4(t,e){return t instanceof sm?t.displayMessage||e:typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"&&t.message||e}class bD{constructor(e){this.baseUrl=e}async fetch(e,n){const r=`${this.baseUrl}${e}`;try{const{headers:s,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=wD(),u=new Headers(s);return u.has("Content-Type")||u.set("Content-Type","application/json"),l&&!u.has("X-Admin-Token")&&u.set("X-Admin-Token",l),await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:u})}catch(s){throw console.error(`[API] Request to ${r} failed:`,s),s}}async request(e,n){const r=await this.fetch(e,n);if(!r.ok){const i=new sm(r,await r.text());throw console.error("[API] Error response:",i.response),i}return r.status===204?void 0:await r.json()}}function ED(t){t instanceof sm&&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 SD(t){try{return await t()}catch(e){throw ED(e),e}}const ck=new bD(`${jg()}/api/v1`),CD=(t,e)=>ck.fetch(t,e),iv=(t,e)=>SD(()=>ck.request(t,e)),$0={async getCurrentUser(){if(jo())return null;const t=await CD("/auth/me",{cache:"no-store"});return t.status===401||!t.ok?null:t.json()},async logout(){await iv("/auth/logout",{method:"POST"})},async requestStagingAccess(){await iv("/staging-access-request",{method:"POST"})}},im=R.createContext(null),L0="pwc:auth-stale",kD=({children:t})=>{const[e,n]=R.useState(null),[r,s]=R.useState(!0),i=R.useCallback(async()=>{s(!0);const l=await $0.getCurrentUser();n(l),s(!1)},[]),o=R.useCallback(async()=>{const l=Fg("/api/v1/auth/logout");if(new URL(l,window.location.origin).origin!==window.location.origin){const u=document.createElement("form");u.method="POST",u.action=`${l}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(u),u.submit();return}await $0.logout(),n(null)},[]);R.useEffect(()=>{i()},[i]),R.useEffect(()=>{},[e]),R.useEffect(()=>{const l=()=>{n(null)};return window.addEventListener(L0,l),()=>window.removeEventListener(L0,l)},[]);const a=R.useMemo(()=>({user:e,isLoading:r,refresh:i,logout:o}),[e,r,i,o]);return w.jsx(im.Provider,{value:a,children:t})};function om(){const t=R.useContext(im);if(!t)throw new Error("useAuth must be used inside an ");return t}function m4(){return R.useContext(im)}const Os=({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"})};return w.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:n[t]})},j0="https://github.com/huggingface/paperswithcode-feedback/issues",PD="https://paperswithcode.co/following",F0="pwc:announcement:following-feed:v1:dismissed",sh=[{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}],RD=()=>{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)},TD=()=>{const[t,e]=R.useState(!1);return R.useEffect(()=>{e(RD())},[]),w.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},D0=({onOpenSearch:t})=>{const[e,n]=R.useState(!1),[r,s]=R.useState(()=>localStorage.getItem(F0)!=="1"),i=R.useRef(null),o=R.useRef(null),a=()=>n(!1),{user:l,logout:u}=om(),c=$n(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",h=jo(),_=al()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:rL()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:nL}:null,p=_?[sh[0],_,...sh.slice(1)]:sh;return R.useLayoutEffect(()=>{var S;const y=i.current,v=o.current;if(!y||!v)return;let m=!1;const x=()=>{if(m)return;const k=y.querySelector(".nav-item.active"),C=(k==null?void 0:k.offsetWidth)??0;v.style.width=`${C}px`,v.style.transform=`translateX(${(k==null?void 0:k.offsetLeft)??0}px)`,v.style.opacity=C>0?"1":"0"};x();const b=window.requestAnimationFrame(()=>{v.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),()=>{m=!0,window.cancelAnimationFrame(b),E==null||E.disconnect(),window.removeEventListener("resize",x)}},[c.pathname,p.length]),w.jsxs(G$,{open:e,onOpenChange:n,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(bi,{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:i,children:[p.map(({to:y,label:v,end:m,badge:x,href:b})=>{const E=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:v}),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(bi,{to:y,end:m,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:j0,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),w.jsxs("button",{className:"search-trigger",onClick:t,children:[w.jsx(Os,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domains…"}),w.jsx(TD,{})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:w.jsx(Os,{name:"search",size:14})}),!h&&w.jsx(bi,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(Os,{name:"bookmark",size:13})}),h?null:l?w.jsx(yD,{user:l,onLogout:u}):w.jsx(hS,{returnTo:f}),w.jsx(K$,{asChild:!0,children:w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",children:w.jsx(Os,{name:"menu",size:14})})})]}),!d&&r&&w.jsxs("div",{className:"site-announcement",role:"status",children:[w.jsx("span",{children:"New: "}),h?w.jsx("a",{href:PD,target:"_blank",rel:"noreferrer",children:"following feed"}):w.jsx(Rn,{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(F0,"1"),s(!1)},children:w.jsx(Os,{name:"close",size:11})})]})]}),w.jsx(Q$,{children:w.jsx(Y$,{className:"mobile-nav-drawer",children:w.jsxs(X$,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(J$,{className:"sr-only",children:"Navigation menu"}),w.jsx(Z$,{className:"icon-btn mobile-nav-close","aria-label":"Close menu",children:w.jsx(Os,{name:"close",size:14})}),w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),t()},children:[w.jsx(Os,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domains…"})]}),p.map(({to:y,label:v,end:m,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:v}),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(bi,{to:y,end:m,className:E,onClick:a,children:S},y)}),w.jsx("a",{className:"mobile-nav-link",href:j0,target:"_blank",rel:"noreferrer",onClick:a,children:"Submit feedback"}),!h&&w.jsx(bi,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!h&&(l==null?void 0:l.is_admin)&&w.jsx(bi,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},ID=()=>{const{pathname:t}=$n();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(Rn,{to:"/docs/api",children:"API"}),w.jsx(Rn,{to:"/mcp",children:"MCP"}),w.jsx(Rn,{to:"/privacy",children:"Privacy"}),w.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},OD=1,MD=1e6;let ih=0;function ND(){return ih=(ih+1)%Number.MAX_SAFE_INTEGER,ih.toString()}const oh=new Map,z0=t=>{if(oh.has(t))return;const e=setTimeout(()=>{oh.delete(t),Oa({type:"REMOVE_TOAST",toastId:t})},MD);oh.set(t,e)},AD=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,OD)};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?z0(n):t.toasts.forEach(r=>{z0(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)}}},Lu=[];let ju={toasts:[]};function Oa(t){ju=AD(ju,t),Lu.forEach(e=>{e(ju)})}function $D({...t}){const e=ND(),n=s=>Oa({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Oa({type:"DISMISS_TOAST",toastId:e});return Oa({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function LD(){const[t,e]=g.useState(ju);return g.useEffect(()=>(Lu.push(e),()=>{const n=Lu.indexOf(e);n>-1&&Lu.splice(n,1)}),[t]),{...t,toast:$D,dismiss:n=>Oa({type:"DISMISS_TOAST",toastId:n})}}var jD=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"}),FD="VisuallyHidden",Od=g.forwardRef((t,e)=>w.jsx(Re.span,{...t,ref:e,style:{...jD,...t.style}}));Od.displayName=FD;var DD=Od,am="ToastProvider",[lm,zD,BD]=Ug("Toast"),[dk]=Ss("Toast",[BD]),[UD,Md]=dk(am),fk=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=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 \`${am}\`. Expected non-empty \`string\`.`),w.jsx(lm.Provider,{scope:e,children:w.jsx(UD,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>c(h=>h+1),[]),onToastRemove:g.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};fk.displayName=am;var hk="ToastViewport",VD=["F8"],ov="toast.viewportPause",av="toast.viewportResume",pk=g.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=VD,label:s="Notifications ({hotkey})",...i}=t,o=Md(hk,n),a=zD(n),l=g.useRef(null),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),f=Xe(e,d,o.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;g.useEffect(()=>{const y=v=>{var x;r.length!==0&&r.every(b=>v[b]||v.code===b)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),g.useEffect(()=>{const y=l.current,v=d.current;if(_&&y&&v){const m=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(ov);v.dispatchEvent(S),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(av);v.dispatchEvent(S),o.isClosePausedRef.current=!1}},b=S=>{!y.contains(S.relatedTarget)&&x()},E=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",m),y.addEventListener("focusout",b),y.addEventListener("pointermove",m),y.addEventListener("pointerleave",E),window.addEventListener("blur",m),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",m),y.removeEventListener("focusout",b),y.removeEventListener("pointermove",m),y.removeEventListener("pointerleave",E),window.removeEventListener("blur",m),window.removeEventListener("focus",x)}}},[_,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:y})=>{const m=a().map(x=>{const b=x.ref.current,E=[b,...n3(b)];return y==="forwards"?E:E.reverse()});return(y==="forwards"?m.reverse():m).flat()},[a]);return g.useEffect(()=>{const y=d.current;if(y){const v=m=>{var E,S,k;const x=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!x){const C=document.activeElement,I=m.shiftKey;if(m.target===y&&I){(E=u.current)==null||E.focus();return}const N=p({tabbingDirection:I?"backwards":"forwards"}),B=N.findIndex(j=>j===C);ah(N.slice(B+1))?m.preventDefault():I?(S=u.current)==null||S.focus():(k=c.current)==null||k.focus()}};return y.addEventListener("keydown",v),()=>y.removeEventListener("keydown",v)}},[a,p]),w.jsxs($A,{ref:l,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&w.jsx(lv,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});ah(y)}}),w.jsx(lm.Slot,{scope:n,children:w.jsx(Re.ol,{tabIndex:-1,...i,ref:f})}),_&&w.jsx(lv,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});ah(y)}})]})});pk.displayName=hk;var vk="ToastFocusProxy",lv=g.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=Md(vk,n);return w.jsx(Od,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});lv.displayName=vk;var kl="Toast",qD="toast.swipeStart",HD="toast.swipeMove",WD="toast.swipeCancel",GD="toast.swipeEnd",gk=g.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=yd({prop:r,defaultProp:s??!0,onChange:i,caller:kl});return w.jsx(er,{present:n||a,children:w.jsx(YD,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Bt(t.onPause),onResume:Bt(t.onResume),onSwipeStart:Z(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Z(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:Z(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:Z(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)})})})});gk.displayName=kl;var[KD,QD]=dk(kl,{onClose(){}}),YD=g.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,..._}=t,p=Md(kl,n),[y,v]=g.useState(null),m=Xe(e,j=>v(j)),x=g.useRef(null),b=g.useRef(null),E=s||p.duration,S=g.useRef(0),k=g.useRef(E),C=g.useRef(0),{onToastAdd:I,onToastRemove:P}=p,$=Bt(()=>{var W;(y==null?void 0:y.contains(document.activeElement))&&((W=p.viewport)==null||W.focus()),o()}),N=g.useCallback(j=>{!j||j===1/0||(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout($,j))},[$]);g.useEffect(()=>{const j=p.viewport;if(j){const W=()=>{N(k.current),u==null||u()},q=()=>{const G=new Date().getTime()-S.current;k.current=k.current-G,window.clearTimeout(C.current),l==null||l()};return j.addEventListener(ov,q),j.addEventListener(av,W),()=>{j.removeEventListener(ov,q),j.removeEventListener(av,W)}}},[p.viewport,E,l,u,N]),g.useEffect(()=>{i&&!p.isClosePausedRef.current&&N(E)},[i,E,p.isClosePausedRef,N]),g.useEffect(()=>(I(),()=>P()),[I,P]);const B=g.useMemo(()=>y?Ek(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[B&&w.jsx(XD,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:B}),w.jsx(KD,{scope:n,onClose:$,children:_l.createPortal(w.jsx(lm.ItemSlot,{scope:n,children:w.jsx(AA,{asChild:!0,onEscapeKeyDown:Z(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||$(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(Re.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,..._,ref:m,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Z(t.onKeyDown,j=>{j.key==="Escape"&&(a==null||a(j.nativeEvent),j.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:Z(t.onPointerDown,j=>{j.button===0&&(x.current={x:j.clientX,y:j.clientY})}),onPointerMove:Z(t.onPointerMove,j=>{if(!x.current)return;const W=j.clientX-x.current.x,q=j.clientY-x.current.y,G=!!b.current,M=["left","right"].includes(p.swipeDirection),T=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,z=M?T(0,W):0,K=M?0:T(0,q),H=j.pointerType==="touch"?10:2,Q={x:z,y:K},X={originalEvent:j,delta:Q};G?(b.current=Q,fu(HD,d,X,{discrete:!1})):B0(Q,p.swipeDirection,H)?(b.current=Q,fu(qD,c,X,{discrete:!1}),j.target.setPointerCapture(j.pointerId)):(Math.abs(W)>H||Math.abs(q)>H)&&(x.current=null)}),onPointerUp:Z(t.onPointerUp,j=>{const W=b.current,q=j.target;if(q.hasPointerCapture(j.pointerId)&&q.releasePointerCapture(j.pointerId),b.current=null,x.current=null,W){const G=j.currentTarget,M={originalEvent:j,delta:W};B0(W,p.swipeDirection,p.swipeThreshold)?fu(GD,h,M,{discrete:!0}):fu(WD,f,M,{discrete:!0}),G.addEventListener("click",T=>T.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),XD=t=>{const{__scopeToast:e,children:n,...r}=t,s=Md(kl,e),[i,o]=g.useState(!1),[a,l]=g.useState(!1);return e3(()=>o(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(_d,{asChild:!0,children:w.jsx(Od,{...r,children:i&&w.jsxs(w.Fragment,{children:[s.label," ",n]})})})},JD="ToastTitle",mk=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Re.div,{...r,ref:e})});mk.displayName=JD;var ZD="ToastDescription",yk=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Re.div,{...r,ref:e})});yk.displayName=ZD;var _k="ToastAction",wk=g.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?w.jsx(bk,{altText:n,asChild:!0,children:w.jsx(um,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${_k}\`. Expected non-empty \`string\`.`),null)});wk.displayName=_k;var xk="ToastClose",um=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=QD(xk,n);return w.jsx(bk,{asChild:!0,children:w.jsx(Re.button,{type:"button",...r,ref:e,onClick:Z(t.onClick,s.onClose)})})});um.displayName=xk;var bk=g.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return w.jsx(Re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function Ek(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),t3(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...Ek(r))}}),e}function fu(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Og(s,i):s.dispatchEvent(i)}var B0=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function e3(t=()=>{}){const e=Bt(t);pn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function t3(t){return t.nodeType===t.ELEMENT_NODE}function n3(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function ah(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var r3=fk,Sk=pk,Ck=gk,kk=mk,Pk=yk,Rk=wk,Tk=um;const U0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,V0=RS,s3=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return V0(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const f=U0(c)||U0(d);return s[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,...h}=c;return Object.entries(h).every(_=>{let[p,y]=_;return Array.isArray(y)?y.includes({...i,...a}[p]):{...i,...a}[p]===y})?[...u,d,f]:u},[]);return V0(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},i3=r3,Ik=g.forwardRef(({className:t,...e},n)=>w.jsx(Sk,{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}));Ik.displayName=Sk.displayName;const o3=s3("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"}}),Ok=g.forwardRef(({className:t,variant:e,...n},r)=>w.jsx(Ck,{ref:r,className:at(o3({variant:e}),t),...n}));Ok.displayName=Ck.displayName;const a3=g.forwardRef(({className:t,...e},n)=>w.jsx(Rk,{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}));a3.displayName=Rk.displayName;const Mk=g.forwardRef(({className:t,...e},n)=>w.jsx(Tk,{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(cD,{className:"h-4 w-4"})}));Mk.displayName=Tk.displayName;const Nk=g.forwardRef(({className:t,...e},n)=>w.jsx(kk,{ref:n,className:at("text-sm font-semibold",t),...e}));Nk.displayName=kk.displayName;const Ak=g.forwardRef(({className:t,...e},n)=>w.jsx(Pk,{ref:n,className:at("text-sm opacity-90",t),...e}));Ak.displayName=Pk.displayName;function l3(){const{toasts:t}=LD();return w.jsxs(i3,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return w.jsxs(Ok,{...i,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx(Nk,{children:n}),r&&w.jsx(Ak,{children:r})]}),s,w.jsx(Mk,{})]},e)}),w.jsx(Ik,{})]})}var u3=t=>{switch(t){case"success":return f3;case"info":return p3;case"warning":return h3;case"error":return v3;default:return null}},c3=Array(12).fill(0),d3=({visible:t,className:e})=>R.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},R.createElement("div",{className:"sonner-spinner"},c3.map((n,r)=>R.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),f3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),h3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),p3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),v3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),g3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},R.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),R.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),m3=()=>{let[t,e]=R.useState(document.hidden);return R.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},uv=1,y3=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:uv++,i=this.toasts.find(a=>a.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...t,id:s,title:n}),{...a,...t,id:s,dismissible:o,title:n}):a):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),s=n!==void 0,i,o=r.then(async l=>{if(i=["resolve",l],R.isValidElement(l))s=!1,this.create({id:n,type:"default",message:l});else if(w3(l)&&!l.ok){s=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,c=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:u,description:c})}else if(e.success!==void 0){s=!1;let u=typeof e.success=="function"?await e.success(l):e.success,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){s=!1;let u=typeof e.error=="function"?await e.error(l):e.error,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;s&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,u)=>o.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||uv++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Nt=new y3,_3=(t,e)=>{let n=(e==null?void 0:e.id)||uv++;return Nt.addToast({title:t,...e,id:n}),n},w3=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",x3=_3,b3=()=>Nt.toasts,E3=()=>Nt.getActiveToasts();Object.assign(x3,{success:Nt.success,info:Nt.info,warning:Nt.warning,error:Nt.error,custom:Nt.custom,message:Nt.message,promise:Nt.promise,dismiss:Nt.dismiss,loading:Nt.loading},{getHistory:b3,getToasts:E3});function S3(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}S3(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);function hu(t){return t.label!==void 0}var C3=3,k3="32px",P3="16px",q0=4e3,R3=356,T3=14,I3=20,O3=200;function xn(...t){return t.filter(Boolean).join(" ")}function M3(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var N3=t=>{var e,n,r,s,i,o,a,l,u,c,d;let{invert:f,toast:h,unstyled:_,interacting:p,setHeights:y,visibleToasts:v,heights:m,index:x,toasts:b,expanded:E,removeToast:S,defaultRichColors:k,closeButton:C,style:I,cancelButtonStyle:P,actionButtonStyle:$,className:N="",descriptionClassName:B="",duration:j,position:W,gap:q,loadingIcon:G,expandByDefault:M,classNames:T,icons:z,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:H}=t,[Q,X]=R.useState(null),[ie,pe]=R.useState(null),[se,ve]=R.useState(!1),[_e,Ze]=R.useState(!1),[Ot,et]=R.useState(!1),[ze,nr]=R.useState(!1),[Or,lt]=R.useState(!1),[Mr,tn]=R.useState(0),[Ut,Nr]=R.useState(0),Ar=R.useRef(h.duration||j||q0),Bo=R.useRef(null),vn=R.useRef(null),Wk=x===0,Gk=x+1<=v,nn=h.type,hi=h.dismissible!==!1,Kk=h.className||"",Qk=h.descriptionClassName||"",Pl=R.useMemo(()=>m.findIndex(oe=>oe.toastId===h.id)||0,[m,h.id]),Yk=R.useMemo(()=>{var oe;return(oe=h.closeButton)!=null?oe:C},[h.closeButton,C]),dm=R.useMemo(()=>h.duration||j||q0,[h.duration,j]),$d=R.useRef(0),pi=R.useRef(0),fm=R.useRef(0),vi=R.useRef(null),[Xk,Jk]=W.split("-"),hm=R.useMemo(()=>m.reduce((oe,Se,je)=>je>=Pl?oe:oe+Se.height,0),[m,Pl]),pm=m3(),Zk=h.invert||f,Ld=nn==="loading";pi.current=R.useMemo(()=>Pl*q+hm,[Pl,hm]),R.useEffect(()=>{Ar.current=dm},[dm]),R.useEffect(()=>{ve(!0)},[]),R.useEffect(()=>{let oe=vn.current;if(oe){let Se=oe.getBoundingClientRect().height;return Nr(Se),y(je=>[{toastId:h.id,height:Se,position:h.position},...je]),()=>y(je=>je.filter(gn=>gn.toastId!==h.id))}},[y,h.id]),R.useLayoutEffect(()=>{if(!se)return;let oe=vn.current,Se=oe.style.height;oe.style.height="auto";let je=oe.getBoundingClientRect().height;oe.style.height=Se,Nr(je),y(gn=>gn.find(mn=>mn.toastId===h.id)?gn.map(mn=>mn.toastId===h.id?{...mn,height:je}:mn):[{toastId:h.id,height:je,position:h.position},...gn])},[se,h.title,h.description,y,h.id]);let $r=R.useCallback(()=>{Ze(!0),tn(pi.current),y(oe=>oe.filter(Se=>Se.toastId!==h.id)),setTimeout(()=>{S(h)},O3)},[h,S,y,pi]);R.useEffect(()=>{if(h.promise&&nn==="loading"||h.duration===1/0||h.type==="loading")return;let oe;return E||p||H&&pm?(()=>{if(fm.current<$d.current){let Se=new Date().getTime()-$d.current;Ar.current=Ar.current-Se}fm.current=new Date().getTime()})():Ar.current!==1/0&&($d.current=new Date().getTime(),oe=setTimeout(()=>{var Se;(Se=h.onAutoClose)==null||Se.call(h,h),$r()},Ar.current)),()=>clearTimeout(oe)},[E,p,h,nn,H,pm,$r]),R.useEffect(()=>{h.delete&&$r()},[$r,h.delete]);function eP(){var oe,Se,je;return z!=null&&z.loading?R.createElement("div",{className:xn(T==null?void 0:T.loader,(oe=h==null?void 0:h.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":nn==="loading"},z.loading):G?R.createElement("div",{className:xn(T==null?void 0:T.loader,(Se=h==null?void 0:h.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":nn==="loading"},G):R.createElement(d3,{className:xn(T==null?void 0:T.loader,(je=h==null?void 0:h.classNames)==null?void 0:je.loader),visible:nn==="loading"})}return R.createElement("li",{tabIndex:0,ref:vn,className:xn(N,Kk,T==null?void 0:T.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,T==null?void 0:T.default,T==null?void 0:T[nn],(n=h==null?void 0:h.classNames)==null?void 0:n[nn]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:k,"data-styled":!(h.jsx||h.unstyled||_),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":Or,"data-removed":_e,"data-visible":Gk,"data-y-position":Xk,"data-x-position":Jk,"data-index":x,"data-front":Wk,"data-swiping":Ot,"data-dismissible":hi,"data-type":nn,"data-invert":Zk,"data-swipe-out":ze,"data-swipe-direction":ie,"data-expanded":!!(E||M&&se),style:{"--index":x,"--toasts-before":x,"--z-index":b.length-x,"--offset":`${_e?Mr:pi.current}px`,"--initial-height":M?"auto":`${Ut}px`,...I,...h.style},onDragEnd:()=>{et(!1),X(null),vi.current=null},onPointerDown:oe=>{Ld||!hi||(Bo.current=new Date,tn(pi.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(et(!0),vi.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Se,je,gn;if(ze||!hi)return;vi.current=null;let mn=Number(((oe=vn.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Lr=Number(((Se=vn.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Cs=new Date().getTime()-((je=Bo.current)==null?void 0:je.getTime()),yn=Q==="x"?mn:Lr,jr=Math.abs(yn)/Cs;if(Math.abs(yn)>=I3||jr>.11){tn(pi.current),(gn=h.onDismiss)==null||gn.call(h,h),pe(Q==="x"?mn>0?"right":"left":Lr>0?"down":"up"),$r(),nr(!0),lt(!1);return}et(!1),X(null)},onPointerMove:oe=>{var Se,je,gn,mn;if(!vi.current||!hi||((Se=window.getSelection())==null?void 0:Se.toString().length)>0)return;let Lr=oe.clientY-vi.current.y,Cs=oe.clientX-vi.current.x,yn=(je=t.swipeDirections)!=null?je:M3(W);!Q&&(Math.abs(Cs)>1||Math.abs(Lr)>1)&&X(Math.abs(Cs)>Math.abs(Lr)?"x":"y");let jr={x:0,y:0};Q==="y"?(yn.includes("top")||yn.includes("bottom"))&&(yn.includes("top")&&Lr<0||yn.includes("bottom")&&Lr>0)&&(jr.y=Lr):Q==="x"&&(yn.includes("left")||yn.includes("right"))&&(yn.includes("left")&&Cs<0||yn.includes("right")&&Cs>0)&&(jr.x=Cs),(Math.abs(jr.x)>0||Math.abs(jr.y)>0)&<(!0),(gn=vn.current)==null||gn.style.setProperty("--swipe-amount-x",`${jr.x}px`),(mn=vn.current)==null||mn.style.setProperty("--swipe-amount-y",`${jr.y}px`)}},Yk&&!h.jsx?R.createElement("button",{"aria-label":K,"data-disabled":Ld,"data-close-button":!0,onClick:Ld||!hi?()=>{}:()=>{var oe;$r(),(oe=h.onDismiss)==null||oe.call(h,h)},className:xn(T==null?void 0:T.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=z==null?void 0:z.close)!=null?i:g3):null,h.jsx||g.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:R.createElement(R.Fragment,null,nn||h.icon||h.promise?R.createElement("div",{"data-icon":"",className:xn(T==null?void 0:T.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||eP():null,h.type!=="loading"?h.icon||(z==null?void 0:z[nn])||u3(nn):null):null,R.createElement("div",{"data-content":"",className:xn(T==null?void 0:T.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},R.createElement("div",{"data-title":"",className:xn(T==null?void 0:T.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?R.createElement("div",{"data-description":"",className:xn(B,Qk,T==null?void 0:T.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),g.isValidElement(h.cancel)?h.cancel:h.cancel&&hu(h.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:oe=>{var Se,je;hu(h.cancel)&&hi&&((je=(Se=h.cancel).onClick)==null||je.call(Se,oe),$r())},className:xn(T==null?void 0:T.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,g.isValidElement(h.action)?h.action:h.action&&hu(h.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:oe=>{var Se,je;hu(h.action)&&((je=(Se=h.action).onClick)==null||je.call(Se,oe),!oe.defaultPrevented&&$r())},className:xn(T==null?void 0:T.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function H0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function A3(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?P3:k3;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=a:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var $3=g.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:f,style:h,visibleToasts:_=C3,toastOptions:p,dir:y=H0(),gap:v=T3,loadingIcon:m,icons:x,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:E}=t,[S,k]=R.useState([]),C=R.useMemo(()=>Array.from(new Set([r].concat(S.filter(H=>H.position).map(H=>H.position)))),[S,r]),[I,P]=R.useState([]),[$,N]=R.useState(!1),[B,j]=R.useState(!1),[W,q]=R.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=R.useRef(null),M=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=R.useRef(null),z=R.useRef(!1),K=R.useCallback(H=>{k(Q=>{var X;return(X=Q.find(ie=>ie.id===H.id))!=null&&X.delete||Nt.dismiss(H.id),Q.filter(({id:ie})=>ie!==H.id)})},[]);return R.useEffect(()=>Nt.subscribe(H=>{if(H.dismiss){k(Q=>Q.map(X=>X.id===H.id?{...X,delete:!0}:X));return}setTimeout(()=>{yb.flushSync(()=>{k(Q=>{let X=Q.findIndex(ie=>ie.id===H.id);return X!==-1?[...Q.slice(0,X),{...Q[X],...H},...Q.slice(X+1)]:[H,...Q]})})})}),[]),R.useEffect(()=>{if(c!=="system"){q(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{H.addListener(({matches:X})=>{try{q(X?"dark":"light")}catch(ie){console.error(ie)}})}},[c]),R.useEffect(()=>{S.length<=1&&N(!1)},[S]),R.useEffect(()=>{let H=Q=>{var X,ie;s.every(pe=>Q[pe]||Q.code===pe)&&(N(!0),(X=G.current)==null||X.focus()),Q.code==="Escape"&&(document.activeElement===G.current||(ie=G.current)!=null&&ie.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[s]),R.useEffect(()=>{if(G.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,z.current=!1)}},[G.current]),R.createElement("section",{ref:e,"aria-label":`${b} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((H,Q)=>{var X;let[ie,pe]=H.split("-");return S.length?R.createElement("ol",{key:H,dir:y==="auto"?H0():y,tabIndex:-1,ref:G,className:a,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":ie,"data-lifted":$&&S.length>1&&!i,"data-x-position":pe,style:{"--front-toast-height":`${((X=I[0])==null?void 0:X.height)||0}px`,"--width":`${R3}px`,"--gap":`${v}px`,...h,...A3(l,u)},onBlur:se=>{z.current&&!se.currentTarget.contains(se.relatedTarget)&&(z.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||z.current||(z.current=!0,T.current=se.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{B||N(!1)},onDragEnd:()=>N(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||j(!0)},onPointerUp:()=>j(!1)},S.filter(se=>!se.position&&Q===0||se.position===H).map((se,ve)=>{var _e,Ze;return R.createElement(N3,{key:se.id,icons:x,index:ve,toast:se,defaultRichColors:d,duration:(_e=p==null?void 0:p.duration)!=null?_e:f,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:n,visibleToasts:_,closeButton:(Ze=p==null?void 0:p.closeButton)!=null?Ze:o,interacting:B,position:H,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:K,toasts:S.filter(Ot=>Ot.position==se.position),heights:I.filter(Ot=>Ot.position==se.position),setHeights:P,expandByDefault:i,gap:v,loadingIcon:m,expanded:$,pauseWhenPageIsHidden:E,swipeDirections:t.swipeDirections})})):null}))});const L3=({...t})=>{const{theme:e="system"}=OT();return w.jsx($3,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var j3=Symbol("radix.slottable");function F3(t){const e=({children:n})=>w.jsx(w.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=j3,e}var[Nd]=Ss("Tooltip",[kd]),cm=kd(),$k="TooltipProvider",D3=700,W0="tooltip.open",[z3,Lk]=Nd($k),jk=t=>{const{__scopeTooltip:e,delayDuration:n=D3,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),w.jsx(z3,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};jk.displayName=$k;var Fk="Tooltip",[y4,Ad]=Nd(Fk),cv="TooltipTrigger",B3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Ad(cv,n),i=Lk(cv,n),o=cm(n),a=g.useRef(null),l=Xe(e,a,s.onTriggerChange),u=g.useRef(!1),c=g.useRef(!1),d=g.useCallback(()=>u.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.jsx(iC,{asChild:!0,...o,children:w.jsx(Re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Z(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:Z(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:Z(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Z(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Z(t.onBlur,s.onClose),onClick:Z(t.onClick,s.onClose)})})});B3.displayName=cv;var U3="TooltipPortal",[_4,V3]=Nd(U3,{forceMount:void 0}),Mo="TooltipContent",Dk=g.forwardRef((t,e)=>{const n=V3(Mo,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=Ad(Mo,t.__scopeTooltip);return w.jsx(er,{present:r||o.open,children:o.disableHoverableContent?w.jsx(zk,{side:s,...i,ref:e}):w.jsx(q3,{side:s,...i,ref:e})})}),q3=g.forwardRef((t,e)=>{const n=Ad(Mo,t.__scopeTooltip),r=Lk(Mo,t.__scopeTooltip),s=g.useRef(null),i=Xe(e,s),[o,a]=g.useState(null),{trigger:l,onClose:u}=n,c=s.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{a(null),d(!1)},[d]),h=g.useCallback((_,p)=>{const y=_.currentTarget,v={x:_.clientX,y:_.clientY},m=Q3(v,y.getBoundingClientRect()),x=Y3(v,m),b=X3(p.getBoundingClientRect()),E=Z3([...x,...b]);a(E),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&c){const _=y=>h(y,c),p=y=>h(y,l);return l.addEventListener("pointerleave",_),c.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",_),c.removeEventListener("pointerleave",p)}}},[l,c,h,f]),g.useEffect(()=>{if(o){const _=p=>{const y=p.target,v={x:p.clientX,y:p.clientY},m=(l==null?void 0:l.contains(y))||(c==null?void 0:c.contains(y)),x=!J3(v,o);m?f():x&&(f(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[l,c,o,u,f]),w.jsx(zk,{...t,ref:i})}),[H3,W3]=Nd(Fk,{isInside:!1}),G3=F3("TooltipContent"),zk=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Ad(Mo,n),u=cm(n),{onClose:c}=l;return g.useEffect(()=>(document.addEventListener(W0,c),()=>document.removeEventListener(W0,c)),[c]),g.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),w.jsx(xl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:w.jsxs(oC,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[w.jsx(G3,{children:r}),w.jsx(H3,{scope:n,isInside:!0,children:w.jsx(DD,{id:l.contentId,role:"tooltip",children:s||r})})]})})});Dk.displayName=Mo;var Bk="TooltipArrow",K3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=cm(n);return W3(Bk,n).isInside?null:w.jsx(aC,{...s,...r,ref:e})});K3.displayName=Bk;function Q3(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Y3(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function X3(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function J3(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;ir!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(s=!s)}return s}function Z3(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),ez(e)}function ez(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var tz=jk,Uk=Dk;const nz=tz,rz=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(Uk,{ref:r,sideOffset:e,className:at("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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}));rz.displayName=Uk.displayName;function sz(){const{pathname:t,hash:e}=$n();g.useLayoutEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"instant"})},[t,e])}class iz{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 G0=new iz(iv),lh={hide_closed_source_evals:!1},Vk=R.createContext(null),oz=({children:t})=>{const{user:e}=om(),[n,r]=R.useState(lh),[s,i]=R.useState(!1);R.useEffect(()=>{let l=!1;if(!e){r(lh);return}return i(!0),G0.getPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(lh)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[e]);const o=R.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await G0.updatePreferences(u);r(c)}catch{r(n)}},[n,e]),a=R.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:s,setHideClosedSourceEvals:o}),[n,e,s,o]);return w.jsx(Vk.Provider,{value:a,children:t})};function w4(){const t=R.useContext(Vk);if(!t)throw new Error("usePreferences must be used inside a ");return t}const qk=iL(),az=qk?MN:ON;if(!qk&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const lz=R.lazy(()=>ce(()=>import("./AuthorizePaperEditView-CmLofDOW.js"),__vite__mapDeps([0,1,2,3,4]))),uz=R.lazy(()=>ce(()=>import("./FollowingView-DKH_R2lt.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,1,25,26,27,28,29,30,31]))),cz=R.lazy(()=>ce(()=>import("./FeedView-B8_X5TkM.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,1,25,26,27,28,29,30,31]))),dz=R.lazy(()=>ce(()=>import("./ChatView-DCUOQn_a.js"),__vite__mapDeps([32,1,33,22,23,24,14,25,34,35,36,37,26,38,39,40,41,12,2,42,43,44,45,46,17,18,47,48,49]))),fz=R.lazy(()=>ce(()=>import("./SharedChatView-NuSCzJsx.js"),__vite__mapDeps([50,1,33,22,23,24,14,25,34,35,36,37,26,38,39,40,41,12,2,42,43,44,45,46]))),hz=R.lazy(()=>ce(()=>import("./PapersListView-Bitwo62b.js"),__vite__mapDeps([51,11,12,13,7,14,15,16,26,27,1,28,52,29,30,31,19,20,21]))),pz=R.lazy(()=>ce(()=>import("./PaperDetailView-DNUhr9yL.js"),__vite__mapDeps([53,11,12,13,7,14,15,16,54,34,55,56,1,27,28,57,30,31,3,58,18,4,42,59,60,21,61,2,26,62,63,64,65,35,66,9,67,68,69,36,70,39,40,29,71,72]))),vz=R.lazy(()=>ce(()=>import("./PaperReaderView-C0PN93t_.js"),__vite__mapDeps([73,1,33,22,23,24,14,25,34,35,36,37,26,38,39,40,41,12,2,42,43,44,45,46,74,56,15,27,28,32,17,18,47,48,49]))),gz=R.lazy(()=>ce(()=>import("./TagsIndexView-CYhpgaLv.js"),__vite__mapDeps([75,1,26,7,76,60,3,21,58,61,77,47,78,79,43,66,25,80,37,81,69,30,31,82,64,59,65,2,62,9,83]))),mz=R.lazy(()=>ce(()=>import("./TagBrowseView-RxEnzLQJ.js"),__vite__mapDeps([84,85,1,2,10,9,11,12,13,7,14,15,16,86,87,19,20,21,74,38,39,40,41,34,46,26,76,27,28,29,30,31,80,36]))),yz=R.lazy(()=>ce(()=>import("./MethodsIndexView-BLhOffBh.js"),__vite__mapDeps([88,1,26,76,30,31,82,64,3,59,65,60,21,58,61,2,62,9,83,78]))),_z=R.lazy(()=>ce(()=>import("./FrameworksIndexView-VQ1ZCNea.js"),__vite__mapDeps([89,1,11,12,13,7,14,15,16,26]))),wz=R.lazy(()=>ce(()=>import("./TrendsView-YtH_23zk.js"),__vite__mapDeps([90,1,31,30]))),xz=R.lazy(()=>ce(()=>import("./ConferencesIndexView-CXqn0qBf.js"),__vite__mapDeps([91,1,26,30,31,82,64,3,59,65,60,21,58,61,2,62,9]))),bz=R.lazy(()=>ce(()=>import("./AiDeadlinesView-C9Oqhdjq.js"),__vite__mapDeps([92,1,26,93,67,30,31,15,58]))),Ez=R.lazy(()=>ce(()=>import("./ConferenceDetailView-C7dSxojX.js"),__vite__mapDeps([94,1,74,38,39,40,41,34,12,14,2,46,26,7,30,31,15]))),Sz=R.lazy(()=>ce(()=>import("./ConferenceTaskView-DFHaiufu.js"),__vite__mapDeps([95,1,11,12,13,7,14,15,16,19,20,21,74,38,39,40,41,34,2,46,26,27,28,29,30,31]))),Cz=R.lazy(()=>ce(()=>import("./OrganizationsIndexView-BFMUnAB5.js"),__vite__mapDeps([96,1,31,30,26,97]))),kz=R.lazy(()=>ce(()=>import("./OrganizationDetailView-DMyQ2Izc.js"),__vite__mapDeps([98,99,85,1,2,10,9,11,12,13,7,14,15,16,74,38,39,40,41,34,46,100,30,26,19,20,21,31,60,3,58,61,29,27,28,101]))),Pz=R.lazy(()=>ce(()=>import("./OrganizationTaskView-DWeNl8Ej.js"),__vite__mapDeps([102,99,85,1,2,10,9,11,12,13,7,14,15,16,74,38,39,40,41,34,46,100,30,26,19,20,21,31,60,3,58,61,29,27,28,101]))),Rz=R.lazy(()=>ce(()=>import("./AuthorDetailView-Bv11V4WZ.js"),__vite__mapDeps([103,1,11,12,13,7,14,15,16,20,21,19,85,2,10,9,31,30,29,27,28,101]))),Tz=R.lazy(()=>ce(()=>import("./MethodDetailView-0qBqvuwa.js"),__vite__mapDeps([104,85,1,2,10,9,12,28,11,13,7,14,15,16,19,20,21,74,38,39,40,41,34,46,26,76,29,30,31]))),Iz=R.lazy(()=>ce(()=>import("./BenchmarkDetailView-BnI8cNM6.js"),__vite__mapDeps([105,85,1,2,10,9,26,54,14,34,15,55,13,93,67,11,12,7,16,30,31,87,76,106]))),Oz=R.lazy(()=>ce(()=>import("./SavedPapersView-BCiUyr2H.js"),__vite__mapDeps([107,12,1,11,13,7,14,15,16,30,31,71]))),Mz=R.lazy(()=>ce(()=>import("./SettingsView-9QN1I95Q.js"),__vite__mapDeps([108,1,2,10,93,67,86,8,80,23,57,48,44,79]))),Nz=R.lazy(()=>ce(()=>import("./PrivacyView-BrhRqIBn.js"),__vite__mapDeps([109,57]))),Az=R.lazy(()=>ce(()=>import("./ApiDocsView-D7YuFEO7.js"),__vite__mapDeps([110,1,39,111]))),$z=R.lazy(()=>ce(()=>import("./McpView-DURAZUEI.js"),__vite__mapDeps([112,1,57,49,36,44,42,113]))),Lz=R.lazy(()=>ce(()=>import("./SubmitView-CY9aqVy-.js"),__vite__mapDeps([114,2,31,3,59,65,14]))),jz=R.lazy(()=>ce(()=>import("./CronDashboard-C1SJZEYw.js"),__vite__mapDeps([115,1,116,68,3,24,66,78,81,37,77,117,44,118,61,119,2,70,28,4,26,23,120]))),Fz=R.lazy(()=>ce(()=>import("./AutonomousOperations-B9YSXne8.js"),__vite__mapDeps([121,1,2,68,3,116,59,81,117]))),Dz=R.lazy(()=>ce(()=>import("./SubmissionsDashboard-BRu8KXRt.js"),__vite__mapDeps([122,63,12,1,2,26,15,14,62,118,61,117,119,123]))),zz=R.lazy(()=>ce(()=>import("./UserProfileView-CphSsA_F.js"),__vite__mapDeps([124,1,100,30,26]))),Bz=R.lazy(()=>ce(()=>import("./RateLimitsView-Dgq2KKl4.js"),__vite__mapDeps([125,1]))),Uz=R.lazy(()=>ce(()=>import("./AstraForRoboticsView-CMNvenQE.js"),__vite__mapDeps([126,11,12,13,7,14,15,16,19,31,30,29,27,1,28,57,127]))),uh=R.lazy(()=>ce(()=>import("./NotFound-Br7ty259.js"),[])),K0=R.lazy(()=>ce(()=>import("./SearchOverlay-V0kUCUuz.js"),__vite__mapDeps([128,12,1,13,26,14,52,7]))),Vz=R.lazy(()=>ce(()=>import("./StagingAccessRequestView--9rXbvGS.js"),__vite__mapDeps([129,119]))),ch=()=>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}})]})]}),qz=new dA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Hz=()=>{const{arxivId:t}=_1();return w.jsx(To,{to:t?`/paper/${t}`:"/papers",replace:!0})},Wz=()=>{const{taskSlug:t}=_1();return w.jsx(To,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},Q0=({element:t})=>jo()?w.jsx(To,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:t}),Hk=({element:t})=>{const{user:e,isLoading:n}=om();return jo()?w.jsx(To,{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(hS,{returnTo:"/admin-dashboard"})]})})},Gz=()=>{const t=tL(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return R.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(Hk,{element:w.jsx(jz,{})})},Kz=()=>{const[t,e]=R.useState(!1),n=$n();return sz(),R.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),R.useEffect(()=>{const r=s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"&&(s.preventDefault(),e(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsx(Vz,{})}):n.pathname.startsWith("/pdf/")?w.jsxs("div",{className:"reader-route-shell",children:[w.jsx(D0,{onOpenSearch:()=>e(!0)}),w.jsx("div",{className:"reader-route-content",children:w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsx(Y_,{children:w.jsx(ue,{path:"/pdf/:paperId",element:sL()?w.jsx(vz,{}):w.jsx(uh,{})})})})}),t&&w.jsx(R.Suspense,{fallback:null,children:w.jsx(K0,{open:t,onClose:()=>e(!1)})})]}):w.jsxs(w.Fragment,{children:[w.jsx(D0,{onOpenSearch:()=>e(!0)}),w.jsx("main",{children:w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsxs(Y_,{children:[w.jsx(ue,{path:"/",element:w.jsx(cz,{})}),w.jsx(ue,{path:"/following",element:w.jsx(uz,{})}),w.jsx(ue,{path:"/chat/:sessionId?",element:al()?w.jsx(dz,{}):w.jsx(To,{to:"/",replace:!0})}),w.jsx(ue,{path:"/share/:shareId",element:al()?w.jsx(fz,{}):w.jsx(uh,{})}),w.jsx(ue,{path:"/papers",element:w.jsx(hz,{})}),w.jsx(ue,{path:"/papers/:arxivId",element:w.jsx(Hz,{})}),w.jsx(ue,{path:"/paper/:arxivId",element:w.jsx(pz,{})}),w.jsx(ue,{path:"/tasks",element:w.jsx(gz,{})}),w.jsx(ue,{path:"/tasks/:taskSlug",element:w.jsx(mz,{})}),w.jsx(ue,{path:"/task/:taskSlug",element:w.jsx(Wz,{})}),w.jsx(ue,{path:"/methods",element:w.jsx(yz,{})}),w.jsx(ue,{path:"/methods/:methodSlug",element:w.jsx(Tz,{})}),w.jsx(ue,{path:"/frameworks",element:w.jsx(_z,{})}),w.jsx(ue,{path:"/trends",element:w.jsx(wz,{})}),w.jsx(ue,{path:"/conferences",element:w.jsx(xz,{})}),w.jsx(ue,{path:"/ai-deadlines",element:w.jsx(bz,{})}),w.jsx(ue,{path:"/conferences/:confSlug",element:w.jsx(Ez,{})}),w.jsx(ue,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(Sz,{})}),w.jsx(ue,{path:"/organizations",element:w.jsx(Cz,{})}),w.jsx(ue,{path:"/orgs/:orgSlug",element:w.jsx(kz,{})}),w.jsx(ue,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(Pz,{})}),w.jsx(ue,{path:"/authors/:authorId",element:w.jsx(Rz,{})}),w.jsx(ue,{path:"/benchmark/:datasetSlug",element:w.jsx(Iz,{})}),w.jsx(ue,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(lz,{})}),w.jsx(ue,{path:"/submit",element:w.jsx(Lz,{})}),w.jsx(ue,{path:"/saved",element:w.jsx(Q0,{element:w.jsx(Oz,{})})}),w.jsx(ue,{path:"/settings",element:w.jsx(Mz,{})}),w.jsx(ue,{path:"/privacy",element:w.jsx(Nz,{})}),w.jsx(ue,{path:"/docs/api",element:w.jsx(Az,{})}),w.jsx(ue,{path:"/mcp",element:w.jsx($z,{})}),w.jsx(ue,{path:"/admin-dashboard",element:w.jsx(Gz,{})}),w.jsx(ue,{path:"/autonomous-operations",element:w.jsx(Hk,{element:w.jsx(Fz,{})})}),w.jsx(ue,{path:"/cron-dashboard",element:w.jsx(To,{to:"/admin-dashboard",replace:!0})}),w.jsx(ue,{path:"/submissions",element:w.jsx(Q0,{element:w.jsx(Dz,{})})}),w.jsx(ue,{path:"/rate-limits",element:w.jsx(Bz,{})}),w.jsx(ue,{path:"/astra-for-robotics",element:w.jsx(Uz,{})}),w.jsx(ue,{path:"/:username",element:w.jsx(zz,{})}),w.jsx(ue,{path:"*",element:w.jsx(uh,{})})]})})}),w.jsx(ID,{}),t&&w.jsx(R.Suspense,{fallback:null,children:w.jsx(K0,{open:t,onClose:()=>e(!1)})})]})},Qz=()=>w.jsx(fA,{client:qz,children:w.jsx(kD,{children:w.jsx(oz,{children:w.jsxs(nz,{children:[w.jsx(az,{children:w.jsx(Kz,{})}),w.jsx(l3,{}),w.jsx(L3,{}),!1]})})})});NM();const Yz=w.jsx(MT,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(OM,{children:w.jsx(Qz,{})})}),Xz=_b(document.getElementById("root"));Xz.render(w.jsx(R.StrictMode,{children:Yz}));export{RS as $,sm as A,uC as B,nL as C,uD as D,Fg as E,R as F,G0 as G,hS as H,UF as I,jo as J,eL as K,Rn as L,sL as M,c4 as N,dD as O,er as P,fD as Q,BF as R,lk as S,a3 as T,lr as U,u4 as V,ED as W,cD as X,aL as Y,iw as Z,ce as _,om as a,_l as a0,iv as a1,vS as a2,s3 as a3,eo as a4,G$ as a5,Q$ as a6,Y$ as a7,X$ as a8,Es as a9,T1 as aA,qN as aB,HN as aC,Hp as aD,k1 as aE,oA as aF,QN as aG,Ct as aH,r4 as aI,il as aJ,lA as aK,i4 as aL,s4 as aM,P1 as aN,AS as aO,$S as aP,LS as aQ,To as aR,$0 as aS,Z$ as aa,J$ as ab,l4 as ac,n4 as ad,IF as ae,iC as af,kd as ag,_d as ah,Q1 as ai,Ng as aj,z1 as ak,Mg as al,xl as am,oC as an,aC as ao,$n as ap,OT as aq,Zz as ar,CD as as,f4 as at,md as au,ZN as av,WN as aw,t4 as ax,Wp as ay,Sn as az,Rg as b,m4 as c,e4 as d,rL as e,d4 as f,Id as g,LD as h,al as i,w as j,w4 as k,aD as l,o4 as m,h4 as n,g4 as o,Re as p,yd as q,g as r,Xe as s,Z as t,_1 as u,EF as v,Ss as w,at as x,p4 as y,jS as z}; +`);function hu(t){return t.label!==void 0}var C3=3,k3="32px",P3="16px",q0=4e3,R3=356,T3=14,I3=20,O3=200;function xn(...t){return t.filter(Boolean).join(" ")}function M3(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var N3=t=>{var e,n,r,s,i,o,a,l,u,c,d;let{invert:f,toast:h,unstyled:_,interacting:p,setHeights:y,visibleToasts:v,heights:m,index:x,toasts:b,expanded:E,removeToast:S,defaultRichColors:k,closeButton:C,style:I,cancelButtonStyle:P,actionButtonStyle:$,className:N="",descriptionClassName:B="",duration:j,position:W,gap:q,loadingIcon:G,expandByDefault:M,classNames:T,icons:z,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:H}=t,[Q,X]=R.useState(null),[ie,pe]=R.useState(null),[se,ve]=R.useState(!1),[_e,Ze]=R.useState(!1),[Ot,et]=R.useState(!1),[ze,nr]=R.useState(!1),[Or,lt]=R.useState(!1),[Mr,tn]=R.useState(0),[Ut,Nr]=R.useState(0),Ar=R.useRef(h.duration||j||q0),Bo=R.useRef(null),vn=R.useRef(null),Wk=x===0,Gk=x+1<=v,nn=h.type,hi=h.dismissible!==!1,Kk=h.className||"",Qk=h.descriptionClassName||"",Pl=R.useMemo(()=>m.findIndex(oe=>oe.toastId===h.id)||0,[m,h.id]),Yk=R.useMemo(()=>{var oe;return(oe=h.closeButton)!=null?oe:C},[h.closeButton,C]),dm=R.useMemo(()=>h.duration||j||q0,[h.duration,j]),$d=R.useRef(0),pi=R.useRef(0),fm=R.useRef(0),vi=R.useRef(null),[Xk,Jk]=W.split("-"),hm=R.useMemo(()=>m.reduce((oe,Se,je)=>je>=Pl?oe:oe+Se.height,0),[m,Pl]),pm=m3(),Zk=h.invert||f,Ld=nn==="loading";pi.current=R.useMemo(()=>Pl*q+hm,[Pl,hm]),R.useEffect(()=>{Ar.current=dm},[dm]),R.useEffect(()=>{ve(!0)},[]),R.useEffect(()=>{let oe=vn.current;if(oe){let Se=oe.getBoundingClientRect().height;return Nr(Se),y(je=>[{toastId:h.id,height:Se,position:h.position},...je]),()=>y(je=>je.filter(gn=>gn.toastId!==h.id))}},[y,h.id]),R.useLayoutEffect(()=>{if(!se)return;let oe=vn.current,Se=oe.style.height;oe.style.height="auto";let je=oe.getBoundingClientRect().height;oe.style.height=Se,Nr(je),y(gn=>gn.find(mn=>mn.toastId===h.id)?gn.map(mn=>mn.toastId===h.id?{...mn,height:je}:mn):[{toastId:h.id,height:je,position:h.position},...gn])},[se,h.title,h.description,y,h.id]);let $r=R.useCallback(()=>{Ze(!0),tn(pi.current),y(oe=>oe.filter(Se=>Se.toastId!==h.id)),setTimeout(()=>{S(h)},O3)},[h,S,y,pi]);R.useEffect(()=>{if(h.promise&&nn==="loading"||h.duration===1/0||h.type==="loading")return;let oe;return E||p||H&&pm?(()=>{if(fm.current<$d.current){let Se=new Date().getTime()-$d.current;Ar.current=Ar.current-Se}fm.current=new Date().getTime()})():Ar.current!==1/0&&($d.current=new Date().getTime(),oe=setTimeout(()=>{var Se;(Se=h.onAutoClose)==null||Se.call(h,h),$r()},Ar.current)),()=>clearTimeout(oe)},[E,p,h,nn,H,pm,$r]),R.useEffect(()=>{h.delete&&$r()},[$r,h.delete]);function eP(){var oe,Se,je;return z!=null&&z.loading?R.createElement("div",{className:xn(T==null?void 0:T.loader,(oe=h==null?void 0:h.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":nn==="loading"},z.loading):G?R.createElement("div",{className:xn(T==null?void 0:T.loader,(Se=h==null?void 0:h.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":nn==="loading"},G):R.createElement(d3,{className:xn(T==null?void 0:T.loader,(je=h==null?void 0:h.classNames)==null?void 0:je.loader),visible:nn==="loading"})}return R.createElement("li",{tabIndex:0,ref:vn,className:xn(N,Kk,T==null?void 0:T.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,T==null?void 0:T.default,T==null?void 0:T[nn],(n=h==null?void 0:h.classNames)==null?void 0:n[nn]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:k,"data-styled":!(h.jsx||h.unstyled||_),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":Or,"data-removed":_e,"data-visible":Gk,"data-y-position":Xk,"data-x-position":Jk,"data-index":x,"data-front":Wk,"data-swiping":Ot,"data-dismissible":hi,"data-type":nn,"data-invert":Zk,"data-swipe-out":ze,"data-swipe-direction":ie,"data-expanded":!!(E||M&&se),style:{"--index":x,"--toasts-before":x,"--z-index":b.length-x,"--offset":`${_e?Mr:pi.current}px`,"--initial-height":M?"auto":`${Ut}px`,...I,...h.style},onDragEnd:()=>{et(!1),X(null),vi.current=null},onPointerDown:oe=>{Ld||!hi||(Bo.current=new Date,tn(pi.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(et(!0),vi.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Se,je,gn;if(ze||!hi)return;vi.current=null;let mn=Number(((oe=vn.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Lr=Number(((Se=vn.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Cs=new Date().getTime()-((je=Bo.current)==null?void 0:je.getTime()),yn=Q==="x"?mn:Lr,jr=Math.abs(yn)/Cs;if(Math.abs(yn)>=I3||jr>.11){tn(pi.current),(gn=h.onDismiss)==null||gn.call(h,h),pe(Q==="x"?mn>0?"right":"left":Lr>0?"down":"up"),$r(),nr(!0),lt(!1);return}et(!1),X(null)},onPointerMove:oe=>{var Se,je,gn,mn;if(!vi.current||!hi||((Se=window.getSelection())==null?void 0:Se.toString().length)>0)return;let Lr=oe.clientY-vi.current.y,Cs=oe.clientX-vi.current.x,yn=(je=t.swipeDirections)!=null?je:M3(W);!Q&&(Math.abs(Cs)>1||Math.abs(Lr)>1)&&X(Math.abs(Cs)>Math.abs(Lr)?"x":"y");let jr={x:0,y:0};Q==="y"?(yn.includes("top")||yn.includes("bottom"))&&(yn.includes("top")&&Lr<0||yn.includes("bottom")&&Lr>0)&&(jr.y=Lr):Q==="x"&&(yn.includes("left")||yn.includes("right"))&&(yn.includes("left")&&Cs<0||yn.includes("right")&&Cs>0)&&(jr.x=Cs),(Math.abs(jr.x)>0||Math.abs(jr.y)>0)&<(!0),(gn=vn.current)==null||gn.style.setProperty("--swipe-amount-x",`${jr.x}px`),(mn=vn.current)==null||mn.style.setProperty("--swipe-amount-y",`${jr.y}px`)}},Yk&&!h.jsx?R.createElement("button",{"aria-label":K,"data-disabled":Ld,"data-close-button":!0,onClick:Ld||!hi?()=>{}:()=>{var oe;$r(),(oe=h.onDismiss)==null||oe.call(h,h)},className:xn(T==null?void 0:T.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=z==null?void 0:z.close)!=null?i:g3):null,h.jsx||g.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:R.createElement(R.Fragment,null,nn||h.icon||h.promise?R.createElement("div",{"data-icon":"",className:xn(T==null?void 0:T.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||eP():null,h.type!=="loading"?h.icon||(z==null?void 0:z[nn])||u3(nn):null):null,R.createElement("div",{"data-content":"",className:xn(T==null?void 0:T.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},R.createElement("div",{"data-title":"",className:xn(T==null?void 0:T.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?R.createElement("div",{"data-description":"",className:xn(B,Qk,T==null?void 0:T.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),g.isValidElement(h.cancel)?h.cancel:h.cancel&&hu(h.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:oe=>{var Se,je;hu(h.cancel)&&hi&&((je=(Se=h.cancel).onClick)==null||je.call(Se,oe),$r())},className:xn(T==null?void 0:T.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,g.isValidElement(h.action)?h.action:h.action&&hu(h.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:oe=>{var Se,je;hu(h.action)&&((je=(Se=h.action).onClick)==null||je.call(Se,oe),!oe.defaultPrevented&&$r())},className:xn(T==null?void 0:T.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function H0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function A3(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?P3:k3;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=a:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var $3=g.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:f,style:h,visibleToasts:_=C3,toastOptions:p,dir:y=H0(),gap:v=T3,loadingIcon:m,icons:x,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:E}=t,[S,k]=R.useState([]),C=R.useMemo(()=>Array.from(new Set([r].concat(S.filter(H=>H.position).map(H=>H.position)))),[S,r]),[I,P]=R.useState([]),[$,N]=R.useState(!1),[B,j]=R.useState(!1),[W,q]=R.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=R.useRef(null),M=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=R.useRef(null),z=R.useRef(!1),K=R.useCallback(H=>{k(Q=>{var X;return(X=Q.find(ie=>ie.id===H.id))!=null&&X.delete||Nt.dismiss(H.id),Q.filter(({id:ie})=>ie!==H.id)})},[]);return R.useEffect(()=>Nt.subscribe(H=>{if(H.dismiss){k(Q=>Q.map(X=>X.id===H.id?{...X,delete:!0}:X));return}setTimeout(()=>{yb.flushSync(()=>{k(Q=>{let X=Q.findIndex(ie=>ie.id===H.id);return X!==-1?[...Q.slice(0,X),{...Q[X],...H},...Q.slice(X+1)]:[H,...Q]})})})}),[]),R.useEffect(()=>{if(c!=="system"){q(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{H.addListener(({matches:X})=>{try{q(X?"dark":"light")}catch(ie){console.error(ie)}})}},[c]),R.useEffect(()=>{S.length<=1&&N(!1)},[S]),R.useEffect(()=>{let H=Q=>{var X,ie;s.every(pe=>Q[pe]||Q.code===pe)&&(N(!0),(X=G.current)==null||X.focus()),Q.code==="Escape"&&(document.activeElement===G.current||(ie=G.current)!=null&&ie.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[s]),R.useEffect(()=>{if(G.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,z.current=!1)}},[G.current]),R.createElement("section",{ref:e,"aria-label":`${b} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((H,Q)=>{var X;let[ie,pe]=H.split("-");return S.length?R.createElement("ol",{key:H,dir:y==="auto"?H0():y,tabIndex:-1,ref:G,className:a,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":ie,"data-lifted":$&&S.length>1&&!i,"data-x-position":pe,style:{"--front-toast-height":`${((X=I[0])==null?void 0:X.height)||0}px`,"--width":`${R3}px`,"--gap":`${v}px`,...h,...A3(l,u)},onBlur:se=>{z.current&&!se.currentTarget.contains(se.relatedTarget)&&(z.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||z.current||(z.current=!0,T.current=se.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{B||N(!1)},onDragEnd:()=>N(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||j(!0)},onPointerUp:()=>j(!1)},S.filter(se=>!se.position&&Q===0||se.position===H).map((se,ve)=>{var _e,Ze;return R.createElement(N3,{key:se.id,icons:x,index:ve,toast:se,defaultRichColors:d,duration:(_e=p==null?void 0:p.duration)!=null?_e:f,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:n,visibleToasts:_,closeButton:(Ze=p==null?void 0:p.closeButton)!=null?Ze:o,interacting:B,position:H,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:K,toasts:S.filter(Ot=>Ot.position==se.position),heights:I.filter(Ot=>Ot.position==se.position),setHeights:P,expandByDefault:i,gap:v,loadingIcon:m,expanded:$,pauseWhenPageIsHidden:E,swipeDirections:t.swipeDirections})})):null}))});const L3=({...t})=>{const{theme:e="system"}=OT();return w.jsx($3,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var j3=Symbol("radix.slottable");function F3(t){const e=({children:n})=>w.jsx(w.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=j3,e}var[Nd]=Ss("Tooltip",[kd]),cm=kd(),$k="TooltipProvider",D3=700,W0="tooltip.open",[z3,Lk]=Nd($k),jk=t=>{const{__scopeTooltip:e,delayDuration:n=D3,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),w.jsx(z3,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};jk.displayName=$k;var Fk="Tooltip",[y4,Ad]=Nd(Fk),cv="TooltipTrigger",B3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Ad(cv,n),i=Lk(cv,n),o=cm(n),a=g.useRef(null),l=Xe(e,a,s.onTriggerChange),u=g.useRef(!1),c=g.useRef(!1),d=g.useCallback(()=>u.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.jsx(iC,{asChild:!0,...o,children:w.jsx(Re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Z(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:Z(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:Z(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Z(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Z(t.onBlur,s.onClose),onClick:Z(t.onClick,s.onClose)})})});B3.displayName=cv;var U3="TooltipPortal",[_4,V3]=Nd(U3,{forceMount:void 0}),Mo="TooltipContent",Dk=g.forwardRef((t,e)=>{const n=V3(Mo,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=Ad(Mo,t.__scopeTooltip);return w.jsx(er,{present:r||o.open,children:o.disableHoverableContent?w.jsx(zk,{side:s,...i,ref:e}):w.jsx(q3,{side:s,...i,ref:e})})}),q3=g.forwardRef((t,e)=>{const n=Ad(Mo,t.__scopeTooltip),r=Lk(Mo,t.__scopeTooltip),s=g.useRef(null),i=Xe(e,s),[o,a]=g.useState(null),{trigger:l,onClose:u}=n,c=s.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{a(null),d(!1)},[d]),h=g.useCallback((_,p)=>{const y=_.currentTarget,v={x:_.clientX,y:_.clientY},m=Q3(v,y.getBoundingClientRect()),x=Y3(v,m),b=X3(p.getBoundingClientRect()),E=Z3([...x,...b]);a(E),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&c){const _=y=>h(y,c),p=y=>h(y,l);return l.addEventListener("pointerleave",_),c.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",_),c.removeEventListener("pointerleave",p)}}},[l,c,h,f]),g.useEffect(()=>{if(o){const _=p=>{const y=p.target,v={x:p.clientX,y:p.clientY},m=(l==null?void 0:l.contains(y))||(c==null?void 0:c.contains(y)),x=!J3(v,o);m?f():x&&(f(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[l,c,o,u,f]),w.jsx(zk,{...t,ref:i})}),[H3,W3]=Nd(Fk,{isInside:!1}),G3=F3("TooltipContent"),zk=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Ad(Mo,n),u=cm(n),{onClose:c}=l;return g.useEffect(()=>(document.addEventListener(W0,c),()=>document.removeEventListener(W0,c)),[c]),g.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),w.jsx(xl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:w.jsxs(oC,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[w.jsx(G3,{children:r}),w.jsx(H3,{scope:n,isInside:!0,children:w.jsx(DD,{id:l.contentId,role:"tooltip",children:s||r})})]})})});Dk.displayName=Mo;var Bk="TooltipArrow",K3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=cm(n);return W3(Bk,n).isInside?null:w.jsx(aC,{...s,...r,ref:e})});K3.displayName=Bk;function Q3(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Y3(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function X3(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function J3(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;ir!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(s=!s)}return s}function Z3(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),ez(e)}function ez(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var tz=jk,Uk=Dk;const nz=tz,rz=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(Uk,{ref:r,sideOffset:e,className:at("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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}));rz.displayName=Uk.displayName;function sz(){const{pathname:t,hash:e}=$n();g.useLayoutEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"instant"})},[t,e])}class iz{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 G0=new iz(iv),lh={hide_closed_source_evals:!1},Vk=R.createContext(null),oz=({children:t})=>{const{user:e}=om(),[n,r]=R.useState(lh),[s,i]=R.useState(!1);R.useEffect(()=>{let l=!1;if(!e){r(lh);return}return i(!0),G0.getPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(lh)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[e]);const o=R.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await G0.updatePreferences(u);r(c)}catch{r(n)}},[n,e]),a=R.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:s,setHideClosedSourceEvals:o}),[n,e,s,o]);return w.jsx(Vk.Provider,{value:a,children:t})};function w4(){const t=R.useContext(Vk);if(!t)throw new Error("usePreferences must be used inside a ");return t}const qk=iL(),az=qk?MN:ON;if(!qk&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const lz=R.lazy(()=>ce(()=>import("./AuthorizePaperEditView-BT467XuQ.js"),__vite__mapDeps([0,1,2,3,4]))),uz=R.lazy(()=>ce(()=>import("./FollowingView-CwCG1Am-.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,1,25,26,27,28,29,30,31]))),cz=R.lazy(()=>ce(()=>import("./FeedView-DmNv9H2e.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,1,25,26,27,28,29,30,31]))),dz=R.lazy(()=>ce(()=>import("./ChatView-BWOmR-sr.js"),__vite__mapDeps([32,1,33,22,23,24,14,25,34,35,36,37,26,38,39,40,41,12,2,42,43,44,45,46,17,18,47,48,49]))),fz=R.lazy(()=>ce(()=>import("./SharedChatView-rTXZ7eaT.js"),__vite__mapDeps([50,1,33,22,23,24,14,25,34,35,36,37,26,38,39,40,41,12,2,42,43,44,45,46]))),hz=R.lazy(()=>ce(()=>import("./PapersListView-DmAF2yfX.js"),__vite__mapDeps([51,11,12,13,7,14,15,16,26,27,1,28,52,29,30,31,19,20,21]))),pz=R.lazy(()=>ce(()=>import("./PaperDetailView-CeJ8lQ5x.js"),__vite__mapDeps([53,11,12,13,7,14,15,16,54,34,55,56,1,27,28,57,30,31,3,58,18,4,42,59,60,21,61,2,26,62,63,64,65,35,66,9,67,68,69,36,70,39,40,29,71,72]))),vz=R.lazy(()=>ce(()=>import("./PaperReaderView-B5hOVSoX.js"),__vite__mapDeps([73,1,33,22,23,24,14,25,34,35,36,37,26,38,39,40,41,12,2,42,43,44,45,46,74,56,15,27,28,32,17,18,47,48,49]))),gz=R.lazy(()=>ce(()=>import("./TagsIndexView-CHHNusue.js"),__vite__mapDeps([75,1,26,7,76,60,3,21,58,61,77,47,78,79,43,66,25,80,37,81,69,30,31,82,64,59,65,2,62,9,83]))),mz=R.lazy(()=>ce(()=>import("./TagBrowseView-Bdloff_M.js"),__vite__mapDeps([84,85,1,2,10,9,11,12,13,7,14,15,16,86,87,19,20,21,74,38,39,40,41,34,46,26,76,27,28,29,30,31,80,36]))),yz=R.lazy(()=>ce(()=>import("./MethodsIndexView-CwAFmNPM.js"),__vite__mapDeps([88,1,26,76,30,31,82,64,3,59,65,60,21,58,61,2,62,9,83,78]))),_z=R.lazy(()=>ce(()=>import("./FrameworksIndexView-BHbIG7KF.js"),__vite__mapDeps([89,1,11,12,13,7,14,15,16,26]))),wz=R.lazy(()=>ce(()=>import("./TrendsView-VYiOkhSO.js"),__vite__mapDeps([90,1,31,30]))),xz=R.lazy(()=>ce(()=>import("./ConferencesIndexView-DKn6lpPt.js"),__vite__mapDeps([91,1,26,30,31,82,64,3,59,65,60,21,58,61,2,62,9]))),bz=R.lazy(()=>ce(()=>import("./AiDeadlinesView-DFDzpADq.js"),__vite__mapDeps([92,1,26,93,67,30,31,15,58]))),Ez=R.lazy(()=>ce(()=>import("./ConferenceDetailView-B6czFOLF.js"),__vite__mapDeps([94,1,74,38,39,40,41,34,12,14,2,46,26,7,30,31,15]))),Sz=R.lazy(()=>ce(()=>import("./ConferenceTaskView-WdW5o_l9.js"),__vite__mapDeps([95,1,11,12,13,7,14,15,16,19,20,21,74,38,39,40,41,34,2,46,26,27,28,29,30,31]))),Cz=R.lazy(()=>ce(()=>import("./OrganizationsIndexView-CvT2PFcr.js"),__vite__mapDeps([96,1,31,30,26,97]))),kz=R.lazy(()=>ce(()=>import("./OrganizationDetailView-DejGNmp9.js"),__vite__mapDeps([98,99,85,1,2,10,9,11,12,13,7,14,15,16,74,38,39,40,41,34,46,100,30,26,19,20,21,31,60,3,58,61,29,27,28,101]))),Pz=R.lazy(()=>ce(()=>import("./OrganizationTaskView-DqRaxVTK.js"),__vite__mapDeps([102,99,85,1,2,10,9,11,12,13,7,14,15,16,74,38,39,40,41,34,46,100,30,26,19,20,21,31,60,3,58,61,29,27,28,101]))),Rz=R.lazy(()=>ce(()=>import("./AuthorDetailView-bU4ydLti.js"),__vite__mapDeps([103,1,11,12,13,7,14,15,16,20,21,19,85,2,10,9,31,30,29,27,28,101]))),Tz=R.lazy(()=>ce(()=>import("./MethodDetailView-BesJdFsW.js"),__vite__mapDeps([104,85,1,2,10,9,12,28,11,13,7,14,15,16,19,20,21,74,38,39,40,41,34,46,26,76,29,30,31]))),Iz=R.lazy(()=>ce(()=>import("./BenchmarkDetailView-D9CMxLQx.js"),__vite__mapDeps([105,85,1,2,10,9,26,54,14,34,15,55,13,93,67,11,12,7,16,30,31,87,76,106]))),Oz=R.lazy(()=>ce(()=>import("./SavedPapersView-Cz0s6dJz.js"),__vite__mapDeps([107,12,1,11,13,7,14,15,16,30,31,71]))),Mz=R.lazy(()=>ce(()=>import("./SettingsView-Bk7rZu9X.js"),__vite__mapDeps([108,1,2,10,93,67,86,8,80,23,57,48,44,79]))),Nz=R.lazy(()=>ce(()=>import("./PrivacyView-BY3HWUzu.js"),__vite__mapDeps([109,57]))),Az=R.lazy(()=>ce(()=>import("./ApiDocsView-CArow2ru.js"),__vite__mapDeps([110,1,39,111]))),$z=R.lazy(()=>ce(()=>import("./McpView-D287q6AU.js"),__vite__mapDeps([112,1,57,49,36,44,42,113]))),Lz=R.lazy(()=>ce(()=>import("./SubmitView-DOOIhPRA.js"),__vite__mapDeps([114,2,31,3,59,65,14]))),jz=R.lazy(()=>ce(()=>import("./CronDashboard-ax5sO8xp.js"),__vite__mapDeps([115,1,116,68,3,24,66,78,81,37,77,117,44,118,61,119,2,70,28,4,26,23,120]))),Fz=R.lazy(()=>ce(()=>import("./AutonomousOperations-BTR1Cddl.js"),__vite__mapDeps([121,1,2,68,3,116,59,81,117]))),Dz=R.lazy(()=>ce(()=>import("./SubmissionsDashboard-CVsy2Di_.js"),__vite__mapDeps([122,63,12,1,2,26,15,14,62,118,61,117,119,123]))),zz=R.lazy(()=>ce(()=>import("./UserProfileView-DCfF3CNW.js"),__vite__mapDeps([124,1,100,30,26]))),Bz=R.lazy(()=>ce(()=>import("./RateLimitsView-ksu7TvSj.js"),__vite__mapDeps([125,1]))),Uz=R.lazy(()=>ce(()=>import("./AstraForRoboticsView-CJuXw7rp.js"),__vite__mapDeps([126,11,12,13,7,14,15,16,19,31,30,29,27,1,28,57,127]))),uh=R.lazy(()=>ce(()=>import("./NotFound-CK9eyj2q.js"),[])),K0=R.lazy(()=>ce(()=>import("./SearchOverlay-C1MdC-eB.js"),__vite__mapDeps([128,12,1,13,26,14,52,7]))),Vz=R.lazy(()=>ce(()=>import("./StagingAccessRequestView-_VYsleyo.js"),__vite__mapDeps([129,119]))),ch=()=>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}})]})]}),qz=new dA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Hz=()=>{const{arxivId:t}=_1();return w.jsx(To,{to:t?`/paper/${t}`:"/papers",replace:!0})},Wz=()=>{const{taskSlug:t}=_1();return w.jsx(To,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},Q0=({element:t})=>jo()?w.jsx(To,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:t}),Hk=({element:t})=>{const{user:e,isLoading:n}=om();return jo()?w.jsx(To,{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(hS,{returnTo:"/admin-dashboard"})]})})},Gz=()=>{const t=tL(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return R.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(Hk,{element:w.jsx(jz,{})})},Kz=()=>{const[t,e]=R.useState(!1),n=$n();return sz(),R.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),R.useEffect(()=>{const r=s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"&&(s.preventDefault(),e(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsx(Vz,{})}):n.pathname.startsWith("/pdf/")?w.jsxs("div",{className:"reader-route-shell",children:[w.jsx(D0,{onOpenSearch:()=>e(!0)}),w.jsx("div",{className:"reader-route-content",children:w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsx(Y_,{children:w.jsx(ue,{path:"/pdf/:paperId",element:sL()?w.jsx(vz,{}):w.jsx(uh,{})})})})}),t&&w.jsx(R.Suspense,{fallback:null,children:w.jsx(K0,{open:t,onClose:()=>e(!1)})})]}):w.jsxs(w.Fragment,{children:[w.jsx(D0,{onOpenSearch:()=>e(!0)}),w.jsx("main",{children:w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsxs(Y_,{children:[w.jsx(ue,{path:"/",element:w.jsx(cz,{})}),w.jsx(ue,{path:"/following",element:w.jsx(uz,{})}),w.jsx(ue,{path:"/chat/:sessionId?",element:al()?w.jsx(dz,{}):w.jsx(To,{to:"/",replace:!0})}),w.jsx(ue,{path:"/share/:shareId",element:al()?w.jsx(fz,{}):w.jsx(uh,{})}),w.jsx(ue,{path:"/papers",element:w.jsx(hz,{})}),w.jsx(ue,{path:"/papers/:arxivId",element:w.jsx(Hz,{})}),w.jsx(ue,{path:"/paper/:arxivId",element:w.jsx(pz,{})}),w.jsx(ue,{path:"/tasks",element:w.jsx(gz,{})}),w.jsx(ue,{path:"/tasks/:taskSlug",element:w.jsx(mz,{})}),w.jsx(ue,{path:"/task/:taskSlug",element:w.jsx(Wz,{})}),w.jsx(ue,{path:"/methods",element:w.jsx(yz,{})}),w.jsx(ue,{path:"/methods/:methodSlug",element:w.jsx(Tz,{})}),w.jsx(ue,{path:"/frameworks",element:w.jsx(_z,{})}),w.jsx(ue,{path:"/trends",element:w.jsx(wz,{})}),w.jsx(ue,{path:"/conferences",element:w.jsx(xz,{})}),w.jsx(ue,{path:"/ai-deadlines",element:w.jsx(bz,{})}),w.jsx(ue,{path:"/conferences/:confSlug",element:w.jsx(Ez,{})}),w.jsx(ue,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(Sz,{})}),w.jsx(ue,{path:"/organizations",element:w.jsx(Cz,{})}),w.jsx(ue,{path:"/orgs/:orgSlug",element:w.jsx(kz,{})}),w.jsx(ue,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(Pz,{})}),w.jsx(ue,{path:"/authors/:authorId",element:w.jsx(Rz,{})}),w.jsx(ue,{path:"/benchmark/:datasetSlug",element:w.jsx(Iz,{})}),w.jsx(ue,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(lz,{})}),w.jsx(ue,{path:"/submit",element:w.jsx(Lz,{})}),w.jsx(ue,{path:"/saved",element:w.jsx(Q0,{element:w.jsx(Oz,{})})}),w.jsx(ue,{path:"/settings",element:w.jsx(Mz,{})}),w.jsx(ue,{path:"/privacy",element:w.jsx(Nz,{})}),w.jsx(ue,{path:"/docs/api",element:w.jsx(Az,{})}),w.jsx(ue,{path:"/mcp",element:w.jsx($z,{})}),w.jsx(ue,{path:"/admin-dashboard",element:w.jsx(Gz,{})}),w.jsx(ue,{path:"/autonomous-operations",element:w.jsx(Hk,{element:w.jsx(Fz,{})})}),w.jsx(ue,{path:"/cron-dashboard",element:w.jsx(To,{to:"/admin-dashboard",replace:!0})}),w.jsx(ue,{path:"/submissions",element:w.jsx(Q0,{element:w.jsx(Dz,{})})}),w.jsx(ue,{path:"/rate-limits",element:w.jsx(Bz,{})}),w.jsx(ue,{path:"/astra-for-robotics",element:w.jsx(Uz,{})}),w.jsx(ue,{path:"/:username",element:w.jsx(zz,{})}),w.jsx(ue,{path:"*",element:w.jsx(uh,{})})]})})}),w.jsx(ID,{}),t&&w.jsx(R.Suspense,{fallback:null,children:w.jsx(K0,{open:t,onClose:()=>e(!1)})})]})},Qz=()=>w.jsx(fA,{client:qz,children:w.jsx(kD,{children:w.jsx(oz,{children:w.jsxs(nz,{children:[w.jsx(az,{children:w.jsx(Kz,{})}),w.jsx(l3,{}),w.jsx(L3,{}),!1]})})})});NM();const Yz=w.jsx(MT,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(OM,{children:w.jsx(Qz,{})})}),Xz=_b(document.getElementById("root"));Xz.render(w.jsx(R.StrictMode,{children:Yz}));export{RS as $,sm as A,uC as B,nL as C,uD as D,Fg as E,R as F,G0 as G,hS as H,UF as I,jo as J,eL as K,Rn as L,sL as M,c4 as N,dD as O,er as P,fD as Q,BF as R,lk as S,a3 as T,lr as U,u4 as V,ED as W,cD as X,aL as Y,iw as Z,ce as _,om as a,_l as a0,iv as a1,vS as a2,s3 as a3,eo as a4,G$ as a5,Q$ as a6,Y$ as a7,X$ as a8,Es as a9,T1 as aA,qN as aB,HN as aC,Hp as aD,k1 as aE,oA as aF,QN as aG,Ct as aH,r4 as aI,il as aJ,lA as aK,i4 as aL,s4 as aM,P1 as aN,AS as aO,$S as aP,LS as aQ,To as aR,$0 as aS,Z$ as aa,J$ as ab,l4 as ac,n4 as ad,IF as ae,iC as af,kd as ag,_d as ah,Q1 as ai,Ng as aj,z1 as ak,Mg as al,xl as am,oC as an,aC as ao,$n as ap,OT as aq,Zz as ar,CD as as,f4 as at,md as au,ZN as av,WN as aw,t4 as ax,Wp as ay,Sn as az,Rg as b,m4 as c,e4 as d,rL as e,d4 as f,Id as g,LD as h,al as i,w as j,w4 as k,aD as l,o4 as m,h4 as n,g4 as o,Re as p,yd as q,g as r,Xe as s,Z as t,_1 as u,EF as v,Ss as w,at as x,p4 as y,jS as z}; diff --git a/assets/index-BeqN5AbC.js b/assets/index-DyDOGuaE.js similarity index 99% rename from assets/index-BeqN5AbC.js rename to assets/index-DyDOGuaE.js index 998f2ac83843b07c93b10ed0dcf4d0f18a13e20d..6dc0069368934972acdc5323625cd72aa4f5c8c1 100644 --- a/assets/index-BeqN5AbC.js +++ b/assets/index-DyDOGuaE.js @@ -1,4 +1,4 @@ -import{ar as We,Z as Ot,j as Ze}from"./index-CA09r0fx.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,Z as Ot,j as Ze}from"./index-DGz7IJy3.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,x as n}from"./index-DGz7IJy3.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-DTsjFZ6p.js b/assets/loader-circle-DZdOKwBN.js similarity index 85% rename from assets/loader-circle-DTsjFZ6p.js rename to assets/loader-circle-DZdOKwBN.js index e4139b2a4ee6f1b716b78eadb3579ee60ce5f825..66ca3da4e8d6c94254793afa065606b5ddbbaef3 100644 --- a/assets/loader-circle-DTsjFZ6p.js +++ b/assets/loader-circle-DZdOKwBN.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-CA09r0fx.js";/** +import{g as e}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/mail-DhwziyiT.js b/assets/mail-Dydp9Gj0.js similarity index 97% rename from assets/mail-DhwziyiT.js rename to assets/mail-Dydp9Gj0.js index 954391ea1f1cf3306a734c928994baeaab38a5b3..00b23cf5d00399d5c42f905c23a6553ca5ceac40 100644 --- a/assets/mail-DhwziyiT.js +++ b/assets/mail-Dydp9Gj0.js @@ -1,4 +1,4 @@ -import{g as a}from"./index-CA09r0fx.js";/** +import{g as a}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/moon-Cn0WCdQ9.js b/assets/moon-BTUByzSL.js similarity index 85% rename from assets/moon-Cn0WCdQ9.js rename to assets/moon-BTUByzSL.js index 3b810f8a57fcf9d4c895b5c33b09c8083ab2a9ae..1b1cd98397e3131c2755a60749c9973a70553ccd 100644 --- a/assets/moon-Cn0WCdQ9.js +++ b/assets/moon-BTUByzSL.js @@ -1,4 +1,4 @@ -import{g as o}from"./index-CA09r0fx.js";/** +import{g as o}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-B__IMcd_.js b/assets/openrouter-yE0IuBaT.js similarity index 82% rename from assets/openrouter-B__IMcd_.js rename to assets/openrouter-yE0IuBaT.js index 6be284ff066e2462988e4d80c9b4d932d721ad69..3618b22abd994a75b35d440aa3737e742ba4ab69 100644 --- a/assets/openrouter-B__IMcd_.js +++ b/assets/openrouter-yE0IuBaT.js @@ -1 +1 @@ -import{u as r}from"./useQuery-GCOPnmOE.js";import{c as n}from"./chat-XoDxf8nx.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-SnJNmisF.js";import{c as n}from"./chat-C_06RcUY.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/operations-CpjCuL3Z.js b/assets/operations-C37-eWov.js similarity index 97% rename from assets/operations-CpjCuL3Z.js rename to assets/operations-C37-eWov.js index a78a26a2a7372fe82a865a832dcf4ed9e9e58bdb..50d4fdfd82a24638e624ab0ee316c7f3c6481265 100644 --- a/assets/operations-CpjCuL3Z.js +++ b/assets/operations-C37-eWov.js @@ -1 +1 @@ -import{r as s,j as a,x as n,a1 as u}from"./index-CA09r0fx.js";const c=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("rounded-lg border bg-card text-card-foreground shadow-sm",o),...e}));c.displayName="Card";const f=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex flex-col space-y-1.5 p-6",o),...e}));f.displayName="CardHeader";const m=s.forwardRef(({className:o,...e},t)=>a.jsx("h3",{ref:t,className:n("text-2xl font-semibold leading-none tracking-tight",o),...e}));m.displayName="CardTitle";const p=s.forwardRef(({className:o,...e},t)=>a.jsx("p",{ref:t,className:n("text-sm text-muted-foreground",o),...e}));p.displayName="CardDescription";const l=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("p-6 pt-0",o),...e}));l.displayName="CardContent";const h=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex items-center p-6 pt-0",o),...e}));h.displayName="CardFooter";function y(o){if(!o)return"Never";const e=new Date(o);if(Number.isNaN(e.getTime()))return o;const t=Date.now()-e.getTime(),r=Math.floor(t/6e4),i=Math.floor(t/36e5),d=Math.floor(t/864e5);return r<1?"Just now":r<60?`${r}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 C{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,r){return this.request("/admin/autonomous-operations/manual-mode",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e,expected_revision:t,confirmation:r})})}setAutonomousOperator(e,t,r,i){return this.request(`/admin/autonomous-operations/operators/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t,expected_revision:r,confirmation:i})})}qualifyAutonomousChatBaseline(e,t,r){return this.request("/admin/autonomous-operations/chat-baseline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sha:e,expected_revision:t,confirmation:r})})}}const g=new C(u);export{c as C,f as a,m as b,p as c,l as d,y as f,g as o}; +import{r as s,j as a,x as n,a1 as u}from"./index-DGz7IJy3.js";const c=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("rounded-lg border bg-card text-card-foreground shadow-sm",o),...e}));c.displayName="Card";const f=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex flex-col space-y-1.5 p-6",o),...e}));f.displayName="CardHeader";const m=s.forwardRef(({className:o,...e},t)=>a.jsx("h3",{ref:t,className:n("text-2xl font-semibold leading-none tracking-tight",o),...e}));m.displayName="CardTitle";const p=s.forwardRef(({className:o,...e},t)=>a.jsx("p",{ref:t,className:n("text-sm text-muted-foreground",o),...e}));p.displayName="CardDescription";const l=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("p-6 pt-0",o),...e}));l.displayName="CardContent";const h=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex items-center p-6 pt-0",o),...e}));h.displayName="CardFooter";function y(o){if(!o)return"Never";const e=new Date(o);if(Number.isNaN(e.getTime()))return o;const t=Date.now()-e.getTime(),r=Math.floor(t/6e4),i=Math.floor(t/36e5),d=Math.floor(t/864e5);return r<1?"Just now":r<60?`${r}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 C{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,r){return this.request("/admin/autonomous-operations/manual-mode",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e,expected_revision:t,confirmation:r})})}setAutonomousOperator(e,t,r,i){return this.request(`/admin/autonomous-operations/operators/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t,expected_revision:r,confirmation:i})})}qualifyAutonomousChatBaseline(e,t,r){return this.request("/admin/autonomous-operations/chat-baseline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sha:e,expected_revision:t,confirmation:r})})}}const g=new C(u);export{c as C,f as a,m as b,p as c,l as d,y as f,g as o}; diff --git a/assets/paperEdits-BaXeJ-Bi.js b/assets/paperEdits-BtAPUkKl.js similarity index 87% rename from assets/paperEdits-BaXeJ-Bi.js rename to assets/paperEdits-BtAPUkKl.js index 5c9a8ceec684c6f9d4449cfcf1f106912b81bacf..d892f941ea1c46de63a2e4695698e2603c370cb2 100644 --- a/assets/paperEdits-BaXeJ-Bi.js +++ b/assets/paperEdits-BtAPUkKl.js @@ -1 +1 @@ -import{a1 as p}from"./index-CA09r0fx.js";const i={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),history:(e,o)=>p(`/papers/${e}/edit-history${o?`?cursor=${encodeURIComponent(o)}`:""}`),digest:(e,o)=>p(`/admin/paper-edit-digest?day=${e}&page=${o}`),suspend:(e,o)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:o})})};export{i as p}; +import{a1 as p}from"./index-DGz7IJy3.js";const i={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),history:(e,o)=>p(`/papers/${e}/edit-history${o?`?cursor=${encodeURIComponent(o)}`:""}`),digest:(e,o)=>p(`/admin/paper-edit-digest?day=${e}&page=${o}`),suspend:(e,o)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:o})})};export{i as p}; diff --git a/assets/papers-2SfezChA.js b/assets/papers-CgK5TA59.js similarity index 99% rename from assets/papers-2SfezChA.js rename to assets/papers-CgK5TA59.js index a6b49212f4e6f25c303bcbf6b2d55ec9f49ff618..ef9d210059ccb1030e07c3a7665f3ddf4c0d03ee 100644 --- a/assets/papers-2SfezChA.js +++ b/assets/papers-CgK5TA59.js @@ -1 +1 @@ -var w=Object.defineProperty;var S=(n,e,t)=>e in n?w(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var f=(n,e,t)=>S(n,typeof e!="symbol"?e+"":e,t);import{A as m,E as $,a1 as l,as as g}from"./index-CA09r0fx.js";const d="pwc:fresh-auth-mutation";function v(n){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",n);const e=$("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class P{constructor(e,t=v){f(this,"paperLoads",new Map);f(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(s=>{throw this.paperLoads.delete(e),s}),this.paperLoads.set(e,r)),r}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(s=>{throw this.evaluationLoads.delete(e),s}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,t,r,s,o){const a=this.paperLoads.get(e);if(!a)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const i=(await a).sections[t];if(!i)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,s,r,i,o,`paper:${e}:${t}`)}async mutateEvaluations(e,t,r,s){const o=this.evaluationLoads.get(String(e));if(!o)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const a=(await o).version;return this.mutate("evaluations",r,t,a,s,`paper:${e}:evaluations`)}async mutate(e,t,r,s,o,a){const i=new Headers(o.headers);Object.entries(this.idempotencyHeaders(a,r,s)).forEach(([h,y])=>i.set(h,y));const p={...o,headers:i};try{const h=await this.request(t,p);return this.clearAttempt(p),h}catch(h){throw h instanceof m&&h.status===401&&h.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,r,p),this.recoverFreshAuth(e)):h instanceof m&&h.status===409&&(this.clearAttempt(p),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),h}}freshAuthMutationDraft(){const e=sessionStorage.getItem(d);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(d),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(d),sessionStorage.removeItem("pwc:fresh-auth-edit"),t}saveFreshAuthMutation(e,t,r,s){const o=Object.fromEntries(new Headers(s.headers).entries()),a=typeof s.body=="string"?s.body:void 0;sessionStorage.setItem(d,JSON.stringify({section:e,endpoint:t,payload:r,options:{method:(s.method??"POST").toUpperCase(),body:a,headers:o}}))}idempotencyHeaders(e,t,r){const s=`pwc:mutation:${e}:${JSON.stringify(t)}`,o=sessionStorage.getItem(s);if(o){const i=JSON.parse(o);return{"Idempotency-Key":i.key,"If-Match":i.version}}const a=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:a,version:r})),sessionStorage.setItem(`pwc:mutation-key:${a}`,s),{"Idempotency-Key":a,"If-Match":r}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const r=sessionStorage.getItem(`pwc:mutation-key:${t}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const u=new P(l);function c(n){const e=new URLSearchParams;for(const[r,s]of Object.entries(n??{}))s!==void 0&&s!==""&&e.set(r,String(s));const t=e.toString();return t?`?${t}`:""}class q{constructor(e){this.request=e}list(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&o!==""&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,o,a){const i=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&i.set("mode",s),a!=null&&a.start_date&&i.set("start_date",a.start_date),a!=null&&a.end_date&&i.set("end_date",a.end_date),this.request(`/papers/search?${i.toString()}`,{signal:o})}searchFeed(e){return this.request(`/papers/search/feed${c(e)}`,{cache:"no-cache"})}get(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,t=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${t}`)}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,t){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}trending(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,t){return this.request(`/tasks/${e}/papers${c(t)}`)}forMethod(e,t){return this.request(`/methods/${encodeURIComponent(e)}/papers${c(t)}`)}forConference(e,t){return this.request(`/conferences/${e}/papers${c(t)}`)}forOrganization(e,t){return this.request(`/organizations/${e}/papers${c(t)}`)}getAuthor(e){return this.request(`/authors/${e}`)}primeCurationState(e,t=!1){return u.primePaper(e,t)}freshAuthMutationDraft(){return u.freshAuthMutationDraft()}resumeFreshAuthMutation(){return u.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return u.mutatePaper(e,"tasks",t,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,t){const r=new URLSearchParams(t.map(s=>["method_ids",String(s)])).toString();return u.mutatePaper(e,"methods",t,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,t){const r=new URLSearchParams(t.map(s=>["organization_ids",String(s)])).toString();return u.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return u.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return u.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateXThreads(e,t){return u.mutatePaper(e,"x_threads",t,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:t})})}updateSourceUrl(e,t){return u.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return u.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const A=new q(l);async function T(n){const e=await g(`/papers/${encodeURIComponent(n)}/web-markdown`);if(!e.ok)throw new m(e,await e.text());return e.text()}async function _(n){const e=await g(`/papers/${encodeURIComponent(n)}/layout`);if(e.status===404)return null;if(!e.ok)throw new m(e,await e.text());return e.json()}export{_ as a,u as b,T as g,A as p}; +var w=Object.defineProperty;var S=(n,e,t)=>e in n?w(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var f=(n,e,t)=>S(n,typeof e!="symbol"?e+"":e,t);import{A as m,E as $,a1 as l,as as g}from"./index-DGz7IJy3.js";const d="pwc:fresh-auth-mutation";function v(n){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",n);const e=$("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class P{constructor(e,t=v){f(this,"paperLoads",new Map);f(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(s=>{throw this.paperLoads.delete(e),s}),this.paperLoads.set(e,r)),r}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(s=>{throw this.evaluationLoads.delete(e),s}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,t,r,s,o){const a=this.paperLoads.get(e);if(!a)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const i=(await a).sections[t];if(!i)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,s,r,i,o,`paper:${e}:${t}`)}async mutateEvaluations(e,t,r,s){const o=this.evaluationLoads.get(String(e));if(!o)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const a=(await o).version;return this.mutate("evaluations",r,t,a,s,`paper:${e}:evaluations`)}async mutate(e,t,r,s,o,a){const i=new Headers(o.headers);Object.entries(this.idempotencyHeaders(a,r,s)).forEach(([h,y])=>i.set(h,y));const p={...o,headers:i};try{const h=await this.request(t,p);return this.clearAttempt(p),h}catch(h){throw h instanceof m&&h.status===401&&h.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,r,p),this.recoverFreshAuth(e)):h instanceof m&&h.status===409&&(this.clearAttempt(p),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),h}}freshAuthMutationDraft(){const e=sessionStorage.getItem(d);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(d),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(d),sessionStorage.removeItem("pwc:fresh-auth-edit"),t}saveFreshAuthMutation(e,t,r,s){const o=Object.fromEntries(new Headers(s.headers).entries()),a=typeof s.body=="string"?s.body:void 0;sessionStorage.setItem(d,JSON.stringify({section:e,endpoint:t,payload:r,options:{method:(s.method??"POST").toUpperCase(),body:a,headers:o}}))}idempotencyHeaders(e,t,r){const s=`pwc:mutation:${e}:${JSON.stringify(t)}`,o=sessionStorage.getItem(s);if(o){const i=JSON.parse(o);return{"Idempotency-Key":i.key,"If-Match":i.version}}const a=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:a,version:r})),sessionStorage.setItem(`pwc:mutation-key:${a}`,s),{"Idempotency-Key":a,"If-Match":r}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const r=sessionStorage.getItem(`pwc:mutation-key:${t}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const u=new P(l);function c(n){const e=new URLSearchParams;for(const[r,s]of Object.entries(n??{}))s!==void 0&&s!==""&&e.set(r,String(s));const t=e.toString();return t?`?${t}`:""}class q{constructor(e){this.request=e}list(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&o!==""&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,o,a){const i=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&i.set("mode",s),a!=null&&a.start_date&&i.set("start_date",a.start_date),a!=null&&a.end_date&&i.set("end_date",a.end_date),this.request(`/papers/search?${i.toString()}`,{signal:o})}searchFeed(e){return this.request(`/papers/search/feed${c(e)}`,{cache:"no-cache"})}get(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,t=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${t}`)}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,t){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}trending(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,t){return this.request(`/tasks/${e}/papers${c(t)}`)}forMethod(e,t){return this.request(`/methods/${encodeURIComponent(e)}/papers${c(t)}`)}forConference(e,t){return this.request(`/conferences/${e}/papers${c(t)}`)}forOrganization(e,t){return this.request(`/organizations/${e}/papers${c(t)}`)}getAuthor(e){return this.request(`/authors/${e}`)}primeCurationState(e,t=!1){return u.primePaper(e,t)}freshAuthMutationDraft(){return u.freshAuthMutationDraft()}resumeFreshAuthMutation(){return u.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return u.mutatePaper(e,"tasks",t,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,t){const r=new URLSearchParams(t.map(s=>["method_ids",String(s)])).toString();return u.mutatePaper(e,"methods",t,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,t){const r=new URLSearchParams(t.map(s=>["organization_ids",String(s)])).toString();return u.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return u.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return u.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateXThreads(e,t){return u.mutatePaper(e,"x_threads",t,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:t})})}updateSourceUrl(e,t){return u.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return u.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const A=new q(l);async function T(n){const e=await g(`/papers/${encodeURIComponent(n)}/web-markdown`);if(!e.ok)throw new m(e,await e.text());return e.text()}async function _(n){const e=await g(`/papers/${encodeURIComponent(n)}/layout`);if(e.status===404)return null;if(!e.ok)throw new m(e,await e.text());return e.json()}export{_ as a,u as b,T as g,A as p}; diff --git a/assets/plus-BGozleiT.js b/assets/plus-v7R1dHou.js similarity index 86% rename from assets/plus-BGozleiT.js rename to assets/plus-v7R1dHou.js index 56e8e4cf5cdb5623f7e0b23ee4a039115cdf08e6..8c35065bd9b91d957665700cc442cd04db5653c3 100644 --- a/assets/plus-BGozleiT.js +++ b/assets/plus-v7R1dHou.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-CA09r0fx.js";/** +import{g as e}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/popover-D6rzCRBR.js b/assets/popover-VInL7Z23.js similarity index 98% rename from assets/popover-D6rzCRBR.js rename to assets/popover-VInL7Z23.js index 86886765b6e5725802368eb3dbaae3c5b98cf3d4..2d20febc543beaa3484005d49f4913ef3194471a 100644 --- a/assets/popover-D6rzCRBR.js +++ b/assets/popover-VInL7Z23.js @@ -1 +1 @@ -import{r as s,j as l,a9 as V,q as $,ae as L,a4 as W,s as A,p as O,t as h,af as E,ag as y,P as _,ah as H,w as z,ai as G,aj as B,ak as K,al as Z,am as q,an as U,ao as J,x as Q}from"./index-CA09r0fx.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(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}; +import{r as s,j as l,a9 as V,q as $,ae as L,a4 as W,s as A,p as O,t as h,af as E,ag as y,P as _,ah as H,w as z,ai as G,aj as B,ak as K,al as Z,am as q,an as U,ao as J,x as Q}from"./index-DGz7IJy3.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(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/refresh-cw-D8COsQ3x.js b/assets/refresh-cw-By5_OblM.js similarity index 94% rename from assets/refresh-cw-D8COsQ3x.js rename to assets/refresh-cw-By5_OblM.js index e5fff999f15593babe98f15a182584ebb6e24e8f..b6fd8f385a5e70e803e62b8f6c2898ab0356b5a6 100644 --- a/assets/refresh-cw-D8COsQ3x.js +++ b/assets/refresh-cw-By5_OblM.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-CA09r0fx.js";/** +import{g as e}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/research-CAknkOM8.js b/assets/research-C0oNhyj8.js similarity index 89% rename from assets/research-CAknkOM8.js rename to assets/research-C0oNhyj8.js index 69ad71aa3aa137100152fdfe3296956d3ae91f16..1133e34b67b565a96f78e33ce3fa663f5f2ed9fe 100644 --- a/assets/research-CAknkOM8.js +++ b/assets/research-C0oNhyj8.js @@ -1 +1 @@ -import{a1 as s}from"./index-CA09r0fx.js";const r={follows:()=>s("/me/follows"),setFollow:(t,e,a)=>s(`/me/follows/${t}/${e}`,{method:a?"PUT":"DELETE"}),following:(t=0,e={})=>{const a=new URLSearchParams({offset:String(t),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.hasCode&&a.set("has_code","true"),e.hasHfArtifacts&&a.set("has_hf_artifacts","true"),s(`/me/following?${a}`)},email:()=>s("/me/research-email"),setEmail:t=>s("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:t})})};export{r}; +import{a1 as s}from"./index-DGz7IJy3.js";const r={follows:()=>s("/me/follows"),setFollow:(t,e,a)=>s(`/me/follows/${t}/${e}`,{method:a?"PUT":"DELETE"}),following:(t=0,e={})=>{const a=new URLSearchParams({offset:String(t),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.hasCode&&a.set("has_code","true"),e.hasHfArtifacts&&a.set("has_hf_artifacts","true"),s(`/me/following?${a}`)},email:()=>s("/me/research-email"),setEmail:t=>s("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:t})})};export{r}; diff --git a/assets/savedPapersAuth-WTp5kQxS.js b/assets/savedPapersAuth-BLCvmsFl.js similarity index 85% rename from assets/savedPapersAuth-WTp5kQxS.js rename to assets/savedPapersAuth-BLCvmsFl.js index 2fd9807989e8d3af7d327d6c50f945fc8f170fd5..f92b2a304ae423d7da391776325d706b5906c42d 100644 --- a/assets/savedPapersAuth-WTp5kQxS.js +++ b/assets/savedPapersAuth-BLCvmsFl.js @@ -1 +1 @@ -import{E as i}from"./index-CA09r0fx.js";const s="saved_papers_authorized";function u(n=!1){const r=i("/api/v1/auth/hf/login"),o=new URL(r,window.location.origin).origin,t=new URL(window.location.href);n&&t.searchParams.set(s,"1");const a=o===window.location.origin?`${t.pathname}${t.search}${t.hash}`:t.toString(),e=new URLSearchParams({return_to:a,authorize_bucket:"true",bucket_create:"true"});return`${r}?${e.toString()}`}export{s as S,u as s}; +import{E as i}from"./index-DGz7IJy3.js";const s="saved_papers_authorized";function u(n=!1){const r=i("/api/v1/auth/hf/login"),o=new URL(r,window.location.origin).origin,t=new URL(window.location.href);n&&t.searchParams.set(s,"1");const a=o===window.location.origin?`${t.pathname}${t.search}${t.hash}`:t.toString(),e=new URLSearchParams({return_to:a,authorize_bucket:"true",bucket_create:"true"});return`${r}?${e.toString()}`}export{s as S,u as s}; diff --git a/assets/searchable-select-CNl4nXvO.js b/assets/searchable-select-C2BNEPyI.js similarity index 98% rename from assets/searchable-select-CNl4nXvO.js rename to assets/searchable-select-C2BNEPyI.js index 57d50838ab56cc4de4575e6407ac62b95525bb88..a7ad9aa0fc6a10a9cf2faac2cb9da586e277214b 100644 --- a/assets/searchable-select-CNl4nXvO.js +++ b/assets/searchable-select-C2BNEPyI.js @@ -1,4 +1,4 @@ -import{g as he,r as a,a4 as Q,p as L,a5 as Me,a6 as De,a7 as $e,a8 as Le,a9 as H,j as p,x as D,l as Pe}from"./index-CA09r0fx.js";import{u as Fe}from"./useQuery-GCOPnmOE.js";import{B as qe}from"./button-BkpxXw_S.js";import{P as Ke,a as Ve,b as Be}from"./popover-D6rzCRBR.js";import"./dialog-BMl1SbyK.js";import{L as Ue}from"./loader-circle-DTsjFZ6p.js";/** +import{g as he,r as a,a4 as Q,p as L,a5 as Me,a6 as De,a7 as $e,a8 as Le,a9 as H,j as p,x as D,l as Pe}from"./index-DGz7IJy3.js";import{u as Fe}from"./useQuery-SnJNmisF.js";import{B as qe}from"./button-DEdvni-v.js";import{P as Ke,a as Ve,b as Be}from"./popover-VInL7Z23.js";import"./dialog-DRb-cMlG.js";import{L as Ue}from"./loader-circle-DZdOKwBN.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/share-2-B8SQJ4QE.js b/assets/share-2-Byoooou-.js similarity index 91% rename from assets/share-2-B8SQJ4QE.js rename to assets/share-2-Byoooou-.js index 0cfa807b6ee422ddd757bb4ce612658d367b713e..4a800cf93cc9a765c10e525443128ef4f86f305e 100644 --- a/assets/share-2-B8SQJ4QE.js +++ b/assets/share-2-Byoooou-.js @@ -1,4 +1,4 @@ -import{g as c}from"./index-CA09r0fx.js";/** +import{g as c}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/shield-alert-DFYdQl7U.js b/assets/shield-alert-BJn-Krlm.js similarity index 91% rename from assets/shield-alert-DFYdQl7U.js rename to assets/shield-alert-BJn-Krlm.js index 71c2c32ec60c23c89fd8029432f94bc29bcadc8c..52c2989f18d729ab4f0754c05f47a38177dbef02 100644 --- a/assets/shield-alert-DFYdQl7U.js +++ b/assets/shield-alert-BJn-Krlm.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-CA09r0fx.js";/** +import{g as e}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-CiNN3v7Q.js b/assets/skeleton-Qth9DQSW.js similarity index 62% rename from assets/skeleton-CiNN3v7Q.js rename to assets/skeleton-Qth9DQSW.js index 726f2ff13cca88e6725a286c719e551b91291d86..68aab6815707cc3220ef2a924bb6be3ccfa2e06d 100644 --- a/assets/skeleton-CiNN3v7Q.js +++ b/assets/skeleton-Qth9DQSW.js @@ -1 +1 @@ -import{j as t,x as n}from"./index-CA09r0fx.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,x as n}from"./index-DGz7IJy3.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/submissions-CERjLe5i.js b/assets/submissions-0YkeXTxt.js similarity index 99% rename from assets/submissions-CERjLe5i.js rename to assets/submissions-0YkeXTxt.js index 4b180c26a706dd27a8ec31d0d34a6a92eea3cd80..29480d9da71b56d26588ed0809efcc46d83b556c 100644 --- a/assets/submissions-CERjLe5i.js +++ b/assets/submissions-0YkeXTxt.js @@ -1 +1 @@ -import{a1 as qe}from"./index-CA09r0fx.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 N.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 R 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 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,...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 Ne 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)}}Ne.create=s=>new Ne({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 Ae extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ae.create=s=>new Ae({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 N 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 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,...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 N?new N({...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 E=s=>s instanceof _e?E(s.schema):s instanceof z?E(s.innerType()):s instanceof se?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?E(s._def.innerType):s instanceof he?[void 0]:s instanceof fe?[null]:s instanceof j?[void 0,...E(s.unwrap())]:s instanceof L?[null,...E(s.unwrap())]:s instanceof Me||s instanceof ie?E(s.unwrap()):s instanceof ae?E(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=E(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:R.create(),valueType:e,typeName:_.ZodRecord,...y(t)})}}class Ee 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}}}}Ee.create=(s,e,t)=>new Ee({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 Re 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}}}Re.create=s=>new Re({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=R.create,b=B.create,oe=le.create,_t=pe.create;P.create;const T=N.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 A=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(),is_author:oe(),status:ge(["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:ge(["human","codex"]).nullish(),review_evidence:A.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)})),Nt=S("evaluations",k({operations:T(gt)}),k({evaluations:T(yt)})),At=S("repositories",k({repositories:T(de)}),k({repositories:T(de)})),Zt=S("project_pages",k({project_pages:T(de)}),k({project_pages:T(de)})),Et=S("source_url",k({source_url:l()}),k({source_url:l().nullish()})),Rt=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,A),Pt=S("new_method",xt,A),Mt=S("new_benchmark",kt,A),Vt=S("new_metric",bt,A),zt=S("new_conference",wt,A),Lt=S("new_organization",Tt,A),Dt=S("new_external_paper",k({title:l().optional(),source_url:l(),authors:T(l()),date_published:l().optional(),abstract:l().optional()}),A),De=ze("edit_type",[Ct,Ot,Nt,At,Zt,Et,Rt,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)}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}; +import{a1 as qe}from"./index-DGz7IJy3.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 N.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 R 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 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,...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 Ne 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)}}Ne.create=s=>new Ne({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 Ae extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ae.create=s=>new Ae({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 N 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 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,...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 N?new N({...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 E=s=>s instanceof _e?E(s.schema):s instanceof z?E(s.innerType()):s instanceof se?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?E(s._def.innerType):s instanceof he?[void 0]:s instanceof fe?[null]:s instanceof j?[void 0,...E(s.unwrap())]:s instanceof L?[null,...E(s.unwrap())]:s instanceof Me||s instanceof ie?E(s.unwrap()):s instanceof ae?E(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=E(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:R.create(),valueType:e,typeName:_.ZodRecord,...y(t)})}}class Ee 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}}}}Ee.create=(s,e,t)=>new Ee({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 Re 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}}}Re.create=s=>new Re({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=R.create,b=B.create,oe=le.create,_t=pe.create;P.create;const T=N.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 A=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(),is_author:oe(),status:ge(["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:ge(["human","codex"]).nullish(),review_evidence:A.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)})),Nt=S("evaluations",k({operations:T(gt)}),k({evaluations:T(yt)})),At=S("repositories",k({repositories:T(de)}),k({repositories:T(de)})),Zt=S("project_pages",k({project_pages:T(de)}),k({project_pages:T(de)})),Et=S("source_url",k({source_url:l()}),k({source_url:l().nullish()})),Rt=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,A),Pt=S("new_method",xt,A),Mt=S("new_benchmark",kt,A),Vt=S("new_metric",bt,A),zt=S("new_conference",wt,A),Lt=S("new_organization",Tt,A),Dt=S("new_external_paper",k({title:l().optional(),source_url:l(),authors:T(l()),date_published:l().optional(),abstract:l().optional()}),A),De=ze("edit_type",[Ct,Ot,Nt,At,Zt,Et,Rt,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)}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/switch-VPV7aWRb.js b/assets/switch-CwjWc_fX.js similarity index 94% rename from assets/switch-VPV7aWRb.js rename to assets/switch-CwjWc_fX.js index 960f346fd501a85355773619ad597b2e32b5558d..ced9a1a886e99cde23ae94d30debab8d066497df 100644 --- a/assets/switch-VPV7aWRb.js +++ b/assets/switch-CwjWc_fX.js @@ -1 +1 @@ -import{r as s,s as C,q as I,j as a,p as y,t as M,v as H,w as q,x as g}from"./index-CA09r0fx.js";import{u as A}from"./index-1y8ilIyE.js";var b="Switch",[U]=q(b),[z,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(z,{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=A(e),v=H(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,s as C,q as I,j as a,p as y,t as M,v as H,w as q,x as g}from"./index-DGz7IJy3.js";import{u as A}from"./index-Bx9aRYc1.js";var b="Switch",[U]=q(b),[z,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(z,{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=A(e),v=H(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-FDLjm_7X.js b/assets/textarea-BC6nB3vb.js similarity index 86% rename from assets/textarea-FDLjm_7X.js rename to assets/textarea-BC6nB3vb.js index 8b3ab5e3589798d5f69222543a96df47a8d88ae6..ba474799db75165bb0a548554510c6cb138728ba 100644 --- a/assets/textarea-FDLjm_7X.js +++ b/assets/textarea-BC6nB3vb.js @@ -1 +1 @@ -import{r as s,j as a,x as t}from"./index-CA09r0fx.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,x as t}from"./index-DGz7IJy3.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-BxkpoAw0.js b/assets/thumbs-up-C5Gnbt6N.js similarity index 90% rename from assets/thumbs-up-BxkpoAw0.js rename to assets/thumbs-up-C5Gnbt6N.js index 1fe56231b7e1b944c71ded0be1f456f419824dbf..7e94dbce09f5eed6deb7354682639cbc63705340 100644 --- a/assets/thumbs-up-BxkpoAw0.js +++ b/assets/thumbs-up-C5Gnbt6N.js @@ -1,4 +1,4 @@ -import{g as a}from"./index-CA09r0fx.js";/** +import{g as a}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/trending-up-DpdmhQm9.js b/assets/trending-up-E7e_PcEb.js similarity index 88% rename from assets/trending-up-DpdmhQm9.js rename to assets/trending-up-E7e_PcEb.js index f08f73da5f8cf1d2fcf7d03e5475ca9ab44671d9..d6d9f2240859158745ee02116c977f1a6619b5ab 100644 --- a/assets/trending-up-DpdmhQm9.js +++ b/assets/trending-up-E7e_PcEb.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-CA09r0fx.js";/** +import{g as e}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/triangle-alert-CFbLex2p.js b/assets/triangle-alert-C4uGz6dq.js similarity index 94% rename from assets/triangle-alert-CFbLex2p.js rename to assets/triangle-alert-C4uGz6dq.js index 82d8044bfe96639649c1aedeb6d4f614aaa05f15..5ea1d2fe9aa0f8a20877f9a179ce00528e137e9a 100644 --- a/assets/triangle-alert-CFbLex2p.js +++ b/assets/triangle-alert-C4uGz6dq.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-CA09r0fx.js";/** +import{g as e}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/trophy-C7Evgy5l.js b/assets/trophy-B1w2ILFe.js similarity index 93% rename from assets/trophy-C7Evgy5l.js rename to assets/trophy-B1w2ILFe.js index d7e407a87b789dcd4ae9782975b6a662762d78d1..0e68fa00ff9a972c052c8b21340d71e470679d99 100644 --- a/assets/trophy-C7Evgy5l.js +++ b/assets/trophy-B1w2ILFe.js @@ -1,4 +1,4 @@ -import{g as a}from"./index-CA09r0fx.js";/** +import{g as a}from"./index-DGz7IJy3.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/useDebounce-D9TiKPXO.js b/assets/useDebounce-CZ3fZlNX.js similarity index 66% rename from assets/useDebounce-D9TiKPXO.js rename to assets/useDebounce-CZ3fZlNX.js index 830a7765e0f4ebe69efc7b7967994fa3a98eb4ff..7d155cd26af33a313f89bec5f2f795b024c0c281 100644 --- a/assets/useDebounce-D9TiKPXO.js +++ b/assets/useDebounce-CZ3fZlNX.js @@ -1 +1 @@ -import{r as o}from"./index-CA09r0fx.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-DGz7IJy3.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/useInfiniteQuery-TrlVUjws.js b/assets/useInfiniteQuery-Bix5WR2s.js similarity index 89% rename from assets/useInfiniteQuery-TrlVUjws.js rename to assets/useInfiniteQuery-Bix5WR2s.js index a48efa54d0d741d616bc21ee27d198fc2b319510..8f85c3a997ae5296c240fd23e78838de6e48c37f 100644 --- a/assets/useInfiniteQuery-TrlVUjws.js +++ b/assets/useInfiniteQuery-Bix5WR2s.js @@ -1 +1 @@ -import{Q as v,a as p}from"./useQuery-GCOPnmOE.js";import{aL as x,aM as b}from"./index-CA09r0fx.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 M(e,t){return p(e,l)}export{M as u}; +import{Q as v,a as p}from"./useQuery-SnJNmisF.js";import{aL as x,aM as b}from"./index-DGz7IJy3.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 M(e,t){return p(e,l)}export{M as u}; diff --git a/assets/useIntersectionObserver-jfqowp0n.js b/assets/useIntersectionObserver-B7kBuOiP.js similarity index 86% rename from assets/useIntersectionObserver-jfqowp0n.js rename to assets/useIntersectionObserver-B7kBuOiP.js index 2d6686b322608968911425e217582e6627b29fc7..84dfcc15e361aa5125f05b4820dc1e2afc62f4f4 100644 --- a/assets/useIntersectionObserver-jfqowp0n.js +++ b/assets/useIntersectionObserver-B7kBuOiP.js @@ -1 +1 @@ -import{r}from"./index-CA09r0fx.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-DGz7IJy3.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-CUMX1r3q.js b/assets/useMutation-B1oRtfbH.js similarity index 97% rename from assets/useMutation-CUMX1r3q.js rename to assets/useMutation-B1oRtfbH.js index 3845aae63beace66ed1649b1826588289d3434f3..bb2433ee9a9ec146e37c1364752ca7b5bdcfee4b 100644 --- a/assets/useMutation-CUMX1r3q.js +++ b/assets/useMutation-B1oRtfbH.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),y=(i,t,s)=>(E(i,t,"access private method"),s);import{au as U,ax as k,aJ as j,aK as q,aH as P,m as I,r as v,az as L,aI as z}from"./index-CA09r0fx.js";var a,c,o,h,n,C,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,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,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,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,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,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={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,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function J(i,t){const s=I(),[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{J 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{au as U,ax as k,aJ as j,aK as q,aH as P,m as I,r as v,az as L,aI as z}from"./index-DGz7IJy3.js";var a,c,o,h,n,C,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,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,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,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,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,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={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,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function J(i,t){const s=I(),[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{J as u}; diff --git a/assets/usePapers-Bb48_cnL.js b/assets/usePapers-knk68Pd9.js similarity index 95% rename from assets/usePapers-Bb48_cnL.js rename to assets/usePapers-knk68Pd9.js index 1022a684fbe8cc5ee7468494709cebb51619d7db..84ac780ee1039b37ffe1ad5011a397421d273cae 100644 --- a/assets/usePapers-Bb48_cnL.js +++ b/assets/usePapers-knk68Pd9.js @@ -1 +1 @@ -import{p as g}from"./paperQueryKeys-BP2E-0yf.js";import{ad as y}from"./index-CA09r0fx.js";import{u as x}from"./useQuery-GCOPnmOE.js";import{u as m}from"./useInfiniteQuery-TrlVUjws.js";import{p as h}from"./papers-2SfezChA.js";function I(a,e=!0){return x({queryKey:g.detail(a),queryFn:()=>h.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function K(a={}){const{page_size:e=20,search:t,order_by:s="date_published",order_dir:n="desc",start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d=!0,include_resources:c=!1,has_code:f=!1,has_hf_artifacts:p=!1,framework:_,repository:b,author:F,enabled:k=!0}=a;return m({queryKey:[...g.feeds.infinite,{page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}],queryFn:({pageParam:P=1})=>h.list({page:P,page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}),getNextPageParam:P=>P.next_page,initialPageParam:1,enabled:k,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function D({q:a,order_by:e="relevance",start_date:t,end_date:s,has_code:n=!1,has_hf_artifacts:i=!1,enabled:o=!0}){return m({queryKey:[...g.feeds.search,{q:a,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i}],queryFn:({pageParam:r=1})=>h.searchFeed({q:a,page:r,page_size:20,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i,mode:"hybrid"}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:o&&a.trim().length>0,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function W(a){const{taskId:e,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:r=!1,has_hf_artifacts:u=!1,start_date:l,end_date:d,enabled:c=!0}=a;return m({queryKey:[...g.feeds.task,e,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}],queryFn:({pageParam:f=1})=>h.forTask(e,{page:f,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,repository_limit:1,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function N(a){const{conferenceSlug:e,taskSlug:t,presentation:s,page_size:n=20,order_by:i="date_published",order_dir:o="desc",latest_only:r=!0,include_resources:u=!0,has_code:l=!1,has_hf_artifacts:d=!1,start_date:c,end_date:f,enabled:p=!0}=a;return m({queryKey:[...g.feeds.conference,e,t,s,{page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}],queryFn:({pageParam:_=1})=>h.forConference(e,{task:t,presentation:s,page:_,page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}),getNextPageParam:_=>_.next_page,initialPageParam:1,enabled:p&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function S(a){const{organizationSlug:e,taskSlug:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:r=!0,has_code:u=!1,has_hf_artifacts:l=!1,start_date:d,end_date:c,enabled:f=!0}=a;return m({queryKey:[...g.feeds.organization,e,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}],queryFn:({pageParam:p=1})=>h.forOrganization(e,{task:t,page:p,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}),getNextPageParam:p=>p.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}export{D as a,I as b,W as c,N as d,S as e,K as u}; +import{p as g}from"./paperQueryKeys-BP2E-0yf.js";import{ad as y}from"./index-DGz7IJy3.js";import{u as x}from"./useQuery-SnJNmisF.js";import{u as m}from"./useInfiniteQuery-Bix5WR2s.js";import{p as h}from"./papers-CgK5TA59.js";function I(a,e=!0){return x({queryKey:g.detail(a),queryFn:()=>h.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function K(a={}){const{page_size:e=20,search:t,order_by:s="date_published",order_dir:n="desc",start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d=!0,include_resources:c=!1,has_code:f=!1,has_hf_artifacts:p=!1,framework:_,repository:b,author:F,enabled:k=!0}=a;return m({queryKey:[...g.feeds.infinite,{page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}],queryFn:({pageParam:P=1})=>h.list({page:P,page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}),getNextPageParam:P=>P.next_page,initialPageParam:1,enabled:k,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function D({q:a,order_by:e="relevance",start_date:t,end_date:s,has_code:n=!1,has_hf_artifacts:i=!1,enabled:o=!0}){return m({queryKey:[...g.feeds.search,{q:a,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i}],queryFn:({pageParam:r=1})=>h.searchFeed({q:a,page:r,page_size:20,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i,mode:"hybrid"}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:o&&a.trim().length>0,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function W(a){const{taskId:e,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:r=!1,has_hf_artifacts:u=!1,start_date:l,end_date:d,enabled:c=!0}=a;return m({queryKey:[...g.feeds.task,e,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}],queryFn:({pageParam:f=1})=>h.forTask(e,{page:f,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,repository_limit:1,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function N(a){const{conferenceSlug:e,taskSlug:t,presentation:s,page_size:n=20,order_by:i="date_published",order_dir:o="desc",latest_only:r=!0,include_resources:u=!0,has_code:l=!1,has_hf_artifacts:d=!1,start_date:c,end_date:f,enabled:p=!0}=a;return m({queryKey:[...g.feeds.conference,e,t,s,{page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}],queryFn:({pageParam:_=1})=>h.forConference(e,{task:t,presentation:s,page:_,page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}),getNextPageParam:_=>_.next_page,initialPageParam:1,enabled:p&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function S(a){const{organizationSlug:e,taskSlug:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:r=!0,has_code:u=!1,has_hf_artifacts:l=!1,start_date:d,end_date:c,enabled:f=!0}=a;return m({queryKey:[...g.feeds.organization,e,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}],queryFn:({pageParam:p=1})=>h.forOrganization(e,{task:t,page:p,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}),getNextPageParam:p=>p.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}export{D as a,I as b,W as c,N as d,S as e,K as u}; diff --git a/assets/useQuery-GCOPnmOE.js b/assets/useQuery-SnJNmisF.js similarity index 99% rename from assets/useQuery-GCOPnmOE.js rename to assets/useQuery-SnJNmisF.js index 0bc300f6ee1cf225ff6ae161f24e82190ff9c50e..8f27504a8fda7c3efe522512c085daa4b6d0727e 100644 --- a/assets/useQuery-GCOPnmOE.js +++ b/assets/useQuery-SnJNmisF.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{au as Tt,av as gt,aw as S,ax as q,ay as H,az as tt,aA as et,aB as vt,aC as Mt,aD as J,aE as Qt,aF as xt,aG as mt,aH as Ct,r as O,aI as Ot,m as _t}from"./index-CA09r0fx.js";var v,a,j,g,x,U,C,w,z,P,L,_,F,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,j);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,F);p(this,T);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,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,T))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return 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},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:m}=d;f=d.data;let 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),M=!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:M,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=K=>{k?K.reject(I.error):R&&K.resolve(I.data)},pt=()=>{const K=u(this,C,I.promise=gt());V(K)},G=i(this,C);switch(G.status){case"pending":t.queryHash===r.queryHash&&V(G);break;case"fulfilled":(k||I.data!==G.value)&&pt();break;case"rejected":(!k||I.error!==G.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,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,T=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=Mt(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,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,T)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(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))}},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 M,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",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 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=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,Vt as a,Pt as b,Bt as c,kt as d,jt as e,At as f,yt as g,Ht as h,Wt 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{au as Tt,av as gt,aw as S,ax as q,ay as H,az as tt,aA as et,aB as vt,aC as Mt,aD as J,aE as Qt,aF as xt,aG as mt,aH as Ct,r as O,aI as Ot,m as _t}from"./index-DGz7IJy3.js";var v,a,j,g,x,U,C,w,z,P,L,_,F,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,j);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,F);p(this,T);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,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,T))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return 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},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:m}=d;f=d.data;let 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),M=!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:M,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=K=>{k?K.reject(I.error):R&&K.resolve(I.data)},pt=()=>{const K=u(this,C,I.promise=gt());V(K)},G=i(this,C);switch(G.status){case"pending":t.queryHash===r.queryHash&&V(G);break;case"fulfilled":(k||I.data!==G.value)&&pt();break;case"rejected":(!k||I.error!==G.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,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,T=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=Mt(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,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,T)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(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))}},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 M,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",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 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=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,Vt as a,Pt as b,Bt as c,kt as d,jt as e,At as f,yt as g,Ht as h,Wt as s,Xt as u}; diff --git a/index.html b/index.html index 5040d1a7bc2bd36080ca140fe4314c0be9a27fa7..e878c88463846b0f60af55b9a558c5e5666d49cf 100644 --- a/index.html +++ b/index.html @@ -72,7 +72,7 @@ plausible.init(); })(); - +