diff --git a/assets/AiDeadlinesView-DkV4e8P1.js b/assets/AiDeadlinesView-uOgVcFI9.js similarity index 97% rename from assets/AiDeadlinesView-DkV4e8P1.js rename to assets/AiDeadlinesView-uOgVcFI9.js index 2a58aa348ee8c4c779f34a17e7e20ebfd15205d8..dcb0e689fd03c8176d95fb9761868caa59b376d0 100644 --- a/assets/AiDeadlinesView-DkV4e8P1.js +++ b/assets/AiDeadlinesView-uOgVcFI9.js @@ -1,3 +1,3 @@ -import{r as x,j as t,b as E}from"./index-LWBjDGUR.js";import{u as A}from"./useQuery-CVb9j2D6.js";import{S as B}from"./switch-Brp2Ns-5.js";import{S as U}from"./skeleton-JE1BtvIJ.js";import{A as W,a as O}from"./alert-fokOob1I.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-CUdQ6AzV.js";import"./useBaseQuery-CSyvHxAw.js";import"./index-CIXIMLCe.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"]),H=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(H).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),z=(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}`},I=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>I(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=I(e);return a.length?a[a.length-1]:null},Q=(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`},J=(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)"},X=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=z(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,b as E}from"./index-DsjIhQkx.js";import{u as A}from"./useQuery-xOve4y-6.js";import{S as B}from"./switch-DIM4i6Fu.js";import{S as U}from"./skeleton-B1Kg5w0V.js";import{A as W,a as O}from"./alert-BThP2mep.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-BoPFX590.js";import"./useBaseQuery-D4kcdcVW.js";import"./index-DUeJ-D3M.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"]),H=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(H).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),z=(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}`},I=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>I(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=I(e);return a.length?a[a.length-1]:null},Q=(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`},J=(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)"},X=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=z(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}/,""),Z=(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)}`;window.open(s,"_blank","noopener,noreferrer")},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=["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(` `),g=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(g),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)},te=({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?I(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),g=e?z(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,p=s?new Date(s.deadline_at).getTime():null;return t.jsx(V,{open:a,onOpenChange:n,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(Y,{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:[g&&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:g})]}),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})]})]}),p!=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:_(p,r)},children:J(p,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,m)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,u=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:u&&!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:_(u?null:y,r)},children:X(y,r)})]},`${d.type??"deadline"}-${m}`)})]}),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:e.url,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:()=>Z(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},M=({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(B,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ne=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),g=s?new Date(s.deadline_at).getTime():null,c=_(i?g:null,a),p=z(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:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.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:g!=null?Q(g,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[p&&t.jsx("span",{children:p}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(m=>{const y=n.has(m);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(m)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(m)},m)})})]})},me=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,g]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),p=A({queryKey:["conference-deadlines"],queryFn:()=>E.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(u=>{const h=new Set(u);return h.has(l)?h.delete(l):h.add(l),h})},m=x.useMemo(()=>{var u;const l=new Map;return(u=p.data)==null||u.results.forEach(h=>{D(h).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((h,j)=>j[1]-h[1]).map(([h])=>h)},[p.data]),y=x.useMemo(()=>{var j;const u=(((j=p.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))),h=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[...u].sort((f,w)=>{const v=h(f),N=h(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[p.data,e,n,o,c]);return p.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(O,{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(M,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(M,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),m.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[m.map(l=>{const u=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"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:p.isLoading?"…":`${y.length} conferences`})}),p.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,u)=>t.jsx(U,{className:"h-44"},u))}):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(ne,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:g},l.id))}),t.jsx(te,{conf:s,open:s!==null,onOpenChange:l=>{l||g(null)}})]})};export{me as default}; diff --git a/assets/AuthorDetailView-Ba9-6m_p.js b/assets/AuthorDetailView-CYd080uW.js similarity index 82% rename from assets/AuthorDetailView-Ba9-6m_p.js rename to assets/AuthorDetailView-CYd080uW.js index 9d1ddbdab5826255a614897911f2baf51336d71a..65f0860d0150517abaafb32cc1dacf9ad99feda1 100644 --- a/assets/AuthorDetailView-Ba9-6m_p.js +++ b/assets/AuthorDetailView-CYd080uW.js @@ -1 +1 @@ -import{e as m,j as e,L as g,b as h}from"./index-LWBjDGUR.js";import{u as d}from"./useQuery-CVb9j2D6.js";import{S as c}from"./skeleton-JE1BtvIJ.js";import x from"./NotFound-DTl10qdH.js";import"./useBaseQuery-CSyvHxAw.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default}; +import{e as m,j as e,L as g,b as h}from"./index-DsjIhQkx.js";import{u as d}from"./useQuery-xOve4y-6.js";import{S as c}from"./skeleton-B1Kg5w0V.js";import x from"./NotFound-B_H_to4V.js";import"./useBaseQuery-D4kcdcVW.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default}; diff --git a/assets/BenchmarkDetailView-BVdCY9wO.js b/assets/BenchmarkDetailView-BVdCY9wO.js new file mode 100644 index 0000000000000000000000000000000000000000..69003fd9ea9b633e6f0ce75003bb68d271856661 --- /dev/null +++ b/assets/BenchmarkDetailView-BVdCY9wO.js @@ -0,0 +1,2 @@ +import{u as vt,r as w,j as n,a0 as ne,g as jt,e as _t,a as kt,V as St,L as me,b as ee}from"./index-DsjIhQkx.js";import{u as te}from"./useQuery-xOve4y-6.js";import{S as xe}from"./skeleton-B1Kg5w0V.js";import{S as Je}from"./switch-DIM4i6Fu.js";import{A as Ct,a as Et}from"./alert-BThP2mep.js";import{L as ye}from"./LatexTitle-DA7SEiSe.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-B3x84Amj.js";import{B as Tt}from"./BenchmarkTrendSparkline-Cjb-e1Og.js";import{I as $t}from"./components-DbYcrD0u.js";import"./useBaseQuery-D4kcdcVW.js";import"./index-DUeJ-D3M.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DWx_NdIh.js";import"./transform-C1LieBU0.js";function Mt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ft(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Lt=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>Ze(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return Mi-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;ob.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Ft(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.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"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.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"}}))}),ce.map((o,m)=>n.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&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;Bi-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,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))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function It(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"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Pt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;rD||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Vt(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]),a=s.length,i=new Uint8Array(a);for(let c=0;c{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 Ot(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ut(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.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"),a.appendChild(i),i.appendChild(e),Ot(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Wt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function zt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Wt(r):qt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Pt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(zt(c,r,a,s)),t.appendChild(l)}function Gt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Kt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=Qt(e).toLowerCase();return Kt[t]||""}function Xt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Yt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function Jt(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 Me(e,t,r){const s=Jt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Xt(l)));a=Yt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function Zt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function er(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function tr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function rr(e,t){return P(e,HTMLCanvasElement)?Zt(e):P(e,HTMLVideoElement)?er(e,t):P(e,HTMLIFrameElement)?tr(e,t):e.cloneNode(ht(e))}const sr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function nr(e,t,r){var s,a;if(ht(t))return t;let i=[];return sr(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function ar(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function ir(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function lr(e,t,r){return P(t,Element)&&(ar(e,t,r),Gt(e,t,r),ir(e,t),cr(e,t)),t}async function or(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;irr(s,t)).then(s=>nr(e,s,t)).then(s=>lr(e,s,t)).then(s=>or(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,dr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ur=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function hr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function fr(e,t,r,s,a){try{const i=r?It(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(mr(t),`$1${l}$3`)}catch{}return e}function pr(e,{preferredFontFormat:t}){return t?e.replace(ur,r=>{for(;;){const[s,,a]=dr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=pr(e,r);return hr(s).reduce((i,c)=>i.then(l=>fr(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gr(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 xr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function br(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await gr(e,t),await xr(e,t),await br(e,t))}function yr(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(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function wr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function vr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function jr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await wr(r,t);return vr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function _r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function kr(e,t){const r=await jr(e,t),s=_r(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(` +`)}async function Sr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Cr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Sr(a,t),await xt(a,t),yr(a,t),await Ut(a,r,s)}async function Er(e,t={}){const{width:r,height:s}=ut(e,t),a=await Cr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Bt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ht(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Nr(e,t={}){const r=await Er(e,t);return await Vt(r)}const Te="#ffffff";function Rr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Tr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Rr():t}async function $r(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 Nr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Tr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await $r(u),a("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(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx($t,{name:"copy",size:11}),l]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Mr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Fr(e){const t=new Map;for(const r of e){const s=Mr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Lr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.valuei;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Ir=5;function Pr(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 be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const Yr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Mt(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Fr(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Ir),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Lr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Pr(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx(Tt,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Lt,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Nt,{}),(h.external??h.is_external)&&n.jsx(Rt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Yr as default}; diff --git a/assets/BenchmarkDetailView-yKHafFH-.js b/assets/BenchmarkDetailView-yKHafFH-.js deleted file mode 100644 index 4076fc0ee2078635a0e7c714081fa03a0d6f0be2..0000000000000000000000000000000000000000 --- a/assets/BenchmarkDetailView-yKHafFH-.js +++ /dev/null @@ -1,2 +0,0 @@ -import{u as vt,r as w,j as n,$ as ne,g as jt,e as _t,a as kt,U as St,L as me,b as ee}from"./index-LWBjDGUR.js";import{u as te}from"./useQuery-CVb9j2D6.js";import{S as xe}from"./skeleton-JE1BtvIJ.js";import{S as Je}from"./switch-Brp2Ns-5.js";import{A as Ct,a as Et}from"./alert-fokOob1I.js";import{L as ye}from"./LatexTitle-CB-vNeWW.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-DyD1_AOv.js";import{B as $t}from"./BenchmarkTrendSparkline-B7WHyzPN.js";import{I as Tt}from"./components-DaxA6Lf7.js";import"./useBaseQuery-CSyvHxAw.js";import"./index-CIXIMLCe.js";import"./katex.min-BSBacQyE.js";import"./hover-card-BYeJ4GbN.js";import"./transform-BSMO2egg.js";function Mt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ft(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Lt=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,T=e.map(o=>Ze(o.date)),z=Math.min(...T),I=Math.max(...T),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return Mi-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;ob.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Ft(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.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"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.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"}}))}),ce.map((o,m)=>n.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&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;Bi-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,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))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function It(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"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Pt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;rD||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Vt(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]),a=s.length,i=new Uint8Array(a);for(let c=0;c{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 Ot(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ut(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.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"),a.appendChild(i),i.appendChild(e),Ot(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Wt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function zt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Wt(r):qt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Pt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(zt(c,r,a,s)),t.appendChild(l)}function Gt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Kt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Te(e){const t=Qt(e).toLowerCase();return Kt[t]||""}function Xt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Yt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function Jt(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 Me(e,t,r){const s=Jt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Xt(l)));a=Yt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function Zt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function er(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=Te(r),a=await Me(r,s,t);return ve(a)}async function tr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function rr(e,t){return P(e,HTMLCanvasElement)?Zt(e):P(e,HTMLVideoElement)?er(e,t):P(e,HTMLIFrameElement)?tr(e,t):e.cloneNode(ht(e))}const sr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function nr(e,t,r){var s,a;if(ht(t))return t;let i=[];return sr(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function ar(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function ir(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function lr(e,t,r){return P(t,Element)&&(ar(e,t,r),Gt(e,t,r),ir(e,t),cr(e,t)),t}async function or(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;irr(s,t)).then(s=>nr(e,s,t)).then(s=>lr(e,s,t)).then(s=>or(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,dr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ur=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function hr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function fr(e,t,r,s,a){try{const i=r?It(t,r):t,c=Te(t);let l;return a||(l=await Me(i,c,s)),e.replace(mr(t),`$1${l}$3`)}catch{}return e}function pr(e,{preferredFontFormat:t}){return t?e.replace(ur,r=>{for(;;){const[s,,a]=dr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=pr(e,r);return hr(s).reduce((i,c)=>i.then(l=>fr(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gr(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 xr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Te(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function br(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await gr(e,t),await xr(e,t),await br(e,t))}function yr(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(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function wr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function vr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function jr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await wr(r,t);return vr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function _r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function kr(e,t){const r=await jr(e,t),s=_r(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(` -`)}async function Sr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Cr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Sr(a,t),await xt(a,t),yr(a,t),await Ut(a,r,s)}async function Er(e,t={}){const{width:r,height:s}=ut(e,t),a=await Cr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Bt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ht(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Nr(e,t={}){const r=await Er(e,t);return await Vt(r)}const $e="#ffffff";function Rr(){return typeof window>"u"?$e:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||$e}function $r(e){if(typeof window>"u")return $e;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Rr():t}async function Tr(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 Nr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:$r(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await Tr(u),a("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(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx(Tt,{name:"copy",size:11}),l]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Mr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Fr(e){const t=new Map;for(const r of e){const s=Mr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Lr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.valuei;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Ir=5;function Pr(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 be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const Yr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),T=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,$=-1;for(const j of d){const ue=h.get(j.id)||0;ue>$&&($=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,T],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,T),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!T,staleTime:10*60*1e3}),Y=w.useMemo(()=>Mt(E.data,T,a.hide_closed_source_evals),[E.data,T,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Fr(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const $ of H)for(const j of Object.keys($.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[$,j]of d)j>h&&(h=j,g=$);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Ir),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Lr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!T||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var $,j;const h=he(($=d.metrics)==null?void 0:$[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Pr(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx($t,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Lt,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var $,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&(($=R.metrics)==null?void 0:$[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const $=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;$!==null&&((d===null||$!==d)&&(g=S+1,d=$),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Nt,{}),(h.external??h.is_external)&&n.jsx(Rt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Yr as default}; diff --git a/assets/BenchmarkTrendSparkline-B7WHyzPN.js b/assets/BenchmarkTrendSparkline-Cjb-e1Og.js similarity index 97% rename from assets/BenchmarkTrendSparkline-B7WHyzPN.js rename to assets/BenchmarkTrendSparkline-Cjb-e1Og.js index 0f6f351cdc06d9a558bd345aee36ff23f9260340..62152d73da52bcb2f80716714291f90e198a1211 100644 --- a/assets/BenchmarkTrendSparkline-B7WHyzPN.js +++ b/assets/BenchmarkTrendSparkline-Cjb-e1Og.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-LWBjDGUR.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-DsjIhQkx.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/ChatMessage-_9GmgEOY.js b/assets/ChatMessage-DFG7XCLG.js similarity index 97% rename from assets/ChatMessage-_9GmgEOY.js rename to assets/ChatMessage-DFG7XCLG.js index 323b84984f0ed8dee5aa68c1c0415d81cd3ae46c..d43575dd7997dfcacd32479118e5028c48b6b300 100644 --- a/assets/ChatMessage-_9GmgEOY.js +++ b/assets/ChatMessage-DFG7XCLG.js @@ -1,4 +1,4 @@ -import{c as E,r as j,j as t,R as g}from"./index-LWBjDGUR.js";import{M as R,S as w,A as S,o as P,s as b,v as $}from"./chatSessions-gAEfkaKP.js";import"./katex.min-BSBacQyE.js";import{H as T,a as H,b as I}from"./hover-card-BYeJ4GbN.js";import{r as M,a as U,P as F}from"./PaperPreviewLink-DWreeZBU.js";import{M as L,r as A,d as B}from"./index-C3kXFp4C.js";/** +import{c as E,r as j,j as t,R as g}from"./index-DsjIhQkx.js";import{M as R,S as w,A as S,o as P,s as b,v as $}from"./chatSessions-BX17B8vQ.js";import"./katex.min-BSBacQyE.js";import{H as T,a as H,b as I}from"./hover-card-DWx_NdIh.js";import{r as M,a as U,P as F}from"./PaperPreviewLink-BkYFo5pJ.js";import{M as L,r as A,d as B}from"./index-DaRHhPdB.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatView-DDHqYDAC.js b/assets/ChatView-DDHqYDAC.js new file mode 100644 index 0000000000000000000000000000000000000000..97ea24a80b9f42c7b98f9dd4aae13dd73072f3a2 --- /dev/null +++ b/assets/ChatView-DDHqYDAC.js @@ -0,0 +1,16 @@ +import{c as ht,d as Ie,r as o,j as r,e as ft,u as mt,a as pt,f as gt,g as yt,h as bt,k as wt,X as vt}from"./index-DsjIhQkx.js";import{C as Be,U as _t,A as Rt}from"./ChatMessage-DFG7XCLG.js";import{c as xt,g as je,t as rt,r as St,F as kt,D as Tt,l as Ct,C as He,a as We,b as Ve,d as Ot,e as Et,P as jt,f as Ge,h as Lt,T as It,S as Ke,u as $e,i as Nt,j as At,k as Dt}from"./chatSessions-BX17B8vQ.js";import{S as Pt}from"./chatPrompts-CDY3UGU1.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DWx_NdIh.js";import"./PaperPreviewLink-BkYFo5pJ.js";import"./index-DaRHhPdB.js";import"./useQuery-xOve4y-6.js";import"./useBaseQuery-D4kcdcVW.js";/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mt=ht("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),U=(c,u)=>new Promise(h=>{const E=setTimeout(f,c);function f(){u==null||u.removeEventListener("abort",f),clearTimeout(E),h()}u==null||u.addEventListener("abort",f)}),J=c=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...c}),X={name:"Object Detection",slug:"object-detection"},re={name:"Real-Time Object Detection",slug:"real-time-object-detection"},Yt={"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:J({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[X,re],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:J({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[X,re],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:J({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:[X,re],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:J({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[X,re],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:J({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:[X,re],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:J({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:[X,re],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:J({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"},X],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:J({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[X,re],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},st=c=>c.map(u=>Yt[u]),ze=st(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),Je=st(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),Xe="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.",Qe="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.",Ze=`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.`,Ft=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*Ut(c,u){const h=()=>(u==null?void 0:u.aborted)===!0,E=c.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 U(350,u),!h()){yield{type:"reasoning_start"};for(let f=0;f{const u=String("0").trim().toLowerCase();return u==="1"||u==="true"||u==="yes"};class Le extends Error{constructor(u,h,E,f){super(u),this.code=h,this.status=E,this.retryAfterSeconds=f,this.name="ChatStreamError"}}function qt(c,u){if(_e())try{fetch(Ie(`/api/v1/chat/latency/${encodeURIComponent(c)}`),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",keepalive:!0,body:JSON.stringify(u)}).catch(()=>{})}catch{}}function Bt(c,u={}){return _e()?Ht(c,u.signal):Ut(c.message,u.signal)}async function*Ht(c,u){const h=await fetch(Ie("/api/v1/chat/stream"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"include",body:JSON.stringify(c),signal:u});if(!h.ok||!h.body){const x=await h.json().catch(()=>null),v=x==null?void 0:x.detail,_=h.status===403&&!v,R=Number(h.headers.get("Retry-After")),N=Number.isFinite(R)&&R>=0?Math.min(300,Math.ceil(R)):void 0;throw new Le(_?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(v==null?void 0:v.message)||v||`Chat stream failed (${h.status})`,(v==null?void 0:v.code)||(_?"staging_access_required":void 0),h.status,N)}const E=h.body.getReader(),f=new TextDecoder;let j="";try{for(;;){const{done:x,value:v}=await E.read();if(x)break;j+=f.decode(v,{stream:!0});let _;for(;(_=j.indexOf(` + +`))!==-1;){const R=j.slice(0,_);j=j.slice(_+2);const N=R.split(` +`).filter(T=>T.startsWith("data:")).map(T=>T.slice(5).trimStart()).join(` +`);!N||N==="[DONE]"||(yield JSON.parse(N))}}}finally{E.releaseLock()}}const et="Preparing research workspace…",Wt=750;function Ee(c,u){for(let h=c.length-1;h>=0;h-=1)if(u(c[h]))return h;return-1}function Vt(c){const[u,h]=o.useState([]),[E,f]=o.useState(!1),[j,x]=o.useState(""),v=o.useRef(!1),_=o.useRef(null),R=o.useRef(null),N=o.useRef("cleared"),T=o.useRef(null),S=o.useRef(null),[D,Y]=o.useState(null),B=o.useRef([]),C=o.useRef(c),de=o.useRef(""),Q=o.useRef(""),ue=o.useRef(0),L=o.useRef(0),A=o.useRef(c.sessionId),H=o.useRef(c.sessionId);H.current!==c.sessionId&&(H.current=c.sessionId,A.current!==c.sessionId&&(L.current+=1,T.current=null)),C.current=c,B.current=u,o.useEffect(()=>()=>{var t;R.current!==null&&window.clearTimeout(R.current),(t=_.current)==null||t.abort(),S.current=null},[]),o.useEffect(()=>{v.current||(A.current=c.sessionId)},[c.sessionId]);const Z=o.useMemo(()=>{const t={};for(const i of u)for(const s of i.blocks??[])if(s.kind==="tool")for(const l of s.results??[])t[l.route_id]=l;return t},[u]),se=()=>`m${++ue.current}_${Date.now().toString(36)}`,P=t=>h(i=>{if(!i.length)return i;const s=i.slice();return s[s.length-1]=t(s[s.length-1]),s}),V=t=>P(i=>({...i,blocks:[...i.blocks??[],t]})),ae=(t,i)=>P(s=>({...s,blocks:(s.blocks??[]).map((l,p,m)=>t(l,p,m)?i(l):l)})),F=t=>(i,s,l)=>i.kind===t&&Ee(l,p=>p.kind===t)===s,G=t=>{if(_.current!==t||(R.current!==null&&(window.clearTimeout(R.current),R.current=null),N.current==="cleared"))return;const i=N.current==="shown";N.current="cleared",i&&P(s=>{if(s.status!==et)return s;const{status:l,...p}=s;return p})},K=(t,i)=>{t.requestId&&qt(t.requestId,i)},ie=(t,i)=>{const s=T.current;!s||s.controller!==t||(s.requestId=i,s.streamStartReported||(s.streamStartReported=!0,K(s,{submission_to_stream_start_ms:Math.max(0,performance.now()-s.submittedAt)})),s.firstVisibleAt!==void 0&&!s.firstVisibleReported&&(s.firstVisibleReported=!0,K(s,{submission_to_first_visible_delta_ms:Math.max(0,s.firstVisibleAt-s.submittedAt)})))},ee=(t,i)=>{const s=T.current;!s||s.controller!==t||s.terminalReported||(s.terminalReported=!0,K(s,{terminal_classification:i}))};o.useLayoutEffect(()=>{const t=T.current;if(!t||t.firstVisibleAt!==void 0)return;const i=u.at(-1);(i==null?void 0:i.role)!=="assistant"||!(i.blocks??[]).some(l=>l.kind==="tool"||l.kind==="reasoning"&&!!l.text.trim()||l.kind==="answer"&&!!l.text.trim())||(t.firstVisibleAt=performance.now(),t.requestId&&!t.firstVisibleReported&&(t.firstVisibleReported=!0,K(t,{submission_to_first_visible_delta_ms:Math.max(0,t.firstVisibleAt-t.submittedAt)})))},[u]);const oe=t=>{switch(t.type){case"stream_start":t.session_id&&(A.current=t.session_id,C.current.onSessionId(t.session_id));break;case"sandbox_start":case"sandbox_ready":case"workspace_ready":break;case"session_title_start":Q.current="";break;case"session_title_delta":Q.current+=t.text,C.current.onTitle(Q.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":Q.current=t.title,C.current.onTitle(t.title);break;case"reasoning_start":P(i=>({...i,blocks:[...(i.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s),{kind:"reasoning",text:"",active:!0,open:!0}]}));break;case"reasoning_delta":ae(F("reasoning"),i=>i.kind==="reasoning"?{...i,text:i.text+t.text}:i);break;case"reasoning_end":P(i=>{const s=i.blocks??[],l=Ee(s,y=>y.kind==="reasoning"&&y.active);if(l<0)return i;const p=s[l];if(p.kind!=="reasoning")return i;const m=s[l-1];return(m==null?void 0:m.kind)==="reasoning"&&m.text===p.text?{...i,blocks:s.filter((y,b)=>b!==l)}:{...i,blocks:s.map((y,b)=>b===l?{...p,active:!1,open:!1}:y)}});break;case"tool_call":V({kind:"tool",id:t.id,name:t.name,args:t.args,status:"running",open:!1});break;case"tool_result":ae(i=>i.kind==="tool"&&i.id===t.id,i=>i.kind==="tool"?t.status?{...i,schema_version:2,status:t.status,took_ms:t.took_ms,content:t.content,metadata:t.metadata,open:t.status!=="success"}:{...i,status:"done",hits:t.hits,took_ms:t.took_ms,results:t.results}:i);break;case"answer_delta":P(i=>{const s=i.blocks??[],l=s.at(-1);return(l==null?void 0:l.kind)==="answer"&&!l.done?{...i,blocks:[...s.slice(0,-1),{...l,text:l.text+t.text}]}:{...i,blocks:[...s,{kind:"answer",text:t.text,done:!1}]}});break;case"done":P(i=>({...i,streaming:!1,followups:t.followups,finishReason:t.finish_reason,citations:t.citations,blocks:(i.blocks??[]).map(s=>s.kind==="answer"?{...s,done:!0}:s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}));break;case"error":P(i=>({...i,streaming:!1,error:t.message,errorCode:t.code,blocks:(i.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}));break}},ge=async(t,i)=>{const s=await je(t),l=rt(s);return L.current!==i?null:(h(l),B.current=l,l)},$=(t,i,s,l,p)=>{const m=++L.current;v.current=!0;const y=new AbortController;return _.current=y,de.current=t,A.current=i.session_id,x(""),h(s),f(!0),T.current={controller:y,submittedAt:performance.now(),streamStartReported:!1,firstVisibleReported:!1,terminalReported:!1},R.current!==null&&window.clearTimeout(R.current),N.current="armed",R.current=window.setTimeout(()=>{R.current=null,!(_.current!==y||y.signal.aborted||L.current!==m)&&(N.current="shown",P(b=>{var O;return b.role==="assistant"&&b.streaming&&(((O=b.blocks)==null?void 0:O.length)??0)===0&&!b.error?{...b,status:et}:b}))},Wt),(async()=>{var M;let b=!1,O=!1,I=!1,W=!1;try{for await(const g of Bt(i,{signal:y.signal})){g.type==="stream_start"&&(b=!0,ie(y,g.request_id)),(g.type==="workspace_ready"||g.type==="reasoning_start"||g.type==="reasoning_delta"||g.type==="tool_call"||g.type==="answer_delta"||g.type==="done"||g.type==="error")&&G(y),(g.type==="done"||g.type==="error")&&(O=!0,I=g.type==="error",ee(y,g.type==="error"?"error":"complete"));const d=L.current===m;!y.signal.aborted&&(d||g.type==="stream_start"||g.type==="session_title_start"||g.type==="session_title_delta"||g.type==="session_title_done")&&oe(g)}}catch(g){if(I=!0,!y.signal.aborted){if(G(y),g instanceof Le&&g.code==="chat_capacity"){W=!0;const d=g.retryAfterSeconds??5,ne={question:t,request:i,optimistic:s,original:l,edit:p,retryAfterSeconds:d,retryAt:Date.now()+d*1e3};S.current=ne,Y({question:t,retryAt:ne.retryAt,retryAfterSeconds:d}),L.current===m&&(h(l),B.current=l,x(""))}else ee(y,"network_error");!W&&L.current===m&&oe({type:"error",message:g instanceof Error?g.message:"The assistant stream failed.",code:g instanceof Le?g.code:void 0})}}finally{if(_.current===y){if(G(y),!O&&!y.signal.aborted&&ee(y,"network_error"),v.current=!1,f(!1),W)C.current.onSettled(i.session_id);else if(!y.signal.aborted){const g=A.current;if(p&&!b)L.current===m&&(h(p.snapshot),B.current=p.snapshot,x("Couldn’t resend this message. Your original conversation was restored."));else if(g){L.current===m&&p&&!p.first&&(I||!O)&&(h(p.snapshot),B.current=p.snapshot);try{const d=await ge(g,m);d&&p&&!p.first&&d.some(ne=>ne.id===p.targetId)&&x("Couldn’t resend this message. Your original conversation was restored.")}catch{L.current===m&&P(d=>d.streaming?{...d,streaming:!1}:d)}}else L.current===m&&P(d=>d.streaming?{...d,streaming:!1}:d);C.current.onSettled(g)}((M=T.current)==null?void 0:M.controller)===y&&(T.current=null)}}})(),!0},Re=o.useCallback(t=>{const i=t.trim();if(!i||i.length>8e3||v.current||S.current)return!1;const s=B.current,l=[...s].reverse().find(I=>I.role==="user"),p=l!=null&&l.status&&l.status!=="complete"&&l.revision?{replace_message_id:l.id,prior_revision:l.revision}:null,m={id:se(),role:"user",text:i},y={id:se(),role:"assistant",streaming:!0,blocks:[]},b=p&&l?Ee(s,I=>I.id===l.id):-1,O=b<0?[...s,m,y]:[...s.slice(0,b),m,y];return $(i,{message:i,session_id:C.current.sessionId,client_message_id:crypto.randomUUID(),...!C.current.sessionId&&C.current.initialModel?{initial_model:C.current.initialModel}:{},...p??{}},O,s)},[]),ce=o.useCallback((t,i)=>{const s=i.trim();if(!s||s.length>8e3||v.current||S.current)return!1;const l=B.current.slice(),p=l.findIndex(M=>M.id===t&&M.role==="user");if(p<0)return!1;const m=l[p],y=l.findIndex(M=>M.role==="user"),b=p===y;if(!b&&(!C.current.sessionId||!m.revision))return!1;const O={id:m.id,role:"user",text:s,revision:b?void 0:m.revision+1,status:"generating"},I={id:se(),role:"assistant",streaming:!0,blocks:[]},W=b?[O,I]:[...l.slice(0,p),O,I];return $(s,{message:s,session_id:b?null:C.current.sessionId,client_message_id:crypto.randomUUID(),...b&&C.current.initialModel?{initial_model:C.current.initialModel}:{},...b?{}:{replace_message_id:m.id,prior_revision:m.revision}},W,l,{targetId:m.id,snapshot:l,first:b})},[]),ye=o.useCallback(()=>{S.current=null,Y(null)},[]),he=o.useCallback(()=>{const t=S.current;return!t||Date.now(){var l;if(!_.current)return;const t=_.current;G(t),ee(t,"stopped"),t.abort(),_.current=null,((l=T.current)==null?void 0:l.controller)===t&&(T.current=null),v.current=!1,f(!1),h(p=>{const m=p.at(-1);if((m==null?void 0:m.role)!=="assistant")return p;const y=(m.blocks??[]).flatMap(b=>b.kind==="tool"&&b.status==="running"?[]:b.kind==="reasoning"&&b.active?[]:b.kind==="answer"?[{...b,done:!0}]:[b]);return[...p.slice(0,-1),{...m,blocks:y,streaming:!1,finishReason:"stopped"}]}),C.current.onInterrupted(de.current);const i=A.current;i&&xt(i).catch(()=>{});const s=++L.current;window.setTimeout(()=>{i&&L.current===s?ge(i,s).catch(()=>{}).finally(()=>C.current.onSettled(i)):i||C.current.onSettled(null)},450)},[]),te=o.useCallback((t,i)=>h(s=>s.map(l=>{var p;return l.id!==t?l:{...l,blocks:(p=l.blocks)==null?void 0:p.map((m,y)=>y===i&&(m.kind==="reasoning"||m.kind==="tool")?{...m,open:!m.open}:m)}})),[]),be=o.useCallback(()=>{var t;L.current+=1,R.current!==null&&(window.clearTimeout(R.current),R.current=null),N.current="cleared",(t=_.current)==null||t.abort(),_.current=null,T.current=null,S.current=null,Y(null),v.current=!1,A.current=null,h([]),f(!1),x("")},[]),we=o.useCallback(t=>{var i;L.current+=1,R.current!==null&&(window.clearTimeout(R.current),R.current=null),N.current="cleared",T.current=null,S.current=null,Y(null),v.current||((i=_.current)==null||i.abort(),_.current=null),h(t),v.current||f(!1),x("")},[]);return{messages:u,busy:E,papers:Z,sessionError:j,capacityRequest:D,send:Re,editAndResend:ce,retryCapacity:he,cancelCapacity:ye,stop:z,toggleBlock:te,reset:be,load:we}}const Gt="https://huggingface.co/settings/inference-providers",tt="pwc.chat.billing-notice-dismissed.v1",nt=({provider:c})=>{const[u,h]=o.useState(()=>localStorage.getItem(tt)==="1");return!_e()||u||c!=="huggingface"?null:r.jsxs("div",{className:"chat-billing-notice",role:"note",children:[r.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."}),r.jsxs("div",{className:"chat-billing-notice-actions",children:[r.jsx("a",{href:"/settings",children:"Review billing"}),r.jsx("a",{href:Gt,target:"_blank",rel:"noreferrer",children:"Review usage"}),r.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(tt,"1"),h(!0)},children:r.jsx(vt,{size:15,"aria-hidden":"true"})})]})]})},Kt=({retryAt:c,onRetry:u,onCancel:h})=>{const[E,f]=o.useState(()=>Math.max(0,Math.ceil((c-Date.now())/1e3))),j=o.useRef(null);return o.useEffect(()=>{var R;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;(R=j.current)==null||R.focus();const v=()=>f(Math.max(0,Math.ceil((c-Date.now())/1e3)));v();const _=window.setInterval(v,250);return()=>{window.clearInterval(_),x==null||x.focus()}},[c]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),h())},children:[r.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),r.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),r.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:E>0?`Try again available in ${E} second${E===1?"":"s"}.`:"You can try again now."}),r.jsxs("div",{className:"chat-capacity-dialog-actions",children:[r.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:j,onClick:h,children:"Cancel"}),r.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:E>0,onClick:u,children:"Try again"})]})]})})},an=()=>{var Ye,Fe,Ue,qe;const{sessionId:c}=ft(),u=mt(),[h,E]=pt(),{user:f,isLoading:j}=gt(),{toast:x}=yt(),[v,_]=o.useState([]),[R,N]=o.useState(!1),[T,S]=o.useState(""),[D,Y]=o.useState(()=>c?{id:c,status:"loading"}:null),[B,C]=o.useState(0),de=o.useRef(St()),Q=o.useRef(h.get("model")||((Ye=de.current)==null?void 0:Ye.model)),[ue,L]=o.useState(kt),[A,H]=o.useState(Q.current||Tt),Z=((Fe=ue.find(e=>e.id===A))==null?void 0:Fe.provider)??"huggingface",se=wt(),[P,V]=o.useState(""),[ae,F]=o.useState(""),[G,K]=o.useState(()=>{var e,n;return((e=h.get("q"))==null?void 0:e.trim())||((n=de.current)==null?void 0:n.prompt)||""}),ie=o.useRef(!1),ee=o.useRef(!1),oe=o.useRef(!1),[ge,$]=o.useState(null),[Re,ce]=o.useState(null),[ye,he]=o.useState(""),[z,te]=o.useState(null),[be,we]=o.useState(()=>typeof window>"u"||window.innerWidth>900),[t,i]=o.useState(!1),[s,l]=o.useState(!1),[p,m]=o.useState(""),y=o.useRef(new Set),b=o.useRef(!1),O=o.useRef(c),I=o.useRef(null),W=o.useRef(null),M=o.useRef(null);O.current=c;const g=o.useCallback(async()=>{if(!f)return;const e=!b.current;e&&N(!0);try{const n=await Ct();_(a=>{const w=I.current,k=w?a.find(pe=>pe.id===w):void 0;if(!k)return n;const q=n.find(pe=>pe.id===w);return[q?{...q,title:k.title,is_busy:!0}:k,...n.filter(pe=>pe.id!==w)]}),b.current=!0,S("")}catch(n){S(n instanceof Error?n.message:"Could not load chats")}finally{e&&N(!1)}},[f]),d=Vt({sessionId:c??null,initialModel:A,onSessionId:e=>{I.current=e;const n=e!==O.current,a=O.current===W.current,w=new Date().toISOString();_(k=>k.some(q=>q.id===e)?k.map(q=>q.id===e?{...q,is_busy:!0}:q):[{id:e,title:"New chat",selected_model:A,created_at:w,updated_at:w,message_count:1,is_busy:!0},...k]),n&&a&&V("New chat"),a&&(M.current=e,Y({id:e,status:"loaded"}),n&&u(`/chat/${e}`,{replace:!0}))},onTitle:e=>{const n=I.current??O.current;n&&!y.current.has(n)&&(n===O.current&&V(e),_(a=>a.map(w=>w.id===n?{...w,title:e}:w)))},onSettled:e=>{e&&_(n=>n.map(a=>a.id===e?{...a,is_busy:!1}:a)),I.current=null,W.current=null,g()},onInterrupted:e=>{F(e)}});d.load;const ne=d.send;o.useEffect(()=>{d.capacityRequest&&F(d.capacityRequest.question)},[d.capacityRequest]),o.useEffect(()=>{d.busy&&$(null)},[d.busy]);const xe=o.useCallback(e=>{sessionStorage.setItem(He,e),sessionStorage.setItem(We,A),sessionStorage.setItem(Ve,"1"),window.location.href=bt("/chat",!0)},[A]),fe=o.useCallback(async e=>{if(!f){xe(e);return}if(Z==="huggingface"&&!ee.current){if(oe.current)return;oe.current=!0;try{const a=await fetch(Ie("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!a.ok)throw new Error("Could not check Hugging Face authorization.");if(!(await a.json()).connected){xe(e);return}ee.current=!0}catch(a){F(e),S(a instanceof Error?a.message:"Could not check Hugging Face authorization.");return}finally{oe.current=!1}}const n=O.current??null;ne(e)&&(W.current=n,I.current=n,Ot(),F(""))},[xe,Z,ne,f]);o.useEffect(()=>{if(j||!f)return;const e=sessionStorage.getItem(We);e&&H(e),g(),Et().then(w=>{if(L(w.items),!O.current){const k=Q.current||e;H(k&&w.items.some(q=>q.id===k)?k:w.default_model)}});const n=sessionStorage.getItem(He),a=sessionStorage.getItem(Ve)==="1";n&&(a?K(n):F(n))},[j,g,f]),o.useEffect(()=>{if(!c){M.current!==null&&(M.current=null,d.reset()),Y(null);return}if(M.current===c||(Y(n=>(n==null?void 0:n.id)===c&&n.status==="loading"?n:{id:c,status:"loading"}),j||!f))return;let e=!1;return S(""),je(c).then(n=>{e||(d.load(rt(n)),H(n.selected_model),V(n.title),M.current=c,Y({id:c,status:"loaded"}))}).catch(n=>{if(e)return;const a=n instanceof Error?n.message:"Chat not found";d.reset(),S(a),Y({id:c,status:"error",error:a})}),()=>{e=!0}},[j,c,f,d.busy,B]),o.useEffect(()=>{var w;const e=(w=h.get("q"))==null?void 0:w.trim();if(!e)return;ie.current=!1;const n=h.get("model");n&&H(n),K(e);const a=new URLSearchParams(h);a.delete("q"),a.delete("model"),E(a,{replace:!0})},[h,E]),o.useEffect(()=>{if(j||d.busy||!G||ie.current)return;const e=window.setTimeout(()=>{if(ie.current)return;ie.current=!0;const n=G;K(""),fe(n)},0);return()=>window.clearTimeout(e)},[j,d.busy,G,fe]),o.useEffect(()=>{const e=()=>{!f||d.busy||g()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[d.busy,g,f]),o.useEffect(()=>{if(!z)return;const e=()=>te(null),n=a=>{a.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",n),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",n)}},[z]);const Ne=()=>{I.current=null,d.reset(),F(""),V(""),u("/chat")},Ae=async e=>{const n=ye.trim();if(n)try{const a=await $e(e,{title:n});y.current.add(e),e===c&&V(a.title),_(w=>w.map(k=>k.id===e?a:k)),ce(null)}catch(a){S(a instanceof Error?a.message:"Rename failed")}},at=async e=>{const n=e===c&&d.busy;if(window.confirm(n?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){n&&d.stop();try{if(n){const a=Date.now()+3e3;for(;(await je(e)).is_busy;){if(Date.now()>=a)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(k=>window.setTimeout(k,150))}}await Nt(e),e===c&&Ne(),await g()}catch(a){S(a instanceof Error?a.message:"Delete failed")}}},it=async()=>{var e;if(!s){l(!0);try{const n=await Dt();if(await g(),n.archived_count===0){x({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const a=((e=[...d.messages].reverse().find(w=>w.role==="user"))==null?void 0:e.text)??"";d.reset(),F(a),V(""),x({title:`${n.archived_count} ${n.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(n){x({variant:"destructive",title:"Could not archive old chats",description:n instanceof Error?n.message:"Try again."})}finally{l(!1)}}},De=async e=>{const n=A;if(H(e),!!c)try{const a=await $e(c,{selected_model:e});_(w=>w.map(k=>k.id===c?{...k,selected_model:a.selected_model}:k)),S("")}catch(a){H(n),S(a instanceof Error?a.message:"Model change failed")}},ot=async()=>{var e;if(!(!c||d.busy||t)){i(!0);try{const n=await At(c),a=new URL(n.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(a),x({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{m(a)}}catch(n){const a=n instanceof Error?n.message:"Could not share this conversation";S(a),x({variant:"destructive",title:"Share failed",description:a})}finally{i(!1)}}},[ct,lt]=o.useState(60);o.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const n=()=>lt(e.offsetHeight);n();const a=new ResizeObserver(n);return a.observe(e),()=>a.disconnect()},[]);const Se=o.useRef(null),ve=o.useRef(null),me=o.useRef(null);o.useEffect(()=>{d.busy||(me.current=null)},[d.busy]);const dt=(e,n)=>{var a;ve.current=((a=Se.current)==null?void 0:a.scrollTop)??null,d.toggleBlock(e,n)};o.useLayoutEffect(()=>{const e=Se.current;if(e){if(ve.current!==null){e.scrollTop=ve.current,ve.current=null;return}if(me.current){const n=Array.from(e.querySelectorAll("[data-message-id]")).find(a=>a.dataset.messageId===me.current);if(n){const a=e.getBoundingClientRect(),w=n.getBoundingClientRect();e.scrollTop+=w.top-a.top-24;return}}e.scrollTop=e.scrollHeight}},[d.messages]);const le=v.find(e=>e.id===c),Pe=d.messages.filter(e=>e.role==="user"),ke=(Ue=Pe[0])==null?void 0:Ue.id,ut=(qe=Pe.at(-1))==null?void 0:qe.id,Te=d.messages.length===0,Ce=(D==null?void 0:D.id)===c,Oe=!!(c&&(j||f&&(!Ce||(D==null?void 0:D.status)==="loading"))),Me=Ce&&(D==null?void 0:D.status)==="error"?D.error:void 0;return r.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${ct}px)`},children:[r.jsxs("aside",{className:`chat-sidebar${be?"":" chat-sidebar-closed"}`,children:[r.jsxs("div",{className:"chat-sidebar-top",children:[r.jsxs("button",{type:"button",className:"chat-new-chat",onClick:Ne,children:[r.jsx(jt,{})," New chat"]}),r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>we(!1),title:"Collapse sidebar",children:r.jsx(Ge,{})})]}),r.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[R&&r.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!R&&T&&r.jsx("div",{className:"chat-sessions-empty",children:T}),!R&&!T&&v.length===0&&r.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Lt(v).map(e=>r.jsxs("div",{className:"chat-session-group",children:[r.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(n=>r.jsxs("div",{className:`chat-session${n.id===c?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>u(`/chat/${n.id}`),onKeyDown:a=>{if(a.key==="Enter"&&u(`/chat/${n.id}`),a.key==="F2"&&(ce(n.id),he(n.title)),a.key==="ContextMenu"||a.shiftKey&&a.key==="F10"){a.preventDefault();const w=a.currentTarget.getBoundingClientRect();te({id:n.id,x:w.right-150,y:w.bottom})}},onContextMenu:a=>{a.preventDefault(),te({id:n.id,x:a.clientX,y:a.clientY})},children:[Re===n.id?r.jsx("input",{className:"chat-session-title-input",value:ye,autoFocus:!0,maxLength:80,onClick:a=>a.stopPropagation(),onChange:a=>he(a.target.value),onBlur:()=>void Ae(n.id),onKeyDown:a=>{a.stopPropagation(),a.key==="Enter"&&Ae(n.id),a.key==="Escape"&&ce(null)}}):r.jsx("span",{className:"chat-session-title",children:n.title}),r.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:a=>{a.stopPropagation();const w=a.currentTarget.getBoundingClientRect();te({id:n.id,x:w.right-150,y:w.bottom})},children:"⋯"}),r.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:a=>{a.stopPropagation(),at(n.id)},children:r.jsx(It,{})})]},n.id))]},e.label))]}),z&&r.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:z.x,top:z.y},onClick:e=>e.stopPropagation(),children:r.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=v.find(n=>n.id===z.id);e&&(ce(e.id),he(e.title)),te(null)},children:"Rename chat"})})]}),r.jsxs("section",{className:"chat-main",children:[r.jsxs("div",{className:"chat-topbar",children:[!be&&r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>we(!0),title:"Open sidebar",children:r.jsx(Ge,{})}),r.jsx("span",{className:"chat-topbar-title",children:Oe?(le==null?void 0:le.title)||"":P||(le==null?void 0:le.title)||(Te?"":"New chat")}),se&&r.jsx("span",{className:"chat-staging-badge",children:"Staging"}),c&&Ce&&(D==null?void 0:D.status)==="loaded"&&!Te&&r.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void ot(),disabled:d.busy||t||Oe,"aria-label":"Share conversation",children:[t?r.jsx(Ke,{}):r.jsx(Mt,{"aria-hidden":"true"}),r.jsx("span",{children:"Share"})]})]}),Oe?r.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[r.jsx(Ke,{}),r.jsx("span",{children:"Loading conversation…"})]}):Me?r.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[r.jsx("p",{children:Me}),r.jsx("button",{type:"button",onClick:()=>{Y({id:c,status:"loading"}),C(e=>e+1)},children:"Try again"})]}):Te?r.jsx("div",{className:"chat-empty",children:r.jsxs("div",{className:"chat-empty-inner",children:[r.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),r.jsxs("h1",{className:"chat-empty-title",children:["Ask ",r.jsx("em",{children:"Papers With Code"})]}),r.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),se&&r.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),r.jsx(nt,{provider:Z}),r.jsx(Be,{onSend:fe,busy:d.busy,onStop:d.stop,autoFocus:!0,draft:ae,onDraftChange:F,models:ue,selectedModel:A,onModelChange:e=>void De(e)}),r.jsx("div",{className:"chat-examples",children:Pt.map(e=>r.jsx("button",{type:"button",className:"chat-example",onClick:()=>fe(e),children:e},e))})]})}):r.jsxs(r.Fragment,{children:[d.sessionError&&r.jsx("div",{className:"chat-session-error",role:"alert",children:d.sessionError}),r.jsx("div",{className:"chat-conversation",ref:Se,children:r.jsx("div",{className:"chat-conversation-inner",children:d.messages.map(e=>e.role==="user"?r.jsx(_t,{id:e.id,text:e.text??"",isInitial:e.id===ke,editingAllowed:!d.busy&&!!e.revision,editing:ge===e.id,editNotice:e.id===ke?"Sending will start a new chat.":e.id===ut?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>$(e.id),onCancel:()=>$(null),onResend:n=>{e.id!==ke&&(me.current=e.id);const a=d.editAndResend(e.id,n);return a?$(null):me.current=null,a}},e.id):r.jsx(Rt,{msg:e,papers:d.papers,onToggleBlock:dt,onArchiveOldChats:()=>void it(),archivePending:s},e.id))})}),r.jsx("div",{className:"chat-composer-wrap",children:r.jsxs("div",{className:"chat-composer-inner",children:[r.jsx(nt,{provider:Z}),r.jsx(Be,{onSend:fe,busy:d.busy,onStop:d.stop,placeholder:ae?"Edit and send again…":"Ask a follow-up…",draft:ae,onDraftChange:F,models:ue,selectedModel:A,onModelChange:e=>void De(e)}),r.jsx("div",{className:"chat-composer-foot",children:_e()?r.jsxs(r.Fragment,{children:[Z==="openrouter"?r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",r.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",r.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),r.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):r.jsx(r.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),p&&r.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>m(""),children:r.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[r.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),r.jsx("p",{children:"It could not be copied automatically. Copy this link manually:"}),r.jsx("input",{readOnly:!0,value:p,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),r.jsx("button",{type:"button",onClick:()=>m(""),children:"Close"})]})}),d.capacityRequest&&r.jsx(Kt,{retryAt:d.capacityRequest.retryAt,onCancel:d.cancelCapacity,onRetry:()=>{d.retryCapacity()&&F("")}})]})};export{Kt as ChatCapacityDialog,an as default}; diff --git a/assets/ChatView-KuyaCl6P.js b/assets/ChatView-KuyaCl6P.js deleted file mode 100644 index 7cc5622de9a60fe3ceca3569cfb5c74f6ce8e059..0000000000000000000000000000000000000000 --- a/assets/ChatView-KuyaCl6P.js +++ /dev/null @@ -1,16 +0,0 @@ -import{c as lt,d as je,r as o,j as r,e as dt,u as ut,a as ht,f as ft,g as mt,h as pt,X as gt}from"./index-LWBjDGUR.js";import{C as Fe,U as yt,A as bt}from"./ChatMessage-_9GmgEOY.js";import{c as wt,g as Ce,t as et,r as vt,F as _t,D as Rt,l as xt,C as Ue,a as qe,b as Be,d as St,e as kt,P as Tt,f as He,h as Ot,T as Ct,S as We,u as Ve,i as Et,j as jt,k as Lt}from"./chatSessions-gAEfkaKP.js";import{S as It}from"./chatPrompts-CDY3UGU1.js";import"./katex.min-BSBacQyE.js";import"./hover-card-BYeJ4GbN.js";import"./PaperPreviewLink-DWreeZBU.js";import"./index-C3kXFp4C.js";import"./useQuery-CVb9j2D6.js";import"./useBaseQuery-CSyvHxAw.js";/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Nt=lt("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),U=(l,d)=>new Promise(u=>{const E=setTimeout(f,l);function f(){d==null||d.removeEventListener("abort",f),clearTimeout(E),u()}d==null||d.addEventListener("abort",f)}),J=l=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...l}),X={name:"Object Detection",slug:"object-detection"},ne={name:"Real-Time Object Detection",slug:"real-time-object-detection"},At={"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:J({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[X,ne],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:J({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[X,ne],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:J({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:[X,ne],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:J({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[X,ne],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:J({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:[X,ne],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:J({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:[X,ne],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:J({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"},X],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:J({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[X,ne],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},tt=l=>l.map(d=>At[d]),Ge=tt(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),$e=tt(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),Ke="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.",ze="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.",Je=`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.`,Dt=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*Pt(l,d){const u=()=>(d==null?void 0:d.aborted)===!0,E=l.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 U(350,d),!u()){yield{type:"reasoning_start"};for(let f=0;f{const d=String("0").trim().toLowerCase();return d==="1"||d==="true"||d==="yes"};class Ee extends Error{constructor(d,u,E,f){super(d),this.code=u,this.status=E,this.retryAfterSeconds=f,this.name="ChatStreamError"}}function Mt(l,d){if(_e())try{fetch(je(`/api/v1/chat/latency/${encodeURIComponent(l)}`),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",keepalive:!0,body:JSON.stringify(d)}).catch(()=>{})}catch{}}function Yt(l,d={}){return _e()?Ft(l,d.signal):Pt(l.message,d.signal)}async function*Ft(l,d){const u=await fetch(je("/api/v1/chat/stream"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"include",body:JSON.stringify(l),signal:d});if(!u.ok||!u.body){const x=await u.json().catch(()=>null),v=x==null?void 0:x.detail,_=u.status===403&&!v,R=Number(u.headers.get("Retry-After")),I=Number.isFinite(R)&&R>=0?Math.min(300,Math.ceil(R)):void 0;throw new Ee(_?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(v==null?void 0:v.message)||v||`Chat stream failed (${u.status})`,(v==null?void 0:v.code)||(_?"staging_access_required":void 0),u.status,I)}const E=u.body.getReader(),f=new TextDecoder;let j="";try{for(;;){const{done:x,value:v}=await E.read();if(x)break;j+=f.decode(v,{stream:!0});let _;for(;(_=j.indexOf(` - -`))!==-1;){const R=j.slice(0,_);j=j.slice(_+2);const I=R.split(` -`).filter(T=>T.startsWith("data:")).map(T=>T.slice(5).trimStart()).join(` -`);!I||I==="[DONE]"||(yield JSON.parse(I))}}}finally{E.releaseLock()}}const Xe="Preparing research workspace…",Ut=750;function Oe(l,d){for(let u=l.length-1;u>=0;u-=1)if(d(l[u]))return u;return-1}function qt(l){const[d,u]=o.useState([]),[E,f]=o.useState(!1),[j,x]=o.useState(""),v=o.useRef(!1),_=o.useRef(null),R=o.useRef(null),I=o.useRef("cleared"),T=o.useRef(null),O=o.useRef(null),[D,F]=o.useState(null),H=o.useRef([]),C=o.useRef(l),ce=o.useRef(""),Q=o.useRef(""),le=o.useRef(0),L=o.useRef(0),N=o.useRef(l.sessionId),W=o.useRef(l.sessionId);W.current!==l.sessionId&&(W.current=l.sessionId,N.current!==l.sessionId&&(L.current+=1,T.current=null)),C.current=l,H.current=d,o.useEffect(()=>()=>{var t;R.current!==null&&window.clearTimeout(R.current),(t=_.current)==null||t.abort(),O.current=null},[]),o.useEffect(()=>{v.current||(N.current=l.sessionId)},[l.sessionId]);const de=o.useMemo(()=>{const t={};for(const a of d)for(const s of a.blocks??[])if(s.kind==="tool")for(const c of s.results??[])t[c.route_id]=c;return t},[d]),re=()=>`m${++le.current}_${Date.now().toString(36)}`,M=t=>u(a=>{if(!a.length)return a;const s=a.slice();return s[s.length-1]=t(s[s.length-1]),s}),V=t=>M(a=>({...a,blocks:[...a.blocks??[],t]})),se=(t,a)=>M(s=>({...s,blocks:(s.blocks??[]).map((c,g,m)=>t(c,g,m)?a(c):c)})),q=t=>(a,s,c)=>a.kind===t&&Oe(c,g=>g.kind===t)===s,G=t=>{if(_.current!==t||(R.current!==null&&(window.clearTimeout(R.current),R.current=null),I.current==="cleared"))return;const a=I.current==="shown";I.current="cleared",a&&M(s=>{if(s.status!==Xe)return s;const{status:c,...g}=s;return g})},$=(t,a)=>{t.requestId&&Mt(t.requestId,a)},ae=(t,a)=>{const s=T.current;!s||s.controller!==t||(s.requestId=a,s.streamStartReported||(s.streamStartReported=!0,$(s,{submission_to_stream_start_ms:Math.max(0,performance.now()-s.submittedAt)})),s.firstVisibleAt!==void 0&&!s.firstVisibleReported&&(s.firstVisibleReported=!0,$(s,{submission_to_first_visible_delta_ms:Math.max(0,s.firstVisibleAt-s.submittedAt)})))},ie=(t,a)=>{const s=T.current;!s||s.controller!==t||s.terminalReported||(s.terminalReported=!0,$(s,{terminal_classification:a}))};o.useLayoutEffect(()=>{const t=T.current;if(!t||t.firstVisibleAt!==void 0)return;const a=d.at(-1);(a==null?void 0:a.role)!=="assistant"||!(a.blocks??[]).some(c=>c.kind==="tool"||c.kind==="reasoning"&&!!c.text.trim()||c.kind==="answer"&&!!c.text.trim())||(t.firstVisibleAt=performance.now(),t.requestId&&!t.firstVisibleReported&&(t.firstVisibleReported=!0,$(t,{submission_to_first_visible_delta_ms:Math.max(0,t.firstVisibleAt-t.submittedAt)})))},[d]);const Z=t=>{switch(t.type){case"stream_start":t.session_id&&(N.current=t.session_id,C.current.onSessionId(t.session_id));break;case"sandbox_start":case"sandbox_ready":case"workspace_ready":break;case"session_title_start":Q.current="";break;case"session_title_delta":Q.current+=t.text,C.current.onTitle(Q.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":Q.current=t.title,C.current.onTitle(t.title);break;case"reasoning_start":M(a=>({...a,blocks:[...(a.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s),{kind:"reasoning",text:"",active:!0,open:!0}]}));break;case"reasoning_delta":se(q("reasoning"),a=>a.kind==="reasoning"?{...a,text:a.text+t.text}:a);break;case"reasoning_end":M(a=>{const s=a.blocks??[],c=Oe(s,p=>p.kind==="reasoning"&&p.active);if(c<0)return a;const g=s[c];if(g.kind!=="reasoning")return a;const m=s[c-1];return(m==null?void 0:m.kind)==="reasoning"&&m.text===g.text?{...a,blocks:s.filter((p,y)=>y!==c)}:{...a,blocks:s.map((p,y)=>y===c?{...g,active:!1,open:!1}:p)}});break;case"tool_call":V({kind:"tool",id:t.id,name:t.name,args:t.args,status:"running",open:!1});break;case"tool_result":se(a=>a.kind==="tool"&&a.id===t.id,a=>a.kind==="tool"?t.status?{...a,schema_version:2,status:t.status,took_ms:t.took_ms,content:t.content,metadata:t.metadata,open:t.status!=="success"}:{...a,status:"done",hits:t.hits,took_ms:t.took_ms,results:t.results}:a);break;case"answer_delta":M(a=>{const s=a.blocks??[],c=s.at(-1);return(c==null?void 0:c.kind)==="answer"&&!c.done?{...a,blocks:[...s.slice(0,-1),{...c,text:c.text+t.text}]}:{...a,blocks:[...s,{kind:"answer",text:t.text,done:!1}]}});break;case"done":M(a=>({...a,streaming:!1,followups:t.followups,finishReason:t.finish_reason,citations:t.citations,blocks:(a.blocks??[]).map(s=>s.kind==="answer"?{...s,done:!0}:s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}));break;case"error":M(a=>({...a,streaming:!1,error:t.message,errorCode:t.code,blocks:(a.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}));break}},pe=async(t,a)=>{const s=await Ce(t),c=et(s);return L.current!==a?null:(u(c),H.current=c,c)},K=(t,a,s,c,g)=>{const m=++L.current;v.current=!0;const p=new AbortController;return _.current=p,ce.current=t,N.current=a.session_id,x(""),u(s),f(!0),T.current={controller:p,submittedAt:performance.now(),streamStartReported:!1,firstVisibleReported:!1,terminalReported:!1},R.current!==null&&window.clearTimeout(R.current),I.current="armed",R.current=window.setTimeout(()=>{R.current=null,!(_.current!==p||p.signal.aborted||L.current!==m)&&(I.current="shown",M(y=>{var P;return y.role==="assistant"&&y.streaming&&(((P=y.blocks)==null?void 0:P.length)??0)===0&&!y.error?{...y,status:Xe}:y}))},Ut),(async()=>{var h;let y=!1,P=!1,A=!1,Y=!1;try{for await(const b of Yt(a,{signal:p.signal})){b.type==="stream_start"&&(y=!0,ae(p,b.request_id)),(b.type==="workspace_ready"||b.type==="reasoning_start"||b.type==="reasoning_delta"||b.type==="tool_call"||b.type==="answer_delta"||b.type==="done"||b.type==="error")&&G(p),(b.type==="done"||b.type==="error")&&(P=!0,A=b.type==="error",ie(p,b.type==="error"?"error":"complete"));const S=L.current===m;!p.signal.aborted&&(S||b.type==="stream_start"||b.type==="session_title_start"||b.type==="session_title_delta"||b.type==="session_title_done")&&Z(b)}}catch(b){if(A=!0,!p.signal.aborted){if(G(p),b instanceof Ee&&b.code==="chat_capacity"){Y=!0;const S=b.retryAfterSeconds??5,te={question:t,request:a,optimistic:s,original:c,edit:g,retryAfterSeconds:S,retryAt:Date.now()+S*1e3};O.current=te,F({question:t,retryAt:te.retryAt,retryAfterSeconds:S}),L.current===m&&(u(c),H.current=c,x(""))}else ie(p,"network_error");!Y&&L.current===m&&Z({type:"error",message:b instanceof Error?b.message:"The assistant stream failed.",code:b instanceof Ee?b.code:void 0})}}finally{if(_.current===p){if(G(p),!P&&!p.signal.aborted&&ie(p,"network_error"),v.current=!1,f(!1),Y)C.current.onSettled(a.session_id);else if(!p.signal.aborted){const b=N.current;if(g&&!y)L.current===m&&(u(g.snapshot),H.current=g.snapshot,x("Couldn’t resend this message. Your original conversation was restored."));else if(b){L.current===m&&g&&!g.first&&(A||!P)&&(u(g.snapshot),H.current=g.snapshot);try{const S=await pe(b,m);S&&g&&!g.first&&S.some(te=>te.id===g.targetId)&&x("Couldn’t resend this message. Your original conversation was restored.")}catch{L.current===m&&M(S=>S.streaming?{...S,streaming:!1}:S)}}else L.current===m&&M(S=>S.streaming?{...S,streaming:!1}:S);C.current.onSettled(b)}((h=T.current)==null?void 0:h.controller)===p&&(T.current=null)}}})(),!0},ge=o.useCallback(t=>{const a=t.trim();if(!a||a.length>8e3||v.current||O.current)return!1;const s=H.current,c=[...s].reverse().find(A=>A.role==="user"),g=c!=null&&c.status&&c.status!=="complete"&&c.revision?{replace_message_id:c.id,prior_revision:c.revision}:null,m={id:re(),role:"user",text:a},p={id:re(),role:"assistant",streaming:!0,blocks:[]},y=g&&c?Oe(s,A=>A.id===c.id):-1,P=y<0?[...s,m,p]:[...s.slice(0,y),m,p];return K(a,{message:a,session_id:C.current.sessionId,client_message_id:crypto.randomUUID(),...!C.current.sessionId&&C.current.initialModel?{initial_model:C.current.initialModel}:{},...g??{}},P,s)},[]),ue=o.useCallback((t,a)=>{const s=a.trim();if(!s||s.length>8e3||v.current||O.current)return!1;const c=H.current.slice(),g=c.findIndex(h=>h.id===t&&h.role==="user");if(g<0)return!1;const m=c[g],p=c.findIndex(h=>h.role==="user"),y=g===p;if(!y&&(!C.current.sessionId||!m.revision))return!1;const P={id:m.id,role:"user",text:s,revision:y?void 0:m.revision+1,status:"generating"},A={id:re(),role:"assistant",streaming:!0,blocks:[]},Y=y?[P,A]:[...c.slice(0,g),P,A];return K(s,{message:s,session_id:y?null:C.current.sessionId,client_message_id:crypto.randomUUID(),...y&&C.current.initialModel?{initial_model:C.current.initialModel}:{},...y?{}:{replace_message_id:m.id,prior_revision:m.revision}},Y,c,{targetId:m.id,snapshot:c,first:y})},[]),z=o.useCallback(()=>{O.current=null,F(null)},[]),ee=o.useCallback(()=>{const t=O.current;return!t||Date.now(){var c;if(!_.current)return;const t=_.current;G(t),ie(t,"stopped"),t.abort(),_.current=null,((c=T.current)==null?void 0:c.controller)===t&&(T.current=null),v.current=!1,f(!1),u(g=>{const m=g.at(-1);if((m==null?void 0:m.role)!=="assistant")return g;const p=(m.blocks??[]).flatMap(y=>y.kind==="tool"&&y.status==="running"?[]:y.kind==="reasoning"&&y.active?[]:y.kind==="answer"?[{...y,done:!0}]:[y]);return[...g.slice(0,-1),{...m,blocks:p,streaming:!1,finishReason:"stopped"}]}),C.current.onInterrupted(ce.current);const a=N.current;a&&wt(a).catch(()=>{});const s=++L.current;window.setTimeout(()=>{a&&L.current===s?pe(a,s).catch(()=>{}).finally(()=>C.current.onSettled(a)):a||C.current.onSettled(null)},450)},[]),be=o.useCallback((t,a)=>u(s=>s.map(c=>{var g;return c.id!==t?c:{...c,blocks:(g=c.blocks)==null?void 0:g.map((m,p)=>p===a&&(m.kind==="reasoning"||m.kind==="tool")?{...m,open:!m.open}:m)}})),[]),he=o.useCallback(()=>{var t;L.current+=1,R.current!==null&&(window.clearTimeout(R.current),R.current=null),I.current="cleared",(t=_.current)==null||t.abort(),_.current=null,T.current=null,O.current=null,F(null),v.current=!1,N.current=null,u([]),f(!1),x("")},[]),we=o.useCallback(t=>{var a;L.current+=1,R.current!==null&&(window.clearTimeout(R.current),R.current=null),I.current="cleared",T.current=null,O.current=null,F(null),v.current||((a=_.current)==null||a.abort(),_.current=null),u(t),v.current||f(!1),x("")},[]);return{messages:d,busy:E,papers:de,sessionError:j,capacityRequest:D,send:ge,editAndResend:ue,retryCapacity:ee,cancelCapacity:z,stop:ye,toggleBlock:be,reset:he,load:we}}const Bt="https://huggingface.co/settings/inference-providers",Qe="pwc.chat.billing-notice-dismissed.v1",Ze=({provider:l})=>{const[d,u]=o.useState(()=>localStorage.getItem(Qe)==="1");return!_e()||d||l!=="huggingface"?null:r.jsxs("div",{className:"chat-billing-notice",role:"note",children:[r.jsx("span",{children:"Hugging Face models use the inference permission granted at sign-in. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),r.jsxs("div",{className:"chat-billing-notice-actions",children:[r.jsx("a",{href:"/settings",children:"Review billing"}),r.jsx("a",{href:Bt,target:"_blank",rel:"noreferrer",children:"Review usage"}),r.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(Qe,"1"),u(!0)},children:r.jsx(gt,{size:15,"aria-hidden":"true"})})]})]})},Ht=({retryAt:l,onRetry:d,onCancel:u})=>{const[E,f]=o.useState(()=>Math.max(0,Math.ceil((l-Date.now())/1e3))),j=o.useRef(null);return o.useEffect(()=>{var R;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;(R=j.current)==null||R.focus();const v=()=>f(Math.max(0,Math.ceil((l-Date.now())/1e3)));v();const _=window.setInterval(v,250);return()=>{window.clearInterval(_),x==null||x.focus()}},[l]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),u())},children:[r.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),r.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),r.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:E>0?`Try again available in ${E} second${E===1?"":"s"}.`:"You can try again now."}),r.jsxs("div",{className:"chat-capacity-dialog-actions",children:[r.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:j,onClick:u,children:"Cancel"}),r.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:E>0,onClick:d,children:"Try again"})]})]})})},tn=()=>{var De,Pe,Me,Ye;const{sessionId:l}=dt(),d=ut(),[u,E]=ht(),{user:f,isLoading:j}=ft(),{toast:x}=mt(),[v,_]=o.useState([]),[R,I]=o.useState(!1),[T,O]=o.useState(""),[D,F]=o.useState(()=>l?{id:l,status:"loading"}:null),[H,C]=o.useState(0),ce=o.useRef(vt()),Q=o.useRef(u.get("model")||((De=ce.current)==null?void 0:De.model)),[le,L]=o.useState(_t),[N,W]=o.useState(Q.current||Rt),de=((Pe=le.find(e=>e.id===N))==null?void 0:Pe.provider)??"huggingface",re=pt(),[M,V]=o.useState(""),[se,q]=o.useState(""),[G,$]=o.useState(()=>{var e,n;return((e=u.get("q"))==null?void 0:e.trim())||((n=ce.current)==null?void 0:n.prompt)||""}),ae=o.useRef(!1),[ie,Z]=o.useState(null),[pe,K]=o.useState(null),[ge,ue]=o.useState(""),[z,ee]=o.useState(null),[ye,be]=o.useState(()=>typeof window>"u"||window.innerWidth>900),[he,we]=o.useState(!1),[t,a]=o.useState(!1),[s,c]=o.useState(""),g=o.useRef(new Set),m=o.useRef(!1),p=o.useRef(l),y=o.useRef(null),P=o.useRef(null),A=o.useRef(null);p.current=l;const Y=o.useCallback(async()=>{if(!f)return;const e=!m.current;e&&I(!0);try{const n=await xt();_(i=>{const w=y.current,k=w?i.find(me=>me.id===w):void 0;if(!k)return n;const B=n.find(me=>me.id===w);return[B?{...B,title:k.title,is_busy:!0}:k,...n.filter(me=>me.id!==w)]}),m.current=!0,O("")}catch(n){O(n instanceof Error?n.message:"Could not load chats")}finally{e&&I(!1)}},[f]),h=qt({sessionId:l??null,initialModel:N,onSessionId:e=>{y.current=e;const n=e!==p.current,i=p.current===P.current,w=new Date().toISOString();_(k=>k.some(B=>B.id===e)?k.map(B=>B.id===e?{...B,is_busy:!0}:B):[{id:e,title:"New chat",selected_model:N,created_at:w,updated_at:w,message_count:1,is_busy:!0},...k]),n&&i&&V("New chat"),i&&(A.current=e,F({id:e,status:"loaded"}),n&&d(`/chat/${e}`,{replace:!0}))},onTitle:e=>{const n=y.current??p.current;n&&!g.current.has(n)&&(n===p.current&&V(e),_(i=>i.map(w=>w.id===n?{...w,title:e}:w)))},onSettled:e=>{e&&_(n=>n.map(i=>i.id===e?{...i,is_busy:!1}:i)),y.current=null,P.current=null,Y()},onInterrupted:e=>{q(e)}});h.load;const b=h.send;o.useEffect(()=>{h.capacityRequest&&q(h.capacityRequest.question)},[h.capacityRequest]),o.useEffect(()=>{h.busy&&Z(null)},[h.busy]);const S=o.useCallback(e=>{if(!f){sessionStorage.setItem(Ue,e),sessionStorage.setItem(qe,N),sessionStorage.setItem(Be,"1"),window.location.href=je(`/api/v1/auth/hf/login?return_to=${encodeURIComponent("/chat")}`);return}const n=p.current??null;b(e)&&(P.current=n,y.current=n,St(),q(""))},[N,b,f]);o.useEffect(()=>{if(j||!f)return;const e=sessionStorage.getItem(qe);e&&W(e),Y(),kt().then(w=>{if(L(w.items),!p.current){const k=Q.current||e;W(k&&w.items.some(B=>B.id===k)?k:w.default_model)}});const n=sessionStorage.getItem(Ue),i=sessionStorage.getItem(Be)==="1";n&&(i?$(n):q(n))},[j,Y,f]),o.useEffect(()=>{if(!l){A.current!==null&&(A.current=null,h.reset()),F(null);return}if(A.current===l||(F(n=>(n==null?void 0:n.id)===l&&n.status==="loading"?n:{id:l,status:"loading"}),j||!f))return;let e=!1;return O(""),Ce(l).then(n=>{e||(h.load(et(n)),W(n.selected_model),V(n.title),A.current=l,F({id:l,status:"loaded"}))}).catch(n=>{if(e)return;const i=n instanceof Error?n.message:"Chat not found";h.reset(),O(i),F({id:l,status:"error",error:i})}),()=>{e=!0}},[j,l,f,h.busy,H]),o.useEffect(()=>{var w;const e=(w=u.get("q"))==null?void 0:w.trim();if(!e)return;ae.current=!1;const n=u.get("model");n&&W(n),$(e);const i=new URLSearchParams(u);i.delete("q"),i.delete("model"),E(i,{replace:!0})},[u,E]),o.useEffect(()=>{if(j||h.busy||!G||ae.current)return;const e=window.setTimeout(()=>{if(ae.current)return;ae.current=!0;const n=G;$(""),S(n)},0);return()=>window.clearTimeout(e)},[j,h.busy,G,S]),o.useEffect(()=>{const e=()=>{!f||h.busy||Y()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[h.busy,Y,f]),o.useEffect(()=>{if(!z)return;const e=()=>ee(null),n=i=>{i.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",n),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",n)}},[z]);const te=()=>{y.current=null,h.reset(),q(""),V(""),d("/chat")},Le=async e=>{const n=ge.trim();if(n)try{const i=await Ve(e,{title:n});g.current.add(e),e===l&&V(i.title),_(w=>w.map(k=>k.id===e?i:k)),K(null)}catch(i){O(i instanceof Error?i.message:"Rename failed")}},nt=async e=>{const n=e===l&&h.busy;if(window.confirm(n?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){n&&h.stop();try{if(n){const i=Date.now()+3e3;for(;(await Ce(e)).is_busy;){if(Date.now()>=i)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(k=>window.setTimeout(k,150))}}await Et(e),e===l&&te(),await Y()}catch(i){O(i instanceof Error?i.message:"Delete failed")}}},rt=async()=>{var e;if(!t){a(!0);try{const n=await Lt();if(await Y(),n.archived_count===0){x({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const i=((e=[...h.messages].reverse().find(w=>w.role==="user"))==null?void 0:e.text)??"";h.reset(),q(i),V(""),x({title:`${n.archived_count} ${n.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(n){x({variant:"destructive",title:"Could not archive old chats",description:n instanceof Error?n.message:"Try again."})}finally{a(!1)}}},Ie=async e=>{const n=N;if(W(e),!!l)try{const i=await Ve(l,{selected_model:e});_(w=>w.map(k=>k.id===l?{...k,selected_model:i.selected_model}:k)),O("")}catch(i){W(n),O(i instanceof Error?i.message:"Model change failed")}},st=async()=>{var e;if(!(!l||h.busy||he)){we(!0);try{const n=await jt(l),i=new URL(n.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(i),x({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{c(i)}}catch(n){const i=n instanceof Error?n.message:"Could not share this conversation";O(i),x({variant:"destructive",title:"Share failed",description:i})}finally{we(!1)}}},[at,it]=o.useState(60);o.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const n=()=>it(e.offsetHeight);n();const i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[]);const Re=o.useRef(null),ve=o.useRef(null),fe=o.useRef(null);o.useEffect(()=>{h.busy||(fe.current=null)},[h.busy]);const ot=(e,n)=>{var i;ve.current=((i=Re.current)==null?void 0:i.scrollTop)??null,h.toggleBlock(e,n)};o.useLayoutEffect(()=>{const e=Re.current;if(e){if(ve.current!==null){e.scrollTop=ve.current,ve.current=null;return}if(fe.current){const n=Array.from(e.querySelectorAll("[data-message-id]")).find(i=>i.dataset.messageId===fe.current);if(n){const i=e.getBoundingClientRect(),w=n.getBoundingClientRect();e.scrollTop+=w.top-i.top-24;return}}e.scrollTop=e.scrollHeight}},[h.messages]);const oe=v.find(e=>e.id===l),Ne=h.messages.filter(e=>e.role==="user"),xe=(Me=Ne[0])==null?void 0:Me.id,ct=(Ye=Ne.at(-1))==null?void 0:Ye.id,Se=h.messages.length===0,ke=(D==null?void 0:D.id)===l,Te=!!(l&&(j||f&&(!ke||(D==null?void 0:D.status)==="loading"))),Ae=ke&&(D==null?void 0:D.status)==="error"?D.error:void 0;return r.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${at}px)`},children:[r.jsxs("aside",{className:`chat-sidebar${ye?"":" chat-sidebar-closed"}`,children:[r.jsxs("div",{className:"chat-sidebar-top",children:[r.jsxs("button",{type:"button",className:"chat-new-chat",onClick:te,children:[r.jsx(Tt,{})," New chat"]}),r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>be(!1),title:"Collapse sidebar",children:r.jsx(He,{})})]}),r.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[R&&r.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!R&&T&&r.jsx("div",{className:"chat-sessions-empty",children:T}),!R&&!T&&v.length===0&&r.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Ot(v).map(e=>r.jsxs("div",{className:"chat-session-group",children:[r.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(n=>r.jsxs("div",{className:`chat-session${n.id===l?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>d(`/chat/${n.id}`),onKeyDown:i=>{if(i.key==="Enter"&&d(`/chat/${n.id}`),i.key==="F2"&&(K(n.id),ue(n.title)),i.key==="ContextMenu"||i.shiftKey&&i.key==="F10"){i.preventDefault();const w=i.currentTarget.getBoundingClientRect();ee({id:n.id,x:w.right-150,y:w.bottom})}},onContextMenu:i=>{i.preventDefault(),ee({id:n.id,x:i.clientX,y:i.clientY})},children:[pe===n.id?r.jsx("input",{className:"chat-session-title-input",value:ge,autoFocus:!0,maxLength:80,onClick:i=>i.stopPropagation(),onChange:i=>ue(i.target.value),onBlur:()=>void Le(n.id),onKeyDown:i=>{i.stopPropagation(),i.key==="Enter"&&Le(n.id),i.key==="Escape"&&K(null)}}):r.jsx("span",{className:"chat-session-title",children:n.title}),r.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:i=>{i.stopPropagation();const w=i.currentTarget.getBoundingClientRect();ee({id:n.id,x:w.right-150,y:w.bottom})},children:"⋯"}),r.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:i=>{i.stopPropagation(),nt(n.id)},children:r.jsx(Ct,{})})]},n.id))]},e.label))]}),z&&r.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:z.x,top:z.y},onClick:e=>e.stopPropagation(),children:r.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=v.find(n=>n.id===z.id);e&&(K(e.id),ue(e.title)),ee(null)},children:"Rename chat"})})]}),r.jsxs("section",{className:"chat-main",children:[r.jsxs("div",{className:"chat-topbar",children:[!ye&&r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>be(!0),title:"Open sidebar",children:r.jsx(He,{})}),r.jsx("span",{className:"chat-topbar-title",children:Te?(oe==null?void 0:oe.title)||"":M||(oe==null?void 0:oe.title)||(Se?"":"New chat")}),re&&r.jsx("span",{className:"chat-staging-badge",children:"Staging"}),l&&ke&&(D==null?void 0:D.status)==="loaded"&&!Se&&r.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void st(),disabled:h.busy||he||Te,"aria-label":"Share conversation",children:[he?r.jsx(We,{}):r.jsx(Nt,{"aria-hidden":"true"}),r.jsx("span",{children:"Share"})]})]}),Te?r.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[r.jsx(We,{}),r.jsx("span",{children:"Loading conversation…"})]}):Ae?r.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[r.jsx("p",{children:Ae}),r.jsx("button",{type:"button",onClick:()=>{F({id:l,status:"loading"}),C(e=>e+1)},children:"Try again"})]}):Se?r.jsx("div",{className:"chat-empty",children:r.jsxs("div",{className:"chat-empty-inner",children:[r.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),r.jsxs("h1",{className:"chat-empty-title",children:["Ask ",r.jsx("em",{children:"Papers With Code"})]}),r.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),re&&r.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),r.jsx(Ze,{provider:de}),r.jsx(Fe,{onSend:S,busy:h.busy,onStop:h.stop,autoFocus:!0,draft:se,onDraftChange:q,models:le,selectedModel:N,onModelChange:e=>void Ie(e)}),r.jsx("div",{className:"chat-examples",children:It.map(e=>r.jsx("button",{type:"button",className:"chat-example",onClick:()=>S(e),children:e},e))})]})}):r.jsxs(r.Fragment,{children:[h.sessionError&&r.jsx("div",{className:"chat-session-error",role:"alert",children:h.sessionError}),r.jsx("div",{className:"chat-conversation",ref:Re,children:r.jsx("div",{className:"chat-conversation-inner",children:h.messages.map(e=>e.role==="user"?r.jsx(yt,{id:e.id,text:e.text??"",isInitial:e.id===xe,editingAllowed:!h.busy&&!!e.revision,editing:ie===e.id,editNotice:e.id===xe?"Sending will start a new chat.":e.id===ct?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>Z(e.id),onCancel:()=>Z(null),onResend:n=>{e.id!==xe&&(fe.current=e.id);const i=h.editAndResend(e.id,n);return i?Z(null):fe.current=null,i}},e.id):r.jsx(bt,{msg:e,papers:h.papers,onToggleBlock:ot,onArchiveOldChats:()=>void rt(),archivePending:t},e.id))})}),r.jsx("div",{className:"chat-composer-wrap",children:r.jsxs("div",{className:"chat-composer-inner",children:[r.jsx(Ze,{provider:de}),r.jsx(Fe,{onSend:S,busy:h.busy,onStop:h.stop,placeholder:se?"Edit and send again…":"Ask a follow-up…",draft:se,onDraftChange:q,models:le,selectedModel:N,onModelChange:e=>void Ie(e)}),r.jsx("div",{className:"chat-composer-foot",children:_e()?r.jsxs(r.Fragment,{children:[de==="openrouter"?r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",r.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",r.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),r.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):r.jsx(r.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),s&&r.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>c(""),children:r.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[r.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),r.jsx("p",{children:"It could not be copied automatically. Copy this link manually:"}),r.jsx("input",{readOnly:!0,value:s,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),r.jsx("button",{type:"button",onClick:()=>c(""),children:"Close"})]})}),h.capacityRequest&&r.jsx(Ht,{retryAt:h.capacityRequest.retryAt,onCancel:h.cancelCapacity,onRetry:()=>{h.retryCapacity()&&q("")}})]})};export{Ht as ChatCapacityDialog,tn as default}; diff --git a/assets/ConferenceDetailView-BKXxJj_4.js b/assets/ConferenceDetailView-bTqcoiXt.js similarity index 93% rename from assets/ConferenceDetailView-BKXxJj_4.js rename to assets/ConferenceDetailView-bTqcoiXt.js index e51c1ffc17bb9a83cd4a5394ad38c37dd383daee..1eacee39c0eced34800d88ddb39e1a5de2ce58a3 100644 --- a/assets/ConferenceDetailView-BKXxJj_4.js +++ b/assets/ConferenceDetailView-bTqcoiXt.js @@ -1 +1 @@ -import{e as L,r as D,j as e,L as p,b as C}from"./index-LWBjDGUR.js";import{u as T}from"./useQuery-CVb9j2D6.js";import{M as F}from"./MarkdownText-DQ_lzSri.js";import{e as B,h as A,d as E}from"./transform-BSMO2egg.js";import{S as f}from"./skeleton-JE1BtvIJ.js";import{A as P,a as z}from"./alert-fokOob1I.js";import"./useBaseQuery-CSyvHxAw.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DWreeZBU.js";import"./index-C3kXFp4C.js";import"./hover-card-BYeJ4GbN.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(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}`},J=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.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((r,n)=>r+n.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?R(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:s.url,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:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.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((r,n)=>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))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.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:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(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)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{J as default}; +import{e as L,r as D,j as e,L as p,b as C}from"./index-DsjIhQkx.js";import{u as T}from"./useQuery-xOve4y-6.js";import{M as F}from"./MarkdownText-DP1ebl5t.js";import{e as B,h as A,d as E}from"./transform-C1LieBU0.js";import{S as f}from"./skeleton-B1Kg5w0V.js";import{A as P,a as z}from"./alert-BThP2mep.js";import"./useBaseQuery-D4kcdcVW.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BkYFo5pJ.js";import"./index-DaRHhPdB.js";import"./hover-card-DWx_NdIh.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(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}`},J=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.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((r,n)=>r+n.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?R(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:s.url,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:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.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((r,n)=>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))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.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:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(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)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{J as default}; diff --git a/assets/ConferenceTaskView-BK0b5von.js b/assets/ConferenceTaskView-D8rZq4uz.js similarity index 89% rename from assets/ConferenceTaskView-BK0b5von.js rename to assets/ConferenceTaskView-D8rZq4uz.js index fa44358faea0f4daa1072b8bdd89253b10f7f51d..01c8a52356750d2907531c1e0a341745f3e826aa 100644 --- a/assets/ConferenceTaskView-BK0b5von.js +++ b/assets/ConferenceTaskView-D8rZq4uz.js @@ -1 +1 @@ -import{e as $,a as D,r as f,j as e,L as b,R as W,b as M}from"./index-LWBjDGUR.js";import{u as z}from"./useQuery-CVb9j2D6.js";import{P as G}from"./components-DaxA6Lf7.js";import{P as J}from"./PaperFeedFilters-BVyIB5Fr.js";import{M as h}from"./MarkdownText-DQ_lzSri.js";import{t as X,d as Y}from"./transform-BSMO2egg.js";import{c as Z}from"./usePapers-Cexc6lbX.js";import{u as ee}from"./useIntersectionObserver-CTkoMSzM.js";import{S as se}from"./skeleton-JE1BtvIJ.js";import{A as ae,a as te}from"./alert-fokOob1I.js";import"./useBaseQuery-CSyvHxAw.js";import"./LatexTitle-CB-vNeWW.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DWreeZBU.js";import"./index-C3kXFp4C.js";import"./hover-card-BYeJ4GbN.js";import"./useInfiniteQuery-CdDNcC4u.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=Z({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=ee({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(X),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Y(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{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(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),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&&a==="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&&a==="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&&a==="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:R.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:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.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:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(J,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.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:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.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(G,{paper:t,rank:s+1})]},t.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{e as $,a as D,r as f,j as e,L as b,R as W,b as M}from"./index-DsjIhQkx.js";import{u as z}from"./useQuery-xOve4y-6.js";import{P as G}from"./components-DbYcrD0u.js";import{P as J}from"./PaperFeedFilters-DLrIO7NL.js";import{M as h}from"./MarkdownText-DP1ebl5t.js";import{t as X,d as Y}from"./transform-C1LieBU0.js";import{c as Z}from"./usePapers-CHYNlILt.js";import{u as ee}from"./useIntersectionObserver-DdSZQ78X.js";import{S as se}from"./skeleton-B1Kg5w0V.js";import{A as ae,a as te}from"./alert-BThP2mep.js";import"./useBaseQuery-D4kcdcVW.js";import"./LatexTitle-DA7SEiSe.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BkYFo5pJ.js";import"./index-DaRHhPdB.js";import"./hover-card-DWx_NdIh.js";import"./useInfiniteQuery-BfqUfQDk.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=Z({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=ee({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(X),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Y(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{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(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),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&&a==="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&&a==="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&&a==="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:R.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:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.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:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(J,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.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:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.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(G,{paper:t,rank:s+1})]},t.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-C77Ml82l.js b/assets/ConferencesIndexView-BV1UHo-C.js similarity index 86% rename from assets/ConferencesIndexView-C77Ml82l.js rename to assets/ConferencesIndexView-BV1UHo-C.js index 2e8d551db5e5e5b90272f8f52c47018829f15810..e422f44388c5c61078f9f1e7ee2fd9a9e8f6c360 100644 --- a/assets/ConferencesIndexView-C77Ml82l.js +++ b/assets/ConferencesIndexView-BV1UHo-C.js @@ -1 +1 @@ -import{r as p,j as e,L as d,b as u}from"./index-LWBjDGUR.js";import{u as h}from"./useQuery-CVb9j2D6.js";import{S as m}from"./skeleton-JE1BtvIJ.js";import{A as f,a as g}from"./alert-fokOob1I.js";import{T as x}from"./TaxonomySuggestionTile-BUN64GsM.js";import"./useBaseQuery-CSyvHxAw.js";import"./SignInToEditDialog-BeFxaoXp.js";import"./button-D2jk6ElT.js";import"./textarea-sAKp6aGF.js";import"./dialog-CUdQ6AzV.js";import"./useMutation-Cm0dU_OR.js";import"./loader-circle-C5GDD3qQ.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(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 n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},y=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=p.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=v(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(y)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{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"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>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((s,i)=>e.jsx(m,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.reduce((l,o)=>l+(o.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:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default}; +import{r as p,j as e,L as d,b as u}from"./index-DsjIhQkx.js";import{u as h}from"./useQuery-xOve4y-6.js";import{S as m}from"./skeleton-B1Kg5w0V.js";import{A as f,a as g}from"./alert-BThP2mep.js";import{T as x}from"./TaxonomySuggestionTile-CPUYdGFD.js";import"./useBaseQuery-D4kcdcVW.js";import"./SignInToEditDialog-DuAbhKyX.js";import"./button-CYp7VsNM.js";import"./textarea-BMnjM1hO.js";import"./dialog-BoPFX590.js";import"./useMutation-B-lCv88U.js";import"./loader-circle-DEdDfzjU.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(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 n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},y=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=p.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=v(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(y)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{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"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>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((s,i)=>e.jsx(m,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.reduce((l,o)=>l+(o.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:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default}; diff --git a/assets/ContributionsPage-CrOMof-R.js b/assets/ContributionsPage-CQgUV_SV.js similarity index 91% rename from assets/ContributionsPage-CrOMof-R.js rename to assets/ContributionsPage-CQgUV_SV.js index 828e4994e590ecf05845b0268855e5df258515f8..89301ba75a8c4f5be04efa31e63446a5ee79d83f 100644 --- a/assets/ContributionsPage-CrOMof-R.js +++ b/assets/ContributionsPage-CQgUV_SV.js @@ -1 +1 @@ -import{f as o,j as t,b as n}from"./index-LWBjDGUR.js";import{u as c}from"./useInfiniteQuery-CdDNcC4u.js";import{B as d}from"./button-D2jk6ElT.js";import"./useBaseQuery-CSyvHxAw.js";const h=()=>{var r;const{user:s}=o(),a=c({queryKey:["contributions",s==null?void 0:s.username],queryFn:({pageParam:e})=>n.getMyContributions(e),initialPageParam:void 0,getNextPageParam:e=>e.next_cursor??void 0,enabled:!!(s!=null&&s.can_contribute)}),i=((r=a.data)==null?void 0:r.pages.flatMap(e=>e.events))??[];return s!=null&&s.can_contribute?t.jsxs("div",{className:"page max-w-5xl mx-auto px-4 py-8",children:[t.jsx("h1",{className:"text-3xl font-bold",children:"My contributions"}),t.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Private history for catalog changes made through your contributor account."}),a.isLoading&&t.jsx("p",{className:"mt-8",children:"Loading contributions…"}),a.error&&t.jsx("p",{className:"mt-8 text-destructive",children:"Could not load contribution history."}),t.jsxs("div",{className:"mt-6 space-y-3",children:[i.map(e=>t.jsxs("article",{className:"rounded-md border p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("strong",{children:[e.operation," ",e.entity_type]}),t.jsx("time",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),t.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e.entity_id," · ",e.id]}),t.jsxs("details",{className:"mt-3 text-xs",children:[t.jsx("summary",{children:"Before / after"}),t.jsx("pre",{className:"mt-2 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:e.before,after:e.after},null,2)})]})]},e.id)),a.data&&i.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No direct edits yet."}),a.hasNextPage&&t.jsx(d,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older contributions"})]})]}):t.jsxs("div",{className:"page",children:[t.jsx("h1",{children:"Contributions"}),t.jsx("p",{children:"This history is available to project contributors and admins."})]})};export{h as default}; +import{f as o,j as t,b as n}from"./index-DsjIhQkx.js";import{u as c}from"./useInfiniteQuery-BfqUfQDk.js";import{B as d}from"./button-CYp7VsNM.js";import"./useBaseQuery-D4kcdcVW.js";const h=()=>{var r;const{user:s}=o(),a=c({queryKey:["contributions",s==null?void 0:s.username],queryFn:({pageParam:e})=>n.getMyContributions(e),initialPageParam:void 0,getNextPageParam:e=>e.next_cursor??void 0,enabled:!!(s!=null&&s.can_contribute)}),i=((r=a.data)==null?void 0:r.pages.flatMap(e=>e.events))??[];return s!=null&&s.can_contribute?t.jsxs("div",{className:"page max-w-5xl mx-auto px-4 py-8",children:[t.jsx("h1",{className:"text-3xl font-bold",children:"My contributions"}),t.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Private history for catalog changes made through your contributor account."}),a.isLoading&&t.jsx("p",{className:"mt-8",children:"Loading contributions…"}),a.error&&t.jsx("p",{className:"mt-8 text-destructive",children:"Could not load contribution history."}),t.jsxs("div",{className:"mt-6 space-y-3",children:[i.map(e=>t.jsxs("article",{className:"rounded-md border p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("strong",{children:[e.operation," ",e.entity_type]}),t.jsx("time",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),t.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e.entity_id," · ",e.id]}),t.jsxs("details",{className:"mt-3 text-xs",children:[t.jsx("summary",{children:"Before / after"}),t.jsx("pre",{className:"mt-2 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:e.before,after:e.after},null,2)})]})]},e.id)),a.data&&i.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No direct edits yet."}),a.hasNextPage&&t.jsx(d,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older contributions"})]})]}):t.jsxs("div",{className:"page",children:[t.jsx("h1",{children:"Contributions"}),t.jsx("p",{children:"This history is available to project contributors and admins."})]})};export{h as default}; diff --git a/assets/CronDashboard-yceEcg4l.js b/assets/CronDashboard-D0q8JAn8.js similarity index 95% rename from assets/CronDashboard-yceEcg4l.js rename to assets/CronDashboard-D0q8JAn8.js index b4633b770189d85d7af02feb9436835215a15c24..fd9999ef504fee546d9c55b889f505f8d3e7a7d9 100644 --- a/assets/CronDashboard-yceEcg4l.js +++ b/assets/CronDashboard-D0q8JAn8.js @@ -1,4 +1,4 @@ -import{c as p,r as m,j as e,s as u,M as ke,m as Ce,l as J,a1 as Te,N as Re,O as Se,o as E,P as Me,q as Fe,Q as X,L as Le,t as Ae,b as S,f as Pe}from"./index-LWBjDGUR.js";import{u as $}from"./useQuery-CVb9j2D6.js";import{B as w,D as U,f as De}from"./codexAddEvals-DUvovZgS.js";import{B as M}from"./button-D2jk6ElT.js";import{C as Ie}from"./chevron-down-YxmRXwt0.js";import{C as P,a as O,R as V,S as Je}from"./shield-alert-D9bH_bs8.js";import{L as R}from"./loader-circle-C5GDD3qQ.js";import{E as Z}from"./external-link-BPkSuoMQ.js";import{u as G}from"./useMutation-Cm0dU_OR.js";import{u as qe}from"./useInfiniteQuery-CdDNcC4u.js";import"./useBaseQuery-CSyvHxAw.js";/** +import{c as p,r as m,j as e,t as u,N as ke,n as Ce,m as J,a2 as Te,O as Re,Q as Se,p as $,P as Me,s as Fe,S as X,L as Le,v as Ae,b as S,f as Pe}from"./index-DsjIhQkx.js";import{u as q}from"./useQuery-xOve4y-6.js";import{B as w,D as U,f as De}from"./codexAddEvals-D6PHbQ5d.js";import{B as M}from"./button-CYp7VsNM.js";import{C as Ie}from"./chevron-down-CBbOvtCm.js";import{C as P,a as O,R as V,S as Je}from"./shield-alert-BS0sYsit.js";import{L as R}from"./loader-circle-DEdDfzjU.js";import{E as Z}from"./external-link-CG866OfT.js";import{u as G}from"./useMutation-B-lCv88U.js";import{u as Ee}from"./useInfiniteQuery-BfqUfQDk.js";import"./useBaseQuery-D4kcdcVW.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,12 +8,12 @@ import{c as p,r as m,j as e,s as u,M as ke,m as Ce,l as J,a1 as Te,N as Re,O as * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ee=p("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + */const $e=p("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $e=p("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + */const qe=p("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -58,4 +58,4 @@ import{c as p,r as m,j as e,s as u,M as ke,m as Ce,l as J,a1 as Te,N as Re,O as * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ge=p("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),j=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));j.displayName="Card";const b=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex flex-col space-y-1.5 p-6",s),...a}));b.displayName="CardHeader";const y=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:u("text-2xl font-semibold leading-none tracking-tight",s),...a}));y.displayName="CardTitle";const I=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:u("text-sm text-muted-foreground",s),...a}));I.displayName="CardDescription";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("p-6 pt-0",s),...a}));N.displayName="CardContent";const Ke=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex items-center p-6 pt-0",s),...a}));Ke.displayName="CardFooter";var q="Tabs",[Qe]=Fe(q,[X]),ee=X(),[We,z]=Qe(q),se=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:t,activationMode:c="automatic",...g}=s,x=ke(t),[h,f]=Ce({prop:n,onChange:o,defaultProp:d??"",caller:q});return e.jsx(We,{scope:r,baseId:Te(),value:h,onValueChange:f,orientation:i,dir:x,activationMode:c,children:e.jsx(J.div,{dir:x,"data-orientation":i,...g,ref:a})})});se.displayName=q;var ae="TabsList",re=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...o}=s,d=z(ae,r),i=ee(r);return e.jsx(Re,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(J.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});re.displayName=ae;var te="TabsTrigger",ne=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...d}=s,i=z(te,r),t=ee(r),c=le(i.baseId,n),g=oe(i.baseId,n),x=n===i.value;return e.jsx(Se,{asChild:!0,...t,focusable:!o,active:x,children:e.jsx(J.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":g,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...d,ref:a,onMouseDown:E(s.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?i.onValueChange(n):h.preventDefault()}),onKeyDown:E(s.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(n)}),onFocus:E(s.onFocus,()=>{const h=i.activationMode!=="manual";!x&&!o&&h&&i.onValueChange(n)})})})});ne.displayName=te;var ie="TabsContent",ce=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:o,children:d,...i}=s,t=z(ie,r),c=le(t.baseId,n),g=oe(t.baseId,n),x=n===t.value,h=m.useRef(x);return m.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),e.jsx(Me,{present:o||x,children:({present:f})=>e.jsx(J.div,{"data-state":x?"active":"inactive","data-orientation":t.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:g,tabIndex:0,...i,ref:a,style:{...s.style,animationDuration:h.current?"0s":void 0},children:f&&d})})});ce.displayName=ie;function le(s,a){return`${s}-trigger-${a}`}function oe(s,a){return`${s}-content-${a}`}var Xe=se,de=re,me=ne,xe=ce;const Ze=Xe,ue=m.forwardRef(({className:s,...a},r)=>e.jsx(de,{ref:r,className:u("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));ue.displayName=de.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx(me,{ref:r,className:u("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));L.displayName=me.displayName;const A=m.forwardRef(({className:s,...a},r)=>e.jsx(xe,{ref:r,className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));A.displayName=xe.displayName;function _(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),o=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function he(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function pe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function ge(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const Ye={healthy:O,degraded:Ge,broken:P,running:R,stuck:P,unknown:He};function es({status:s,isRunning:a}){const r=a?"running":s,n=Ye[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function Q({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},n))})]})}function ss({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(D,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",pe(s)],...s.updated_at?[["Updated",_(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(w,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(w,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function as(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function rs({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"outline",className:as(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(Z,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",_(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",_(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",he(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ts({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ue,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(rs,{job:n},n.id))})]})]})}function ns({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:o=!1,paperMarkdownJobsError:d=null}){const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),t=!!(s.db_metrics&&Object.keys(s.db_metrics).length),c=s.job_name==="paper_markdown_backfill",g=i||t||!!s.workflow_status||c;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(es,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(w,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(w,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),g&&(a?e.jsx($e,{className:"h-4 w-4 cron-muted"}):e.jsx(Ie,{className:"h-4 w-4 cron-muted"}))]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Y,{}),"Log: ",_(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(U,{}),"DB: ",_(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ve,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(D,{}),"Duration: ",he(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(Ee,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(K,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(D,{}),"Actions: ",pe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(w,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&g&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&i&&e.jsx(Q,{icon:K,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&t&&e.jsx(Q,{icon:U,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(ss,{workflow:s.workflow_status}),c&&e.jsx(ts,{monitor:n,loading:o,error:d})]})})]})}const fe=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:u("w-full caption-bottom text-sm",s),...a})}));fe.displayName="Table";const je=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:u("[&_tr]:border-b",s),...a}));je.displayName="TableHeader";const Ne=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:u("[&_tr:last-child]:border-0",s),...a}));Ne.displayName="TableBody";const is=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));is.displayName="TableFooter";const H=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:u("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));H.displayName="TableRow";const C=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));C.displayName="TableHead";const T=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));T.displayName="TableCell";const cs=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:u("mt-4 text-sm text-muted-foreground",s),...a}));cs.displayName="TableCaption";const ls={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},os={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ds={queued:Be,dispatching:R,running:Oe,completed:O,failed:P,canceled:ze};function ms({status:s}){const a=ds[s];return e.jsxs(w,{variant:"outline",className:ls[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function xs(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function us({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:o,error:d}=$({queryKey:["codexPaperJobs",a],queryFn:()=>De(100),refetchInterval:s?1e4:!1,retry:!1}),i=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(j,{className:"mb-8",children:[e.jsx(b,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(I,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(N,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&i!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),i===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(t=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:t}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[t]})]},t)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(fe,{children:[e.jsx(je,{children:e.jsxs(H,{children:[e.jsx(C,{children:"Status"}),e.jsx(C,{children:"Paper"}),e.jsx(C,{children:"Action"}),e.jsx(C,{children:"Requested"}),e.jsx(C,{children:"Execution"})]})}),e.jsx(Ne,{children:r.jobs.map(t=>{const c=xs(t);return e.jsxs(H,{children:[e.jsx(T,{className:"align-top",children:e.jsx(ms,{status:t.status})}),e.jsxs(T,{className:"min-w-[260px] align-top",children:[e.jsx(Le,{to:`/paper/${encodeURIComponent(t.paper_route)}`,className:"font-medium hover:underline",children:t.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",t.paper_id]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[os[t.kind],t.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(O,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:_(t.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",t.requested_by]})]}),e.jsxs(T,{className:"max-w-[360px] align-top",children:[t.hf_job_url?e.jsxs("a",{href:t.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Z,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),c&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${t.error?"text-red-700":"cron-muted"}`,title:c,children:c})]})]},t.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",_(r.timestamp)]})]})]})]})}const hs=()=>{var d,i,t;const s=Ae(),a=qe({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>S.getCatalogAudit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(c=>c.events))??[],n=G({mutationFn:()=>S.acknowledgeCatalogAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=G({mutationFn:c=>S.rollbackCatalogEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(j,{children:[e.jsxs(b,{className:"flex-row items-center justify-between",children:[e.jsx(y,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((t=(i=a.data)==null?void 0:i.pages[0])==null?void 0:t.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(N,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:c.before,after:c.after},null,2)})]}),!c.rollback_of_event_id&&e.jsx(M,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>o.mutate(c.id),disabled:o.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(M,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},W={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},Rs=()=>{const[s,a]=m.useState(!0),[r,n]=m.useState(0),[o,d]=m.useState(new Set),{user:i}=Pe(),{data:t,isLoading:c,isFetching:g,error:x,refetch:h}=$({queryKey:["cronStatus",i==null?void 0:i.username],queryFn:()=>S.getCronStatus(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),f=$({queryKey:["paperMarkdownJobs",i==null?void 0:i.username],queryFn:()=>S.getPaperMarkdownJobs(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),ve=(x&&typeof x=="object"&&"status"in x?x.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":x instanceof Error?x.message:void 0,be=l=>{d(v=>{const k=new Set(v);return k.has(l)?k.delete(l):k.add(l),k})},ye=(t==null?void 0:t.jobs.filter(l=>l.critical))??[],F=((t==null?void 0:t.jobs.filter(l=>!l.critical))??[]).reduce((l,v)=>(l[v.category]||(l[v.category]=[]),l[v.category].push(v),l),{}),we=Object.keys(F).sort((l,v)=>{const k=["hourly","daily","weekly"];return k.indexOf(l)-k.indexOf(v)}),B=l=>e.jsx(ns,{job:l,expanded:o.has(l.job_name),onToggle:()=>be(l.job_name),paperMarkdownJobs:l.job_name==="paper_markdown_backfill"?f.data:void 0,paperMarkdownJobsLoading:l.job_name==="paper_markdown_backfill"?f.isLoading:!1,paperMarkdownJobsError:l.job_name==="paper_markdown_backfill"?f.error:null},l.job_name),_e=()=>{n(l=>l+1),h(),f.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(D,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(M,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:_e,disabled:g,children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(j,{className:"mb-6",children:e.jsx(N,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",i==null?void 0:i.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(Ze,{defaultValue:"critical-jobs",children:[e.jsxs(ue,{className:"grid w-full grid-cols-3 sm:w-auto",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"})]}),e.jsxs(A,{value:"critical-jobs",className:"mt-6",children:[c&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),x&&e.jsx(j,{className:"cron-status--broken",children:e.jsx(N,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{className:"h-5 w-5"}),e.jsx("p",{children:ve??"Failed to load CRON jobs status. Please try again."})]})})}),t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(l=>e.jsxs(j,{children:[e.jsx(b,{className:"pb-2",children:e.jsx(y,{className:"text-sm font-medium cron-muted capitalize",children:l})}),e.jsx(N,{children:e.jsx("div",{className:"text-2xl font-bold",children:t.summary[l]})})]},l))}),t.summary.critical_issues.length>0&&e.jsxs(j,{className:"mb-6 cron-status--broken",children:[e.jsx(b,{children:e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(Je,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(N,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:t.summary.critical_issues.map(l=>e.jsx("li",{children:l},l))})})]}),e.jsxs(j,{className:"mb-8",children:[e.jsx(b,{children:e.jsx(y,{className:"text-base",children:"What to check next"})}),e.jsxs(N,{children:[e.jsx("p",{className:"text-sm cron-muted",children:t.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Y,{className:"h-4 w-4"}),"Last updated: ",_(t.timestamp)," · Health score:"," ",t.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(j,{className:"mb-8",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Critical jobs"}),e.jsx(I,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(N,{className:"space-y-4",children:ye.map(B)})]}),e.jsx("div",{className:"space-y-6",children:we.map(l=>e.jsxs(j,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:W[l]??W.hourly,children:l}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(I,{children:[F[l].length," job",F[l].length!==1?"s":""]})]})}),e.jsx(N,{className:"space-y-4",children:F[l].map(B)})]},l))})]})]}),e.jsx(A,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(us,{autoRefresh:s,refreshToken:r})}),e.jsx(A,{value:"catalog-audit",className:"mt-6",children:e.jsx(hs,{})})]})]})})};export{Rs as default}; + */const Ge=p("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),j=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));j.displayName="Card";const b=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex flex-col space-y-1.5 p-6",s),...a}));b.displayName="CardHeader";const y=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:u("text-2xl font-semibold leading-none tracking-tight",s),...a}));y.displayName="CardTitle";const I=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:u("text-sm text-muted-foreground",s),...a}));I.displayName="CardDescription";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("p-6 pt-0",s),...a}));N.displayName="CardContent";const Ke=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex items-center p-6 pt-0",s),...a}));Ke.displayName="CardFooter";var E="Tabs",[Qe]=Fe(E,[X]),ee=X(),[We,z]=Qe(E),se=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:t,activationMode:c="automatic",...g}=s,x=ke(t),[h,f]=Ce({prop:n,onChange:o,defaultProp:d??"",caller:E});return e.jsx(We,{scope:r,baseId:Te(),value:h,onValueChange:f,orientation:i,dir:x,activationMode:c,children:e.jsx(J.div,{dir:x,"data-orientation":i,...g,ref:a})})});se.displayName=E;var ae="TabsList",re=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...o}=s,d=z(ae,r),i=ee(r);return e.jsx(Re,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(J.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});re.displayName=ae;var te="TabsTrigger",ne=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...d}=s,i=z(te,r),t=ee(r),c=le(i.baseId,n),g=oe(i.baseId,n),x=n===i.value;return e.jsx(Se,{asChild:!0,...t,focusable:!o,active:x,children:e.jsx(J.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":g,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...d,ref:a,onMouseDown:$(s.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?i.onValueChange(n):h.preventDefault()}),onKeyDown:$(s.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(n)}),onFocus:$(s.onFocus,()=>{const h=i.activationMode!=="manual";!x&&!o&&h&&i.onValueChange(n)})})})});ne.displayName=te;var ie="TabsContent",ce=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:o,children:d,...i}=s,t=z(ie,r),c=le(t.baseId,n),g=oe(t.baseId,n),x=n===t.value,h=m.useRef(x);return m.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),e.jsx(Me,{present:o||x,children:({present:f})=>e.jsx(J.div,{"data-state":x?"active":"inactive","data-orientation":t.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:g,tabIndex:0,...i,ref:a,style:{...s.style,animationDuration:h.current?"0s":void 0},children:f&&d})})});ce.displayName=ie;function le(s,a){return`${s}-trigger-${a}`}function oe(s,a){return`${s}-content-${a}`}var Xe=se,de=re,me=ne,xe=ce;const Ze=Xe,ue=m.forwardRef(({className:s,...a},r)=>e.jsx(de,{ref:r,className:u("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));ue.displayName=de.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx(me,{ref:r,className:u("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));L.displayName=me.displayName;const A=m.forwardRef(({className:s,...a},r)=>e.jsx(xe,{ref:r,className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));A.displayName=xe.displayName;function _(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),o=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function he(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function pe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function ge(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const Ye={healthy:O,degraded:Ge,broken:P,running:R,stuck:P,unknown:He};function es({status:s,isRunning:a}){const r=a?"running":s,n=Ye[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function Q({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},n))})]})}function ss({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(D,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",pe(s)],...s.updated_at?[["Updated",_(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(w,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(w,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function as(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function rs({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"outline",className:as(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(Z,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",_(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",_(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",he(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ts({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ue,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(rs,{job:n},n.id))})]})]})}function ns({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:o=!1,paperMarkdownJobsError:d=null}){const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),t=!!(s.db_metrics&&Object.keys(s.db_metrics).length),c=s.job_name==="paper_markdown_backfill",g=i||t||!!s.workflow_status||c;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(es,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(w,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(w,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),g&&(a?e.jsx(qe,{className:"h-4 w-4 cron-muted"}):e.jsx(Ie,{className:"h-4 w-4 cron-muted"}))]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Y,{}),"Log: ",_(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(U,{}),"DB: ",_(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ve,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(D,{}),"Duration: ",he(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx($e,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(K,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(D,{}),"Actions: ",pe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(w,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&g&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&i&&e.jsx(Q,{icon:K,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&t&&e.jsx(Q,{icon:U,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(ss,{workflow:s.workflow_status}),c&&e.jsx(ts,{monitor:n,loading:o,error:d})]})})]})}const fe=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:u("w-full caption-bottom text-sm",s),...a})}));fe.displayName="Table";const je=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:u("[&_tr]:border-b",s),...a}));je.displayName="TableHeader";const Ne=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:u("[&_tr:last-child]:border-0",s),...a}));Ne.displayName="TableBody";const is=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));is.displayName="TableFooter";const H=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:u("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));H.displayName="TableRow";const C=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));C.displayName="TableHead";const T=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));T.displayName="TableCell";const cs=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:u("mt-4 text-sm text-muted-foreground",s),...a}));cs.displayName="TableCaption";const ls={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},os={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ds={queued:Be,dispatching:R,running:Oe,completed:O,failed:P,canceled:ze};function ms({status:s}){const a=ds[s];return e.jsxs(w,{variant:"outline",className:ls[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function xs(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function us({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:o,error:d}=q({queryKey:["codexPaperJobs",a],queryFn:()=>De(100),refetchInterval:s?1e4:!1,retry:!1}),i=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(j,{className:"mb-8",children:[e.jsx(b,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(I,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(N,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&i!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),i===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(t=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:t}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[t]})]},t)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(fe,{children:[e.jsx(je,{children:e.jsxs(H,{children:[e.jsx(C,{children:"Status"}),e.jsx(C,{children:"Paper"}),e.jsx(C,{children:"Action"}),e.jsx(C,{children:"Requested"}),e.jsx(C,{children:"Execution"})]})}),e.jsx(Ne,{children:r.jobs.map(t=>{const c=xs(t);return e.jsxs(H,{children:[e.jsx(T,{className:"align-top",children:e.jsx(ms,{status:t.status})}),e.jsxs(T,{className:"min-w-[260px] align-top",children:[e.jsx(Le,{to:`/paper/${encodeURIComponent(t.paper_route)}`,className:"font-medium hover:underline",children:t.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",t.paper_id]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[os[t.kind],t.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(O,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:_(t.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",t.requested_by]})]}),e.jsxs(T,{className:"max-w-[360px] align-top",children:[t.hf_job_url?e.jsxs("a",{href:t.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Z,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),c&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${t.error?"text-red-700":"cron-muted"}`,title:c,children:c})]})]},t.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",_(r.timestamp)]})]})]})]})}const hs=()=>{var d,i,t;const s=Ae(),a=Ee({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>S.getCatalogAudit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(c=>c.events))??[],n=G({mutationFn:()=>S.acknowledgeCatalogAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=G({mutationFn:c=>S.rollbackCatalogEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(j,{children:[e.jsxs(b,{className:"flex-row items-center justify-between",children:[e.jsx(y,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((t=(i=a.data)==null?void 0:i.pages[0])==null?void 0:t.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(N,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:c.before,after:c.after},null,2)})]}),!c.rollback_of_event_id&&e.jsx(M,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>o.mutate(c.id),disabled:o.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(M,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},W={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},Rs=()=>{const[s,a]=m.useState(!0),[r,n]=m.useState(0),[o,d]=m.useState(new Set),{user:i}=Pe(),{data:t,isLoading:c,isFetching:g,error:x,refetch:h}=q({queryKey:["cronStatus",i==null?void 0:i.username],queryFn:()=>S.getCronStatus(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),f=q({queryKey:["paperMarkdownJobs",i==null?void 0:i.username],queryFn:()=>S.getPaperMarkdownJobs(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),ve=(x&&typeof x=="object"&&"status"in x?x.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":x instanceof Error?x.message:void 0,be=l=>{d(v=>{const k=new Set(v);return k.has(l)?k.delete(l):k.add(l),k})},ye=(t==null?void 0:t.jobs.filter(l=>l.critical))??[],F=((t==null?void 0:t.jobs.filter(l=>!l.critical))??[]).reduce((l,v)=>(l[v.category]||(l[v.category]=[]),l[v.category].push(v),l),{}),we=Object.keys(F).sort((l,v)=>{const k=["hourly","daily","weekly"];return k.indexOf(l)-k.indexOf(v)}),B=l=>e.jsx(ns,{job:l,expanded:o.has(l.job_name),onToggle:()=>be(l.job_name),paperMarkdownJobs:l.job_name==="paper_markdown_backfill"?f.data:void 0,paperMarkdownJobsLoading:l.job_name==="paper_markdown_backfill"?f.isLoading:!1,paperMarkdownJobsError:l.job_name==="paper_markdown_backfill"?f.error:null},l.job_name),_e=()=>{n(l=>l+1),h(),f.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(D,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(M,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:_e,disabled:g,children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(j,{className:"mb-6",children:e.jsx(N,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",i==null?void 0:i.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(Ze,{defaultValue:"critical-jobs",children:[e.jsxs(ue,{className:"grid w-full grid-cols-3 sm:w-auto",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"})]}),e.jsxs(A,{value:"critical-jobs",className:"mt-6",children:[c&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),x&&e.jsx(j,{className:"cron-status--broken",children:e.jsx(N,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{className:"h-5 w-5"}),e.jsx("p",{children:ve??"Failed to load CRON jobs status. Please try again."})]})})}),t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(l=>e.jsxs(j,{children:[e.jsx(b,{className:"pb-2",children:e.jsx(y,{className:"text-sm font-medium cron-muted capitalize",children:l})}),e.jsx(N,{children:e.jsx("div",{className:"text-2xl font-bold",children:t.summary[l]})})]},l))}),t.summary.critical_issues.length>0&&e.jsxs(j,{className:"mb-6 cron-status--broken",children:[e.jsx(b,{children:e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(Je,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(N,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:t.summary.critical_issues.map(l=>e.jsx("li",{children:l},l))})})]}),e.jsxs(j,{className:"mb-8",children:[e.jsx(b,{children:e.jsx(y,{className:"text-base",children:"What to check next"})}),e.jsxs(N,{children:[e.jsx("p",{className:"text-sm cron-muted",children:t.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Y,{className:"h-4 w-4"}),"Last updated: ",_(t.timestamp)," · Health score:"," ",t.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(j,{className:"mb-8",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Critical jobs"}),e.jsx(I,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(N,{className:"space-y-4",children:ye.map(B)})]}),e.jsx("div",{className:"space-y-6",children:we.map(l=>e.jsxs(j,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:W[l]??W.hourly,children:l}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(I,{children:[F[l].length," job",F[l].length!==1?"s":""]})]})}),e.jsx(N,{className:"space-y-4",children:F[l].map(B)})]},l))})]})]}),e.jsx(A,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(us,{autoRefresh:s,refreshToken:r})}),e.jsx(A,{value:"catalog-audit",className:"mt-6",children:e.jsx(hs,{})})]})]})})};export{Rs as default}; diff --git a/assets/ExternalSourceEvalBadge-DyD1_AOv.js b/assets/ExternalSourceEvalBadge-B3x84Amj.js similarity index 92% rename from assets/ExternalSourceEvalBadge-DyD1_AOv.js rename to assets/ExternalSourceEvalBadge-B3x84Amj.js index ded4c5e8849eba49aae6adedfa240e7001002dac..199e669f555c3022403ef5f0cf5e6a4be3b76550 100644 --- a/assets/ExternalSourceEvalBadge-DyD1_AOv.js +++ b/assets/ExternalSourceEvalBadge-B3x84Amj.js @@ -1 +1 @@ -import{j as e,L as l}from"./index-LWBjDGUR.js";import{H as t,a as n,b as o}from"./hover-card-BYeJ4GbN.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{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"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E}; +import{j as e,L as l}from"./index-DsjIhQkx.js";import{H as t,a as n,b as o}from"./hover-card-DWx_NdIh.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{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"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E}; diff --git a/assets/FeedView-D_yPsBLc.js b/assets/FeedView-BVMZaD9m.js similarity index 90% rename from assets/FeedView-D_yPsBLc.js rename to assets/FeedView-BVMZaD9m.js index da4a42303e0d0757babd85214c4f7738711e9e94..115b8395cd30f294505d461fdf6d1c29e7507eef 100644 --- a/assets/FeedView-D_yPsBLc.js +++ b/assets/FeedView-BVMZaD9m.js @@ -1 +1 @@ -import{u as O,r as p,j as e,a as H,L as _,i as F,b as E}from"./index-LWBjDGUR.js";import{P as I}from"./components-DaxA6Lf7.js";import{P as q}from"./PaperFeedFilters-BVyIB5Fr.js";import{D as U,M as $,F as K,A as B,q as W}from"./chatSessions-gAEfkaKP.js";import{S as g}from"./chatPrompts-CDY3UGU1.js";import{t as G,d as k}from"./transform-BSMO2egg.js";import{u as z}from"./usePapers-Cexc6lbX.js";import{u as Q}from"./useIntersectionObserver-CTkoMSzM.js";import{P as V}from"./usePeriodFilter-DR8ybPj0.js";import{S as f}from"./skeleton-JE1BtvIJ.js";import{A as X,a as Y}from"./alert-fokOob1I.js";import{u as L}from"./useQuery-CVb9j2D6.js";import"./LatexTitle-CB-vNeWW.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CdDNcC4u.js";import"./useBaseQuery-CSyvHxAw.js";const J=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Z={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},ee={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},S=45,se=1800,te=25,ae=350,re=a=>{const[i,d]=p.useState(g[0].slice(0,1));return p.useEffect(()=>{var r,u;if(!a)return;if((u=(r=window.matchMedia)==null?void 0:r.call(window,"(prefers-reduced-motion: reduce)"))!=null&&u.matches){d(g[0]);return}let m=0,n=1,h=!1,o;d(g[0].slice(0,n));const l=()=>{const x=g[m];if(!h){if(n+=1,d(x.slice(0,n)),n===x.length){h=!0,o=window.setTimeout(l,se);return}o=window.setTimeout(l,S);return}if(n-=1,d(x.slice(0,n)),n===0){h=!1,m=(m+1)%g.length,o=window.setTimeout(l,ae);return}o=window.setTimeout(l,te)};return o=window.setTimeout(l,S),()=>window.clearTimeout(o)},[a]),i},ie=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ne=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",oe=()=>{const a=O(),[i,d]=p.useState(""),[m,n]=p.useState(U),h=re(!i),o=p.useRef(null);p.useEffect(()=>{const r=o.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[i]);const l=(r=i)=>{const u=r.trim();u&&(W(u,m),a("/chat"))};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:o,rows:1,value:i,placeholder:h,"aria-label":"Ask the assistant",onChange:r=>d(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),l())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx($,{models:K,selectedModel:m,onModelChange:n}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${i.trim()?" chat-send-on":""}`,onClick:()=>l(),disabled:!i.trim(),"aria-label":"Ask the assistant",children:e.jsx(B,{})})]})]})},we=()=>{var b,w,v,P,A;const[a,i]=H(),d=ie(a.get("order_by")),m=ne(a.get("time")),n=a.get("has_code")==="true",h=a.get("has_hf_artifacts")==="true",o=ee[m],l=s=>{const t=new URLSearchParams(a);t.set("order_by",s),i(t)},r=s=>{const t=new URLSearchParams(a);t.set("time",Z[s]),i(t)},u=s=>{const t=new URLSearchParams(a);s?t.set("has_code","true"):t.delete("has_code"),i(t)},x=s=>{const t=new URLSearchParams(a);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),i(t)},N=L({queryKey:["top-tasks-sidebar"],queryFn:()=>E.getTopTasks({limit:8}),staleTime:10*60*1e3}),j=L({queryKey:["trending-tasks-sidebar"],queryFn:()=>E.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=z({page_size:30,order_by:d,order_dir:"desc",time:m,include_resources:!0,has_code:n,has_hf_artifacts:h}),y=p.useMemo(()=>{var t;return(((t=c.data)==null?void 0:t.pages.flatMap(R=>R.results))||[]).map(G)},[c.data]),{targetRef:C,isIntersecting:T}=Q({rootMargin:"400px"});p.useEffect(()=>{T&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[T,c.hasNextPage,c.isFetchingNextPage]);const M=c.isLoading,D=c.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),N.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),(b=N.data)==null?void 0:b.map(s=>e.jsxs(_,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(_,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),((v=(w=j.data)==null?void 0:w.results)==null?void 0:v.length)===0&&!j.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(P=j.data)==null?void 0:P.results)==null?void 0:A.map(s=>e.jsxs(_,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[F()&&e.jsx(oe,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:J.map(([s,t])=>e.jsx("button",{className:`sort-btn ${d===s?"active":""}`,onClick:()=>l(s),children:t},s))}),e.jsx(q,{hasCode:n,hasHfArtifacts:h,onHasCodeChange:u,onHasHfArtifactsChange:x})]}),e.jsx("div",{className:"sort-options sort-options-time",children:V.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${o===s?"active":""}`,onClick:()=>r(s),children:s},s))})]}),D&&e.jsx(X,{variant:"destructive",className:"mb-4",children:e.jsx(Y,{children:"Failed to load papers. Please try again."})}),M?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(f,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(f,{className:"h-6 w-3/4"}),e.jsx(f,{className:"h-4 w-1/2"}),e.jsx(f,{className:"h-12 w-full"})]})]},t))}):y.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,t)=>e.jsx(I,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:C,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{oe as AskAssistant,we as default}; +import{u as O,r as p,j as e,a as H,L as _,i as F,b as E}from"./index-DsjIhQkx.js";import{P as I}from"./components-DbYcrD0u.js";import{P as q}from"./PaperFeedFilters-DLrIO7NL.js";import{D as U,M as $,F as K,A as B,q as W}from"./chatSessions-BX17B8vQ.js";import{S as g}from"./chatPrompts-CDY3UGU1.js";import{t as G,d as k}from"./transform-C1LieBU0.js";import{u as z}from"./usePapers-CHYNlILt.js";import{u as Q}from"./useIntersectionObserver-DdSZQ78X.js";import{P as V}from"./usePeriodFilter-veYjaFZT.js";import{S as f}from"./skeleton-B1Kg5w0V.js";import{A as X,a as Y}from"./alert-BThP2mep.js";import{u as L}from"./useQuery-xOve4y-6.js";import"./LatexTitle-DA7SEiSe.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-BfqUfQDk.js";import"./useBaseQuery-D4kcdcVW.js";const J=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Z={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},ee={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},S=45,se=1800,te=25,ae=350,re=a=>{const[i,d]=p.useState(g[0].slice(0,1));return p.useEffect(()=>{var r,u;if(!a)return;if((u=(r=window.matchMedia)==null?void 0:r.call(window,"(prefers-reduced-motion: reduce)"))!=null&&u.matches){d(g[0]);return}let m=0,n=1,h=!1,o;d(g[0].slice(0,n));const l=()=>{const x=g[m];if(!h){if(n+=1,d(x.slice(0,n)),n===x.length){h=!0,o=window.setTimeout(l,se);return}o=window.setTimeout(l,S);return}if(n-=1,d(x.slice(0,n)),n===0){h=!1,m=(m+1)%g.length,o=window.setTimeout(l,ae);return}o=window.setTimeout(l,te)};return o=window.setTimeout(l,S),()=>window.clearTimeout(o)},[a]),i},ie=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ne=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",oe=()=>{const a=O(),[i,d]=p.useState(""),[m,n]=p.useState(U),h=re(!i),o=p.useRef(null);p.useEffect(()=>{const r=o.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[i]);const l=(r=i)=>{const u=r.trim();u&&(W(u,m),a("/chat"))};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:o,rows:1,value:i,placeholder:h,"aria-label":"Ask the assistant",onChange:r=>d(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),l())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx($,{models:K,selectedModel:m,onModelChange:n}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${i.trim()?" chat-send-on":""}`,onClick:()=>l(),disabled:!i.trim(),"aria-label":"Ask the assistant",children:e.jsx(B,{})})]})]})},we=()=>{var b,w,v,P,A;const[a,i]=H(),d=ie(a.get("order_by")),m=ne(a.get("time")),n=a.get("has_code")==="true",h=a.get("has_hf_artifacts")==="true",o=ee[m],l=s=>{const t=new URLSearchParams(a);t.set("order_by",s),i(t)},r=s=>{const t=new URLSearchParams(a);t.set("time",Z[s]),i(t)},u=s=>{const t=new URLSearchParams(a);s?t.set("has_code","true"):t.delete("has_code"),i(t)},x=s=>{const t=new URLSearchParams(a);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),i(t)},N=L({queryKey:["top-tasks-sidebar"],queryFn:()=>E.getTopTasks({limit:8}),staleTime:10*60*1e3}),j=L({queryKey:["trending-tasks-sidebar"],queryFn:()=>E.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=z({page_size:30,order_by:d,order_dir:"desc",time:m,include_resources:!0,has_code:n,has_hf_artifacts:h}),y=p.useMemo(()=>{var t;return(((t=c.data)==null?void 0:t.pages.flatMap(R=>R.results))||[]).map(G)},[c.data]),{targetRef:C,isIntersecting:T}=Q({rootMargin:"400px"});p.useEffect(()=>{T&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[T,c.hasNextPage,c.isFetchingNextPage]);const M=c.isLoading,D=c.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),N.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),(b=N.data)==null?void 0:b.map(s=>e.jsxs(_,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(_,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),((v=(w=j.data)==null?void 0:w.results)==null?void 0:v.length)===0&&!j.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(P=j.data)==null?void 0:P.results)==null?void 0:A.map(s=>e.jsxs(_,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[F()&&e.jsx(oe,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:J.map(([s,t])=>e.jsx("button",{className:`sort-btn ${d===s?"active":""}`,onClick:()=>l(s),children:t},s))}),e.jsx(q,{hasCode:n,hasHfArtifacts:h,onHasCodeChange:u,onHasHfArtifactsChange:x})]}),e.jsx("div",{className:"sort-options sort-options-time",children:V.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${o===s?"active":""}`,onClick:()=>r(s),children:s},s))})]}),D&&e.jsx(X,{variant:"destructive",className:"mb-4",children:e.jsx(Y,{children:"Failed to load papers. Please try again."})}),M?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(f,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(f,{className:"h-6 w-3/4"}),e.jsx(f,{className:"h-4 w-1/2"}),e.jsx(f,{className:"h-12 w-full"})]})]},t))}):y.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,t)=>e.jsx(I,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:C,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{oe as AskAssistant,we as default}; diff --git a/assets/FrameworksIndexView-CGPkOk6q.js b/assets/FrameworksIndexView-Cn2Zjt-F.js similarity index 92% rename from assets/FrameworksIndexView-CGPkOk6q.js rename to assets/FrameworksIndexView-Cn2Zjt-F.js index da475a37ddbafd682b9b0675906c1c7938227093..5c3fd3129ab5444436a02a7da4332eee8bcd8a8b 100644 --- a/assets/FrameworksIndexView-CGPkOk6q.js +++ b/assets/FrameworksIndexView-Cn2Zjt-F.js @@ -1 +1 @@ -import{R as c,j as e,L as d,b as m}from"./index-LWBjDGUR.js";import{u as h}from"./useQuery-CVb9j2D6.js";import{I as g}from"./components-DaxA6Lf7.js";import{e as p,h as u}from"./transform-BSMO2egg.js";import"./useBaseQuery-CSyvHxAw.js";import"./LatexTitle-CB-vNeWW.js";import"./katex.min-BSBacQyE.js";const f={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},x={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},j={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},v={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},k={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},w=({platform:r})=>{const i=p(u(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:i.bg,color:i.text},children:f[r]})},_=({framework:r})=>e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card",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(i=>e.jsx(w,{platform:i},i))})]}),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(d,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Paper"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(g,{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"})]})]}),B=()=>{var l;const r=h({queryKey:["framework-catalog"],queryFn:()=>m.getFrameworkCatalog()}),i=((l=r.data)==null?void 0:l.domains)??[],o=i.reduce((a,s)=>a+s.categories.reduce((n,t)=>n+t.frameworks.length,0),0);return c.useEffect(()=>{var s;const a=window.location.hash.slice(1);a&&((s=document.getElementById(a))==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."}),i.map(a=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:x,children:[e.jsxs("div",{children:[e.jsx("h2",{style:j,children:a.name}),e.jsx("div",{style:v,children:a.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.categories.length," ",a.categories.length===1?"category":"categories"," ·"," ",a.categories.reduce((s,n)=>s+n.frameworks.length,0)," frameworks"]})]}),a.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:k,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(n=>e.jsx(_,{framework:n},n.slug))})]},s.slug))]},a.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[o," frameworks across ",i.length," ",i.length===1?"domain":"domains",". More areas coming soon."]})]})};export{B as default}; +import{R as c,j as e,L as d,b as m}from"./index-DsjIhQkx.js";import{u as h}from"./useQuery-xOve4y-6.js";import{I as g}from"./components-DbYcrD0u.js";import{e as p,h as u}from"./transform-C1LieBU0.js";import"./useBaseQuery-D4kcdcVW.js";import"./LatexTitle-DA7SEiSe.js";import"./katex.min-BSBacQyE.js";const f={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},x={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},j={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},v={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},k={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},w=({platform:r})=>{const i=p(u(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:i.bg,color:i.text},children:f[r]})},_=({framework:r})=>e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card",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(i=>e.jsx(w,{platform:i},i))})]}),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(d,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Paper"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(g,{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"})]})]}),B=()=>{var l;const r=h({queryKey:["framework-catalog"],queryFn:()=>m.getFrameworkCatalog()}),i=((l=r.data)==null?void 0:l.domains)??[],o=i.reduce((a,s)=>a+s.categories.reduce((n,t)=>n+t.frameworks.length,0),0);return c.useEffect(()=>{var s;const a=window.location.hash.slice(1);a&&((s=document.getElementById(a))==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."}),i.map(a=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:x,children:[e.jsxs("div",{children:[e.jsx("h2",{style:j,children:a.name}),e.jsx("div",{style:v,children:a.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.categories.length," ",a.categories.length===1?"category":"categories"," ·"," ",a.categories.reduce((s,n)=>s+n.frameworks.length,0)," frameworks"]})]}),a.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:k,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(n=>e.jsx(_,{framework:n},n.slug))})]},s.slug))]},a.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[o," frameworks across ",i.length," ",i.length===1?"domain":"domains",". More areas coming soon."]})]})};export{B as default}; diff --git a/assets/LatexTitle-CB-vNeWW.js b/assets/LatexTitle-DA7SEiSe.js similarity index 98% rename from assets/LatexTitle-CB-vNeWW.js rename to assets/LatexTitle-DA7SEiSe.js index 0b6fbdbbdb676a1d10d2b339fa624f1303d44f66..f7ca26e43cfa0980c1e6766d8d8a47254ce7a99f 100644 --- a/assets/LatexTitle-CB-vNeWW.js +++ b/assets/LatexTitle-DA7SEiSe.js @@ -1 +1 @@ -import{j as o,r as g}from"./index-LWBjDGUR.js";import{k as T}from"./katex.min-BSBacQyE.js";const j=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),C={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},M={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},_={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},b={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":C,"`":M,"^":_,'"':b,"~":{n:"ñ",N:"Ñ"}},E={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(e,s){var n;return((n=O[e])==null?void 0:n[s])??null}function N(e){const s=[];let n=0,i="";const l=()=>{i&&(s.push({type:"text",content:i}),i="")};for(;n=e.length)return{name:"",end:n};if(!/[a-zA-Z]/.test(e[n]))return{name:e[n],end:n+1};const i=n;for(;n=e.length)return null;if(e[s+1]==="{"){const i=d(e,s+1);return i?{end:i.end}:null}return/[A-Za-z0-9+\-=.]/.test(e[s+1])?{end:s+2}:null}function y(e,s){let n=s;if(e[n]==="\\"){const{name:t,end:a}=$(e,n);if(!t)return null;if(n=a,e[n]==="{"){const f=d(e,n);f&&(n=f.end)}}else if(/[A-Za-z0-9]/.test(e[n])){let t=n+1;for(;t`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;ii&&n.push(e.slice(i,u)),i=u}return n}function A({latex:e,display:s}){const n=g.useMemo(()=>{try{return T.renderToString(e.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[e,s]);return n?o.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:n}}):o.jsx(o.Fragment,{children:s?`$$${e}$$`:`$${e}$`})}function k(e){const s=N(e),n=[];return s.forEach((i,l)=>{const t=`latex-${l}`;if(i.type==="text"){const a=p(i.content,t);a.length===1?n.push(a[0]):a.length>1&&n.push(o.jsx(g.Fragment,{children:a},t));return}if(i.type==="display"){n.push(o.jsx(A,{latex:i.content,display:!0},t));return}n.push(o.jsx(A,{latex:i.content,display:!1},t))}),n.length===1?n[0]:o.jsx(o.Fragment,{children:n})}const U=({text:e,className:s=""})=>{const n=g.useMemo(()=>k(e),[e]);return o.jsx("span",{className:s,children:n})},X=({title:e,className:s=""})=>o.jsx(U,{text:e,className:s});export{X as L,U as a}; +import{j as o,r as g}from"./index-DsjIhQkx.js";import{k as T}from"./katex.min-BSBacQyE.js";const j=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),C={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},M={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},_={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},b={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":C,"`":M,"^":_,'"':b,"~":{n:"ñ",N:"Ñ"}},E={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(e,s){var n;return((n=O[e])==null?void 0:n[s])??null}function N(e){const s=[];let n=0,i="";const l=()=>{i&&(s.push({type:"text",content:i}),i="")};for(;n=e.length)return{name:"",end:n};if(!/[a-zA-Z]/.test(e[n]))return{name:e[n],end:n+1};const i=n;for(;n=e.length)return null;if(e[s+1]==="{"){const i=d(e,s+1);return i?{end:i.end}:null}return/[A-Za-z0-9+\-=.]/.test(e[s+1])?{end:s+2}:null}function y(e,s){let n=s;if(e[n]==="\\"){const{name:t,end:a}=$(e,n);if(!t)return null;if(n=a,e[n]==="{"){const f=d(e,n);f&&(n=f.end)}}else if(/[A-Za-z0-9]/.test(e[n])){let t=n+1;for(;t`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;ii&&n.push(e.slice(i,u)),i=u}return n}function A({latex:e,display:s}){const n=g.useMemo(()=>{try{return T.renderToString(e.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[e,s]);return n?o.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:n}}):o.jsx(o.Fragment,{children:s?`$$${e}$$`:`$${e}$`})}function k(e){const s=N(e),n=[];return s.forEach((i,l)=>{const t=`latex-${l}`;if(i.type==="text"){const a=p(i.content,t);a.length===1?n.push(a[0]):a.length>1&&n.push(o.jsx(g.Fragment,{children:a},t));return}if(i.type==="display"){n.push(o.jsx(A,{latex:i.content,display:!0},t));return}n.push(o.jsx(A,{latex:i.content,display:!1},t))}),n.length===1?n[0]:o.jsx(o.Fragment,{children:n})}const U=({text:e,className:s=""})=>{const n=g.useMemo(()=>k(e),[e]);return o.jsx("span",{className:s,children:n})},X=({title:e,className:s=""})=>o.jsx(U,{text:e,className:s});export{X as L,U as a}; diff --git a/assets/MarkdownText-DQ_lzSri.js b/assets/MarkdownText-DP1ebl5t.js similarity index 84% rename from assets/MarkdownText-DQ_lzSri.js rename to assets/MarkdownText-DP1ebl5t.js index 78ea469b4c13bdd5cbf153b8ab66324f5706436d..d641f2cab4fdb75fe7259e46388c02c7e362b4a4 100644 --- a/assets/MarkdownText-DQ_lzSri.js +++ b/assets/MarkdownText-DP1ebl5t.js @@ -1 +1 @@ -import{T as l,j as s,L as u}from"./index-LWBjDGUR.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-DWreeZBU.js";import{M as d,r as w}from"./index-C3kXFp4C.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M}; +import{U as l,j as s,L as u}from"./index-DsjIhQkx.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-BkYFo5pJ.js";import{M as d,r as w}from"./index-DaRHhPdB.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M}; diff --git a/assets/MethodDetailView-MpXmLFF4.js b/assets/MethodDetailView-CR2MACLD.js similarity index 96% rename from assets/MethodDetailView-MpXmLFF4.js rename to assets/MethodDetailView-CR2MACLD.js index 94c9682066d9b85ae48ef552560c5010541224a4..3e39c341f7b5890ff08ac93ec9bfe3ff8d24ffd7 100644 --- a/assets/MethodDetailView-MpXmLFF4.js +++ b/assets/MethodDetailView-CR2MACLD.js @@ -1 +1 @@ -import{j as e,r as E,e as W,a as V,L as R,b as v,ak as Z}from"./index-LWBjDGUR.js";import{u as A}from"./useQuery-CVb9j2D6.js";import{u as X}from"./useInfiniteQuery-CdDNcC4u.js";import{M as Y,P as J}from"./components-DaxA6Lf7.js";import{P as ee}from"./PaperFeedFilters-BVyIB5Fr.js";import{M as H}from"./MarkdownText-DQ_lzSri.js";import{s as te}from"./slug-BpH-Nkvz.js";import{t as se}from"./transform-BSMO2egg.js";import{u as ae}from"./useIntersectionObserver-CTkoMSzM.js";import{S as M}from"./skeleton-JE1BtvIJ.js";import{A as ie,a as re}from"./alert-fokOob1I.js";import"./useBaseQuery-CSyvHxAw.js";import"./LatexTitle-CB-vNeWW.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DWreeZBU.js";import"./index-C3kXFp4C.js";import"./hover-card-BYeJ4GbN.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},p=({x:s,y:a,w:i,h:r,fill:f,stroke:j,label:g,fontSize:c=10,multiline:y})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:a,width:i,height:r,rx:"3",ry:"3",fill:f,stroke:j,strokeWidth:"1"}),y?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:s+i/2,y:a+r/2-2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[0]}),e.jsx("text",{x:s+i/2,y:a+r/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[1]})]}):e.jsx("text",{x:s+i/2,y:a+r/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:g})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(p,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(p,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(p,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(p,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(p,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(p,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(p,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(p,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const a=30+s*75,i=60-s*8,r=240-s*30;return e.jsx("g",{children:e.jsx("rect",{x:a,y:(420-r)/2,width:i,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][s],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][s],strokeWidth:"1"})},s)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:50,y:i,width:r,height:f,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${s}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:210,y:i,width:r,height:f,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${s}`)}),[0,1,2,3].map(s=>{const a=60+s*80+(50-s*6)/2,i=50+(100-s*12);return e.jsx("path",{d:`M${i} ${a} L210 ${a}`,stroke:t.faint,strokeDasharray:"4 3"},`s${s}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),le=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(s=>[0,1,2].map(a=>e.jsx("rect",{x:20+a*40,y:40+s*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][s*3+a],stroke:t.faint},`${s}-${a}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(p,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(p,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(s=>{const a=25+s*56,i=(5-s)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:a,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-i*.1} 0.04 250)`,stroke:t.faint}),i<.4&&e.jsx("circle",{cx:a+25,cy:115,r:12-i*16,fill:t.orange,opacity:1-i*1.5})]},s)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),oe=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),de=[["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:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),de.map(([s,a],i)=>{const r=92+i*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),a?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:a}):null]},s)})]}),xe={attention:G,"self-attention":G,cnn:ne,"u-net":q,unet:q,vit:le,diffusion:O,ddpm:O,gan:oe,vae:ce,"agent-skills":he},me=({method:s})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(p,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(p,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(p,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),fe=({method:s})=>{const a=(s.slug||"").toLowerCase(),i=xe[a];if(i)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(i,{})});if(s.image_url){const r=a==="transformer"||a==="gpt-4"||a==="gpt-4o"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${r}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(me,{method:s})})},L=720,C=138,u={top:8,right:10,bottom:25,left:36},U=56,pe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=s=>pe.format(new Date(`${s}T00:00:00Z`)),ue=(s,a)=>{if(s===0)return new Set;const i=s>48?12:s>36?6:s>18?3:2,r=Math.max(1,Math.ceil(U/a)),f=Math.max(i,r),j=s-1,g=new Set([0,j]);for(let c=f;c=U&&g.add(c);return g},K=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const a=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${a}`},je=({history:s,methodName:a})=>{const[i,r]=E.useState(null),f=Math.max(1,...s.map(n=>n.paper_count)),j=L-u.left-u.right,g=C-u.top-u.bottom,c=s.length?j/s.length:j,y=Math.max(2,c*.68),d=ue(s.length,c),z=Array.from(new Set([0,Math.ceil(f/2),f])),x=i==null?null:s[i],S=x?K(x):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${L} ${C}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),z.map(n=>{const m=u.top+g-n/f*g;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:L-u.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:m+3,textAnchor:"end",children:n})]},n)}),s.map((n,m)=>{const k=n.paper_count/f*g,b=n.paper_count>0?Math.max(1,k):0,F=u.left+c*m+(c-y)/2,l=u.top+g-b,_=i===m,N=m===s.length-1,w=K(n);return e.jsxs("g",{className:`method-usage-bar${_?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(n.start_date)}: ${n.paper_count} ${n.paper_count===1?"paper":"papers"}${w?`. ${w}`:""}`,onMouseEnter:()=>r(m),onMouseLeave:()=>r(null),onFocus:()=>r(m),onBlur:()=>r(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+c*m,y:u.top,width:c,height:g}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:l,width:y,height:b,rx:"1.5"})]},n.start_date)}),s.map((n,m)=>d.has(m)?e.jsx("text",{className:"method-usage-x-label",x:u.left+c*(m+.5),y:C-11,textAnchor:"middle",children:s.length>48?ge.format(new Date(`${n.start_date}T00:00:00Z`)):B(n.start_date)},n.start_date):null)]}),x&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(x.start_date)}),e.jsxs("span",{children:[x.paper_count," ",x.paper_count===1?"paper":"papers",i===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(x.catalog_share??0).toFixed(2),"% of"," ",(x.catalog_paper_count??0).toLocaleString()," catalog papers"]}),S&&e.jsx("span",{children:S})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Q={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Pe=()=>{var N,w,$,P,T,I;const{methodSlug:s}=W(),[a,i]=V(),[r,f]=E.useState("trending"),j=a.get("has_code")==="true",g=a.get("has_hf_artifacts")==="true",c=o=>{const h=new URLSearchParams(a);o?h.set("has_code","true"):h.delete("has_code"),i(h)},y=o=>{const h=new URLSearchParams(a);o?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),i(h)},d=A({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),z=A({queryKey:["areas-all"],queryFn:()=>v.getAreas({page_size:50,ordering:"name"}),enabled:!!((N=d.data)!=null&&N.area_id),staleTime:10*60*1e3}),x=A({queryKey:["method-trend",s],queryFn:()=>v.getMethodTrend(s),enabled:!!s&&!!d.data,staleTime:10*60*1e3}),S=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",n=X({queryKey:["method-papers-infinite",s,S,j,g],queryFn:({pageParam:o=1})=>v.getMethodPapers(s,{page:o,page_size:20,order_by:S,order_dir:"desc",include_resources:!0,has_code:j,has_hf_artifacts:g}),getNextPageParam:o=>o.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Z}),m=A({queryKey:["related-methods",(w=d.data)==null?void 0:w.slug,($=d.data)==null?void 0:$.area_id,(P=d.data)==null?void 0:P.id],queryFn:async()=>{const o=Q[d.data.slug];return o?Promise.all(o.map(D=>v.getMethod(D))):(await v.getMethods({area_id:d.data.area_id,exclude_id:d.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!d.data&&(!!Q[d.data.slug]||!!d.data.area_id),staleTime:10*60*1e3}),k=E.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(D=>D.results))||[]).map(se)},[n.data]),{targetRef:b,isIntersecting:F}=ae({rootMargin:"200px"});if(E.useEffect(()=>{F&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[F,n.hasNextPage,n.isFetchingNextPage]),d.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(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(re,{children:"Method not found."})})});const l=d.data,_=(T=z.data)==null?void 0:T.results.find(o=>o.id===l.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(R,{to:"/methods",children:"Methods"}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(R,{to:`/methods#area-${te(_.name)}`,children:_.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:l.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${l.slug==="grokking"||l.slug==="latent-reasoning"?" 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:l.name}),l.full_name&&l.full_name!==l.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:l.full_name}),l.description&&e.jsx(H,{className:"method-description",text:l.description}),l.source_url&&l.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:l.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:l.source_title}),l.introduced_year&&e.jsx("span",{className:"method-source-meta",children:l.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:(l.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.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]})]}),l.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:l.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(je,{history:x.data.history,methodName:l.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(fe,{method:l}),l.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:l.image_credit})})]})]}),(((I=m.data)==null?void 0:I.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(o=>e.jsx(Y,{method:{slug:o.slug,name:o.name}},o.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(([o,h])=>e.jsx("button",{className:`sort-btn ${r===o?"active":""}`,onClick:()=>f(o),children:h},o))}),e.jsx(ee,{hasCode:j,hasHfArtifacts:g,onHasCodeChange:c,onHasHfArtifactsChange:y})]}),e.jsxs("div",{className:"results-count",children:[k.length," papers mentioning ",l.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((o,h)=>e.jsx(M,{className:"h-40 w-full"},h))}):k.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:k.map((o,h)=>e.jsx(J,{paper:o,rank:h+1},o.id))}),e.jsx("div",{ref:b,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Pe as default}; +import{j as e,r as E,e as W,a as V,L as R,b as v,al as Z}from"./index-DsjIhQkx.js";import{u as A}from"./useQuery-xOve4y-6.js";import{u as X}from"./useInfiniteQuery-BfqUfQDk.js";import{M as Y,P as J}from"./components-DbYcrD0u.js";import{P as ee}from"./PaperFeedFilters-DLrIO7NL.js";import{M as H}from"./MarkdownText-DP1ebl5t.js";import{s as te}from"./slug-BpH-Nkvz.js";import{t as se}from"./transform-C1LieBU0.js";import{u as ae}from"./useIntersectionObserver-DdSZQ78X.js";import{S as M}from"./skeleton-B1Kg5w0V.js";import{A as ie,a as re}from"./alert-BThP2mep.js";import"./useBaseQuery-D4kcdcVW.js";import"./LatexTitle-DA7SEiSe.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BkYFo5pJ.js";import"./index-DaRHhPdB.js";import"./hover-card-DWx_NdIh.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},p=({x:s,y:a,w:i,h:r,fill:f,stroke:j,label:g,fontSize:c=10,multiline:y})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:a,width:i,height:r,rx:"3",ry:"3",fill:f,stroke:j,strokeWidth:"1"}),y?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:s+i/2,y:a+r/2-2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[0]}),e.jsx("text",{x:s+i/2,y:a+r/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[1]})]}):e.jsx("text",{x:s+i/2,y:a+r/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:g})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(p,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(p,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(p,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(p,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(p,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(p,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(p,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(p,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const a=30+s*75,i=60-s*8,r=240-s*30;return e.jsx("g",{children:e.jsx("rect",{x:a,y:(420-r)/2,width:i,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][s],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][s],strokeWidth:"1"})},s)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:50,y:i,width:r,height:f,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${s}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:210,y:i,width:r,height:f,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${s}`)}),[0,1,2,3].map(s=>{const a=60+s*80+(50-s*6)/2,i=50+(100-s*12);return e.jsx("path",{d:`M${i} ${a} L210 ${a}`,stroke:t.faint,strokeDasharray:"4 3"},`s${s}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),le=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(s=>[0,1,2].map(a=>e.jsx("rect",{x:20+a*40,y:40+s*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][s*3+a],stroke:t.faint},`${s}-${a}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(p,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(p,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(s=>{const a=25+s*56,i=(5-s)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:a,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-i*.1} 0.04 250)`,stroke:t.faint}),i<.4&&e.jsx("circle",{cx:a+25,cy:115,r:12-i*16,fill:t.orange,opacity:1-i*1.5})]},s)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),oe=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),de=[["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:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),de.map(([s,a],i)=>{const r=92+i*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),a?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:a}):null]},s)})]}),xe={attention:G,"self-attention":G,cnn:ne,"u-net":q,unet:q,vit:le,diffusion:O,ddpm:O,gan:oe,vae:ce,"agent-skills":he},me=({method:s})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(p,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(p,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(p,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),fe=({method:s})=>{const a=(s.slug||"").toLowerCase(),i=xe[a];if(i)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(i,{})});if(s.image_url){const r=a==="transformer"||a==="gpt-4"||a==="gpt-4o"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${r}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(me,{method:s})})},L=720,C=138,u={top:8,right:10,bottom:25,left:36},U=56,pe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=s=>pe.format(new Date(`${s}T00:00:00Z`)),ue=(s,a)=>{if(s===0)return new Set;const i=s>48?12:s>36?6:s>18?3:2,r=Math.max(1,Math.ceil(U/a)),f=Math.max(i,r),j=s-1,g=new Set([0,j]);for(let c=f;c=U&&g.add(c);return g},K=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const a=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${a}`},je=({history:s,methodName:a})=>{const[i,r]=E.useState(null),f=Math.max(1,...s.map(n=>n.paper_count)),j=L-u.left-u.right,g=C-u.top-u.bottom,c=s.length?j/s.length:j,y=Math.max(2,c*.68),d=ue(s.length,c),z=Array.from(new Set([0,Math.ceil(f/2),f])),x=i==null?null:s[i],S=x?K(x):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${L} ${C}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),z.map(n=>{const m=u.top+g-n/f*g;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:L-u.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:m+3,textAnchor:"end",children:n})]},n)}),s.map((n,m)=>{const k=n.paper_count/f*g,b=n.paper_count>0?Math.max(1,k):0,F=u.left+c*m+(c-y)/2,l=u.top+g-b,_=i===m,N=m===s.length-1,w=K(n);return e.jsxs("g",{className:`method-usage-bar${_?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(n.start_date)}: ${n.paper_count} ${n.paper_count===1?"paper":"papers"}${w?`. ${w}`:""}`,onMouseEnter:()=>r(m),onMouseLeave:()=>r(null),onFocus:()=>r(m),onBlur:()=>r(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+c*m,y:u.top,width:c,height:g}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:l,width:y,height:b,rx:"1.5"})]},n.start_date)}),s.map((n,m)=>d.has(m)?e.jsx("text",{className:"method-usage-x-label",x:u.left+c*(m+.5),y:C-11,textAnchor:"middle",children:s.length>48?ge.format(new Date(`${n.start_date}T00:00:00Z`)):B(n.start_date)},n.start_date):null)]}),x&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(x.start_date)}),e.jsxs("span",{children:[x.paper_count," ",x.paper_count===1?"paper":"papers",i===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(x.catalog_share??0).toFixed(2),"% of"," ",(x.catalog_paper_count??0).toLocaleString()," catalog papers"]}),S&&e.jsx("span",{children:S})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Q={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Pe=()=>{var N,w,$,P,T,I;const{methodSlug:s}=W(),[a,i]=V(),[r,f]=E.useState("trending"),j=a.get("has_code")==="true",g=a.get("has_hf_artifacts")==="true",c=o=>{const h=new URLSearchParams(a);o?h.set("has_code","true"):h.delete("has_code"),i(h)},y=o=>{const h=new URLSearchParams(a);o?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),i(h)},d=A({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),z=A({queryKey:["areas-all"],queryFn:()=>v.getAreas({page_size:50,ordering:"name"}),enabled:!!((N=d.data)!=null&&N.area_id),staleTime:10*60*1e3}),x=A({queryKey:["method-trend",s],queryFn:()=>v.getMethodTrend(s),enabled:!!s&&!!d.data,staleTime:10*60*1e3}),S=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",n=X({queryKey:["method-papers-infinite",s,S,j,g],queryFn:({pageParam:o=1})=>v.getMethodPapers(s,{page:o,page_size:20,order_by:S,order_dir:"desc",include_resources:!0,has_code:j,has_hf_artifacts:g}),getNextPageParam:o=>o.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Z}),m=A({queryKey:["related-methods",(w=d.data)==null?void 0:w.slug,($=d.data)==null?void 0:$.area_id,(P=d.data)==null?void 0:P.id],queryFn:async()=>{const o=Q[d.data.slug];return o?Promise.all(o.map(D=>v.getMethod(D))):(await v.getMethods({area_id:d.data.area_id,exclude_id:d.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!d.data&&(!!Q[d.data.slug]||!!d.data.area_id),staleTime:10*60*1e3}),k=E.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(D=>D.results))||[]).map(se)},[n.data]),{targetRef:b,isIntersecting:F}=ae({rootMargin:"200px"});if(E.useEffect(()=>{F&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[F,n.hasNextPage,n.isFetchingNextPage]),d.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(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(re,{children:"Method not found."})})});const l=d.data,_=(T=z.data)==null?void 0:T.results.find(o=>o.id===l.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(R,{to:"/methods",children:"Methods"}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(R,{to:`/methods#area-${te(_.name)}`,children:_.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:l.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${l.slug==="grokking"||l.slug==="latent-reasoning"?" 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:l.name}),l.full_name&&l.full_name!==l.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:l.full_name}),l.description&&e.jsx(H,{className:"method-description",text:l.description}),l.source_url&&l.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:l.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:l.source_title}),l.introduced_year&&e.jsx("span",{className:"method-source-meta",children:l.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:(l.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.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]})]}),l.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:l.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(je,{history:x.data.history,methodName:l.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(fe,{method:l}),l.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:l.image_credit})})]})]}),(((I=m.data)==null?void 0:I.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(o=>e.jsx(Y,{method:{slug:o.slug,name:o.name}},o.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(([o,h])=>e.jsx("button",{className:`sort-btn ${r===o?"active":""}`,onClick:()=>f(o),children:h},o))}),e.jsx(ee,{hasCode:j,hasHfArtifacts:g,onHasCodeChange:c,onHasHfArtifactsChange:y})]}),e.jsxs("div",{className:"results-count",children:[k.length," papers mentioning ",l.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((o,h)=>e.jsx(M,{className:"h-40 w-full"},h))}):k.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:k.map((o,h)=>e.jsx(J,{paper:o,rank:h+1},o.id))}),e.jsx("div",{ref:b,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Pe as default}; diff --git a/assets/MethodsIndexView-BuJTAVXK.js b/assets/MethodsIndexView-CDBkw1Ix.js similarity index 87% rename from assets/MethodsIndexView-BuJTAVXK.js rename to assets/MethodsIndexView-CDBkw1Ix.js index 903d24113cb250812b37c0ba72d536fb78c6dba9..a282b0100cb356920542b46d9e99950b7f801040 100644 --- a/assets/MethodsIndexView-BuJTAVXK.js +++ b/assets/MethodsIndexView-CDBkw1Ix.js @@ -1,4 +1,4 @@ -import{c as g,r as d,j as e,L as j,b as m}from"./index-LWBjDGUR.js";import{u as h}from"./useQuery-CVb9j2D6.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-JE1BtvIJ.js";import{A as y,a as v}from"./alert-fokOob1I.js";import{T as _}from"./TaxonomySuggestionTile-BUN64GsM.js";import"./useBaseQuery-CSyvHxAw.js";import"./SignInToEditDialog-BeFxaoXp.js";import"./button-D2jk6ElT.js";import"./textarea-sAKp6aGF.js";import"./dialog-CUdQ6AzV.js";import"./useMutation-Cm0dU_OR.js";import"./loader-circle-C5GDD3qQ.js";/** +import{c as g,r as d,j as e,L as j,b as m}from"./index-DsjIhQkx.js";import{u as h}from"./useQuery-xOve4y-6.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-B1Kg5w0V.js";import{A as y,a as v}from"./alert-BThP2mep.js";import{T as _}from"./TaxonomySuggestionTile-CPUYdGFD.js";import"./useBaseQuery-D4kcdcVW.js";import"./SignInToEditDialog-DuAbhKyX.js";import"./button-CYp7VsNM.js";import"./textarea-BMnjM1hO.js";import"./dialog-BoPFX590.js";import"./useMutation-B-lCv88U.js";import"./loader-circle-DEdDfzjU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-DTl10qdH.js b/assets/NotFound-B_H_to4V.js similarity index 89% rename from assets/NotFound-DTl10qdH.js rename to assets/NotFound-B_H_to4V.js index 2351aa086dfd46e28fd8342280549cfceb2f2884..86042b899980321a001acf23c1bed5a79217631e 100644 --- a/assets/NotFound-DTl10qdH.js +++ b/assets/NotFound-B_H_to4V.js @@ -1 +1 @@ -import{aK as o,r as a,j as t,L as s}from"./index-LWBjDGUR.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{aL as o,r as a,j as t,L as s}from"./index-DsjIhQkx.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/OrganizationDetailView-7gGiFGel.js b/assets/OrganizationDetailView-7gGiFGel.js deleted file mode 100644 index 11d28b03c78b6abae2a0ccd6c2a7edd6d2853a87..0000000000000000000000000000000000000000 --- a/assets/OrganizationDetailView-7gGiFGel.js +++ /dev/null @@ -1 +0,0 @@ -import{e as t,j as r}from"./index-LWBjDGUR.js";import{O as i}from"./OrganizationPaperFeed-DPUi2fIX.js";import m from"./NotFound-DTl10qdH.js";import"./useQuery-CVb9j2D6.js";import"./useBaseQuery-CSyvHxAw.js";import"./components-DaxA6Lf7.js";import"./LatexTitle-CB-vNeWW.js";import"./katex.min-BSBacQyE.js";import"./transform-BSMO2egg.js";import"./MarkdownText-DQ_lzSri.js";import"./PaperPreviewLink-DWreeZBU.js";import"./index-C3kXFp4C.js";import"./hover-card-BYeJ4GbN.js";import"./skeleton-JE1BtvIJ.js";import"./PaperFeedFilters-BVyIB5Fr.js";import"./alert-fokOob1I.js";import"./searchable-select-BvzTwnT-.js";import"./button-D2jk6ElT.js";import"./dialog-CUdQ6AzV.js";import"./loader-circle-C5GDD3qQ.js";import"./useIntersectionObserver-CTkoMSzM.js";import"./usePapers-Cexc6lbX.js";import"./useInfiniteQuery-CdDNcC4u.js";const V=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{V as default}; diff --git a/assets/OrganizationDetailView-DJd05bzy.js b/assets/OrganizationDetailView-DJd05bzy.js new file mode 100644 index 0000000000000000000000000000000000000000..a3f577f087612447c48d4ea0c536f7742bb81a41 --- /dev/null +++ b/assets/OrganizationDetailView-DJd05bzy.js @@ -0,0 +1 @@ +import{e as t,j as r}from"./index-DsjIhQkx.js";import{O as i}from"./OrganizationPaperFeed-8WeZrAve.js";import m from"./NotFound-B_H_to4V.js";import"./useQuery-xOve4y-6.js";import"./useBaseQuery-D4kcdcVW.js";import"./components-DbYcrD0u.js";import"./LatexTitle-DA7SEiSe.js";import"./katex.min-BSBacQyE.js";import"./transform-C1LieBU0.js";import"./MarkdownText-DP1ebl5t.js";import"./PaperPreviewLink-BkYFo5pJ.js";import"./index-DaRHhPdB.js";import"./hover-card-DWx_NdIh.js";import"./skeleton-B1Kg5w0V.js";import"./PaperFeedFilters-DLrIO7NL.js";import"./alert-BThP2mep.js";import"./searchable-select-Bl979FVT.js";import"./button-CYp7VsNM.js";import"./dialog-BoPFX590.js";import"./loader-circle-DEdDfzjU.js";import"./useIntersectionObserver-DdSZQ78X.js";import"./usePapers-CHYNlILt.js";import"./useInfiniteQuery-BfqUfQDk.js";const V=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{V as default}; diff --git a/assets/OrganizationPaperFeed-DPUi2fIX.js b/assets/OrganizationPaperFeed-8WeZrAve.js similarity index 93% rename from assets/OrganizationPaperFeed-DPUi2fIX.js rename to assets/OrganizationPaperFeed-8WeZrAve.js index 85cdcaa97b241557bde3d0ba8b3a281d0614de5e..31a15a3826c49ee0c596017bc02ae428ea3683ec 100644 --- a/assets/OrganizationPaperFeed-DPUi2fIX.js +++ b/assets/OrganizationPaperFeed-8WeZrAve.js @@ -1 +1 @@ -import{j as e,r as b,b as L,u as H,a as W,L as D}from"./index-LWBjDGUR.js";import{u as w}from"./useQuery-CVb9j2D6.js";import{P as G}from"./components-DaxA6Lf7.js";import{M as K}from"./MarkdownText-DQ_lzSri.js";import{S as $}from"./skeleton-JE1BtvIJ.js";import{P as Q}from"./PaperFeedFilters-BVyIB5Fr.js";import{A as Z,a as B}from"./alert-fokOob1I.js";import{a as Y}from"./searchable-select-BvzTwnT-.js";import{u as J}from"./useIntersectionObserver-CTkoMSzM.js";import{d as V}from"./usePapers-Cexc6lbX.js";import{d as E,t as X}from"./transform-BSMO2egg.js";import ee from"./NotFound-DTl10qdH.js";const v=24*60*60*1e3,C=12,te=3,se=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),R=s=>new Date(`${s}T00:00:00Z`),ae=s=>s.toISOString().slice(0,10),re=(s,c)=>{if(s===0)return 0;const l=c.findIndex(d=>s<=d);return l===-1?4:l+1},ne=s=>{const c=R(s.start_date),l=R(s.end_date),d=new Date(c.getTime()-c.getUTCDay()*v),j=new Date(l.getTime()+(6-l.getUTCDay())*v),g=new Map(s.results.map(a=>[a.date,a.paper_count])),h=s.results.map(a=>a.paper_count).sort((a,N)=>a-N),n=[.25,.5,.75].map(a=>h[Math.min(h.length-1,Math.floor(h.length*a))]??1),u=[];for(let a=d.getTime();a<=j.getTime();a+=v){const N=new Date(a),m=ae(N),_=a>=c.getTime()&&a<=l.getTime(),p=_?g.get(m)??0:0;u.push({key:m,date:N,count:p,inRange:_,level:re(p,n)})}const y=u.length/7,x=[];let f=-1;for(let a=0;a_.inRange&&(a===0||_.date.getUTCDate()<=7));m&&m.date.getUTCMonth()!==f&&(f=m.date.getUTCMonth(),x.length>0&&a-x[x.length-1].column<3&&x.pop(),x.push({label:m.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:a}))}return{days:u,months:x,weekCount:y}},ie=({data:s,organizationName:c})=>{const l=b.useRef(null),{days:d,months:j,weekCount:g}=b.useMemo(()=>ne(s),[s]),h=g*C+(g-1)*te;return b.useEffect(()=>{const n=l.current;n&&(n.scrollLeft=n.scrollWidth)},[g]),e.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[e.jsxs("div",{className:"organization-contributions-header",children:[e.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:"Paper contributions"}),e.jsxs("p",{className:"organization-contributions-summary",children:[s.total_count.toLocaleString()," ",s.total_count===1?"paper":"papers"," published in the last year"]})]}),e.jsx("div",{className:"organization-contributions-scroll",ref:l,children:e.jsxs("div",{className:"organization-contributions-plot",style:{width:h+34},role:"img","aria-label":`${c} published ${s.total_count} papers in the last year`,children:[e.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((n,u)=>e.jsx("span",{children:se.get(u)??""},u))}),e.jsxs("div",{children:[e.jsx("div",{className:"organization-contributions-months",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:j.map(n=>e.jsx("span",{style:{gridColumnStart:n.column+1},children:n.label},`${n.label}-${n.column}`))}),e.jsx("div",{className:"organization-contributions-grid",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:d.map(n=>e.jsx("span",{className:`organization-contribution-cell ${n.inRange?`level-${n.level}`:"is-outside"}`,title:n.inRange?`${n.count} ${n.count===1?"paper":"papers"} on ${n.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},n.key))})]})]})}),e.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[e.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(n=>e.jsx("span",{className:`organization-contribution-cell level-${n}`},n)),e.jsx("span",{children:"More"})]})]})},oe=({organizationSlug:s,organizationName:c})=>{const l=w({queryKey:["organization-contributions",s],queryFn:()=>L.getOrganizationContributions(s),staleTime:6e5});return l.isLoading?e.jsx($,{className:"organization-contributions-skeleton"}):l.data?e.jsx(ie,{data:l.data,organizationName:c}):null},le=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=s=>s==="date_published"||s==="citation_count"?s:"trending",ye=({organizationSlug:s,taskSlug:c})=>{var k,P,F,M,A,O,z,S;const l=H(),[d,j]=W(),[g,h]=b.useState(!1),n=ce(d.get("order_by")),u=d.get("has_code")==="true",y=d.get("has_hf_artifacts")==="true",x=w({queryKey:["organization",s],queryFn:()=>L.getOrganization(s),staleTime:10*60*1e3}),f=w({queryKey:["organization-areas-with-tasks",s],queryFn:()=>L.getOrganizationAreasWithTasks(s),staleTime:10*60*1e3}),a=V({organizationSlug:s,taskSlug:c,page_size:12,order_by:n,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:y,enabled:!!s}),{targetRef:N,isIntersecting:m}=J({rootMargin:"200px"});b.useEffect(()=>{m&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[m,a.hasNextPage,a.isFetchingNextPage]),b.useEffect(()=>{h(!1)},[s,c]);const _=b.useMemo(()=>{var r;return(((r=f.data)==null?void 0:r.results)??[]).flatMap(i=>i.tasks.filter(o=>!!o.slug).map(o=>({...o,slug:o.slug,label:E(o.name,o.slug)})))},[f.data]),p=_.find(r=>r.slug===c),T=b.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(i=>i.results.map(X))},[a.data]),t=x.data??((k=f.data)==null?void 0:k.organization),I=((F=(P=a.data)==null?void 0:P.pages[0])==null?void 0:F.count)??0;if(((M=x.error)==null?void 0:M.status)===404||((A=f.error)==null?void 0:A.status)===404||((O=a.error)==null?void 0:O.status)===404)return e.jsx(ee,{});if(f.error||a.error)return e.jsx("div",{className:"page",children:e.jsx(Z,{variant:"destructive",children:e.jsx(B,{children:"Failed to load organization papers. Please try again."})})});const U=r=>{const i=r.trim().toLocaleLowerCase();return _.filter(o=>`${o.label} ${o.slug}`.toLocaleLowerCase().includes(i)).map(o=>({value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}))},q=r=>{const i=r==="__all__"?`/orgs/${s}`:`/orgs/${s}/${r}`,o=d.toString();l({pathname:i,search:o?`?${o}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(D,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(D,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(t==null?void 0:t.name)??s}),p&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:E(p.name,p.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:[t!=null&&t.logo_url&&!g?e.jsx("img",{src:t.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):t?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:t.name.slice(0,1).toUpperCase()}):null,(t==null?void 0:t.name)??e.jsx($,{className:"h-12 w-64"})]}),t&&e.jsxs("div",{className:"feed-subtitle",children:[((z=t.paper_count)==null?void 0:z.toLocaleString())??0," papers",(t.organization_trending_score??0)>0&&t.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",t.trending_rank," trending this month"]})]}),(t==null?void 0:t.description)&&e.jsx(K,{className:"method-description",text:t.description}),t&&e.jsxs("div",{className:"organization-hero-links",children:[t.website_url&&e.jsx("a",{href:t.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),t.hf_url&&e.jsx("a",{href:t.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),t.github_url&&e.jsx("a",{href:t.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),t&&e.jsx(oe,{organizationSlug:s,organizationName:t.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(Y,{value:c??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:p?{value:p.slug,label:p.label,description:`${p.paper_count.toLocaleString()} ${p.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((S=t==null?void 0:t.paper_count)==null?void 0:S.toLocaleString())??0} papers`},queryKey:["organization-task-options",s],queryFn:async r=>{var i;return[{value:"__all__",label:"All tasks",description:`${((i=t==null?void 0:t.paper_count)==null?void 0:i.toLocaleString())??0} papers`},...U(r)]},enabled:!f.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:le.map(([r,i])=>e.jsx("button",{type:"button",className:`sort-btn ${n===r?"active":""}`,onClick:()=>{const o=new URLSearchParams(d);r==="trending"?o.delete("order_by"):o.set("order_by",r),j(o)},children:i},r))}),e.jsx(Q,{hasCode:u,hasHfArtifacts:y,onHasCodeChange:r=>{const i=new URLSearchParams(d);r?i.set("has_code","true"):i.delete("has_code"),j(i)},onHasHfArtifactsChange:r=>{const i=new URLSearchParams(d);r?i.set("has_hf_artifacts","true"):i.delete("has_hf_artifacts"),j(i)}})]}),e.jsxs("div",{className:"results-count",children:[I.toLocaleString()," papers"]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,i)=>e.jsx($,{className:"h-40 w-full"},i))}):T.length===0?e.jsx("div",{className:"no-results",children:(t==null?void 0:t.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:T.map((r,i)=>e.jsx(G,{paper:r,rank:i+1},r.id))}),e.jsx("div",{ref:N,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ye as O}; +import{j as e,r as b,b as L,u as H,a as W,L as D}from"./index-DsjIhQkx.js";import{u as w}from"./useQuery-xOve4y-6.js";import{P as G}from"./components-DbYcrD0u.js";import{M as K}from"./MarkdownText-DP1ebl5t.js";import{S as $}from"./skeleton-B1Kg5w0V.js";import{P as Q}from"./PaperFeedFilters-DLrIO7NL.js";import{A as Z,a as B}from"./alert-BThP2mep.js";import{a as Y}from"./searchable-select-Bl979FVT.js";import{u as J}from"./useIntersectionObserver-DdSZQ78X.js";import{d as V}from"./usePapers-CHYNlILt.js";import{d as E,t as X}from"./transform-C1LieBU0.js";import ee from"./NotFound-B_H_to4V.js";const v=24*60*60*1e3,C=12,te=3,se=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),R=s=>new Date(`${s}T00:00:00Z`),ae=s=>s.toISOString().slice(0,10),re=(s,c)=>{if(s===0)return 0;const l=c.findIndex(d=>s<=d);return l===-1?4:l+1},ne=s=>{const c=R(s.start_date),l=R(s.end_date),d=new Date(c.getTime()-c.getUTCDay()*v),j=new Date(l.getTime()+(6-l.getUTCDay())*v),g=new Map(s.results.map(a=>[a.date,a.paper_count])),h=s.results.map(a=>a.paper_count).sort((a,N)=>a-N),n=[.25,.5,.75].map(a=>h[Math.min(h.length-1,Math.floor(h.length*a))]??1),u=[];for(let a=d.getTime();a<=j.getTime();a+=v){const N=new Date(a),m=ae(N),_=a>=c.getTime()&&a<=l.getTime(),p=_?g.get(m)??0:0;u.push({key:m,date:N,count:p,inRange:_,level:re(p,n)})}const y=u.length/7,x=[];let f=-1;for(let a=0;a_.inRange&&(a===0||_.date.getUTCDate()<=7));m&&m.date.getUTCMonth()!==f&&(f=m.date.getUTCMonth(),x.length>0&&a-x[x.length-1].column<3&&x.pop(),x.push({label:m.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:a}))}return{days:u,months:x,weekCount:y}},ie=({data:s,organizationName:c})=>{const l=b.useRef(null),{days:d,months:j,weekCount:g}=b.useMemo(()=>ne(s),[s]),h=g*C+(g-1)*te;return b.useEffect(()=>{const n=l.current;n&&(n.scrollLeft=n.scrollWidth)},[g]),e.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[e.jsxs("div",{className:"organization-contributions-header",children:[e.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:"Paper contributions"}),e.jsxs("p",{className:"organization-contributions-summary",children:[s.total_count.toLocaleString()," ",s.total_count===1?"paper":"papers"," published in the last year"]})]}),e.jsx("div",{className:"organization-contributions-scroll",ref:l,children:e.jsxs("div",{className:"organization-contributions-plot",style:{width:h+34},role:"img","aria-label":`${c} published ${s.total_count} papers in the last year`,children:[e.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((n,u)=>e.jsx("span",{children:se.get(u)??""},u))}),e.jsxs("div",{children:[e.jsx("div",{className:"organization-contributions-months",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:j.map(n=>e.jsx("span",{style:{gridColumnStart:n.column+1},children:n.label},`${n.label}-${n.column}`))}),e.jsx("div",{className:"organization-contributions-grid",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:d.map(n=>e.jsx("span",{className:`organization-contribution-cell ${n.inRange?`level-${n.level}`:"is-outside"}`,title:n.inRange?`${n.count} ${n.count===1?"paper":"papers"} on ${n.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},n.key))})]})]})}),e.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[e.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(n=>e.jsx("span",{className:`organization-contribution-cell level-${n}`},n)),e.jsx("span",{children:"More"})]})]})},oe=({organizationSlug:s,organizationName:c})=>{const l=w({queryKey:["organization-contributions",s],queryFn:()=>L.getOrganizationContributions(s),staleTime:6e5});return l.isLoading?e.jsx($,{className:"organization-contributions-skeleton"}):l.data?e.jsx(ie,{data:l.data,organizationName:c}):null},le=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=s=>s==="date_published"||s==="citation_count"?s:"trending",ye=({organizationSlug:s,taskSlug:c})=>{var k,P,F,M,A,O,z,S;const l=H(),[d,j]=W(),[g,h]=b.useState(!1),n=ce(d.get("order_by")),u=d.get("has_code")==="true",y=d.get("has_hf_artifacts")==="true",x=w({queryKey:["organization",s],queryFn:()=>L.getOrganization(s),staleTime:10*60*1e3}),f=w({queryKey:["organization-areas-with-tasks",s],queryFn:()=>L.getOrganizationAreasWithTasks(s),staleTime:10*60*1e3}),a=V({organizationSlug:s,taskSlug:c,page_size:12,order_by:n,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:y,enabled:!!s}),{targetRef:N,isIntersecting:m}=J({rootMargin:"200px"});b.useEffect(()=>{m&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[m,a.hasNextPage,a.isFetchingNextPage]),b.useEffect(()=>{h(!1)},[s,c]);const _=b.useMemo(()=>{var r;return(((r=f.data)==null?void 0:r.results)??[]).flatMap(i=>i.tasks.filter(o=>!!o.slug).map(o=>({...o,slug:o.slug,label:E(o.name,o.slug)})))},[f.data]),p=_.find(r=>r.slug===c),T=b.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(i=>i.results.map(X))},[a.data]),t=x.data??((k=f.data)==null?void 0:k.organization),I=((F=(P=a.data)==null?void 0:P.pages[0])==null?void 0:F.count)??0;if(((M=x.error)==null?void 0:M.status)===404||((A=f.error)==null?void 0:A.status)===404||((O=a.error)==null?void 0:O.status)===404)return e.jsx(ee,{});if(f.error||a.error)return e.jsx("div",{className:"page",children:e.jsx(Z,{variant:"destructive",children:e.jsx(B,{children:"Failed to load organization papers. Please try again."})})});const U=r=>{const i=r.trim().toLocaleLowerCase();return _.filter(o=>`${o.label} ${o.slug}`.toLocaleLowerCase().includes(i)).map(o=>({value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}))},q=r=>{const i=r==="__all__"?`/orgs/${s}`:`/orgs/${s}/${r}`,o=d.toString();l({pathname:i,search:o?`?${o}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(D,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(D,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(t==null?void 0:t.name)??s}),p&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:E(p.name,p.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:[t!=null&&t.logo_url&&!g?e.jsx("img",{src:t.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):t?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:t.name.slice(0,1).toUpperCase()}):null,(t==null?void 0:t.name)??e.jsx($,{className:"h-12 w-64"})]}),t&&e.jsxs("div",{className:"feed-subtitle",children:[((z=t.paper_count)==null?void 0:z.toLocaleString())??0," papers",(t.organization_trending_score??0)>0&&t.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",t.trending_rank," trending this month"]})]}),(t==null?void 0:t.description)&&e.jsx(K,{className:"method-description",text:t.description}),t&&e.jsxs("div",{className:"organization-hero-links",children:[t.website_url&&e.jsx("a",{href:t.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),t.hf_url&&e.jsx("a",{href:t.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),t.github_url&&e.jsx("a",{href:t.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),t&&e.jsx(oe,{organizationSlug:s,organizationName:t.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(Y,{value:c??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:p?{value:p.slug,label:p.label,description:`${p.paper_count.toLocaleString()} ${p.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((S=t==null?void 0:t.paper_count)==null?void 0:S.toLocaleString())??0} papers`},queryKey:["organization-task-options",s],queryFn:async r=>{var i;return[{value:"__all__",label:"All tasks",description:`${((i=t==null?void 0:t.paper_count)==null?void 0:i.toLocaleString())??0} papers`},...U(r)]},enabled:!f.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:le.map(([r,i])=>e.jsx("button",{type:"button",className:`sort-btn ${n===r?"active":""}`,onClick:()=>{const o=new URLSearchParams(d);r==="trending"?o.delete("order_by"):o.set("order_by",r),j(o)},children:i},r))}),e.jsx(Q,{hasCode:u,hasHfArtifacts:y,onHasCodeChange:r=>{const i=new URLSearchParams(d);r?i.set("has_code","true"):i.delete("has_code"),j(i)},onHasHfArtifactsChange:r=>{const i=new URLSearchParams(d);r?i.set("has_hf_artifacts","true"):i.delete("has_hf_artifacts"),j(i)}})]}),e.jsxs("div",{className:"results-count",children:[I.toLocaleString()," papers"]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,i)=>e.jsx($,{className:"h-40 w-full"},i))}):T.length===0?e.jsx("div",{className:"no-results",children:(t==null?void 0:t.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:T.map((r,i)=>e.jsx(G,{paper:r,rank:i+1},r.id))}),e.jsx("div",{ref:N,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ye as O}; diff --git a/assets/OrganizationTaskView-B91F04sp.js b/assets/OrganizationTaskView-B91F04sp.js new file mode 100644 index 0000000000000000000000000000000000000000..bf1e1e2d08bb92ea0816fa6db47244f6101c5f70 --- /dev/null +++ b/assets/OrganizationTaskView-B91F04sp.js @@ -0,0 +1 @@ +import{e as i,j as t}from"./index-DsjIhQkx.js";import{O as m}from"./OrganizationPaperFeed-8WeZrAve.js";import p from"./NotFound-B_H_to4V.js";import"./useQuery-xOve4y-6.js";import"./useBaseQuery-D4kcdcVW.js";import"./components-DbYcrD0u.js";import"./LatexTitle-DA7SEiSe.js";import"./katex.min-BSBacQyE.js";import"./transform-C1LieBU0.js";import"./MarkdownText-DP1ebl5t.js";import"./PaperPreviewLink-BkYFo5pJ.js";import"./index-DaRHhPdB.js";import"./hover-card-DWx_NdIh.js";import"./skeleton-B1Kg5w0V.js";import"./PaperFeedFilters-DLrIO7NL.js";import"./alert-BThP2mep.js";import"./searchable-select-Bl979FVT.js";import"./button-CYp7VsNM.js";import"./dialog-BoPFX590.js";import"./loader-circle-DEdDfzjU.js";import"./useIntersectionObserver-DdSZQ78X.js";import"./usePapers-CHYNlILt.js";import"./useInfiniteQuery-BfqUfQDk.js";const V=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{V as default}; diff --git a/assets/OrganizationTaskView-CqHYmvnR.js b/assets/OrganizationTaskView-CqHYmvnR.js deleted file mode 100644 index 09dc898d26daa9aaf2095ea4c67822d394b93a9d..0000000000000000000000000000000000000000 --- a/assets/OrganizationTaskView-CqHYmvnR.js +++ /dev/null @@ -1 +0,0 @@ -import{e as i,j as t}from"./index-LWBjDGUR.js";import{O as m}from"./OrganizationPaperFeed-DPUi2fIX.js";import p from"./NotFound-DTl10qdH.js";import"./useQuery-CVb9j2D6.js";import"./useBaseQuery-CSyvHxAw.js";import"./components-DaxA6Lf7.js";import"./LatexTitle-CB-vNeWW.js";import"./katex.min-BSBacQyE.js";import"./transform-BSMO2egg.js";import"./MarkdownText-DQ_lzSri.js";import"./PaperPreviewLink-DWreeZBU.js";import"./index-C3kXFp4C.js";import"./hover-card-BYeJ4GbN.js";import"./skeleton-JE1BtvIJ.js";import"./PaperFeedFilters-BVyIB5Fr.js";import"./alert-fokOob1I.js";import"./searchable-select-BvzTwnT-.js";import"./button-D2jk6ElT.js";import"./dialog-CUdQ6AzV.js";import"./loader-circle-C5GDD3qQ.js";import"./useIntersectionObserver-CTkoMSzM.js";import"./usePapers-Cexc6lbX.js";import"./useInfiniteQuery-CdDNcC4u.js";const V=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{V as default}; diff --git a/assets/OrganizationsIndexView-kFwneTNZ.js b/assets/OrganizationsIndexView-D1m-Jyhd.js similarity index 94% rename from assets/OrganizationsIndexView-kFwneTNZ.js rename to assets/OrganizationsIndexView-D1m-Jyhd.js index da19eb7b0209e2e37b14ddf0c65811d7ce113e2b..ce4611488af4c7a0b23d416a2ecac1e288325ba1 100644 --- a/assets/OrganizationsIndexView-kFwneTNZ.js +++ b/assets/OrganizationsIndexView-D1m-Jyhd.js @@ -1 +1 @@ -import{a as u,r as g,j as e,L as x,b as j}from"./index-LWBjDGUR.js";import{u as y}from"./useQuery-CVb9j2D6.js";import{A as f,a as _}from"./alert-fokOob1I.js";import{S as N}from"./skeleton-JE1BtvIJ.js";import"./useBaseQuery-CSyvHxAw.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)})})},q=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),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 21 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(N,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{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{q as default}; +import{a as u,r as g,j as e,L as x,b as j}from"./index-DsjIhQkx.js";import{u as y}from"./useQuery-xOve4y-6.js";import{A as f,a as _}from"./alert-BThP2mep.js";import{S as N}from"./skeleton-B1Kg5w0V.js";import"./useBaseQuery-D4kcdcVW.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)})})},q=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),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 21 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(N,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{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{q as default}; diff --git a/assets/PaperDetailView-DryrpQ-P.js b/assets/PaperDetailView-CGHTDbxn.js similarity index 98% rename from assets/PaperDetailView-DryrpQ-P.js rename to assets/PaperDetailView-CGHTDbxn.js index e18cef5633fc34aec771bffc01e16a56e330b8b2..904f7a3f66d26900d4b6257da921b9e3136e2d8b 100644 --- a/assets/PaperDetailView-DryrpQ-P.js +++ b/assets/PaperDetailView-CGHTDbxn.js @@ -1,4 +1,4 @@ -import{c as bt,k as Ws,r as m,j as e,P as as,l as _e,m as rs,n as Te,o as Le,p as ns,q as jt,C as je,s as Qe,t as me,g as he,X as is,v as ve,w as Ys,x as os,y as Zs,z as ea,A as ta,B as sa,D as aa,E as Kt,F as ra,G as na,H as ia,I as oa,J as la,f as Je,R as vt,b as ge,K as ls,d as cs,M as ca,N as da,O as ua,Q as ds,S as ma,e as ha,T as pa,u as fa,U as xa,L as xe,V as ga,W as ba,Y as ja,Z as va,_ as ya,$ as _a,a0 as ka}from"./index-LWBjDGUR.js";import{u as re}from"./useQuery-CVb9j2D6.js";import{I as J,S as wa,a as Na,T as Ca,M as Ea}from"./components-DaxA6Lf7.js";import{C as Sa,E as Ra}from"./ExternalSourceEvalBadge-DyD1_AOv.js";import{L as qe,a as Pa}from"./LatexTitle-CB-vNeWW.js";import{c as Aa}from"./transform-BSMO2egg.js";import{f as $a,D as Ia}from"./latexPlainText-DI8YEXVe.js";import{a as Fa}from"./usePapers-Cexc6lbX.js";import{S as $e}from"./skeleton-JE1BtvIJ.js";import{A as La,a as Ta}from"./alert-fokOob1I.js";import{B as H}from"./button-D2jk6ElT.js";import{u as us}from"./index-CIXIMLCe.js";import{I as Z}from"./textarea-sAKp6aGF.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as ue}from"./dialog-CUdQ6AzV.js";import{u as pe}from"./useMutation-Cm0dU_OR.js";import{S as yt,P as Xe,L as ae,a as Ua}from"./SignInToEditDialog-BeFxaoXp.js";import{S as Ve,a as Ot}from"./searchable-select-BvzTwnT-.js";import{L as ne}from"./loader-circle-C5GDD3qQ.js";import{B as ms,D as Da,c as Ba,g as Ma,s as Ha,a as qa,b as za,d as Ka,i as Oa,e as Ga}from"./codexAddEvals-DUvovZgS.js";import{G as Gt}from"./github-B_khJHHj.js";import{M as Qa,r as Va}from"./index-C3kXFp4C.js";import"./useBaseQuery-CSyvHxAw.js";import"./hover-card-BYeJ4GbN.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CdDNcC4u.js";/** +import{c as bt,l as Ws,r as m,j as e,P as as,m as _e,n as rs,o as Te,p as Le,q as ns,s as jt,C as je,t as Qe,v as me,g as he,X as is,w as ve,x as Ys,y as os,z as Zs,A as ea,B as ta,D as sa,E as aa,F as Kt,G as ra,H as na,I as ia,J as oa,K as la,f as Je,R as vt,b as ge,M as ls,d as cs,N as ca,O as da,Q as ua,S as ds,T as ma,e as ha,U as pa,u as fa,V as xa,L as xe,W as ga,Y as ba,Z as ja,_ as va,$ as ya,a0 as _a,a1 as ka}from"./index-DsjIhQkx.js";import{u as re}from"./useQuery-xOve4y-6.js";import{I as J,S as wa,a as Na,T as Ca,M as Ea}from"./components-DbYcrD0u.js";import{C as Sa,E as Ra}from"./ExternalSourceEvalBadge-B3x84Amj.js";import{L as qe,a as Pa}from"./LatexTitle-DA7SEiSe.js";import{c as Aa}from"./transform-C1LieBU0.js";import{f as $a,D as Ia}from"./latexPlainText-DI8YEXVe.js";import{a as Fa}from"./usePapers-CHYNlILt.js";import{S as $e}from"./skeleton-B1Kg5w0V.js";import{A as La,a as Ta}from"./alert-BThP2mep.js";import{B as H}from"./button-CYp7VsNM.js";import{u as us}from"./index-DUeJ-D3M.js";import{I as Z}from"./textarea-BMnjM1hO.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as ue}from"./dialog-BoPFX590.js";import{u as pe}from"./useMutation-B-lCv88U.js";import{S as yt,P as Xe,L as ae,a as Ua}from"./SignInToEditDialog-DuAbhKyX.js";import{S as Ve,a as Ot}from"./searchable-select-Bl979FVT.js";import{L as ne}from"./loader-circle-DEdDfzjU.js";import{B as ms,D as Da,c as Ba,g as Ma,s as Ha,a as qa,b as za,d as Ka,i as Oa,e as Ga}from"./codexAddEvals-D6PHbQ5d.js";import{G as Gt}from"./github-Yx3jwWKl.js";import{M as Qa,r as Va}from"./index-DaRHhPdB.js";import"./useBaseQuery-D4kcdcVW.js";import"./hover-card-DWx_NdIh.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-BfqUfQDk.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/PaperFeedFilters-BVyIB5Fr.js b/assets/PaperFeedFilters-DLrIO7NL.js similarity index 90% rename from assets/PaperFeedFilters-BVyIB5Fr.js rename to assets/PaperFeedFilters-DLrIO7NL.js index 316d9e6633255d988554239318bc134abd0a321f..ebefb4ef3e184e9fda174340fa8789064a9b4d80 100644 --- a/assets/PaperFeedFilters-BVyIB5Fr.js +++ b/assets/PaperFeedFilters-DLrIO7NL.js @@ -1 +1 @@ -import{j as e}from"./index-LWBjDGUR.js";import{I as i}from"./components-DaxA6Lf7.js";const n=()=>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:"✓"})]}),d=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!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:[e.jsx(l,{checked:s,icon:e.jsx(i,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(n,{}),label:"Has artifacts",onChange:o})]})]});export{d as P}; +import{j as e}from"./index-DsjIhQkx.js";import{I as i}from"./components-DbYcrD0u.js";const n=()=>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:"✓"})]}),d=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!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:[e.jsx(l,{checked:s,icon:e.jsx(i,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(n,{}),label:"Has artifacts",onChange:o})]})]});export{d as P}; diff --git a/assets/PaperPreviewLink-DWreeZBU.js b/assets/PaperPreviewLink-BkYFo5pJ.js similarity index 93% rename from assets/PaperPreviewLink-DWreeZBU.js rename to assets/PaperPreviewLink-BkYFo5pJ.js index 83d3a0e3a4b9b7512ecd4e16965f131d66a8fdb0..65873f38ee357bdbc840ce5eea04d657b00bca65 100644 --- a/assets/PaperPreviewLink-DWreeZBU.js +++ b/assets/PaperPreviewLink-BkYFo5pJ.js @@ -1,7 +1,7 @@ -import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-C3kXFp4C.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as C,_ as ce,T as ue,L as he,al as pe}from"./index-LWBjDGUR.js";import{u as me}from"./useQuery-CVb9j2D6.js";import{H as fe,a as de,b as ge}from"./hover-card-BYeJ4GbN.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-DaRHhPdB.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,$ as ce,U as ue,L as he,am as pe}from"./index-DsjIhQkx.js";import{u as me}from"./useQuery-xOve4y-6.js";import{H as fe,a as de,b as ge}from"./hover-card-DWx_NdIh.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.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:n,inlineMath:r}};function n(o,s,l,a){const u=o.value||"",p=l.createTracker(a),m="$".repeat(Math.max(ne(u,"$")+1,2)),g=l.enter("mathFlow");let x=p.move(m);if(o.meta){const d=l.enter("mathFlowMeta");x+=p.move(l.safe(o.meta,{after:` `,before:x,encode:["$"],...p.current()})),d()}return x+=p.move(` `),u&&(x+=p.move(u+` -`)),x+=p.move(m),g(),x}function r(o,s,l){let a=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(a);)u++;const p="$".repeat(u);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let m=-1;for(;++mu&&(u=p):p&&(u!==void 0&&u>-1&&a.push(` +`)),x+=p.move(m),g(),x}function r(o,s,l){let a=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(a);)u++;const p="$".repeat(u);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let m=-1;for(;++mu&&(u=p):p&&(u!==void 0&&u>-1&&a.push(` `.repeat(u)||" "),u=-1,a.push(p))}return a.join("")}function Q(e,t,n){return e.type==="element"?Qe(e,t,n):e.type==="text"?n.whitespace==="normal"?Y(e,n):Ye(e):[]}function Qe(e,t,n){const r=J(e,n),i=e.children||[];let o=-1,s=[];if(Xe(e))return s;let l,a;for(j(e)||H(e)&&B(t,e,H)?a=` -`:Ke(e)?(l=2,a=2):W(e)&&(l=1,a=1);++o({name:n.name,slug:n.slug??""}))}}function at(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ot(e){var n;if(e.conference)return e.conference;const t=(n=e.published)==null?void 0:n.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const st=({seed:e=0})=>f.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[f.jsxs("div",{className:"paper-preview-thumb-title",children:[f.jsx("span",{}),f.jsx("span",{})]}),f.jsx("div",{className:"paper-preview-thumb-auth"}),f.jsxs("div",{className:"paper-preview-thumb-cols",children:[f.jsx("div",{className:"paper-preview-thumb-col"}),f.jsx("div",{className:"paper-preview-thumb-col"})]}),f.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),lt=({thumbnailUrl:e,seed:t})=>{const[n,r]=C.useState(!1),i=ce(e);return C.useEffect(()=>r(!1),[i]),!i||n?f.jsx(st,{seed:t}):f.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:f.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>r(!0)})})},ct=({data:e})=>{const t=e.routeId.split("").reduce((r,i)=>r+i.charCodeAt(0),0),n=at(e);return f.jsxs("div",{className:"paper-preview-inner",children:[f.jsx(lt,{thumbnailUrl:e.thumbnailUrl,seed:t}),f.jsxs("div",{className:"paper-preview-meta",children:[f.jsx("div",{className:"paper-preview-title",children:e.title}),n&&f.jsx("div",{className:"paper-preview-auth",children:n}),f.jsxs("div",{className:"paper-preview-venue",children:[ot(e),e.arxivId&&f.jsxs(f.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&f.jsxs(f.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&f.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(r=>f.jsx("span",{className:"paper-preview-tag",children:r.name},r.slug||r.name))})]})]})},ut=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,yt=({routeId:e,to:t,initialData:n,className:r,children:i,target:o,title:s})=>{const l=ue(e),[a,u]=C.useState(!1),p=!!(n!=null&&n.title.trim()),m=me({queryKey:["paper-preview",l],queryFn:()=>pe(l,!1),enabled:a&&!p,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),g=n??(m.data?it(m.data,l):void 0),x=f.jsx(he,{className:r,to:t??`/paper/${l}`,target:o,title:s,rel:o==="_blank"?"noopener noreferrer":void 0,children:i});return f.jsxs(fe,{open:a,onOpenChange:d=>{(!d||!ut())&&u(d)},openDelay:150,closeDelay:100,children:[f.jsx(de,{asChild:!0,children:x}),f.jsx(ge,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:g?f.jsx(ct,{data:g}):m.isError?f.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):f.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{yt as P,gt as a,xt as r}; +`:Ke(e)?(l=2,a=2):W(e)&&(l=1,a=1);++o({name:n.name,slug:n.slug??""}))}}function at(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ot(e){var n;if(e.conference)return e.conference;const t=(n=e.published)==null?void 0:n.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const st=({seed:e=0})=>f.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[f.jsxs("div",{className:"paper-preview-thumb-title",children:[f.jsx("span",{}),f.jsx("span",{})]}),f.jsx("div",{className:"paper-preview-thumb-auth"}),f.jsxs("div",{className:"paper-preview-thumb-cols",children:[f.jsx("div",{className:"paper-preview-thumb-col"}),f.jsx("div",{className:"paper-preview-thumb-col"})]}),f.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),lt=({thumbnailUrl:e,seed:t})=>{const[n,r]=T.useState(!1),i=ce(e);return T.useEffect(()=>r(!1),[i]),!i||n?f.jsx(st,{seed:t}):f.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:f.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>r(!0)})})},ct=({data:e})=>{const t=e.routeId.split("").reduce((r,i)=>r+i.charCodeAt(0),0),n=at(e);return f.jsxs("div",{className:"paper-preview-inner",children:[f.jsx(lt,{thumbnailUrl:e.thumbnailUrl,seed:t}),f.jsxs("div",{className:"paper-preview-meta",children:[f.jsx("div",{className:"paper-preview-title",children:e.title}),n&&f.jsx("div",{className:"paper-preview-auth",children:n}),f.jsxs("div",{className:"paper-preview-venue",children:[ot(e),e.arxivId&&f.jsxs(f.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&f.jsxs(f.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&f.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(r=>f.jsx("span",{className:"paper-preview-tag",children:r.name},r.slug||r.name))})]})]})},ut=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,yt=({routeId:e,to:t,initialData:n,className:r,children:i,target:o,title:s})=>{const l=ue(e),[a,u]=T.useState(!1),p=!!(n!=null&&n.title.trim()),m=me({queryKey:["paper-preview",l],queryFn:()=>pe(l,!1),enabled:a&&!p,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),g=n??(m.data?it(m.data,l):void 0),x=f.jsx(he,{className:r,to:t??`/paper/${l}`,target:o,title:s,rel:o==="_blank"?"noopener noreferrer":void 0,children:i});return f.jsxs(fe,{open:a,onOpenChange:d=>{(!d||!ut())&&u(d)},openDelay:150,closeDelay:100,children:[f.jsx(de,{asChild:!0,children:x}),f.jsx(ge,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:g?f.jsx(ct,{data:g}):m.isError?f.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):f.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{yt as P,gt as a,xt as r}; diff --git a/assets/PapersListView-CaUF6tiV.js b/assets/PapersListView-BzmcMfSw.js similarity index 83% rename from assets/PapersListView-CaUF6tiV.js rename to assets/PapersListView-BzmcMfSw.js index 18d5b2afd49be3477cc75a0298143990f4ec688c..873b68be16e81dc299941a691aeb4c2800fb9545 100644 --- a/assets/PapersListView-CaUF6tiV.js +++ b/assets/PapersListView-BzmcMfSw.js @@ -1 +1 @@ -import{a as A,r as i,j as e,L as I,b as T}from"./index-LWBjDGUR.js";import{I as F,P as L}from"./components-DaxA6Lf7.js";import{t as C,d as R}from"./transform-BSMO2egg.js";import{u as k}from"./usePapers-Cexc6lbX.js";import{u as D}from"./useDebounce-Cr0VFQou.js";import{u as E,P as O}from"./usePeriodFilter-DR8ybPj0.js";import{u as B}from"./useIntersectionObserver-CTkoMSzM.js";import{S as c}from"./skeleton-JE1BtvIJ.js";import{A as $,a as M}from"./alert-fokOob1I.js";import{u as q}from"./useQuery-CVb9j2D6.js";import"./LatexTitle-CB-vNeWW.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CdDNcC4u.js";import"./useBaseQuery-CSyvHxAw.js";const z=[["trending","trending"],["new","newest"],["cited","most cited"]],te=()=>{var x,g,j,f;const[d,N]=A(),o=d.get("search")||"",[p,v]=i.useState(o),t=D(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),N(s,{replace:!0})},[t]);const[n,b]=i.useState("new"),{period:P,setPeriod:y,publishedAfter:S}=E("All Time"),a=k({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:S,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(_=>_.results))||[]).map(C)},[a.data]),{targetRef:w,isIntersecting:h}=B({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:O.map(s=>e.jsx("button",{className:`period-btn ${P===s?"active":""}`,onClick:()=>y(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(F,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>v(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(f=m.data)==null?void 0:f.map(s=>e.jsxs(I,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[R(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:z.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>b(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx($,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(L,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:w,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{te as default}; +import{a as A,r as i,j as e,L as I,b as T}from"./index-DsjIhQkx.js";import{I as F,P as L}from"./components-DbYcrD0u.js";import{t as C,d as R}from"./transform-C1LieBU0.js";import{u as k}from"./usePapers-CHYNlILt.js";import{u as D}from"./useDebounce-DuVaIR_H.js";import{u as E,P as O}from"./usePeriodFilter-veYjaFZT.js";import{u as B}from"./useIntersectionObserver-DdSZQ78X.js";import{S as c}from"./skeleton-B1Kg5w0V.js";import{A as $,a as M}from"./alert-BThP2mep.js";import{u as q}from"./useQuery-xOve4y-6.js";import"./LatexTitle-DA7SEiSe.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-BfqUfQDk.js";import"./useBaseQuery-D4kcdcVW.js";const z=[["trending","trending"],["new","newest"],["cited","most cited"]],te=()=>{var x,g,j,f;const[d,N]=A(),o=d.get("search")||"",[p,v]=i.useState(o),t=D(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),N(s,{replace:!0})},[t]);const[n,b]=i.useState("new"),{period:P,setPeriod:y,publishedAfter:S}=E("All Time"),a=k({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:S,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(_=>_.results))||[]).map(C)},[a.data]),{targetRef:w,isIntersecting:h}=B({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:O.map(s=>e.jsx("button",{className:`period-btn ${P===s?"active":""}`,onClick:()=>y(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(F,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>v(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(f=m.data)==null?void 0:f.map(s=>e.jsxs(I,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[R(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:z.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>b(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx($,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(L,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:w,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{te as default}; diff --git a/assets/SavedPapersView-Dl29aGCp.js b/assets/SavedPapersView-AVBr0WvC.js similarity index 86% rename from assets/SavedPapersView-Dl29aGCp.js rename to assets/SavedPapersView-AVBr0WvC.js index c7049f67fb52d1ab9452ae114be74010c05e2190..270f476344e1065e551d9c9504f664462df59e1c 100644 --- a/assets/SavedPapersView-Dl29aGCp.js +++ b/assets/SavedPapersView-AVBr0WvC.js @@ -1 +1 @@ -import{f as o,j as s,a6 as m,L as p,b as h}from"./index-LWBjDGUR.js";import{u as x}from"./useQuery-CVb9j2D6.js";import{T as u,P as j}from"./components-DaxA6Lf7.js";import{S as r}from"./skeleton-JE1BtvIJ.js";import{A as v,a as N}from"./alert-fokOob1I.js";import{t as g}from"./transform-BSMO2egg.js";import"./useBaseQuery-CSyvHxAw.js";import"./LatexTitle-CB-vNeWW.js";import"./katex.min-BSBacQyE.js";const C=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{C as default}; +import{f as o,j as s,a7 as m,L as p,b as h}from"./index-DsjIhQkx.js";import{u as x}from"./useQuery-xOve4y-6.js";import{T as u,P as j}from"./components-DbYcrD0u.js";import{S as r}from"./skeleton-B1Kg5w0V.js";import{A as v,a as N}from"./alert-BThP2mep.js";import{t as g}from"./transform-C1LieBU0.js";import"./useBaseQuery-D4kcdcVW.js";import"./LatexTitle-DA7SEiSe.js";import"./katex.min-BSBacQyE.js";const C=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{C as default}; diff --git a/assets/SearchOverlay-BfRi7gsA.js b/assets/SearchOverlay-NFroiW9m.js similarity index 93% rename from assets/SearchOverlay-BfRi7gsA.js rename to assets/SearchOverlay-NFroiW9m.js index 634fd779e4e8d259ccd9c157e5e396bcd0be3021..7f11db272b2e3372b60c48ac6d595300ce1b782d 100644 --- a/assets/SearchOverlay-BfRi7gsA.js +++ b/assets/SearchOverlay-NFroiW9m.js @@ -1 +1 @@ -import{r as C,u as L,R as T,i as $,j as s,b as m}from"./index-LWBjDGUR.js";import{u as p}from"./useQuery-CVb9j2D6.js";import{L as A}from"./LatexTitle-CB-vNeWW.js";import{u as D}from"./useDebounce-Cr0VFQou.js";import{e as z,h as M,d as B}from"./transform-BSMO2egg.js";import"./useBaseQuery-CSyvHxAw.js";import"./katex.min-BSBacQyE.js";const I=10,J=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{J as default}; +import{r as C,u as L,R as T,i as $,j as s,b as m}from"./index-DsjIhQkx.js";import{u as p}from"./useQuery-xOve4y-6.js";import{L as A}from"./LatexTitle-DA7SEiSe.js";import{u as D}from"./useDebounce-DuVaIR_H.js";import{e as z,h as M,d as B}from"./transform-C1LieBU0.js";import"./useBaseQuery-D4kcdcVW.js";import"./katex.min-BSBacQyE.js";const I=10,J=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{J as default}; diff --git a/assets/SettingsView-Frf9Rfgi.js b/assets/SettingsView-CN37p6xn.js similarity index 53% rename from assets/SettingsView-Frf9Rfgi.js rename to assets/SettingsView-CN37p6xn.js index b8d5304140bd47385adcf5b848034b6504da6b56..b8df99ef9f31715b357ed6b5f82b680175873d54 100644 --- a/assets/SettingsView-Frf9Rfgi.js +++ b/assets/SettingsView-CN37p6xn.js @@ -1,4 +1,4 @@ -import{c as r,f as k,U as w,ao as C,R as m,t as F,j as e,a6 as c,d as p}from"./index-LWBjDGUR.js";import{u as S}from"./useQuery-CVb9j2D6.js";import{u as _}from"./useMutation-Cm0dU_OR.js";import{S as H}from"./switch-Brp2Ns-5.js";import{f as E,D as M}from"./latexPlainText-DI8YEXVe.js";import{E as A}from"./external-link-BPkSuoMQ.js";import"./useBaseQuery-CSyvHxAw.js";import"./index-CIXIMLCe.js";/** +import{c as r,f as k,V as w,ap as C,R as m,v as F,j as e,a7 as c,d as p}from"./index-DsjIhQkx.js";import{u as S}from"./useQuery-xOve4y-6.js";import{u as _}from"./useMutation-B-lCv88U.js";import{S as H}from"./switch-DIM4i6Fu.js";import{f as E,D as M}from"./latexPlainText-DI8YEXVe.js";import{E as A}from"./external-link-CG866OfT.js";import"./useBaseQuery-D4kcdcVW.js";import"./index-DUeJ-D3M.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,9 +8,9 @@ import{c as r,f as k,U as w,ao as C,R as m,t as F,j as e,a6 as c,d as p}from"./i * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const P=r("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + */const z=r("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const z=r("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),U=()=>{var u;const{user:t}=k(),{preferences:b,setHideClosedSourceEvals:x,canPersist:j}=w(),{theme:y,setTheme:v}=C(),f=y??"system",[a,o]=m.useState(""),N=F(),d=S({queryKey:["inference-billing",t==null?void 0:t.hf_subject],enabled:!!t,queryFn:async()=>{const s=await fetch(p("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not load billing status.");return await s.json()}}),n=d.data??null,h=_({mutationFn:async s=>{const l=await fetch(p("/api/v1/me/inference-billing"),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({bill_to:s})}),i=await l.json();if(!l.ok)throw new Error(typeof i.detail=="string"?i.detail:"Could not change the billing account.");return i},onSuccess:s=>{N.setQueryData(["inference-billing",t==null?void 0:t.hf_subject],s),o("")},onError:s=>{o(s instanceof Error?s.message:"Could not change the billing account.")}}),g=d.isLoading||h.isPending;return m.useEffect(()=>(document.title=E("Settings"),()=>{document.title=M}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),t?g&&!n?e.jsx("div",{className:"settings-billing-loading",children:"Checking Hugging Face billing…"}):n!=null&&n.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsxs("div",{className:"settings-plan-row",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:n.bill_to?`Hugging Face organization · ${n.bill_to}`:`Hugging Face ${n.account_type}`}),e.jsx("div",{className:"settings-row-desc",children:n.bill_to?"Chat requests use this organization’s shared credits and billing.":`$${(u=n.monthly_credits_usd)==null?void 0:u.toFixed(2)} included each month, then pay as you go through your personal HF account when enabled.`})]}),e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),e.jsx("label",{className:"settings-token-label",htmlFor:"hf-billing-account",children:"Bill chat usage to"}),e.jsxs("select",{id:"hf-billing-account",className:"settings-billing-select",value:n.bill_to??"",onChange:s=>{o(""),h.mutate(s.target.value||null)},disabled:g,children:[e.jsxs("option",{value:"",children:["Personal account (@",t.username,")"]}),n.organizations.map(s=>e.jsxs("option",{value:s.name,children:[s.display_name," (",s.name,")"]},s.name))]}),e.jsx("p",{className:"settings-billing-help",children:"Hugging Face maintains the authoritative usage, spend, credits, and provider limits. Additional usage is billed by Hugging Face when pay-as-you-go or purchased credits are enabled. Organization billing requires a Team or Enterprise plan and OAuth access for the selected organization."}),a&&e.jsx("div",{className:"settings-token-error",children:a}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsxs("a",{className:"button button-primary",href:n.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(A,{"aria-hidden":"true"})]}),e.jsx(c,{returnTo:"/settings",label:"Refresh HF permissions"})]})]}):e.jsxs("div",{className:"settings-billing-connect",children:[e.jsxs("p",{className:"settings-row-desc",children:["Authorize Papers With Code to call ",e.jsx("strong",{children:"Inference Providers"})," ","on your behalf. No manually created token is needed. Hugging Face bills your personal account by default; after authorizing, you can optionally select an eligible organization."]}),a&&e.jsx("div",{className:"settings-token-error",children:a}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx(c,{returnTo:"/settings",label:"Authorize with Hugging Face"})})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to connect your Hugging Face account for research chat. Model usage is billed by Hugging Face, not Papers With Code."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(c,{returnTo:"/settings"})})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:T},{value:"light",label:"Light",description:"Always use light mode",icon:z},{value:"dark",label:"Dark",description:"Always use dark mode",icon:P}].map(s=>{const l=s.icon,i=f===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${i?"is-selected":""}`,"aria-pressed":i,onClick:()=>v(s.value),children:[e.jsx(l,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(H,{id:"hide-closed-source-evals",checked:b.hide_closed_source_evals,onCheckedChange:s=>{x(!!s)}})]}),!j&&!t&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(c,{returnTo:"/settings"})})]})]})]})};export{U as default}; + */const I=r("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),O=()=>{var g;const{user:t}=k(),{preferences:b,setHideClosedSourceEvals:x,canPersist:j}=w(),{theme:y,setTheme:v}=C(),f=y??"system",[a,o]=m.useState(""),N=F(),d=S({queryKey:["inference-billing",t==null?void 0:t.hf_subject],enabled:!!t,queryFn:async()=>{const s=await fetch(p("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not load billing status.");return await s.json()}}),n=d.data??null,h=_({mutationFn:async s=>{const l=await fetch(p("/api/v1/me/inference-billing"),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({bill_to:s})}),i=await l.json();if(!l.ok)throw new Error(typeof i.detail=="string"?i.detail:"Could not change the billing account.");return i},onSuccess:s=>{N.setQueryData(["inference-billing",t==null?void 0:t.hf_subject],s),o("")},onError:s=>{o(s instanceof Error?s.message:"Could not change the billing account.")}}),u=d.isLoading||h.isPending;return m.useEffect(()=>(document.title=E("Settings"),()=>{document.title=M}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),t?u&&!n?e.jsx("div",{className:"settings-billing-loading",children:"Checking Hugging Face billing…"}):n!=null&&n.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsxs("div",{className:"settings-plan-row",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:n.bill_to?`Hugging Face organization · ${n.bill_to}`:`Hugging Face ${n.account_type}`}),e.jsx("div",{className:"settings-row-desc",children:n.bill_to?"Chat requests use this organization’s shared credits and billing.":`$${(g=n.monthly_credits_usd)==null?void 0:g.toFixed(2)} included each month, then pay as you go through your personal HF account when enabled.`})]}),e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),e.jsx("label",{className:"settings-token-label",htmlFor:"hf-billing-account",children:"Bill chat usage to"}),e.jsxs("select",{id:"hf-billing-account",className:"settings-billing-select",value:n.bill_to??"",onChange:s=>{o(""),h.mutate(s.target.value||null)},disabled:u,children:[e.jsxs("option",{value:"",children:["Personal account (@",t.username,")"]}),n.organizations.map(s=>e.jsxs("option",{value:s.name,children:[s.display_name," (",s.name,")"]},s.name))]}),e.jsx("p",{className:"settings-billing-help",children:"Hugging Face maintains the authoritative usage, spend, credits, and provider limits. Additional usage is billed by Hugging Face when pay-as-you-go or purchased credits are enabled. Organization billing requires a Team or Enterprise plan and OAuth access for the selected organization."}),a&&e.jsx("div",{className:"settings-token-error",children:a}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsxs("a",{className:"button button-primary",href:n.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(A,{"aria-hidden":"true"})]}),e.jsx(c,{returnTo:"/settings",label:"Refresh HF permissions",authorizeInference:!0})]})]}):e.jsxs("div",{className:"settings-billing-connect",children:[e.jsxs("p",{className:"settings-row-desc",children:["Authorize Papers With Code to call ",e.jsx("strong",{children:"Inference Providers"})," ","on your behalf. No manually created token is needed. Hugging Face bills your personal account by default; after authorizing, you can optionally select an eligible organization."]}),a&&e.jsx("div",{className:"settings-token-error",children:a}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx(c,{returnTo:"/settings",label:"Authorize with Hugging Face",authorizeInference:!0})})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to connect your Hugging Face account for research chat. Model usage is billed by Hugging Face, not Papers With Code."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(c,{returnTo:"/settings",authorizeInference:!0})})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:T},{value:"light",label:"Light",description:"Always use light mode",icon:I},{value:"dark",label:"Dark",description:"Always use dark mode",icon:z}].map(s=>{const l=s.icon,i=f===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${i?"is-selected":""}`,"aria-pressed":i,onClick:()=>v(s.value),children:[e.jsx(l,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(H,{id:"hide-closed-source-evals",checked:b.hide_closed_source_evals,onCheckedChange:s=>{x(!!s)}})]}),!j&&!t&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(c,{returnTo:"/settings"})})]})]})]})};export{O as default}; diff --git a/assets/SharedChatView-BUBKFK2G.js b/assets/SharedChatView-BUBKFK2G.js deleted file mode 100644 index c5b831fc17d8e8c93fc9180435728fdd70c267d5..0000000000000000000000000000000000000000 --- a/assets/SharedChatView-BUBKFK2G.js +++ /dev/null @@ -1 +0,0 @@ -import{e as g,u as f,r as u,j as e,h as x}from"./index-LWBjDGUR.js";import{u as v}from"./useQuery-CVb9j2D6.js";import{C as j,U as S,A as y}from"./ChatMessage-_9GmgEOY.js";import{m as p,S as b,p as N,q,n as C}from"./chatSessions-gAEfkaKP.js";import"./useBaseQuery-CSyvHxAw.js";import"./katex.min-BSBacQyE.js";import"./hover-card-BYeJ4GbN.js";import"./PaperPreviewLink-DWreeZBU.js";import"./index-C3kXFp4C.js";const k=({detail:d})=>{const[i,h]=u.useState(()=>N(d)),a=u.useMemo(()=>{const t={};for(const n of i)for(const s of n.blocks??[])if(s.kind==="tool")for(const r of s.results??[])t[r.route_id]=r;return t},[i]),l=(t,n)=>{h(s=>s.map(r=>{var o;return r.id!==t?r:{...r,blocks:(o=r.blocks)==null?void 0:o.map((c,m)=>m===n&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??""},t.id):e.jsx(y,{msg:t,papers:a,onToggleBlock:l},t.id))})},B=()=>{const{shareId:d=""}=g(),i=f(),h=x(),a=v({queryKey:["shared-chat",d],queryFn:()=>C(d),retry:(n,s)=>!(s instanceof p&&s.status===404)&&n<1});u.useEffect(()=>{const n=document.title,s=document.head.querySelector('meta[name="robots"]'),r=s==null?void 0:s.content,o=s??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",s||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=n,s?s.content=r??"":o.remove()}},[]);const l=n=>{q(n,void 0,{autoSend:!1}),i("/chat")},t=a.error instanceof p&&a.error.status===404;return a.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(b,{})," Loading shared conversation…"]}):t?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."})]}):a.isError||!a.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 a.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(k,{detail:a.data},a.data.updated_at),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."}),h&&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. Hugging Face models also require the Inference Providers permission granted during sign-in; choose personal or organization billing in"," ",e.jsx("a",{href:"/settings",children:"Settings"}),"."]}),e.jsx(j,{onSend:l,placeholder:"Ask a new research question…"})]})]})]})};export{B as default}; diff --git a/assets/SharedChatView-ONvzGQrB.js b/assets/SharedChatView-ONvzGQrB.js new file mode 100644 index 0000000000000000000000000000000000000000..0d3c6729bef4fd9cc3cd86702d264680c7558c42 --- /dev/null +++ b/assets/SharedChatView-ONvzGQrB.js @@ -0,0 +1 @@ +import{e as g,u as f,r as u,j as e,k as x}from"./index-DsjIhQkx.js";import{u as v}from"./useQuery-xOve4y-6.js";import{C as j,U as S,A as y}from"./ChatMessage-DFG7XCLG.js";import{m as p,S as b,p as N,q as k,n as q}from"./chatSessions-BX17B8vQ.js";import"./useBaseQuery-D4kcdcVW.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DWx_NdIh.js";import"./PaperPreviewLink-BkYFo5pJ.js";import"./index-DaRHhPdB.js";const C=({detail:d})=>{const[i,h]=u.useState(()=>N(d)),a=u.useMemo(()=>{const t={};for(const n of i)for(const s of n.blocks??[])if(s.kind==="tool")for(const r of s.results??[])t[r.route_id]=r;return t},[i]),l=(t,n)=>{h(s=>s.map(r=>{var o;return r.id!==t?r:{...r,blocks:(o=r.blocks)==null?void 0:o.map((c,m)=>m===n&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??""},t.id):e.jsx(y,{msg:t,papers:a,onToggleBlock:l},t.id))})},B=()=>{const{shareId:d=""}=g(),i=f(),h=x(),a=v({queryKey:["shared-chat",d],queryFn:()=>q(d),retry:(n,s)=>!(s instanceof p&&s.status===404)&&n<1});u.useEffect(()=>{const n=document.title,s=document.head.querySelector('meta[name="robots"]'),r=s==null?void 0:s.content,o=s??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",s||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=n,s?s.content=r??"":o.remove()}},[]);const l=n=>{k(n,void 0,{autoSend:!1}),i("/chat")},t=a.error instanceof p&&a.error.status===404;return a.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(b,{})," Loading shared conversation…"]}):t?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."})]}):a.isError||!a.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 a.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(C,{detail:a.data},a.data.updated_at),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."}),h&&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. Hugging Face models also require the Inference Providers permission granted during sign-in; choose personal or organization billing in"," ",e.jsx("a",{href:"/settings",children:"Settings"}),"."]}),e.jsx(j,{onSend:l,placeholder:"Ask a new research question…"})]})]})]})};export{B as default}; diff --git a/assets/SignInToEditDialog-BeFxaoXp.js b/assets/SignInToEditDialog-DuAbhKyX.js similarity index 95% rename from assets/SignInToEditDialog-BeFxaoXp.js rename to assets/SignInToEditDialog-DuAbhKyX.js index cf0825e2227911757ee96902c1ff6c04c6ca457d..72c452dacba21d019b252c95c2dbdf932a07cfdc 100644 --- a/assets/SignInToEditDialog-BeFxaoXp.js +++ b/assets/SignInToEditDialog-DuAbhKyX.js @@ -1,4 +1,4 @@ -import{c as X,r as i,j as e,a4 as W,s as q,a5 as Q,g as Z,v as ee,X as te,C as se,a6 as ae}from"./index-LWBjDGUR.js";import{B as D}from"./button-D2jk6ElT.js";import{I as h,T as re}from"./textarea-sAKp6aGF.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-CUdQ6AzV.js";import{u as oe}from"./useMutation-Cm0dU_OR.js";import{L as ie}from"./loader-circle-C5GDD3qQ.js";/** +import{c as X,r as i,j as e,a5 as W,t as q,a6 as Q,g as Z,w as ee,X as te,C as se,a7 as ae}from"./index-DsjIhQkx.js";import{B as D}from"./button-CYp7VsNM.js";import{I as h,T as re}from"./textarea-BMnjM1hO.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-BoPFX590.js";import{u as oe}from"./useMutation-B-lCv88U.js";import{L as ie}from"./loader-circle-DEdDfzjU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmissionsDashboard-sLQHfiII.js b/assets/SubmissionsDashboard-BrnMfyKI.js similarity index 98% rename from assets/SubmissionsDashboard-sLQHfiII.js rename to assets/SubmissionsDashboard-BrnMfyKI.js index a18a3ba7025bffc295773afe0e79dc8189e8616e..383bafe7ff5842749b58fdb0c7d7734ff4332152 100644 --- a/assets/SubmissionsDashboard-sLQHfiII.js +++ b/assets/SubmissionsDashboard-BrnMfyKI.js @@ -1,4 +1,4 @@ -var fe=s=>{throw TypeError(s)};var X=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(X(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(X(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(X(s,t,"access private method"),i);import{aq as Ae,ar as ee,as as Oe,at as Me,t as ke,r as $,au as Fe,c as Qe,j as e,av as Se,aw as qe,R as N,s as q,ax as Ie,_ as Ue,f as De,g as we,al as Le,ay as $e,az as Te,aA as Be,aB as ze,aC as He,aD as se}from"./index-LWBjDGUR.js";import{Q as Ee,u as Ke,a as Pe,e as Je,b as We,c as Ve,s as pe,f as Ye,g as Ge}from"./useBaseQuery-CSyvHxAw.js";import{u as ge}from"./useQuery-CVb9j2D6.js";import{u as be}from"./useMutation-Cm0dU_OR.js";import{R as Xe,S as Ze,C as es,a as ss}from"./shield-alert-D9bH_bs8.js";import{L as B}from"./loader-circle-C5GDD3qQ.js";function je(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 D,S,L,U,w,Q,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,D);E(this,S);E(this,L);E(this,U);E(this,w);E(this,Q);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,D,t),_(this,U,n),_(this,L,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,L,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,L));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,L=new WeakMap,U=new WeakMap,w=new WeakMap,Q=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,Q)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,Q,Me(p(this,Q),i(t)))),p(this,Q)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,D).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,D),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,Q),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function Y({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ve(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):Fe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ye(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ge({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/** +var fe=s=>{throw TypeError(s)};var X=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(X(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(X(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(X(s,t,"access private method"),i);import{ar as Ae,as as ee,at as Oe,au as Me,v as ke,r as $,av as Fe,c as Qe,j as e,aw as Se,ax as qe,R as N,t as q,ay as Ie,$ as Ue,f as De,g as we,am as Le,az as $e,aA as Te,aB as Be,aC as ze,aD as He,aE as se}from"./index-DsjIhQkx.js";import{Q as Ee,u as Ke,a as Pe,e as Je,b as We,c as Ve,s as pe,f as Ye,g as Ge}from"./useBaseQuery-D4kcdcVW.js";import{u as ge}from"./useQuery-xOve4y-6.js";import{u as be}from"./useMutation-B-lCv88U.js";import{R as Xe,S as Ze,C as es,a as ss}from"./shield-alert-BS0sYsit.js";import{L as B}from"./loader-circle-DEdDfzjU.js";function je(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 D,S,L,U,w,Q,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,D);E(this,S);E(this,L);E(this,U);E(this,w);E(this,Q);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,D,t),_(this,U,n),_(this,L,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,L,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,L));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,L=new WeakMap,U=new WeakMap,w=new WeakMap,Q=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,Q)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,Q,Me(p(this,Q),i(t)))),p(this,Q)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,D).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,D),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,Q),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function Y({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ve(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):Fe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ye(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ge({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmitView-Dyt8xzD0.js b/assets/SubmitView-Bv_8lA_L.js similarity index 94% rename from assets/SubmitView-Dyt8xzD0.js rename to assets/SubmitView-Bv_8lA_L.js index 249c3c22d128023c36a249608064acf180cb73f2..7909ee6fd6ee3806bc4458ca3ee8c290977bf296 100644 --- a/assets/SubmitView-Dyt8xzD0.js +++ b/assets/SubmitView-Bv_8lA_L.js @@ -1 +1 @@ -import{u as R,t as T,g as _,R as n,j as e,ap as D}from"./index-LWBjDGUR.js";import{u as k}from"./useMutation-Cm0dU_OR.js";import{A as w,a as C}from"./alert-fokOob1I.js";import{B as j}from"./button-D2jk6ElT.js";import{I as h,T as z}from"./textarea-sAKp6aGF.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(g=>g.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,g]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,x]=n.useState(null),u=S(d),v=u==="external",c=k({mutationFn:t=>D(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{x(q(t))}}),P=t=>{if(t.preventDefault(),x(null),u==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:P,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:d,onChange:t=>s(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:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="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."})]}),v&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:l,onChange:t=>p(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(z,{id:"submit-abstract",value:o,onChange:t=>g(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:f,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(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."})]})]}),b&&e.jsx(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default}; +import{u as R,v as T,g as _,R as n,j as e,aq as D}from"./index-DsjIhQkx.js";import{u as k}from"./useMutation-B-lCv88U.js";import{A as w,a as C}from"./alert-BThP2mep.js";import{B as j}from"./button-CYp7VsNM.js";import{I as h,T as z}from"./textarea-BMnjM1hO.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(g=>g.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,g]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,x]=n.useState(null),u=S(d),v=u==="external",c=k({mutationFn:t=>D(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{x(q(t))}}),P=t=>{if(t.preventDefault(),x(null),u==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:P,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:d,onChange:t=>s(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:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="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."})]}),v&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:l,onChange:t=>p(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(z,{id:"submit-abstract",value:o,onChange:t=>g(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:f,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(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."})]})]}),b&&e.jsx(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default}; diff --git a/assets/TagBrowseView-lNBiZoSj.js b/assets/TagBrowseView-CrKqHljw.js similarity index 90% rename from assets/TagBrowseView-lNBiZoSj.js rename to assets/TagBrowseView-CrKqHljw.js index d1e9e34f457f5a9f6043f973135dc323f2babb16..c8346f3ebb0b137b387ff97fa9d8178a3bff1ee0 100644 --- a/assets/TagBrowseView-lNBiZoSj.js +++ b/assets/TagBrowseView-CrKqHljw.js @@ -1,4 +1,4 @@ -import{c as je,r as h,m as Z,j as e,l as B,a1 as _e,o as ve,P as Xe,q as Ne,n as ke,a2 as es,R as _,a3 as ss,M as as,s as J,e as ts,u as ns,a as rs,U as os,L as P,_ as cs,b as ge}from"./index-LWBjDGUR.js";import{u as be}from"./useQuery-CVb9j2D6.js";import{P as is,M as ls}from"./components-DaxA6Lf7.js";import{B as ds}from"./BenchmarkTrendSparkline-B7WHyzPN.js";import{P as ps}from"./PaperFeedFilters-BVyIB5Fr.js";import{M as W}from"./MarkdownText-DQ_lzSri.js";import{t as ms,d as V}from"./transform-BSMO2egg.js";import{b as hs}from"./usePapers-Cexc6lbX.js";import{u as us}from"./useIntersectionObserver-CTkoMSzM.js";import{S as U}from"./skeleton-JE1BtvIJ.js";import{A as xs,a as gs}from"./alert-fokOob1I.js";import{C as bs}from"./chevron-down-YxmRXwt0.js";import{G as fe}from"./github-B_khJHHj.js";import"./useBaseQuery-CSyvHxAw.js";import"./LatexTitle-CB-vNeWW.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DWreeZBU.js";import"./index-C3kXFp4C.js";import"./hover-card-BYeJ4GbN.js";import"./useInfiniteQuery-CdDNcC4u.js";/** +import{c as je,r as h,n as Z,j as e,m as B,a2 as _e,p as ve,P as Xe,s as Ne,o as ke,a3 as es,R as _,a4 as ss,N as as,t as J,e as ts,u as ns,a as rs,V as os,L as P,$ as cs,b as ge}from"./index-DsjIhQkx.js";import{u as be}from"./useQuery-xOve4y-6.js";import{P as is,M as ls}from"./components-DbYcrD0u.js";import{B as ds}from"./BenchmarkTrendSparkline-Cjb-e1Og.js";import{P as ps}from"./PaperFeedFilters-DLrIO7NL.js";import{M as W}from"./MarkdownText-DP1ebl5t.js";import{t as ms,d as V}from"./transform-C1LieBU0.js";import{b as hs}from"./usePapers-CHYNlILt.js";import{u as us}from"./useIntersectionObserver-DdSZQ78X.js";import{S as U}from"./skeleton-B1Kg5w0V.js";import{A as xs,a as gs}from"./alert-BThP2mep.js";import{C as bs}from"./chevron-down-CBbOvtCm.js";import{G as fe}from"./github-Yx3jwWKl.js";import"./useBaseQuery-D4kcdcVW.js";import"./LatexTitle-DA7SEiSe.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BkYFo5pJ.js";import"./index-DaRHhPdB.js";import"./hover-card-DWx_NdIh.js";import"./useInfiniteQuery-BfqUfQDk.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,4 +8,4 @@ import{c as je,r as h,m as Z,j as e,l as B,a1 as _e,o as ve,P as Xe,q as Ne,n as * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const js=je("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);var z="Collapsible",[_s,Ce]=Ne(z),[vs,X]=_s(z),we=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...u}=a,[g,b]=Z({prop:r,defaultProp:i??!1,onChange:l,caller:z});return e.jsx(vs,{scope:n,disabled:o,contentId:_e(),open:g,onOpenToggle:h.useCallback(()=>b(j=>!j),[b]),children:e.jsx(B.div,{"data-state":se(g),"data-disabled":o?"":void 0,...u,ref:c})})});we.displayName=z;var ye="CollapsibleTrigger",Ae=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,...r}=a,i=X(ye,n);return e.jsx(B.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":se(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:c,onClick:ve(a.onClick,i.onOpenToggle)})});Ae.displayName=ye;var ee="CollapsibleContent",Se=h.forwardRef((a,c)=>{const{forceMount:n,...r}=a,i=X(ee,a.__scopeCollapsible);return e.jsx(Xe,{present:n||i.open,children:({present:o})=>e.jsx(Ns,{...r,ref:c,present:o})})});Se.displayName=ee;var Ns=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=a,l=X(ee,n),[u,g]=h.useState(r),b=h.useRef(null),j=ke(c,b),v=h.useRef(0),R=v.current,A=h.useRef(0),T=A.current,k=l.open||u,N=h.useRef(k),m=h.useRef(void 0);return h.useEffect(()=>{const p=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(p)},[]),es(()=>{const p=b.current;if(p){m.current=m.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const C=p.getBoundingClientRect();v.current=C.height,A.current=C.width,N.current||(p.style.transitionDuration=m.current.transitionDuration,p.style.animationName=m.current.animationName),g(r)}},[l.open,r]),e.jsx(B.div,{"data-state":se(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!k,...o,ref:j,style:{"--radix-collapsible-content-height":R?`${R}px`:void 0,"--radix-collapsible-content-width":T?`${T}px`:void 0,...a.style},children:k&&i})});function se(a){return a?"open":"closed"}var ks=we,Cs=Ae,ws=Se,w="Accordion",ys=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ae,As,Ss]=ss(w),[K]=Ne(w,[Ss,Ce]),te=Ce(),Pe=_.forwardRef((a,c)=>{const{type:n,...r}=a,i=r,o=r;return e.jsx(ae.Provider,{scope:a.__scopeAccordion,children:n==="multiple"?e.jsx(Es,{...o,ref:c}):e.jsx(Is,{...i,ref:c})})});Pe.displayName=w;var[Re,Ps]=K(w),[Ie,Rs]=K(w,{collapsible:!1}),Is=_.forwardRef((a,c)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...l}=a,[u,g]=Z({prop:n,defaultProp:r??"",onChange:i,caller:w});return e.jsx(Re,{scope:a.__scopeAccordion,value:_.useMemo(()=>u?[u]:[],[u]),onItemOpen:g,onItemClose:_.useCallback(()=>o&&g(""),[o,g]),children:e.jsx(Ie,{scope:a.__scopeAccordion,collapsible:o,children:e.jsx(Ee,{...l,ref:c})})})}),Es=_.forwardRef((a,c)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=a,[l,u]=Z({prop:n,defaultProp:r??[],onChange:i,caller:w}),g=_.useCallback(j=>u((v=[])=>[...v,j]),[u]),b=_.useCallback(j=>u((v=[])=>v.filter(R=>R!==j)),[u]);return e.jsx(Re,{scope:a.__scopeAccordion,value:l,onItemOpen:g,onItemClose:b,children:e.jsx(Ie,{scope:a.__scopeAccordion,collapsible:!0,children:e.jsx(Ee,{...o,ref:c})})})}),[Ts,G]=K(w),Ee=_.forwardRef((a,c)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...l}=a,u=_.useRef(null),g=ke(u,c),b=As(n),v=as(i)==="ltr",R=ve(a.onKeyDown,A=>{var F;if(!ys.includes(A.key))return;const T=A.target,k=b().filter(M=>{var x;return!((x=M.ref.current)!=null&&x.disabled)}),N=k.findIndex(M=>M.ref.current===T),m=k.length;if(N===-1)return;A.preventDefault();let p=N;const C=0,I=m-1,f=()=>{p=N+1,p>I&&(p=C)},E=()=>{p=N-1,p{const{__scopeAccordion:n,value:r,...i}=a,o=G(q,n),l=Ps(q,n),u=te(n),g=_e(),b=r&&l.value.includes(r)||!1,j=o.disabled||a.disabled;return e.jsx(Ms,{scope:n,open:b,disabled:j,triggerId:g,children:e.jsx(ks,{"data-orientation":o.orientation,"data-state":Fe(b),...u,...i,ref:c,disabled:j,open:b,onOpenChange:v=>{v?l.onItemOpen(r):l.onItemClose(r)}})})});Te.displayName=q;var Me="AccordionHeader",$e=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(Me,n);return e.jsx(B.h3,{"data-orientation":i.orientation,"data-state":Fe(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:c})});$e.displayName=Me;var Y="AccordionTrigger",Oe=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(Y,n),l=Rs(Y,n),u=te(n);return e.jsx(ae.ItemSlot,{scope:n,children:e.jsx(Cs,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...r,ref:c})})});Oe.displayName=Y;var De="AccordionContent",Be=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(De,n),l=te(n);return e.jsx(ws,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...r,ref:c,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...a.style}})});Be.displayName=De;function Fe(a){return a?"open":"closed"}var $s=Pe,Os=Te,Ds=$e,Le=Oe,He=Be;const Bs=$s,Ve=h.forwardRef(({className:a,...c},n)=>e.jsx(Os,{ref:n,className:J("border-b",a),...c}));Ve.displayName="AccordionItem";const Ue=h.forwardRef(({className:a,children:c,...n},r)=>e.jsx(Ds,{className:"flex",children:e.jsxs(Le,{ref:r,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[c,e.jsx(bs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Ue.displayName=Le.displayName;const qe=h.forwardRef(({className:a,children:c,...n},r)=>e.jsx(He,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:J("pb-4 pt-0",a),children:c})}));qe.displayName=He.displayName;const Fs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Ls=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",Q=3,Hs=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Vs=a=>[...a].sort((c,n)=>{const r=c.slug==="classic-language-modeling",i=n.slug==="classic-language-modeling";return r!==i?r?1:-1:0}),la=()=>{var de,pe,me,he,ue,xe;const{taskSlug:a}=ts(),c=ns(),[n,r]=rs(),i=Ls(n.get("order_by")),o=n.get("has_code")==="true",l=n.get("has_hf_artifacts")==="true",u=s=>{const t=new URLSearchParams(n);t.set("order_by",s),r(t)},g=s=>{const t=new URLSearchParams(n);s?t.set("has_code","true"):t.delete("has_code"),r(t)},b=s=>{const t=new URLSearchParams(n);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},[j,v]=h.useState(!1),[R,A]=h.useState(()=>new Set),{preferences:T}=os(),k=(s,t)=>{const d=s||"";return t?`/benchmark/${d}?task=${encodeURIComponent(t)}`:`/benchmark/${d}`},N=T.hide_closed_source_evals?!0:void 0,m=be({queryKey:["task-page",a,N],queryFn:()=>ge.getTaskPage(a,{is_open:N}),enabled:!!a,staleTime:10*60*1e3}),p=be({queryKey:["task-benchmark-trends",a,N],queryFn:()=>ge.getTrendingBenchmarks(a,{limit:100,min_recent_papers:0,is_open:N}),enabled:!!a,staleTime:10*60*1e3}),C=h.useMemo(()=>{var s;return Vs(((s=m.data)==null?void 0:s.children)||[])},[m.data]),I=h.useMemo(()=>{var t;const s=new Map;return(((t=m.data)==null?void 0:t.subtask_benchmarks)||[]).forEach(d=>{s.set(d.subtask_id,d.benchmarks||[])}),s},[m.data]),f=hs({taskId:((pe=(de=m.data)==null?void 0:de.task)==null?void 0:pe.id)||"",page_size:20,order_by:i,order_dir:"desc",include_resources:!0,has_code:o,has_hf_artifacts:l,enabled:!!((he=(me=m.data)==null?void 0:me.task)!=null&&he.id)}),E=h.useMemo(()=>{var t;return(((t=f.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(ms)},[f.data]),D=h.useMemo(()=>{var t;const s={};return(t=f.data)==null||t.pages.forEach(d=>d.results.forEach(O=>(O.methods||[]).forEach(S=>{const y=S.slug||S.id;s[y]||(s[y]={id:S.id,name:S.name,slug:S.slug||"",count:0}),s[y].count++}))),Object.values(s).sort((d,O)=>O.count-d.count).slice(0,8)},[f.data]),{targetRef:F,isIntersecting:M}=us({rootMargin:"200px"});if(h.useEffect(()=>{M&&f.hasNextPage&&!f.isFetchingNextPage&&f.fetchNextPage()},[M,f.hasNextPage,f.isFetchingNextPage]),m.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-4"}),e.jsx(U,{className:"h-6 w-1/3 mb-8"}),e.jsx(U,{className:"h-64 w-full"})]});if(m.error||!m.data)return e.jsx("div",{className:"page",children:e.jsx(xs,{variant:"destructive",children:e.jsx(gs,{children:"Task not found."})})});const x=m.data.task,ze=m.data.parents||[],L=V(x.name,x.slug),re=(m.data.sisters||[]).filter(s=>s.id!==x.id),oe=m.data.recommended_frameworks||[],H=m.data.benchmarks||[],Ke=new Map(H.map(s=>[s.id,s])),Ge=new Set(H.map(s=>s.id)),ce=(((ue=p.data)==null?void 0:ue.results)||[]).filter(s=>Ge.has(s.id)).map(s=>{const t=Ke.get(s.id);return{...s,best_model_name:(t==null?void 0:t.best_model_name)??s.best_model_name,best_paper_route:t==null?void 0:t.best_paper_route,best_paper_title:t==null?void 0:t.best_paper_title,best_code_url:t==null?void 0:t.best_code_url}}),$=ce.length?ce:H.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,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:[]})),ie=((xe=p.data)==null?void 0:xe.recent_days)||90,We=C.some(s=>(I.get(s.id)||[]).length>0),Qe=C.length>0,le=$.length>0,Ye=(()=>{const s=new Set;return H.forEach(t=>s.add(t.id)),I.forEach(t=>t.forEach(d=>s.add(d.id))),s.size})(),Ze=s=>{A(t=>{const d=new Set(t);return d.has(s)?d.delete(s):d.add(s),d})};return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(P,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(P,{to:"/tasks",children:"Tasks"}),[...ze].reverse().map(s=>e.jsxs(_.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(P,{to:`/tasks/${s.slug||s.id}`,children:V(s.name,s.slug)})]},s.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:x.name.toUpperCase()})]}),e.jsxs("div",{className:x.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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:L}),x.description&&e.jsx(W,{className:"task-explainer",text:x.description}),x.research_trends&&x.research_trends.length>0&&e.jsx(Bs,{className:"task-research-trends",type:"single",collapsible:!0,children:e.jsxs(Ve,{className:"task-research-trends-item",value:"key-trends",children:[e.jsx(Ue,{className:"task-research-trends-trigger",children:e.jsx("span",{className:"task-research-trends-title",children:"Key trends"})}),e.jsx(qe,{className:"task-research-trends-content",children:e.jsx("ul",{children:x.research_trends.map((s,t)=>e.jsx("li",{children:e.jsx(W,{text:s})},t))})})]})}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(x.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:Ye}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[D.length,"+"]}),"METHODS USED"]})]}),oe.length>0&&e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),oe.map(s=>{const t=s.owner&&s.name?`${s.owner}/${s.name}`:s.name||s.url.replace(/^https?:\/\/github\.com\//,"");return e.jsxs("a",{href:s.url,className:"task-framework-link",target:"_blank",rel:"noreferrer",children:[e.jsx(fe,{size:13,strokeWidth:1.8,"aria-hidden":"true"}),e.jsx("span",{children:t}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Hs(s.num_stars)]})]},s.id)})]})]}),x.image_url&&e.jsxs("figure",{className:`task-figure-card${x.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:cs(x.image_url)??void 0,alt:`${L} schematic`,onError:s=>{var t,d;(d=(t=s.currentTarget.parentElement)==null?void 0:t.parentElement)==null||d.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",L,x.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(W,{className:"task-image-credit",text:x.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[le&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[ie,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",$.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"})]}),(j?$:$.slice(0,5)).map(s=>e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ds,{history:s.history,benchmarkName:s.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:s.recent_paper_count})," ",s.recent_paper_count===1?"paper":"papers"," /"," ",ie,"d"]}),s.rate_change==null?s.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${s.rate_change>=1?"is-up":"is-down"}`,children:[s.rate_change>=1?"↑":"↓"," ",s.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(P,{className:"bench-row-name",to:k(s.slug||s.id,a),children:s.name}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:s.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:s.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(js,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:s.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:s.best_paper_route&&s.best_paper_title?e.jsx(P,{to:`/paper/${encodeURIComponent(s.best_paper_route)}`,children:s.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:s.best_code_url?e.jsx("a",{href:s.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${s.best_paper_title||s.best_model_name}`,children:e.jsx(fe,{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(P,{to:k(s.slug||s.id,a),"aria-label":`Compare ${s.best_model_name||"the best model"} with all results on ${s.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(fs,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s.id))]}),$.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(s=>!s),children:j?"− show top 5":`+ show ${$.length-5} more benchmarks`})]}),Qe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:le?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:We?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",C.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:C.map(s=>{const t=I.get(s.id)||[],d=R.has(s.id),O=d?t:t.slice(0,Q),S=t.length-Q;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(P,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:V(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:t.length>0?`[${t.length} benchmark${t.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),O.length>0?O.map((y,Je)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(k(y.slug||y.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(Je+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:y.name}),e.jsx("div",{className:"bench-row-sub",children:y.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:y.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},y.id)):e.jsxs(P,{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})]}),S>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Ze(s.id),children:d?`− show top ${Q}`:`+ show ${S} more benchmark${S===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:["[",(x.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:Fs.map(([s,t])=>e.jsx("button",{className:`sort-btn ${i===s?"active":""}`,onClick:()=>u(s),children:t},s))}),e.jsx(ps,{hasCode:o,hasHfArtifacts:l,onHasCodeChange:g,onHasHfArtifactsChange:b})]}),e.jsxs("div",{className:"results-count",children:[E.length," loaded in ",e.jsx("span",{children:L})]})]}),f.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,t)=>e.jsx(U,{className:"h-40 w-full"},t))}):E.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:E.map((s,t)=>e.jsx(is,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:F,style:{height:1}}),f.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[re.length>0&&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"}),re.slice(0,8).map(s=>e.jsxs(P,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:V(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),D.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"}),D.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(ls,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{la as default}; + */const js=je("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);var K="Collapsible",[_s,Ce]=Ne(K),[vs,X]=_s(K),we=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...u}=a,[g,b]=Z({prop:r,defaultProp:i??!1,onChange:l,caller:K});return e.jsx(vs,{scope:n,disabled:o,contentId:_e(),open:g,onOpenToggle:h.useCallback(()=>b(j=>!j),[b]),children:e.jsx(B.div,{"data-state":se(g),"data-disabled":o?"":void 0,...u,ref:c})})});we.displayName=K;var ye="CollapsibleTrigger",Ae=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,...r}=a,i=X(ye,n);return e.jsx(B.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":se(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:c,onClick:ve(a.onClick,i.onOpenToggle)})});Ae.displayName=ye;var ee="CollapsibleContent",Se=h.forwardRef((a,c)=>{const{forceMount:n,...r}=a,i=X(ee,a.__scopeCollapsible);return e.jsx(Xe,{present:n||i.open,children:({present:o})=>e.jsx(Ns,{...r,ref:c,present:o})})});Se.displayName=ee;var Ns=h.forwardRef((a,c)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=a,l=X(ee,n),[u,g]=h.useState(r),b=h.useRef(null),j=ke(c,b),v=h.useRef(0),R=v.current,A=h.useRef(0),T=A.current,k=l.open||u,N=h.useRef(k),m=h.useRef(void 0);return h.useEffect(()=>{const p=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(p)},[]),es(()=>{const p=b.current;if(p){m.current=m.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const C=p.getBoundingClientRect();v.current=C.height,A.current=C.width,N.current||(p.style.transitionDuration=m.current.transitionDuration,p.style.animationName=m.current.animationName),g(r)}},[l.open,r]),e.jsx(B.div,{"data-state":se(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!k,...o,ref:j,style:{"--radix-collapsible-content-height":R?`${R}px`:void 0,"--radix-collapsible-content-width":T?`${T}px`:void 0,...a.style},children:k&&i})});function se(a){return a?"open":"closed"}var ks=we,Cs=Ae,ws=Se,w="Accordion",ys=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ae,As,Ss]=ss(w),[q]=Ne(w,[Ss,Ce]),te=Ce(),Pe=_.forwardRef((a,c)=>{const{type:n,...r}=a,i=r,o=r;return e.jsx(ae.Provider,{scope:a.__scopeAccordion,children:n==="multiple"?e.jsx(Es,{...o,ref:c}):e.jsx(Is,{...i,ref:c})})});Pe.displayName=w;var[Re,Ps]=q(w),[Ie,Rs]=q(w,{collapsible:!1}),Is=_.forwardRef((a,c)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...l}=a,[u,g]=Z({prop:n,defaultProp:r??"",onChange:i,caller:w});return e.jsx(Re,{scope:a.__scopeAccordion,value:_.useMemo(()=>u?[u]:[],[u]),onItemOpen:g,onItemClose:_.useCallback(()=>o&&g(""),[o,g]),children:e.jsx(Ie,{scope:a.__scopeAccordion,collapsible:o,children:e.jsx(Ee,{...l,ref:c})})})}),Es=_.forwardRef((a,c)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=a,[l,u]=Z({prop:n,defaultProp:r??[],onChange:i,caller:w}),g=_.useCallback(j=>u((v=[])=>[...v,j]),[u]),b=_.useCallback(j=>u((v=[])=>v.filter(R=>R!==j)),[u]);return e.jsx(Re,{scope:a.__scopeAccordion,value:l,onItemOpen:g,onItemClose:b,children:e.jsx(Ie,{scope:a.__scopeAccordion,collapsible:!0,children:e.jsx(Ee,{...o,ref:c})})})}),[Ts,G]=q(w),Ee=_.forwardRef((a,c)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...l}=a,u=_.useRef(null),g=ke(u,c),b=As(n),v=as(i)==="ltr",R=ve(a.onKeyDown,A=>{var F;if(!ys.includes(A.key))return;const T=A.target,k=b().filter(M=>{var x;return!((x=M.ref.current)!=null&&x.disabled)}),N=k.findIndex(M=>M.ref.current===T),m=k.length;if(N===-1)return;A.preventDefault();let p=N;const C=0,I=m-1,f=()=>{p=N+1,p>I&&(p=C)},E=()=>{p=N-1,p{const{__scopeAccordion:n,value:r,...i}=a,o=G(z,n),l=Ps(z,n),u=te(n),g=_e(),b=r&&l.value.includes(r)||!1,j=o.disabled||a.disabled;return e.jsx(Ms,{scope:n,open:b,disabled:j,triggerId:g,children:e.jsx(ks,{"data-orientation":o.orientation,"data-state":Fe(b),...u,...i,ref:c,disabled:j,open:b,onOpenChange:v=>{v?l.onItemOpen(r):l.onItemClose(r)}})})});Te.displayName=z;var Me="AccordionHeader",$e=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(Me,n);return e.jsx(B.h3,{"data-orientation":i.orientation,"data-state":Fe(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:c})});$e.displayName=Me;var Y="AccordionTrigger",Oe=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(Y,n),l=Rs(Y,n),u=te(n);return e.jsx(ae.ItemSlot,{scope:n,children:e.jsx(Cs,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...r,ref:c})})});Oe.displayName=Y;var De="AccordionContent",Be=_.forwardRef((a,c)=>{const{__scopeAccordion:n,...r}=a,i=G(w,n),o=ne(De,n),l=te(n);return e.jsx(ws,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...r,ref:c,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...a.style}})});Be.displayName=De;function Fe(a){return a?"open":"closed"}var $s=Pe,Os=Te,Ds=$e,Le=Oe,He=Be;const Bs=$s,Ve=h.forwardRef(({className:a,...c},n)=>e.jsx(Os,{ref:n,className:J("border-b",a),...c}));Ve.displayName="AccordionItem";const Ue=h.forwardRef(({className:a,children:c,...n},r)=>e.jsx(Ds,{className:"flex",children:e.jsxs(Le,{ref:r,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[c,e.jsx(bs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Ue.displayName=Le.displayName;const ze=h.forwardRef(({className:a,children:c,...n},r)=>e.jsx(He,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:J("pb-4 pt-0",a),children:c})}));ze.displayName=He.displayName;const Fs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Ls=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",Q=3,Hs=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Vs=a=>[...a].sort((c,n)=>{const r=c.slug==="classic-language-modeling",i=n.slug==="classic-language-modeling";return r!==i?r?1:-1:0}),la=()=>{var de,pe,me,he,ue,xe;const{taskSlug:a}=ts(),c=ns(),[n,r]=rs(),i=Ls(n.get("order_by")),o=n.get("has_code")==="true",l=n.get("has_hf_artifacts")==="true",u=s=>{const t=new URLSearchParams(n);t.set("order_by",s),r(t)},g=s=>{const t=new URLSearchParams(n);s?t.set("has_code","true"):t.delete("has_code"),r(t)},b=s=>{const t=new URLSearchParams(n);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},[j,v]=h.useState(!1),[R,A]=h.useState(()=>new Set),{preferences:T}=os(),k=(s,t)=>{const d=s||"";return t?`/benchmark/${d}?task=${encodeURIComponent(t)}`:`/benchmark/${d}`},N=T.hide_closed_source_evals?!0:void 0,m=be({queryKey:["task-page",a,N],queryFn:()=>ge.getTaskPage(a,{is_open:N}),enabled:!!a,staleTime:10*60*1e3}),p=be({queryKey:["task-benchmark-trends",a,N],queryFn:()=>ge.getTrendingBenchmarks(a,{limit:100,min_recent_papers:0,is_open:N}),enabled:!!a,staleTime:10*60*1e3}),C=h.useMemo(()=>{var s;return Vs(((s=m.data)==null?void 0:s.children)||[])},[m.data]),I=h.useMemo(()=>{var t;const s=new Map;return(((t=m.data)==null?void 0:t.subtask_benchmarks)||[]).forEach(d=>{s.set(d.subtask_id,d.benchmarks||[])}),s},[m.data]),f=hs({taskId:((pe=(de=m.data)==null?void 0:de.task)==null?void 0:pe.id)||"",page_size:20,order_by:i,order_dir:"desc",include_resources:!0,has_code:o,has_hf_artifacts:l,enabled:!!((he=(me=m.data)==null?void 0:me.task)!=null&&he.id)}),E=h.useMemo(()=>{var t;return(((t=f.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(ms)},[f.data]),D=h.useMemo(()=>{var t;const s={};return(t=f.data)==null||t.pages.forEach(d=>d.results.forEach(O=>(O.methods||[]).forEach(S=>{const y=S.slug||S.id;s[y]||(s[y]={id:S.id,name:S.name,slug:S.slug||"",count:0}),s[y].count++}))),Object.values(s).sort((d,O)=>O.count-d.count).slice(0,8)},[f.data]),{targetRef:F,isIntersecting:M}=us({rootMargin:"200px"});if(h.useEffect(()=>{M&&f.hasNextPage&&!f.isFetchingNextPage&&f.fetchNextPage()},[M,f.hasNextPage,f.isFetchingNextPage]),m.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-4"}),e.jsx(U,{className:"h-6 w-1/3 mb-8"}),e.jsx(U,{className:"h-64 w-full"})]});if(m.error||!m.data)return e.jsx("div",{className:"page",children:e.jsx(xs,{variant:"destructive",children:e.jsx(gs,{children:"Task not found."})})});const x=m.data.task,Ke=m.data.parents||[],L=V(x.name,x.slug),re=(m.data.sisters||[]).filter(s=>s.id!==x.id),oe=m.data.recommended_frameworks||[],H=m.data.benchmarks||[],qe=new Map(H.map(s=>[s.id,s])),Ge=new Set(H.map(s=>s.id)),ce=(((ue=p.data)==null?void 0:ue.results)||[]).filter(s=>Ge.has(s.id)).map(s=>{const t=qe.get(s.id);return{...s,best_model_name:(t==null?void 0:t.best_model_name)??s.best_model_name,best_paper_route:t==null?void 0:t.best_paper_route,best_paper_title:t==null?void 0:t.best_paper_title,best_code_url:t==null?void 0:t.best_code_url}}),$=ce.length?ce:H.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,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:[]})),ie=((xe=p.data)==null?void 0:xe.recent_days)||90,We=C.some(s=>(I.get(s.id)||[]).length>0),Qe=C.length>0,le=$.length>0,Ye=(()=>{const s=new Set;return H.forEach(t=>s.add(t.id)),I.forEach(t=>t.forEach(d=>s.add(d.id))),s.size})(),Ze=s=>{A(t=>{const d=new Set(t);return d.has(s)?d.delete(s):d.add(s),d})};return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(P,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(P,{to:"/tasks",children:"Tasks"}),[...Ke].reverse().map(s=>e.jsxs(_.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(P,{to:`/tasks/${s.slug||s.id}`,children:V(s.name,s.slug)})]},s.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:x.name.toUpperCase()})]}),e.jsxs("div",{className:x.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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:L}),x.description&&e.jsx(W,{className:"task-explainer",text:x.description}),x.research_trends&&x.research_trends.length>0&&e.jsx(Bs,{className:"task-research-trends",type:"single",collapsible:!0,children:e.jsxs(Ve,{className:"task-research-trends-item",value:"key-trends",children:[e.jsx(Ue,{className:"task-research-trends-trigger",children:e.jsx("span",{className:"task-research-trends-title",children:"Key trends"})}),e.jsx(ze,{className:"task-research-trends-content",children:e.jsx("ul",{children:x.research_trends.map((s,t)=>e.jsx("li",{children:e.jsx(W,{text:s})},t))})})]})}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(x.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:Ye}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[D.length,"+"]}),"METHODS USED"]})]}),oe.length>0&&e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),oe.map(s=>{const t=s.owner&&s.name?`${s.owner}/${s.name}`:s.name||s.url.replace(/^https?:\/\/github\.com\//,"");return e.jsxs("a",{href:s.url,className:"task-framework-link",target:"_blank",rel:"noreferrer",children:[e.jsx(fe,{size:13,strokeWidth:1.8,"aria-hidden":"true"}),e.jsx("span",{children:t}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Hs(s.num_stars)]})]},s.id)})]})]}),x.image_url&&e.jsxs("figure",{className:`task-figure-card${x.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:cs(x.image_url)??void 0,alt:`${L} schematic`,onError:s=>{var t,d;(d=(t=s.currentTarget.parentElement)==null?void 0:t.parentElement)==null||d.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",L,x.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(W,{className:"task-image-credit",text:x.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[le&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[ie,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",$.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"})]}),(j?$:$.slice(0,5)).map(s=>e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ds,{history:s.history,benchmarkName:s.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:s.recent_paper_count})," ",s.recent_paper_count===1?"paper":"papers"," /"," ",ie,"d"]}),s.rate_change==null?s.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${s.rate_change>=1?"is-up":"is-down"}`,children:[s.rate_change>=1?"↑":"↓"," ",s.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(P,{className:"bench-row-name",to:k(s.slug||s.id,a),children:s.name}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:s.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:s.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(js,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:s.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:s.best_paper_route&&s.best_paper_title?e.jsx(P,{to:`/paper/${encodeURIComponent(s.best_paper_route)}`,children:s.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:s.best_code_url?e.jsx("a",{href:s.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${s.best_paper_title||s.best_model_name}`,children:e.jsx(fe,{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(P,{to:k(s.slug||s.id,a),"aria-label":`Compare ${s.best_model_name||"the best model"} with all results on ${s.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(fs,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s.id))]}),$.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(s=>!s),children:j?"− show top 5":`+ show ${$.length-5} more benchmarks`})]}),Qe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:le?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:We?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",C.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:C.map(s=>{const t=I.get(s.id)||[],d=R.has(s.id),O=d?t:t.slice(0,Q),S=t.length-Q;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(P,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:V(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:t.length>0?`[${t.length} benchmark${t.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),O.length>0?O.map((y,Je)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(k(y.slug||y.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(Je+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:y.name}),e.jsx("div",{className:"bench-row-sub",children:y.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:y.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},y.id)):e.jsxs(P,{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})]}),S>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Ze(s.id),children:d?`− show top ${Q}`:`+ show ${S} more benchmark${S===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:["[",(x.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:Fs.map(([s,t])=>e.jsx("button",{className:`sort-btn ${i===s?"active":""}`,onClick:()=>u(s),children:t},s))}),e.jsx(ps,{hasCode:o,hasHfArtifacts:l,onHasCodeChange:g,onHasHfArtifactsChange:b})]}),e.jsxs("div",{className:"results-count",children:[E.length," loaded in ",e.jsx("span",{children:L})]})]}),f.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,t)=>e.jsx(U,{className:"h-40 w-full"},t))}):E.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:E.map((s,t)=>e.jsx(is,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:F,style:{height:1}}),f.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[re.length>0&&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"}),re.slice(0,8).map(s=>e.jsxs(P,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:V(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),D.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"}),D.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(ls,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{la as default}; diff --git a/assets/TagsIndexView-DrP0WvYO.js b/assets/TagsIndexView--NNviBMX.js similarity index 82% rename from assets/TagsIndexView-DrP0WvYO.js rename to assets/TagsIndexView--NNviBMX.js index 213cdd2facf2303bdf6fa9ca1d68d7f5b69b46c8..3c4d7193b2b4ea066db935a8416240b306eee456 100644 --- a/assets/TagsIndexView-DrP0WvYO.js +++ b/assets/TagsIndexView--NNviBMX.js @@ -1 +1 @@ -import{r as d,j as e,L as p,b as h}from"./index-LWBjDGUR.js";import{u as g}from"./useQuery-CVb9j2D6.js";import{e as x,h as f,d as u}from"./transform-BSMO2egg.js";import{S as m}from"./skeleton-JE1BtvIJ.js";import{A as j,a as y}from"./alert-fokOob1I.js";import{T as k}from"./TaxonomySuggestionTile-BUN64GsM.js";import"./useBaseQuery-CSyvHxAw.js";import"./SignInToEditDialog-BeFxaoXp.js";import"./button-D2jk6ElT.js";import"./textarea-sAKp6aGF.js";import"./dialog-CUdQ6AzV.js";import"./useMutation-Cm0dU_OR.js";import"./loader-circle-C5GDD3qQ.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>h.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>s[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,t)=>s+t.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,t)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>e.jsx(m,{className:"h-24"},a))})]},t))}):o.map(s=>{const t=s.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return e.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),e.jsx(k,{kind:"task"})]})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{E as default}; +import{r as d,j as e,L as p,b as h}from"./index-DsjIhQkx.js";import{u as g}from"./useQuery-xOve4y-6.js";import{e as x,h as f,d as u}from"./transform-C1LieBU0.js";import{S as m}from"./skeleton-B1Kg5w0V.js";import{A as j,a as y}from"./alert-BThP2mep.js";import{T as k}from"./TaxonomySuggestionTile-CPUYdGFD.js";import"./useBaseQuery-D4kcdcVW.js";import"./SignInToEditDialog-DuAbhKyX.js";import"./button-CYp7VsNM.js";import"./textarea-BMnjM1hO.js";import"./dialog-BoPFX590.js";import"./useMutation-B-lCv88U.js";import"./loader-circle-DEdDfzjU.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>h.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>s[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,t)=>s+t.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,t)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>e.jsx(m,{className:"h-24"},a))})]},t))}):o.map(s=>{const t=s.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return e.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),e.jsx(k,{kind:"task"})]})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{E as default}; diff --git a/assets/TaxonomySuggestionTile-BUN64GsM.js b/assets/TaxonomySuggestionTile-CPUYdGFD.js similarity index 83% rename from assets/TaxonomySuggestionTile-BUN64GsM.js rename to assets/TaxonomySuggestionTile-CPUYdGFD.js index 7e2122418055ba9289fa5de889efc7d2f1c8cb81..1a2d51086e7d74ab8b428735e0f73deedd5fc023 100644 --- a/assets/TaxonomySuggestionTile-BUN64GsM.js +++ b/assets/TaxonomySuggestionTile-CPUYdGFD.js @@ -1 +1 @@ -import{f as u,r as o,j as e}from"./index-LWBjDGUR.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-BeFxaoXp.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!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(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T}; +import{f as u,r as o,j as e}from"./index-DsjIhQkx.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-DuAbhKyX.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!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(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T}; diff --git a/assets/TrendsView-BpNENNEr.js b/assets/TrendsView-CtkIaI1c.js similarity index 96% rename from assets/TrendsView-BpNENNEr.js rename to assets/TrendsView-CtkIaI1c.js index 2813dc7c104df5dc11e1114c6142150d5b962b02..89b8c0b2c81c5a9a248894fca82a89c57bb98ce0 100644 --- a/assets/TrendsView-BpNENNEr.js +++ b/assets/TrendsView-CtkIaI1c.js @@ -1 +1 @@ -import{b as X,R as G,j as e}from"./index-LWBjDGUR.js";import{u as J}from"./useQuery-CVb9j2D6.js";import{A as q,a as E}from"./alert-fokOob1I.js";import{S as P}from"./skeleton-JE1BtvIJ.js";import"./useBaseQuery-CSyvHxAw.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},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(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-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:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,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:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-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:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[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(i[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:r,display:"inline-block"}}),i[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:i.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)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ne=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,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(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{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:M,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:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ne as default}; +import{b as X,R as G,j as e}from"./index-DsjIhQkx.js";import{u as J}from"./useQuery-xOve4y-6.js";import{A as q,a as E}from"./alert-BThP2mep.js";import{S as P}from"./skeleton-B1Kg5w0V.js";import"./useBaseQuery-D4kcdcVW.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},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(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-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:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,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:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-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:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[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(i[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:r,display:"inline-block"}}),i[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:i.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)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ne=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,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(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{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:M,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:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ne as default}; diff --git a/assets/alert-BThP2mep.js b/assets/alert-BThP2mep.js new file mode 100644 index 0000000000000000000000000000000000000000..91311855a3775658641e676bd05c0bb835635eba --- /dev/null +++ b/assets/alert-BThP2mep.js @@ -0,0 +1 @@ +import{r as a,j as s,t as l,a6 as i}from"./index-DsjIhQkx.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:t,variant:e,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:e}),t),...r}));n.displayName="Alert";const v=a.forwardRef(({className:t,...e},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",t),...e}));v.displayName="AlertTitle";const c=a.forwardRef(({className:t,...e},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",t),...e}));c.displayName="AlertDescription";export{n as A,c as a}; diff --git a/assets/alert-fokOob1I.js b/assets/alert-fokOob1I.js deleted file mode 100644 index 463f33db74b1b80b34dd9492d40761fbbc428b34..0000000000000000000000000000000000000000 --- a/assets/alert-fokOob1I.js +++ /dev/null @@ -1 +0,0 @@ -import{r as a,j as s,s as l,a5 as i}from"./index-LWBjDGUR.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/button-D2jk6ElT.js b/assets/button-CYp7VsNM.js similarity index 89% rename from assets/button-D2jk6ElT.js rename to assets/button-CYp7VsNM.js index d8ea404bccd9d1e15b153dcbfde4c6ce2682bd56..342a914b48cf5652f775e4a4eac49e7e215a928f 100644 --- a/assets/button-D2jk6ElT.js +++ b/assets/button-CYp7VsNM.js @@ -1 +1 @@ -import{r as a,j as d,aJ as u,s as c,a5 as f}from"./index-LWBjDGUR.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,aK as u,t as c,a6 as f}from"./index-DsjIhQkx.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/chatSessions-gAEfkaKP.js b/assets/chatSessions-BX17B8vQ.js similarity index 99% rename from assets/chatSessions-gAEfkaKP.js rename to assets/chatSessions-BX17B8vQ.js index f19389b7445a1434c9cd9082ce4f400bc88df2b4..b4c5b8ad5755ee55f4206753256166234a352dda 100644 --- a/assets/chatSessions-gAEfkaKP.js +++ b/assets/chatSessions-BX17B8vQ.js @@ -1 +1 @@ -import{j as o,d as f}from"./index-LWBjDGUR.js";const w=({light:s})=>o.jsx("span",{className:`chat-spinner${s?" chat-spinner-light":""}`}),_=({open:s})=>o.jsx("svg",{className:`chat-chev${s?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"m6 9 6 6 6-6"})}),S=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]}),y=({size:s=14})=>o.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),j=()=>o.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:o.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),C=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M12 5v14M5 12h14"})}),T=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),o.jsx("path",{d:"M9 4v16"})]}),b=()=>o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.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"})}),k=({models:s,selectedModel:t,onModelChange:e,disabled:r})=>{var u;const n=((u=s.find(a=>a.id===t))==null?void 0:u.label)??`${t} (unavailable)`,i=Math.min(Math.max(n.length+5,12),32);return o.jsxs("select",{className:"chat-model-select",style:{width:`${i}ch`},value:t,disabled:r,onChange:a=>e(a.target.value),"aria-label":"Research model",children:[!s.some(a=>a.id===t)&&o.jsx("option",{value:t,disabled:!0,children:n}),s.map(a=>o.jsx("option",{value:a.id,children:a.label},a.id))]})},p="pwc:chat-oauth-draft",l="pwc:chat-oauth-model",h="pwc:chat-oauth-auto-send";function I(s,t,e={}){const r=s.trim();r&&(sessionStorage.setItem(p,r),e.autoSend===!1?sessionStorage.removeItem(h):sessionStorage.setItem(h,"1"),t?sessionStorage.setItem(l,t):sessionStorage.removeItem(l))}function M(){var t;if(typeof window>"u"||sessionStorage.getItem(h)!=="1")return null;const s=(t=sessionStorage.getItem(p))==null?void 0:t.trim();return s?{prompt:s,model:sessionStorage.getItem(l)}:null}function D(){sessionStorage.removeItem(p),sessionStorage.removeItem(l),sessionStorage.removeItem(h)}const v="google/gemma-4-31B-it",E=[{id:v,label:"Gemma 4 31B",provider:"huggingface"},{id:"zai-org/GLM-5.2",label:"GLM 5.2",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"}];async function c(s,t){const e=await fetch(f(s),{credentials:"include",headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t});if(!e.ok){const r=await e.json().catch(()=>null),n=r==null?void 0:r.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${e.status})`)}return e.status===204?void 0:e.json()}class g extends Error{constructor(t,e){super(t),this.status=e}}async function m(s){const t=await fetch(f(s),{headers:{Accept:"application/json"}});if(!t.ok){const e=await t.json().catch(()=>null),r=e==null?void 0:e.detail;throw new g((r==null?void 0:r.message)||r||`Shared conversation request failed (${t.status})`,t.status)}return t.json()}async function $(){const s=[];let t=null;do{const e=new URLSearchParams({limit:"50"});t&&e.set("cursor",t);const r=await c(`/api/v1/chat/sessions?${e.toString()}`);s.push(...r.items),t=r.next_cursor}while(t&&s.length<100);return s}function A(s){return c(`/api/v1/chat/sessions/${s}`)}function L(s,t){return c(`/api/v1/chat/sessions/${s}`,{method:"PATCH",body:JSON.stringify(t)})}function q(s){return c(`/api/v1/chat/sessions/${s}`,{method:"DELETE"})}function O(){return c("/api/v1/chat/sessions/archive-old",{method:"POST"})}function P(s){return c(`/api/v1/chat/sessions/${s}/cancel`,{method:"POST"})}function R(s){return c(`/api/v1/chat/sessions/${s}/share`,{method:"POST"})}function B(s){return m(`/api/v1/chat/shares/${encodeURIComponent(s)}`)}async function H(){return c("/api/v1/chat/models")}function d(s,t){const e=s.map(r=>r.kind==="reasoning"?{...r,active:!1,open:!1}:r.kind==="tool"?{...r,status:r.status==="running"?"error":r.status,open:t&&(r.status==="error"||r.status==="denied"||r.status==="running")}:{...r,done:!0});return e.filter((r,n)=>{const i=e[n-1];return!(r.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&r.text===i.text)})}function K(s){const t=e=>e==="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.":e==="hf_inference_credential_expired"?"Your Hugging Face authorization expired. Reconnect in Settings.":e==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":e==="provider_timeout"?"The model provider timed out. Try again shortly.":["provider_error","provider_unavailable"].includes(e??"")?"The model provider failed before completing the response. You can edit and retry your question.":e==="persistence_error"?"The response could not be saved. You can edit and retry your question.":e==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return s.messages.flatMap(e=>{if(e.role==="assistant")return[{id:e.id,role:"assistant",blocks:d(e.display_blocks,!0),followups:e.followups,citations:e.citations,finishReason:e.finish_reason??void 0,streaming:!1}];const r={id:e.id,role:"user",text:e.content,revision:e.revision,status:e.status,error:e.status==="complete"?void 0:e.error_code||e.status};if(!["error","interrupted"].includes(e.status))return[r];const n=e.status==="interrupted";return[r,{id:`${e.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:d(e.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:t(e.error_code),errorCode:n?void 0:e.error_code??void 0}]})}function U(s){return s.messages.map(t=>t.role==="user"?{id:t.id,role:"user",text:t.content}:{id:t.id,role:"assistant",blocks:d(t.display_blocks,!1),citations:t.citations,finishReason:t.finish_reason??void 0,error:t.error??void 0,streaming:!1})}function Y(s){const t=Date.now(),e=new Date().setHours(0,0,0,0),r=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...s].sort((i,u)=>Date.parse(u.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(n.updated_at),u=t-i;i>=e?r[0].items.push(n):u<7*864e5?r[1].items.push(n):u<30*864e5?r[2].items.push(n):r[3].items.push(n)}return r.filter(n=>n.items.length>0)}export{j as A,p as C,v as D,E as F,k as M,C as P,w as S,b as T,l as a,h as b,P as c,D as d,H as e,T as f,A as g,Y as h,q as i,R as j,O as k,$ as l,g as m,B as n,S as o,U as p,I as q,M as r,_ as s,K as t,L as u,y as v}; +import{j as o,d as f}from"./index-DsjIhQkx.js";const w=({light:s})=>o.jsx("span",{className:`chat-spinner${s?" chat-spinner-light":""}`}),_=({open:s})=>o.jsx("svg",{className:`chat-chev${s?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"m6 9 6 6 6-6"})}),S=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]}),y=({size:s=14})=>o.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),j=()=>o.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:o.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),C=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M12 5v14M5 12h14"})}),T=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),o.jsx("path",{d:"M9 4v16"})]}),b=()=>o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.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"})}),k=({models:s,selectedModel:t,onModelChange:e,disabled:r})=>{var u;const n=((u=s.find(a=>a.id===t))==null?void 0:u.label)??`${t} (unavailable)`,i=Math.min(Math.max(n.length+5,12),32);return o.jsxs("select",{className:"chat-model-select",style:{width:`${i}ch`},value:t,disabled:r,onChange:a=>e(a.target.value),"aria-label":"Research model",children:[!s.some(a=>a.id===t)&&o.jsx("option",{value:t,disabled:!0,children:n}),s.map(a=>o.jsx("option",{value:a.id,children:a.label},a.id))]})},p="pwc:chat-oauth-draft",l="pwc:chat-oauth-model",h="pwc:chat-oauth-auto-send";function I(s,t,e={}){const r=s.trim();r&&(sessionStorage.setItem(p,r),e.autoSend===!1?sessionStorage.removeItem(h):sessionStorage.setItem(h,"1"),t?sessionStorage.setItem(l,t):sessionStorage.removeItem(l))}function M(){var t;if(typeof window>"u"||sessionStorage.getItem(h)!=="1")return null;const s=(t=sessionStorage.getItem(p))==null?void 0:t.trim();return s?{prompt:s,model:sessionStorage.getItem(l)}:null}function D(){sessionStorage.removeItem(p),sessionStorage.removeItem(l),sessionStorage.removeItem(h)}const v="google/gemma-4-31B-it",E=[{id:v,label:"Gemma 4 31B",provider:"huggingface"},{id:"zai-org/GLM-5.2",label:"GLM 5.2",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"}];async function c(s,t){const e=await fetch(f(s),{credentials:"include",headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t});if(!e.ok){const r=await e.json().catch(()=>null),n=r==null?void 0:r.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${e.status})`)}return e.status===204?void 0:e.json()}class g extends Error{constructor(t,e){super(t),this.status=e}}async function m(s){const t=await fetch(f(s),{headers:{Accept:"application/json"}});if(!t.ok){const e=await t.json().catch(()=>null),r=e==null?void 0:e.detail;throw new g((r==null?void 0:r.message)||r||`Shared conversation request failed (${t.status})`,t.status)}return t.json()}async function $(){const s=[];let t=null;do{const e=new URLSearchParams({limit:"50"});t&&e.set("cursor",t);const r=await c(`/api/v1/chat/sessions?${e.toString()}`);s.push(...r.items),t=r.next_cursor}while(t&&s.length<100);return s}function A(s){return c(`/api/v1/chat/sessions/${s}`)}function L(s,t){return c(`/api/v1/chat/sessions/${s}`,{method:"PATCH",body:JSON.stringify(t)})}function q(s){return c(`/api/v1/chat/sessions/${s}`,{method:"DELETE"})}function O(){return c("/api/v1/chat/sessions/archive-old",{method:"POST"})}function P(s){return c(`/api/v1/chat/sessions/${s}/cancel`,{method:"POST"})}function R(s){return c(`/api/v1/chat/sessions/${s}/share`,{method:"POST"})}function B(s){return m(`/api/v1/chat/shares/${encodeURIComponent(s)}`)}async function H(){return c("/api/v1/chat/models")}function d(s,t){const e=s.map(r=>r.kind==="reasoning"?{...r,active:!1,open:!1}:r.kind==="tool"?{...r,status:r.status==="running"?"error":r.status,open:t&&(r.status==="error"||r.status==="denied"||r.status==="running")}:{...r,done:!0});return e.filter((r,n)=>{const i=e[n-1];return!(r.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&r.text===i.text)})}function K(s){const t=e=>e==="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.":e==="hf_inference_credential_expired"?"Your Hugging Face authorization expired. Reconnect in Settings.":e==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":e==="provider_timeout"?"The model provider timed out. Try again shortly.":["provider_error","provider_unavailable"].includes(e??"")?"The model provider failed before completing the response. You can edit and retry your question.":e==="persistence_error"?"The response could not be saved. You can edit and retry your question.":e==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return s.messages.flatMap(e=>{if(e.role==="assistant")return[{id:e.id,role:"assistant",blocks:d(e.display_blocks,!0),followups:e.followups,citations:e.citations,finishReason:e.finish_reason??void 0,streaming:!1}];const r={id:e.id,role:"user",text:e.content,revision:e.revision,status:e.status,error:e.status==="complete"?void 0:e.error_code||e.status};if(!["error","interrupted"].includes(e.status))return[r];const n=e.status==="interrupted";return[r,{id:`${e.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:d(e.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:t(e.error_code),errorCode:n?void 0:e.error_code??void 0}]})}function U(s){return s.messages.map(t=>t.role==="user"?{id:t.id,role:"user",text:t.content}:{id:t.id,role:"assistant",blocks:d(t.display_blocks,!1),citations:t.citations,finishReason:t.finish_reason??void 0,error:t.error??void 0,streaming:!1})}function Y(s){const t=Date.now(),e=new Date().setHours(0,0,0,0),r=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...s].sort((i,u)=>Date.parse(u.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(n.updated_at),u=t-i;i>=e?r[0].items.push(n):u<7*864e5?r[1].items.push(n):u<30*864e5?r[2].items.push(n):r[3].items.push(n)}return r.filter(n=>n.items.length>0)}export{j as A,p as C,v as D,E as F,k as M,C as P,w as S,b as T,l as a,h as b,P as c,D as d,H as e,T as f,A as g,Y as h,q as i,R as j,O as k,$ as l,g as m,B as n,S as o,U as p,I as q,M as r,_ as s,K as t,L as u,y as v}; diff --git a/assets/chevron-down-YxmRXwt0.js b/assets/chevron-down-CBbOvtCm.js similarity index 85% rename from assets/chevron-down-YxmRXwt0.js rename to assets/chevron-down-CBbOvtCm.js index f5e20d99116239dab3d10c1e2369af729aa5f3d4..c1a18d6c5ad81ae9a2fa0964772dcb021f998dce 100644 --- a/assets/chevron-down-YxmRXwt0.js +++ b/assets/chevron-down-CBbOvtCm.js @@ -1,4 +1,4 @@ -import{c as o}from"./index-LWBjDGUR.js";/** +import{c as o}from"./index-DsjIhQkx.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codexAddEvals-DUvovZgS.js b/assets/codexAddEvals-D6PHbQ5d.js similarity index 97% rename from assets/codexAddEvals-DUvovZgS.js rename to assets/codexAddEvals-D6PHbQ5d.js index 98e1a16525bfc6fb3acd27581bd7645aed22a7a1..6eeba79478fc4411dea6d432ee956dd63e785b85 100644 --- a/assets/codexAddEvals-DUvovZgS.js +++ b/assets/codexAddEvals-D6PHbQ5d.js @@ -1,4 +1,4 @@ -import{c as o,j as i,s as c,a5 as d,d as n}from"./index-LWBjDGUR.js";/** +import{c as o,j as i,t as c,a6 as d,d as n}from"./index-DsjIhQkx.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/components-DaxA6Lf7.js b/assets/components-DbYcrD0u.js similarity index 98% rename from assets/components-DaxA6Lf7.js rename to assets/components-DbYcrD0u.js index 06e10b56410fd25575f63491bde0baea89778e6d..d95df7992caa4e97de967a23e4a9a6d0f076fc2f 100644 --- a/assets/components-DaxA6Lf7.js +++ b/assets/components-DbYcrD0u.js @@ -1 +1 @@ -import{t as R,R as g,b as T,j as e,L,u as w}from"./index-LWBjDGUR.js";import{L as E,a as z}from"./LatexTitle-CB-vNeWW.js";import{h as P,d as Z,f as B,e as H}from"./transform-BSMO2egg.js";const D=({slug:t,label:s,onClick:r})=>{const l=w(),x=P(t),o=H(x),h=i=>{if(i.stopPropagation(),r){r(t);return}l(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),Z(s||B(t),t)]})},G=({method:t,onClick:s})=>{const r=w(),l=t.slug||t.id||"";if(!l)return null;const x=o=>{if(o.stopPropagation(),s){s(l);return}r(`/methods/${l}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},N={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=g.useRef(null),l=g.useRef(null),[x,o]=g.useState(t.length);if(g.useLayoutEffect(()=>{const n=r.current,a=l.current;if(!n||!a||t.length===0)return;const m=f=>(a.textContent=f,a.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let c=0,d=0;for(const C of t){const p=m(C.measureText);if(c+p<=f)c+=p,d+=1;else break}if(d0&&c+m(` · +${t.length-d} more`)>f;)d-=1,c-=m(t[d].measureText);d===0&&(d=1)}o(d)};M();const u=new ResizeObserver(M);return u.observe(n),()=>u.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:l,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,a)=>e.jsxs(g.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[a>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[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:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${a}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const l=g.useMemo(()=>{const o=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(a=>a.rank===i);n.forEach((a,m)=>{const M=m===0,u=M?`${h?"":" · "}${N[i]} on `:", ";o.push({name:a.name,slug:a.slug,rank:i,isGroupStart:M,measureText:u+a.name})}),n.length>0&&(h=!1)}return o},[t]),x=g.useMemo(()=>[1,2,3].map(o=>t.filter(i=>i.rank===o).map((i,n)=>({name:i.name,slug:i.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${N[o]} on `:", ")+i.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):l.length===0?null:e.jsx(F,{units:l,paperHref:s})},O=({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]})},U=({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"})]}),K=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)},_=({paperId:t})=>{const s=K(t),r=160,l=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let k=0;k.3,a=Math.floor(s()*3),m=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:c+(r-c*2)*(1-k)/2,y:S+v*2.4,width:(r-c*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-o)/2,y:W,width:(r-c*2)*o,height:.9,fill:u,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:A,width:6,height:1,fill:f,opacity:.6}),h.map((k,v)=>{const y=j+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:C,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:j,width:d,height:14,fill:"#F0EBE0",stroke:u,strokeWidth:.3,opacity:.9}),a===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${j+11} ${p+6},${j+8} ${p+10},${j+9} ${p+14},${j+5} ${p+18},${j+6} ${p+22},${j+3}`})}),a===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:p+2,y:j+11,width:d-4,height:1.5,fill:u})]}),a===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:j+5,width:d-6,height:1,fill:f}),e.jsx("rect",{x:p+6,y:j+8,width:d-12,height:.8,fill:f})]})]}),m.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:p,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`r${v}`)})]})})},V=({paperId:t,title:s,thumbnailUrl:r,priority:l=!1})=>{const[x,o]=g.useState(!1),[h,i]=g.useState(0),[n,a]=g.useState(l),m=g.useRef(null);g.useEffect(()=>{o(!1),i(0)},[r]);const M=g.useMemo(()=>{if(!r)return null;if(h===0)return r;const u=r.includes("?")?"&":"?";return`${r}${u}retry=${h}`},[r,h]);return g.useEffect(()=>{if(l||n)return;const u=m.current;if(!u)return;const f=new IntersectionObserver(([c])=>{c.isIntersecting&&(a(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(u),()=>f.disconnect()},[l,n]),r&&!x?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(l||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:l?"eager":"lazy",decoding:"async",fetchPriority:l?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(u=>u+1);return}o(!0)}},M)}):e.jsx(_,{paperId:t})},q="language-modeling";function $(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Y(t){return $(t.slug)==="large language model"||$(t.name)==="large language model"}function Q(t){return t.tags.includes(q)?t.methods.filter(s=>!Y(s)):t.methods}const se=({paper:t,rank:s,onClickTag:r})=>{const l=R(),x=`/paper/${t.id}`,o=g.useCallback(()=>{l.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>T.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,l]),h=t.authors.slice(0,3).join(", "),i=t.authors.length,n=Q(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:x,className:"paper-thumb-wrap",onFocus:o,onMouseEnter:o,children:e.jsx(V,{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:[e.jsx("h3",{className:"paper-title",children:e.jsx(L,{to:x,onFocus:o,onMouseEnter:o,children:e.jsx(E,{title:t.title})})}),e.jsxs("div",{className:"paper-authors",children:[h,i>3&&e.jsxs("span",{children:[", ","+",i-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[i>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[i>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})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:x}),(t.tags.length>0||n.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(a=>e.jsx(D,{slug:a,onClick:r},a)),n.map(a=>e.jsx(G,{method:a},a.id||a.slug||a.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[t.githubUrl&&e.jsxs("a",{className:"paper-resource is-link",href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:a=>a.stopPropagation(),children:[e.jsx(O,{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:"↑"}),J(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),t.hfUrl&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:t.hfUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:a=>a.stopPropagation(),children:[e.jsx(U,{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 J(t){return t.toFixed(1)}export{O as I,G as M,se as P,I as S,D as T,V as a}; +import{v as R,R as g,b as T,j as e,L,u as w}from"./index-DsjIhQkx.js";import{L as E,a as z}from"./LatexTitle-DA7SEiSe.js";import{h as P,d as Z,f as B,e as H}from"./transform-C1LieBU0.js";const D=({slug:t,label:s,onClick:r})=>{const l=w(),x=P(t),o=H(x),h=i=>{if(i.stopPropagation(),r){r(t);return}l(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),Z(s||B(t),t)]})},G=({method:t,onClick:s})=>{const r=w(),l=t.slug||t.id||"";if(!l)return null;const x=o=>{if(o.stopPropagation(),s){s(l);return}r(`/methods/${l}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},N={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=g.useRef(null),l=g.useRef(null),[x,o]=g.useState(t.length);if(g.useLayoutEffect(()=>{const n=r.current,a=l.current;if(!n||!a||t.length===0)return;const m=f=>(a.textContent=f,a.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let c=0,d=0;for(const C of t){const p=m(C.measureText);if(c+p<=f)c+=p,d+=1;else break}if(d0&&c+m(` · +${t.length-d} more`)>f;)d-=1,c-=m(t[d].measureText);d===0&&(d=1)}o(d)};M();const u=new ResizeObserver(M);return u.observe(n),()=>u.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:l,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,a)=>e.jsxs(g.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[a>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[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:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${a}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const l=g.useMemo(()=>{const o=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(a=>a.rank===i);n.forEach((a,m)=>{const M=m===0,u=M?`${h?"":" · "}${N[i]} on `:", ";o.push({name:a.name,slug:a.slug,rank:i,isGroupStart:M,measureText:u+a.name})}),n.length>0&&(h=!1)}return o},[t]),x=g.useMemo(()=>[1,2,3].map(o=>t.filter(i=>i.rank===o).map((i,n)=>({name:i.name,slug:i.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${N[o]} on `:", ")+i.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):l.length===0?null:e.jsx(F,{units:l,paperHref:s})},O=({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]})},U=({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"})]}),K=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)},_=({paperId:t})=>{const s=K(t),r=160,l=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let k=0;k.3,a=Math.floor(s()*3),m=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:c+(r-c*2)*(1-k)/2,y:S+v*2.4,width:(r-c*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-o)/2,y:W,width:(r-c*2)*o,height:.9,fill:u,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:A,width:6,height:1,fill:f,opacity:.6}),h.map((k,v)=>{const y=j+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:C,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:j,width:d,height:14,fill:"#F0EBE0",stroke:u,strokeWidth:.3,opacity:.9}),a===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${j+11} ${p+6},${j+8} ${p+10},${j+9} ${p+14},${j+5} ${p+18},${j+6} ${p+22},${j+3}`})}),a===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:p+2,y:j+11,width:d-4,height:1.5,fill:u})]}),a===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:j+5,width:d-6,height:1,fill:f}),e.jsx("rect",{x:p+6,y:j+8,width:d-12,height:.8,fill:f})]})]}),m.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:p,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`r${v}`)})]})})},V=({paperId:t,title:s,thumbnailUrl:r,priority:l=!1})=>{const[x,o]=g.useState(!1),[h,i]=g.useState(0),[n,a]=g.useState(l),m=g.useRef(null);g.useEffect(()=>{o(!1),i(0)},[r]);const M=g.useMemo(()=>{if(!r)return null;if(h===0)return r;const u=r.includes("?")?"&":"?";return`${r}${u}retry=${h}`},[r,h]);return g.useEffect(()=>{if(l||n)return;const u=m.current;if(!u)return;const f=new IntersectionObserver(([c])=>{c.isIntersecting&&(a(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(u),()=>f.disconnect()},[l,n]),r&&!x?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(l||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:l?"eager":"lazy",decoding:"async",fetchPriority:l?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(u=>u+1);return}o(!0)}},M)}):e.jsx(_,{paperId:t})},q="language-modeling";function $(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Y(t){return $(t.slug)==="large language model"||$(t.name)==="large language model"}function Q(t){return t.tags.includes(q)?t.methods.filter(s=>!Y(s)):t.methods}const se=({paper:t,rank:s,onClickTag:r})=>{const l=R(),x=`/paper/${t.id}`,o=g.useCallback(()=>{l.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>T.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,l]),h=t.authors.slice(0,3).join(", "),i=t.authors.length,n=Q(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:x,className:"paper-thumb-wrap",onFocus:o,onMouseEnter:o,children:e.jsx(V,{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:[e.jsx("h3",{className:"paper-title",children:e.jsx(L,{to:x,onFocus:o,onMouseEnter:o,children:e.jsx(E,{title:t.title})})}),e.jsxs("div",{className:"paper-authors",children:[h,i>3&&e.jsxs("span",{children:[", ","+",i-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[i>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[i>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})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:x}),(t.tags.length>0||n.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(a=>e.jsx(D,{slug:a,onClick:r},a)),n.map(a=>e.jsx(G,{method:a},a.id||a.slug||a.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[t.githubUrl&&e.jsxs("a",{className:"paper-resource is-link",href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:a=>a.stopPropagation(),children:[e.jsx(O,{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:"↑"}),J(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),t.hfUrl&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:t.hfUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:a=>a.stopPropagation(),children:[e.jsx(U,{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 J(t){return t.toFixed(1)}export{O as I,G as M,se as P,I as S,D as T,V as a}; diff --git a/assets/dialog-CUdQ6AzV.js b/assets/dialog-BoPFX590.js similarity index 88% rename from assets/dialog-CUdQ6AzV.js rename to assets/dialog-BoPFX590.js index 1bc3de2085a2bbf5e69f34fd01ad437caefb4d72..b354ccd0dc0df2a84cce5c90bb6cfa75ed0636a8 100644 --- a/assets/dialog-CUdQ6AzV.js +++ b/assets/dialog-BoPFX590.js @@ -1,5 +1,5 @@ -import{r as s,j as i,a7 as Z,m as K,a1 as R,P as N,ab as U,l as D,o as x,q as X,n as h,ac as Y,ad as J,ae as Q,af as ee,ag as te,aj as oe,X as ne,s as p}from"./index-LWBjDGUR.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?Z(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=X(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=K({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};P.displayName=C;var O="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(O,o),r=h(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=O;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),w=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:n}=e,r=f(E,t);return i.jsx(fe,{scope:t,forceMount:o,children:s.Children.map(a,l=>i.jsx(N,{present:o||r.open,children:i.jsx(U,{asChild:!0,container:n,children:l})}))})};w.displayName=E;var y="DialogOverlay",A=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(N,{present:a||r.open,children:i.jsx(pe,{...n,ref:t})}):null});A.displayName=y;var ge=ae("DialogOverlay.RemoveScroll"),pe=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(y,o);return i.jsx(J,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(N,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=h(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return Y(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=h(t,d);return Q(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",F=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});F.displayName=_;var M="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(M,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=M;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. +import{r as s,j as i,a8 as q,n as K,a2 as R,P as h,ac as U,m as D,p as x,s as X,o as N,ad as Y,ae as J,af as Q,ag as ee,ah as te,ak as oe,X as ne,t as p}from"./index-DsjIhQkx.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?q(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=X(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=K({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};P.displayName=C;var O="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(O,o),r=N(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=O;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),w=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:n}=e,r=f(E,t);return i.jsx(fe,{scope:t,forceMount:o,children:s.Children.map(a,l=>i.jsx(h,{present:o||r.open,children:i.jsx(U,{asChild:!0,container:n,children:l})}))})};w.displayName=E;var y="DialogOverlay",A=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(h,{present:a||r.open,children:i.jsx(pe,{...n,ref:t})}):null});A.displayName=y;var ge=ae("DialogOverlay.RemoveScroll"),pe=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(y,o);return i.jsx(J,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(h,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=N(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return Y(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=N(t,d);return Q(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",F=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});F.displayName=_;var M="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(M,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=M;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},ve="DialogDescriptionWarning",ye=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ve).contentName}}.`;return s.useEffect(()=>{var r;const n=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Ce=P,Re=w,V=A,H=T,B=F,z=W,Ne=k;const we=Ce,he=Re,q=s.forwardRef(({className:e,...t},o)=>i.jsx(V,{ref:o,className:p("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",e),...t}));q.displayName=V.displayName;const Ee=s.forwardRef(({className:e,children:t,...o},a)=>i.jsxs(he,{children:[i.jsx(q,{}),i.jsxs(H,{ref:a,className:p("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",e),...o,children:[t,i.jsxs(Ne,{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:[i.jsx(ne,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ee.displayName=H.displayName;const _e=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_e.displayName="DialogHeader";const je=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});je.displayName="DialogFooter";const be=s.forwardRef(({className:e,...t},o)=>i.jsx(B,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));be.displayName=B.displayName;const Pe=s.forwardRef(({className:e,...t},o)=>i.jsx(z,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));Pe.displayName=z.displayName;export{H as C,we as D,V as O,Re as P,Ce as R,Ee as a,_e as b,be as c,Pe as d,je as e}; +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},ve="DialogDescriptionWarning",ye=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ve).contentName}}.`;return s.useEffect(()=>{var r;const n=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Ce=P,Re=w,V=A,H=T,B=F,z=W,he=k;const we=Ce,Ne=Re,Z=s.forwardRef(({className:e,...t},o)=>i.jsx(V,{ref:o,className:p("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",e),...t}));Z.displayName=V.displayName;const Ee=s.forwardRef(({className:e,children:t,...o},a)=>i.jsxs(Ne,{children:[i.jsx(Z,{}),i.jsxs(H,{ref:a,className:p("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",e),...o,children:[t,i.jsxs(he,{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:[i.jsx(ne,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ee.displayName=H.displayName;const _e=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_e.displayName="DialogHeader";const je=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});je.displayName="DialogFooter";const be=s.forwardRef(({className:e,...t},o)=>i.jsx(B,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));be.displayName=B.displayName;const Pe=s.forwardRef(({className:e,...t},o)=>i.jsx(z,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));Pe.displayName=z.displayName;export{H as C,we as D,V as O,Re as P,Ce as R,Ee as a,_e as b,be as c,Pe as d,je as e}; diff --git a/assets/external-link-BPkSuoMQ.js b/assets/external-link-CG866OfT.js similarity index 89% rename from assets/external-link-BPkSuoMQ.js rename to assets/external-link-CG866OfT.js index 3565f83fc316271cdab566a7e76e8f50a80867d4..3177757c4196300e724215d8557bf23339e7a4ca 100644 --- a/assets/external-link-BPkSuoMQ.js +++ b/assets/external-link-CG866OfT.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-LWBjDGUR.js";/** +import{c as a}from"./index-DsjIhQkx.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-B_khJHHj.js b/assets/github-Yx3jwWKl.js similarity index 93% rename from assets/github-B_khJHHj.js rename to assets/github-Yx3jwWKl.js index c725b66f595d2886a1e44afb79e565bb6da4be79..83cde99e20bebeb98e5b7f65680cba212ebaeedd 100644 --- a/assets/github-B_khJHHj.js +++ b/assets/github-Yx3jwWKl.js @@ -1,4 +1,4 @@ -import{c}from"./index-LWBjDGUR.js";/** +import{c}from"./index-DsjIhQkx.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-BYeJ4GbN.js b/assets/hover-card-DWx_NdIh.js similarity index 67% rename from assets/hover-card-BYeJ4GbN.js rename to assets/hover-card-DWx_NdIh.js index a88fdec0cf8489d6bc42949cd27d1842b4526183..c5d50bb7ec2b75e583ac3c5f2a729b75b0a1198c 100644 --- a/assets/hover-card-BYeJ4GbN.js +++ b/assets/hover-card-DWx_NdIh.js @@ -1 +1 @@ -import{r as n,m as k,j as i,a8 as F,a9 as I,l as U,o as l,aa as T,P as O,ab as $,q as W,n as z,ag as B,ah as G,ai as K,s as q}from"./index-LWBjDGUR.js";var E,g="HoverCard",[y]=W(g,[T]),w=T(),[V,S]=y(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:c,openDelay:f=700,closeDelay:v=300}=e,d=w(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:c,caller:g}),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)},[]),i.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:i.jsx(F,{...d,children:r})})};N.displayName=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),c=w(r);return i.jsx(I,{asChild:!0,...c,children:i.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,c=S(H,o);return i.jsx(J,{scope:o,forceMount:r,children:i.jsx(O,{present:r||c.open,children:i.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,c=S(R,e.__scopeHoverCard);return i.jsx(O,{present:s||c.open,children:i.jsx(X,{"data-state":c.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,b(c.onOpen)),onPointerLeave:l(e.onPointerLeave,b(c.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:f,...v}=e,d=S(R,r),C=w(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"))}),i.jsx(B,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(c,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:i.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(r);return i.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function b(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ie=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>i.jsx(re,{children:i.jsx(L,{ref:a,align:o,sideOffset:r,className: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,ie as a,ne as b}; +import{r as n,n as k,j as c,a9 as F,aa as I,m as U,p as l,ab as T,P as O,ac as $,s as W,o as z,ah as B,ai as G,aj as K,t as V}from"./index-DsjIhQkx.js";var E,g="HoverCard",[y]=W(g,[T]),w=T(),[q,S]=y(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(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:g}),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(q,{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=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=w(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,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(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,b(i.onOpen)),onPointerLeave:l(e.onPointerLeave,b(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=w(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=w(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function b(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.jsx(L,{ref:a,align:o,sideOffset:r,className:V("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ce as a,ne as b}; diff --git a/assets/index-CIXIMLCe.js b/assets/index-DUeJ-D3M.js similarity index 72% rename from assets/index-CIXIMLCe.js rename to assets/index-DUeJ-D3M.js index bae259a7e61a7dada8899f57c59195b37a47a761..c06177d5061d8f86dd195ac7f009f6a632ab5b7e 100644 --- a/assets/index-CIXIMLCe.js +++ b/assets/index-DUeJ-D3M.js @@ -1 +1 @@ -import{r as u}from"./index-LWBjDGUR.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-DsjIhQkx.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-C3kXFp4C.js b/assets/index-DaRHhPdB.js similarity index 99% rename from assets/index-C3kXFp4C.js rename to assets/index-DaRHhPdB.js index 68896c504db6d6e66fa8107ea2a0dd089ef30141..ede3c677e1deaebbe1cfff16092e97da053ea67e 100644 --- a/assets/index-C3kXFp4C.js +++ b/assets/index-DaRHhPdB.js @@ -1,4 +1,4 @@ -import{am as nn,an as or,j as pn}from"./index-LWBjDGUR.js";function pf(){}function mf(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(i,r).trim();(l||!o)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function wi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Si=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ci=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ei={};function ft(e,t){return(Ei.jsx?Ci:Si).test(e)}const Ii=/[ \t\n\f\r]/g;function Ai(e){return typeof e=="object"?e.type==="text"?ht(e.value):!1:ht(e)}function ht(e){return e.replace(Ii,"")===""}class qe{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qe.prototype.normal={};qe.prototype.property={};qe.prototype.space=void 0;function ar(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new qe(n,r,t)}function vn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ti=0;const D=Ie(),W=Ie(),zn=Ie(),S=Ie(),V=Ie(),De=Ie(),te=Ie();function Ie(){return 2**++Ti}const Dn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:W,commaOrSpaceSeparated:te,commaSeparated:De,number:S,overloadedBoolean:zn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),mn=Object.keys(Dn);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Li.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,_i);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Di,Ri);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function Ri(e){return"-"+e.toLowerCase()}function _i(e){return e.charAt(1).toUpperCase()}const Oi=ar([ur,Pi,fr,hr,pr],"html"),Un=ar([ur,vi,fr,hr,pr],"svg");function gf(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Mi(e){return e.join(" ").trim()}var Vn={},gt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ni=/\n/g,Bi=/^\s*/,ji=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Hi=/^:\s*/,Ui=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Vi=/^[;\s]*/,$i=/^\s+|\s+$/g,qi=` +import{an as nn,ao as or,j as pn}from"./index-DsjIhQkx.js";function pf(){}function mf(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(i,r).trim();(l||!o)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function wi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Si=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ci=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ei={};function ft(e,t){return(Ei.jsx?Ci:Si).test(e)}const Ii=/[ \t\n\f\r]/g;function Ai(e){return typeof e=="object"?e.type==="text"?ht(e.value):!1:ht(e)}function ht(e){return e.replace(Ii,"")===""}class qe{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qe.prototype.normal={};qe.prototype.property={};qe.prototype.space=void 0;function ar(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new qe(n,r,t)}function vn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ti=0;const D=Ie(),W=Ie(),zn=Ie(),S=Ie(),V=Ie(),De=Ie(),te=Ie();function Ie(){return 2**++Ti}const Dn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:W,commaOrSpaceSeparated:te,commaSeparated:De,number:S,overloadedBoolean:zn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),mn=Object.keys(Dn);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Li.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,_i);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Di,Ri);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function Ri(e){return"-"+e.toLowerCase()}function _i(e){return e.charAt(1).toUpperCase()}const Oi=ar([ur,Pi,fr,hr,pr],"html"),Un=ar([ur,vi,fr,hr,pr],"svg");function gf(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Mi(e){return e.join(" ").trim()}var Vn={},gt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ni=/\n/g,Bi=/^\s*/,ji=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Hi=/^:\s*/,Ui=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Vi=/^[;\s]*/,$i=/^\s+|\s+$/g,qi=` `,dt="/",yt="*",Ce="",Wi="comment",Yi="declaration";function Xi(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(d){var x=d.match(Ni);x&&(n+=x.length);var C=d.lastIndexOf(qi);r=~C?d.length-C:r+d.length}function o(){var d={line:n,column:r};return function(x){return x.position=new l(d),s(),x}}function l(d){this.start=d,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function a(d){var x=new Error(t.source+":"+n+":"+r+": "+d);if(x.reason=d,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(d){var x=d.exec(e);if(x){var C=x[0];return i(C),e=e.slice(C.length),x}}function s(){u(Bi)}function f(d){var x;for(d=d||[];x=c();)x!==!1&&d.push(x);return d}function c(){var d=o();if(!(dt!=e.charAt(0)||yt!=e.charAt(1))){for(var x=2;Ce!=e.charAt(x)&&(yt!=e.charAt(x)||dt!=e.charAt(x+1));)++x;if(x+=2,Ce===e.charAt(x-1))return a("End of comment missing");var C=e.slice(2,x-2);return r+=2,i(C),e=e.slice(x),r+=2,d({type:Wi,comment:C})}}function p(){var d=o(),x=u(ji);if(x){if(c(),!u(Hi))return a("property missing ':'");var C=u(Ui),y=d({type:Yi,property:kt(x[0].replace(gt,Ce)),value:C?kt(C[0].replace(gt,Ce)):Ce});return u(Vi),y}}function h(){var d=[];f(d);for(var x;x=p();)x!==!1&&(d.push(x),f(d));return d}return s(),h()}function kt(e){return e?e.replace($i,Ce):Ce}var Qi=Xi,Gi=nn&&nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.default=Ji;const Ki=Gi(Qi);function Ji(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Ki.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:l,value:a}=o;i?t(l,a,o):a&&(n=n||{},n[l]=a)}),n}var an={};Object.defineProperty(an,"__esModule",{value:!0});an.camelCase=void 0;var Zi=/^--[a-zA-Z0-9_-]+$/,el=/-([a-z])/g,nl=/^[^-]+$/,tl=/^-(webkit|moz|ms|o|khtml)-/,rl=/^-(ms)-/,il=function(e){return!e||nl.test(e)||Zi.test(e)},ll=function(e,t){return t.toUpperCase()},xt=function(e,t){return"".concat(t,"-")},ol=function(e,t){return t===void 0&&(t={}),il(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(rl,xt):e=e.replace(tl,xt),e.replace(el,ll))};an.camelCase=ol;var al=nn&&nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ul=al(Vn),sl=an;function Ln(e,t){var n={};return!e||typeof e!="string"||(0,ul.default)(e,function(r,i){r&&i&&(n[(0,sl.camelCase)(r,t)]=i)}),n}Ln.default=Ln;var cl=Ln;const fl=or(cl),mr=gr("end"),$n=gr("start");function gr(e){return t;function t(n){const r=n&&n.position&&n.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 hl(e){const t=$n(e),n=mr(e);if(t&&n)return{start:t,end:n}}function je(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bt(e.position):"start"in e||"end"in e?bt(e):"line"in e||"column"in e?Fn(e):""}function Fn(e){return wt(e&&e.line)+":"+wt(e&&e.column)}function bt(e){return Fn(e&&e.start)+"-"+Fn(e&&e.end)}function wt(e){return e&&typeof e=="number"?e:1}class K extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.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=je(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const qn={}.hasOwnProperty,pl=new Map,ml=/[A-Z]/g,gl=new Set(["table","tbody","thead","tfoot","tr"]),dl=new Set(["td","th"]),dr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yl(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Il(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=El(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Un:Oi,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=yr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function yr(e,t,n){if(t.type==="element")return kl(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return xl(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return wl(e,t,n);if(t.type==="mdxjsEsm")return bl(e,t);if(t.type==="root")return Sl(e,t,n);if(t.type==="text")return Cl(e,t)}function kl(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=xr(e,t.tagName,!1),l=Al(e,t);let a=Yn(e,t);return gl.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Ai(u):!0})),kr(e,l,o,t),Wn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function xl(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ve(e,t.position)}function bl(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ve(e,t.position)}function wl(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:xr(e,t.name,!0),l=Tl(e,t),a=Yn(e,t);return kr(e,l,o,t),Wn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Sl(e,t,n){const r={};return Wn(r,Yn(e,t)),e.create(t,e.Fragment,r,n)}function Cl(e,t){return t.value}function kr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function El(e,t,n){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?n:t;return a?s(o,l,a):s(o,l)}}function Il(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=$n(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Al(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&qn.call(t.properties,i)){const o=Pl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&dl.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Tl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Ve(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else Ve(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Yn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:pl;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(re(e,e.length,0,t),e):t}const Et={}.hasOwnProperty;function wr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function se(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=xe(/[A-Za-z]/),G=xe(/[\dA-Za-z]/),Ml=xe(/[#-'*+\--9=?A-Z^-~]/);function tn(e){return e!==null&&(e<32||e===127)}const Rn=xe(/\d/),Nl=xe(/[\dA-Fa-f]/),Bl=xe(/[!-/:-@[-`{-~]/);function v(e){return e!==null&&e<-2}function U(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}const un=xe(new RegExp("\\p{P}|\\p{S}","u")),Ee=xe(/\s/);function xe(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Re(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function O(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return R(u)?(e.enter(n),a(u)):t(u)}function a(u){return R(u)&&o++l))return;const M=t.events.length;let $=M,B,k;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(B){k=t.events[$][1].end;break}B=!0}for(y(r),w=M;wE;){const F=n[L];t.containerState=F[1],F[0].exit.call(t,e)}n.length=E}function A(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function $l(e,t,n){return O(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Le(e){if(e===null||U(e)||Ee(e))return 1;if(un(e))return 2}function sn(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};At(c,-u),At(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ie(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=ie(s,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),s=ie(s,sn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=ie(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,s=ie(s,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,re(e,r-1,n-r+3,s),n=r+s.length-f-2;break}}for(n=-1;++n0&&R(w)?O(e,A,"linePrefix",o+1)(w):A(w)}function A(w){return w===null||v(w)?e.check(Tt,x,L)(w):(e.enter("codeFlowValue"),E(w))}function E(w){return w===null||v(w)?(e.exit("codeFlowValue"),A(w)):(e.consume(w),E)}function L(w){return e.exit("codeFenced"),t(w)}function F(w,M,$){let B=0;return k;function k(N){return w.enter("lineEnding"),w.consume(N),w.exit("lineEnding"),T}function T(N){return w.enter("codeFencedFence"),R(N)?O(w,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):P(N)}function P(N){return N===a?(w.enter("codeFencedFenceSequence"),j(N)):$(N)}function j(N){return N===a?(B++,w.consume(N),j):B>=l?(w.exit("codeFencedFenceSequence"),R(N)?O(w,q,"whitespace")(N):q(N)):$(N)}function q(N){return N===null||v(N)?(w.exit("codeFencedFence"),M(N)):$(N)}}}function to(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const dn={name:"codeIndented",tokenize:io},ro={partial:!0,tokenize:lo};function io(e,t,n){const r=this;return i;function i(s){return e.enter("codeIndented"),O(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):n(s)}function l(s){return s===null?u(s):v(s)?e.attempt(ro,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||v(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),t(s)}}function lo(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):v(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):O(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):v(l)?i(l):n(l)}}const oo={name:"codeText",previous:uo,resolve:ao,tokenize:so};function ao(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ne(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ne(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ne(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Tr(e,t,n,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||tn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||v(y)?n(y):(e.consume(y),y===92?d:h)}function d(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function x(y){return!f&&(y===null||y===41||U(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):f999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):v(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||v(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!R(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function vr(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?n(p):v(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),O(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||v(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function He(e,t){let n;return r;function r(i){return v(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):R(i)?O(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ko={name:"definition",tokenize:bo},xo={partial:!0,tokenize:wo};function bo(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return Pr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return U(h)?He(e,s)(h):s(h)}function s(h){return Tr(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(xo,c,c)(h)}function c(h){return R(h)?O(e,p,"whitespace")(h):p(h)}function p(h){return h===null||v(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function wo(e,t,n){return r;function r(a){return U(a)?He(e,i)(a):n(a)}function i(a){return vr(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return R(a)?O(e,l,"whitespace")(a):l(a)}function l(a){return a===null||v(a)?t(a):n(a)}}const So={name:"hardBreakEscape",tokenize:Co};function Co(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return v(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Eo={name:"headingAtx",resolve:Io,tokenize:Ao};function Io(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},re(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ao(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||U(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||v(f)?(e.exit("atxHeading"),t(f)):R(f)?O(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||U(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const To=["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"],vt=["pre","script","style","textarea"],Po={concrete:!0,name:"htmlFlow",resolveTo:Do,tokenize:Lo},vo={partial:!0,tokenize:Ro},zo={partial:!0,tokenize:Fo};function Do(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Lo(e,t,n){const r=this;let i,o,l,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),o=!0,x):g===63?(e.consume(g),i=3,r.interrupt?t:m):J(g)?(e.consume(g),l=String.fromCharCode(g),C):n(g)}function p(g){return g===45?(e.consume(g),i=2,h):g===91?(e.consume(g),i=5,a=0,d):J(g)?(e.consume(g),i=4,r.interrupt?t:m):n(g)}function h(g){return g===45?(e.consume(g),r.interrupt?t:m):n(g)}function d(g){const ae="CDATA[";return g===ae.charCodeAt(a++)?(e.consume(g),a===ae.length?r.interrupt?t:P:d):n(g)}function x(g){return J(g)?(e.consume(g),l=String.fromCharCode(g),C):n(g)}function C(g){if(g===null||g===47||g===62||U(g)){const ae=g===47,be=l.toLowerCase();return!ae&&!o&&vt.includes(be)?(i=1,r.interrupt?t(g):P(g)):To.includes(l.toLowerCase())?(i=6,ae?(e.consume(g),y):r.interrupt?t(g):P(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?A(g):E(g))}return g===45||G(g)?(e.consume(g),l+=String.fromCharCode(g),C):n(g)}function y(g){return g===62?(e.consume(g),r.interrupt?t:P):n(g)}function A(g){return R(g)?(e.consume(g),A):k(g)}function E(g){return g===47?(e.consume(g),k):g===58||g===95||J(g)?(e.consume(g),L):R(g)?(e.consume(g),E):k(g)}function L(g){return g===45||g===46||g===58||g===95||G(g)?(e.consume(g),L):F(g)}function F(g){return g===61?(e.consume(g),w):R(g)?(e.consume(g),F):E(g)}function w(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),u=g,M):R(g)?(e.consume(g),w):$(g)}function M(g){return g===u?(e.consume(g),u=null,B):g===null||v(g)?n(g):(e.consume(g),M)}function $(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||U(g)?F(g):(e.consume(g),$)}function B(g){return g===47||g===62||R(g)?E(g):n(g)}function k(g){return g===62?(e.consume(g),T):n(g)}function T(g){return g===null||v(g)?P(g):R(g)?(e.consume(g),T):n(g)}function P(g){return g===45&&i===2?(e.consume(g),Q):g===60&&i===1?(e.consume(g),Y):g===62&&i===4?(e.consume(g),oe):g===63&&i===3?(e.consume(g),m):g===93&&i===5?(e.consume(g),he):v(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(vo,pe,j)(g)):g===null||v(g)?(e.exit("htmlFlowData"),j(g)):(e.consume(g),P)}function j(g){return e.check(zo,q,pe)(g)}function q(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),N}function N(g){return g===null||v(g)?j(g):(e.enter("htmlFlowData"),P(g))}function Q(g){return g===45?(e.consume(g),m):P(g)}function Y(g){return g===47?(e.consume(g),l="",le):P(g)}function le(g){if(g===62){const ae=l.toLowerCase();return vt.includes(ae)?(e.consume(g),oe):P(g)}return J(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),le):P(g)}function he(g){return g===93?(e.consume(g),m):P(g)}function m(g){return g===62?(e.consume(g),oe):g===45&&i===2?(e.consume(g),m):P(g)}function oe(g){return g===null||v(g)?(e.exit("htmlFlowData"),pe(g)):(e.consume(g),oe)}function pe(g){return e.exit("htmlFlow"),t(g)}}function Fo(e,t,n){const r=this;return i;function i(l){return v(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Ro(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(We,t,n)}}const _o={name:"htmlText",tokenize:Oo};function Oo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),F):m===63?(e.consume(m),E):J(m)?(e.consume(m),$):n(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,d):J(m)?(e.consume(m),A):n(m)}function f(m){return m===45?(e.consume(m),h):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):v(m)?(l=c,Y(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?Q(m):m===45?p(m):c(m)}function d(m){const oe="CDATA[";return m===oe.charCodeAt(o++)?(e.consume(m),o===oe.length?x:d):n(m)}function x(m){return m===null?n(m):m===93?(e.consume(m),C):v(m)?(l=x,Y(m)):(e.consume(m),x)}function C(m){return m===93?(e.consume(m),y):x(m)}function y(m){return m===62?Q(m):m===93?(e.consume(m),y):x(m)}function A(m){return m===null||m===62?Q(m):v(m)?(l=A,Y(m)):(e.consume(m),A)}function E(m){return m===null?n(m):m===63?(e.consume(m),L):v(m)?(l=E,Y(m)):(e.consume(m),E)}function L(m){return m===62?Q(m):E(m)}function F(m){return J(m)?(e.consume(m),w):n(m)}function w(m){return m===45||G(m)?(e.consume(m),w):M(m)}function M(m){return v(m)?(l=M,Y(m)):R(m)?(e.consume(m),M):Q(m)}function $(m){return m===45||G(m)?(e.consume(m),$):m===47||m===62||U(m)?B(m):n(m)}function B(m){return m===47?(e.consume(m),Q):m===58||m===95||J(m)?(e.consume(m),k):v(m)?(l=B,Y(m)):R(m)?(e.consume(m),B):Q(m)}function k(m){return m===45||m===46||m===58||m===95||G(m)?(e.consume(m),k):T(m)}function T(m){return m===61?(e.consume(m),P):v(m)?(l=T,Y(m)):R(m)?(e.consume(m),T):B(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,j):v(m)?(l=P,Y(m)):R(m)?(e.consume(m),P):(e.consume(m),q)}function j(m){return m===i?(e.consume(m),i=void 0,N):m===null?n(m):v(m)?(l=j,Y(m)):(e.consume(m),j)}function q(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||U(m)?B(m):(e.consume(m),q)}function N(m){return m===47||m===62||U(m)?B(m):n(m)}function Q(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function Y(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),le}function le(m){return R(m)?O(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):he(m)}function he(m){return e.enter("htmlTextData"),l(m)}}const Gn={name:"labelEnd",resolveAll:jo,resolveTo:Ho,tokenize:Uo},Mo={tokenize:Vo},No={tokenize:$o},Bo={tokenize:qo};function jo(e){let t=-1;const n=[];for(;++t=3&&(s===null||v(s))?(e.exit("thematicBreak"),t(s)):n(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),R(s)?O(e,a,"whitespace")(s):a(s))}}const Z={continuation:{tokenize:na},exit:ra,name:"list",tokenize:ea},Jo={partial:!0,tokenize:ia},Zo={partial:!0,tokenize:ta};function ea(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const d=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(d==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Rn(h)){if(r.containerState.type||(r.containerState.type=d,e.enter(d,{_container:!0})),d==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Ze,n,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return Rn(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):n(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(We,r.interrupt?n:f,e.attempt(Jo,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return R(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function na(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(We,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,O(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!R(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Zo,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,O(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function ta(e,t,n){const r=this;return O(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function ra(e){e.exit(this.containerState.type)}function ia(e,t,n){const r=this;return O(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!R(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const zt={name:"setextUnderline",resolveTo:la,tokenize:oa};function la(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function oa(e,t,n){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):n(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),R(s)?O(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||v(s)?(e.exit("setextHeadingLine"),t(s)):n(s)}}const aa={tokenize:ua};function ua(e){const t=this,n=e.attempt(We,r,e.attempt(this.parser.constructs.flowInitial,i,O(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ho,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const sa={resolveAll:Dr()},ca=zr("string"),fa=zr("text");function zr(e){return{resolveAll:Dr(e==="text"?ha:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return s(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Ia(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=z.tokenStack[z.tokenStack.length-1];(ue[1]||Lt).call(z,void 0,ue[0])}for(I.position={start:ke(b.length>0?b[0][1].start:{line:1,column:1,offset:0}),end:ke(b.length>0?b[b.length-2][1].end:{line:1,column:1,offset:0})},H=-1;++Hi.map(i=>d[i]); -var x0=Object.defineProperty;var uf=e=>{throw TypeError(e)};var S0=(e,t,n)=>t in e?x0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var St=(e,t,n)=>S0(e,typeof t!="symbol"?t+"":t,n),vl=(e,t,n)=>t.has(e)||uf("Cannot "+n);var N=(e,t,n)=>(vl(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>t.has(e)?uf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(vl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Me=(e,t,n)=>(vl(e,t,"access private method"),n);var ts=(e,t,n,r)=>({set _(o){W(e,t,o,n)},get _(){return N(e,t,r)}});function E0(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var KN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ah(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lh={exports:{}},Ra={},jh={exports:{}},Z={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-BVMZaD9m.js","assets/components-DbYcrD0u.js","assets/LatexTitle-DA7SEiSe.js","assets/katex.min-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/transform-C1LieBU0.js","assets/PaperFeedFilters-DLrIO7NL.js","assets/chatSessions-BX17B8vQ.js","assets/chatPrompts-CDY3UGU1.js","assets/usePapers-CHYNlILt.js","assets/useQuery-xOve4y-6.js","assets/useBaseQuery-D4kcdcVW.js","assets/useInfiniteQuery-BfqUfQDk.js","assets/useIntersectionObserver-DdSZQ78X.js","assets/usePeriodFilter-veYjaFZT.js","assets/skeleton-B1Kg5w0V.js","assets/alert-BThP2mep.js","assets/ChatView-DDHqYDAC.js","assets/ChatMessage-DFG7XCLG.js","assets/hover-card-DWx_NdIh.js","assets/PaperPreviewLink-BkYFo5pJ.js","assets/index-DaRHhPdB.js","assets/SharedChatView-ONvzGQrB.js","assets/PapersListView-BzmcMfSw.js","assets/useDebounce-DuVaIR_H.js","assets/PaperDetailView-CGHTDbxn.js","assets/ExternalSourceEvalBadge-B3x84Amj.js","assets/ExternalSourceEvalBadge-DXfuqNnO.css","assets/latexPlainText-DI8YEXVe.js","assets/button-CYp7VsNM.js","assets/index-DUeJ-D3M.js","assets/textarea-BMnjM1hO.js","assets/dialog-BoPFX590.js","assets/useMutation-B-lCv88U.js","assets/SignInToEditDialog-DuAbhKyX.js","assets/loader-circle-DEdDfzjU.js","assets/searchable-select-Bl979FVT.js","assets/codexAddEvals-D6PHbQ5d.js","assets/github-Yx3jwWKl.js","assets/TagsIndexView--NNviBMX.js","assets/TaxonomySuggestionTile-CPUYdGFD.js","assets/TagBrowseView-CrKqHljw.js","assets/BenchmarkTrendSparkline-Cjb-e1Og.js","assets/MarkdownText-DP1ebl5t.js","assets/chevron-down-CBbOvtCm.js","assets/MethodsIndexView-CDBkw1Ix.js","assets/slug-BpH-Nkvz.js","assets/FrameworksIndexView-Cn2Zjt-F.js","assets/TrendsView-CtkIaI1c.js","assets/ConferencesIndexView-BV1UHo-C.js","assets/AiDeadlinesView-uOgVcFI9.js","assets/switch-DIM4i6Fu.js","assets/ConferenceDetailView-bTqcoiXt.js","assets/ConferenceTaskView-D8rZq4uz.js","assets/OrganizationsIndexView-D1m-Jyhd.js","assets/OrganizationsIndexView-dniuSNch.css","assets/OrganizationDetailView-DJd05bzy.js","assets/OrganizationPaperFeed-8WeZrAve.js","assets/NotFound-B_H_to4V.js","assets/OrganizationTaskView-B91F04sp.js","assets/AuthorDetailView-CYd080uW.js","assets/MethodDetailView-CR2MACLD.js","assets/BenchmarkDetailView-BVdCY9wO.js","assets/BenchmarkDetailView-DS2Mrskn.css","assets/SavedPapersView-AVBr0WvC.js","assets/SettingsView-CN37p6xn.js","assets/external-link-CG866OfT.js","assets/SubmitView-Bv_8lA_L.js","assets/CronDashboard-D0q8JAn8.js","assets/shield-alert-BS0sYsit.js","assets/CronDashboard-DwChfW9h.css","assets/SubmissionsDashboard-BrnMfyKI.js","assets/ContributionsPage-CQgUV_SV.js","assets/SearchOverlay-NFroiW9m.js"])))=>i.map(i=>d[i]); +var x0=Object.defineProperty;var uf=e=>{throw TypeError(e)};var S0=(e,t,n)=>t in e?x0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var St=(e,t,n)=>S0(e,typeof t!="symbol"?t+"":t,n),vl=(e,t,n)=>t.has(e)||uf("Cannot "+n);var N=(e,t,n)=>(vl(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>t.has(e)?uf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(vl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Me=(e,t,n)=>(vl(e,t,"access private method"),n);var ts=(e,t,n,r)=>({set _(o){W(e,t,o,n)},get _(){return N(e,t,r)}});function E0(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var qN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ah(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lh={exports:{}},Ra={},jh={exports:{}},Z={};/** * @license React * react.production.min.js * @@ -65,7 +65,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function va(){return va=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Q1(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Y1(e,t){return e.button===0&&(!t||t==="_self")&&!Q1(e)}function oc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function X1(e,t){let n=oc(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const J1=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Z1=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],eE="6";try{window.__reactRouterVersion=eE}catch{}const tE=f.createContext({isTransitioning:!1}),nE="startTransition",ya=Na[nE];function rE(e){let{basename:t,children:n,future:r,window:o}=e,i=f.useRef();i.current==null&&(i.current=a1({window:o,v5Compat:!0}));let s=i.current,[a,l]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&ya?ya(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>s.listen(c),[s,c]),f.useEffect(()=>sv(r),[r]),f.createElement(av,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}function oE(e){let{basename:t,children:n,future:r,window:o}=e,i=f.useRef();i.current==null&&(i.current=l1({window:o,v5Compat:!0}));let s=i.current,[a,l]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&ya?ya(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>s.listen(c),[s,c]),f.useEffect(()=>sv(r),[r]),f.createElement(av,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const iE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cn=f.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=t,h=lv(t,J1),{basename:p}=f.useContext(dn),E,y=!1;if(typeof u=="string"&&sE.test(u)&&(E=u,iE))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=Po(S.pathname,p);S.origin===w.origin&&C!=null?u=C+S.search+S.hash:y=!0}catch{}let x=A1(u,{relative:o}),v=lE(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:o,viewTransition:d});function m(w){r&&r(w),w.defaultPrevented||v(w)}return f.createElement("a",va({},h,{href:E||x,onClick:y||i?r:m,ref:n,target:l}))}),Dr=f.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:l,viewTransition:u,children:c}=t,d=lv(t,Z1),h=Qa(l,{relative:d.relative}),p=pn(),E=f.useContext(Zm),{navigator:y,basename:x}=f.useContext(dn),v=E!=null&&uE(h)&&u===!0,m=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,w=p.pathname,S=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;o||(w=w.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&x&&(S=Po(S,x)||S);const C=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=w===m||!s&&w.startsWith(m)&&w.charAt(C)==="/",P=S!=null&&(S===m||!s&&S.startsWith(m)&&S.charAt(m.length)==="/"),R={isActive:_,isPending:P,isTransitioning:v},L=_?r:void 0,A;typeof i=="function"?A=i(R):A=[i,_?"active":null,P?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let z=typeof a=="function"?a(R):a;return f.createElement(Cn,va({},d,{"aria-current":L,className:A,ref:n,style:z,to:l,viewTransition:u}),typeof c=="function"?c(R):c)});var ic;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ic||(ic={}));var Tp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Tp||(Tp={}));function aE(e){let t=f.useContext(qa);return t||ge(!1),t}function lE(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:a}=t===void 0?{}:t,l=bd(),u=pn(),c=Qa(e,{relative:s});return f.useCallback(d=>{if(Y1(d,n)){d.preventDefault();let h=r!==void 0?r:Ni(u)===Ni(c);l(e,{replace:h,state:o,preventScrollReset:i,relative:s,viewTransition:a})}},[u,l,c,r,o,n,e,i,s,a])}function qN(e){let t=f.useRef(oc(e)),n=f.useRef(!1),r=pn(),o=f.useMemo(()=>X1(r.search,n.current?null:t.current),[r.search]),i=bd(),s=f.useCallback((a,l)=>{const u=oc(typeof a=="function"?a(o):a);n.current=!0,i("?"+u,l)},[i,o]);return[o,s]}function uE(e,t){t===void 0&&(t={});let n=f.useContext(tE);n==null&&ge(!1);let{basename:r}=aE(ic.useViewTransitionState),o=Qa(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Po(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=Po(n.nextLocation.pathname,r)||n.nextLocation.pathname;return nc(o.pathname,s)!=null||nc(o.pathname,i)!=null}var Ya=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ur,Nn,uo,_h,cE=(_h=class extends Ya{constructor(){super();ee(this,ur);ee(this,Nn);ee(this,uo);W(this,uo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,Nn)||this.setEventListener(N(this,uo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Nn))==null||t.call(this),W(this,Nn,void 0))}setEventListener(t){var n;W(this,uo,t),(n=N(this,Nn))==null||n.call(this),W(this,Nn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,ur)!==t&&(W(this,ur,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof N(this,ur)=="boolean"?N(this,ur):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ur=new WeakMap,Nn=new WeakMap,uo=new WeakMap,_h),uv=new cE,dE={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Mn,Pc,bh,fE=(bh=class{constructor(){ee(this,Mn,dE);ee(this,Pc,!1)}setTimeoutProvider(e){W(this,Mn,e)}setTimeout(e,t){return N(this,Mn).setTimeout(e,t)}clearTimeout(e){N(this,Mn).clearTimeout(e)}setInterval(e,t){return N(this,Mn).setInterval(e,t)}clearInterval(e){N(this,Mn).clearInterval(e)}},Mn=new WeakMap,Pc=new WeakMap,bh),sc=new fE;function pE(e){setTimeout(e,0)}var hE=typeof window>"u"||"Deno"in globalThis;function bt(){}function gE(e,t){return typeof e=="function"?e(t):e}function mE(e){return typeof e=="number"&&e>=0&&e!==1/0}function vE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ac(e,t){return typeof e=="function"?e(t):e}function yE(e,t){return typeof e=="function"?e(t):e}function Rp(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Pd(s,t.options))return!1}else if(!Ai(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function Np(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Oi(t.options.mutationKey)!==Oi(i))return!1}else if(!Ai(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Pd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Oi)(e)}function Oi(e){return JSON.stringify(e,(t,n)=>lc(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Ai(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ai(e[n],t[n])):!1}var wE=Object.prototype.hasOwnProperty;function cv(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Mp(e)&&Mp(t);if(!r&&!(lc(e)&&lc(t)))return t;const i=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),a=s.length,l=r?new Array(a):{};let u=0;for(let c=0;c{sc.setTimeout(t,e)})}function SE(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?cv(e,t):t}function QN(e){return e}function EE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function CE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var kd=Symbol();function dv(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===kd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function YN(e,t){return typeof e=="function"?e(...t):!!e}function _E(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var fv=(()=>{let e=()=>hE;return{isServer(){return e()},setIsServer(t){e=t}}})();function bE(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var PE=pE;function kE(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=PE;const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ue=kE(),co,On,fo,Ph,TE=(Ph=class extends Ya{constructor(){super();ee(this,co,!0);ee(this,On);ee(this,fo);W(this,fo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){N(this,On)||this.setEventListener(N(this,fo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,On))==null||t.call(this),W(this,On,void 0))}setEventListener(t){var n;W(this,fo,t),(n=N(this,On))==null||n.call(this),W(this,On,t(this.setOnline.bind(this)))}setOnline(t){N(this,co)!==t&&(W(this,co,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,co)}},co=new WeakMap,On=new WeakMap,fo=new WeakMap,Ph),wa=new TE;function RE(e){return Math.min(1e3*2**e,3e4)}function pv(e){return(e??"online")==="online"?wa.isOnline():!0}var uc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function hv(e){let t=!1,n=0,r;const o=bE(),i=()=>o.status!=="pending",s=y=>{var x;if(!i()){const v=new uc(y);h(v),(x=e.onCancel)==null||x.call(e,v)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>uv.isFocused()&&(e.networkMode==="always"||wa.isOnline())&&e.canRun(),c=()=>pv(e.networkMode)&&e.canRun(),d=y=>{i()||(r==null||r(),o.resolve(y))},h=y=>{i()||(r==null||r(),o.reject(y))},p=()=>new Promise(y=>{var x;r=v=>{(i()||u())&&y(v)},(x=e.onPause)==null||x.call(e)}).then(()=>{var y;r=void 0,i()||(y=e.onContinue)==null||y.call(e)}),E=()=>{if(i())return;let y;const x=n===0?e.initialPromise:void 0;try{y=x??e.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(d).catch(v=>{var _;if(i())return;const m=e.retry??(fv.isServer()?0:3),w=e.retryDelay??RE,S=typeof w=="function"?w(n,v):w,C=m===!0||typeof m=="number"&&nu()?void 0:p()).then(()=>{t?h(v):E()})})};return{promise:o,status:()=>o.status,cancel:s,continue:()=>(r==null||r(),o),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?E():p().then(E),o)}}var cr,kh,gv=(kh=class{constructor(){ee(this,cr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mE(this.gcTime)&&W(this,cr,sc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fv.isServer()?1/0:5*60*1e3))}clearGcTimeout(){N(this,cr)!==void 0&&(sc.clearTimeout(N(this,cr)),W(this,cr,void 0))}},cr=new WeakMap,kh);function NE(e){return{onFetch:(t,n)=>{var c,d,h,p,E;const r=t.options,o=(h=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],s=((E=t.state.data)==null?void 0:E.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const x=w=>{_E(w,()=>t.signal,()=>y=!0)},v=dv(t.options,t.fetchOptions),m=async(w,S,C)=>{if(y)return Promise.reject(t.signal.reason);if(S==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return x(z),z})(),R=await v(P),{maxPages:L}=t.options,A=C?CE:EE;return{pages:A(w.pages,R,L),pageParams:A(w.pageParams,S,L)}};if(o&&i.length){const w=o==="backward",S=w?mv:cc,C={pages:i,pageParams:s},_=S(r,C);a=await m(C,_,w)}else{const w=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:cc(r,a);if(l>0&&S==null)break;a=await m(a,S),l++}while(l{var y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function cc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function mv(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function XN(e,t){return t?cc(e,t)!=null:!1}function JN(e,t){return!t||!e.getPreviousPageParam?!1:mv(e,t)!=null}var po,dr,ho,ut,fr,Pe,Di,pr,et,vv,Yt,Th,ME=(Th=class extends gv{constructor(t){super();ee(this,et);ee(this,po);ee(this,dr);ee(this,ho);ee(this,ut);ee(this,fr);ee(this,Pe);ee(this,Di);ee(this,pr);W(this,pr,!1),W(this,Di,t.defaultOptions),this.setOptions(t.options),this.observers=[],W(this,fr,t.client),W(this,ut,N(this,fr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,W(this,dr,Lp(this.options)),this.state=t.state??N(this,dr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return N(this,po)}get promise(){var t;return(t=N(this,Pe))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,Di),...t},t!=null&&t._type&&W(this,po,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Lp(this.options);n.data!==void 0&&(this.setState(Ap(n.data,n.dataUpdatedAt)),W(this,dr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,ut).remove(this)}setData(t,n){const r=SE(this.state.data,t,this.options);return Me(this,et,Yt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Me(this,et,Yt).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=N(this,Pe))==null?void 0:r.promise;return(o=N(this,Pe))==null||o.cancel(t),n?n.then(bt).catch(bt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return N(this,dr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>yE(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===kd||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ac(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!vE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Pe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Pe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,ut).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Pe)&&(N(this,pr)||Me(this,et,vv).call(this)?N(this,Pe).cancel({revert:!0}):N(this,Pe).cancelRetry()),this.scheduleGc()),N(this,ut).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Me(this,et,Yt).call(this,{type:"invalidate"})}async fetch(t,n){var u,c,d,h,p,E,y,x,v,m,w;if(this.state.fetchStatus!=="idle"&&((u=N(this,Pe))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(N(this,Pe))return N(this,Pe).continueRetry(),N(this,Pe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(C=>C.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(W(this,pr,!0),r.signal)})},i=()=>{const S=dv(this.options,n),_=(()=>{const P={client:N(this,fr),queryKey:this.queryKey,meta:this.meta};return o(P),P})();return W(this,pr,!1),this.options.persister?this.options.persister(S,_,this):S(_)},a=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:N(this,fr),state:this.state,fetchFn:i};return o(S),S})(),l=N(this,po)==="infinite"?NE(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),W(this,ho,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Me(this,et,Yt).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),W(this,Pe,hv({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof uc&&S.revert&&this.setState({...N(this,ho),fetchStatus:"idle"}),r.abort()},onFail:(S,C)=>{Me(this,et,Yt).call(this,{type:"failed",failureCount:S,error:C})},onPause:()=>{Me(this,et,Yt).call(this,{type:"pause"})},onContinue:()=>{Me(this,et,Yt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await N(this,Pe).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(h=N(this,ut).config).onSuccess)==null||p.call(h,S,this),(y=(E=N(this,ut).config).onSettled)==null||y.call(E,S,this.state.error,this),S}catch(S){if(S instanceof uc){if(S.silent)return N(this,Pe).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Me(this,et,Yt).call(this,{type:"error",error:S}),(v=(x=N(this,ut).config).onError)==null||v.call(x,S,this),(w=(m=N(this,ut).config).onSettled)==null||w.call(m,this.state.data,S,this),S}finally{this.scheduleGc()}}},po=new WeakMap,dr=new WeakMap,ho=new WeakMap,ut=new WeakMap,fr=new WeakMap,Pe=new WeakMap,Di=new WeakMap,pr=new WeakMap,et=new WeakSet,vv=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Yt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...OE(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...Ap(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return W(this,ho,t.manual?o:void 0),o;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,ut).notify({query:this,type:"updated",action:t})})},Th);function OE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pv(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ap(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Lp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var $i,$t,De,hr,Ft,_n,Rh,AE=(Rh=class extends gv{constructor(t){super();ee(this,Ft);ee(this,$i);ee(this,$t);ee(this,De);ee(this,hr);W(this,$i,t.client),this.mutationId=t.mutationId,W(this,De,t.mutationCache),W(this,$t,[]),this.state=t.state||LE(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,$t).includes(t)||(N(this,$t).push(t),this.clearGcTimeout(),N(this,De).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){W(this,$t,N(this,$t).filter(n=>n!==t)),this.scheduleGc(),N(this,De).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,$t).length||(this.state.status==="pending"?this.scheduleGc():N(this,De).remove(this))}continue(){var t;return((t=N(this,hr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,l,u,c,d,h,p,E,y,x,v,m,w,S,C,_,P;const n=()=>{Me(this,Ft,_n).call(this,{type:"continue"})},r={client:N(this,$i),meta:this.options.meta,mutationKey:this.options.mutationKey};W(this,hr,hv({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,L)=>{Me(this,Ft,_n).call(this,{type:"failed",failureCount:R,error:L})},onPause:()=>{Me(this,Ft,_n).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,De).canRun(this)}));const o=this.state.status==="pending",i=!N(this,hr).canStart();try{if(o)n();else{Me(this,Ft,_n).call(this,{type:"pending",variables:t,isPaused:i}),N(this,De).config.onMutate&&await N(this,De).config.onMutate(t,this,r);const L=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t,r));L!==this.state.context&&Me(this,Ft,_n).call(this,{type:"pending",context:L,variables:t,isPaused:i})}const R=await N(this,hr).start();return await((u=(l=N(this,De).config).onSuccess)==null?void 0:u.call(l,R,t,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,R,t,this.state.context,r)),await((p=(h=N(this,De).config).onSettled)==null?void 0:p.call(h,R,null,this.state.variables,this.state.context,this,r)),await((y=(E=this.options).onSettled)==null?void 0:y.call(E,R,null,t,this.state.context,r)),Me(this,Ft,_n).call(this,{type:"success",data:R}),R}catch(R){try{await((v=(x=N(this,De).config).onError)==null?void 0:v.call(x,R,t,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((w=(m=this.options).onError)==null?void 0:w.call(m,R,t,this.state.context,r))}catch(L){Promise.reject(L)}try{await((C=(S=N(this,De).config).onSettled)==null?void 0:C.call(S,void 0,R,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((P=(_=this.options).onSettled)==null?void 0:P.call(_,void 0,R,t,this.state.context,r))}catch(L){Promise.reject(L)}throw Me(this,Ft,_n).call(this,{type:"error",error:R}),R}finally{N(this,De).runNext(this)}}},$i=new WeakMap,$t=new WeakMap,De=new WeakMap,hr=new WeakMap,Ft=new WeakSet,_n=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ue.batch(()=>{N(this,$t).forEach(r=>{r.onMutationUpdate(t)}),N(this,De).notify({mutation:this,type:"updated",action:t})})},Rh);function LE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zt,Pt,Fi,Nh,jE=(Nh=class extends Ya{constructor(t={}){super();ee(this,Zt);ee(this,Pt);ee(this,Fi);this.config=t,W(this,Zt,new Set),W(this,Pt,new Map),W(this,Fi,0)}build(t,n,r){const o=new AE({client:t,mutationCache:this,mutationId:++ts(this,Fi)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){N(this,Zt).add(t);const n=ws(t);if(typeof n=="string"){const r=N(this,Pt).get(n);r?r.push(t):N(this,Pt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,Zt).delete(t)){const n=ws(t);if(typeof n=="string"){const r=N(this,Pt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&N(this,Pt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=ws(t);if(typeof n=="string"){const r=N(this,Pt).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=ws(t);if(typeof n=="string"){const o=(r=N(this,Pt).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ue.batch(()=>{N(this,Zt).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,Zt).clear(),N(this,Pt).clear()})}getAll(){return Array.from(N(this,Zt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Np(n,r))}findAll(t={}){return this.getAll().filter(n=>Np(t,n))}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ue.batch(()=>Promise.all(t.map(n=>n.continue().catch(bt))))}},Zt=new WeakMap,Pt=new WeakMap,Fi=new WeakMap,Nh);function ws(e){var t;return(t=e.options.scope)==null?void 0:t.id}var zt,Mh,IE=(Mh=class extends Ya{constructor(t={}){super();ee(this,zt);this.config=t,W(this,zt,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Pd(o,n);let s=this.get(i);return s||(s=new ME({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){N(this,zt).has(t.queryHash)||(N(this,zt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,zt).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,zt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ue.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,zt).get(t)}getAll(){return[...N(this,zt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Rp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Rp(t,r)):n}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},zt=new WeakMap,Mh),we,An,Ln,go,mo,jn,vo,yo,Oh,DE=(Oh=class{constructor(e={}){ee(this,we);ee(this,An);ee(this,Ln);ee(this,go);ee(this,mo);ee(this,jn);ee(this,vo);ee(this,yo);W(this,we,e.queryCache||new IE),W(this,An,e.mutationCache||new jE),W(this,Ln,e.defaultOptions||{}),W(this,go,new Map),W(this,mo,new Map),W(this,jn,0)}mount(){ts(this,jn)._++,N(this,jn)===1&&(W(this,vo,uv.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onFocus())})),W(this,yo,wa.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onOnline())})))}unmount(){var e,t;ts(this,jn)._--,N(this,jn)===0&&((e=N(this,vo))==null||e.call(this),W(this,vo,void 0),(t=N(this,yo))==null||t.call(this),W(this,yo,void 0))}isFetching(e){return N(this,we).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,An).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,we).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=N(this,we).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ac(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return N(this,we).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=N(this,we).get(r.queryHash),i=o==null?void 0:o.state.data,s=gE(t,i);if(s!==void 0)return N(this,we).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Ue.batch(()=>N(this,we).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,we).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,we);Ue.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,we);return Ue.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ue.batch(()=>N(this,we).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(bt).catch(bt)}invalidateQueries(e,t={}){return Ue.batch(()=>(N(this,we).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ue.batch(()=>N(this,we).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(bt)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(bt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,we).build(this,t);return n.isStaleByTime(ac(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(bt).catch(bt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(bt).catch(bt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return wa.isOnline()?N(this,An).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,we)}getMutationCache(){return N(this,An)}getDefaultOptions(){return N(this,Ln)}setDefaultOptions(e){W(this,Ln,e)}setQueryDefaults(e,t){N(this,go).set(Oi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,go).values()],n={};return t.forEach(r=>{Ai(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){N(this,mo).set(Oi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,mo).values()],n={};return t.forEach(r=>{Ai(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Ln).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Pd(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===kd&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Ln).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,we).clear(),N(this,An).clear()}},we=new WeakMap,An=new WeakMap,Ln=new WeakMap,go=new WeakMap,mo=new WeakMap,jn=new WeakMap,vo=new WeakMap,yo=new WeakMap,Oh),yv=f.createContext(void 0),ZN=e=>{const t=f.useContext(yv);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$E=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(yv.Provider,{value:e,children:t}));const jp=e=>e.endsWith("/")?e.slice(0,-1):e;function Td(){const e="https://paperswithcode.co".trim();if(!e)return"";try{const t=e.startsWith("http")?new URL(e):new URL(e,typeof window<"u"?window.location.origin:"http://localhost");return jp(t.origin)}catch{return jp(e)}}function io(e){const t=e.startsWith("/")?e:`/${e}`,n=Td();return n?`${n}${t}`:t}function Xa(e){const t=e.startsWith("/")?e:`/${e}`;return io(t)}function FE(){return Xa("/admin-dashboard")}function eM(e){if(!e)return null;if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("//"))return e;if(e.startsWith("/")){const t=Td();return t?`${t}${e}`:e}return e}function Ki(){const t=String("1").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}function xa(){const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}function tM(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function zE(){const t=String("1").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}const UE="/hf-logo.svg?v=20260513b",Ip=({size:e=14})=>g.jsx("img",{src:UE,alt:"",width:Math.round(e*95/88),height:e,"aria-hidden":"true",draggable:!1,style:{display:"block"}}),wv=({returnTo:e,compact:t=!1,label:n="Sign in"})=>{if(Ki())return null;const r=()=>{const o=Xa("/api/v1/auth/hf/login"),s=new URL(o,window.location.origin).origin===window.location.origin?e:new URL(e,window.location.origin).toString(),a=`${o}?return_to=${encodeURIComponent(s)}`;window.location.href=a};return t?g.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:r,children:g.jsx(Ip,{size:16})}):g.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:r,"aria-label":"Sign in with Hugging Face",children:[g.jsx(Ip,{size:18}),g.jsx("span",{children:n})]})};function BE(e,t=[]){let n=[];function r(i,s){const a=f.createContext(s);a.displayName=i+"Context";const l=n.length;n=[...n,s];const u=d=>{var v;const{scope:h,children:p,...E}=d,y=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,x=f.useMemo(()=>E,Object.values(E));return g.jsx(y.Provider,{value:x,children:p})};u.displayName=i+"Provider";function c(d,h){var y;const p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,E=f.useContext(p);if(E)return E;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,VE(o,...t)]}function VE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Je(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var vt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function Dp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pr(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Dp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{let{children:i,...s}=r;xv(i)&&typeof Sa=="function"&&(i=Sa(i._payload));const a=f.Children.toArray(i),l=a.find(GE);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var nM=Sv("Slot");function KE(e){const t=f.forwardRef((n,r)=>{let{children:o,...i}=n;if(xv(o)&&typeof Sa=="function"&&(o=Sa(o._payload)),f.isValidElement(o)){const s=YE(o),a=QE(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Pr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qE=Symbol("radix.slottable");function GE(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qE}function QE(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function YE(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rd=XE.reduce((e,t)=>{const n=Sv(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ev={exports:{}},Cv={};/** + */function va(){return va=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Q1(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Y1(e,t){return e.button===0&&(!t||t==="_self")&&!Q1(e)}function oc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function X1(e,t){let n=oc(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const J1=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Z1=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],eE="6";try{window.__reactRouterVersion=eE}catch{}const tE=f.createContext({isTransitioning:!1}),nE="startTransition",ya=Na[nE];function rE(e){let{basename:t,children:n,future:r,window:o}=e,i=f.useRef();i.current==null&&(i.current=a1({window:o,v5Compat:!0}));let s=i.current,[a,l]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&ya?ya(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>s.listen(c),[s,c]),f.useEffect(()=>sv(r),[r]),f.createElement(av,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}function oE(e){let{basename:t,children:n,future:r,window:o}=e,i=f.useRef();i.current==null&&(i.current=l1({window:o,v5Compat:!0}));let s=i.current,[a,l]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&ya?ya(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>s.listen(c),[s,c]),f.useEffect(()=>sv(r),[r]),f.createElement(av,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const iE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cn=f.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=t,h=lv(t,J1),{basename:p}=f.useContext(dn),E,y=!1;if(typeof u=="string"&&sE.test(u)&&(E=u,iE))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=Po(S.pathname,p);S.origin===w.origin&&C!=null?u=C+S.search+S.hash:y=!0}catch{}let x=A1(u,{relative:o}),v=lE(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:o,viewTransition:d});function m(w){r&&r(w),w.defaultPrevented||v(w)}return f.createElement("a",va({},h,{href:E||x,onClick:y||i?r:m,ref:n,target:l}))}),Dr=f.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:l,viewTransition:u,children:c}=t,d=lv(t,Z1),h=Qa(l,{relative:d.relative}),p=pn(),E=f.useContext(Zm),{navigator:y,basename:x}=f.useContext(dn),v=E!=null&&uE(h)&&u===!0,m=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,w=p.pathname,S=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;o||(w=w.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&x&&(S=Po(S,x)||S);const C=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=w===m||!s&&w.startsWith(m)&&w.charAt(C)==="/",P=S!=null&&(S===m||!s&&S.startsWith(m)&&S.charAt(m.length)==="/"),R={isActive:_,isPending:P,isTransitioning:v},L=_?r:void 0,A;typeof i=="function"?A=i(R):A=[i,_?"active":null,P?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let z=typeof a=="function"?a(R):a;return f.createElement(Cn,va({},d,{"aria-current":L,className:A,ref:n,style:z,to:l,viewTransition:u}),typeof c=="function"?c(R):c)});var ic;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ic||(ic={}));var Tp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Tp||(Tp={}));function aE(e){let t=f.useContext(qa);return t||ge(!1),t}function lE(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:a}=t===void 0?{}:t,l=bd(),u=pn(),c=Qa(e,{relative:s});return f.useCallback(d=>{if(Y1(d,n)){d.preventDefault();let h=r!==void 0?r:Ni(u)===Ni(c);l(e,{replace:h,state:o,preventScrollReset:i,relative:s,viewTransition:a})}},[u,l,c,r,o,n,e,i,s,a])}function GN(e){let t=f.useRef(oc(e)),n=f.useRef(!1),r=pn(),o=f.useMemo(()=>X1(r.search,n.current?null:t.current),[r.search]),i=bd(),s=f.useCallback((a,l)=>{const u=oc(typeof a=="function"?a(o):a);n.current=!0,i("?"+u,l)},[i,o]);return[o,s]}function uE(e,t){t===void 0&&(t={});let n=f.useContext(tE);n==null&&ge(!1);let{basename:r}=aE(ic.useViewTransitionState),o=Qa(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Po(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=Po(n.nextLocation.pathname,r)||n.nextLocation.pathname;return nc(o.pathname,s)!=null||nc(o.pathname,i)!=null}var Ya=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ur,Nn,uo,_h,cE=(_h=class extends Ya{constructor(){super();ee(this,ur);ee(this,Nn);ee(this,uo);W(this,uo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,Nn)||this.setEventListener(N(this,uo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Nn))==null||t.call(this),W(this,Nn,void 0))}setEventListener(t){var n;W(this,uo,t),(n=N(this,Nn))==null||n.call(this),W(this,Nn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,ur)!==t&&(W(this,ur,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof N(this,ur)=="boolean"?N(this,ur):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ur=new WeakMap,Nn=new WeakMap,uo=new WeakMap,_h),uv=new cE,dE={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Mn,Pc,bh,fE=(bh=class{constructor(){ee(this,Mn,dE);ee(this,Pc,!1)}setTimeoutProvider(e){W(this,Mn,e)}setTimeout(e,t){return N(this,Mn).setTimeout(e,t)}clearTimeout(e){N(this,Mn).clearTimeout(e)}setInterval(e,t){return N(this,Mn).setInterval(e,t)}clearInterval(e){N(this,Mn).clearInterval(e)}},Mn=new WeakMap,Pc=new WeakMap,bh),sc=new fE;function pE(e){setTimeout(e,0)}var hE=typeof window>"u"||"Deno"in globalThis;function bt(){}function gE(e,t){return typeof e=="function"?e(t):e}function mE(e){return typeof e=="number"&&e>=0&&e!==1/0}function vE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ac(e,t){return typeof e=="function"?e(t):e}function yE(e,t){return typeof e=="function"?e(t):e}function Rp(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Pd(s,t.options))return!1}else if(!Ai(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function Np(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Oi(t.options.mutationKey)!==Oi(i))return!1}else if(!Ai(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Pd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Oi)(e)}function Oi(e){return JSON.stringify(e,(t,n)=>lc(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Ai(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ai(e[n],t[n])):!1}var wE=Object.prototype.hasOwnProperty;function cv(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Mp(e)&&Mp(t);if(!r&&!(lc(e)&&lc(t)))return t;const i=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),a=s.length,l=r?new Array(a):{};let u=0;for(let c=0;c{sc.setTimeout(t,e)})}function SE(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?cv(e,t):t}function YN(e){return e}function EE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function CE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var kd=Symbol();function dv(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===kd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function XN(e,t){return typeof e=="function"?e(...t):!!e}function _E(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var fv=(()=>{let e=()=>hE;return{isServer(){return e()},setIsServer(t){e=t}}})();function bE(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var PE=pE;function kE(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=PE;const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ue=kE(),co,On,fo,Ph,TE=(Ph=class extends Ya{constructor(){super();ee(this,co,!0);ee(this,On);ee(this,fo);W(this,fo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){N(this,On)||this.setEventListener(N(this,fo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,On))==null||t.call(this),W(this,On,void 0))}setEventListener(t){var n;W(this,fo,t),(n=N(this,On))==null||n.call(this),W(this,On,t(this.setOnline.bind(this)))}setOnline(t){N(this,co)!==t&&(W(this,co,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,co)}},co=new WeakMap,On=new WeakMap,fo=new WeakMap,Ph),wa=new TE;function RE(e){return Math.min(1e3*2**e,3e4)}function pv(e){return(e??"online")==="online"?wa.isOnline():!0}var uc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function hv(e){let t=!1,n=0,r;const o=bE(),i=()=>o.status!=="pending",s=y=>{var x;if(!i()){const v=new uc(y);h(v),(x=e.onCancel)==null||x.call(e,v)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>uv.isFocused()&&(e.networkMode==="always"||wa.isOnline())&&e.canRun(),c=()=>pv(e.networkMode)&&e.canRun(),d=y=>{i()||(r==null||r(),o.resolve(y))},h=y=>{i()||(r==null||r(),o.reject(y))},p=()=>new Promise(y=>{var x;r=v=>{(i()||u())&&y(v)},(x=e.onPause)==null||x.call(e)}).then(()=>{var y;r=void 0,i()||(y=e.onContinue)==null||y.call(e)}),E=()=>{if(i())return;let y;const x=n===0?e.initialPromise:void 0;try{y=x??e.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(d).catch(v=>{var _;if(i())return;const m=e.retry??(fv.isServer()?0:3),w=e.retryDelay??RE,S=typeof w=="function"?w(n,v):w,C=m===!0||typeof m=="number"&&nu()?void 0:p()).then(()=>{t?h(v):E()})})};return{promise:o,status:()=>o.status,cancel:s,continue:()=>(r==null||r(),o),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?E():p().then(E),o)}}var cr,kh,gv=(kh=class{constructor(){ee(this,cr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mE(this.gcTime)&&W(this,cr,sc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fv.isServer()?1/0:5*60*1e3))}clearGcTimeout(){N(this,cr)!==void 0&&(sc.clearTimeout(N(this,cr)),W(this,cr,void 0))}},cr=new WeakMap,kh);function NE(e){return{onFetch:(t,n)=>{var c,d,h,p,E;const r=t.options,o=(h=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],s=((E=t.state.data)==null?void 0:E.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const x=w=>{_E(w,()=>t.signal,()=>y=!0)},v=dv(t.options,t.fetchOptions),m=async(w,S,C)=>{if(y)return Promise.reject(t.signal.reason);if(S==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return x(z),z})(),R=await v(P),{maxPages:L}=t.options,A=C?CE:EE;return{pages:A(w.pages,R,L),pageParams:A(w.pageParams,S,L)}};if(o&&i.length){const w=o==="backward",S=w?mv:cc,C={pages:i,pageParams:s},_=S(r,C);a=await m(C,_,w)}else{const w=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:cc(r,a);if(l>0&&S==null)break;a=await m(a,S),l++}while(l{var y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function cc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function mv(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function JN(e,t){return t?cc(e,t)!=null:!1}function ZN(e,t){return!t||!e.getPreviousPageParam?!1:mv(e,t)!=null}var po,dr,ho,ut,fr,Pe,Di,pr,et,vv,Yt,Th,ME=(Th=class extends gv{constructor(t){super();ee(this,et);ee(this,po);ee(this,dr);ee(this,ho);ee(this,ut);ee(this,fr);ee(this,Pe);ee(this,Di);ee(this,pr);W(this,pr,!1),W(this,Di,t.defaultOptions),this.setOptions(t.options),this.observers=[],W(this,fr,t.client),W(this,ut,N(this,fr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,W(this,dr,Lp(this.options)),this.state=t.state??N(this,dr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return N(this,po)}get promise(){var t;return(t=N(this,Pe))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,Di),...t},t!=null&&t._type&&W(this,po,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Lp(this.options);n.data!==void 0&&(this.setState(Ap(n.data,n.dataUpdatedAt)),W(this,dr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,ut).remove(this)}setData(t,n){const r=SE(this.state.data,t,this.options);return Me(this,et,Yt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Me(this,et,Yt).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=N(this,Pe))==null?void 0:r.promise;return(o=N(this,Pe))==null||o.cancel(t),n?n.then(bt).catch(bt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return N(this,dr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>yE(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===kd||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ac(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!vE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Pe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Pe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,ut).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Pe)&&(N(this,pr)||Me(this,et,vv).call(this)?N(this,Pe).cancel({revert:!0}):N(this,Pe).cancelRetry()),this.scheduleGc()),N(this,ut).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Me(this,et,Yt).call(this,{type:"invalidate"})}async fetch(t,n){var u,c,d,h,p,E,y,x,v,m,w;if(this.state.fetchStatus!=="idle"&&((u=N(this,Pe))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(N(this,Pe))return N(this,Pe).continueRetry(),N(this,Pe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(C=>C.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(W(this,pr,!0),r.signal)})},i=()=>{const S=dv(this.options,n),_=(()=>{const P={client:N(this,fr),queryKey:this.queryKey,meta:this.meta};return o(P),P})();return W(this,pr,!1),this.options.persister?this.options.persister(S,_,this):S(_)},a=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:N(this,fr),state:this.state,fetchFn:i};return o(S),S})(),l=N(this,po)==="infinite"?NE(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),W(this,ho,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Me(this,et,Yt).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),W(this,Pe,hv({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof uc&&S.revert&&this.setState({...N(this,ho),fetchStatus:"idle"}),r.abort()},onFail:(S,C)=>{Me(this,et,Yt).call(this,{type:"failed",failureCount:S,error:C})},onPause:()=>{Me(this,et,Yt).call(this,{type:"pause"})},onContinue:()=>{Me(this,et,Yt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await N(this,Pe).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(h=N(this,ut).config).onSuccess)==null||p.call(h,S,this),(y=(E=N(this,ut).config).onSettled)==null||y.call(E,S,this.state.error,this),S}catch(S){if(S instanceof uc){if(S.silent)return N(this,Pe).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Me(this,et,Yt).call(this,{type:"error",error:S}),(v=(x=N(this,ut).config).onError)==null||v.call(x,S,this),(w=(m=N(this,ut).config).onSettled)==null||w.call(m,this.state.data,S,this),S}finally{this.scheduleGc()}}},po=new WeakMap,dr=new WeakMap,ho=new WeakMap,ut=new WeakMap,fr=new WeakMap,Pe=new WeakMap,Di=new WeakMap,pr=new WeakMap,et=new WeakSet,vv=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Yt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...OE(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...Ap(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return W(this,ho,t.manual?o:void 0),o;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,ut).notify({query:this,type:"updated",action:t})})},Th);function OE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pv(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ap(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Lp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var $i,$t,De,hr,Ft,_n,Rh,AE=(Rh=class extends gv{constructor(t){super();ee(this,Ft);ee(this,$i);ee(this,$t);ee(this,De);ee(this,hr);W(this,$i,t.client),this.mutationId=t.mutationId,W(this,De,t.mutationCache),W(this,$t,[]),this.state=t.state||LE(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,$t).includes(t)||(N(this,$t).push(t),this.clearGcTimeout(),N(this,De).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){W(this,$t,N(this,$t).filter(n=>n!==t)),this.scheduleGc(),N(this,De).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,$t).length||(this.state.status==="pending"?this.scheduleGc():N(this,De).remove(this))}continue(){var t;return((t=N(this,hr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,l,u,c,d,h,p,E,y,x,v,m,w,S,C,_,P;const n=()=>{Me(this,Ft,_n).call(this,{type:"continue"})},r={client:N(this,$i),meta:this.options.meta,mutationKey:this.options.mutationKey};W(this,hr,hv({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,L)=>{Me(this,Ft,_n).call(this,{type:"failed",failureCount:R,error:L})},onPause:()=>{Me(this,Ft,_n).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,De).canRun(this)}));const o=this.state.status==="pending",i=!N(this,hr).canStart();try{if(o)n();else{Me(this,Ft,_n).call(this,{type:"pending",variables:t,isPaused:i}),N(this,De).config.onMutate&&await N(this,De).config.onMutate(t,this,r);const L=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t,r));L!==this.state.context&&Me(this,Ft,_n).call(this,{type:"pending",context:L,variables:t,isPaused:i})}const R=await N(this,hr).start();return await((u=(l=N(this,De).config).onSuccess)==null?void 0:u.call(l,R,t,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,R,t,this.state.context,r)),await((p=(h=N(this,De).config).onSettled)==null?void 0:p.call(h,R,null,this.state.variables,this.state.context,this,r)),await((y=(E=this.options).onSettled)==null?void 0:y.call(E,R,null,t,this.state.context,r)),Me(this,Ft,_n).call(this,{type:"success",data:R}),R}catch(R){try{await((v=(x=N(this,De).config).onError)==null?void 0:v.call(x,R,t,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((w=(m=this.options).onError)==null?void 0:w.call(m,R,t,this.state.context,r))}catch(L){Promise.reject(L)}try{await((C=(S=N(this,De).config).onSettled)==null?void 0:C.call(S,void 0,R,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((P=(_=this.options).onSettled)==null?void 0:P.call(_,void 0,R,t,this.state.context,r))}catch(L){Promise.reject(L)}throw Me(this,Ft,_n).call(this,{type:"error",error:R}),R}finally{N(this,De).runNext(this)}}},$i=new WeakMap,$t=new WeakMap,De=new WeakMap,hr=new WeakMap,Ft=new WeakSet,_n=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ue.batch(()=>{N(this,$t).forEach(r=>{r.onMutationUpdate(t)}),N(this,De).notify({mutation:this,type:"updated",action:t})})},Rh);function LE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zt,Pt,Fi,Nh,jE=(Nh=class extends Ya{constructor(t={}){super();ee(this,Zt);ee(this,Pt);ee(this,Fi);this.config=t,W(this,Zt,new Set),W(this,Pt,new Map),W(this,Fi,0)}build(t,n,r){const o=new AE({client:t,mutationCache:this,mutationId:++ts(this,Fi)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){N(this,Zt).add(t);const n=ws(t);if(typeof n=="string"){const r=N(this,Pt).get(n);r?r.push(t):N(this,Pt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,Zt).delete(t)){const n=ws(t);if(typeof n=="string"){const r=N(this,Pt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&N(this,Pt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=ws(t);if(typeof n=="string"){const r=N(this,Pt).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=ws(t);if(typeof n=="string"){const o=(r=N(this,Pt).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ue.batch(()=>{N(this,Zt).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,Zt).clear(),N(this,Pt).clear()})}getAll(){return Array.from(N(this,Zt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Np(n,r))}findAll(t={}){return this.getAll().filter(n=>Np(t,n))}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ue.batch(()=>Promise.all(t.map(n=>n.continue().catch(bt))))}},Zt=new WeakMap,Pt=new WeakMap,Fi=new WeakMap,Nh);function ws(e){var t;return(t=e.options.scope)==null?void 0:t.id}var zt,Mh,IE=(Mh=class extends Ya{constructor(t={}){super();ee(this,zt);this.config=t,W(this,zt,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Pd(o,n);let s=this.get(i);return s||(s=new ME({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){N(this,zt).has(t.queryHash)||(N(this,zt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,zt).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,zt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ue.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,zt).get(t)}getAll(){return[...N(this,zt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Rp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Rp(t,r)):n}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},zt=new WeakMap,Mh),we,An,Ln,go,mo,jn,vo,yo,Oh,DE=(Oh=class{constructor(e={}){ee(this,we);ee(this,An);ee(this,Ln);ee(this,go);ee(this,mo);ee(this,jn);ee(this,vo);ee(this,yo);W(this,we,e.queryCache||new IE),W(this,An,e.mutationCache||new jE),W(this,Ln,e.defaultOptions||{}),W(this,go,new Map),W(this,mo,new Map),W(this,jn,0)}mount(){ts(this,jn)._++,N(this,jn)===1&&(W(this,vo,uv.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onFocus())})),W(this,yo,wa.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onOnline())})))}unmount(){var e,t;ts(this,jn)._--,N(this,jn)===0&&((e=N(this,vo))==null||e.call(this),W(this,vo,void 0),(t=N(this,yo))==null||t.call(this),W(this,yo,void 0))}isFetching(e){return N(this,we).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,An).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,we).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=N(this,we).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ac(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return N(this,we).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=N(this,we).get(r.queryHash),i=o==null?void 0:o.state.data,s=gE(t,i);if(s!==void 0)return N(this,we).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Ue.batch(()=>N(this,we).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,we).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,we);Ue.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,we);return Ue.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ue.batch(()=>N(this,we).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(bt).catch(bt)}invalidateQueries(e,t={}){return Ue.batch(()=>(N(this,we).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ue.batch(()=>N(this,we).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(bt)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(bt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,we).build(this,t);return n.isStaleByTime(ac(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(bt).catch(bt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(bt).catch(bt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return wa.isOnline()?N(this,An).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,we)}getMutationCache(){return N(this,An)}getDefaultOptions(){return N(this,Ln)}setDefaultOptions(e){W(this,Ln,e)}setQueryDefaults(e,t){N(this,go).set(Oi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,go).values()],n={};return t.forEach(r=>{Ai(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){N(this,mo).set(Oi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,mo).values()],n={};return t.forEach(r=>{Ai(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Ln).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Pd(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===kd&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Ln).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,we).clear(),N(this,An).clear()}},we=new WeakMap,An=new WeakMap,Ln=new WeakMap,go=new WeakMap,mo=new WeakMap,jn=new WeakMap,vo=new WeakMap,yo=new WeakMap,Oh),yv=f.createContext(void 0),eM=e=>{const t=f.useContext(yv);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$E=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(yv.Provider,{value:e,children:t}));const jp=e=>e.endsWith("/")?e.slice(0,-1):e;function Td(){const e="https://paperswithcode.co".trim();if(!e)return"";try{const t=e.startsWith("http")?new URL(e):new URL(e,typeof window<"u"?window.location.origin:"http://localhost");return jp(t.origin)}catch{return jp(e)}}function io(e){const t=e.startsWith("/")?e:`/${e}`,n=Td();return n?`${n}${t}`:t}function Xa(e){const t=e.startsWith("/")?e:`/${e}`;return io(t)}function FE(){return Xa("/admin-dashboard")}function tM(e){if(!e)return null;if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("//"))return e;if(e.startsWith("/")){const t=Td();return t?`${t}${e}`:e}return e}function Ki(){const t=String("1").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}function xa(){const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}function nM(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function zE(){const t=String("1").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}const UE="/hf-logo.svg?v=20260513b",Ip=({size:e=14})=>g.jsx("img",{src:UE,alt:"",width:Math.round(e*95/88),height:e,"aria-hidden":"true",draggable:!1,style:{display:"block"}});function BE(e,t=!1){const n=Xa("/api/v1/auth/hf/login"),o=new URL(n,window.location.origin).origin===window.location.origin?e:new URL(e,window.location.origin).toString(),i=new URLSearchParams({return_to:o});return t&&i.set("authorize_inference","true"),`${n}?${i.toString()}`}const wv=({returnTo:e,compact:t=!1,label:n="Sign in",authorizeInference:r=!1})=>{if(Ki())return null;const o=()=>{window.location.href=BE(e,r)};return t?g.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:o,children:g.jsx(Ip,{size:16})}):g.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:o,"aria-label":"Sign in with Hugging Face",children:[g.jsx(Ip,{size:18}),g.jsx("span",{children:n})]})};function VE(e,t=[]){let n=[];function r(i,s){const a=f.createContext(s);a.displayName=i+"Context";const l=n.length;n=[...n,s];const u=d=>{var v;const{scope:h,children:p,...E}=d,y=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,x=f.useMemo(()=>E,Object.values(E));return g.jsx(y.Provider,{value:x,children:p})};u.displayName=i+"Provider";function c(d,h){var y;const p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,E=f.useContext(p);if(E)return E;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,WE(o,...t)]}function WE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Je(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var vt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function Dp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pr(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Dp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{let{children:i,...s}=r;xv(i)&&typeof Sa=="function"&&(i=Sa(i._payload));const a=f.Children.toArray(i),l=a.find(QE);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var rM=Sv("Slot");function qE(e){const t=f.forwardRef((n,r)=>{let{children:o,...i}=n;if(xv(o)&&typeof Sa=="function"&&(o=Sa(o._payload)),f.isValidElement(o)){const s=XE(o),a=YE(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Pr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var GE=Symbol("radix.slottable");function QE(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GE}function YE(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function XE(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var JE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rd=JE.reduce((e,t)=>{const n=Sv(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ev={exports:{}},Cv={};/** * @license React * use-sync-external-store-shim.production.js * @@ -73,8 +73,8 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var To=f;function JE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ZE=typeof Object.is=="function"?Object.is:JE,eC=To.useState,tC=To.useEffect,nC=To.useLayoutEffect,rC=To.useDebugValue;function oC(e,t){var n=t(),r=eC({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return nC(function(){o.value=n,o.getSnapshot=t,Kl(o)&&i({inst:o})},[e,n,t]),tC(function(){return Kl(o)&&i({inst:o}),e(function(){Kl(o)&&i({inst:o})})},[e]),rC(n),n}function Kl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ZE(e,n)}catch{return!0}}function iC(e,t){return t()}var sC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?iC:oC;Cv.useSyncExternalStore=To.useSyncExternalStore!==void 0?To.useSyncExternalStore:sC;Ev.exports=Cv;var aC=Ev.exports;function lC(){return aC.useSyncExternalStore(uC,()=>!0,()=>!1)}function uC(){return()=>{}}var Nd="Avatar",[cC]=BE(Nd),[dC,_v]=cC(Nd),bv=f.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=f.useState("idle");return g.jsx(dC,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:g.jsx(Rd.span,{...r,ref:t})})});bv.displayName=Nd;var Pv="AvatarImage",kv=f.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,s=_v(Pv,n),a=fC(r,i),l=Je(u=>{o(u),s.onImageLoadingStatusChange(u)});return vt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?g.jsx(Rd.img,{...i,ref:t,src:r}):null});kv.displayName=Pv;var Tv="AvatarFallback",Rv=f.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=_v(Tv,n),[s,a]=f.useState(r===void 0);return f.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?g.jsx(Rd.span,{...o,ref:t}):null});Rv.displayName=Tv;function $p(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function fC(e,{referrerPolicy:t,crossOrigin:n}){const r=lC(),o=f.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[s,a]=f.useState(()=>$p(i,e));return vt(()=>{a($p(i,e))},[i,e]),vt(()=>{const l=d=>()=>{a(d)};if(!i)return;const u=l("loaded"),c=l("error");return i.addEventListener("load",u),i.addEventListener("error",c),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",c)}},[i,n,t]),s}var Nv=bv,Mv=kv,Ov=Rv;function Av(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t{const t=gC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Md);return a[0]===""&&a.length!==1&&a.shift(),jv(a,t)||hC(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},jv=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?jv(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Md);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},Fp=/^\[(.+)\]$/,hC=e=>{if(Fp.test(e)){const t=Fp.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},gC=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return vC(Object.entries(e.classGroups),n).forEach(([i,s])=>{dc(s,r,i,t)}),r},dc=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:zp(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(mC(o)){dc(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{dc(s,zp(t,i),n,r)})})},zp=(e,t)=>{let n=e;return t.split(Md).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},mC=e=>e.isThemeGetter,vC=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,yC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},Iv="!",wC=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let u=0,c=0,d;for(let x=0;xc?d-c:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:E,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:s}):s},xC=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},SC=e=>({cache:yC(e.cacheSize),parseClassName:wC(e),...pC(e)}),EC=/\s+/,CC=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(EC);let a="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let E=!!p,y=r(E?h.substring(0,p):h);if(!y){if(!E){a=u+(a.length>0?" "+a:a);continue}if(y=r(h),!y){a=u+(a.length>0?" "+a:a);continue}E=!1}const x=xC(c).join(":"),v=d?x+Iv:x,m=v+y;if(i.includes(m))continue;i.push(m);const w=o(y,E);for(let S=0;S0?" "+a:a)}return a};function _C(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rd(c),e());return n=SC(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=CC(l,n);return o(l,c),c}return function(){return i(_C.apply(null,arguments))}}const ae=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$v=/^\[(?:([a-z-]+):)?(.+)\]$/i,PC=/^\d+\/\d+$/,kC=new Set(["px","full","screen"]),TC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,NC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,MC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qt=e=>so(e)||kC.has(e)||PC.test(e),Sn=e=>jo(e,"length",zC),so=e=>!!e&&!Number.isNaN(Number(e)),ql=e=>jo(e,"number",so),Go=e=>!!e&&Number.isInteger(Number(e)),AC=e=>e.endsWith("%")&&so(e.slice(0,-1)),Q=e=>$v.test(e),En=e=>TC.test(e),LC=new Set(["length","size","percentage"]),jC=e=>jo(e,LC,Fv),IC=e=>jo(e,"position",Fv),DC=new Set(["image","url"]),$C=e=>jo(e,DC,BC),FC=e=>jo(e,"",UC),Qo=()=>!0,jo=(e,t,n)=>{const r=$v.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},zC=e=>RC.test(e)&&!NC.test(e),Fv=()=>!1,UC=e=>MC.test(e),BC=e=>OC.test(e),VC=()=>{const e=ae("colors"),t=ae("spacing"),n=ae("blur"),r=ae("brightness"),o=ae("borderColor"),i=ae("borderRadius"),s=ae("borderSpacing"),a=ae("borderWidth"),l=ae("contrast"),u=ae("grayscale"),c=ae("hueRotate"),d=ae("invert"),h=ae("gap"),p=ae("gradientColorStops"),E=ae("gradientColorStopPositions"),y=ae("inset"),x=ae("margin"),v=ae("opacity"),m=ae("padding"),w=ae("saturate"),S=ae("scale"),C=ae("sepia"),_=ae("skew"),P=ae("space"),R=ae("translate"),L=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",Q,t],D=()=>[Q,t],K=()=>["",Qt,Sn],I=()=>["auto",so,Q],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],k=()=>["","0",Q],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[so,Q];return{cacheSize:500,separator:":",theme:{colors:[Qo],spacing:[Qt,Sn],blur:["none","",En,Q],brightness:B(),borderColor:[e],borderRadius:["none","","full",En,Q],borderSpacing:D(),borderWidth:K(),contrast:B(),grayscale:k(),hueRotate:B(),invert:k(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[AC,Sn],inset:z(),margin:z(),opacity:B(),padding:D(),saturate:B(),scale:B(),sepia:k(),skew:B(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",Q]}],container:["container"],columns:[{columns:[En]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),Q]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Go,Q]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Q]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",Go,Q]}],"grid-cols":[{"grid-cols":[Qo]}],"col-start-end":[{col:["auto",{span:["full",Go,Q]},Q]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Qo]}],"row-start-end":[{row:["auto",{span:[Go,Q]},Q]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Q]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Q,t]}],"min-w":[{"min-w":[Q,t,"min","max","fit"]}],"max-w":[{"max-w":[Q,t,"none","full","min","max","fit","prose",{screen:[En]},En]}],h:[{h:[Q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",En,Sn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ql]}],"font-family":[{font:[Qo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Q]}],"line-clamp":[{"line-clamp":["none",so,ql]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qt,Q]}],"list-image":[{"list-image":["none",Q]}],"list-style-type":[{list:["none","disc","decimal",Q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qt,Sn]}],"underline-offset":[{"underline-offset":["auto",Qt,Q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),IC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$C]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:U()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Qt,Q]}],"outline-w":[{outline:[Qt,Sn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Qt,Sn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",En,FC]}],"shadow-color":[{shadow:[Qo]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",En,Q]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Q]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Q]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Go,Q]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Q]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qt,Sn,ql]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},WC=bC(VC);function Ne(...e){return WC(Lv(e))}function rM(e){const t=e.trim(),n=t.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=t.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:t}function oM(e){if(e==null||e==="")return"—";const t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.abs(t)>=100?t.toFixed(0):Math.abs(t)>=10?t.toFixed(1):t.toFixed(2):String(e)}const zv=f.forwardRef(({className:e,...t},n)=>g.jsx(Nv,{ref:n,className:Ne("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));zv.displayName=Nv.displayName;const Uv=f.forwardRef(({className:e,...t},n)=>g.jsx(Mv,{ref:n,className:Ne("aspect-square h-full w-full",e),...t}));Uv.displayName=Mv.displayName;const Bv=f.forwardRef(({className:e,...t},n)=>g.jsx(Ov,{ref:n,className:Ne("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Bv.displayName=Ov.displayName;function V(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function iM(e,t){const n=f.createContext(t),r=i=>{const{children:s,...a}=i,l=f.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=f.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function kr(e,t=[]){let n=[];function r(i,s){const a=f.createContext(s),l=n.length;n=[...n,s];const u=d=>{var v;const{scope:h,children:p,...E}=d,y=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,x=f.useMemo(()=>E,Object.values(E));return g.jsx(y.Provider,{value:x,children:p})};u.displayName=i+"Provider";function c(d,h){var y;const p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,E=f.useContext(p);if(E)return E;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,HC(o,...t)]}function HC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var KC=Na[" useInsertionEffect ".trim().toString()]||vt;function Od({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=qC({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const c=f.useRef(e!==void 0);f.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=f.useCallback(c=>{var d;if(a){const h=GC(c)?c(e):c;h!==e&&((d=s.current)==null||d.call(s,h))}else i(c)},[a,e,i,s]);return[l,u]}function qC({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),i=f.useRef(t);return KC(()=>{i.current=t},[t]),f.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function GC(e){return typeof e=="function"}function QC(e){const t=YC(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(JC);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function YC(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=e_(o),a=ZC(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Pr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var XC=Symbol("radix.slottable");function JC(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===XC}function ZC(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function e_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var t_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=t_.reduce((e,t)=>{const n=QC(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ad(e,t){e&&Hi.flushSync(()=>e.dispatchEvent(t))}function Up(e){const t=n_(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(o_);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function n_(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=s_(o),a=i_(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Pr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var r_=Symbol("radix.slottable");function o_(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===r_}function i_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function s_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ld(e){const t=e+"CollectionProvider",[n,r]=kr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:v}=y,m=T.useRef(null),w=T.useRef(new Map).current;return g.jsx(o,{scope:x,itemMap:w,collectionRef:m,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=Up(a),u=T.forwardRef((y,x)=>{const{scope:v,children:m}=y,w=i(a,v),S=Re(x,w.collectionRef);return g.jsx(l,{ref:S,children:m})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",h=Up(c),p=T.forwardRef((y,x)=>{const{scope:v,children:m,...w}=y,S=T.useRef(null),C=Re(x,S),_=i(c,v);return T.useEffect(()=>(_.itemMap.set(S,{ref:S,...w}),()=>void _.itemMap.delete(S))),g.jsx(h,{[d]:"",ref:C,children:m})});p.displayName=c;function E(y){const x=i(e+"CollectionConsumer",y);return T.useCallback(()=>{const m=x.collectionRef.current;if(!m)return[];const w=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((_,P)=>w.indexOf(_.ref.current)-w.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:p},E,r]}var a_=f.createContext(void 0);function Vv(e){const t=f.useContext(a_);return e||t||"ltr"}function l_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var u_="DismissableLayer",fc="dismissableLayer.update",c_="dismissableLayer.pointerDownOutside",d_="dismissableLayer.focusOutside",Bp,Wv=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ja=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=f.useContext(Wv),[c,d]=f.useState(null),h=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),E=Re(t,P=>d(P)),y=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(x),m=c?y.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=m>=v,C=p_(P=>{const R=P.target,L=[...u.branches].some(A=>A.contains(R));!S||L||(o==null||o(P),s==null||s(P),P.defaultPrevented||a==null||a())},h),_=h_(P=>{const R=P.target;[...u.branches].some(A=>A.contains(R))||(i==null||i(P),s==null||s(P),P.defaultPrevented||a==null||a())},h);return l_(P=>{m===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},h),f.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Bp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Vp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Bp)}},[c,h,n,u]),f.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Vp())},[c,u]),f.useEffect(()=>{const P=()=>p({});return document.addEventListener(fc,P),()=>document.removeEventListener(fc,P)},[]),g.jsx(ve.div,{...l,ref:E,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,_.onFocusCapture),onBlurCapture:V(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});Ja.displayName=u_;var f_="DismissableLayerBranch",Hv=f.forwardRef((e,t)=>{const n=f.useContext(Wv),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(ve.div,{...e,ref:o})});Hv.displayName=f_;function p_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Kv(c_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function h_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e),r=f.useRef(!1);return f.useEffect(()=>{const o=i=>{i.target&&!r.current&&Kv(d_,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vp(){const e=new CustomEvent(fc);document.dispatchEvent(e)}function Kv(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ad(o,i):o.dispatchEvent(i)}var g_=Ja,m_=Hv,Gl=0;function v_(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wp()),document.body.insertAdjacentElement("beforeend",e[1]??Wp()),Gl++,()=>{Gl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Gl--}},[])}function Wp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ql="focusScope.autoFocusOnMount",Yl="focusScope.autoFocusOnUnmount",Hp={bubbles:!1,cancelable:!0},y_="FocusScope",qv=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=f.useState(null),u=Je(o),c=Je(i),d=f.useRef(null),h=Re(t,y=>l(y)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let y=function(w){if(p.paused||!a)return;const S=w.target;a.contains(S)?d.current=S:bn(d.current,{select:!0})},x=function(w){if(p.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||bn(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&bn(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const m=new MutationObserver(v);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),m.disconnect()}}},[r,a,p.paused]),f.useEffect(()=>{if(a){qp.add(p);const y=document.activeElement;if(!a.contains(y)){const v=new CustomEvent(Ql,Hp);a.addEventListener(Ql,u),a.dispatchEvent(v),v.defaultPrevented||(w_(__(Gv(a)),{select:!0}),document.activeElement===y&&bn(a))}return()=>{a.removeEventListener(Ql,u),setTimeout(()=>{const v=new CustomEvent(Yl,Hp);a.addEventListener(Yl,c),a.dispatchEvent(v),v.defaultPrevented||bn(y??document.body,{select:!0}),a.removeEventListener(Yl,c),qp.remove(p)},0)}}},[a,u,c,p]);const E=f.useCallback(y=>{if(!n&&!r||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(x&&v){const m=y.currentTarget,[w,S]=x_(m);w&&S?!y.shiftKey&&v===S?(y.preventDefault(),n&&bn(w,{select:!0})):y.shiftKey&&v===w&&(y.preventDefault(),n&&bn(S,{select:!0})):v===m&&y.preventDefault()}},[n,r,p.paused]);return g.jsx(ve.div,{tabIndex:-1,...s,ref:h,onKeyDown:E})});qv.displayName=y_;function w_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bn(r,{select:t}),document.activeElement!==n)return}function x_(e){const t=Gv(e),n=Kp(t,e),r=Kp(t.reverse(),e);return[n,r]}function Gv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Kp(e,t){for(const n of e)if(!S_(n,{upTo:t}))return n}function S_(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function E_(e){return e instanceof HTMLInputElement&&"select"in e}function bn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&E_(e)&&t&&e.select()}}var qp=C_();function C_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Gp(e,t),e.unshift(t)},remove(t){var n;e=Gp(e,t),(n=e[0])==null||n.resume()}}}function Gp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function __(e){return e.filter(t=>t.tagName!=="A")}var b_=Na[" useId ".trim().toString()]||(()=>{}),P_=0;function pc(e){const[t,n]=f.useState(b_());return vt(()=>{n(r=>r??String(P_++))},[e]),t?`radix-${t}`:""}const k_=["top","right","bottom","left"],Yn=Math.min,tt=Math.max,Ea=Math.round,xs=Math.floor,Kt=e=>({x:e,y:e}),T_={left:"right",right:"left",bottom:"top",top:"bottom"};function hc(e,t,n){return tt(e,Yn(t,n))}function ln(e,t){return typeof e=="function"?e(t):e}function un(e){return e.split("-")[0]}function Io(e){return e.split("-")[1]}function jd(e){return e==="x"?"y":"x"}function Id(e){return e==="y"?"height":"width"}function Vt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Dd(e){return jd(Vt(e))}function R_(e,t,n){n===void 0&&(n=!1);const r=Io(e),o=Dd(e),i=Id(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ca(s)),[s,Ca(s)]}function N_(e){const t=Ca(e);return[gc(e),t,gc(t)]}function gc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Qp=["left","right"],Yp=["right","left"],M_=["top","bottom"],O_=["bottom","top"];function A_(e,t,n){switch(e){case"top":case"bottom":return n?t?Yp:Qp:t?Qp:Yp;case"left":case"right":return t?M_:O_;default:return[]}}function L_(e,t,n,r){const o=Io(e);let i=A_(un(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(gc)))),i}function Ca(e){const t=un(e);return T_[t]+e.slice(t.length)}function j_(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qv(e){return typeof e!="number"?j_(e):{top:e,right:e,bottom:e,left:e}}function _a(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xp(e,t,n){let{reference:r,floating:o}=e;const i=Vt(t),s=Dd(t),a=Id(s),l=un(t),u=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:c,y:r.y-o.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Io(t)){case"start":p[s]-=h*(n&&u?-1:1);break;case"end":p[s]+=h*(n&&u?-1:1);break}return p}async function I_(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=ln(t,e),E=Qv(p),x=a[h?d==="floating"?"reference":"floating":d],v=_a(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),m=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=_a(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:w,strategy:l}):m);return{top:(v.top-C.top+E.top)/S.y,bottom:(C.bottom-v.bottom+E.bottom)/S.y,left:(v.left-C.left+E.left)/S.x,right:(C.right-v.right+E.right)/S.x}}const D_=50,$_=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:I_},l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Xp(u,r,l),h=r,p=0;const E={};for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=ln(e,t)||{};if(u==null)return{};const d=Qv(c),h={x:n,y:r},p=Dd(o),E=Id(p),y=await s.getDimensions(u),x=p==="y",v=x?"top":"left",m=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=i.reference[E]+i.reference[p]-h[p]-i.floating[E],C=h[p]-i.reference[p],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=_?_[w]:0;(!P||!await(s.isElement==null?void 0:s.isElement(_)))&&(P=a.floating[w]||i.floating[E]);const R=S/2-C/2,L=P/2-y[E]/2-1,A=Yn(d[v],L),z=Yn(d[m],L),D=A,K=P-y[E]-z,I=P/2-y[E]/2+R,Y=hc(D,I,K),U=!l.arrow&&Io(o)!=null&&I!==Y&&i.reference[E]/2-(II<=0)){var z,D;const I=(((z=i.flip)==null?void 0:z.index)||0)+1,Y=P[I];if(Y&&(!(d==="alignment"?m!==Vt(Y):!1)||A.every(M=>Vt(M.placement)===m?M.overflows[0]>0:!0)))return{data:{index:I,overflows:A},reset:{placement:Y}};let U=(D=A.filter(H=>H.overflows[0]<=0).sort((H,M)=>H.overflows[1]-M.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(p){case"bestFit":{var K;const H=(K=A.filter(M=>{if(_){const k=Vt(M.placement);return k===m||k==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(k=>k>0).reduce((k,j)=>k+j,0)]).sort((M,k)=>M[1]-k[1])[0])==null?void 0:K[0];H&&(U=H);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function Jp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zp(e){return k_.some(t=>e[t]>=0)}const U_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=ln(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Jp(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Zp(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Jp(s,n.floating);return{data:{escapedOffsets:a,escaped:Zp(a)}}}default:return{}}}}},Yv=new Set(["left","top"]);async function B_(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=un(n),a=Io(n),l=Vt(n)==="y",u=Yv.has(s)?-1:1,c=i&&l?-1:1,d=ln(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:E}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof E=="number"&&(p=a==="end"?E*-1:E),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const V_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await B_(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},W_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:m,y:w}=v;return{x:m,y:w}}},...u}=ln(e,t),c={x:n,y:r},d=await i.detectOverflow(t,u),h=Vt(un(o)),p=jd(h);let E=c[p],y=c[h];if(s){const v=p==="y"?"top":"left",m=p==="y"?"bottom":"right",w=E+d[v],S=E-d[m];E=hc(w,E,S)}if(a){const v=h==="y"?"top":"left",m=h==="y"?"bottom":"right",w=y+d[v],S=y-d[m];y=hc(w,y,S)}const x=l.fn({...t,[p]:E,[h]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:s,[h]:a}}}}}},H_=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=ln(e,t),c={x:n,y:r},d=Vt(o),h=jd(d);let p=c[h],E=c[d];const y=ln(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const w=h==="y"?"height":"width",S=i.reference[h]-i.floating[w]+x.mainAxis,C=i.reference[h]+i.reference[w]-x.mainAxis;pC&&(p=C)}if(u){var v,m;const w=h==="y"?"width":"height",S=Yv.has(un(o)),C=i.reference[d]-i.floating[w]+(S&&((v=s.offset)==null?void 0:v[d])||0)+(S?0:x.crossAxis),_=i.reference[d]+i.reference[w]+(S?0:((m=s.offset)==null?void 0:m[d])||0)-(S?x.crossAxis:0);E_&&(E=_)}return{[h]:p,[d]:E}}}},K_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=ln(e,t),c=await s.detectOverflow(t,u),d=un(o),h=Io(o),p=Vt(o)==="y",{width:E,height:y}=i.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,x=h==="end"?"top":"bottom");const m=y-c.top-c.bottom,w=E-c.left-c.right,S=Yn(y-c[x],m),C=Yn(E-c[v],w),_=!t.middlewareData.shift;let P=S,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=m),_&&!h){const A=tt(c.left,0),z=tt(c.right,0),D=tt(c.top,0),K=tt(c.bottom,0);p?R=E-2*(A!==0||z!==0?A+z:tt(c.left,c.right)):P=y-2*(D!==0||K!==0?D+K:tt(c.top,c.bottom))}await l({...t,availableWidth:R,availableHeight:P});const L=await s.getDimensions(a.floating);return E!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function Za(){return typeof window<"u"}function Do(e){return Xv(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qt(e){var t;return(t=(Xv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Xv(e){return Za()?e instanceof Node||e instanceof ot(e).Node:!1}function Ot(e){return Za()?e instanceof Element||e instanceof ot(e).Element:!1}function hn(e){return Za()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function eh(e){return!Za()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}function qi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function q_(e){return/^(table|td|th)$/.test(Do(e))}function el(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const G_=/transform|translate|scale|rotate|perspective|filter/,Q_=/paint|layout|strict|content/,rr=e=>!!e&&e!=="none";let Xl;function $d(e){const t=Ot(e)?At(e):e;return rr(t.transform)||rr(t.translate)||rr(t.scale)||rr(t.rotate)||rr(t.perspective)||!Fd()&&(rr(t.backdropFilter)||rr(t.filter))||G_.test(t.willChange||"")||Q_.test(t.contain||"")}function Y_(e){let t=Xn(e);for(;hn(t)&&!Ro(t);){if($d(t))return t;if(el(t))return null;t=Xn(t)}return null}function Fd(){return Xl==null&&(Xl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xl}function Ro(e){return/^(html|body|#document)$/.test(Do(e))}function At(e){return ot(e).getComputedStyle(e)}function tl(e){return Ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xn(e){if(Do(e)==="html")return e;const t=e.assignedSlot||e.parentNode||eh(e)&&e.host||qt(e);return eh(t)?t.host:t}function Jv(e){const t=Xn(e);return Ro(t)?e.ownerDocument?e.ownerDocument.body:e.body:hn(t)&&qi(t)?t:Jv(t)}function Li(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Jv(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ot(o);if(i){const a=mc(s);return t.concat(s,s.visualViewport||[],qi(o)?o:[],a&&n?Li(a):[])}else return t.concat(o,Li(o,[],n))}function mc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zv(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=hn(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ea(n)!==i||Ea(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function zd(e){return Ot(e)?e:e.contextElement}function ao(e){const t=zd(e);if(!hn(t))return Kt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Zv(t);let s=(i?Ea(n.width):n.width)/r,a=(i?Ea(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const X_=Kt(0);function ey(e){const t=ot(e);return!Fd()||!t.visualViewport?X_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function J_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ot(e)?!1:t}function Er(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=zd(e);let s=Kt(1);t&&(r?Ot(r)&&(s=ao(r)):s=ao(e));const a=J_(i,n,r)?ey(i):Kt(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,c=o.width/s.x,d=o.height/s.y;if(i){const h=ot(i),p=r&&Ot(r)?ot(r):r;let E=h,y=mc(E);for(;y&&r&&p!==E;){const x=ao(y),v=y.getBoundingClientRect(),m=At(y),w=v.left+(y.clientLeft+parseFloat(m.paddingLeft))*x.x,S=v.top+(y.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=w,u+=S,E=ot(y),y=mc(E)}}return _a({width:c,height:d,x:l,y:u})}function nl(e,t){const n=tl(e).scrollLeft;return t?t.left+n:Er(qt(e)).left+n}function ty(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-nl(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Z_(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=qt(r),a=t?el(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Kt(1);const c=Kt(0),d=hn(r);if((d||!d&&!i)&&((Do(r)!=="body"||qi(s))&&(l=tl(r)),d)){const p=Er(r);u=ao(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=s&&!d&&!i?ty(s,l):Kt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function eb(e){return Array.from(e.getClientRects())}function tb(e){const t=qt(e),n=tl(e),r=e.ownerDocument.body,o=tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+nl(e);const a=-n.scrollTop;return At(r).direction==="rtl"&&(s+=tt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const th=25;function nb(e,t){const n=ot(e),r=qt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Fd();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=nl(r);if(u<=0){const c=r.ownerDocument,d=c.body,h=getComputedStyle(d),p=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,E=Math.abs(r.clientWidth-d.clientWidth-p);E<=th&&(i-=E)}else u<=th&&(i+=u);return{width:i,height:s,x:a,y:l}}function rb(e,t){const n=Er(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=hn(e)?ao(e):Kt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function nh(e,t,n){let r;if(t==="viewport")r=nb(e,n);else if(t==="document")r=tb(qt(e));else if(Ot(t))r=rb(t,n);else{const o=ey(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return _a(r)}function ny(e,t){const n=Xn(e);return n===t||!Ot(n)||Ro(n)?!1:At(n).position==="fixed"||ny(n,t)}function ob(e,t){const n=t.get(e);if(n)return n;let r=Li(e,[],!1).filter(a=>Ot(a)&&Do(a)!=="body"),o=null;const i=At(e).position==="fixed";let s=i?Xn(e):e;for(;Ot(s)&&!Ro(s);){const a=At(s),l=$d(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||qi(s)&&!l&&ny(e,s))?r=r.filter(c=>c!==s):o=a,s=Xn(s)}return t.set(e,r),r}function ib(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?el(t)?[]:ob(t,this._c):[].concat(n),r],a=nh(t,s[0],o);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let h=1;h{s(!1,1e-7)},1e3)}P===1&&!oy(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return s(!0),i}function fb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=zd(e),c=o||i?[...u?Li(u):[],...t?Li(t):[]]:[];c.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=u&&a?db(u,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(v=>{let[m]=v;m&&m.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!l&&p.observe(u),t&&p.observe(t));let E,y=l?Er(e):null;l&&x();function x(){const v=Er(e);y&&!oy(y,v)&&n(),y=v,E=requestAnimationFrame(x)}return n(),()=>{var v;c.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(E)}}const pb=V_,hb=W_,gb=z_,mb=K_,vb=U_,oh=F_,yb=H_,wb=(e,t,n)=>{const r=new Map,o={platform:cb,...n},i={...o.platform,_c:r};return $_(e,t,{...o,platform:i})};var xb=typeof document<"u",Sb=function(){},zs=xb?f.useLayoutEffect:Sb;function ba(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ba(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ba(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function iy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ih(e,t){const n=iy(e);return Math.round(t*n)/n}function Zl(e){const t=f.useRef(e);return zs(()=>{t.current=e}),t}function Eb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=f.useState(r);ba(h,r)||p(r);const[E,y]=f.useState(null),[x,v]=f.useState(null),m=f.useCallback(M=>{M!==_.current&&(_.current=M,y(M))},[]),w=f.useCallback(M=>{M!==P.current&&(P.current=M,v(M))},[]),S=i||E,C=s||x,_=f.useRef(null),P=f.useRef(null),R=f.useRef(c),L=l!=null,A=Zl(l),z=Zl(o),D=Zl(u),K=f.useCallback(()=>{if(!_.current||!P.current)return;const M={placement:t,strategy:n,middleware:h};z.current&&(M.platform=z.current),wb(_.current,P.current,M).then(k=>{const j={...k,isPositioned:D.current!==!1};I.current&&!ba(R.current,j)&&(R.current=j,Hi.flushSync(()=>{d(j)}))})},[h,t,n,z,D]);zs(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[u]);const I=f.useRef(!1);zs(()=>(I.current=!0,()=>{I.current=!1}),[]),zs(()=>{if(S&&(_.current=S),C&&(P.current=C),S&&C){if(A.current)return A.current(S,C,K);K()}},[S,C,K,A,L]);const Y=f.useMemo(()=>({reference:_,floating:P,setReference:m,setFloating:w}),[m,w]),U=f.useMemo(()=>({reference:S,floating:C}),[S,C]),H=f.useMemo(()=>{const M={position:n,left:0,top:0};if(!U.floating)return M;const k=ih(U.floating,c.x),j=ih(U.floating,c.y);return a?{...M,transform:"translate("+k+"px, "+j+"px)",...iy(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:j}},[n,a,U.floating,c.x,c.y]);return f.useMemo(()=>({...c,update:K,refs:Y,elements:U,floatingStyles:H}),[c,K,Y,U,H])}const Cb=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?oh({element:r.current,padding:o}).fn(n):{}:r?oh({element:r,padding:o}).fn(n):{}}}},_b=(e,t)=>{const n=pb(e);return{name:n.name,fn:n.fn,options:[e,t]}},bb=(e,t)=>{const n=hb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pb=(e,t)=>({fn:yb(e).fn,options:[e,t]}),kb=(e,t)=>{const n=gb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tb=(e,t)=>{const n=mb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rb=(e,t)=>{const n=vb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nb=(e,t)=>{const n=Cb(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Mb="Arrow",sy=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx(ve.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});sy.displayName=Mb;var Ob=sy;function Ab(e){const[t,n]=f.useState(void 0);return vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ud="Popper",[ay,rl]=kr(Ud),[Lb,ly]=ay(Ud),uy=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return g.jsx(Lb,{scope:t,anchor:r,onAnchorChange:o,children:n})};uy.displayName=Ud;var cy="PopperAnchor",dy=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=ly(cy,n),s=f.useRef(null),a=Re(t,s),l=f.useRef(null);return f.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:g.jsx(ve.div,{...o,ref:a})});dy.displayName=cy;var Bd="PopperContent",[jb,Ib]=ay(Bd),fy=f.forwardRef((e,t)=>{var J,Gt,be,Lt,gn,Mr;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:E,...y}=e,x=ly(Bd,n),[v,m]=f.useState(null),w=Re(t,mn=>m(mn)),[S,C]=f.useState(null),_=Ab(S),P=(_==null?void 0:_.width)??0,R=(_==null?void 0:_.height)??0,L=r+(i!=="center"?"-"+i:""),A=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},z=Array.isArray(u)?u:[u],D=z.length>0,K={padding:A,boundary:z.filter($b),altBoundary:D},{refs:I,floatingStyles:Y,placement:U,isPositioned:H,middlewareData:M}=Eb({strategy:"fixed",placement:L,whileElementsMounted:(...mn)=>fb(...mn,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[_b({mainAxis:o+R,alignmentAxis:s}),l&&bb({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Pb():void 0,...K}),l&&kb({...K}),Tb({...K,apply:({elements:mn,rects:Ji,availableWidth:pl,availableHeight:Zi})=>{const{width:hl,height:$o}=Ji.reference,Or=mn.floating.style;Or.setProperty("--radix-popper-available-width",`${pl}px`),Or.setProperty("--radix-popper-available-height",`${Zi}px`),Or.setProperty("--radix-popper-anchor-width",`${hl}px`),Or.setProperty("--radix-popper-anchor-height",`${$o}px`)}}),S&&Nb({element:S,padding:a}),Fb({arrowWidth:P,arrowHeight:R}),h&&Rb({strategy:"referenceHidden",...K})]}),[k,j]=gy(U),B=Je(E);vt(()=>{H&&(B==null||B())},[H,B]);const F=(J=M.arrow)==null?void 0:J.x,G=(Gt=M.arrow)==null?void 0:Gt.y,X=((be=M.arrow)==null?void 0:be.centerOffset)!==0,[fe,ye]=f.useState();return vt(()=>{v&&ye(window.getComputedStyle(v).zIndex)},[v]),g.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:H?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(Lt=M.transformOrigin)==null?void 0:Lt.x,(gn=M.transformOrigin)==null?void 0:gn.y].join(" "),...((Mr=M.hide)==null?void 0:Mr.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(jb,{scope:n,placedSide:k,onArrowChange:C,arrowX:F,arrowY:G,shouldHideArrow:X,children:g.jsx(ve.div,{"data-side":k,"data-align":j,...y,ref:w,style:{...y.style,animation:H?void 0:"none"}})})})});fy.displayName=Bd;var py="PopperArrow",Db={top:"bottom",right:"left",bottom:"top",left:"right"},hy=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Ib(py,r),s=Db[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(Ob,{...o,ref:n,style:{...o.style,display:"block"}})})});hy.displayName=py;function $b(e){return e!==null}var Fb=e=>({name:"transformOrigin",options:e,fn(t){var x,v,m;const{placement:n,rects:r,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,c]=gy(n),d={start:"0%",center:"50%",end:"100%"}[c],h=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,p=(((m=o.arrow)==null?void 0:m.y)??0)+l/2;let E="",y="";return u==="bottom"?(E=s?d:`${h}px`,y=`${-l}px`):u==="top"?(E=s?d:`${h}px`,y=`${r.floating.height+l}px`):u==="right"?(E=`${-l}px`,y=s?d:`${p}px`):u==="left"&&(E=`${r.floating.width+l}px`,y=s?d:`${p}px`),{data:{x:E,y}}}});function gy(e){const[t,n="center"]=e.split("-");return[t,n]}var zb=uy,my=dy,vy=fy,yy=hy,Ub="Portal",Vd=f.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=f.useState(!1);vt(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Km.createPortal(g.jsx(ve.div,{...r,ref:t}),s):null});Vd.displayName=Ub;function Bb(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Tr=e=>{const{present:t,children:n}=e,r=Vb(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=Re(r.ref,Wb(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};Tr.displayName="Presence";function Vb(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Bb(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=Ss(r.current);i.current=a==="mounted"?u:"none"},[a]),vt(()=>{const u=r.current,c=o.current;if(c!==e){const h=i.current,p=Ss(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),vt(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=p=>{const y=Ss(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=p=>{p.target===t&&(i.current=Ss(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Ss(e){return(e==null?void 0:e.animationName)||"none"}function Wb(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eu="rovingFocusGroup.onEntryFocus",Hb={bubbles:!1,cancelable:!0},Gi="RovingFocusGroup",[vc,wy,Kb]=Ld(Gi),[qb,xy]=kr(Gi,[Kb]),[Gb,Qb]=qb(Gi),Sy=f.forwardRef((e,t)=>g.jsx(vc.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(vc.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Yb,{...e,ref:t})})}));Sy.displayName=Gi;var Yb=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,h=f.useRef(null),p=Re(t,h),E=Vv(i),[y,x]=Od({prop:s,defaultProp:a??null,onChange:l,caller:Gi}),[v,m]=f.useState(!1),w=Je(u),S=wy(n),C=f.useRef(!1),[_,P]=f.useState(0);return f.useEffect(()=>{const R=h.current;if(R)return R.addEventListener(eu,w),()=>R.removeEventListener(eu,w)},[w]),g.jsx(Gb,{scope:n,orientation:r,dir:E,loop:o,currentTabStopId:y,onItemFocus:f.useCallback(R=>x(R),[x]),onItemShiftTab:f.useCallback(()=>m(!0),[]),onFocusableItemAdd:f.useCallback(()=>P(R=>R+1),[]),onFocusableItemRemove:f.useCallback(()=>P(R=>R-1),[]),children:g.jsx(ve.div,{tabIndex:v||_===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,R=>{const L=!C.current;if(R.target===R.currentTarget&&L&&!v){const A=new CustomEvent(eu,Hb);if(R.currentTarget.dispatchEvent(A),!A.defaultPrevented){const z=S().filter(U=>U.focusable),D=z.find(U=>U.active),K=z.find(U=>U.id===y),Y=[D,K,...z].filter(Boolean).map(U=>U.ref.current);_y(Y,c)}}C.current=!1}),onBlur:V(e.onBlur,()=>m(!1))})})}),Ey="RovingFocusGroupItem",Cy=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=pc(),u=i||l,c=Qb(Ey,n),d=c.currentTabStopId===u,h=wy(n),{onFocusableItemAdd:p,onFocusableItemRemove:E,currentTabStopId:y}=c;return f.useEffect(()=>{if(r)return p(),()=>E()},[r,p,E]),g.jsx(vc.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:g.jsx(ve.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:V(e.onMouseDown,x=>{r?c.onItemFocus(u):x.preventDefault()}),onFocus:V(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:V(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=Zb(x,c.orientation,c.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=h().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const S=w.indexOf(x.currentTarget);w=c.loop?eP(w,S+1):w.slice(S+1)}setTimeout(()=>_y(w))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:y!=null}):s})})});Cy.displayName=Ey;var Xb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Zb(e,t,n){const r=Jb(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Xb[r]}function _y(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function eP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tP=Sy,nP=Cy;function rP(e){const t=oP(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(sP);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function oP(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=lP(o),a=aP(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Pr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var iP=Symbol("radix.slottable");function sP(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iP}function aP(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function lP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$r=new WeakMap,Es=new WeakMap,Cs={},tu=0,by=function(e){return e&&(e.host||by(e.parentNode))},cP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=by(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},dP=function(e,t,n,r){var o=cP(t,Array.isArray(e)?e:[e]);Cs[n]||(Cs[n]=new WeakMap);var i=Cs[n],s=[],a=new Set,l=new Set(o),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};o.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))c(h);else try{var p=h.getAttribute(r),E=p!==null&&p!=="false",y=($r.get(h)||0)+1,x=(i.get(h)||0)+1;$r.set(h,y),i.set(h,x),s.push(h),y===1&&E&&Es.set(h,!0),x===1&&h.setAttribute(n,"true"),E||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return c(t),a.clear(),tu++,function(){s.forEach(function(d){var h=$r.get(d)-1,p=i.get(d)-1;$r.set(d,h),i.set(d,p),h||(Es.has(d)||d.removeAttribute(r),Es.delete(d)),p||d.removeAttribute(n)}),tu--,tu||($r=new WeakMap,$r=new WeakMap,Es=new WeakMap,Cs={})}},fP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=uP(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),dP(r,o,n,"aria-hidden")):function(){return null}},Bt=function(){return Bt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return RP;var t=NP(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},OP=Ry(),lo="data-scroll-locked",AP=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` - .`.concat(hP,` { + */var To=f;function ZE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var eC=typeof Object.is=="function"?Object.is:ZE,tC=To.useState,nC=To.useEffect,rC=To.useLayoutEffect,oC=To.useDebugValue;function iC(e,t){var n=t(),r=tC({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return rC(function(){o.value=n,o.getSnapshot=t,Kl(o)&&i({inst:o})},[e,n,t]),nC(function(){return Kl(o)&&i({inst:o}),e(function(){Kl(o)&&i({inst:o})})},[e]),oC(n),n}function Kl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!eC(e,n)}catch{return!0}}function sC(e,t){return t()}var aC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?sC:iC;Cv.useSyncExternalStore=To.useSyncExternalStore!==void 0?To.useSyncExternalStore:aC;Ev.exports=Cv;var lC=Ev.exports;function uC(){return lC.useSyncExternalStore(cC,()=>!0,()=>!1)}function cC(){return()=>{}}var Nd="Avatar",[dC]=VE(Nd),[fC,_v]=dC(Nd),bv=f.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=f.useState("idle");return g.jsx(fC,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:g.jsx(Rd.span,{...r,ref:t})})});bv.displayName=Nd;var Pv="AvatarImage",kv=f.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,s=_v(Pv,n),a=pC(r,i),l=Je(u=>{o(u),s.onImageLoadingStatusChange(u)});return vt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?g.jsx(Rd.img,{...i,ref:t,src:r}):null});kv.displayName=Pv;var Tv="AvatarFallback",Rv=f.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=_v(Tv,n),[s,a]=f.useState(r===void 0);return f.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?g.jsx(Rd.span,{...o,ref:t}):null});Rv.displayName=Tv;function $p(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function pC(e,{referrerPolicy:t,crossOrigin:n}){const r=uC(),o=f.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[s,a]=f.useState(()=>$p(i,e));return vt(()=>{a($p(i,e))},[i,e]),vt(()=>{const l=d=>()=>{a(d)};if(!i)return;const u=l("loaded"),c=l("error");return i.addEventListener("load",u),i.addEventListener("error",c),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",c)}},[i,n,t]),s}var Nv=bv,Mv=kv,Ov=Rv;function Av(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t{const t=mC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Md);return a[0]===""&&a.length!==1&&a.shift(),jv(a,t)||gC(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},jv=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?jv(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Md);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},Fp=/^\[(.+)\]$/,gC=e=>{if(Fp.test(e)){const t=Fp.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},mC=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return yC(Object.entries(e.classGroups),n).forEach(([i,s])=>{dc(s,r,i,t)}),r},dc=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:zp(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(vC(o)){dc(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{dc(s,zp(t,i),n,r)})})},zp=(e,t)=>{let n=e;return t.split(Md).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},vC=e=>e.isThemeGetter,yC=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,wC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},Iv="!",xC=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let u=0,c=0,d;for(let x=0;xc?d-c:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:E,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:s}):s},SC=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},EC=e=>({cache:wC(e.cacheSize),parseClassName:xC(e),...hC(e)}),CC=/\s+/,_C=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(CC);let a="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let E=!!p,y=r(E?h.substring(0,p):h);if(!y){if(!E){a=u+(a.length>0?" "+a:a);continue}if(y=r(h),!y){a=u+(a.length>0?" "+a:a);continue}E=!1}const x=SC(c).join(":"),v=d?x+Iv:x,m=v+y;if(i.includes(m))continue;i.push(m);const w=o(y,E);for(let S=0;S0?" "+a:a)}return a};function bC(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rd(c),e());return n=EC(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=_C(l,n);return o(l,c),c}return function(){return i(bC.apply(null,arguments))}}const ae=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$v=/^\[(?:([a-z-]+):)?(.+)\]$/i,kC=/^\d+\/\d+$/,TC=new Set(["px","full","screen"]),RC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,MC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,OC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qt=e=>so(e)||TC.has(e)||kC.test(e),Sn=e=>jo(e,"length",UC),so=e=>!!e&&!Number.isNaN(Number(e)),ql=e=>jo(e,"number",so),Go=e=>!!e&&Number.isInteger(Number(e)),LC=e=>e.endsWith("%")&&so(e.slice(0,-1)),Q=e=>$v.test(e),En=e=>RC.test(e),jC=new Set(["length","size","percentage"]),IC=e=>jo(e,jC,Fv),DC=e=>jo(e,"position",Fv),$C=new Set(["image","url"]),FC=e=>jo(e,$C,VC),zC=e=>jo(e,"",BC),Qo=()=>!0,jo=(e,t,n)=>{const r=$v.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},UC=e=>NC.test(e)&&!MC.test(e),Fv=()=>!1,BC=e=>OC.test(e),VC=e=>AC.test(e),WC=()=>{const e=ae("colors"),t=ae("spacing"),n=ae("blur"),r=ae("brightness"),o=ae("borderColor"),i=ae("borderRadius"),s=ae("borderSpacing"),a=ae("borderWidth"),l=ae("contrast"),u=ae("grayscale"),c=ae("hueRotate"),d=ae("invert"),h=ae("gap"),p=ae("gradientColorStops"),E=ae("gradientColorStopPositions"),y=ae("inset"),x=ae("margin"),v=ae("opacity"),m=ae("padding"),w=ae("saturate"),S=ae("scale"),C=ae("sepia"),_=ae("skew"),P=ae("space"),R=ae("translate"),L=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",Q,t],D=()=>[Q,t],K=()=>["",Qt,Sn],I=()=>["auto",so,Q],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],k=()=>["","0",Q],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[so,Q];return{cacheSize:500,separator:":",theme:{colors:[Qo],spacing:[Qt,Sn],blur:["none","",En,Q],brightness:B(),borderColor:[e],borderRadius:["none","","full",En,Q],borderSpacing:D(),borderWidth:K(),contrast:B(),grayscale:k(),hueRotate:B(),invert:k(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[LC,Sn],inset:z(),margin:z(),opacity:B(),padding:D(),saturate:B(),scale:B(),sepia:k(),skew:B(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",Q]}],container:["container"],columns:[{columns:[En]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),Q]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Go,Q]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Q]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",Go,Q]}],"grid-cols":[{"grid-cols":[Qo]}],"col-start-end":[{col:["auto",{span:["full",Go,Q]},Q]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Qo]}],"row-start-end":[{row:["auto",{span:[Go,Q]},Q]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Q]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Q,t]}],"min-w":[{"min-w":[Q,t,"min","max","fit"]}],"max-w":[{"max-w":[Q,t,"none","full","min","max","fit","prose",{screen:[En]},En]}],h:[{h:[Q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",En,Sn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ql]}],"font-family":[{font:[Qo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Q]}],"line-clamp":[{"line-clamp":["none",so,ql]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qt,Q]}],"list-image":[{"list-image":["none",Q]}],"list-style-type":[{list:["none","disc","decimal",Q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qt,Sn]}],"underline-offset":[{"underline-offset":["auto",Qt,Q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),DC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",IC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},FC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:U()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Qt,Q]}],"outline-w":[{outline:[Qt,Sn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Qt,Sn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",En,zC]}],"shadow-color":[{shadow:[Qo]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",En,Q]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Q]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Q]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Go,Q]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Q]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qt,Sn,ql]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},HC=PC(WC);function Ne(...e){return HC(Lv(e))}function oM(e){const t=e.trim(),n=t.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=t.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:t}function iM(e){if(e==null||e==="")return"—";const t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.abs(t)>=100?t.toFixed(0):Math.abs(t)>=10?t.toFixed(1):t.toFixed(2):String(e)}const zv=f.forwardRef(({className:e,...t},n)=>g.jsx(Nv,{ref:n,className:Ne("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));zv.displayName=Nv.displayName;const Uv=f.forwardRef(({className:e,...t},n)=>g.jsx(Mv,{ref:n,className:Ne("aspect-square h-full w-full",e),...t}));Uv.displayName=Mv.displayName;const Bv=f.forwardRef(({className:e,...t},n)=>g.jsx(Ov,{ref:n,className:Ne("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Bv.displayName=Ov.displayName;function V(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function sM(e,t){const n=f.createContext(t),r=i=>{const{children:s,...a}=i,l=f.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=f.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function kr(e,t=[]){let n=[];function r(i,s){const a=f.createContext(s),l=n.length;n=[...n,s];const u=d=>{var v;const{scope:h,children:p,...E}=d,y=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,x=f.useMemo(()=>E,Object.values(E));return g.jsx(y.Provider,{value:x,children:p})};u.displayName=i+"Provider";function c(d,h){var y;const p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,E=f.useContext(p);if(E)return E;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,KC(o,...t)]}function KC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var qC=Na[" useInsertionEffect ".trim().toString()]||vt;function Od({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=GC({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const c=f.useRef(e!==void 0);f.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=f.useCallback(c=>{var d;if(a){const h=QC(c)?c(e):c;h!==e&&((d=s.current)==null||d.call(s,h))}else i(c)},[a,e,i,s]);return[l,u]}function GC({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),i=f.useRef(t);return qC(()=>{i.current=t},[t]),f.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function QC(e){return typeof e=="function"}function YC(e){const t=XC(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(ZC);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function XC(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=t_(o),a=e_(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Pr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var JC=Symbol("radix.slottable");function ZC(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===JC}function e_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function t_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var n_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=n_.reduce((e,t)=>{const n=YC(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ad(e,t){e&&Hi.flushSync(()=>e.dispatchEvent(t))}function Up(e){const t=r_(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(i_);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function r_(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=a_(o),a=s_(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Pr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var o_=Symbol("radix.slottable");function i_(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===o_}function s_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function a_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ld(e){const t=e+"CollectionProvider",[n,r]=kr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:v}=y,m=T.useRef(null),w=T.useRef(new Map).current;return g.jsx(o,{scope:x,itemMap:w,collectionRef:m,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=Up(a),u=T.forwardRef((y,x)=>{const{scope:v,children:m}=y,w=i(a,v),S=Re(x,w.collectionRef);return g.jsx(l,{ref:S,children:m})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",h=Up(c),p=T.forwardRef((y,x)=>{const{scope:v,children:m,...w}=y,S=T.useRef(null),C=Re(x,S),_=i(c,v);return T.useEffect(()=>(_.itemMap.set(S,{ref:S,...w}),()=>void _.itemMap.delete(S))),g.jsx(h,{[d]:"",ref:C,children:m})});p.displayName=c;function E(y){const x=i(e+"CollectionConsumer",y);return T.useCallback(()=>{const m=x.collectionRef.current;if(!m)return[];const w=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((_,P)=>w.indexOf(_.ref.current)-w.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:p},E,r]}var l_=f.createContext(void 0);function Vv(e){const t=f.useContext(l_);return e||t||"ltr"}function u_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var c_="DismissableLayer",fc="dismissableLayer.update",d_="dismissableLayer.pointerDownOutside",f_="dismissableLayer.focusOutside",Bp,Wv=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ja=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=f.useContext(Wv),[c,d]=f.useState(null),h=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),E=Re(t,P=>d(P)),y=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(x),m=c?y.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=m>=v,C=h_(P=>{const R=P.target,L=[...u.branches].some(A=>A.contains(R));!S||L||(o==null||o(P),s==null||s(P),P.defaultPrevented||a==null||a())},h),_=g_(P=>{const R=P.target;[...u.branches].some(A=>A.contains(R))||(i==null||i(P),s==null||s(P),P.defaultPrevented||a==null||a())},h);return u_(P=>{m===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},h),f.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Bp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Vp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Bp)}},[c,h,n,u]),f.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Vp())},[c,u]),f.useEffect(()=>{const P=()=>p({});return document.addEventListener(fc,P),()=>document.removeEventListener(fc,P)},[]),g.jsx(ve.div,{...l,ref:E,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,_.onFocusCapture),onBlurCapture:V(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});Ja.displayName=c_;var p_="DismissableLayerBranch",Hv=f.forwardRef((e,t)=>{const n=f.useContext(Wv),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(ve.div,{...e,ref:o})});Hv.displayName=p_;function h_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Kv(d_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function g_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e),r=f.useRef(!1);return f.useEffect(()=>{const o=i=>{i.target&&!r.current&&Kv(f_,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vp(){const e=new CustomEvent(fc);document.dispatchEvent(e)}function Kv(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ad(o,i):o.dispatchEvent(i)}var m_=Ja,v_=Hv,Gl=0;function y_(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wp()),document.body.insertAdjacentElement("beforeend",e[1]??Wp()),Gl++,()=>{Gl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Gl--}},[])}function Wp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ql="focusScope.autoFocusOnMount",Yl="focusScope.autoFocusOnUnmount",Hp={bubbles:!1,cancelable:!0},w_="FocusScope",qv=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=f.useState(null),u=Je(o),c=Je(i),d=f.useRef(null),h=Re(t,y=>l(y)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let y=function(w){if(p.paused||!a)return;const S=w.target;a.contains(S)?d.current=S:bn(d.current,{select:!0})},x=function(w){if(p.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||bn(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&bn(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const m=new MutationObserver(v);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),m.disconnect()}}},[r,a,p.paused]),f.useEffect(()=>{if(a){qp.add(p);const y=document.activeElement;if(!a.contains(y)){const v=new CustomEvent(Ql,Hp);a.addEventListener(Ql,u),a.dispatchEvent(v),v.defaultPrevented||(x_(b_(Gv(a)),{select:!0}),document.activeElement===y&&bn(a))}return()=>{a.removeEventListener(Ql,u),setTimeout(()=>{const v=new CustomEvent(Yl,Hp);a.addEventListener(Yl,c),a.dispatchEvent(v),v.defaultPrevented||bn(y??document.body,{select:!0}),a.removeEventListener(Yl,c),qp.remove(p)},0)}}},[a,u,c,p]);const E=f.useCallback(y=>{if(!n&&!r||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(x&&v){const m=y.currentTarget,[w,S]=S_(m);w&&S?!y.shiftKey&&v===S?(y.preventDefault(),n&&bn(w,{select:!0})):y.shiftKey&&v===w&&(y.preventDefault(),n&&bn(S,{select:!0})):v===m&&y.preventDefault()}},[n,r,p.paused]);return g.jsx(ve.div,{tabIndex:-1,...s,ref:h,onKeyDown:E})});qv.displayName=w_;function x_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bn(r,{select:t}),document.activeElement!==n)return}function S_(e){const t=Gv(e),n=Kp(t,e),r=Kp(t.reverse(),e);return[n,r]}function Gv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Kp(e,t){for(const n of e)if(!E_(n,{upTo:t}))return n}function E_(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function C_(e){return e instanceof HTMLInputElement&&"select"in e}function bn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&C_(e)&&t&&e.select()}}var qp=__();function __(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Gp(e,t),e.unshift(t)},remove(t){var n;e=Gp(e,t),(n=e[0])==null||n.resume()}}}function Gp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function b_(e){return e.filter(t=>t.tagName!=="A")}var P_=Na[" useId ".trim().toString()]||(()=>{}),k_=0;function pc(e){const[t,n]=f.useState(P_());return vt(()=>{n(r=>r??String(k_++))},[e]),t?`radix-${t}`:""}const T_=["top","right","bottom","left"],Yn=Math.min,tt=Math.max,Ea=Math.round,xs=Math.floor,Kt=e=>({x:e,y:e}),R_={left:"right",right:"left",bottom:"top",top:"bottom"};function hc(e,t,n){return tt(e,Yn(t,n))}function ln(e,t){return typeof e=="function"?e(t):e}function un(e){return e.split("-")[0]}function Io(e){return e.split("-")[1]}function jd(e){return e==="x"?"y":"x"}function Id(e){return e==="y"?"height":"width"}function Vt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Dd(e){return jd(Vt(e))}function N_(e,t,n){n===void 0&&(n=!1);const r=Io(e),o=Dd(e),i=Id(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ca(s)),[s,Ca(s)]}function M_(e){const t=Ca(e);return[gc(e),t,gc(t)]}function gc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Qp=["left","right"],Yp=["right","left"],O_=["top","bottom"],A_=["bottom","top"];function L_(e,t,n){switch(e){case"top":case"bottom":return n?t?Yp:Qp:t?Qp:Yp;case"left":case"right":return t?O_:A_;default:return[]}}function j_(e,t,n,r){const o=Io(e);let i=L_(un(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(gc)))),i}function Ca(e){const t=un(e);return R_[t]+e.slice(t.length)}function I_(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qv(e){return typeof e!="number"?I_(e):{top:e,right:e,bottom:e,left:e}}function _a(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xp(e,t,n){let{reference:r,floating:o}=e;const i=Vt(t),s=Dd(t),a=Id(s),l=un(t),u=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:c,y:r.y-o.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Io(t)){case"start":p[s]-=h*(n&&u?-1:1);break;case"end":p[s]+=h*(n&&u?-1:1);break}return p}async function D_(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=ln(t,e),E=Qv(p),x=a[h?d==="floating"?"reference":"floating":d],v=_a(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),m=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=_a(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:w,strategy:l}):m);return{top:(v.top-C.top+E.top)/S.y,bottom:(C.bottom-v.bottom+E.bottom)/S.y,left:(v.left-C.left+E.left)/S.x,right:(C.right-v.right+E.right)/S.x}}const $_=50,F_=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:D_},l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Xp(u,r,l),h=r,p=0;const E={};for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=ln(e,t)||{};if(u==null)return{};const d=Qv(c),h={x:n,y:r},p=Dd(o),E=Id(p),y=await s.getDimensions(u),x=p==="y",v=x?"top":"left",m=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=i.reference[E]+i.reference[p]-h[p]-i.floating[E],C=h[p]-i.reference[p],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=_?_[w]:0;(!P||!await(s.isElement==null?void 0:s.isElement(_)))&&(P=a.floating[w]||i.floating[E]);const R=S/2-C/2,L=P/2-y[E]/2-1,A=Yn(d[v],L),z=Yn(d[m],L),D=A,K=P-y[E]-z,I=P/2-y[E]/2+R,Y=hc(D,I,K),U=!l.arrow&&Io(o)!=null&&I!==Y&&i.reference[E]/2-(II<=0)){var z,D;const I=(((z=i.flip)==null?void 0:z.index)||0)+1,Y=P[I];if(Y&&(!(d==="alignment"?m!==Vt(Y):!1)||A.every(M=>Vt(M.placement)===m?M.overflows[0]>0:!0)))return{data:{index:I,overflows:A},reset:{placement:Y}};let U=(D=A.filter(H=>H.overflows[0]<=0).sort((H,M)=>H.overflows[1]-M.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(p){case"bestFit":{var K;const H=(K=A.filter(M=>{if(_){const k=Vt(M.placement);return k===m||k==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(k=>k>0).reduce((k,j)=>k+j,0)]).sort((M,k)=>M[1]-k[1])[0])==null?void 0:K[0];H&&(U=H);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function Jp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zp(e){return T_.some(t=>e[t]>=0)}const B_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=ln(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Jp(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Zp(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Jp(s,n.floating);return{data:{escapedOffsets:a,escaped:Zp(a)}}}default:return{}}}}},Yv=new Set(["left","top"]);async function V_(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=un(n),a=Io(n),l=Vt(n)==="y",u=Yv.has(s)?-1:1,c=i&&l?-1:1,d=ln(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:E}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof E=="number"&&(p=a==="end"?E*-1:E),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const W_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await V_(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},H_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:m,y:w}=v;return{x:m,y:w}}},...u}=ln(e,t),c={x:n,y:r},d=await i.detectOverflow(t,u),h=Vt(un(o)),p=jd(h);let E=c[p],y=c[h];if(s){const v=p==="y"?"top":"left",m=p==="y"?"bottom":"right",w=E+d[v],S=E-d[m];E=hc(w,E,S)}if(a){const v=h==="y"?"top":"left",m=h==="y"?"bottom":"right",w=y+d[v],S=y-d[m];y=hc(w,y,S)}const x=l.fn({...t,[p]:E,[h]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:s,[h]:a}}}}}},K_=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=ln(e,t),c={x:n,y:r},d=Vt(o),h=jd(d);let p=c[h],E=c[d];const y=ln(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const w=h==="y"?"height":"width",S=i.reference[h]-i.floating[w]+x.mainAxis,C=i.reference[h]+i.reference[w]-x.mainAxis;pC&&(p=C)}if(u){var v,m;const w=h==="y"?"width":"height",S=Yv.has(un(o)),C=i.reference[d]-i.floating[w]+(S&&((v=s.offset)==null?void 0:v[d])||0)+(S?0:x.crossAxis),_=i.reference[d]+i.reference[w]+(S?0:((m=s.offset)==null?void 0:m[d])||0)-(S?x.crossAxis:0);E_&&(E=_)}return{[h]:p,[d]:E}}}},q_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=ln(e,t),c=await s.detectOverflow(t,u),d=un(o),h=Io(o),p=Vt(o)==="y",{width:E,height:y}=i.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,x=h==="end"?"top":"bottom");const m=y-c.top-c.bottom,w=E-c.left-c.right,S=Yn(y-c[x],m),C=Yn(E-c[v],w),_=!t.middlewareData.shift;let P=S,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=m),_&&!h){const A=tt(c.left,0),z=tt(c.right,0),D=tt(c.top,0),K=tt(c.bottom,0);p?R=E-2*(A!==0||z!==0?A+z:tt(c.left,c.right)):P=y-2*(D!==0||K!==0?D+K:tt(c.top,c.bottom))}await l({...t,availableWidth:R,availableHeight:P});const L=await s.getDimensions(a.floating);return E!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function Za(){return typeof window<"u"}function Do(e){return Xv(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qt(e){var t;return(t=(Xv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Xv(e){return Za()?e instanceof Node||e instanceof ot(e).Node:!1}function Ot(e){return Za()?e instanceof Element||e instanceof ot(e).Element:!1}function hn(e){return Za()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function eh(e){return!Za()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}function qi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function G_(e){return/^(table|td|th)$/.test(Do(e))}function el(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Q_=/transform|translate|scale|rotate|perspective|filter/,Y_=/paint|layout|strict|content/,rr=e=>!!e&&e!=="none";let Xl;function $d(e){const t=Ot(e)?At(e):e;return rr(t.transform)||rr(t.translate)||rr(t.scale)||rr(t.rotate)||rr(t.perspective)||!Fd()&&(rr(t.backdropFilter)||rr(t.filter))||Q_.test(t.willChange||"")||Y_.test(t.contain||"")}function X_(e){let t=Xn(e);for(;hn(t)&&!Ro(t);){if($d(t))return t;if(el(t))return null;t=Xn(t)}return null}function Fd(){return Xl==null&&(Xl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xl}function Ro(e){return/^(html|body|#document)$/.test(Do(e))}function At(e){return ot(e).getComputedStyle(e)}function tl(e){return Ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xn(e){if(Do(e)==="html")return e;const t=e.assignedSlot||e.parentNode||eh(e)&&e.host||qt(e);return eh(t)?t.host:t}function Jv(e){const t=Xn(e);return Ro(t)?e.ownerDocument?e.ownerDocument.body:e.body:hn(t)&&qi(t)?t:Jv(t)}function Li(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Jv(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ot(o);if(i){const a=mc(s);return t.concat(s,s.visualViewport||[],qi(o)?o:[],a&&n?Li(a):[])}else return t.concat(o,Li(o,[],n))}function mc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zv(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=hn(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ea(n)!==i||Ea(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function zd(e){return Ot(e)?e:e.contextElement}function ao(e){const t=zd(e);if(!hn(t))return Kt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Zv(t);let s=(i?Ea(n.width):n.width)/r,a=(i?Ea(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const J_=Kt(0);function ey(e){const t=ot(e);return!Fd()||!t.visualViewport?J_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Z_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ot(e)?!1:t}function Er(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=zd(e);let s=Kt(1);t&&(r?Ot(r)&&(s=ao(r)):s=ao(e));const a=Z_(i,n,r)?ey(i):Kt(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,c=o.width/s.x,d=o.height/s.y;if(i){const h=ot(i),p=r&&Ot(r)?ot(r):r;let E=h,y=mc(E);for(;y&&r&&p!==E;){const x=ao(y),v=y.getBoundingClientRect(),m=At(y),w=v.left+(y.clientLeft+parseFloat(m.paddingLeft))*x.x,S=v.top+(y.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=w,u+=S,E=ot(y),y=mc(E)}}return _a({width:c,height:d,x:l,y:u})}function nl(e,t){const n=tl(e).scrollLeft;return t?t.left+n:Er(qt(e)).left+n}function ty(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-nl(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function eb(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=qt(r),a=t?el(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Kt(1);const c=Kt(0),d=hn(r);if((d||!d&&!i)&&((Do(r)!=="body"||qi(s))&&(l=tl(r)),d)){const p=Er(r);u=ao(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=s&&!d&&!i?ty(s,l):Kt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function tb(e){return Array.from(e.getClientRects())}function nb(e){const t=qt(e),n=tl(e),r=e.ownerDocument.body,o=tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+nl(e);const a=-n.scrollTop;return At(r).direction==="rtl"&&(s+=tt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const th=25;function rb(e,t){const n=ot(e),r=qt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Fd();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=nl(r);if(u<=0){const c=r.ownerDocument,d=c.body,h=getComputedStyle(d),p=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,E=Math.abs(r.clientWidth-d.clientWidth-p);E<=th&&(i-=E)}else u<=th&&(i+=u);return{width:i,height:s,x:a,y:l}}function ob(e,t){const n=Er(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=hn(e)?ao(e):Kt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function nh(e,t,n){let r;if(t==="viewport")r=rb(e,n);else if(t==="document")r=nb(qt(e));else if(Ot(t))r=ob(t,n);else{const o=ey(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return _a(r)}function ny(e,t){const n=Xn(e);return n===t||!Ot(n)||Ro(n)?!1:At(n).position==="fixed"||ny(n,t)}function ib(e,t){const n=t.get(e);if(n)return n;let r=Li(e,[],!1).filter(a=>Ot(a)&&Do(a)!=="body"),o=null;const i=At(e).position==="fixed";let s=i?Xn(e):e;for(;Ot(s)&&!Ro(s);){const a=At(s),l=$d(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||qi(s)&&!l&&ny(e,s))?r=r.filter(c=>c!==s):o=a,s=Xn(s)}return t.set(e,r),r}function sb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?el(t)?[]:ib(t,this._c):[].concat(n),r],a=nh(t,s[0],o);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let h=1;h{s(!1,1e-7)},1e3)}P===1&&!oy(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return s(!0),i}function pb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=zd(e),c=o||i?[...u?Li(u):[],...t?Li(t):[]]:[];c.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=u&&a?fb(u,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(v=>{let[m]=v;m&&m.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!l&&p.observe(u),t&&p.observe(t));let E,y=l?Er(e):null;l&&x();function x(){const v=Er(e);y&&!oy(y,v)&&n(),y=v,E=requestAnimationFrame(x)}return n(),()=>{var v;c.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(E)}}const hb=W_,gb=H_,mb=U_,vb=q_,yb=B_,oh=z_,wb=K_,xb=(e,t,n)=>{const r=new Map,o={platform:db,...n},i={...o.platform,_c:r};return F_(e,t,{...o,platform:i})};var Sb=typeof document<"u",Eb=function(){},zs=Sb?f.useLayoutEffect:Eb;function ba(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ba(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ba(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function iy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ih(e,t){const n=iy(e);return Math.round(t*n)/n}function Zl(e){const t=f.useRef(e);return zs(()=>{t.current=e}),t}function Cb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=f.useState(r);ba(h,r)||p(r);const[E,y]=f.useState(null),[x,v]=f.useState(null),m=f.useCallback(M=>{M!==_.current&&(_.current=M,y(M))},[]),w=f.useCallback(M=>{M!==P.current&&(P.current=M,v(M))},[]),S=i||E,C=s||x,_=f.useRef(null),P=f.useRef(null),R=f.useRef(c),L=l!=null,A=Zl(l),z=Zl(o),D=Zl(u),K=f.useCallback(()=>{if(!_.current||!P.current)return;const M={placement:t,strategy:n,middleware:h};z.current&&(M.platform=z.current),xb(_.current,P.current,M).then(k=>{const j={...k,isPositioned:D.current!==!1};I.current&&!ba(R.current,j)&&(R.current=j,Hi.flushSync(()=>{d(j)}))})},[h,t,n,z,D]);zs(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[u]);const I=f.useRef(!1);zs(()=>(I.current=!0,()=>{I.current=!1}),[]),zs(()=>{if(S&&(_.current=S),C&&(P.current=C),S&&C){if(A.current)return A.current(S,C,K);K()}},[S,C,K,A,L]);const Y=f.useMemo(()=>({reference:_,floating:P,setReference:m,setFloating:w}),[m,w]),U=f.useMemo(()=>({reference:S,floating:C}),[S,C]),H=f.useMemo(()=>{const M={position:n,left:0,top:0};if(!U.floating)return M;const k=ih(U.floating,c.x),j=ih(U.floating,c.y);return a?{...M,transform:"translate("+k+"px, "+j+"px)",...iy(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:j}},[n,a,U.floating,c.x,c.y]);return f.useMemo(()=>({...c,update:K,refs:Y,elements:U,floatingStyles:H}),[c,K,Y,U,H])}const _b=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?oh({element:r.current,padding:o}).fn(n):{}:r?oh({element:r,padding:o}).fn(n):{}}}},bb=(e,t)=>{const n=hb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pb=(e,t)=>{const n=gb(e);return{name:n.name,fn:n.fn,options:[e,t]}},kb=(e,t)=>({fn:wb(e).fn,options:[e,t]}),Tb=(e,t)=>{const n=mb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rb=(e,t)=>{const n=vb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nb=(e,t)=>{const n=yb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mb=(e,t)=>{const n=_b(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ob="Arrow",sy=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx(ve.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});sy.displayName=Ob;var Ab=sy;function Lb(e){const[t,n]=f.useState(void 0);return vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ud="Popper",[ay,rl]=kr(Ud),[jb,ly]=ay(Ud),uy=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return g.jsx(jb,{scope:t,anchor:r,onAnchorChange:o,children:n})};uy.displayName=Ud;var cy="PopperAnchor",dy=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=ly(cy,n),s=f.useRef(null),a=Re(t,s),l=f.useRef(null);return f.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:g.jsx(ve.div,{...o,ref:a})});dy.displayName=cy;var Bd="PopperContent",[Ib,Db]=ay(Bd),fy=f.forwardRef((e,t)=>{var J,Gt,be,Lt,gn,Mr;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:E,...y}=e,x=ly(Bd,n),[v,m]=f.useState(null),w=Re(t,mn=>m(mn)),[S,C]=f.useState(null),_=Lb(S),P=(_==null?void 0:_.width)??0,R=(_==null?void 0:_.height)??0,L=r+(i!=="center"?"-"+i:""),A=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},z=Array.isArray(u)?u:[u],D=z.length>0,K={padding:A,boundary:z.filter(Fb),altBoundary:D},{refs:I,floatingStyles:Y,placement:U,isPositioned:H,middlewareData:M}=Cb({strategy:"fixed",placement:L,whileElementsMounted:(...mn)=>pb(...mn,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[bb({mainAxis:o+R,alignmentAxis:s}),l&&Pb({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?kb():void 0,...K}),l&&Tb({...K}),Rb({...K,apply:({elements:mn,rects:Ji,availableWidth:pl,availableHeight:Zi})=>{const{width:hl,height:$o}=Ji.reference,Or=mn.floating.style;Or.setProperty("--radix-popper-available-width",`${pl}px`),Or.setProperty("--radix-popper-available-height",`${Zi}px`),Or.setProperty("--radix-popper-anchor-width",`${hl}px`),Or.setProperty("--radix-popper-anchor-height",`${$o}px`)}}),S&&Mb({element:S,padding:a}),zb({arrowWidth:P,arrowHeight:R}),h&&Nb({strategy:"referenceHidden",...K})]}),[k,j]=gy(U),B=Je(E);vt(()=>{H&&(B==null||B())},[H,B]);const F=(J=M.arrow)==null?void 0:J.x,G=(Gt=M.arrow)==null?void 0:Gt.y,X=((be=M.arrow)==null?void 0:be.centerOffset)!==0,[fe,ye]=f.useState();return vt(()=>{v&&ye(window.getComputedStyle(v).zIndex)},[v]),g.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:H?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(Lt=M.transformOrigin)==null?void 0:Lt.x,(gn=M.transformOrigin)==null?void 0:gn.y].join(" "),...((Mr=M.hide)==null?void 0:Mr.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(Ib,{scope:n,placedSide:k,onArrowChange:C,arrowX:F,arrowY:G,shouldHideArrow:X,children:g.jsx(ve.div,{"data-side":k,"data-align":j,...y,ref:w,style:{...y.style,animation:H?void 0:"none"}})})})});fy.displayName=Bd;var py="PopperArrow",$b={top:"bottom",right:"left",bottom:"top",left:"right"},hy=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Db(py,r),s=$b[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(Ab,{...o,ref:n,style:{...o.style,display:"block"}})})});hy.displayName=py;function Fb(e){return e!==null}var zb=e=>({name:"transformOrigin",options:e,fn(t){var x,v,m;const{placement:n,rects:r,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,c]=gy(n),d={start:"0%",center:"50%",end:"100%"}[c],h=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,p=(((m=o.arrow)==null?void 0:m.y)??0)+l/2;let E="",y="";return u==="bottom"?(E=s?d:`${h}px`,y=`${-l}px`):u==="top"?(E=s?d:`${h}px`,y=`${r.floating.height+l}px`):u==="right"?(E=`${-l}px`,y=s?d:`${p}px`):u==="left"&&(E=`${r.floating.width+l}px`,y=s?d:`${p}px`),{data:{x:E,y}}}});function gy(e){const[t,n="center"]=e.split("-");return[t,n]}var Ub=uy,my=dy,vy=fy,yy=hy,Bb="Portal",Vd=f.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=f.useState(!1);vt(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Km.createPortal(g.jsx(ve.div,{...r,ref:t}),s):null});Vd.displayName=Bb;function Vb(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Tr=e=>{const{present:t,children:n}=e,r=Wb(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=Re(r.ref,Hb(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};Tr.displayName="Presence";function Wb(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Vb(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=Ss(r.current);i.current=a==="mounted"?u:"none"},[a]),vt(()=>{const u=r.current,c=o.current;if(c!==e){const h=i.current,p=Ss(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),vt(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=p=>{const y=Ss(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=p=>{p.target===t&&(i.current=Ss(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Ss(e){return(e==null?void 0:e.animationName)||"none"}function Hb(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eu="rovingFocusGroup.onEntryFocus",Kb={bubbles:!1,cancelable:!0},Gi="RovingFocusGroup",[vc,wy,qb]=Ld(Gi),[Gb,xy]=kr(Gi,[qb]),[Qb,Yb]=Gb(Gi),Sy=f.forwardRef((e,t)=>g.jsx(vc.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(vc.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Xb,{...e,ref:t})})}));Sy.displayName=Gi;var Xb=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,h=f.useRef(null),p=Re(t,h),E=Vv(i),[y,x]=Od({prop:s,defaultProp:a??null,onChange:l,caller:Gi}),[v,m]=f.useState(!1),w=Je(u),S=wy(n),C=f.useRef(!1),[_,P]=f.useState(0);return f.useEffect(()=>{const R=h.current;if(R)return R.addEventListener(eu,w),()=>R.removeEventListener(eu,w)},[w]),g.jsx(Qb,{scope:n,orientation:r,dir:E,loop:o,currentTabStopId:y,onItemFocus:f.useCallback(R=>x(R),[x]),onItemShiftTab:f.useCallback(()=>m(!0),[]),onFocusableItemAdd:f.useCallback(()=>P(R=>R+1),[]),onFocusableItemRemove:f.useCallback(()=>P(R=>R-1),[]),children:g.jsx(ve.div,{tabIndex:v||_===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,R=>{const L=!C.current;if(R.target===R.currentTarget&&L&&!v){const A=new CustomEvent(eu,Kb);if(R.currentTarget.dispatchEvent(A),!A.defaultPrevented){const z=S().filter(U=>U.focusable),D=z.find(U=>U.active),K=z.find(U=>U.id===y),Y=[D,K,...z].filter(Boolean).map(U=>U.ref.current);_y(Y,c)}}C.current=!1}),onBlur:V(e.onBlur,()=>m(!1))})})}),Ey="RovingFocusGroupItem",Cy=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=pc(),u=i||l,c=Yb(Ey,n),d=c.currentTabStopId===u,h=wy(n),{onFocusableItemAdd:p,onFocusableItemRemove:E,currentTabStopId:y}=c;return f.useEffect(()=>{if(r)return p(),()=>E()},[r,p,E]),g.jsx(vc.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:g.jsx(ve.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:V(e.onMouseDown,x=>{r?c.onItemFocus(u):x.preventDefault()}),onFocus:V(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:V(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=eP(x,c.orientation,c.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=h().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const S=w.indexOf(x.currentTarget);w=c.loop?tP(w,S+1):w.slice(S+1)}setTimeout(()=>_y(w))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:y!=null}):s})})});Cy.displayName=Ey;var Jb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Zb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function eP(e,t,n){const r=Zb(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Jb[r]}function _y(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function tP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var nP=Sy,rP=Cy;function oP(e){const t=iP(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(aP);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function iP(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=uP(o),a=lP(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Pr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sP=Symbol("radix.slottable");function aP(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sP}function lP(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function uP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$r=new WeakMap,Es=new WeakMap,Cs={},tu=0,by=function(e){return e&&(e.host||by(e.parentNode))},dP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=by(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},fP=function(e,t,n,r){var o=dP(t,Array.isArray(e)?e:[e]);Cs[n]||(Cs[n]=new WeakMap);var i=Cs[n],s=[],a=new Set,l=new Set(o),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};o.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))c(h);else try{var p=h.getAttribute(r),E=p!==null&&p!=="false",y=($r.get(h)||0)+1,x=(i.get(h)||0)+1;$r.set(h,y),i.set(h,x),s.push(h),y===1&&E&&Es.set(h,!0),x===1&&h.setAttribute(n,"true"),E||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return c(t),a.clear(),tu++,function(){s.forEach(function(d){var h=$r.get(d)-1,p=i.get(d)-1;$r.set(d,h),i.set(d,p),h||(Es.has(d)||d.removeAttribute(r),Es.delete(d)),p||d.removeAttribute(n)}),tu--,tu||($r=new WeakMap,$r=new WeakMap,Es=new WeakMap,Cs={})}},pP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=cP(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),fP(r,o,n,"aria-hidden")):function(){return null}},Bt=function(){return Bt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return NP;var t=MP(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},AP=Ry(),lo="data-scroll-locked",LP=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(gP,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; } @@ -108,50 +108,50 @@ Error generating stack: `+i.message+` } body[`).concat(lo,`] { - `).concat(gP,": ").concat(a,`px; + `).concat(mP,": ").concat(a,`px; } -`)},ah=function(){var e=parseInt(document.body.getAttribute(lo)||"0",10);return isFinite(e)?e:0},LP=function(){f.useEffect(function(){return document.body.setAttribute(lo,(ah()+1).toString()),function(){var e=ah()-1;e<=0?document.body.removeAttribute(lo):document.body.setAttribute(lo,e.toString())}},[])},jP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;LP();var i=f.useMemo(function(){return MP(o)},[o]);return f.createElement(OP,{styles:AP(i,!t,o,n?"":"!important")})},yc=!1;if(typeof window<"u")try{var _s=Object.defineProperty({},"passive",{get:function(){return yc=!0,!0}});window.addEventListener("test",_s,_s),window.removeEventListener("test",_s,_s)}catch{yc=!1}var Fr=yc?{passive:!1}:!1,IP=function(e){return e.tagName==="TEXTAREA"},Ny=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!IP(e)&&n[t]==="visible")},DP=function(e){return Ny(e,"overflowY")},$P=function(e){return Ny(e,"overflowX")},lh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=My(e,r);if(o){var i=Oy(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},FP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},zP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},My=function(e,t){return e==="v"?DP(t):$P(t)},Oy=function(e,t){return e==="v"?FP(t):zP(t)},UP=function(e,t){return e==="h"&&t==="rtl"?-1:1},BP=function(e,t,n,r,o){var i=UP(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,c=s>0,d=0,h=0;do{if(!a)break;var p=Oy(e,a),E=p[0],y=p[1],x=p[2],v=y-x-i*E;(E||v)&&My(e,a)&&(d+=v,h+=E);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(d)<1||!c&&Math.abs(h)<1)&&(u=!0),u},bs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},uh=function(e){return[e.deltaX,e.deltaY]},ch=function(e){return e&&"current"in e?e.current:e},VP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},WP=function(e){return` +`)},ah=function(){var e=parseInt(document.body.getAttribute(lo)||"0",10);return isFinite(e)?e:0},jP=function(){f.useEffect(function(){return document.body.setAttribute(lo,(ah()+1).toString()),function(){var e=ah()-1;e<=0?document.body.removeAttribute(lo):document.body.setAttribute(lo,e.toString())}},[])},IP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;jP();var i=f.useMemo(function(){return OP(o)},[o]);return f.createElement(AP,{styles:LP(i,!t,o,n?"":"!important")})},yc=!1;if(typeof window<"u")try{var _s=Object.defineProperty({},"passive",{get:function(){return yc=!0,!0}});window.addEventListener("test",_s,_s),window.removeEventListener("test",_s,_s)}catch{yc=!1}var Fr=yc?{passive:!1}:!1,DP=function(e){return e.tagName==="TEXTAREA"},Ny=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!DP(e)&&n[t]==="visible")},$P=function(e){return Ny(e,"overflowY")},FP=function(e){return Ny(e,"overflowX")},lh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=My(e,r);if(o){var i=Oy(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},UP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},My=function(e,t){return e==="v"?$P(t):FP(t)},Oy=function(e,t){return e==="v"?zP(t):UP(t)},BP=function(e,t){return e==="h"&&t==="rtl"?-1:1},VP=function(e,t,n,r,o){var i=BP(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,c=s>0,d=0,h=0;do{if(!a)break;var p=Oy(e,a),E=p[0],y=p[1],x=p[2],v=y-x-i*E;(E||v)&&My(e,a)&&(d+=v,h+=E);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(d)<1||!c&&Math.abs(h)<1)&&(u=!0),u},bs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},uh=function(e){return[e.deltaX,e.deltaY]},ch=function(e){return e&&"current"in e?e.current:e},WP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HP=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},HP=0,zr=[];function KP(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(HP++)[0],i=f.useState(Ry)[0],s=f.useRef(e);f.useEffect(function(){s.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=pP([e.lockRef.current],(e.shards||[]).map(ch),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=f.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var v=bs(y),m=n.current,w="deltaX"in y?y.deltaX:m[0]-v[0],S="deltaY"in y?y.deltaY:m[1]-v[1],C,_=y.target,P=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in y&&P==="h"&&_.type==="range")return!1;var R=window.getSelection(),L=R&&R.anchorNode,A=L?L===_||L.contains(_):!1;if(A)return!1;var z=lh(P,_);if(!z)return!0;if(z?C=P:(C=P==="v"?"h":"v",z=lh(P,_)),!z)return!1;if(!r.current&&"changedTouches"in y&&(w||S)&&(r.current=C),!C)return!0;var D=r.current||C;return BP(D,x,y,D==="h"?w:S)},[]),l=f.useCallback(function(y){var x=y;if(!(!zr.length||zr[zr.length-1]!==i)){var v="deltaY"in x?uh(x):bs(x),m=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&VP(C.delta,v)})[0];if(m&&m.should){x.cancelable&&x.preventDefault();return}if(!m){var w=(s.current.shards||[]).map(ch).filter(Boolean).filter(function(C){return C.contains(x.target)}),S=w.length>0?a(x,w[0]):!s.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=f.useCallback(function(y,x,v,m){var w={name:y,delta:x,target:v,should:m,shadowParent:qP(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),c=f.useCallback(function(y){n.current=bs(y),r.current=void 0},[]),d=f.useCallback(function(y){u(y.type,uh(y),y.target,a(y,e.lockRef.current))},[]),h=f.useCallback(function(y){u(y.type,bs(y),y.target,a(y,e.lockRef.current))},[]);f.useEffect(function(){return zr.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Fr),document.addEventListener("touchmove",l,Fr),document.addEventListener("touchstart",c,Fr),function(){zr=zr.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,Fr),document.removeEventListener("touchmove",l,Fr),document.removeEventListener("touchstart",c,Fr)}},[]);var p=e.removeScrollBar,E=e.inert;return f.createElement(f.Fragment,null,E?f.createElement(i,{styles:WP(o)}):null,p?f.createElement(jP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const GP=EP(Ty,KP);var Ay=f.forwardRef(function(e,t){return f.createElement(ol,Bt({},e,{ref:t,sideCar:GP}))});Ay.classNames=ol.classNames;var wc=["Enter"," "],QP=["ArrowDown","PageUp","Home"],Ly=["ArrowUp","PageDown","End"],YP=[...QP,...Ly],XP={ltr:[...wc,"ArrowRight"],rtl:[...wc,"ArrowLeft"]},JP={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qi="Menu",[ji,ZP,ek]=Ld(Qi),[Rr,jy]=kr(Qi,[ek,rl,xy]),il=rl(),Iy=xy(),[tk,Nr]=Rr(Qi),[nk,Yi]=Rr(Qi),Dy=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=il(t),[l,u]=f.useState(null),c=f.useRef(!1),d=Je(i),h=Vv(o);return f.useEffect(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),g.jsx(zb,{...a,children:g.jsx(tk,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:g.jsx(nk,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:h,modal:s,children:r})})})};Dy.displayName=Qi;var rk="MenuAnchor",Wd=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=il(n);return g.jsx(my,{...o,...r,ref:t})});Wd.displayName=rk;var Hd="MenuPortal",[ok,$y]=Rr(Hd,{forceMount:void 0}),Fy=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Nr(Hd,t);return g.jsx(ok,{scope:t,forceMount:n,children:g.jsx(Tr,{present:n||i.open,children:g.jsx(Vd,{asChild:!0,container:o,children:r})})})};Fy.displayName=Hd;var ht="MenuContent",[ik,Kd]=Rr(ht),zy=f.forwardRef((e,t)=>{const n=$y(ht,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Nr(ht,e.__scopeMenu),s=Yi(ht,e.__scopeMenu);return g.jsx(ji.Provider,{scope:e.__scopeMenu,children:g.jsx(Tr,{present:r||i.open,children:g.jsx(ji.Slot,{scope:e.__scopeMenu,children:s.modal?g.jsx(sk,{...o,ref:t}):g.jsx(ak,{...o,ref:t})})})})}),sk=f.forwardRef((e,t)=>{const n=Nr(ht,e.__scopeMenu),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const i=r.current;if(i)return fP(i)},[]),g.jsx(qd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ak=f.forwardRef((e,t)=>{const n=Nr(ht,e.__scopeMenu);return g.jsx(qd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),lk=rP("MenuContent.ScrollLock"),qd=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:E,...y}=e,x=Nr(ht,n),v=Yi(ht,n),m=il(n),w=Iy(n),S=ZP(n),[C,_]=f.useState(null),P=f.useRef(null),R=Re(t,P,x.onContentChange),L=f.useRef(0),A=f.useRef(""),z=f.useRef(0),D=f.useRef(null),K=f.useRef("right"),I=f.useRef(0),Y=E?Ay:f.Fragment,U=E?{as:lk,allowPinchZoom:!0}:void 0,H=k=>{var J,Gt;const j=A.current+k,B=S().filter(be=>!be.disabled),F=document.activeElement,G=(J=B.find(be=>be.ref.current===F))==null?void 0:J.textValue,X=B.map(be=>be.textValue),fe=xk(X,j,G),ye=(Gt=B.find(be=>be.textValue===fe))==null?void 0:Gt.ref.current;(function be(Lt){A.current=Lt,window.clearTimeout(L.current),Lt!==""&&(L.current=window.setTimeout(()=>be(""),1e3))})(j),ye&&setTimeout(()=>ye.focus())};f.useEffect(()=>()=>window.clearTimeout(L.current),[]),v_();const M=f.useCallback(k=>{var B,F;return K.current===((B=D.current)==null?void 0:B.side)&&Ek(k,(F=D.current)==null?void 0:F.area)},[]);return g.jsx(ik,{scope:n,searchRef:A,onItemEnter:f.useCallback(k=>{M(k)&&k.preventDefault()},[M]),onItemLeave:f.useCallback(k=>{var j;M(k)||((j=P.current)==null||j.focus(),_(null))},[M]),onTriggerLeave:f.useCallback(k=>{M(k)&&k.preventDefault()},[M]),pointerGraceTimerRef:z,onPointerGraceIntentChange:f.useCallback(k=>{D.current=k},[]),children:g.jsx(Y,{...U,children:g.jsx(qv,{asChild:!0,trapped:o,onMountAutoFocus:V(i,k=>{var j;k.preventDefault(),(j=P.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:g.jsx(Ja,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,children:g.jsx(tP,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:_,onEntryFocus:V(l,k=>{v.isUsingKeyboardRef.current||k.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(vy,{role:"menu","aria-orientation":"vertical","data-state":nw(x.open),"data-radix-menu-content":"",dir:v.dir,...m,...y,ref:R,style:{outline:"none",...y.style},onKeyDown:V(y.onKeyDown,k=>{const B=k.target.closest("[data-radix-menu-content]")===k.currentTarget,F=k.ctrlKey||k.altKey||k.metaKey,G=k.key.length===1;B&&(k.key==="Tab"&&k.preventDefault(),!F&&G&&H(k.key));const X=P.current;if(k.target!==X||!YP.includes(k.key))return;k.preventDefault();const ye=S().filter(J=>!J.disabled).map(J=>J.ref.current);Ly.includes(k.key)&&ye.reverse(),yk(ye)}),onBlur:V(e.onBlur,k=>{k.currentTarget.contains(k.target)||(window.clearTimeout(L.current),A.current="")}),onPointerMove:V(e.onPointerMove,Ii(k=>{const j=k.target,B=I.current!==k.clientX;if(k.currentTarget.contains(j)&&B){const F=k.clientX>I.current?"right":"left";K.current=F,I.current=k.clientX}}))})})})})})})});zy.displayName=ht;var uk="MenuGroup",Gd=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{role:"group",...r,ref:t})});Gd.displayName=uk;var ck="MenuLabel",Uy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});Uy.displayName=ck;var Pa="MenuItem",dh="menu.itemSelect",sl=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=f.useRef(null),s=Yi(Pa,e.__scopeMenu),a=Kd(Pa,e.__scopeMenu),l=Re(t,i),u=f.useRef(!1),c=()=>{const d=i.current;if(!n&&d){const h=new CustomEvent(dh,{bubbles:!0,cancelable:!0});d.addEventListener(dh,p=>r==null?void 0:r(p),{once:!0}),Ad(d,h),h.defaultPrevented?u.current=!1:s.onClose()}};return g.jsx(By,{...o,ref:l,disabled:n,onClick:V(e.onClick,c),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),u.current=!0},onPointerUp:V(e.onPointerUp,d=>{var h;u.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:V(e.onKeyDown,d=>{const h=a.searchRef.current!=="";n||h&&d.key===" "||wc.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});sl.displayName=Pa;var By=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Kd(Pa,n),a=Iy(n),l=f.useRef(null),u=Re(t,l),[c,d]=f.useState(!1),[h,p]=f.useState("");return f.useEffect(()=>{const E=l.current;E&&p((E.textContent??"").trim())},[i.children]),g.jsx(ji.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:g.jsx(nP,{asChild:!0,...a,focusable:!r,children:g.jsx(ve.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:V(e.onPointerMove,Ii(E=>{r?s.onItemLeave(E):(s.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,Ii(E=>s.onItemLeave(E))),onFocus:V(e.onFocus,()=>d(!0)),onBlur:V(e.onBlur,()=>d(!1))})})})}),dk="MenuCheckboxItem",Vy=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(Gy,{scope:e.__scopeMenu,checked:n,children:g.jsx(sl,{role:"menuitemcheckbox","aria-checked":ka(n)?"mixed":n,...o,ref:t,"data-state":Yd(n),onSelect:V(o.onSelect,()=>r==null?void 0:r(ka(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Vy.displayName=dk;var Wy="MenuRadioGroup",[fk,pk]=Rr(Wy,{value:void 0,onValueChange:()=>{}}),Hy=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Je(r);return g.jsx(fk,{scope:e.__scopeMenu,value:n,onValueChange:i,children:g.jsx(Gd,{...o,ref:t})})});Hy.displayName=Wy;var Ky="MenuRadioItem",qy=f.forwardRef((e,t)=>{const{value:n,...r}=e,o=pk(Ky,e.__scopeMenu),i=n===o.value;return g.jsx(Gy,{scope:e.__scopeMenu,checked:i,children:g.jsx(sl,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Yd(i),onSelect:V(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});qy.displayName=Ky;var Qd="MenuItemIndicator",[Gy,hk]=Rr(Qd,{checked:!1}),Qy=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=hk(Qd,n);return g.jsx(Tr,{present:r||ka(i.checked)||i.checked===!0,children:g.jsx(ve.span,{...o,ref:t,"data-state":Yd(i.checked)})})});Qy.displayName=Qd;var gk="MenuSeparator",Yy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Yy.displayName=gk;var mk="MenuArrow",Xy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=il(n);return g.jsx(yy,{...o,...r,ref:t})});Xy.displayName=mk;var vk="MenuSub",[sM,Jy]=Rr(vk),ti="MenuSubTrigger",Zy=f.forwardRef((e,t)=>{const n=Nr(ti,e.__scopeMenu),r=Yi(ti,e.__scopeMenu),o=Jy(ti,e.__scopeMenu),i=Kd(ti,e.__scopeMenu),s=f.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},c=f.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return f.useEffect(()=>c,[c]),f.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),g.jsx(Wd,{asChild:!0,...u,children:g.jsx(By,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":nw(n.open),...e,ref:Pr(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:V(e.onPointerMove,Ii(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:V(e.onPointerLeave,Ii(d=>{var p,E;c();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const y=(E=n.content)==null?void 0:E.dataset.side,x=y==="right",v=x?-5:5,m=h[x?"left":"right"],w=h[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:m,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:m,y:h.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:V(e.onKeyDown,d=>{var p;const h=i.searchRef.current!=="";e.disabled||h&&d.key===" "||XP[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});Zy.displayName=ti;var ew="MenuSubContent",tw=f.forwardRef((e,t)=>{const n=$y(ht,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Nr(ht,e.__scopeMenu),s=Yi(ht,e.__scopeMenu),a=Jy(ew,e.__scopeMenu),l=f.useRef(null),u=Re(t,l);return g.jsx(ji.Provider,{scope:e.__scopeMenu,children:g.jsx(Tr,{present:r||i.open,children:g.jsx(ji.Slot,{scope:e.__scopeMenu,children:g.jsx(qd,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:V(e.onFocusOutside,c=>{c.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:V(e.onEscapeKeyDown,c=>{s.onClose(),c.preventDefault()}),onKeyDown:V(e.onKeyDown,c=>{var p;const d=c.currentTarget.contains(c.target),h=JP[s.dir].includes(c.key);d&&h&&(i.onOpenChange(!1),(p=a.trigger)==null||p.focus(),c.preventDefault())})})})})})});tw.displayName=ew;function nw(e){return e?"open":"closed"}function ka(e){return e==="indeterminate"}function Yd(e){return ka(e)?"indeterminate":e?"checked":"unchecked"}function yk(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function wk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function xk(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=wk(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Sk(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=h>r&&n<(d-u)*(r-c)/(h-c)+u&&(o=!o)}return o}function Ek(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Sk(n,t)}function Ii(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ck=Dy,_k=Wd,bk=Fy,Pk=zy,kk=Gd,Tk=Uy,Rk=sl,Nk=Vy,Mk=Hy,Ok=qy,Ak=Qy,Lk=Yy,jk=Xy,Ik=Zy,Dk=tw,al="DropdownMenu",[$k]=kr(al,[jy]),He=jy(),[Fk,rw]=$k(al),ow=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=He(t),u=f.useRef(null),[c,d]=Od({prop:o,defaultProp:i??!1,onChange:s,caller:al});return g.jsx(Fk,{scope:t,triggerId:pc(),triggerRef:u,contentId:pc(),open:c,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(h=>!h),[d]),modal:a,children:g.jsx(Ck,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};ow.displayName=al;var iw="DropdownMenuTrigger",sw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=rw(iw,n),s=He(n);return g.jsx(_k,{asChild:!0,...s,children:g.jsx(ve.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Pr(t,i.triggerRef),onPointerDown:V(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:V(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});sw.displayName=iw;var zk="DropdownMenuPortal",aw=e=>{const{__scopeDropdownMenu:t,...n}=e,r=He(t);return g.jsx(bk,{...r,...n})};aw.displayName=zk;var lw="DropdownMenuContent",uw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=rw(lw,n),i=He(n),s=f.useRef(!1);return g.jsx(Pk,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:V(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:V(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!o.modal||c)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uw.displayName=lw;var Uk="DropdownMenuGroup",Bk=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(kk,{...o,...r,ref:t})});Bk.displayName=Uk;var Vk="DropdownMenuLabel",cw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Tk,{...o,...r,ref:t})});cw.displayName=Vk;var Wk="DropdownMenuItem",dw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Rk,{...o,...r,ref:t})});dw.displayName=Wk;var Hk="DropdownMenuCheckboxItem",fw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Nk,{...o,...r,ref:t})});fw.displayName=Hk;var Kk="DropdownMenuRadioGroup",qk=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Mk,{...o,...r,ref:t})});qk.displayName=Kk;var Gk="DropdownMenuRadioItem",pw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Ok,{...o,...r,ref:t})});pw.displayName=Gk;var Qk="DropdownMenuItemIndicator",hw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Ak,{...o,...r,ref:t})});hw.displayName=Qk;var Yk="DropdownMenuSeparator",gw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Lk,{...o,...r,ref:t})});gw.displayName=Yk;var Xk="DropdownMenuArrow",Jk=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(jk,{...o,...r,ref:t})});Jk.displayName=Xk;var Zk="DropdownMenuSubTrigger",mw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Ik,{...o,...r,ref:t})});mw.displayName=Zk;var eT="DropdownMenuSubContent",vw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Dk,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});vw.displayName=eT;var tT=ow,nT=sw,rT=aw,yw=uw,ww=cw,xw=dw,Sw=fw,Ew=pw,Cw=hw,_w=gw,bw=mw,Pw=vw;/** +`)},KP=0,zr=[];function qP(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(KP++)[0],i=f.useState(Ry)[0],s=f.useRef(e);f.useEffect(function(){s.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=hP([e.lockRef.current],(e.shards||[]).map(ch),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=f.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var v=bs(y),m=n.current,w="deltaX"in y?y.deltaX:m[0]-v[0],S="deltaY"in y?y.deltaY:m[1]-v[1],C,_=y.target,P=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in y&&P==="h"&&_.type==="range")return!1;var R=window.getSelection(),L=R&&R.anchorNode,A=L?L===_||L.contains(_):!1;if(A)return!1;var z=lh(P,_);if(!z)return!0;if(z?C=P:(C=P==="v"?"h":"v",z=lh(P,_)),!z)return!1;if(!r.current&&"changedTouches"in y&&(w||S)&&(r.current=C),!C)return!0;var D=r.current||C;return VP(D,x,y,D==="h"?w:S)},[]),l=f.useCallback(function(y){var x=y;if(!(!zr.length||zr[zr.length-1]!==i)){var v="deltaY"in x?uh(x):bs(x),m=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&WP(C.delta,v)})[0];if(m&&m.should){x.cancelable&&x.preventDefault();return}if(!m){var w=(s.current.shards||[]).map(ch).filter(Boolean).filter(function(C){return C.contains(x.target)}),S=w.length>0?a(x,w[0]):!s.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=f.useCallback(function(y,x,v,m){var w={name:y,delta:x,target:v,should:m,shadowParent:GP(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),c=f.useCallback(function(y){n.current=bs(y),r.current=void 0},[]),d=f.useCallback(function(y){u(y.type,uh(y),y.target,a(y,e.lockRef.current))},[]),h=f.useCallback(function(y){u(y.type,bs(y),y.target,a(y,e.lockRef.current))},[]);f.useEffect(function(){return zr.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Fr),document.addEventListener("touchmove",l,Fr),document.addEventListener("touchstart",c,Fr),function(){zr=zr.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,Fr),document.removeEventListener("touchmove",l,Fr),document.removeEventListener("touchstart",c,Fr)}},[]);var p=e.removeScrollBar,E=e.inert;return f.createElement(f.Fragment,null,E?f.createElement(i,{styles:HP(o)}):null,p?f.createElement(IP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function GP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const QP=CP(Ty,qP);var Ay=f.forwardRef(function(e,t){return f.createElement(ol,Bt({},e,{ref:t,sideCar:QP}))});Ay.classNames=ol.classNames;var wc=["Enter"," "],YP=["ArrowDown","PageUp","Home"],Ly=["ArrowUp","PageDown","End"],XP=[...YP,...Ly],JP={ltr:[...wc,"ArrowRight"],rtl:[...wc,"ArrowLeft"]},ZP={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qi="Menu",[ji,ek,tk]=Ld(Qi),[Rr,jy]=kr(Qi,[tk,rl,xy]),il=rl(),Iy=xy(),[nk,Nr]=Rr(Qi),[rk,Yi]=Rr(Qi),Dy=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=il(t),[l,u]=f.useState(null),c=f.useRef(!1),d=Je(i),h=Vv(o);return f.useEffect(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),g.jsx(Ub,{...a,children:g.jsx(nk,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:g.jsx(rk,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:h,modal:s,children:r})})})};Dy.displayName=Qi;var ok="MenuAnchor",Wd=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=il(n);return g.jsx(my,{...o,...r,ref:t})});Wd.displayName=ok;var Hd="MenuPortal",[ik,$y]=Rr(Hd,{forceMount:void 0}),Fy=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Nr(Hd,t);return g.jsx(ik,{scope:t,forceMount:n,children:g.jsx(Tr,{present:n||i.open,children:g.jsx(Vd,{asChild:!0,container:o,children:r})})})};Fy.displayName=Hd;var ht="MenuContent",[sk,Kd]=Rr(ht),zy=f.forwardRef((e,t)=>{const n=$y(ht,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Nr(ht,e.__scopeMenu),s=Yi(ht,e.__scopeMenu);return g.jsx(ji.Provider,{scope:e.__scopeMenu,children:g.jsx(Tr,{present:r||i.open,children:g.jsx(ji.Slot,{scope:e.__scopeMenu,children:s.modal?g.jsx(ak,{...o,ref:t}):g.jsx(lk,{...o,ref:t})})})})}),ak=f.forwardRef((e,t)=>{const n=Nr(ht,e.__scopeMenu),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const i=r.current;if(i)return pP(i)},[]),g.jsx(qd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),lk=f.forwardRef((e,t)=>{const n=Nr(ht,e.__scopeMenu);return g.jsx(qd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),uk=oP("MenuContent.ScrollLock"),qd=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:E,...y}=e,x=Nr(ht,n),v=Yi(ht,n),m=il(n),w=Iy(n),S=ek(n),[C,_]=f.useState(null),P=f.useRef(null),R=Re(t,P,x.onContentChange),L=f.useRef(0),A=f.useRef(""),z=f.useRef(0),D=f.useRef(null),K=f.useRef("right"),I=f.useRef(0),Y=E?Ay:f.Fragment,U=E?{as:uk,allowPinchZoom:!0}:void 0,H=k=>{var J,Gt;const j=A.current+k,B=S().filter(be=>!be.disabled),F=document.activeElement,G=(J=B.find(be=>be.ref.current===F))==null?void 0:J.textValue,X=B.map(be=>be.textValue),fe=Sk(X,j,G),ye=(Gt=B.find(be=>be.textValue===fe))==null?void 0:Gt.ref.current;(function be(Lt){A.current=Lt,window.clearTimeout(L.current),Lt!==""&&(L.current=window.setTimeout(()=>be(""),1e3))})(j),ye&&setTimeout(()=>ye.focus())};f.useEffect(()=>()=>window.clearTimeout(L.current),[]),y_();const M=f.useCallback(k=>{var B,F;return K.current===((B=D.current)==null?void 0:B.side)&&Ck(k,(F=D.current)==null?void 0:F.area)},[]);return g.jsx(sk,{scope:n,searchRef:A,onItemEnter:f.useCallback(k=>{M(k)&&k.preventDefault()},[M]),onItemLeave:f.useCallback(k=>{var j;M(k)||((j=P.current)==null||j.focus(),_(null))},[M]),onTriggerLeave:f.useCallback(k=>{M(k)&&k.preventDefault()},[M]),pointerGraceTimerRef:z,onPointerGraceIntentChange:f.useCallback(k=>{D.current=k},[]),children:g.jsx(Y,{...U,children:g.jsx(qv,{asChild:!0,trapped:o,onMountAutoFocus:V(i,k=>{var j;k.preventDefault(),(j=P.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:g.jsx(Ja,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,children:g.jsx(nP,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:_,onEntryFocus:V(l,k=>{v.isUsingKeyboardRef.current||k.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(vy,{role:"menu","aria-orientation":"vertical","data-state":nw(x.open),"data-radix-menu-content":"",dir:v.dir,...m,...y,ref:R,style:{outline:"none",...y.style},onKeyDown:V(y.onKeyDown,k=>{const B=k.target.closest("[data-radix-menu-content]")===k.currentTarget,F=k.ctrlKey||k.altKey||k.metaKey,G=k.key.length===1;B&&(k.key==="Tab"&&k.preventDefault(),!F&&G&&H(k.key));const X=P.current;if(k.target!==X||!XP.includes(k.key))return;k.preventDefault();const ye=S().filter(J=>!J.disabled).map(J=>J.ref.current);Ly.includes(k.key)&&ye.reverse(),wk(ye)}),onBlur:V(e.onBlur,k=>{k.currentTarget.contains(k.target)||(window.clearTimeout(L.current),A.current="")}),onPointerMove:V(e.onPointerMove,Ii(k=>{const j=k.target,B=I.current!==k.clientX;if(k.currentTarget.contains(j)&&B){const F=k.clientX>I.current?"right":"left";K.current=F,I.current=k.clientX}}))})})})})})})});zy.displayName=ht;var ck="MenuGroup",Gd=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{role:"group",...r,ref:t})});Gd.displayName=ck;var dk="MenuLabel",Uy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});Uy.displayName=dk;var Pa="MenuItem",dh="menu.itemSelect",sl=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=f.useRef(null),s=Yi(Pa,e.__scopeMenu),a=Kd(Pa,e.__scopeMenu),l=Re(t,i),u=f.useRef(!1),c=()=>{const d=i.current;if(!n&&d){const h=new CustomEvent(dh,{bubbles:!0,cancelable:!0});d.addEventListener(dh,p=>r==null?void 0:r(p),{once:!0}),Ad(d,h),h.defaultPrevented?u.current=!1:s.onClose()}};return g.jsx(By,{...o,ref:l,disabled:n,onClick:V(e.onClick,c),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),u.current=!0},onPointerUp:V(e.onPointerUp,d=>{var h;u.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:V(e.onKeyDown,d=>{const h=a.searchRef.current!=="";n||h&&d.key===" "||wc.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});sl.displayName=Pa;var By=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Kd(Pa,n),a=Iy(n),l=f.useRef(null),u=Re(t,l),[c,d]=f.useState(!1),[h,p]=f.useState("");return f.useEffect(()=>{const E=l.current;E&&p((E.textContent??"").trim())},[i.children]),g.jsx(ji.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:g.jsx(rP,{asChild:!0,...a,focusable:!r,children:g.jsx(ve.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:V(e.onPointerMove,Ii(E=>{r?s.onItemLeave(E):(s.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,Ii(E=>s.onItemLeave(E))),onFocus:V(e.onFocus,()=>d(!0)),onBlur:V(e.onBlur,()=>d(!1))})})})}),fk="MenuCheckboxItem",Vy=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(Gy,{scope:e.__scopeMenu,checked:n,children:g.jsx(sl,{role:"menuitemcheckbox","aria-checked":ka(n)?"mixed":n,...o,ref:t,"data-state":Yd(n),onSelect:V(o.onSelect,()=>r==null?void 0:r(ka(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Vy.displayName=fk;var Wy="MenuRadioGroup",[pk,hk]=Rr(Wy,{value:void 0,onValueChange:()=>{}}),Hy=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Je(r);return g.jsx(pk,{scope:e.__scopeMenu,value:n,onValueChange:i,children:g.jsx(Gd,{...o,ref:t})})});Hy.displayName=Wy;var Ky="MenuRadioItem",qy=f.forwardRef((e,t)=>{const{value:n,...r}=e,o=hk(Ky,e.__scopeMenu),i=n===o.value;return g.jsx(Gy,{scope:e.__scopeMenu,checked:i,children:g.jsx(sl,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Yd(i),onSelect:V(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});qy.displayName=Ky;var Qd="MenuItemIndicator",[Gy,gk]=Rr(Qd,{checked:!1}),Qy=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=gk(Qd,n);return g.jsx(Tr,{present:r||ka(i.checked)||i.checked===!0,children:g.jsx(ve.span,{...o,ref:t,"data-state":Yd(i.checked)})})});Qy.displayName=Qd;var mk="MenuSeparator",Yy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Yy.displayName=mk;var vk="MenuArrow",Xy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=il(n);return g.jsx(yy,{...o,...r,ref:t})});Xy.displayName=vk;var yk="MenuSub",[aM,Jy]=Rr(yk),ti="MenuSubTrigger",Zy=f.forwardRef((e,t)=>{const n=Nr(ti,e.__scopeMenu),r=Yi(ti,e.__scopeMenu),o=Jy(ti,e.__scopeMenu),i=Kd(ti,e.__scopeMenu),s=f.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},c=f.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return f.useEffect(()=>c,[c]),f.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),g.jsx(Wd,{asChild:!0,...u,children:g.jsx(By,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":nw(n.open),...e,ref:Pr(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:V(e.onPointerMove,Ii(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:V(e.onPointerLeave,Ii(d=>{var p,E;c();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const y=(E=n.content)==null?void 0:E.dataset.side,x=y==="right",v=x?-5:5,m=h[x?"left":"right"],w=h[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:m,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:m,y:h.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:V(e.onKeyDown,d=>{var p;const h=i.searchRef.current!=="";e.disabled||h&&d.key===" "||JP[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});Zy.displayName=ti;var ew="MenuSubContent",tw=f.forwardRef((e,t)=>{const n=$y(ht,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Nr(ht,e.__scopeMenu),s=Yi(ht,e.__scopeMenu),a=Jy(ew,e.__scopeMenu),l=f.useRef(null),u=Re(t,l);return g.jsx(ji.Provider,{scope:e.__scopeMenu,children:g.jsx(Tr,{present:r||i.open,children:g.jsx(ji.Slot,{scope:e.__scopeMenu,children:g.jsx(qd,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:V(e.onFocusOutside,c=>{c.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:V(e.onEscapeKeyDown,c=>{s.onClose(),c.preventDefault()}),onKeyDown:V(e.onKeyDown,c=>{var p;const d=c.currentTarget.contains(c.target),h=ZP[s.dir].includes(c.key);d&&h&&(i.onOpenChange(!1),(p=a.trigger)==null||p.focus(),c.preventDefault())})})})})})});tw.displayName=ew;function nw(e){return e?"open":"closed"}function ka(e){return e==="indeterminate"}function Yd(e){return ka(e)?"indeterminate":e?"checked":"unchecked"}function wk(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function xk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Sk(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=xk(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Ek(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=h>r&&n<(d-u)*(r-c)/(h-c)+u&&(o=!o)}return o}function Ck(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Ek(n,t)}function Ii(e){return t=>t.pointerType==="mouse"?e(t):void 0}var _k=Dy,bk=Wd,Pk=Fy,kk=zy,Tk=Gd,Rk=Uy,Nk=sl,Mk=Vy,Ok=Hy,Ak=qy,Lk=Qy,jk=Yy,Ik=Xy,Dk=Zy,$k=tw,al="DropdownMenu",[Fk]=kr(al,[jy]),He=jy(),[zk,rw]=Fk(al),ow=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=He(t),u=f.useRef(null),[c,d]=Od({prop:o,defaultProp:i??!1,onChange:s,caller:al});return g.jsx(zk,{scope:t,triggerId:pc(),triggerRef:u,contentId:pc(),open:c,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(h=>!h),[d]),modal:a,children:g.jsx(_k,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};ow.displayName=al;var iw="DropdownMenuTrigger",sw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=rw(iw,n),s=He(n);return g.jsx(bk,{asChild:!0,...s,children:g.jsx(ve.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Pr(t,i.triggerRef),onPointerDown:V(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:V(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});sw.displayName=iw;var Uk="DropdownMenuPortal",aw=e=>{const{__scopeDropdownMenu:t,...n}=e,r=He(t);return g.jsx(Pk,{...r,...n})};aw.displayName=Uk;var lw="DropdownMenuContent",uw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=rw(lw,n),i=He(n),s=f.useRef(!1);return g.jsx(kk,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:V(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:V(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!o.modal||c)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uw.displayName=lw;var Bk="DropdownMenuGroup",Vk=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Tk,{...o,...r,ref:t})});Vk.displayName=Bk;var Wk="DropdownMenuLabel",cw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Rk,{...o,...r,ref:t})});cw.displayName=Wk;var Hk="DropdownMenuItem",dw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Nk,{...o,...r,ref:t})});dw.displayName=Hk;var Kk="DropdownMenuCheckboxItem",fw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Mk,{...o,...r,ref:t})});fw.displayName=Kk;var qk="DropdownMenuRadioGroup",Gk=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Ok,{...o,...r,ref:t})});Gk.displayName=qk;var Qk="DropdownMenuRadioItem",pw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Ak,{...o,...r,ref:t})});pw.displayName=Qk;var Yk="DropdownMenuItemIndicator",hw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Lk,{...o,...r,ref:t})});hw.displayName=Yk;var Xk="DropdownMenuSeparator",gw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(jk,{...o,...r,ref:t})});gw.displayName=Xk;var Jk="DropdownMenuArrow",Zk=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Ik,{...o,...r,ref:t})});Zk.displayName=Jk;var eT="DropdownMenuSubTrigger",mw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Dk,{...o,...r,ref:t})});mw.displayName=eT;var tT="DropdownMenuSubContent",vw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx($k,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});vw.displayName=tT;var nT=ow,rT=sw,oT=aw,yw=uw,ww=cw,xw=dw,Sw=fw,Ew=pw,Cw=hw,_w=gw,bw=mw,Pw=vw;/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kw=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + */const iT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kw=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var iT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var sT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sT=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>f.createElement("svg",{ref:l,...iT,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kw("lucide",o),...a},[...s.map(([u,c])=>f.createElement(u,c)),...Array.isArray(i)?i:[i]]));/** + */const aT=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>f.createElement("svg",{ref:l,...sT,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kw("lucide",o),...a},[...s.map(([u,c])=>f.createElement(u,c)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ll=(e,t)=>{const n=f.forwardRef(({className:r,...o},i)=>f.createElement(sT,{ref:i,iconNode:t,className:kw(`lucide-${oT(e)}`,r),...o}));return n.displayName=`${e}`,n};/** + */const ll=(e,t)=>{const n=f.forwardRef(({className:r,...o},i)=>f.createElement(aT,{ref:i,iconNode:t,className:kw(`lucide-${iT(e)}`,r),...o}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aT=ll("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const lT=ll("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lT=ll("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const uT=ll("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uT=ll("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const cT=ll("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cT=ll("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),dT=tT,fT=nT,pT=f.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(bw,{ref:o,className:Ne("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",t&&"pl-8",e),...r,children:[n,g.jsx(lT,{className:"ml-auto h-4 w-4"})]}));pT.displayName=bw.displayName;const hT=f.forwardRef(({className:e,...t},n)=>g.jsx(Pw,{ref:n,className:Ne("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",e),...t}));hT.displayName=Pw.displayName;const Tw=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(rT,{children:g.jsx(yw,{ref:r,sideOffset:t,className:Ne("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",e),...n})}));Tw.displayName=yw.displayName;const It=f.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(xw,{ref:r,className:Ne("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",t&&"pl-8",e),...n}));It.displayName=xw.displayName;const gT=f.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(Sw,{ref:o,className:Ne("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",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Cw,{children:g.jsx(aT,{className:"h-4 w-4"})})}),t]}));gT.displayName=Sw.displayName;const mT=f.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(Ew,{ref:r,className:Ne("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",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Cw,{children:g.jsx(uT,{className:"h-2 w-2 fill-current"})})}),t]}));mT.displayName=Ew.displayName;const Rw=f.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(ww,{ref:r,className:Ne("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Rw.displayName=ww.displayName;const xc=f.forwardRef(({className:e,...t},n)=>g.jsx(_w,{ref:n,className:Ne("-mx-1 my-1 h-px bg-muted",e),...t}));xc.displayName=_w.displayName;function vT(e){const n=(e.name||e.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 yT=({user:e,onLogout:t})=>g.jsxs(dT,{children:[g.jsx(fT,{asChild:!0,children:g.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:g.jsxs(zv,{className:"h-8 w-8",children:[e.avatar_url&&g.jsx(Uv,{src:e.avatar_url,alt:e.username}),g.jsx(Bv,{className:"text-xs",children:vT(e)})]})})}),g.jsxs(Tw,{align:"end",className:"w-56",children:[g.jsxs(Rw,{className:"flex flex-col gap-0.5 py-2",children:[g.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),g.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&g.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"}),e.role==="contributor"&&g.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"})]}),g.jsx(xc,{}),g.jsx(It,{asChild:!0,children:g.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),xa()&&g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/chat",children:"Chat"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/frameworks",children:"Frameworks"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/trends",children:"Trends"})}),e.is_admin&&g.jsxs(g.Fragment,{children:[g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/admin-dashboard",children:"Admin dashboard"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/submissions",children:"Review submissions"})})]}),e.can_contribute&&g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/contributions",children:"My contributions"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/settings",children:"Settings"})}),g.jsx(xc,{}),g.jsx(It,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),Nw=T.createContext(null),fh="pwc:auth-stale";async function wT(){if(Ki())return null;const e=await fetch(io("/api/v1/auth/me"),{credentials:"include",cache:"no-store"});return e.status===401||!e.ok?null:await e.json()}const xT=({children:e})=>{const[t,n]=T.useState(null),[r,o]=T.useState(!0),i=T.useCallback(async()=>{o(!0);const l=await wT();n(l),o(!1)},[]),s=T.useCallback(async()=>{const l=Xa("/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 fetch(io("/api/v1/auth/logout"),{method:"POST",credentials:"include"}),n(null)},[]);T.useEffect(()=>{i()},[i]),T.useEffect(()=>{const l=()=>n(null);return window.addEventListener(fh,l),()=>window.removeEventListener(fh,l)},[]);const a=T.useMemo(()=>({user:t,isLoading:r,refresh:i,logout:s}),[t,r,i,s]);return g.jsx(Nw.Provider,{value:a,children:e})};function Xd(){const e=T.useContext(Nw);if(!e)throw new Error("useAuth must be used inside an ");return e}const Yo=({name:e,size:t=14})=>{const n={search:g.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:g.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:g.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:g.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return g.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},ph="https://github.com/huggingface/paperswithcode-feedback/issues",ST="https://github.com/huggingface/pwc-cli",hh=[{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}],ET=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgentData,t=(e==null?void 0:e.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(t)},CT=()=>{const[e,t]=T.useState(!1);return T.useEffect(()=>{t(ET())},[]),g.jsx("kbd",{children:e?"⌘K":"Ctrl K"})},_T=({onOpenSearch:e})=>{const[t,n]=T.useState(!1),r=()=>n(!1),{user:o,logout:i}=Xd(),s=pn(),a=xa()&&(s.pathname==="/chat"||s.pathname.startsWith("/chat/")),l=`${s.pathname}${s.search}`||"/",u=Ki();return g.jsxs(g.Fragment,{children:[g.jsxs("header",{className:`app-header${a?" app-header-chat":""}`,children:[g.jsxs("div",{className:"app-header-inner",children:[g.jsxs(Dr,{to:"/",className:"brand",onClick:r,children:[g.jsx("span",{className:"brand-mark"}),g.jsxs("span",{className:"brand-name",children:["Papers ",g.jsx("em",{children:"With Code"})]})]}),g.jsx("nav",{className:"nav",children:hh.map(({to:c,label:d,end:h})=>g.jsx(Dr,{to:c,end:h,className:({isActive:p})=>`nav-item ${p?"active":""}`,children:d},c))}),g.jsx("div",{className:"header-spacer"}),g.jsx("a",{className:"feedback-link header-feedback-link",href:ph,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),g.jsxs("button",{className:"search-trigger",onClick:e,children:[g.jsx(Yo,{name:"search",size:13}),g.jsx("span",{children:"Search papers, authors, domains…"}),g.jsx(CT,{})]}),g.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:g.jsx(Yo,{name:"search",size:14})}),!u&&g.jsx(Dr,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:g.jsx(Yo,{name:"bookmark",size:13})}),u?null:o?g.jsx(yT,{user:o,onLogout:i}):g.jsx(wv,{returnTo:l}),g.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(c=>!c),children:g.jsx(Yo,{name:t?"close":"menu",size:14})})]}),g.jsxs("div",{className:"site-announcement",role:"status",children:[g.jsx("span",{children:"New: Papers with Code CLI and Skill now "}),g.jsx("a",{href:ST,target:"_blank",rel:"noreferrer",children:"available"})]})]}),t&&g.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:g.jsxs("div",{className:"mobile-nav-panel",onClick:c=>c.stopPropagation(),children:[g.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),e()},children:[g.jsx(Yo,{name:"search",size:14}),g.jsx("span",{children:"Search papers, authors, domains…"})]}),hh.map(({to:c,label:d,end:h})=>g.jsx(Dr,{to:c,end:h,className:"mobile-nav-link",onClick:r,children:d},c)),g.jsx("a",{className:"mobile-nav-link",href:ph,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!u&&g.jsx(Dr,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),!u&&(o==null?void 0:o.is_admin)&&g.jsx(Dr,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:r,children:"Admin dashboard"})]})})]})},bT=1,PT=1e6;let iu=0;function kT(){return iu=(iu+1)%Number.MAX_SAFE_INTEGER,iu.toString()}const su=new Map,gh=e=>{if(su.has(e))return;const t=setTimeout(()=>{su.delete(e),di({type:"REMOVE_TOAST",toastId:e})},PT);su.set(e,t)},TT=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,bT)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?gh(n):e.toasts.forEach(r=>{gh(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Vs=[];let Ws={toasts:[]};function di(e){Ws=TT(Ws,e),Vs.forEach(t=>{t(Ws)})}function RT({...e}){const t=kT(),n=o=>di({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>di({type:"DISMISS_TOAST",toastId:t});return di({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function NT(){const[e,t]=f.useState(Ws);return f.useEffect(()=>(Vs.push(t),()=>{const n=Vs.indexOf(t);n>-1&&Vs.splice(n,1)}),[e]),{...e,toast:RT,dismiss:n=>di({type:"DISMISS_TOAST",toastId:n})}}var MT=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"}),OT="VisuallyHidden",ul=f.forwardRef((e,t)=>g.jsx(ve.span,{...e,ref:t,style:{...MT,...e.style}}));ul.displayName=OT;var AT=ul,Jd="ToastProvider",[Zd,LT,jT]=Ld("Toast"),[Mw]=kr("Toast",[jT]),[IT,cl]=Mw(Jd),Ow=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=f.useState(null),[u,c]=f.useState(0),d=f.useRef(!1),h=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Jd}\`. Expected non-empty \`string\`.`),g.jsx(Zd.Provider,{scope:t,children:g.jsx(IT,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>c(p=>p+1),[]),onToastRemove:f.useCallback(()=>c(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:h,children:s})})};Ow.displayName=Jd;var Aw="ToastViewport",DT=["F8"],Sc="toast.viewportPause",Ec="toast.viewportResume",Lw=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=DT,label:o="Notifications ({hotkey})",...i}=e,s=cl(Aw,n),a=LT(n),l=f.useRef(null),u=f.useRef(null),c=f.useRef(null),d=f.useRef(null),h=Re(t,d,s.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=s.toastCount>0;f.useEffect(()=>{const x=v=>{var w;r.length!==0&&r.every(S=>v[S]||v.code===S)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=l.current,v=d.current;if(E&&x&&v){const m=()=>{if(!s.isClosePausedRef.current){const _=new CustomEvent(Sc);v.dispatchEvent(_),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const _=new CustomEvent(Ec);v.dispatchEvent(_),s.isClosePausedRef.current=!1}},S=_=>{!x.contains(_.relatedTarget)&&w()},C=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",m),x.addEventListener("focusout",S),x.addEventListener("pointermove",m),x.addEventListener("pointerleave",C),window.addEventListener("blur",m),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",m),x.removeEventListener("focusout",S),x.removeEventListener("pointermove",m),x.removeEventListener("pointerleave",C),window.removeEventListener("blur",m),window.removeEventListener("focus",w)}}},[E,s.isClosePausedRef]);const y=f.useCallback(({tabbingDirection:x})=>{const m=a().map(w=>{const S=w.ref.current,C=[S,...YT(S)];return x==="forwards"?C:C.reverse()});return(x==="forwards"?m.reverse():m).flat()},[a]);return f.useEffect(()=>{const x=d.current;if(x){const v=m=>{var C,_,P;const w=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!w){const R=document.activeElement,L=m.shiftKey;if(m.target===x&&L){(C=u.current)==null||C.focus();return}const D=y({tabbingDirection:L?"backwards":"forwards"}),K=D.findIndex(I=>I===R);au(D.slice(K+1))?m.preventDefault():L?(_=u.current)==null||_.focus():(P=c.current)==null||P.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,y]),g.jsxs(m_,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&g.jsx(Cc,{ref:u,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});au(x)}}),g.jsx(Zd.Slot,{scope:n,children:g.jsx(ve.ol,{tabIndex:-1,...i,ref:h})}),E&&g.jsx(Cc,{ref:c,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});au(x)}})]})});Lw.displayName=Aw;var jw="ToastFocusProxy",Cc=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=cl(jw,n);return g.jsx(ul,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});Cc.displayName=jw;var Xi="Toast",$T="toast.swipeStart",FT="toast.swipeMove",zT="toast.swipeCancel",UT="toast.swipeEnd",Iw=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a,l]=Od({prop:r,defaultProp:o??!0,onChange:i,caller:Xi});return g.jsx(Tr,{present:n||a,children:g.jsx(WT,{open:a,...s,ref:t,onClose:()=>l(!1),onPause:Je(e.onPause),onResume:Je(e.onResume),onSwipeStart:V(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:V(e.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:V(e.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:V(e.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)})})})});Iw.displayName=Xi;var[BT,VT]=Mw(Xi,{onClose(){}}),WT=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:h,onSwipeEnd:p,...E}=e,y=cl(Xi,n),[x,v]=f.useState(null),m=Re(t,I=>v(I)),w=f.useRef(null),S=f.useRef(null),C=o||y.duration,_=f.useRef(0),P=f.useRef(C),R=f.useRef(0),{onToastAdd:L,onToastRemove:A}=y,z=Je(()=>{var Y;(x==null?void 0:x.contains(document.activeElement))&&((Y=y.viewport)==null||Y.focus()),s()}),D=f.useCallback(I=>{!I||I===1/0||(window.clearTimeout(R.current),_.current=new Date().getTime(),R.current=window.setTimeout(z,I))},[z]);f.useEffect(()=>{const I=y.viewport;if(I){const Y=()=>{D(P.current),u==null||u()},U=()=>{const H=new Date().getTime()-_.current;P.current=P.current-H,window.clearTimeout(R.current),l==null||l()};return I.addEventListener(Sc,U),I.addEventListener(Ec,Y),()=>{I.removeEventListener(Sc,U),I.removeEventListener(Ec,Y)}}},[y.viewport,C,l,u,D]),f.useEffect(()=>{i&&!y.isClosePausedRef.current&&D(C)},[i,C,y.isClosePausedRef,D]),f.useEffect(()=>(L(),()=>A()),[L,A]);const K=f.useMemo(()=>x?Vw(x):null,[x]);return y.viewport?g.jsxs(g.Fragment,{children:[K&&g.jsx(HT,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:K}),g.jsx(BT,{scope:n,onClose:z,children:Hi.createPortal(g.jsx(Zd.ItemSlot,{scope:n,children:g.jsx(g_,{asChild:!0,onEscapeKeyDown:V(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||z(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:g.jsx(ve.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...E,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:V(e.onKeyDown,I=>{I.key==="Escape"&&(a==null||a(I.nativeEvent),I.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:V(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:V(e.onPointerMove,I=>{if(!w.current)return;const Y=I.clientX-w.current.x,U=I.clientY-w.current.y,H=!!S.current,M=["left","right"].includes(y.swipeDirection),k=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,j=M?k(0,Y):0,B=M?0:k(0,U),F=I.pointerType==="touch"?10:2,G={x:j,y:B},X={originalEvent:I,delta:G};H?(S.current=G,Ps(FT,d,X,{discrete:!1})):mh(G,y.swipeDirection,F)?(S.current=G,Ps($T,c,X,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(Y)>F||Math.abs(U)>F)&&(w.current=null)}),onPointerUp:V(e.onPointerUp,I=>{const Y=S.current,U=I.target;if(U.hasPointerCapture(I.pointerId)&&U.releasePointerCapture(I.pointerId),S.current=null,w.current=null,Y){const H=I.currentTarget,M={originalEvent:I,delta:Y};mh(Y,y.swipeDirection,y.swipeThreshold)?Ps(UT,p,M,{discrete:!0}):Ps(zT,h,M,{discrete:!0}),H.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),HT=e=>{const{__scopeToast:t,children:n,...r}=e,o=cl(Xi,t),[i,s]=f.useState(!1),[a,l]=f.useState(!1);return GT(()=>s(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:g.jsx(Vd,{asChild:!0,children:g.jsx(ul,{...r,children:i&&g.jsxs(g.Fragment,{children:[o.label," ",n]})})})},KT="ToastTitle",Dw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});Dw.displayName=KT;var qT="ToastDescription",$w=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});$w.displayName=qT;var Fw="ToastAction",zw=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?g.jsx(Bw,{altText:n,asChild:!0,children:g.jsx(ef,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Fw}\`. Expected non-empty \`string\`.`),null)});zw.displayName=Fw;var Uw="ToastClose",ef=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=VT(Uw,n);return g.jsx(Bw,{asChild:!0,children:g.jsx(ve.button,{type:"button",...r,ref:t,onClick:V(e.onClick,o.onClose)})})});ef.displayName=Uw;var Bw=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return g.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Vw(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),QT(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...Vw(r))}}),t}function Ps(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ad(o,i):o.dispatchEvent(i)}var mh=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function GT(e=()=>{}){const t=Je(e);vt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function QT(e){return e.nodeType===e.ELEMENT_NODE}function YT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function au(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var XT=Ow,Ww=Lw,Hw=Iw,Kw=Dw,qw=$w,Gw=zw,Qw=ef;const vh=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yh=Lv,JT=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const h=vh(c)||vh(d);return o[u][h]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,h]=c;return h===void 0||(u[d]=h),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:h,...p}=c;return Object.entries(p).every(E=>{let[y,x]=E;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...u,d,h]:u},[]);return yh(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},ZT=XT,Yw=f.forwardRef(({className:e,...t},n)=>g.jsx(Ww,{ref:n,className:Ne("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]",e),...t}));Yw.displayName=Ww.displayName;const eR=JT("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 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"}}),Xw=f.forwardRef(({className:e,variant:t,...n},r)=>g.jsx(Hw,{ref:r,className:Ne(eR({variant:t}),e),...n}));Xw.displayName=Hw.displayName;const tR=f.forwardRef(({className:e,...t},n)=>g.jsx(Gw,{ref:n,className:Ne("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",e),...t}));tR.displayName=Gw.displayName;const Jw=f.forwardRef(({className:e,...t},n)=>g.jsx(Qw,{ref:n,className:Ne("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:g.jsx(cT,{className:"h-4 w-4"})}));Jw.displayName=Qw.displayName;const Zw=f.forwardRef(({className:e,...t},n)=>g.jsx(Kw,{ref:n,className:Ne("text-sm font-semibold",e),...t}));Zw.displayName=Kw.displayName;const e0=f.forwardRef(({className:e,...t},n)=>g.jsx(qw,{ref:n,className:Ne("text-sm opacity-90",e),...t}));e0.displayName=qw.displayName;function nR(){const{toasts:e}=NT();return g.jsxs(ZT,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return g.jsxs(Xw,{...i,children:[g.jsxs("div",{className:"grid gap-1",children:[n&&g.jsx(Zw,{children:n}),r&&g.jsx(e0,{children:r})]}),o,g.jsx(Jw,{})]},t)}),g.jsx(Yw,{})]})}var rR=e=>{switch(e){case"success":return sR;case"info":return lR;case"warning":return aR;case"error":return uR;default:return null}},oR=Array(12).fill(0),iR=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},oR.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),sR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),aR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.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"})),lR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),uR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),cR=T.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"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),dR=()=>{let[e,t]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},_c=1,fR=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:_c++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,i,s=r.then(async l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(hR(l)&&!l.ok){o=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,c=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:u,description:c})}else if(t.success!==void 0){o=!1;let u=typeof t.success=="function"?await t.success(l):t.success,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let u=typeof t.error=="function"?await t.error(l):t.error,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,u)=>s.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=(e,t)=>{let n=(t==null?void 0:t.id)||_c++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ke=new fR,pR=(e,t)=>{let n=(t==null?void 0:t.id)||_c++;return Ke.addToast({title:e,...t,id:n}),n},hR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",gR=pR,mR=()=>Ke.toasts,vR=()=>Ke.getActiveToasts();Object.assign(gR,{success:Ke.success,info:Ke.info,warning:Ke.warning,error:Ke.error,custom:Ke.custom,message:Ke.message,promise:Ke.promise,dismiss:Ke.dismiss,loading:Ke.loading},{getHistory:mR,getToasts:vR});function yR(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}yR(`: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 ks(e){return e.label!==void 0}var wR=3,xR="32px",SR="16px",wh=4e3,ER=356,CR=14,_R=20,bR=200;function Ct(...e){return e.filter(Boolean).join(" ")}function PR(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var kR=e=>{var t,n,r,o,i,s,a,l,u,c,d;let{invert:h,toast:p,unstyled:E,interacting:y,setHeights:x,visibleToasts:v,heights:m,index:w,toasts:S,expanded:C,removeToast:_,defaultRichColors:P,closeButton:R,style:L,cancelButtonStyle:A,actionButtonStyle:z,className:D="",descriptionClassName:K="",duration:I,position:Y,gap:U,loadingIcon:H,expandByDefault:M,classNames:k,icons:j,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:F}=e,[G,X]=T.useState(null),[fe,ye]=T.useState(null),[J,Gt]=T.useState(!1),[be,Lt]=T.useState(!1),[gn,Mr]=T.useState(!1),[mn,Ji]=T.useState(!1),[pl,Zi]=T.useState(!1),[hl,$o]=T.useState(0),[Or,nf]=T.useState(0),Fo=T.useRef(p.duration||I||wh),rf=T.useRef(null),tr=T.useRef(null),d0=w===0,f0=w+1<=v,lt=p.type,Ar=p.dismissible!==!1,p0=p.className||"",h0=p.descriptionClassName||"",es=T.useMemo(()=>m.findIndex(q=>q.toastId===p.id)||0,[m,p.id]),g0=T.useMemo(()=>{var q;return(q=p.closeButton)!=null?q:R},[p.closeButton,R]),of=T.useMemo(()=>p.duration||I||wh,[p.duration,I]),gl=T.useRef(0),Lr=T.useRef(0),sf=T.useRef(0),jr=T.useRef(null),[m0,v0]=Y.split("-"),af=T.useMemo(()=>m.reduce((q,oe,ce)=>ce>=es?q:q+oe.height,0),[m,es]),lf=dR(),y0=p.invert||h,ml=lt==="loading";Lr.current=T.useMemo(()=>es*U+af,[es,af]),T.useEffect(()=>{Fo.current=of},[of]),T.useEffect(()=>{Gt(!0)},[]),T.useEffect(()=>{let q=tr.current;if(q){let oe=q.getBoundingClientRect().height;return nf(oe),x(ce=>[{toastId:p.id,height:oe,position:p.position},...ce]),()=>x(ce=>ce.filter(yt=>yt.toastId!==p.id))}},[x,p.id]),T.useLayoutEffect(()=>{if(!J)return;let q=tr.current,oe=q.style.height;q.style.height="auto";let ce=q.getBoundingClientRect().height;q.style.height=oe,nf(ce),x(yt=>yt.find(wt=>wt.toastId===p.id)?yt.map(wt=>wt.toastId===p.id?{...wt,height:ce}:wt):[{toastId:p.id,height:ce,position:p.position},...yt])},[J,p.title,p.description,x,p.id]);let vn=T.useCallback(()=>{Lt(!0),$o(Lr.current),x(q=>q.filter(oe=>oe.toastId!==p.id)),setTimeout(()=>{_(p)},bR)},[p,_,x,Lr]);T.useEffect(()=>{if(p.promise&<==="loading"||p.duration===1/0||p.type==="loading")return;let q;return C||y||F&&lf?(()=>{if(sf.current{var oe;(oe=p.onAutoClose)==null||oe.call(p,p),vn()},Fo.current)),()=>clearTimeout(q)},[C,y,p,lt,F,lf,vn]),T.useEffect(()=>{p.delete&&vn()},[vn,p.delete]);function w0(){var q,oe,ce;return j!=null&&j.loading?T.createElement("div",{className:Ct(k==null?void 0:k.loader,(q=p==null?void 0:p.classNames)==null?void 0:q.loader,"sonner-loader"),"data-visible":lt==="loading"},j.loading):H?T.createElement("div",{className:Ct(k==null?void 0:k.loader,(oe=p==null?void 0:p.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":lt==="loading"},H):T.createElement(iR,{className:Ct(k==null?void 0:k.loader,(ce=p==null?void 0:p.classNames)==null?void 0:ce.loader),visible:lt==="loading"})}return T.createElement("li",{tabIndex:0,ref:tr,className:Ct(D,p0,k==null?void 0:k.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[lt],(n=p==null?void 0:p.classNames)==null?void 0:n[lt]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:P,"data-styled":!(p.jsx||p.unstyled||E),"data-mounted":J,"data-promise":!!p.promise,"data-swiped":pl,"data-removed":be,"data-visible":f0,"data-y-position":m0,"data-x-position":v0,"data-index":w,"data-front":d0,"data-swiping":gn,"data-dismissible":Ar,"data-type":lt,"data-invert":y0,"data-swipe-out":mn,"data-swipe-direction":fe,"data-expanded":!!(C||M&&J),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${be?hl:Lr.current}px`,"--initial-height":M?"auto":`${Or}px`,...L,...p.style},onDragEnd:()=>{Mr(!1),X(null),jr.current=null},onPointerDown:q=>{ml||!Ar||(rf.current=new Date,$o(Lr.current),q.target.setPointerCapture(q.pointerId),q.target.tagName!=="BUTTON"&&(Mr(!0),jr.current={x:q.clientX,y:q.clientY}))},onPointerUp:()=>{var q,oe,ce,yt;if(mn||!Ar)return;jr.current=null;let wt=Number(((q=tr.current)==null?void 0:q.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),yn=Number(((oe=tr.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nr=new Date().getTime()-((ce=rf.current)==null?void 0:ce.getTime()),xt=G==="x"?wt:yn,wn=Math.abs(xt)/nr;if(Math.abs(xt)>=_R||wn>.11){$o(Lr.current),(yt=p.onDismiss)==null||yt.call(p,p),ye(G==="x"?wt>0?"right":"left":yn>0?"down":"up"),vn(),Ji(!0),Zi(!1);return}Mr(!1),X(null)},onPointerMove:q=>{var oe,ce,yt,wt;if(!jr.current||!Ar||((oe=window.getSelection())==null?void 0:oe.toString().length)>0)return;let yn=q.clientY-jr.current.y,nr=q.clientX-jr.current.x,xt=(ce=e.swipeDirections)!=null?ce:PR(Y);!G&&(Math.abs(nr)>1||Math.abs(yn)>1)&&X(Math.abs(nr)>Math.abs(yn)?"x":"y");let wn={x:0,y:0};G==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&yn<0||xt.includes("bottom")&&yn>0)&&(wn.y=yn):G==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&nr<0||xt.includes("right")&&nr>0)&&(wn.x=nr),(Math.abs(wn.x)>0||Math.abs(wn.y)>0)&&Zi(!0),(yt=tr.current)==null||yt.style.setProperty("--swipe-amount-x",`${wn.x}px`),(wt=tr.current)==null||wt.style.setProperty("--swipe-amount-y",`${wn.y}px`)}},g0&&!p.jsx?T.createElement("button",{"aria-label":B,"data-disabled":ml,"data-close-button":!0,onClick:ml||!Ar?()=>{}:()=>{var q;vn(),(q=p.onDismiss)==null||q.call(p,p)},className:Ct(k==null?void 0:k.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(i=j==null?void 0:j.close)!=null?i:cR):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:T.createElement(T.Fragment,null,lt||p.icon||p.promise?T.createElement("div",{"data-icon":"",className:Ct(k==null?void 0:k.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||w0():null,p.type!=="loading"?p.icon||(j==null?void 0:j[lt])||rR(lt):null):null,T.createElement("div",{"data-content":"",className:Ct(k==null?void 0:k.content,(a=p==null?void 0:p.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:Ct(k==null?void 0:k.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?T.createElement("div",{"data-description":"",className:Ct(K,h0,k==null?void 0:k.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),f.isValidElement(p.cancel)?p.cancel:p.cancel&&ks(p.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:q=>{var oe,ce;ks(p.cancel)&&Ar&&((ce=(oe=p.cancel).onClick)==null||ce.call(oe,q),vn())},className:Ct(k==null?void 0:k.cancelButton,(c=p==null?void 0:p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&ks(p.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||z,onClick:q=>{var oe,ce;ks(p.action)&&((ce=(oe=p.action).onClick)==null||ce.call(oe,q),!q.defaultPrevented&&vn())},className:Ct(k==null?void 0:k.actionButton,(d=p==null?void 0:p.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function xh(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function TR(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?SR:xR;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${s}-${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[`${s}-${u}`]=a:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var RR=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:h,style:p,visibleToasts:E=wR,toastOptions:y,dir:x=xh(),gap:v=CR,loadingIcon:m,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=e,[_,P]=T.useState([]),R=T.useMemo(()=>Array.from(new Set([r].concat(_.filter(F=>F.position).map(F=>F.position)))),[_,r]),[L,A]=T.useState([]),[z,D]=T.useState(!1),[K,I]=T.useState(!1),[Y,U]=T.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=T.useRef(null),M=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=T.useRef(null),j=T.useRef(!1),B=T.useCallback(F=>{P(G=>{var X;return(X=G.find(fe=>fe.id===F.id))!=null&&X.delete||Ke.dismiss(F.id),G.filter(({id:fe})=>fe!==F.id)})},[]);return T.useEffect(()=>Ke.subscribe(F=>{if(F.dismiss){P(G=>G.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{Km.flushSync(()=>{P(G=>{let X=G.findIndex(fe=>fe.id===F.id);return X!==-1?[...G.slice(0,X),{...G[X],...F},...G.slice(X+1)]:[F,...G]})})})}),[]),T.useEffect(()=>{if(c!=="system"){U(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:G})=>{U(G?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{U(X?"dark":"light")}catch(fe){console.error(fe)}})}},[c]),T.useEffect(()=>{_.length<=1&&D(!1)},[_]),T.useEffect(()=>{let F=G=>{var X,fe;o.every(ye=>G[ye]||G.code===ye)&&(D(!0),(X=H.current)==null||X.focus()),G.code==="Escape"&&(document.activeElement===H.current||(fe=H.current)!=null&&fe.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),T.useEffect(()=>{if(H.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,j.current=!1)}},[H.current]),T.createElement("section",{ref:t,"aria-label":`${S} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,G)=>{var X;let[fe,ye]=F.split("-");return _.length?T.createElement("ol",{key:F,dir:x==="auto"?xh():x,tabIndex:-1,ref:H,className:a,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":fe,"data-lifted":z&&_.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((X=L[0])==null?void 0:X.height)||0}px`,"--width":`${ER}px`,"--gap":`${v}px`,...p,...TR(l,u)},onBlur:J=>{j.current&&!J.currentTarget.contains(J.relatedTarget)&&(j.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||j.current||(j.current=!0,k.current=J.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{K||D(!1)},onDragEnd:()=>D(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},_.filter(J=>!J.position&&G===0||J.position===F).map((J,Gt)=>{var be,Lt;return T.createElement(kR,{key:J.id,icons:w,index:Gt,toast:J,defaultRichColors:d,duration:(be=y==null?void 0:y.duration)!=null?be:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:E,closeButton:(Lt=y==null?void 0:y.closeButton)!=null?Lt:s,interacting:K,position:F,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:B,toasts:_.filter(gn=>gn.position==J.position),heights:L.filter(gn=>gn.position==J.position),setHeights:A,expandByDefault:i,gap:v,loadingIcon:m,expanded:z,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const NR=({...e})=>{const{theme:t="system"}=YS();return g.jsx(RR,{theme:t,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"}},...e})};var MR=Symbol("radix.slottable");function OR(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=MR,t}var[dl]=kr("Tooltip",[rl]),tf=rl(),t0="TooltipProvider",AR=700,Sh="tooltip.open",[LR,n0]=dl(t0),r0=e=>{const{__scopeTooltip:t,delayDuration:n=AR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(LR,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};r0.displayName=t0;var o0="Tooltip",[aM,fl]=dl(o0),bc="TooltipTrigger",jR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=fl(bc,n),i=n0(bc,n),s=tf(n),a=f.useRef(null),l=Re(t,a,o.onTriggerChange),u=f.useRef(!1),c=f.useRef(!1),d=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(my,{asChild:!0,...s,children:g.jsx(ve.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:V(e.onPointerMove,h=>{h.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),c.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})});jR.displayName=bc;var IR="TooltipPortal",[lM,DR]=dl(IR,{forceMount:void 0}),No="TooltipContent",i0=f.forwardRef((e,t)=>{const n=DR(No,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=fl(No,e.__scopeTooltip);return g.jsx(Tr,{present:r||s.open,children:s.disableHoverableContent?g.jsx(s0,{side:o,...i,ref:t}):g.jsx($R,{side:o,...i,ref:t})})}),$R=f.forwardRef((e,t)=>{const n=fl(No,e.__scopeTooltip),r=n0(No,e.__scopeTooltip),o=f.useRef(null),i=Re(t,o),[s,a]=f.useState(null),{trigger:l,onClose:u}=n,c=o.current,{onPointerInTransitChange:d}=r,h=f.useCallback(()=>{a(null),d(!1)},[d]),p=f.useCallback((E,y)=>{const x=E.currentTarget,v={x:E.clientX,y:E.clientY},m=VR(v,x.getBoundingClientRect()),w=WR(v,m),S=HR(y.getBoundingClientRect()),C=qR([...w,...S]);a(C),d(!0)},[d]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(l&&c){const E=x=>p(x,c),y=x=>p(x,l);return l.addEventListener("pointerleave",E),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",E),c.removeEventListener("pointerleave",y)}}},[l,c,p,h]),f.useEffect(()=>{if(s){const E=y=>{const x=y.target,v={x:y.clientX,y:y.clientY},m=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),w=!KR(v,s);m?h():w&&(h(),u())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[l,c,s,u,h]),g.jsx(s0,{...e,ref:i})}),[FR,zR]=dl(o0,{isInside:!1}),UR=OR("TooltipContent"),s0=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=fl(No,n),u=tf(n),{onClose:c}=l;return f.useEffect(()=>(document.addEventListener(Sh,c),()=>document.removeEventListener(Sh,c)),[c]),f.useEffect(()=>{if(l.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),g.jsx(Ja,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:g.jsxs(vy,{"data-state":l.stateAttribute,...u,...a,ref:t,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:[g.jsx(UR,{children:r}),g.jsx(FR,{scope:n,isInside:!0,children:g.jsx(AT,{id:l.contentId,role:"tooltip",children:o||r})})]})})});i0.displayName=No;var a0="TooltipArrow",BR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=tf(n);return zR(a0,n).isInside?null:g.jsx(yy,{...o,...r,ref:t})});BR.displayName=a0;function VR(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function WR(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function HR(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function KR(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=h>r&&n<(d-u)*(r-c)/(h-c)+u&&(o=!o)}return o}function qR(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),GR(t)}function GR(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var QR=r0,l0=i0;const YR=QR,XR=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(l0,{ref:r,sideOffset:t,className:Ne("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",e),...n}));XR.displayName=l0.displayName;function JR(){const{pathname:e,hash:t}=pn();f.useEffect(()=>{t||window.scrollTo(0,0)},[e,t])}const ZR="cronAdminToken";function eN(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(ZR))==null?void 0:e.trim())??""}const Eh=!1;class Ta extends Error{constructor(n,r){var o;super(`API request failed: ${n.status} ${n.statusText}`);St(this,"status");St(this,"statusText");St(this,"response");St(this,"detail");St(this,"code");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{this.detail=(o=JSON.parse(r))==null?void 0:o.detail,typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code)}catch{this.detail=void 0}}}async function tN(e,t,n){const r=`${e}${t}`;try{const{headers:o,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=eN(),u=new Headers(o);u.has("Content-Type")||u.set("Content-Type","application/json"),l&&!u.has("X-Admin-Token")&&u.set("X-Admin-Token",l);const c=await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:u});if(!c.ok){const h=new Ta(c,await c.text());throw console.error("[API] Error response:",h.response),h}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${r} failed:`,o),o}}async function nN(e){try{return await e()}catch(t){throw t instanceof Ta&&t.status===401&&t.code!=="fresh_auth_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale")),t}}function rN(e){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",e);const t=Xa("/api/v1/auth/hf/login");window.location.assign(`${t}?return_to=${encodeURIComponent(window.location.href)}`)}class oN{constructor(t,n=rN){St(this,"paperLoads",new Map);St(this,"evaluationLoads",new Map);this.request=t,this.recoverFreshAuth=n}primePaper(t,n=!1){n&&this.paperLoads.delete(t);let r=this.paperLoads.get(t);return r||(r=this.request(`/papers/${t}/curation-state`).catch(o=>{throw this.paperLoads.delete(t),o}),this.paperLoads.set(t,r)),r}primeEvaluations(t,n=!1){n&&this.evaluationLoads.delete(t);let r=this.evaluationLoads.get(t);return r||(r=this.request(`/evaluations/curation-state?paper_id=${t}`).catch(o=>{throw this.evaluationLoads.delete(t),o}),this.evaluationLoads.set(t,r)),r}async mutatePaper(t,n,r,o,i){const s=this.paperLoads.get(t);if(!s)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const a=(await s).sections[n];if(!a)throw new Error(`Missing curation version for ${n}`);return this.mutate(n,o,r,a,i,`paper:${t}:${n}`)}async mutateEvaluations(t,n,r,o){const i=this.evaluationLoads.get(String(t));if(!i)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const s=(await i).version;return this.mutate("evaluations",r,n,s,o,`paper:${t}:evaluations`)}async mutate(t,n,r,o,i,s){const a=new Headers(i.headers);Object.entries(this.idempotencyHeaders(s,r,o)).forEach(([u,c])=>a.set(u,c));const l={...i,headers:a};try{const u=await this.request(n,l);return this.clearAttempt(l),u}catch(u){throw u instanceof Ta&&u.status===401&&u.code==="fresh_auth_required"?this.recoverFreshAuth(t):u instanceof Ta&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:n}}))),u}}idempotencyHeaders(t,n,r){const o=`pwc:mutation:${t}:${JSON.stringify(n)}`,i=sessionStorage.getItem(o);if(i){const a=JSON.parse(i);return{"Idempotency-Key":a.key,"If-Match":a.version}}const s=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:s,version:r})),sessionStorage.setItem(`pwc:mutation-key:${s}`,o),{"Idempotency-Key":s,"If-Match":r}}clearAttempt(t){const n=new Headers(t.headers).get("Idempotency-Key");if(!n)return;const r=sessionStorage.getItem(`pwc:mutation-key:${n}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${n}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const iN=`${Td()}/api/v1`;class sN{constructor(t=iN){St(this,"baseUrl");St(this,"curation");this.baseUrl=t,this.curation=new oN((n,r)=>this.request(n,r))}async request(t,n){return nN(()=>tN(this.baseUrl,t,n))}async getPapers(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir),t!=null&&t.time&&n.append("time",t.time),t!=null&&t.published_after&&n.append("published_after",t.published_after),t!=null&&t.published_before&&n.append("published_before",t.published_before),t!=null&&t.conference&&n.append("conference",t.conference),(t==null?void 0:t.latest_only)!==void 0&&n.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&n.append("include_resources",t.include_resources.toString()),(t==null?void 0:t.has_code)!==void 0&&n.append("has_code",t.has_code.toString()),(t==null?void 0:t.has_hf_artifacts)!==void 0&&n.append("has_hf_artifacts",t.has_hf_artifacts.toString());const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(t,n=1,r=10,o){const i=new URLSearchParams;return i.append("q",t),i.append("page",n.toString()),i.append("page_size",r.toString()),o&&i.append("mode",o),this.request(`/papers/search?${i.toString()}`)}async getPaper(t,n=!0){const r=`/papers/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getPaperByArxivId(t,n=!0){const r=`/papers/arxiv/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getRelatedPapers(t,n=4){const r=new URLSearchParams({limit:n.toString()});return this.request(`/papers/${encodeURIComponent(t)}/related?${r.toString()}`)}async indexPaperFromArxiv(t){const n=`/papers/index/${t}`;return this.request(n,{method:"POST"})}async submitPaper(t){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(t)})}primePaperCurationState(t,n=!1){return this.curation.primePaper(t,n)}primeEvaluationCurationState(t,n=!1){return this.curation.primeEvaluations(t,n)}async updatePaperTasks(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("task_ids",i.toString()));const o=`/papers/${t}/tasks?${r.toString()}`;return this.curation.mutatePaper(t,"tasks",n,o,{method:"PUT"})}async updatePaperMethods(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("method_ids",i.toString()));const o=`/papers/${t}/methods?${r.toString()}`;return this.curation.mutatePaper(t,"methods",n,o,{method:"PUT"})}async updatePaperOrganizations(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("organization_ids",i.toString()));const o=`/papers/${t}/organizations?${r.toString()}`;return this.curation.mutatePaper(t,"organizations",n,o,{method:"PUT"})}async updatePaperRepositories(t,n){const r=`/papers/${t}/repositories`;return this.curation.mutatePaper(t,"repositories",n,r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(t,n){const r=`/papers/${t}/project-pages`;return this.curation.mutatePaper(t,"project_pages",n,r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(t,n){const r=`/papers/${t}/source-url`;return this.curation.mutatePaper(t,"source_url",n,r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(t,n){const r=`/papers/${t}/hf-artifacts`;return this.curation.mutatePaper(t,"hf_artifacts",n,r,{method:"PUT",body:JSON.stringify(n)})}async getTrendingPapers(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.max_age_days&&n.append("max_age_days",t.max_age_days.toString()),(t==null?void 0:t.min_velocity)!==void 0&&n.append("min_velocity",t.min_velocity.toString());const r=`/papers/trending${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getRepositoriesForPaper(t){return this.request(`/papers/${t}/repositories`)}async getRepositories(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.owner&&n.append("owner",t.owner),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.min_stars&&n.append("min_stars",t.min_stars.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/repositories/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getProjectPagesForPaper(t){return this.request(`/papers/${t}/project-pages`)}async getProjectPages(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/project-pages/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthors(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.sort_by&&n.append("sort_by",t.sort_by),t!=null&&t.sort_order&&n.append("sort_order",t.sort_order);const r=`/authors${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthor(t){return this.request(`/authors/${t}`)}async getAuthorPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=r.toString();return this.request(`/authors/${t}/papers${o?`?${o}`:""}`)}async getAreas(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/areas/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getArea(t){return this.request(`/areas/${t}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getConferences(){return this.request("/conferences/")}async getConferenceDeadlines(){return this.request("/conferences/deadlines")}async getConference(t){return this.request(`/conferences/${t}`)}async getConferenceAreasWithTasks(t){return this.request(`/conferences/${t}/areas-with-tasks`)}async getConferencePapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.presentation&&r.append("presentation",n.presentation),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/conferences/${t}/papers?${o}`:`/conferences/${t}/papers`;return this.request(i)}async getOrganizations(t=!1){return this.request(`/organizations/${t?"?featured_only=true":""}`)}async getOrganization(t){return this.request(`/organizations/${t}`)}async getOrganizationContributions(t){return this.request(`/organizations/${t}/contributions`)}async getOrganizationAreasWithTasks(t){return this.request(`/organizations/${t}/areas-with-tasks`)}async getOrganizationPapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/organizations/${t}/papers?${o}`:`/organizations/${t}/papers`;return this.request(i)}async getAreaTasks(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/areas/${t}/tasks${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTasks(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.area_id&&n.append("area_id",t.area_id.toString()),t!=null&&t.parent_id&&n.append("parent_id",t.parent_id.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/tasks/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getTask(t){return this.request(`/tasks/${t}`)}async getFrameworkCatalog(){return this.request("/frameworks/")}async getTopTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString());const r=n.toString(),o=r?`/tasks/top?${r}`:"/tasks/top";return this.request(o)}async getTrendingTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.recent_days&&n.append("recent_days",t.recent_days.toString()),t!=null&&t.baseline_days&&n.append("baseline_days",t.baseline_days.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),(t==null?void 0:t.min_recent_papers)!==void 0&&n.append("min_recent_papers",t.min_recent_papers.toString()),(t==null?void 0:t.min_baseline_papers)!==void 0&&n.append("min_baseline_papers",t.min_baseline_papers.toString()),(t==null?void 0:t.min_share_lift)!==void 0&&n.append("min_share_lift",t.min_share_lift.toString());const r=n.toString(),o=r?`/tasks/trending?${r}`:"/tasks/trending";return this.request(o)}async getTaskChildren(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/tasks/${t}/children${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTaskParents(t){return this.request(`/tasks/${t}/parents`)}async getTaskPage(t,n){const r=new URLSearchParams;(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=`/tasks/${t}/page${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTrendingBenchmarks(t,n){const r=new URLSearchParams;(n==null?void 0:n.limit)!==void 0&&r.append("limit",n.limit.toString()),(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.min_recent_papers)!==void 0&&r.append("min_recent_papers",n.min_recent_papers.toString()),(n==null?void 0:n.include_descendants)!==void 0&&r.append("include_descendants",n.include_descendants.toString()),(n==null?void 0:n.bucket_days)!==void 0&&r.append("bucket_days",n.bucket_days.toString()),(n==null?void 0:n.history_buckets)!==void 0&&r.append("history_buckets",n.history_buckets.toString()),(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=r.toString(),i=`/tasks/${encodeURIComponent(t)}/trending-benchmarks${o?`?${o}`:""}`;return this.request(i)}async getTaskPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.toString());const o=r.toString(),i=o?`/tasks/${t}/papers?${o}`:`/tasks/${t}/papers`;return this.request(i)}async getMethods(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.introduced_year&&n.append("introduced_year",t.introduced_year.toString()),(t==null?void 0:t.area_id)!==void 0&&n.append("area_id",t.area_id.toString()),(t==null?void 0:t.exclude_id)!==void 0&&n.append("exclude_id",t.exclude_id.toString()),(t==null?void 0:t.include_trends)!==void 0&&n.append("include_trends",t.include_trends.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/methods/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMethod(t){return this.request(`/methods/${encodeURIComponent(t)}`)}async getMethodTrend(t,n){const r=new URLSearchParams;(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.history_months)!==void 0&&r.append("history_months",n.history_months.toString());const o=r.toString();return this.request(`/methods/${encodeURIComponent(t)}/trend${o?`?${o}`:""}`)}async getMethodPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.toString());const o=r.toString(),i=o?`/methods/${encodeURIComponent(t)}/papers?${o}`:`/methods/${encodeURIComponent(t)}/papers`;return this.request(i)}async getDatasets(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.task&&n.append("task",t.task),t!=null&&t.task_id&&n.append("task",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),(t==null?void 0:t.min_eval_count)!==void 0&&n.append("min_eval_count",t.min_eval_count.toString()),(t==null?void 0:t.is_open)!==void 0&&n.append("is_open",t.is_open.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/datasets/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getDataset(t){return this.request(`/datasets/${t}`)}async getDatasetBySlug(t,n){const r=new URLSearchParams;n!=null&&n.include_paper&&r.set("include_paper","true"),n!=null&&n.task&&r.set("task",n.task),(n==null?void 0:n.is_open)!==void 0&&r.set("is_open",String(n.is_open));const o=r.size?`?${r.toString()}`:"";return this.request(`/datasets/${t}${o}`)}async getDatasetTasks(t){return(await this.request(`/datasets/${t}/tasks/`)).results}async getLeaderboardMetrics(t,n){return(await this.request(`/datasets/${t}/tasks/${n}/metrics`)).metrics}async getEvaluations(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.task_id&&n.append("task_id",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),t!=null&&t.dataset_id&&n.append("dataset_id",t.dataset_id.toString()),t!=null&&t.best_metric&&n.append("best_metric",t.best_metric),(t==null?void 0:t.external)!==void 0&&n.append("external",String(t.external)),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/evaluations/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getEvaluation(t){return this.request(`/evaluations/${t}`)}async getEvaluationsByPaper(t){const r=parseInt(t),o=await this.getEvaluations({paper_id:r,page_size:100,ordering:"-benchmark_popularity"}),i=[...o.results];let s=o.next_page;for(;s;){const a=await this.getEvaluations({paper_id:r,page:s,page_size:100,ordering:"-benchmark_popularity"});i.push(...a.results),s=a.next_page}return i}async getEvaluationsByDataset(t,n){const o=parseInt(t),i=await this.getEvaluations({dataset_id:o,best_metric:n,page_size:100,ordering:"best_rank"}),s=[...i.results];let a=i.next_page;for(;a;){const l=await this.getEvaluations({dataset_id:o,best_metric:n,page:a,page_size:100,ordering:"best_rank"});s.push(...l.results),a=l.next_page}return s}async createEvaluation(t){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(t)})}async updateEvaluation(t,n){const r=`/evaluations/${t}`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async deleteEvaluation(t){const n=`/evaluations/${t}`;return this.request(n,{method:"DELETE"})}async batchEvaluations(t,n){return this.curation.mutateEvaluations(t,n,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:t,operations:n})})}async generateThumbnail(t){const n=io(`/api/thumbnails/generate/${t}`),r=await fetch(n,{method:"POST"});if(!r.ok)throw new Error(`Thumbnail generation failed: ${r.status}`);return await r.json()}async getThumbnailStatus(t){const n=io(`/api/thumbnails/status/${t}`),r=await fetch(n);if(!r.ok)throw new Error(`Thumbnail status check failed: ${r.status}`);return await r.json()}async healthCheck(){const t=io("/health"),n=await fetch(t);if(!n.ok)throw new Error(`Health check failed: ${n.status}`);return await n.json()}async getMetrics(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.direction&&n.append("direction",t.direction),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/metrics/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMetric(t){return this.request(`/metrics/${t}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(t){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(t)})}async listPendingPaperEdits(t){const n=new URLSearchParams;t!=null&&t.status&&n.append("status",t.status),t!=null&&t.edit_type&&n.append("edit_type",t.edit_type),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString());const r=`/admin/paper-edits${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getPendingPaperEdit(t){return this.request(`/admin/paper-edits/${t}`)}async approvePendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/approve`,{method:"POST",body:JSON.stringify(n??{})})}async rejectPendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/reject`,{method:"POST",body:JSON.stringify(n??{})})}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"POST"})}async removeBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"DELETE"})}async getMyPreferences(){return this.request("/me/preferences")}async updateMyPreferences(t){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(t)})}async getCronStatus(){return this.request("/cron/status",{cache:"no-store"})}async getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}async getMyContributions(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/contributions${n}`)}async getCatalogAudit(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/admin/catalog-audit${n}`)}async acknowledgeCatalogAudit(){await this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}async rollbackCatalogEvent(t){return this.request(`/admin/catalog-audit/${t}/rollback`,{method:"POST"})}}const b=new sN;b.getPapers.bind(b);const uM=b.getPaper.bind(b);b.getPaperByArxivId.bind(b);const cM=b.indexPaperFromArxiv.bind(b),dM=b.submitPaper.bind(b),fM=b.updatePaperTasks.bind(b),pM=b.updatePaperMethods.bind(b),hM=b.updatePaperOrganizations.bind(b),gM=b.updatePaperRepositories.bind(b),mM=b.updatePaperProjectPages.bind(b),vM=b.updatePaperSourceUrl.bind(b),yM=b.updatePaperHfArtifacts.bind(b);b.primePaperCurationState.bind(b);b.primeEvaluationCurationState.bind(b);b.getTrendingPapers.bind(b);b.getRepositoriesForPaper.bind(b);b.getRepositories.bind(b);b.getProjectPagesForPaper.bind(b);b.getProjectPages.bind(b);b.getAuthors.bind(b);b.getAuthor.bind(b);b.getAreas.bind(b);b.getArea.bind(b);b.getAreasWithTasks.bind(b);b.getConferences.bind(b);b.getConferenceDeadlines.bind(b);b.getConference.bind(b);b.getConferenceAreasWithTasks.bind(b);b.getConferencePapers.bind(b);const wM=b.getOrganizations.bind(b);b.getOrganization.bind(b);b.getOrganizationContributions.bind(b);b.getOrganizationAreasWithTasks.bind(b);b.getOrganizationPapers.bind(b);b.getAreaTasks.bind(b);const xM=b.getTasks.bind(b),SM=b.getTask.bind(b);b.getTopTasks.bind(b);b.getTrendingTasks.bind(b);b.getTaskChildren.bind(b);b.getTaskParents.bind(b);b.getTaskPage.bind(b);b.getTaskPapers.bind(b);const EM=b.getMethods.bind(b),CM=b.getMethod.bind(b);b.getMethodPapers.bind(b);const _M=b.getDatasets.bind(b),bM=b.getDataset.bind(b);b.getDatasetBySlug.bind(b);b.getDatasetTasks.bind(b);const PM=b.getLeaderboardMetrics.bind(b);b.getEvaluations.bind(b);b.getEvaluation.bind(b);const kM=b.getEvaluationsByPaper.bind(b);b.getEvaluationsByDataset.bind(b);b.createEvaluation.bind(b);b.updateEvaluation.bind(b);b.deleteEvaluation.bind(b);const TM=b.batchEvaluations.bind(b);b.generateThumbnail.bind(b);b.getThumbnailStatus.bind(b);b.getMetrics.bind(b);b.getMetric.bind(b);b.getMetricDirections.bind(b);b.getResearchTrends.bind(b);b.healthCheck.bind(b);b.getMyBookmarkIds.bind(b);b.getMyBookmarks.bind(b);b.addBookmark.bind(b);b.getMyPreferences.bind(b);b.updateMyPreferences.bind(b);const RM=b.submitPendingPaperEdit.bind(b),NM=b.listPendingPaperEdits.bind(b);b.getPendingPaperEdit.bind(b);const MM=b.approvePendingPaperEdit.bind(b),OM=b.rejectPendingPaperEdit.bind(b);b.removeBookmark.bind(b);const lu={hide_closed_source_evals:!1},u0=T.createContext(null),aN=({children:e})=>{const{user:t}=Xd(),[n,r]=T.useState(lu),[o,i]=T.useState(!1);T.useEffect(()=>{let l=!1;if(!t){r(lu);return}return i(!0),b.getMyPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(lu)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[t]);const s=T.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!t)try{const c=await b.updateMyPreferences(u);r(c)}catch{r(n)}},[n,t]),a=T.useMemo(()=>({preferences:n,canPersist:!!t,isLoading:o,setHideClosedSourceEvals:s}),[n,t,o,s]);return g.jsx(u0.Provider,{value:a,children:e})};function AM(){const e=T.useContext(u0);if(!e)throw new Error("usePreferences must be used inside a ");return e}const c0=zE(),lN=c0?oE:rE;if(!c0&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const uN=T.lazy(()=>ie(()=>import("./FeedView-D_yPsBLc.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),cN=T.lazy(()=>ie(()=>import("./ChatView-KuyaCl6P.js"),__vite__mapDeps([17,18,7,3,4,19,20,21,10,11,8]))),dN=T.lazy(()=>ie(()=>import("./SharedChatView-BUBKFK2G.js"),__vite__mapDeps([22,10,11,18,7,3,4,19,20,21]))),fN=T.lazy(()=>ie(()=>import("./PapersListView-CaUF6tiV.js"),__vite__mapDeps([23,1,2,3,4,5,9,10,11,12,24,14,13,15,16]))),pN=T.lazy(()=>ie(()=>import("./PaperDetailView-DryrpQ-P.js"),__vite__mapDeps([25,10,11,1,2,3,4,5,26,19,27,28,9,12,15,16,29,30,31,32,33,34,35,36,37,38,21]))),hN=T.lazy(()=>ie(()=>import("./TagsIndexView-DrP0WvYO.js"),__vite__mapDeps([39,10,11,5,15,16,40,34,29,31,32,33,35]))),gN=T.lazy(()=>ie(()=>import("./TagBrowseView-lNBiZoSj.js"),__vite__mapDeps([41,10,11,1,2,3,4,5,42,6,43,20,21,19,9,12,13,15,16,44,38]))),mN=T.lazy(()=>ie(()=>import("./MethodsIndexView-BuJTAVXK.js"),__vite__mapDeps([45,10,11,46,15,16,40,34,29,31,32,33,35]))),vN=T.lazy(()=>ie(()=>import("./FrameworksIndexView-CGPkOk6q.js"),__vite__mapDeps([47,10,11,1,2,3,4,5]))),yN=T.lazy(()=>ie(()=>import("./TrendsView-BpNENNEr.js"),__vite__mapDeps([48,10,11,16,15]))),wN=T.lazy(()=>ie(()=>import("./ConferencesIndexView-C77Ml82l.js"),__vite__mapDeps([49,10,11,15,16,40,34,29,31,32,33,35]))),xN=T.lazy(()=>ie(()=>import("./AiDeadlinesView-DkV4e8P1.js"),__vite__mapDeps([50,10,11,51,30,15,16,32]))),SN=T.lazy(()=>ie(()=>import("./ConferenceDetailView-BKXxJj_4.js"),__vite__mapDeps([52,10,11,43,3,4,20,21,19,5,15,16]))),EN=T.lazy(()=>ie(()=>import("./ConferenceTaskView-BK0b5von.js"),__vite__mapDeps([53,10,11,1,2,3,4,5,6,43,20,21,19,9,12,13,15,16]))),CN=T.lazy(()=>ie(()=>import("./OrganizationsIndexView-kFwneTNZ.js"),__vite__mapDeps([54,10,11,16,15,55]))),_N=T.lazy(()=>ie(()=>import("./OrganizationDetailView-7gGiFGel.js"),__vite__mapDeps([56,57,10,11,1,2,3,4,5,43,20,21,19,15,6,16,36,29,32,35,13,9,12,58]))),bN=T.lazy(()=>ie(()=>import("./OrganizationTaskView-CqHYmvnR.js"),__vite__mapDeps([59,57,10,11,1,2,3,4,5,43,20,21,19,15,6,16,36,29,32,35,13,9,12,58]))),PN=T.lazy(()=>ie(()=>import("./AuthorDetailView-Ba9-6m_p.js"),__vite__mapDeps([60,10,11,15,58]))),kN=T.lazy(()=>ie(()=>import("./MethodDetailView-MpXmLFF4.js"),__vite__mapDeps([61,10,11,12,1,2,3,4,5,6,43,20,21,19,46,13,15,16]))),TN=T.lazy(()=>ie(()=>import("./BenchmarkDetailView-yKHafFH-.js"),__vite__mapDeps([62,10,11,15,51,30,16,2,3,4,26,19,27,42,1,5,63]))),RN=T.lazy(()=>ie(()=>import("./SavedPapersView-Dl29aGCp.js"),__vite__mapDeps([64,10,11,1,2,3,4,5,15,16]))),NN=T.lazy(()=>ie(()=>import("./SettingsView-Frf9Rfgi.js"),__vite__mapDeps([65,10,11,33,51,30,28,66]))),MN=T.lazy(()=>ie(()=>import("./SubmitView-Dyt8xzD0.js"),__vite__mapDeps([67,33,16,29,31]))),ON=T.lazy(()=>ie(()=>import("./CronDashboard-yceEcg4l.js"),__vite__mapDeps([68,10,11,37,29,44,69,35,66,33,12,70]))),AN=T.lazy(()=>ie(()=>import("./SubmissionsDashboard-sLQHfiII.js"),__vite__mapDeps([71,11,10,33,69,35]))),LN=T.lazy(()=>ie(()=>import("./ContributionsPage-CrOMof-R.js"),__vite__mapDeps([72,12,11,29]))),Ch=T.lazy(()=>ie(()=>import("./NotFound-DTl10qdH.js"),[])),jN=T.lazy(()=>ie(()=>import("./SearchOverlay-BfRi7gsA.js"),__vite__mapDeps([73,10,11,2,3,4,24,5]))),IN=()=>g.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),g.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),DN=new DE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),$N=()=>{const{arxivId:e}=nv();return g.jsx(ko,{to:e?`/paper/${e}`:"/papers",replace:!0})},FN=()=>{const{taskSlug:e}=nv();return g.jsx(ko,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},uu=({element:e})=>Ki()?g.jsx(ko,{to:"/",replace:!0}):g.jsx(g.Fragment,{children:e}),zN=({element:e})=>{const{user:t,isLoading:n}=Xd();return Ki()?g.jsx(ko,{to:"/",replace:!0}):n?g.jsx("div",{className:"page",children:g.jsx("div",{className:"submission-loading",children:g.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?g.jsx(g.Fragment,{children:e}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Admin access required"}),g.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Sign in required"}),g.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),g.jsx(wv,{returnTo:"/admin-dashboard"})]})})},UN=()=>{const e=FE(),t=typeof window<"u"&&new URL(e,window.location.origin).origin!==window.location.origin;return T.useEffect(()=>{t&&window.location.replace(e)},[e,t]),t?g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-loading",children:[g.jsx("span",{children:"Opening the production admin dashboard..."}),g.jsx("a",{href:e,children:"Continue"})]})}):g.jsx(zN,{element:g.jsx(ON,{})})},BN=()=>{const[e,t]=T.useState(!1);return JR(),T.useLayoutEffect(()=>{var n;(n=document.getElementById("initial-discovery-footer"))==null||n.remove()},[]),T.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="k"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),g.jsxs(g.Fragment,{children:[g.jsx(_T,{onOpenSearch:()=>t(!0)}),g.jsx("main",{children:g.jsx(T.Suspense,{fallback:g.jsx(IN,{}),children:g.jsxs(G1,{children:[g.jsx(ne,{path:"/",element:g.jsx(uN,{})}),g.jsx(ne,{path:"/chat/:sessionId?",element:xa()?g.jsx(cN,{}):g.jsx(ko,{to:"/",replace:!0})}),g.jsx(ne,{path:"/share/:shareId",element:xa()?g.jsx(dN,{}):g.jsx(Ch,{})}),g.jsx(ne,{path:"/papers",element:g.jsx(fN,{})}),g.jsx(ne,{path:"/papers/:arxivId",element:g.jsx($N,{})}),g.jsx(ne,{path:"/paper/:arxivId",element:g.jsx(pN,{})}),g.jsx(ne,{path:"/tasks",element:g.jsx(hN,{})}),g.jsx(ne,{path:"/tasks/:taskSlug",element:g.jsx(gN,{})}),g.jsx(ne,{path:"/task/:taskSlug",element:g.jsx(FN,{})}),g.jsx(ne,{path:"/methods",element:g.jsx(mN,{})}),g.jsx(ne,{path:"/methods/:methodSlug",element:g.jsx(kN,{})}),g.jsx(ne,{path:"/frameworks",element:g.jsx(vN,{})}),g.jsx(ne,{path:"/trends",element:g.jsx(yN,{})}),g.jsx(ne,{path:"/conferences",element:g.jsx(wN,{})}),g.jsx(ne,{path:"/ai-deadlines",element:g.jsx(xN,{})}),g.jsx(ne,{path:"/conferences/:confSlug",element:g.jsx(SN,{})}),g.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:g.jsx(EN,{})}),g.jsx(ne,{path:"/organizations",element:g.jsx(CN,{})}),g.jsx(ne,{path:"/orgs/:orgSlug",element:g.jsx(_N,{})}),g.jsx(ne,{path:"/orgs/:orgSlug/:taskSlug",element:g.jsx(bN,{})}),g.jsx(ne,{path:"/authors/:authorId",element:g.jsx(PN,{})}),g.jsx(ne,{path:"/benchmark/:datasetSlug",element:g.jsx(TN,{})}),g.jsx(ne,{path:"/submit",element:g.jsx(MN,{})}),g.jsx(ne,{path:"/saved",element:g.jsx(uu,{element:g.jsx(RN,{})})}),g.jsx(ne,{path:"/settings",element:g.jsx(NN,{})}),g.jsx(ne,{path:"/admin-dashboard",element:g.jsx(UN,{})}),g.jsx(ne,{path:"/cron-dashboard",element:g.jsx(ko,{to:"/admin-dashboard",replace:!0})}),g.jsx(ne,{path:"/submissions",element:g.jsx(uu,{element:g.jsx(AN,{})})}),g.jsx(ne,{path:"/contributions",element:g.jsx(uu,{element:g.jsx(LN,{})})}),g.jsx(ne,{path:"*",element:g.jsx(Ch,{})})]})})}),e&&g.jsx(T.Suspense,{fallback:null,children:g.jsx(jN,{open:e,onClose:()=>t(!1)})})]})},VN=()=>g.jsx($E,{client:DN,children:g.jsx(xT,{children:g.jsx(aN,{children:g.jsxs(YR,{children:[g.jsx(lN,{children:g.jsx(BN,{})}),g.jsx(nR,{}),g.jsx(NR,{}),!1]})})})});o1();const WN=qm(document.getElementById("root"));WN.render(g.jsx(T.StrictMode,{children:g.jsx(XS,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:g.jsx(n1,{children:g.jsx(VN,{})})})}));export{oM as $,gM as A,mM as B,aT as C,vM as D,_M as E,TM as F,PM as G,yM as H,hM as I,wM as J,Ki as K,Cn as L,Vv as M,tP as N,nP as O,Tr as P,xy as Q,T as R,uT as S,rM as T,AM as U,dT as V,fT as W,cT as X,Tw as Y,It as Z,eM as _,qN as a,cM as a0,pc as a1,vt as a2,Ld as a3,Sv as a4,JT as a5,wv as a6,Pr as a7,zb as a8,my as a9,Bv as aA,MM as aB,OM as aC,NM as aD,Oi as aE,LE as aF,YN as aG,JN as aH,XN as aI,nM as aJ,pn as aK,bE as aL,yE as aM,ac as aN,fv as aO,mE as aP,vE as aQ,sc as aR,uv as aS,OE as aT,SE as aU,rl as aa,Vd as ab,fP as ac,Ay as ad,v_ as ae,qv as af,Ja as ag,vy as ah,yy as ai,iM as aj,QN as ak,uM as al,KN as am,Ah as an,YS as ao,dM as ap,Ya as aq,Ue as ar,GN as as,cv as at,bt as au,SM as av,CM as aw,bM as ax,zv as ay,Uv as az,b,ll as c,io as d,nv as e,Xd as f,NT as g,tM as h,xa as i,g as j,kM as k,ve as l,Od as m,Re as n,V as o,Ab as p,kr as q,f as r,Ne as s,ZN as t,bd as u,RM as v,fM as w,xM as x,pM as y,EM as z}; + */const dT=ll("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),fT=nT,pT=rT,hT=f.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(bw,{ref:o,className:Ne("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",t&&"pl-8",e),...r,children:[n,g.jsx(uT,{className:"ml-auto h-4 w-4"})]}));hT.displayName=bw.displayName;const gT=f.forwardRef(({className:e,...t},n)=>g.jsx(Pw,{ref:n,className:Ne("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",e),...t}));gT.displayName=Pw.displayName;const Tw=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(oT,{children:g.jsx(yw,{ref:r,sideOffset:t,className:Ne("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",e),...n})}));Tw.displayName=yw.displayName;const It=f.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(xw,{ref:r,className:Ne("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",t&&"pl-8",e),...n}));It.displayName=xw.displayName;const mT=f.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(Sw,{ref:o,className:Ne("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",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Cw,{children:g.jsx(lT,{className:"h-4 w-4"})})}),t]}));mT.displayName=Sw.displayName;const vT=f.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(Ew,{ref:r,className:Ne("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",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Cw,{children:g.jsx(cT,{className:"h-2 w-2 fill-current"})})}),t]}));vT.displayName=Ew.displayName;const Rw=f.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(ww,{ref:r,className:Ne("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Rw.displayName=ww.displayName;const xc=f.forwardRef(({className:e,...t},n)=>g.jsx(_w,{ref:n,className:Ne("-mx-1 my-1 h-px bg-muted",e),...t}));xc.displayName=_w.displayName;function yT(e){const n=(e.name||e.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 wT=({user:e,onLogout:t})=>g.jsxs(fT,{children:[g.jsx(pT,{asChild:!0,children:g.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:g.jsxs(zv,{className:"h-8 w-8",children:[e.avatar_url&&g.jsx(Uv,{src:e.avatar_url,alt:e.username}),g.jsx(Bv,{className:"text-xs",children:yT(e)})]})})}),g.jsxs(Tw,{align:"end",className:"w-56",children:[g.jsxs(Rw,{className:"flex flex-col gap-0.5 py-2",children:[g.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),g.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&g.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"}),e.role==="contributor"&&g.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"})]}),g.jsx(xc,{}),g.jsx(It,{asChild:!0,children:g.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),xa()&&g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/chat",children:"Chat"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/frameworks",children:"Frameworks"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/trends",children:"Trends"})}),e.is_admin&&g.jsxs(g.Fragment,{children:[g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/admin-dashboard",children:"Admin dashboard"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/submissions",children:"Review submissions"})})]}),e.can_contribute&&g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/contributions",children:"My contributions"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/settings",children:"Settings"})}),g.jsx(xc,{}),g.jsx(It,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),Nw=T.createContext(null),fh="pwc:auth-stale";async function xT(){if(Ki())return null;const e=await fetch(io("/api/v1/auth/me"),{credentials:"include",cache:"no-store"});return e.status===401||!e.ok?null:await e.json()}const ST=({children:e})=>{const[t,n]=T.useState(null),[r,o]=T.useState(!0),i=T.useCallback(async()=>{o(!0);const l=await xT();n(l),o(!1)},[]),s=T.useCallback(async()=>{const l=Xa("/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 fetch(io("/api/v1/auth/logout"),{method:"POST",credentials:"include"}),n(null)},[]);T.useEffect(()=>{i()},[i]),T.useEffect(()=>{const l=()=>n(null);return window.addEventListener(fh,l),()=>window.removeEventListener(fh,l)},[]);const a=T.useMemo(()=>({user:t,isLoading:r,refresh:i,logout:s}),[t,r,i,s]);return g.jsx(Nw.Provider,{value:a,children:e})};function Xd(){const e=T.useContext(Nw);if(!e)throw new Error("useAuth must be used inside an ");return e}const Yo=({name:e,size:t=14})=>{const n={search:g.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:g.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:g.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:g.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return g.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},ph="https://github.com/huggingface/paperswithcode-feedback/issues",ET="https://github.com/huggingface/pwc-cli",hh=[{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}],CT=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgentData,t=(e==null?void 0:e.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(t)},_T=()=>{const[e,t]=T.useState(!1);return T.useEffect(()=>{t(CT())},[]),g.jsx("kbd",{children:e?"⌘K":"Ctrl K"})},bT=({onOpenSearch:e})=>{const[t,n]=T.useState(!1),r=()=>n(!1),{user:o,logout:i}=Xd(),s=pn(),a=xa()&&(s.pathname==="/chat"||s.pathname.startsWith("/chat/")),l=`${s.pathname}${s.search}`||"/",u=Ki();return g.jsxs(g.Fragment,{children:[g.jsxs("header",{className:`app-header${a?" app-header-chat":""}`,children:[g.jsxs("div",{className:"app-header-inner",children:[g.jsxs(Dr,{to:"/",className:"brand",onClick:r,children:[g.jsx("span",{className:"brand-mark"}),g.jsxs("span",{className:"brand-name",children:["Papers ",g.jsx("em",{children:"With Code"})]})]}),g.jsx("nav",{className:"nav",children:hh.map(({to:c,label:d,end:h})=>g.jsx(Dr,{to:c,end:h,className:({isActive:p})=>`nav-item ${p?"active":""}`,children:d},c))}),g.jsx("div",{className:"header-spacer"}),g.jsx("a",{className:"feedback-link header-feedback-link",href:ph,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),g.jsxs("button",{className:"search-trigger",onClick:e,children:[g.jsx(Yo,{name:"search",size:13}),g.jsx("span",{children:"Search papers, authors, domains…"}),g.jsx(_T,{})]}),g.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:g.jsx(Yo,{name:"search",size:14})}),!u&&g.jsx(Dr,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:g.jsx(Yo,{name:"bookmark",size:13})}),u?null:o?g.jsx(wT,{user:o,onLogout:i}):g.jsx(wv,{returnTo:l}),g.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(c=>!c),children:g.jsx(Yo,{name:t?"close":"menu",size:14})})]}),g.jsxs("div",{className:"site-announcement",role:"status",children:[g.jsx("span",{children:"New: Papers with Code CLI and Skill now "}),g.jsx("a",{href:ET,target:"_blank",rel:"noreferrer",children:"available"})]})]}),t&&g.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:g.jsxs("div",{className:"mobile-nav-panel",onClick:c=>c.stopPropagation(),children:[g.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),e()},children:[g.jsx(Yo,{name:"search",size:14}),g.jsx("span",{children:"Search papers, authors, domains…"})]}),hh.map(({to:c,label:d,end:h})=>g.jsx(Dr,{to:c,end:h,className:"mobile-nav-link",onClick:r,children:d},c)),g.jsx("a",{className:"mobile-nav-link",href:ph,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!u&&g.jsx(Dr,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),!u&&(o==null?void 0:o.is_admin)&&g.jsx(Dr,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:r,children:"Admin dashboard"})]})})]})},PT=1,kT=1e6;let iu=0;function TT(){return iu=(iu+1)%Number.MAX_SAFE_INTEGER,iu.toString()}const su=new Map,gh=e=>{if(su.has(e))return;const t=setTimeout(()=>{su.delete(e),di({type:"REMOVE_TOAST",toastId:e})},kT);su.set(e,t)},RT=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,PT)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?gh(n):e.toasts.forEach(r=>{gh(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Vs=[];let Ws={toasts:[]};function di(e){Ws=RT(Ws,e),Vs.forEach(t=>{t(Ws)})}function NT({...e}){const t=TT(),n=o=>di({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>di({type:"DISMISS_TOAST",toastId:t});return di({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function MT(){const[e,t]=f.useState(Ws);return f.useEffect(()=>(Vs.push(t),()=>{const n=Vs.indexOf(t);n>-1&&Vs.splice(n,1)}),[e]),{...e,toast:NT,dismiss:n=>di({type:"DISMISS_TOAST",toastId:n})}}var OT=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"}),AT="VisuallyHidden",ul=f.forwardRef((e,t)=>g.jsx(ve.span,{...e,ref:t,style:{...OT,...e.style}}));ul.displayName=AT;var LT=ul,Jd="ToastProvider",[Zd,jT,IT]=Ld("Toast"),[Mw]=kr("Toast",[IT]),[DT,cl]=Mw(Jd),Ow=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=f.useState(null),[u,c]=f.useState(0),d=f.useRef(!1),h=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Jd}\`. Expected non-empty \`string\`.`),g.jsx(Zd.Provider,{scope:t,children:g.jsx(DT,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>c(p=>p+1),[]),onToastRemove:f.useCallback(()=>c(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:h,children:s})})};Ow.displayName=Jd;var Aw="ToastViewport",$T=["F8"],Sc="toast.viewportPause",Ec="toast.viewportResume",Lw=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=$T,label:o="Notifications ({hotkey})",...i}=e,s=cl(Aw,n),a=jT(n),l=f.useRef(null),u=f.useRef(null),c=f.useRef(null),d=f.useRef(null),h=Re(t,d,s.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=s.toastCount>0;f.useEffect(()=>{const x=v=>{var w;r.length!==0&&r.every(S=>v[S]||v.code===S)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=l.current,v=d.current;if(E&&x&&v){const m=()=>{if(!s.isClosePausedRef.current){const _=new CustomEvent(Sc);v.dispatchEvent(_),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const _=new CustomEvent(Ec);v.dispatchEvent(_),s.isClosePausedRef.current=!1}},S=_=>{!x.contains(_.relatedTarget)&&w()},C=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",m),x.addEventListener("focusout",S),x.addEventListener("pointermove",m),x.addEventListener("pointerleave",C),window.addEventListener("blur",m),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",m),x.removeEventListener("focusout",S),x.removeEventListener("pointermove",m),x.removeEventListener("pointerleave",C),window.removeEventListener("blur",m),window.removeEventListener("focus",w)}}},[E,s.isClosePausedRef]);const y=f.useCallback(({tabbingDirection:x})=>{const m=a().map(w=>{const S=w.ref.current,C=[S,...XT(S)];return x==="forwards"?C:C.reverse()});return(x==="forwards"?m.reverse():m).flat()},[a]);return f.useEffect(()=>{const x=d.current;if(x){const v=m=>{var C,_,P;const w=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!w){const R=document.activeElement,L=m.shiftKey;if(m.target===x&&L){(C=u.current)==null||C.focus();return}const D=y({tabbingDirection:L?"backwards":"forwards"}),K=D.findIndex(I=>I===R);au(D.slice(K+1))?m.preventDefault():L?(_=u.current)==null||_.focus():(P=c.current)==null||P.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,y]),g.jsxs(v_,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&g.jsx(Cc,{ref:u,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});au(x)}}),g.jsx(Zd.Slot,{scope:n,children:g.jsx(ve.ol,{tabIndex:-1,...i,ref:h})}),E&&g.jsx(Cc,{ref:c,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});au(x)}})]})});Lw.displayName=Aw;var jw="ToastFocusProxy",Cc=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=cl(jw,n);return g.jsx(ul,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});Cc.displayName=jw;var Xi="Toast",FT="toast.swipeStart",zT="toast.swipeMove",UT="toast.swipeCancel",BT="toast.swipeEnd",Iw=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a,l]=Od({prop:r,defaultProp:o??!0,onChange:i,caller:Xi});return g.jsx(Tr,{present:n||a,children:g.jsx(HT,{open:a,...s,ref:t,onClose:()=>l(!1),onPause:Je(e.onPause),onResume:Je(e.onResume),onSwipeStart:V(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:V(e.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:V(e.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:V(e.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)})})})});Iw.displayName=Xi;var[VT,WT]=Mw(Xi,{onClose(){}}),HT=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:h,onSwipeEnd:p,...E}=e,y=cl(Xi,n),[x,v]=f.useState(null),m=Re(t,I=>v(I)),w=f.useRef(null),S=f.useRef(null),C=o||y.duration,_=f.useRef(0),P=f.useRef(C),R=f.useRef(0),{onToastAdd:L,onToastRemove:A}=y,z=Je(()=>{var Y;(x==null?void 0:x.contains(document.activeElement))&&((Y=y.viewport)==null||Y.focus()),s()}),D=f.useCallback(I=>{!I||I===1/0||(window.clearTimeout(R.current),_.current=new Date().getTime(),R.current=window.setTimeout(z,I))},[z]);f.useEffect(()=>{const I=y.viewport;if(I){const Y=()=>{D(P.current),u==null||u()},U=()=>{const H=new Date().getTime()-_.current;P.current=P.current-H,window.clearTimeout(R.current),l==null||l()};return I.addEventListener(Sc,U),I.addEventListener(Ec,Y),()=>{I.removeEventListener(Sc,U),I.removeEventListener(Ec,Y)}}},[y.viewport,C,l,u,D]),f.useEffect(()=>{i&&!y.isClosePausedRef.current&&D(C)},[i,C,y.isClosePausedRef,D]),f.useEffect(()=>(L(),()=>A()),[L,A]);const K=f.useMemo(()=>x?Vw(x):null,[x]);return y.viewport?g.jsxs(g.Fragment,{children:[K&&g.jsx(KT,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:K}),g.jsx(VT,{scope:n,onClose:z,children:Hi.createPortal(g.jsx(Zd.ItemSlot,{scope:n,children:g.jsx(m_,{asChild:!0,onEscapeKeyDown:V(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||z(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:g.jsx(ve.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...E,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:V(e.onKeyDown,I=>{I.key==="Escape"&&(a==null||a(I.nativeEvent),I.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:V(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:V(e.onPointerMove,I=>{if(!w.current)return;const Y=I.clientX-w.current.x,U=I.clientY-w.current.y,H=!!S.current,M=["left","right"].includes(y.swipeDirection),k=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,j=M?k(0,Y):0,B=M?0:k(0,U),F=I.pointerType==="touch"?10:2,G={x:j,y:B},X={originalEvent:I,delta:G};H?(S.current=G,Ps(zT,d,X,{discrete:!1})):mh(G,y.swipeDirection,F)?(S.current=G,Ps(FT,c,X,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(Y)>F||Math.abs(U)>F)&&(w.current=null)}),onPointerUp:V(e.onPointerUp,I=>{const Y=S.current,U=I.target;if(U.hasPointerCapture(I.pointerId)&&U.releasePointerCapture(I.pointerId),S.current=null,w.current=null,Y){const H=I.currentTarget,M={originalEvent:I,delta:Y};mh(Y,y.swipeDirection,y.swipeThreshold)?Ps(BT,p,M,{discrete:!0}):Ps(UT,h,M,{discrete:!0}),H.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),KT=e=>{const{__scopeToast:t,children:n,...r}=e,o=cl(Xi,t),[i,s]=f.useState(!1),[a,l]=f.useState(!1);return QT(()=>s(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:g.jsx(Vd,{asChild:!0,children:g.jsx(ul,{...r,children:i&&g.jsxs(g.Fragment,{children:[o.label," ",n]})})})},qT="ToastTitle",Dw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});Dw.displayName=qT;var GT="ToastDescription",$w=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});$w.displayName=GT;var Fw="ToastAction",zw=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?g.jsx(Bw,{altText:n,asChild:!0,children:g.jsx(ef,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Fw}\`. Expected non-empty \`string\`.`),null)});zw.displayName=Fw;var Uw="ToastClose",ef=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=WT(Uw,n);return g.jsx(Bw,{asChild:!0,children:g.jsx(ve.button,{type:"button",...r,ref:t,onClick:V(e.onClick,o.onClose)})})});ef.displayName=Uw;var Bw=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return g.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Vw(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),YT(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...Vw(r))}}),t}function Ps(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ad(o,i):o.dispatchEvent(i)}var mh=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function QT(e=()=>{}){const t=Je(e);vt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function YT(e){return e.nodeType===e.ELEMENT_NODE}function XT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function au(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var JT=Ow,Ww=Lw,Hw=Iw,Kw=Dw,qw=$w,Gw=zw,Qw=ef;const vh=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yh=Lv,ZT=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const h=vh(c)||vh(d);return o[u][h]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,h]=c;return h===void 0||(u[d]=h),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:h,...p}=c;return Object.entries(p).every(E=>{let[y,x]=E;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...u,d,h]:u},[]);return yh(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},eR=JT,Yw=f.forwardRef(({className:e,...t},n)=>g.jsx(Ww,{ref:n,className:Ne("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]",e),...t}));Yw.displayName=Ww.displayName;const tR=ZT("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 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"}}),Xw=f.forwardRef(({className:e,variant:t,...n},r)=>g.jsx(Hw,{ref:r,className:Ne(tR({variant:t}),e),...n}));Xw.displayName=Hw.displayName;const nR=f.forwardRef(({className:e,...t},n)=>g.jsx(Gw,{ref:n,className:Ne("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",e),...t}));nR.displayName=Gw.displayName;const Jw=f.forwardRef(({className:e,...t},n)=>g.jsx(Qw,{ref:n,className:Ne("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:g.jsx(dT,{className:"h-4 w-4"})}));Jw.displayName=Qw.displayName;const Zw=f.forwardRef(({className:e,...t},n)=>g.jsx(Kw,{ref:n,className:Ne("text-sm font-semibold",e),...t}));Zw.displayName=Kw.displayName;const e0=f.forwardRef(({className:e,...t},n)=>g.jsx(qw,{ref:n,className:Ne("text-sm opacity-90",e),...t}));e0.displayName=qw.displayName;function rR(){const{toasts:e}=MT();return g.jsxs(eR,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return g.jsxs(Xw,{...i,children:[g.jsxs("div",{className:"grid gap-1",children:[n&&g.jsx(Zw,{children:n}),r&&g.jsx(e0,{children:r})]}),o,g.jsx(Jw,{})]},t)}),g.jsx(Yw,{})]})}var oR=e=>{switch(e){case"success":return aR;case"info":return uR;case"warning":return lR;case"error":return cR;default:return null}},iR=Array(12).fill(0),sR=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},iR.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),aR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),lR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.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"})),uR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),cR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),dR=T.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"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),fR=()=>{let[e,t]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},_c=1,pR=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:_c++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,i,s=r.then(async l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(gR(l)&&!l.ok){o=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,c=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:u,description:c})}else if(t.success!==void 0){o=!1;let u=typeof t.success=="function"?await t.success(l):t.success,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let u=typeof t.error=="function"?await t.error(l):t.error,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,u)=>s.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=(e,t)=>{let n=(t==null?void 0:t.id)||_c++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ke=new pR,hR=(e,t)=>{let n=(t==null?void 0:t.id)||_c++;return Ke.addToast({title:e,...t,id:n}),n},gR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",mR=hR,vR=()=>Ke.toasts,yR=()=>Ke.getActiveToasts();Object.assign(mR,{success:Ke.success,info:Ke.info,warning:Ke.warning,error:Ke.error,custom:Ke.custom,message:Ke.message,promise:Ke.promise,dismiss:Ke.dismiss,loading:Ke.loading},{getHistory:vR,getToasts:yR});function wR(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}wR(`: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 ks(e){return e.label!==void 0}var xR=3,SR="32px",ER="16px",wh=4e3,CR=356,_R=14,bR=20,PR=200;function Ct(...e){return e.filter(Boolean).join(" ")}function kR(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var TR=e=>{var t,n,r,o,i,s,a,l,u,c,d;let{invert:h,toast:p,unstyled:E,interacting:y,setHeights:x,visibleToasts:v,heights:m,index:w,toasts:S,expanded:C,removeToast:_,defaultRichColors:P,closeButton:R,style:L,cancelButtonStyle:A,actionButtonStyle:z,className:D="",descriptionClassName:K="",duration:I,position:Y,gap:U,loadingIcon:H,expandByDefault:M,classNames:k,icons:j,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:F}=e,[G,X]=T.useState(null),[fe,ye]=T.useState(null),[J,Gt]=T.useState(!1),[be,Lt]=T.useState(!1),[gn,Mr]=T.useState(!1),[mn,Ji]=T.useState(!1),[pl,Zi]=T.useState(!1),[hl,$o]=T.useState(0),[Or,nf]=T.useState(0),Fo=T.useRef(p.duration||I||wh),rf=T.useRef(null),tr=T.useRef(null),d0=w===0,f0=w+1<=v,lt=p.type,Ar=p.dismissible!==!1,p0=p.className||"",h0=p.descriptionClassName||"",es=T.useMemo(()=>m.findIndex(q=>q.toastId===p.id)||0,[m,p.id]),g0=T.useMemo(()=>{var q;return(q=p.closeButton)!=null?q:R},[p.closeButton,R]),of=T.useMemo(()=>p.duration||I||wh,[p.duration,I]),gl=T.useRef(0),Lr=T.useRef(0),sf=T.useRef(0),jr=T.useRef(null),[m0,v0]=Y.split("-"),af=T.useMemo(()=>m.reduce((q,oe,ce)=>ce>=es?q:q+oe.height,0),[m,es]),lf=fR(),y0=p.invert||h,ml=lt==="loading";Lr.current=T.useMemo(()=>es*U+af,[es,af]),T.useEffect(()=>{Fo.current=of},[of]),T.useEffect(()=>{Gt(!0)},[]),T.useEffect(()=>{let q=tr.current;if(q){let oe=q.getBoundingClientRect().height;return nf(oe),x(ce=>[{toastId:p.id,height:oe,position:p.position},...ce]),()=>x(ce=>ce.filter(yt=>yt.toastId!==p.id))}},[x,p.id]),T.useLayoutEffect(()=>{if(!J)return;let q=tr.current,oe=q.style.height;q.style.height="auto";let ce=q.getBoundingClientRect().height;q.style.height=oe,nf(ce),x(yt=>yt.find(wt=>wt.toastId===p.id)?yt.map(wt=>wt.toastId===p.id?{...wt,height:ce}:wt):[{toastId:p.id,height:ce,position:p.position},...yt])},[J,p.title,p.description,x,p.id]);let vn=T.useCallback(()=>{Lt(!0),$o(Lr.current),x(q=>q.filter(oe=>oe.toastId!==p.id)),setTimeout(()=>{_(p)},PR)},[p,_,x,Lr]);T.useEffect(()=>{if(p.promise&<==="loading"||p.duration===1/0||p.type==="loading")return;let q;return C||y||F&&lf?(()=>{if(sf.current{var oe;(oe=p.onAutoClose)==null||oe.call(p,p),vn()},Fo.current)),()=>clearTimeout(q)},[C,y,p,lt,F,lf,vn]),T.useEffect(()=>{p.delete&&vn()},[vn,p.delete]);function w0(){var q,oe,ce;return j!=null&&j.loading?T.createElement("div",{className:Ct(k==null?void 0:k.loader,(q=p==null?void 0:p.classNames)==null?void 0:q.loader,"sonner-loader"),"data-visible":lt==="loading"},j.loading):H?T.createElement("div",{className:Ct(k==null?void 0:k.loader,(oe=p==null?void 0:p.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":lt==="loading"},H):T.createElement(sR,{className:Ct(k==null?void 0:k.loader,(ce=p==null?void 0:p.classNames)==null?void 0:ce.loader),visible:lt==="loading"})}return T.createElement("li",{tabIndex:0,ref:tr,className:Ct(D,p0,k==null?void 0:k.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[lt],(n=p==null?void 0:p.classNames)==null?void 0:n[lt]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:P,"data-styled":!(p.jsx||p.unstyled||E),"data-mounted":J,"data-promise":!!p.promise,"data-swiped":pl,"data-removed":be,"data-visible":f0,"data-y-position":m0,"data-x-position":v0,"data-index":w,"data-front":d0,"data-swiping":gn,"data-dismissible":Ar,"data-type":lt,"data-invert":y0,"data-swipe-out":mn,"data-swipe-direction":fe,"data-expanded":!!(C||M&&J),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${be?hl:Lr.current}px`,"--initial-height":M?"auto":`${Or}px`,...L,...p.style},onDragEnd:()=>{Mr(!1),X(null),jr.current=null},onPointerDown:q=>{ml||!Ar||(rf.current=new Date,$o(Lr.current),q.target.setPointerCapture(q.pointerId),q.target.tagName!=="BUTTON"&&(Mr(!0),jr.current={x:q.clientX,y:q.clientY}))},onPointerUp:()=>{var q,oe,ce,yt;if(mn||!Ar)return;jr.current=null;let wt=Number(((q=tr.current)==null?void 0:q.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),yn=Number(((oe=tr.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nr=new Date().getTime()-((ce=rf.current)==null?void 0:ce.getTime()),xt=G==="x"?wt:yn,wn=Math.abs(xt)/nr;if(Math.abs(xt)>=bR||wn>.11){$o(Lr.current),(yt=p.onDismiss)==null||yt.call(p,p),ye(G==="x"?wt>0?"right":"left":yn>0?"down":"up"),vn(),Ji(!0),Zi(!1);return}Mr(!1),X(null)},onPointerMove:q=>{var oe,ce,yt,wt;if(!jr.current||!Ar||((oe=window.getSelection())==null?void 0:oe.toString().length)>0)return;let yn=q.clientY-jr.current.y,nr=q.clientX-jr.current.x,xt=(ce=e.swipeDirections)!=null?ce:kR(Y);!G&&(Math.abs(nr)>1||Math.abs(yn)>1)&&X(Math.abs(nr)>Math.abs(yn)?"x":"y");let wn={x:0,y:0};G==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&yn<0||xt.includes("bottom")&&yn>0)&&(wn.y=yn):G==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&nr<0||xt.includes("right")&&nr>0)&&(wn.x=nr),(Math.abs(wn.x)>0||Math.abs(wn.y)>0)&&Zi(!0),(yt=tr.current)==null||yt.style.setProperty("--swipe-amount-x",`${wn.x}px`),(wt=tr.current)==null||wt.style.setProperty("--swipe-amount-y",`${wn.y}px`)}},g0&&!p.jsx?T.createElement("button",{"aria-label":B,"data-disabled":ml,"data-close-button":!0,onClick:ml||!Ar?()=>{}:()=>{var q;vn(),(q=p.onDismiss)==null||q.call(p,p)},className:Ct(k==null?void 0:k.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(i=j==null?void 0:j.close)!=null?i:dR):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:T.createElement(T.Fragment,null,lt||p.icon||p.promise?T.createElement("div",{"data-icon":"",className:Ct(k==null?void 0:k.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||w0():null,p.type!=="loading"?p.icon||(j==null?void 0:j[lt])||oR(lt):null):null,T.createElement("div",{"data-content":"",className:Ct(k==null?void 0:k.content,(a=p==null?void 0:p.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:Ct(k==null?void 0:k.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?T.createElement("div",{"data-description":"",className:Ct(K,h0,k==null?void 0:k.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),f.isValidElement(p.cancel)?p.cancel:p.cancel&&ks(p.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:q=>{var oe,ce;ks(p.cancel)&&Ar&&((ce=(oe=p.cancel).onClick)==null||ce.call(oe,q),vn())},className:Ct(k==null?void 0:k.cancelButton,(c=p==null?void 0:p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&ks(p.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||z,onClick:q=>{var oe,ce;ks(p.action)&&((ce=(oe=p.action).onClick)==null||ce.call(oe,q),!q.defaultPrevented&&vn())},className:Ct(k==null?void 0:k.actionButton,(d=p==null?void 0:p.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function xh(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function RR(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?ER:SR;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${s}-${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[`${s}-${u}`]=a:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var NR=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:h,style:p,visibleToasts:E=xR,toastOptions:y,dir:x=xh(),gap:v=_R,loadingIcon:m,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=e,[_,P]=T.useState([]),R=T.useMemo(()=>Array.from(new Set([r].concat(_.filter(F=>F.position).map(F=>F.position)))),[_,r]),[L,A]=T.useState([]),[z,D]=T.useState(!1),[K,I]=T.useState(!1),[Y,U]=T.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=T.useRef(null),M=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=T.useRef(null),j=T.useRef(!1),B=T.useCallback(F=>{P(G=>{var X;return(X=G.find(fe=>fe.id===F.id))!=null&&X.delete||Ke.dismiss(F.id),G.filter(({id:fe})=>fe!==F.id)})},[]);return T.useEffect(()=>Ke.subscribe(F=>{if(F.dismiss){P(G=>G.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{Km.flushSync(()=>{P(G=>{let X=G.findIndex(fe=>fe.id===F.id);return X!==-1?[...G.slice(0,X),{...G[X],...F},...G.slice(X+1)]:[F,...G]})})})}),[]),T.useEffect(()=>{if(c!=="system"){U(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:G})=>{U(G?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{U(X?"dark":"light")}catch(fe){console.error(fe)}})}},[c]),T.useEffect(()=>{_.length<=1&&D(!1)},[_]),T.useEffect(()=>{let F=G=>{var X,fe;o.every(ye=>G[ye]||G.code===ye)&&(D(!0),(X=H.current)==null||X.focus()),G.code==="Escape"&&(document.activeElement===H.current||(fe=H.current)!=null&&fe.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),T.useEffect(()=>{if(H.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,j.current=!1)}},[H.current]),T.createElement("section",{ref:t,"aria-label":`${S} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,G)=>{var X;let[fe,ye]=F.split("-");return _.length?T.createElement("ol",{key:F,dir:x==="auto"?xh():x,tabIndex:-1,ref:H,className:a,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":fe,"data-lifted":z&&_.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((X=L[0])==null?void 0:X.height)||0}px`,"--width":`${CR}px`,"--gap":`${v}px`,...p,...RR(l,u)},onBlur:J=>{j.current&&!J.currentTarget.contains(J.relatedTarget)&&(j.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||j.current||(j.current=!0,k.current=J.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{K||D(!1)},onDragEnd:()=>D(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},_.filter(J=>!J.position&&G===0||J.position===F).map((J,Gt)=>{var be,Lt;return T.createElement(TR,{key:J.id,icons:w,index:Gt,toast:J,defaultRichColors:d,duration:(be=y==null?void 0:y.duration)!=null?be:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:E,closeButton:(Lt=y==null?void 0:y.closeButton)!=null?Lt:s,interacting:K,position:F,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:B,toasts:_.filter(gn=>gn.position==J.position),heights:L.filter(gn=>gn.position==J.position),setHeights:A,expandByDefault:i,gap:v,loadingIcon:m,expanded:z,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const MR=({...e})=>{const{theme:t="system"}=YS();return g.jsx(NR,{theme:t,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"}},...e})};var OR=Symbol("radix.slottable");function AR(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=OR,t}var[dl]=kr("Tooltip",[rl]),tf=rl(),t0="TooltipProvider",LR=700,Sh="tooltip.open",[jR,n0]=dl(t0),r0=e=>{const{__scopeTooltip:t,delayDuration:n=LR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(jR,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};r0.displayName=t0;var o0="Tooltip",[lM,fl]=dl(o0),bc="TooltipTrigger",IR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=fl(bc,n),i=n0(bc,n),s=tf(n),a=f.useRef(null),l=Re(t,a,o.onTriggerChange),u=f.useRef(!1),c=f.useRef(!1),d=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(my,{asChild:!0,...s,children:g.jsx(ve.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:V(e.onPointerMove,h=>{h.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),c.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})});IR.displayName=bc;var DR="TooltipPortal",[uM,$R]=dl(DR,{forceMount:void 0}),No="TooltipContent",i0=f.forwardRef((e,t)=>{const n=$R(No,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=fl(No,e.__scopeTooltip);return g.jsx(Tr,{present:r||s.open,children:s.disableHoverableContent?g.jsx(s0,{side:o,...i,ref:t}):g.jsx(FR,{side:o,...i,ref:t})})}),FR=f.forwardRef((e,t)=>{const n=fl(No,e.__scopeTooltip),r=n0(No,e.__scopeTooltip),o=f.useRef(null),i=Re(t,o),[s,a]=f.useState(null),{trigger:l,onClose:u}=n,c=o.current,{onPointerInTransitChange:d}=r,h=f.useCallback(()=>{a(null),d(!1)},[d]),p=f.useCallback((E,y)=>{const x=E.currentTarget,v={x:E.clientX,y:E.clientY},m=WR(v,x.getBoundingClientRect()),w=HR(v,m),S=KR(y.getBoundingClientRect()),C=GR([...w,...S]);a(C),d(!0)},[d]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(l&&c){const E=x=>p(x,c),y=x=>p(x,l);return l.addEventListener("pointerleave",E),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",E),c.removeEventListener("pointerleave",y)}}},[l,c,p,h]),f.useEffect(()=>{if(s){const E=y=>{const x=y.target,v={x:y.clientX,y:y.clientY},m=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),w=!qR(v,s);m?h():w&&(h(),u())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[l,c,s,u,h]),g.jsx(s0,{...e,ref:i})}),[zR,UR]=dl(o0,{isInside:!1}),BR=AR("TooltipContent"),s0=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=fl(No,n),u=tf(n),{onClose:c}=l;return f.useEffect(()=>(document.addEventListener(Sh,c),()=>document.removeEventListener(Sh,c)),[c]),f.useEffect(()=>{if(l.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),g.jsx(Ja,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:g.jsxs(vy,{"data-state":l.stateAttribute,...u,...a,ref:t,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:[g.jsx(BR,{children:r}),g.jsx(zR,{scope:n,isInside:!0,children:g.jsx(LT,{id:l.contentId,role:"tooltip",children:o||r})})]})})});i0.displayName=No;var a0="TooltipArrow",VR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=tf(n);return UR(a0,n).isInside?null:g.jsx(yy,{...o,...r,ref:t})});VR.displayName=a0;function WR(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function HR(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function KR(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function qR(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=h>r&&n<(d-u)*(r-c)/(h-c)+u&&(o=!o)}return o}function GR(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),QR(t)}function QR(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var YR=r0,l0=i0;const XR=YR,JR=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(l0,{ref:r,sideOffset:t,className:Ne("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",e),...n}));JR.displayName=l0.displayName;function ZR(){const{pathname:e,hash:t}=pn();f.useEffect(()=>{t||window.scrollTo(0,0)},[e,t])}const eN="cronAdminToken";function tN(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(eN))==null?void 0:e.trim())??""}const Eh=!1;class Ta extends Error{constructor(n,r){var o;super(`API request failed: ${n.status} ${n.statusText}`);St(this,"status");St(this,"statusText");St(this,"response");St(this,"detail");St(this,"code");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{this.detail=(o=JSON.parse(r))==null?void 0:o.detail,typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code)}catch{this.detail=void 0}}}async function nN(e,t,n){const r=`${e}${t}`;try{const{headers:o,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=tN(),u=new Headers(o);u.has("Content-Type")||u.set("Content-Type","application/json"),l&&!u.has("X-Admin-Token")&&u.set("X-Admin-Token",l);const c=await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:u});if(!c.ok){const h=new Ta(c,await c.text());throw console.error("[API] Error response:",h.response),h}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${r} failed:`,o),o}}async function rN(e){try{return await e()}catch(t){throw t instanceof Ta&&t.status===401&&t.code!=="fresh_auth_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale")),t}}function oN(e){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",e);const t=Xa("/api/v1/auth/hf/login");window.location.assign(`${t}?return_to=${encodeURIComponent(window.location.href)}`)}class iN{constructor(t,n=oN){St(this,"paperLoads",new Map);St(this,"evaluationLoads",new Map);this.request=t,this.recoverFreshAuth=n}primePaper(t,n=!1){n&&this.paperLoads.delete(t);let r=this.paperLoads.get(t);return r||(r=this.request(`/papers/${t}/curation-state`).catch(o=>{throw this.paperLoads.delete(t),o}),this.paperLoads.set(t,r)),r}primeEvaluations(t,n=!1){n&&this.evaluationLoads.delete(t);let r=this.evaluationLoads.get(t);return r||(r=this.request(`/evaluations/curation-state?paper_id=${t}`).catch(o=>{throw this.evaluationLoads.delete(t),o}),this.evaluationLoads.set(t,r)),r}async mutatePaper(t,n,r,o,i){const s=this.paperLoads.get(t);if(!s)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const a=(await s).sections[n];if(!a)throw new Error(`Missing curation version for ${n}`);return this.mutate(n,o,r,a,i,`paper:${t}:${n}`)}async mutateEvaluations(t,n,r,o){const i=this.evaluationLoads.get(String(t));if(!i)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const s=(await i).version;return this.mutate("evaluations",r,n,s,o,`paper:${t}:evaluations`)}async mutate(t,n,r,o,i,s){const a=new Headers(i.headers);Object.entries(this.idempotencyHeaders(s,r,o)).forEach(([u,c])=>a.set(u,c));const l={...i,headers:a};try{const u=await this.request(n,l);return this.clearAttempt(l),u}catch(u){throw u instanceof Ta&&u.status===401&&u.code==="fresh_auth_required"?this.recoverFreshAuth(t):u instanceof Ta&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:n}}))),u}}idempotencyHeaders(t,n,r){const o=`pwc:mutation:${t}:${JSON.stringify(n)}`,i=sessionStorage.getItem(o);if(i){const a=JSON.parse(i);return{"Idempotency-Key":a.key,"If-Match":a.version}}const s=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:s,version:r})),sessionStorage.setItem(`pwc:mutation-key:${s}`,o),{"Idempotency-Key":s,"If-Match":r}}clearAttempt(t){const n=new Headers(t.headers).get("Idempotency-Key");if(!n)return;const r=sessionStorage.getItem(`pwc:mutation-key:${n}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${n}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const sN=`${Td()}/api/v1`;class aN{constructor(t=sN){St(this,"baseUrl");St(this,"curation");this.baseUrl=t,this.curation=new iN((n,r)=>this.request(n,r))}async request(t,n){return rN(()=>nN(this.baseUrl,t,n))}async getPapers(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir),t!=null&&t.time&&n.append("time",t.time),t!=null&&t.published_after&&n.append("published_after",t.published_after),t!=null&&t.published_before&&n.append("published_before",t.published_before),t!=null&&t.conference&&n.append("conference",t.conference),(t==null?void 0:t.latest_only)!==void 0&&n.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&n.append("include_resources",t.include_resources.toString()),(t==null?void 0:t.has_code)!==void 0&&n.append("has_code",t.has_code.toString()),(t==null?void 0:t.has_hf_artifacts)!==void 0&&n.append("has_hf_artifacts",t.has_hf_artifacts.toString());const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(t,n=1,r=10,o){const i=new URLSearchParams;return i.append("q",t),i.append("page",n.toString()),i.append("page_size",r.toString()),o&&i.append("mode",o),this.request(`/papers/search?${i.toString()}`)}async getPaper(t,n=!0){const r=`/papers/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getPaperByArxivId(t,n=!0){const r=`/papers/arxiv/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getRelatedPapers(t,n=4){const r=new URLSearchParams({limit:n.toString()});return this.request(`/papers/${encodeURIComponent(t)}/related?${r.toString()}`)}async indexPaperFromArxiv(t){const n=`/papers/index/${t}`;return this.request(n,{method:"POST"})}async submitPaper(t){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(t)})}primePaperCurationState(t,n=!1){return this.curation.primePaper(t,n)}primeEvaluationCurationState(t,n=!1){return this.curation.primeEvaluations(t,n)}async updatePaperTasks(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("task_ids",i.toString()));const o=`/papers/${t}/tasks?${r.toString()}`;return this.curation.mutatePaper(t,"tasks",n,o,{method:"PUT"})}async updatePaperMethods(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("method_ids",i.toString()));const o=`/papers/${t}/methods?${r.toString()}`;return this.curation.mutatePaper(t,"methods",n,o,{method:"PUT"})}async updatePaperOrganizations(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("organization_ids",i.toString()));const o=`/papers/${t}/organizations?${r.toString()}`;return this.curation.mutatePaper(t,"organizations",n,o,{method:"PUT"})}async updatePaperRepositories(t,n){const r=`/papers/${t}/repositories`;return this.curation.mutatePaper(t,"repositories",n,r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(t,n){const r=`/papers/${t}/project-pages`;return this.curation.mutatePaper(t,"project_pages",n,r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(t,n){const r=`/papers/${t}/source-url`;return this.curation.mutatePaper(t,"source_url",n,r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(t,n){const r=`/papers/${t}/hf-artifacts`;return this.curation.mutatePaper(t,"hf_artifacts",n,r,{method:"PUT",body:JSON.stringify(n)})}async getTrendingPapers(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.max_age_days&&n.append("max_age_days",t.max_age_days.toString()),(t==null?void 0:t.min_velocity)!==void 0&&n.append("min_velocity",t.min_velocity.toString());const r=`/papers/trending${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getRepositoriesForPaper(t){return this.request(`/papers/${t}/repositories`)}async getRepositories(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.owner&&n.append("owner",t.owner),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.min_stars&&n.append("min_stars",t.min_stars.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/repositories/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getProjectPagesForPaper(t){return this.request(`/papers/${t}/project-pages`)}async getProjectPages(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/project-pages/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthors(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.sort_by&&n.append("sort_by",t.sort_by),t!=null&&t.sort_order&&n.append("sort_order",t.sort_order);const r=`/authors${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthor(t){return this.request(`/authors/${t}`)}async getAuthorPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=r.toString();return this.request(`/authors/${t}/papers${o?`?${o}`:""}`)}async getAreas(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/areas/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getArea(t){return this.request(`/areas/${t}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getConferences(){return this.request("/conferences/")}async getConferenceDeadlines(){return this.request("/conferences/deadlines")}async getConference(t){return this.request(`/conferences/${t}`)}async getConferenceAreasWithTasks(t){return this.request(`/conferences/${t}/areas-with-tasks`)}async getConferencePapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.presentation&&r.append("presentation",n.presentation),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/conferences/${t}/papers?${o}`:`/conferences/${t}/papers`;return this.request(i)}async getOrganizations(t=!1){return this.request(`/organizations/${t?"?featured_only=true":""}`)}async getOrganization(t){return this.request(`/organizations/${t}`)}async getOrganizationContributions(t){return this.request(`/organizations/${t}/contributions`)}async getOrganizationAreasWithTasks(t){return this.request(`/organizations/${t}/areas-with-tasks`)}async getOrganizationPapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/organizations/${t}/papers?${o}`:`/organizations/${t}/papers`;return this.request(i)}async getAreaTasks(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/areas/${t}/tasks${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTasks(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.area_id&&n.append("area_id",t.area_id.toString()),t!=null&&t.parent_id&&n.append("parent_id",t.parent_id.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/tasks/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getTask(t){return this.request(`/tasks/${t}`)}async getFrameworkCatalog(){return this.request("/frameworks/")}async getTopTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString());const r=n.toString(),o=r?`/tasks/top?${r}`:"/tasks/top";return this.request(o)}async getTrendingTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.recent_days&&n.append("recent_days",t.recent_days.toString()),t!=null&&t.baseline_days&&n.append("baseline_days",t.baseline_days.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),(t==null?void 0:t.min_recent_papers)!==void 0&&n.append("min_recent_papers",t.min_recent_papers.toString()),(t==null?void 0:t.min_baseline_papers)!==void 0&&n.append("min_baseline_papers",t.min_baseline_papers.toString()),(t==null?void 0:t.min_share_lift)!==void 0&&n.append("min_share_lift",t.min_share_lift.toString());const r=n.toString(),o=r?`/tasks/trending?${r}`:"/tasks/trending";return this.request(o)}async getTaskChildren(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/tasks/${t}/children${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTaskParents(t){return this.request(`/tasks/${t}/parents`)}async getTaskPage(t,n){const r=new URLSearchParams;(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=`/tasks/${t}/page${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTrendingBenchmarks(t,n){const r=new URLSearchParams;(n==null?void 0:n.limit)!==void 0&&r.append("limit",n.limit.toString()),(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.min_recent_papers)!==void 0&&r.append("min_recent_papers",n.min_recent_papers.toString()),(n==null?void 0:n.include_descendants)!==void 0&&r.append("include_descendants",n.include_descendants.toString()),(n==null?void 0:n.bucket_days)!==void 0&&r.append("bucket_days",n.bucket_days.toString()),(n==null?void 0:n.history_buckets)!==void 0&&r.append("history_buckets",n.history_buckets.toString()),(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=r.toString(),i=`/tasks/${encodeURIComponent(t)}/trending-benchmarks${o?`?${o}`:""}`;return this.request(i)}async getTaskPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.toString());const o=r.toString(),i=o?`/tasks/${t}/papers?${o}`:`/tasks/${t}/papers`;return this.request(i)}async getMethods(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.introduced_year&&n.append("introduced_year",t.introduced_year.toString()),(t==null?void 0:t.area_id)!==void 0&&n.append("area_id",t.area_id.toString()),(t==null?void 0:t.exclude_id)!==void 0&&n.append("exclude_id",t.exclude_id.toString()),(t==null?void 0:t.include_trends)!==void 0&&n.append("include_trends",t.include_trends.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/methods/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMethod(t){return this.request(`/methods/${encodeURIComponent(t)}`)}async getMethodTrend(t,n){const r=new URLSearchParams;(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.history_months)!==void 0&&r.append("history_months",n.history_months.toString());const o=r.toString();return this.request(`/methods/${encodeURIComponent(t)}/trend${o?`?${o}`:""}`)}async getMethodPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.toString());const o=r.toString(),i=o?`/methods/${encodeURIComponent(t)}/papers?${o}`:`/methods/${encodeURIComponent(t)}/papers`;return this.request(i)}async getDatasets(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.task&&n.append("task",t.task),t!=null&&t.task_id&&n.append("task",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),(t==null?void 0:t.min_eval_count)!==void 0&&n.append("min_eval_count",t.min_eval_count.toString()),(t==null?void 0:t.is_open)!==void 0&&n.append("is_open",t.is_open.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/datasets/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getDataset(t){return this.request(`/datasets/${t}`)}async getDatasetBySlug(t,n){const r=new URLSearchParams;n!=null&&n.include_paper&&r.set("include_paper","true"),n!=null&&n.task&&r.set("task",n.task),(n==null?void 0:n.is_open)!==void 0&&r.set("is_open",String(n.is_open));const o=r.size?`?${r.toString()}`:"";return this.request(`/datasets/${t}${o}`)}async getDatasetTasks(t){return(await this.request(`/datasets/${t}/tasks/`)).results}async getLeaderboardMetrics(t,n){return(await this.request(`/datasets/${t}/tasks/${n}/metrics`)).metrics}async getEvaluations(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.task_id&&n.append("task_id",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),t!=null&&t.dataset_id&&n.append("dataset_id",t.dataset_id.toString()),t!=null&&t.best_metric&&n.append("best_metric",t.best_metric),(t==null?void 0:t.external)!==void 0&&n.append("external",String(t.external)),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/evaluations/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getEvaluation(t){return this.request(`/evaluations/${t}`)}async getEvaluationsByPaper(t){const r=parseInt(t),o=await this.getEvaluations({paper_id:r,page_size:100,ordering:"-benchmark_popularity"}),i=[...o.results];let s=o.next_page;for(;s;){const a=await this.getEvaluations({paper_id:r,page:s,page_size:100,ordering:"-benchmark_popularity"});i.push(...a.results),s=a.next_page}return i}async getEvaluationsByDataset(t,n){const o=parseInt(t),i=await this.getEvaluations({dataset_id:o,best_metric:n,page_size:100,ordering:"best_rank"}),s=[...i.results];let a=i.next_page;for(;a;){const l=await this.getEvaluations({dataset_id:o,best_metric:n,page:a,page_size:100,ordering:"best_rank"});s.push(...l.results),a=l.next_page}return s}async createEvaluation(t){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(t)})}async updateEvaluation(t,n){const r=`/evaluations/${t}`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async deleteEvaluation(t){const n=`/evaluations/${t}`;return this.request(n,{method:"DELETE"})}async batchEvaluations(t,n){return this.curation.mutateEvaluations(t,n,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:t,operations:n})})}async generateThumbnail(t){const n=io(`/api/thumbnails/generate/${t}`),r=await fetch(n,{method:"POST"});if(!r.ok)throw new Error(`Thumbnail generation failed: ${r.status}`);return await r.json()}async getThumbnailStatus(t){const n=io(`/api/thumbnails/status/${t}`),r=await fetch(n);if(!r.ok)throw new Error(`Thumbnail status check failed: ${r.status}`);return await r.json()}async healthCheck(){const t=io("/health"),n=await fetch(t);if(!n.ok)throw new Error(`Health check failed: ${n.status}`);return await n.json()}async getMetrics(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.direction&&n.append("direction",t.direction),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/metrics/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMetric(t){return this.request(`/metrics/${t}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(t){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(t)})}async listPendingPaperEdits(t){const n=new URLSearchParams;t!=null&&t.status&&n.append("status",t.status),t!=null&&t.edit_type&&n.append("edit_type",t.edit_type),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString());const r=`/admin/paper-edits${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getPendingPaperEdit(t){return this.request(`/admin/paper-edits/${t}`)}async approvePendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/approve`,{method:"POST",body:JSON.stringify(n??{})})}async rejectPendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/reject`,{method:"POST",body:JSON.stringify(n??{})})}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"POST"})}async removeBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"DELETE"})}async getMyPreferences(){return this.request("/me/preferences")}async updateMyPreferences(t){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(t)})}async getCronStatus(){return this.request("/cron/status",{cache:"no-store"})}async getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}async getMyContributions(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/contributions${n}`)}async getCatalogAudit(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/admin/catalog-audit${n}`)}async acknowledgeCatalogAudit(){await this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}async rollbackCatalogEvent(t){return this.request(`/admin/catalog-audit/${t}/rollback`,{method:"POST"})}}const b=new aN;b.getPapers.bind(b);const cM=b.getPaper.bind(b);b.getPaperByArxivId.bind(b);const dM=b.indexPaperFromArxiv.bind(b),fM=b.submitPaper.bind(b),pM=b.updatePaperTasks.bind(b),hM=b.updatePaperMethods.bind(b),gM=b.updatePaperOrganizations.bind(b),mM=b.updatePaperRepositories.bind(b),vM=b.updatePaperProjectPages.bind(b),yM=b.updatePaperSourceUrl.bind(b),wM=b.updatePaperHfArtifacts.bind(b);b.primePaperCurationState.bind(b);b.primeEvaluationCurationState.bind(b);b.getTrendingPapers.bind(b);b.getRepositoriesForPaper.bind(b);b.getRepositories.bind(b);b.getProjectPagesForPaper.bind(b);b.getProjectPages.bind(b);b.getAuthors.bind(b);b.getAuthor.bind(b);b.getAreas.bind(b);b.getArea.bind(b);b.getAreasWithTasks.bind(b);b.getConferences.bind(b);b.getConferenceDeadlines.bind(b);b.getConference.bind(b);b.getConferenceAreasWithTasks.bind(b);b.getConferencePapers.bind(b);const xM=b.getOrganizations.bind(b);b.getOrganization.bind(b);b.getOrganizationContributions.bind(b);b.getOrganizationAreasWithTasks.bind(b);b.getOrganizationPapers.bind(b);b.getAreaTasks.bind(b);const SM=b.getTasks.bind(b),EM=b.getTask.bind(b);b.getTopTasks.bind(b);b.getTrendingTasks.bind(b);b.getTaskChildren.bind(b);b.getTaskParents.bind(b);b.getTaskPage.bind(b);b.getTaskPapers.bind(b);const CM=b.getMethods.bind(b),_M=b.getMethod.bind(b);b.getMethodPapers.bind(b);const bM=b.getDatasets.bind(b),PM=b.getDataset.bind(b);b.getDatasetBySlug.bind(b);b.getDatasetTasks.bind(b);const kM=b.getLeaderboardMetrics.bind(b);b.getEvaluations.bind(b);b.getEvaluation.bind(b);const TM=b.getEvaluationsByPaper.bind(b);b.getEvaluationsByDataset.bind(b);b.createEvaluation.bind(b);b.updateEvaluation.bind(b);b.deleteEvaluation.bind(b);const RM=b.batchEvaluations.bind(b);b.generateThumbnail.bind(b);b.getThumbnailStatus.bind(b);b.getMetrics.bind(b);b.getMetric.bind(b);b.getMetricDirections.bind(b);b.getResearchTrends.bind(b);b.healthCheck.bind(b);b.getMyBookmarkIds.bind(b);b.getMyBookmarks.bind(b);b.addBookmark.bind(b);b.getMyPreferences.bind(b);b.updateMyPreferences.bind(b);const NM=b.submitPendingPaperEdit.bind(b),MM=b.listPendingPaperEdits.bind(b);b.getPendingPaperEdit.bind(b);const OM=b.approvePendingPaperEdit.bind(b),AM=b.rejectPendingPaperEdit.bind(b);b.removeBookmark.bind(b);const lu={hide_closed_source_evals:!1},u0=T.createContext(null),lN=({children:e})=>{const{user:t}=Xd(),[n,r]=T.useState(lu),[o,i]=T.useState(!1);T.useEffect(()=>{let l=!1;if(!t){r(lu);return}return i(!0),b.getMyPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(lu)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[t]);const s=T.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!t)try{const c=await b.updateMyPreferences(u);r(c)}catch{r(n)}},[n,t]),a=T.useMemo(()=>({preferences:n,canPersist:!!t,isLoading:o,setHideClosedSourceEvals:s}),[n,t,o,s]);return g.jsx(u0.Provider,{value:a,children:e})};function LM(){const e=T.useContext(u0);if(!e)throw new Error("usePreferences must be used inside a ");return e}const c0=zE(),uN=c0?oE:rE;if(!c0&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const cN=T.lazy(()=>ie(()=>import("./FeedView-BVMZaD9m.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),dN=T.lazy(()=>ie(()=>import("./ChatView-DDHqYDAC.js"),__vite__mapDeps([17,18,7,3,4,19,20,21,10,11,8]))),fN=T.lazy(()=>ie(()=>import("./SharedChatView-ONvzGQrB.js"),__vite__mapDeps([22,10,11,18,7,3,4,19,20,21]))),pN=T.lazy(()=>ie(()=>import("./PapersListView-BzmcMfSw.js"),__vite__mapDeps([23,1,2,3,4,5,9,10,11,12,24,14,13,15,16]))),hN=T.lazy(()=>ie(()=>import("./PaperDetailView-CGHTDbxn.js"),__vite__mapDeps([25,10,11,1,2,3,4,5,26,19,27,28,9,12,15,16,29,30,31,32,33,34,35,36,37,38,21]))),gN=T.lazy(()=>ie(()=>import("./TagsIndexView--NNviBMX.js"),__vite__mapDeps([39,10,11,5,15,16,40,34,29,31,32,33,35]))),mN=T.lazy(()=>ie(()=>import("./TagBrowseView-CrKqHljw.js"),__vite__mapDeps([41,10,11,1,2,3,4,5,42,6,43,20,21,19,9,12,13,15,16,44,38]))),vN=T.lazy(()=>ie(()=>import("./MethodsIndexView-CDBkw1Ix.js"),__vite__mapDeps([45,10,11,46,15,16,40,34,29,31,32,33,35]))),yN=T.lazy(()=>ie(()=>import("./FrameworksIndexView-Cn2Zjt-F.js"),__vite__mapDeps([47,10,11,1,2,3,4,5]))),wN=T.lazy(()=>ie(()=>import("./TrendsView-CtkIaI1c.js"),__vite__mapDeps([48,10,11,16,15]))),xN=T.lazy(()=>ie(()=>import("./ConferencesIndexView-BV1UHo-C.js"),__vite__mapDeps([49,10,11,15,16,40,34,29,31,32,33,35]))),SN=T.lazy(()=>ie(()=>import("./AiDeadlinesView-uOgVcFI9.js"),__vite__mapDeps([50,10,11,51,30,15,16,32]))),EN=T.lazy(()=>ie(()=>import("./ConferenceDetailView-bTqcoiXt.js"),__vite__mapDeps([52,10,11,43,3,4,20,21,19,5,15,16]))),CN=T.lazy(()=>ie(()=>import("./ConferenceTaskView-D8rZq4uz.js"),__vite__mapDeps([53,10,11,1,2,3,4,5,6,43,20,21,19,9,12,13,15,16]))),_N=T.lazy(()=>ie(()=>import("./OrganizationsIndexView-D1m-Jyhd.js"),__vite__mapDeps([54,10,11,16,15,55]))),bN=T.lazy(()=>ie(()=>import("./OrganizationDetailView-DJd05bzy.js"),__vite__mapDeps([56,57,10,11,1,2,3,4,5,43,20,21,19,15,6,16,36,29,32,35,13,9,12,58]))),PN=T.lazy(()=>ie(()=>import("./OrganizationTaskView-B91F04sp.js"),__vite__mapDeps([59,57,10,11,1,2,3,4,5,43,20,21,19,15,6,16,36,29,32,35,13,9,12,58]))),kN=T.lazy(()=>ie(()=>import("./AuthorDetailView-CYd080uW.js"),__vite__mapDeps([60,10,11,15,58]))),TN=T.lazy(()=>ie(()=>import("./MethodDetailView-CR2MACLD.js"),__vite__mapDeps([61,10,11,12,1,2,3,4,5,6,43,20,21,19,46,13,15,16]))),RN=T.lazy(()=>ie(()=>import("./BenchmarkDetailView-BVdCY9wO.js"),__vite__mapDeps([62,10,11,15,51,30,16,2,3,4,26,19,27,42,1,5,63]))),NN=T.lazy(()=>ie(()=>import("./SavedPapersView-AVBr0WvC.js"),__vite__mapDeps([64,10,11,1,2,3,4,5,15,16]))),MN=T.lazy(()=>ie(()=>import("./SettingsView-CN37p6xn.js"),__vite__mapDeps([65,10,11,33,51,30,28,66]))),ON=T.lazy(()=>ie(()=>import("./SubmitView-Bv_8lA_L.js"),__vite__mapDeps([67,33,16,29,31]))),AN=T.lazy(()=>ie(()=>import("./CronDashboard-D0q8JAn8.js"),__vite__mapDeps([68,10,11,37,29,44,69,35,66,33,12,70]))),LN=T.lazy(()=>ie(()=>import("./SubmissionsDashboard-BrnMfyKI.js"),__vite__mapDeps([71,11,10,33,69,35]))),jN=T.lazy(()=>ie(()=>import("./ContributionsPage-CQgUV_SV.js"),__vite__mapDeps([72,12,11,29]))),Ch=T.lazy(()=>ie(()=>import("./NotFound-B_H_to4V.js"),[])),IN=T.lazy(()=>ie(()=>import("./SearchOverlay-NFroiW9m.js"),__vite__mapDeps([73,10,11,2,3,4,24,5]))),DN=()=>g.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),g.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),$N=new DE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),FN=()=>{const{arxivId:e}=nv();return g.jsx(ko,{to:e?`/paper/${e}`:"/papers",replace:!0})},zN=()=>{const{taskSlug:e}=nv();return g.jsx(ko,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},uu=({element:e})=>Ki()?g.jsx(ko,{to:"/",replace:!0}):g.jsx(g.Fragment,{children:e}),UN=({element:e})=>{const{user:t,isLoading:n}=Xd();return Ki()?g.jsx(ko,{to:"/",replace:!0}):n?g.jsx("div",{className:"page",children:g.jsx("div",{className:"submission-loading",children:g.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?g.jsx(g.Fragment,{children:e}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Admin access required"}),g.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Sign in required"}),g.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),g.jsx(wv,{returnTo:"/admin-dashboard"})]})})},BN=()=>{const e=FE(),t=typeof window<"u"&&new URL(e,window.location.origin).origin!==window.location.origin;return T.useEffect(()=>{t&&window.location.replace(e)},[e,t]),t?g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-loading",children:[g.jsx("span",{children:"Opening the production admin dashboard..."}),g.jsx("a",{href:e,children:"Continue"})]})}):g.jsx(UN,{element:g.jsx(AN,{})})},VN=()=>{const[e,t]=T.useState(!1);return ZR(),T.useLayoutEffect(()=>{var n;(n=document.getElementById("initial-discovery-footer"))==null||n.remove()},[]),T.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="k"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),g.jsxs(g.Fragment,{children:[g.jsx(bT,{onOpenSearch:()=>t(!0)}),g.jsx("main",{children:g.jsx(T.Suspense,{fallback:g.jsx(DN,{}),children:g.jsxs(G1,{children:[g.jsx(ne,{path:"/",element:g.jsx(cN,{})}),g.jsx(ne,{path:"/chat/:sessionId?",element:xa()?g.jsx(dN,{}):g.jsx(ko,{to:"/",replace:!0})}),g.jsx(ne,{path:"/share/:shareId",element:xa()?g.jsx(fN,{}):g.jsx(Ch,{})}),g.jsx(ne,{path:"/papers",element:g.jsx(pN,{})}),g.jsx(ne,{path:"/papers/:arxivId",element:g.jsx(FN,{})}),g.jsx(ne,{path:"/paper/:arxivId",element:g.jsx(hN,{})}),g.jsx(ne,{path:"/tasks",element:g.jsx(gN,{})}),g.jsx(ne,{path:"/tasks/:taskSlug",element:g.jsx(mN,{})}),g.jsx(ne,{path:"/task/:taskSlug",element:g.jsx(zN,{})}),g.jsx(ne,{path:"/methods",element:g.jsx(vN,{})}),g.jsx(ne,{path:"/methods/:methodSlug",element:g.jsx(TN,{})}),g.jsx(ne,{path:"/frameworks",element:g.jsx(yN,{})}),g.jsx(ne,{path:"/trends",element:g.jsx(wN,{})}),g.jsx(ne,{path:"/conferences",element:g.jsx(xN,{})}),g.jsx(ne,{path:"/ai-deadlines",element:g.jsx(SN,{})}),g.jsx(ne,{path:"/conferences/:confSlug",element:g.jsx(EN,{})}),g.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:g.jsx(CN,{})}),g.jsx(ne,{path:"/organizations",element:g.jsx(_N,{})}),g.jsx(ne,{path:"/orgs/:orgSlug",element:g.jsx(bN,{})}),g.jsx(ne,{path:"/orgs/:orgSlug/:taskSlug",element:g.jsx(PN,{})}),g.jsx(ne,{path:"/authors/:authorId",element:g.jsx(kN,{})}),g.jsx(ne,{path:"/benchmark/:datasetSlug",element:g.jsx(RN,{})}),g.jsx(ne,{path:"/submit",element:g.jsx(ON,{})}),g.jsx(ne,{path:"/saved",element:g.jsx(uu,{element:g.jsx(NN,{})})}),g.jsx(ne,{path:"/settings",element:g.jsx(MN,{})}),g.jsx(ne,{path:"/admin-dashboard",element:g.jsx(BN,{})}),g.jsx(ne,{path:"/cron-dashboard",element:g.jsx(ko,{to:"/admin-dashboard",replace:!0})}),g.jsx(ne,{path:"/submissions",element:g.jsx(uu,{element:g.jsx(LN,{})})}),g.jsx(ne,{path:"/contributions",element:g.jsx(uu,{element:g.jsx(jN,{})})}),g.jsx(ne,{path:"*",element:g.jsx(Ch,{})})]})})}),e&&g.jsx(T.Suspense,{fallback:null,children:g.jsx(IN,{open:e,onClose:()=>t(!1)})})]})},WN=()=>g.jsx($E,{client:$N,children:g.jsx(ST,{children:g.jsx(lN,{children:g.jsxs(XR,{children:[g.jsx(uN,{children:g.jsx(VN,{})}),g.jsx(rR,{}),g.jsx(MR,{}),!1]})})})});o1();const HN=qm(document.getElementById("root"));HN.render(g.jsx(T.StrictMode,{children:g.jsx(XS,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:g.jsx(n1,{children:g.jsx(WN,{})})})}));export{tM as $,CM as A,mM as B,lT as C,vM as D,yM as E,bM as F,RM as G,kM as H,wM as I,gM as J,xM as K,Cn as L,Ki as M,Vv as N,nP as O,Tr as P,rP as Q,T as R,xy as S,cT as T,oM as U,LM as V,fT as W,dT as X,pT as Y,Tw as Z,It as _,GN as a,iM as a0,dM as a1,pc as a2,vt as a3,Ld as a4,Sv as a5,ZT as a6,wv as a7,Pr as a8,Ub as a9,Uv as aA,Bv as aB,OM as aC,AM as aD,MM as aE,Oi as aF,LE as aG,XN as aH,ZN as aI,JN as aJ,rM as aK,pn as aL,bE as aM,yE as aN,ac as aO,fv as aP,mE as aQ,vE as aR,sc as aS,uv as aT,OE as aU,SE as aV,my as aa,rl as ab,Vd as ac,pP as ad,Ay as ae,y_ as af,qv as ag,Ja as ah,vy as ai,yy as aj,sM as ak,YN as al,cM as am,qN as an,Ah as ao,YS as ap,fM as aq,Ya as ar,Ue as as,QN as at,cv as au,bt as av,EM as aw,_M as ax,PM as ay,zv as az,b,ll as c,io as d,nv as e,Xd as f,MT as g,BE as h,xa as i,g as j,nM as k,TM as l,ve as m,Od as n,Re as o,V as p,Lb as q,f as r,kr as s,Ne as t,bd as u,eM as v,NM as w,pM as x,SM as y,hM as z}; diff --git a/assets/loader-circle-C5GDD3qQ.js b/assets/loader-circle-DEdDfzjU.js similarity index 85% rename from assets/loader-circle-C5GDD3qQ.js rename to assets/loader-circle-DEdDfzjU.js index 39194d317d03438ff0a4ab051e4bdd1fbdf53f0a..3571827bf4df3d3abeabe84e427d04630e242f43 100644 --- a/assets/loader-circle-C5GDD3qQ.js +++ b/assets/loader-circle-DEdDfzjU.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-LWBjDGUR.js";/** +import{c as e}from"./index-DsjIhQkx.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/searchable-select-BvzTwnT-.js b/assets/searchable-select-Bl979FVT.js similarity index 92% rename from assets/searchable-select-BvzTwnT-.js rename to assets/searchable-select-Bl979FVT.js index e485d6966b86d242d586d60c3d9377ac99db5e1f..ace19be3e38b1781db01913546544d9cd6746c06 100644 --- a/assets/searchable-select-BvzTwnT-.js +++ b/assets/searchable-select-Bl979FVT.js @@ -1,4 +1,4 @@ -import{c as we,r as n,j as f,a7 as B,m as Ye,a8 as et,a1 as $,n as Re,l as A,o as G,a9 as Ee,aa as Pe,P as Se,ab as tt,q as rt,ac as nt,ad as ot,ae as at,af as lt,ag as st,ah as it,ai as ct,s as M,C as ut}from"./index-LWBjDGUR.js";import{u as dt}from"./useQuery-CVb9j2D6.js";import{B as ft}from"./button-D2jk6ElT.js";import{R as pt,P as mt,O as vt,C as ht}from"./dialog-CUdQ6AzV.js";import{L as gt}from"./loader-circle-C5GDD3qQ.js";/** +import{c as we,r as n,j as f,a8 as B,n as Ye,a9 as et,a2 as $,o as Re,m as A,p as G,aa as Ee,ab as Pe,P as Se,ac as tt,s as rt,ad as nt,ae as ot,af as at,ag as lt,ah as st,ai as it,aj as ct,t as M,C as ut}from"./index-DsjIhQkx.js";import{u as dt}from"./useQuery-xOve4y-6.js";import{B as ft}from"./button-CYp7VsNM.js";import{R as pt,P as mt,O as vt,C as ht}from"./dialog-BoPFX590.js";import{L as gt}from"./loader-circle-DEdDfzjU.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,4 +8,4 @@ import{c as we,r as n,j as f,a7 as B,m as Ye,a8 as et,a1 as $,n as Re,l as A,o a * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bt=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);function yt(e){const r=Ct(e),t=n.forwardRef((s,o)=>{const{children:l,...i}=s,c=n.Children.toArray(l),v=c.find(Rt);if(v){const u=v.props.children,h=c.map(g=>g===v?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:g);return f.jsx(r,{...i,ref:o,children:n.isValidElement(u)?n.cloneElement(u,void 0,h):null})}return f.jsx(r,{...i,ref:o,children:l})});return t.displayName=`${e}.Slot`,t}function Ct(e){const r=n.forwardRef((t,s)=>{const{children:o,...l}=t;if(n.isValidElement(o)){const i=Pt(o),c=Et(l,o.props);return o.type!==n.Fragment&&(c.ref=s?B(s,i):i),n.cloneElement(o,c)}return n.Children.count(o)>1?n.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var wt=Symbol("radix.slottable");function Rt(e){return n.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wt}function Et(e,r){const t={...r};for(const s in r){const o=e[s],l=r[s];/^on[A-Z]/.test(s)?o&&l?t[s]=(...c)=>{const v=l(...c);return o(...c),v}:o&&(t[s]=o):s==="style"?t[s]={...o,...l}:s==="className"&&(t[s]=[o,l].filter(Boolean).join(" "))}return{...e,...t}}function Pt(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var X="Popover",[ke]=rt(X,[Pe]),U=Pe(),[St,D]=ke(X),je=e=>{const{__scopePopover:r,children:t,open:s,defaultOpen:o,onOpenChange:l,modal:i=!1}=e,c=U(r),v=n.useRef(null),[u,h]=n.useState(!1),[g,y]=Ye({prop:s,defaultProp:o??!1,onChange:l,caller:X});return f.jsx(et,{...c,children:f.jsx(St,{scope:r,contentId:$(),triggerRef:v,open:g,onOpenChange:y,onOpenToggle:n.useCallback(()=>y(w=>!w),[y]),hasCustomAnchor:u,onCustomAnchorAdd:n.useCallback(()=>h(!0),[]),onCustomAnchorRemove:n.useCallback(()=>h(!1),[]),modal:i,children:t})})};je.displayName=X;var Ne="PopoverAnchor",kt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ne,t),l=U(t),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=o;return n.useEffect(()=>(i(),()=>c()),[i,c]),f.jsx(Ee,{...l,...s,ref:r})});kt.displayName=Ne;var Ae="PopoverTrigger",Ie=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ae,t),l=U(t),i=Re(r,o.triggerRef),c=f.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Fe(o.open),...s,ref:i,onClick:G(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:f.jsx(Ee,{asChild:!0,...l,children:c})});Ie.displayName=Ae;var de="PopoverPortal",[jt,Nt]=ke(de,{forceMount:void 0}),Me=e=>{const{__scopePopover:r,forceMount:t,children:s,container:o}=e,l=D(de,r);return f.jsx(jt,{scope:r,forceMount:t,children:f.jsx(Se,{present:t||l.open,children:f.jsx(tt,{asChild:!0,container:o,children:s})})})};Me.displayName=de;var W="PopoverContent",Oe=n.forwardRef((e,r)=>{const t=Nt(W,e.__scopePopover),{forceMount:s=t.forceMount,...o}=e,l=D(W,e.__scopePopover);return f.jsx(Se,{present:s||l.open,children:l.modal?f.jsx(It,{...o,ref:r}):f.jsx(Mt,{...o,ref:r})})});Oe.displayName=W;var At=yt("PopoverContent.RemoveScroll"),It=n.forwardRef((e,r)=>{const t=D(W,e.__scopePopover),s=n.useRef(null),o=Re(r,s),l=n.useRef(!1);return n.useEffect(()=>{const i=s.current;if(i)return nt(i)},[]),f.jsx(ot,{as:At,allowPinchZoom:!0,children:f.jsx(_e,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),l.current||(c=t.triggerRef.current)==null||c.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,v=c.button===0&&c.ctrlKey===!0,u=c.button===2||v;l.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:G(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Mt=n.forwardRef((e,r)=>{const t=D(W,e.__scopePopover),s=n.useRef(!1),o=n.useRef(!1);return f.jsx(_e,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(s.current||(c=t.triggerRef.current)==null||c.focus(),l.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:l=>{var v,u;(v=e.onInteractOutside)==null||v.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=l.target;((u=t.triggerRef.current)==null?void 0:u.contains(i))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),_e=n.forwardRef((e,r)=>{const{__scopePopover:t,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onInteractOutside:h,...g}=e,y=D(W,t),w=U(t);return at(),f.jsx(lt,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(st,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onDismiss:()=>y.onOpenChange(!1),children:f.jsx(it,{"data-state":Fe(y.open),role:"dialog",id:y.contentId,...w,...g,ref:r,style:{...g.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)"}})})})}),De="PopoverClose",Ot=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(De,t);return f.jsx(A.button,{type:"button",...s,ref:r,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});Ot.displayName=De;var _t="PopoverArrow",Dt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=U(t);return f.jsx(ct,{...o,...s,ref:r})});Dt.displayName=_t;function Fe(e){return e?"open":"closed"}var Ft=je,$t=Ie,Lt=Me,$e=Oe;const Tt=Ft,Vt=$t,Le=n.forwardRef(({className:e,align:r="center",sideOffset:t=4,...s},o)=>f.jsx(Lt,{children:f.jsx($e,{ref:o,align:r,sideOffset:t,className:M("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),...s})}));Le.displayName=$e.displayName;var be=1,qt=.9,Kt=.8,Bt=.17,le=.1,se=.999,Wt=.9999,Ht=.99,zt=/[\\\/_+.#"@\[\(\{&]/,Gt=/[\\\/_+.#"@\[\(\{&]/g,Ut=/[\s-]/,Te=/[\s-]/g;function ce(e,r,t,s,o,l,i){if(l===r.length)return o===e.length?be:Ht;var c=`${o},${l}`;if(i[c]!==void 0)return i[c];for(var v=s.charAt(l),u=t.indexOf(v,o),h=0,g,y,w,k;u>=0;)g=ce(e,r,t,s,u+1,l+1,i),g>h&&(u===o?g*=be:zt.test(e.charAt(u-1))?(g*=Kt,w=e.slice(o,u-1).match(Gt),w&&o>0&&(g*=Math.pow(se,w.length))):Ut.test(e.charAt(u-1))?(g*=qt,k=e.slice(o,u-1).match(Te),k&&o>0&&(g*=Math.pow(se,k.length))):(g*=Bt,o>0&&(g*=Math.pow(se,u-o))),e.charAt(u)!==r.charAt(l)&&(g*=Wt)),(gg&&(g=y*le)),g>h&&(h=g),u=t.indexOf(v,u+1);return i[c]=h,h}function ye(e){return e.toLowerCase().replace(Te," ")}function Qt(e,r,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,ce(e,r,ye(e),ye(r),0,0,{})}var z='[cmdk-group=""]',ie='[cmdk-group-items=""]',Zt='[cmdk-group-heading=""]',Ve='[cmdk-item=""]',Ce=`${Ve}:not([aria-disabled="true"])`,ue="cmdk-item-select",q="data-value",Jt=(e,r,t)=>Qt(e,r,t),qe=n.createContext(void 0),Q=()=>n.useContext(qe),Ke=n.createContext(void 0),fe=()=>n.useContext(Ke),Be=n.createContext(void 0),We=n.forwardRef((e,r)=>{let t=K(()=>{var a,p;return{search:"",value:(p=(a=e.value)!=null?a:e.defaultValue)!=null?p:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=K(()=>new Set),o=K(()=>new Map),l=K(()=>new Map),i=K(()=>new Set),c=He(e),{label:v,children:u,value:h,onValueChange:g,filter:y,shouldFilter:w,loop:k,disablePointerSelection:T=!1,vimBindings:j=!0,...F}=e,N=$(),Z=$(),O=$(),I=n.useRef(null),m=ir();L(()=>{if(h!==void 0){let a=h.trim();t.current.value=a,R.emit()}},[h]),L(()=>{m(6,me)},[]);let R=n.useMemo(()=>({subscribe:a=>(i.current.add(a),()=>i.current.delete(a)),snapshot:()=>t.current,setState:(a,p,x)=>{var d,b,C,S;if(!Object.is(t.current[a],p)){if(t.current[a]=p,a==="search")ne(),te(),m(1,re);else if(a==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let E=document.getElementById(O);E?E.focus():(d=document.getElementById(N))==null||d.focus()}if(m(7,()=>{var E;t.current.selectedItemId=(E=V())==null?void 0:E.id,R.emit()}),x||m(5,me),((b=c.current)==null?void 0:b.value)!==void 0){let E=p??"";(S=(C=c.current).onValueChange)==null||S.call(C,E);return}}R.emit()}},emit:()=>{i.current.forEach(a=>a())}}),[]),ee=n.useMemo(()=>({value:(a,p,x)=>{var d;p!==((d=l.current.get(a))==null?void 0:d.value)&&(l.current.set(a,{value:p,keywords:x}),t.current.filtered.items.set(a,pe(p,x)),m(2,()=>{te(),R.emit()}))},item:(a,p)=>(s.current.add(a),p&&(o.current.has(p)?o.current.get(p).add(a):o.current.set(p,new Set([a]))),m(3,()=>{ne(),te(),t.current.value||re(),R.emit()}),()=>{l.current.delete(a),s.current.delete(a),t.current.filtered.items.delete(a);let x=V();m(4,()=>{ne(),(x==null?void 0:x.getAttribute("id"))===a&&re(),R.emit()})}),group:a=>(o.current.has(a)||o.current.set(a,new Set),()=>{l.current.delete(a),o.current.delete(a)}),filter:()=>c.current.shouldFilter,label:v||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:O,labelId:Z,listInnerRef:I}),[]);function pe(a,p){var x,d;let b=(d=(x=c.current)==null?void 0:x.filter)!=null?d:Jt;return a?b(a,t.current.search,p):0}function te(){if(!t.current.search||c.current.shouldFilter===!1)return;let a=t.current.filtered.items,p=[];t.current.filtered.groups.forEach(d=>{let b=o.current.get(d),C=0;b.forEach(S=>{let E=a.get(S);C=Math.max(E,C)}),p.push([d,C])});let x=I.current;H().sort((d,b)=>{var C,S;let E=d.getAttribute("id"),J=b.getAttribute("id");return((C=a.get(J))!=null?C:0)-((S=a.get(E))!=null?S:0)}).forEach(d=>{let b=d.closest(ie);b?b.appendChild(d.parentElement===b?d:d.closest(`${ie} > *`)):x.appendChild(d.parentElement===x?d:d.closest(`${ie} > *`))}),p.sort((d,b)=>b[1]-d[1]).forEach(d=>{var b;let C=(b=I.current)==null?void 0:b.querySelector(`${z}[${q}="${encodeURIComponent(d[0])}"]`);C==null||C.parentElement.appendChild(C)})}function re(){let a=H().find(x=>x.getAttribute("aria-disabled")!=="true"),p=a==null?void 0:a.getAttribute(q);R.setState("value",p||void 0)}function ne(){var a,p,x,d;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=s.current.size;return}t.current.filtered.groups=new Set;let b=0;for(let C of s.current){let S=(p=(a=l.current.get(C))==null?void 0:a.value)!=null?p:"",E=(d=(x=l.current.get(C))==null?void 0:x.keywords)!=null?d:[],J=pe(S,E);t.current.filtered.items.set(C,J),J>0&&b++}for(let[C,S]of o.current)for(let E of S)if(t.current.filtered.items.get(E)>0){t.current.filtered.groups.add(C);break}t.current.filtered.count=b}function me(){var a,p,x;let d=V();d&&(((a=d.parentElement)==null?void 0:a.firstChild)===d&&((x=(p=d.closest(z))==null?void 0:p.querySelector(Zt))==null||x.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function V(){var a;return(a=I.current)==null?void 0:a.querySelector(`${Ve}[aria-selected="true"]`)}function H(){var a;return Array.from(((a=I.current)==null?void 0:a.querySelectorAll(Ce))||[])}function oe(a){let p=H()[a];p&&R.setState("value",p.getAttribute(q))}function ae(a){var p;let x=V(),d=H(),b=d.findIndex(S=>S===x),C=d[b+a];(p=c.current)!=null&&p.loop&&(C=b+a<0?d[d.length-1]:b+a===d.length?d[0]:d[b+a]),C&&R.setState("value",C.getAttribute(q))}function ve(a){let p=V(),x=p==null?void 0:p.closest(z),d;for(;x&&!d;)x=a>0?lr(x,z):sr(x,z),d=x==null?void 0:x.querySelector(Ce);d?R.setState("value",d.getAttribute(q)):ae(a)}let he=()=>oe(H().length-1),ge=a=>{a.preventDefault(),a.metaKey?he():a.altKey?ve(1):ae(1)},xe=a=>{a.preventDefault(),a.metaKey?oe(0):a.altKey?ve(-1):ae(-1)};return n.createElement(A.div,{ref:r,tabIndex:-1,...F,"cmdk-root":"",onKeyDown:a=>{var p;(p=F.onKeyDown)==null||p.call(F,a);let x=a.nativeEvent.isComposing||a.keyCode===229;if(!(a.defaultPrevented||x))switch(a.key){case"n":case"j":{j&&a.ctrlKey&&ge(a);break}case"ArrowDown":{ge(a);break}case"p":case"k":{j&&a.ctrlKey&&xe(a);break}case"ArrowUp":{xe(a);break}case"Home":{a.preventDefault(),oe(0);break}case"End":{a.preventDefault(),he();break}case"Enter":{a.preventDefault();let d=V();if(d){let b=new Event(ue);d.dispatchEvent(b)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:ee.inputId,id:ee.labelId,style:ur},v),Y(e,a=>n.createElement(Ke.Provider,{value:R},n.createElement(qe.Provider,{value:ee},a))))}),Xt=n.forwardRef((e,r)=>{var t,s;let o=$(),l=n.useRef(null),i=n.useContext(Be),c=Q(),v=He(e),u=(s=(t=v.current)==null?void 0:t.forceMount)!=null?s:i==null?void 0:i.forceMount;L(()=>{if(!u)return c.item(o,i==null?void 0:i.id)},[u]);let h=ze(o,l,[e.value,e.children,l],e.keywords),g=fe(),y=_(m=>m.value&&m.value===h.current),w=_(m=>u||c.filter()===!1?!0:m.search?m.filtered.items.get(o)>0:!0);n.useEffect(()=>{let m=l.current;if(!(!m||e.disabled))return m.addEventListener(ue,k),()=>m.removeEventListener(ue,k)},[w,e.onSelect,e.disabled]);function k(){var m,R;T(),(R=(m=v.current).onSelect)==null||R.call(m,h.current)}function T(){g.setState("value",h.current,!0)}if(!w)return null;let{disabled:j,value:F,onSelect:N,forceMount:Z,keywords:O,...I}=e;return n.createElement(A.div,{ref:B(l,r),...I,id:o,"cmdk-item":"",role:"option","aria-disabled":!!j,"aria-selected":!!y,"data-disabled":!!j,"data-selected":!!y,onPointerMove:j||c.getDisablePointerSelection()?void 0:T,onClick:j?void 0:k},e.children)}),Yt=n.forwardRef((e,r)=>{let{heading:t,children:s,forceMount:o,...l}=e,i=$(),c=n.useRef(null),v=n.useRef(null),u=$(),h=Q(),g=_(w=>o||h.filter()===!1?!0:w.search?w.filtered.groups.has(i):!0);L(()=>h.group(i),[]),ze(i,c,[e.value,e.heading,v]);let y=n.useMemo(()=>({id:i,forceMount:o}),[o]);return n.createElement(A.div,{ref:B(c,r),...l,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&n.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:u},t),Y(e,w=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?u:void 0},n.createElement(Be.Provider,{value:y},w))))}),er=n.forwardRef((e,r)=>{let{alwaysRender:t,...s}=e,o=n.useRef(null),l=_(i=>!i.search);return!t&&!l?null:n.createElement(A.div,{ref:B(o,r),...s,"cmdk-separator":"",role:"separator"})}),tr=n.forwardRef((e,r)=>{let{onValueChange:t,...s}=e,o=e.value!=null,l=fe(),i=_(u=>u.search),c=_(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),n.createElement(A.input,{ref:r,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":v.listId,"aria-labelledby":v.labelId,"aria-activedescendant":c,id:v.inputId,type:"text",value:o?e.value:i,onChange:u=>{o||l.setState("search",u.target.value),t==null||t(u.target.value)}})}),rr=n.forwardRef((e,r)=>{let{children:t,label:s="Suggestions",...o}=e,l=n.useRef(null),i=n.useRef(null),c=_(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{if(i.current&&l.current){let u=i.current,h=l.current,g,y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=u.offsetHeight;h.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return y.observe(u),()=>{cancelAnimationFrame(g),y.unobserve(u)}}},[]),n.createElement(A.div,{ref:B(l,r),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":s,id:v.listId},Y(e,u=>n.createElement("div",{ref:B(i,v.listInnerRef),"cmdk-list-sizer":""},u)))}),nr=n.forwardRef((e,r)=>{let{open:t,onOpenChange:s,overlayClassName:o,contentClassName:l,container:i,...c}=e;return n.createElement(pt,{open:t,onOpenChange:s},n.createElement(mt,{container:i},n.createElement(vt,{"cmdk-overlay":"",className:o}),n.createElement(ht,{"aria-label":e.label,"cmdk-dialog":"",className:l},n.createElement(We,{ref:r,...c}))))}),or=n.forwardRef((e,r)=>_(t=>t.filtered.count===0)?n.createElement(A.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),ar=n.forwardRef((e,r)=>{let{progress:t,children:s,label:o="Loading...",...l}=e;return n.createElement(A.div,{ref:r,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Y(e,i=>n.createElement("div",{"aria-hidden":!0},i)))}),P=Object.assign(We,{List:rr,Item:Xt,Input:tr,Group:Yt,Separator:er,Dialog:nr,Empty:or,Loading:ar});function lr(e,r){let t=e.nextElementSibling;for(;t;){if(t.matches(r))return t;t=t.nextElementSibling}}function sr(e,r){let t=e.previousElementSibling;for(;t;){if(t.matches(r))return t;t=t.previousElementSibling}}function He(e){let r=n.useRef(e);return L(()=>{r.current=e}),r}var L=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(e){let r=n.useRef();return r.current===void 0&&(r.current=e()),r}function _(e){let r=fe(),t=()=>e(r.snapshot());return n.useSyncExternalStore(r.subscribe,t,t)}function ze(e,r,t,s=[]){let o=n.useRef(),l=Q();return L(()=>{var i;let c=(()=>{var u;for(let h of t){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():o.current}})(),v=s.map(u=>u.trim());l.value(e,c,v),(i=r.current)==null||i.setAttribute(q,c),o.current=c}),o}var ir=()=>{let[e,r]=n.useState(),t=K(()=>new Map);return L(()=>{t.current.forEach(s=>s()),t.current=new Map},[e]),(s,o)=>{t.current.set(s,o),r({})}};function cr(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function Y({asChild:e,children:r},t){return e&&n.isValidElement(r)?n.cloneElement(cr(r),{ref:r.ref},t(r.props.children)):t(r)}var ur={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ge=n.forwardRef(({className:e,...r},t)=>f.jsx(P,{ref:t,className:M("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));Ge.displayName=P.displayName;const Ue=n.forwardRef(({className:e,...r},t)=>f.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[f.jsx(bt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),f.jsx(P.Input,{ref:t,className:M("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));Ue.displayName=P.Input.displayName;const Qe=n.forwardRef(({className:e,...r},t)=>f.jsx(P.List,{ref:t,className:M("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));Qe.displayName=P.List.displayName;const Ze=n.forwardRef((e,r)=>f.jsx(P.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));Ze.displayName=P.Empty.displayName;const Je=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Group,{ref:t,className:M("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));Je.displayName=P.Group.displayName;const dr=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Separator,{ref:t,className:M("-mx-1 h-px bg-border",e),...r}));dr.displayName=P.Separator.displayName;const Xe=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Item,{ref:t,className:M("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...r}));Xe.displayName=P.Item.displayName;const fr=250;function xr({value:e,onChange:r,placeholder:t="Select...",searchPlaceholder:s="Search...",emptyMessage:o="No results found.",disabled:l=!1,selectedOption:i,queryKey:c,queryFn:v,enabled:u=!0,className:h,ariaLabel:g}){const[y,w]=n.useState(!1),[k,T]=n.useState(""),[j,F]=n.useState("");n.useEffect(()=>{const m=window.setTimeout(()=>{F(k.trim())},fr);return()=>window.clearTimeout(m)},[k]),n.useEffect(()=>{y||(T(""),F(""))},[y]);const{data:N=[],isFetching:Z}=dt({queryKey:[...c,j],queryFn:()=>v(j),enabled:u&&y}),O=n.useMemo(()=>!e||N.some(m=>m.value===e)?N:(i==null?void 0:i.value)===e?[i,...N]:N,[N,i,e]),I=n.useMemo(()=>{if(!e)return t;const m=O.find(R=>R.value===e)??((i==null?void 0:i.value)===e?i:null);return(m==null?void 0:m.label)??t},[O,t,i,e]);return f.jsxs(Tt,{open:y,onOpenChange:w,modal:!0,children:[f.jsx(Vt,{asChild:!0,children:f.jsxs(ft,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,"aria-label":g,disabled:l,className:M("h-8 w-full justify-between px-2 text-sm font-normal",!e&&"text-muted-foreground",h),children:[f.jsx("span",{className:"truncate",children:I}),f.jsx(xt,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),f.jsx(Le,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:m=>m.stopPropagation(),children:f.jsxs(Ge,{shouldFilter:!1,className:"h-full",children:[f.jsx(Ue,{placeholder:s,value:k,onValueChange:T}),f.jsx(Qe,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:Z?f.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[f.jsx(gt,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):O.length===0?f.jsx(Ze,{children:o}):f.jsx(Je,{children:O.map(m=>f.jsxs(Xe,{value:m.value,onSelect:()=>{r(m.value),w(!1)},children:[f.jsx(ut,{className:M("mr-2 h-4 w-4",e===m.value?"opacity-100":"opacity-0")}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate",children:m.label}),m.description?f.jsx("div",{className:"truncate text-xs text-muted-foreground",children:m.description}):null]})]},m.value))})})]})})]})}export{bt as S,xr as a}; + */const bt=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);function yt(e){const r=Ct(e),t=n.forwardRef((s,o)=>{const{children:l,...i}=s,c=n.Children.toArray(l),v=c.find(Rt);if(v){const u=v.props.children,h=c.map(g=>g===v?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:g);return f.jsx(r,{...i,ref:o,children:n.isValidElement(u)?n.cloneElement(u,void 0,h):null})}return f.jsx(r,{...i,ref:o,children:l})});return t.displayName=`${e}.Slot`,t}function Ct(e){const r=n.forwardRef((t,s)=>{const{children:o,...l}=t;if(n.isValidElement(o)){const i=Pt(o),c=Et(l,o.props);return o.type!==n.Fragment&&(c.ref=s?B(s,i):i),n.cloneElement(o,c)}return n.Children.count(o)>1?n.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var wt=Symbol("radix.slottable");function Rt(e){return n.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wt}function Et(e,r){const t={...r};for(const s in r){const o=e[s],l=r[s];/^on[A-Z]/.test(s)?o&&l?t[s]=(...c)=>{const v=l(...c);return o(...c),v}:o&&(t[s]=o):s==="style"?t[s]={...o,...l}:s==="className"&&(t[s]=[o,l].filter(Boolean).join(" "))}return{...e,...t}}function Pt(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var X="Popover",[ke]=rt(X,[Pe]),U=Pe(),[St,D]=ke(X),je=e=>{const{__scopePopover:r,children:t,open:s,defaultOpen:o,onOpenChange:l,modal:i=!1}=e,c=U(r),v=n.useRef(null),[u,h]=n.useState(!1),[g,y]=Ye({prop:s,defaultProp:o??!1,onChange:l,caller:X});return f.jsx(et,{...c,children:f.jsx(St,{scope:r,contentId:$(),triggerRef:v,open:g,onOpenChange:y,onOpenToggle:n.useCallback(()=>y(w=>!w),[y]),hasCustomAnchor:u,onCustomAnchorAdd:n.useCallback(()=>h(!0),[]),onCustomAnchorRemove:n.useCallback(()=>h(!1),[]),modal:i,children:t})})};je.displayName=X;var Ne="PopoverAnchor",kt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ne,t),l=U(t),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=o;return n.useEffect(()=>(i(),()=>c()),[i,c]),f.jsx(Ee,{...l,...s,ref:r})});kt.displayName=Ne;var Ae="PopoverTrigger",Ie=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ae,t),l=U(t),i=Re(r,o.triggerRef),c=f.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Fe(o.open),...s,ref:i,onClick:G(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:f.jsx(Ee,{asChild:!0,...l,children:c})});Ie.displayName=Ae;var de="PopoverPortal",[jt,Nt]=ke(de,{forceMount:void 0}),Me=e=>{const{__scopePopover:r,forceMount:t,children:s,container:o}=e,l=D(de,r);return f.jsx(jt,{scope:r,forceMount:t,children:f.jsx(Se,{present:t||l.open,children:f.jsx(tt,{asChild:!0,container:o,children:s})})})};Me.displayName=de;var W="PopoverContent",Oe=n.forwardRef((e,r)=>{const t=Nt(W,e.__scopePopover),{forceMount:s=t.forceMount,...o}=e,l=D(W,e.__scopePopover);return f.jsx(Se,{present:s||l.open,children:l.modal?f.jsx(It,{...o,ref:r}):f.jsx(Mt,{...o,ref:r})})});Oe.displayName=W;var At=yt("PopoverContent.RemoveScroll"),It=n.forwardRef((e,r)=>{const t=D(W,e.__scopePopover),s=n.useRef(null),o=Re(r,s),l=n.useRef(!1);return n.useEffect(()=>{const i=s.current;if(i)return nt(i)},[]),f.jsx(ot,{as:At,allowPinchZoom:!0,children:f.jsx(_e,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),l.current||(c=t.triggerRef.current)==null||c.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,v=c.button===0&&c.ctrlKey===!0,u=c.button===2||v;l.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:G(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Mt=n.forwardRef((e,r)=>{const t=D(W,e.__scopePopover),s=n.useRef(!1),o=n.useRef(!1);return f.jsx(_e,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(s.current||(c=t.triggerRef.current)==null||c.focus(),l.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:l=>{var v,u;(v=e.onInteractOutside)==null||v.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=l.target;((u=t.triggerRef.current)==null?void 0:u.contains(i))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),_e=n.forwardRef((e,r)=>{const{__scopePopover:t,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onInteractOutside:h,...g}=e,y=D(W,t),w=U(t);return at(),f.jsx(lt,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(st,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onDismiss:()=>y.onOpenChange(!1),children:f.jsx(it,{"data-state":Fe(y.open),role:"dialog",id:y.contentId,...w,...g,ref:r,style:{...g.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)"}})})})}),De="PopoverClose",Ot=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(De,t);return f.jsx(A.button,{type:"button",...s,ref:r,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});Ot.displayName=De;var _t="PopoverArrow",Dt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=U(t);return f.jsx(ct,{...o,...s,ref:r})});Dt.displayName=_t;function Fe(e){return e?"open":"closed"}var Ft=je,$t=Ie,Lt=Me,$e=Oe;const Tt=Ft,Vt=$t,Le=n.forwardRef(({className:e,align:r="center",sideOffset:t=4,...s},o)=>f.jsx(Lt,{children:f.jsx($e,{ref:o,align:r,sideOffset:t,className:M("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),...s})}));Le.displayName=$e.displayName;var be=1,Kt=.9,qt=.8,Bt=.17,le=.1,se=.999,Wt=.9999,Ht=.99,zt=/[\\\/_+.#"@\[\(\{&]/,Gt=/[\\\/_+.#"@\[\(\{&]/g,Ut=/[\s-]/,Te=/[\s-]/g;function ce(e,r,t,s,o,l,i){if(l===r.length)return o===e.length?be:Ht;var c=`${o},${l}`;if(i[c]!==void 0)return i[c];for(var v=s.charAt(l),u=t.indexOf(v,o),h=0,g,y,w,k;u>=0;)g=ce(e,r,t,s,u+1,l+1,i),g>h&&(u===o?g*=be:zt.test(e.charAt(u-1))?(g*=qt,w=e.slice(o,u-1).match(Gt),w&&o>0&&(g*=Math.pow(se,w.length))):Ut.test(e.charAt(u-1))?(g*=Kt,k=e.slice(o,u-1).match(Te),k&&o>0&&(g*=Math.pow(se,k.length))):(g*=Bt,o>0&&(g*=Math.pow(se,u-o))),e.charAt(u)!==r.charAt(l)&&(g*=Wt)),(gg&&(g=y*le)),g>h&&(h=g),u=t.indexOf(v,u+1);return i[c]=h,h}function ye(e){return e.toLowerCase().replace(Te," ")}function Qt(e,r,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,ce(e,r,ye(e),ye(r),0,0,{})}var z='[cmdk-group=""]',ie='[cmdk-group-items=""]',Zt='[cmdk-group-heading=""]',Ve='[cmdk-item=""]',Ce=`${Ve}:not([aria-disabled="true"])`,ue="cmdk-item-select",K="data-value",Jt=(e,r,t)=>Qt(e,r,t),Ke=n.createContext(void 0),Q=()=>n.useContext(Ke),qe=n.createContext(void 0),fe=()=>n.useContext(qe),Be=n.createContext(void 0),We=n.forwardRef((e,r)=>{let t=q(()=>{var a,p;return{search:"",value:(p=(a=e.value)!=null?a:e.defaultValue)!=null?p:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=q(()=>new Set),o=q(()=>new Map),l=q(()=>new Map),i=q(()=>new Set),c=He(e),{label:v,children:u,value:h,onValueChange:g,filter:y,shouldFilter:w,loop:k,disablePointerSelection:T=!1,vimBindings:j=!0,...F}=e,N=$(),Z=$(),O=$(),I=n.useRef(null),m=ir();L(()=>{if(h!==void 0){let a=h.trim();t.current.value=a,R.emit()}},[h]),L(()=>{m(6,me)},[]);let R=n.useMemo(()=>({subscribe:a=>(i.current.add(a),()=>i.current.delete(a)),snapshot:()=>t.current,setState:(a,p,x)=>{var d,b,C,S;if(!Object.is(t.current[a],p)){if(t.current[a]=p,a==="search")ne(),te(),m(1,re);else if(a==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let E=document.getElementById(O);E?E.focus():(d=document.getElementById(N))==null||d.focus()}if(m(7,()=>{var E;t.current.selectedItemId=(E=V())==null?void 0:E.id,R.emit()}),x||m(5,me),((b=c.current)==null?void 0:b.value)!==void 0){let E=p??"";(S=(C=c.current).onValueChange)==null||S.call(C,E);return}}R.emit()}},emit:()=>{i.current.forEach(a=>a())}}),[]),ee=n.useMemo(()=>({value:(a,p,x)=>{var d;p!==((d=l.current.get(a))==null?void 0:d.value)&&(l.current.set(a,{value:p,keywords:x}),t.current.filtered.items.set(a,pe(p,x)),m(2,()=>{te(),R.emit()}))},item:(a,p)=>(s.current.add(a),p&&(o.current.has(p)?o.current.get(p).add(a):o.current.set(p,new Set([a]))),m(3,()=>{ne(),te(),t.current.value||re(),R.emit()}),()=>{l.current.delete(a),s.current.delete(a),t.current.filtered.items.delete(a);let x=V();m(4,()=>{ne(),(x==null?void 0:x.getAttribute("id"))===a&&re(),R.emit()})}),group:a=>(o.current.has(a)||o.current.set(a,new Set),()=>{l.current.delete(a),o.current.delete(a)}),filter:()=>c.current.shouldFilter,label:v||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:O,labelId:Z,listInnerRef:I}),[]);function pe(a,p){var x,d;let b=(d=(x=c.current)==null?void 0:x.filter)!=null?d:Jt;return a?b(a,t.current.search,p):0}function te(){if(!t.current.search||c.current.shouldFilter===!1)return;let a=t.current.filtered.items,p=[];t.current.filtered.groups.forEach(d=>{let b=o.current.get(d),C=0;b.forEach(S=>{let E=a.get(S);C=Math.max(E,C)}),p.push([d,C])});let x=I.current;H().sort((d,b)=>{var C,S;let E=d.getAttribute("id"),J=b.getAttribute("id");return((C=a.get(J))!=null?C:0)-((S=a.get(E))!=null?S:0)}).forEach(d=>{let b=d.closest(ie);b?b.appendChild(d.parentElement===b?d:d.closest(`${ie} > *`)):x.appendChild(d.parentElement===x?d:d.closest(`${ie} > *`))}),p.sort((d,b)=>b[1]-d[1]).forEach(d=>{var b;let C=(b=I.current)==null?void 0:b.querySelector(`${z}[${K}="${encodeURIComponent(d[0])}"]`);C==null||C.parentElement.appendChild(C)})}function re(){let a=H().find(x=>x.getAttribute("aria-disabled")!=="true"),p=a==null?void 0:a.getAttribute(K);R.setState("value",p||void 0)}function ne(){var a,p,x,d;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=s.current.size;return}t.current.filtered.groups=new Set;let b=0;for(let C of s.current){let S=(p=(a=l.current.get(C))==null?void 0:a.value)!=null?p:"",E=(d=(x=l.current.get(C))==null?void 0:x.keywords)!=null?d:[],J=pe(S,E);t.current.filtered.items.set(C,J),J>0&&b++}for(let[C,S]of o.current)for(let E of S)if(t.current.filtered.items.get(E)>0){t.current.filtered.groups.add(C);break}t.current.filtered.count=b}function me(){var a,p,x;let d=V();d&&(((a=d.parentElement)==null?void 0:a.firstChild)===d&&((x=(p=d.closest(z))==null?void 0:p.querySelector(Zt))==null||x.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function V(){var a;return(a=I.current)==null?void 0:a.querySelector(`${Ve}[aria-selected="true"]`)}function H(){var a;return Array.from(((a=I.current)==null?void 0:a.querySelectorAll(Ce))||[])}function oe(a){let p=H()[a];p&&R.setState("value",p.getAttribute(K))}function ae(a){var p;let x=V(),d=H(),b=d.findIndex(S=>S===x),C=d[b+a];(p=c.current)!=null&&p.loop&&(C=b+a<0?d[d.length-1]:b+a===d.length?d[0]:d[b+a]),C&&R.setState("value",C.getAttribute(K))}function ve(a){let p=V(),x=p==null?void 0:p.closest(z),d;for(;x&&!d;)x=a>0?lr(x,z):sr(x,z),d=x==null?void 0:x.querySelector(Ce);d?R.setState("value",d.getAttribute(K)):ae(a)}let he=()=>oe(H().length-1),ge=a=>{a.preventDefault(),a.metaKey?he():a.altKey?ve(1):ae(1)},xe=a=>{a.preventDefault(),a.metaKey?oe(0):a.altKey?ve(-1):ae(-1)};return n.createElement(A.div,{ref:r,tabIndex:-1,...F,"cmdk-root":"",onKeyDown:a=>{var p;(p=F.onKeyDown)==null||p.call(F,a);let x=a.nativeEvent.isComposing||a.keyCode===229;if(!(a.defaultPrevented||x))switch(a.key){case"n":case"j":{j&&a.ctrlKey&&ge(a);break}case"ArrowDown":{ge(a);break}case"p":case"k":{j&&a.ctrlKey&&xe(a);break}case"ArrowUp":{xe(a);break}case"Home":{a.preventDefault(),oe(0);break}case"End":{a.preventDefault(),he();break}case"Enter":{a.preventDefault();let d=V();if(d){let b=new Event(ue);d.dispatchEvent(b)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:ee.inputId,id:ee.labelId,style:ur},v),Y(e,a=>n.createElement(qe.Provider,{value:R},n.createElement(Ke.Provider,{value:ee},a))))}),Xt=n.forwardRef((e,r)=>{var t,s;let o=$(),l=n.useRef(null),i=n.useContext(Be),c=Q(),v=He(e),u=(s=(t=v.current)==null?void 0:t.forceMount)!=null?s:i==null?void 0:i.forceMount;L(()=>{if(!u)return c.item(o,i==null?void 0:i.id)},[u]);let h=ze(o,l,[e.value,e.children,l],e.keywords),g=fe(),y=_(m=>m.value&&m.value===h.current),w=_(m=>u||c.filter()===!1?!0:m.search?m.filtered.items.get(o)>0:!0);n.useEffect(()=>{let m=l.current;if(!(!m||e.disabled))return m.addEventListener(ue,k),()=>m.removeEventListener(ue,k)},[w,e.onSelect,e.disabled]);function k(){var m,R;T(),(R=(m=v.current).onSelect)==null||R.call(m,h.current)}function T(){g.setState("value",h.current,!0)}if(!w)return null;let{disabled:j,value:F,onSelect:N,forceMount:Z,keywords:O,...I}=e;return n.createElement(A.div,{ref:B(l,r),...I,id:o,"cmdk-item":"",role:"option","aria-disabled":!!j,"aria-selected":!!y,"data-disabled":!!j,"data-selected":!!y,onPointerMove:j||c.getDisablePointerSelection()?void 0:T,onClick:j?void 0:k},e.children)}),Yt=n.forwardRef((e,r)=>{let{heading:t,children:s,forceMount:o,...l}=e,i=$(),c=n.useRef(null),v=n.useRef(null),u=$(),h=Q(),g=_(w=>o||h.filter()===!1?!0:w.search?w.filtered.groups.has(i):!0);L(()=>h.group(i),[]),ze(i,c,[e.value,e.heading,v]);let y=n.useMemo(()=>({id:i,forceMount:o}),[o]);return n.createElement(A.div,{ref:B(c,r),...l,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&n.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:u},t),Y(e,w=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?u:void 0},n.createElement(Be.Provider,{value:y},w))))}),er=n.forwardRef((e,r)=>{let{alwaysRender:t,...s}=e,o=n.useRef(null),l=_(i=>!i.search);return!t&&!l?null:n.createElement(A.div,{ref:B(o,r),...s,"cmdk-separator":"",role:"separator"})}),tr=n.forwardRef((e,r)=>{let{onValueChange:t,...s}=e,o=e.value!=null,l=fe(),i=_(u=>u.search),c=_(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),n.createElement(A.input,{ref:r,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":v.listId,"aria-labelledby":v.labelId,"aria-activedescendant":c,id:v.inputId,type:"text",value:o?e.value:i,onChange:u=>{o||l.setState("search",u.target.value),t==null||t(u.target.value)}})}),rr=n.forwardRef((e,r)=>{let{children:t,label:s="Suggestions",...o}=e,l=n.useRef(null),i=n.useRef(null),c=_(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{if(i.current&&l.current){let u=i.current,h=l.current,g,y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=u.offsetHeight;h.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return y.observe(u),()=>{cancelAnimationFrame(g),y.unobserve(u)}}},[]),n.createElement(A.div,{ref:B(l,r),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":s,id:v.listId},Y(e,u=>n.createElement("div",{ref:B(i,v.listInnerRef),"cmdk-list-sizer":""},u)))}),nr=n.forwardRef((e,r)=>{let{open:t,onOpenChange:s,overlayClassName:o,contentClassName:l,container:i,...c}=e;return n.createElement(pt,{open:t,onOpenChange:s},n.createElement(mt,{container:i},n.createElement(vt,{"cmdk-overlay":"",className:o}),n.createElement(ht,{"aria-label":e.label,"cmdk-dialog":"",className:l},n.createElement(We,{ref:r,...c}))))}),or=n.forwardRef((e,r)=>_(t=>t.filtered.count===0)?n.createElement(A.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),ar=n.forwardRef((e,r)=>{let{progress:t,children:s,label:o="Loading...",...l}=e;return n.createElement(A.div,{ref:r,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Y(e,i=>n.createElement("div",{"aria-hidden":!0},i)))}),P=Object.assign(We,{List:rr,Item:Xt,Input:tr,Group:Yt,Separator:er,Dialog:nr,Empty:or,Loading:ar});function lr(e,r){let t=e.nextElementSibling;for(;t;){if(t.matches(r))return t;t=t.nextElementSibling}}function sr(e,r){let t=e.previousElementSibling;for(;t;){if(t.matches(r))return t;t=t.previousElementSibling}}function He(e){let r=n.useRef(e);return L(()=>{r.current=e}),r}var L=typeof window>"u"?n.useEffect:n.useLayoutEffect;function q(e){let r=n.useRef();return r.current===void 0&&(r.current=e()),r}function _(e){let r=fe(),t=()=>e(r.snapshot());return n.useSyncExternalStore(r.subscribe,t,t)}function ze(e,r,t,s=[]){let o=n.useRef(),l=Q();return L(()=>{var i;let c=(()=>{var u;for(let h of t){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():o.current}})(),v=s.map(u=>u.trim());l.value(e,c,v),(i=r.current)==null||i.setAttribute(K,c),o.current=c}),o}var ir=()=>{let[e,r]=n.useState(),t=q(()=>new Map);return L(()=>{t.current.forEach(s=>s()),t.current=new Map},[e]),(s,o)=>{t.current.set(s,o),r({})}};function cr(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function Y({asChild:e,children:r},t){return e&&n.isValidElement(r)?n.cloneElement(cr(r),{ref:r.ref},t(r.props.children)):t(r)}var ur={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ge=n.forwardRef(({className:e,...r},t)=>f.jsx(P,{ref:t,className:M("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));Ge.displayName=P.displayName;const Ue=n.forwardRef(({className:e,...r},t)=>f.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[f.jsx(bt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),f.jsx(P.Input,{ref:t,className:M("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));Ue.displayName=P.Input.displayName;const Qe=n.forwardRef(({className:e,...r},t)=>f.jsx(P.List,{ref:t,className:M("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));Qe.displayName=P.List.displayName;const Ze=n.forwardRef((e,r)=>f.jsx(P.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));Ze.displayName=P.Empty.displayName;const Je=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Group,{ref:t,className:M("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));Je.displayName=P.Group.displayName;const dr=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Separator,{ref:t,className:M("-mx-1 h-px bg-border",e),...r}));dr.displayName=P.Separator.displayName;const Xe=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Item,{ref:t,className:M("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...r}));Xe.displayName=P.Item.displayName;const fr=250;function xr({value:e,onChange:r,placeholder:t="Select...",searchPlaceholder:s="Search...",emptyMessage:o="No results found.",disabled:l=!1,selectedOption:i,queryKey:c,queryFn:v,enabled:u=!0,className:h,ariaLabel:g}){const[y,w]=n.useState(!1),[k,T]=n.useState(""),[j,F]=n.useState("");n.useEffect(()=>{const m=window.setTimeout(()=>{F(k.trim())},fr);return()=>window.clearTimeout(m)},[k]),n.useEffect(()=>{y||(T(""),F(""))},[y]);const{data:N=[],isFetching:Z}=dt({queryKey:[...c,j],queryFn:()=>v(j),enabled:u&&y}),O=n.useMemo(()=>!e||N.some(m=>m.value===e)?N:(i==null?void 0:i.value)===e?[i,...N]:N,[N,i,e]),I=n.useMemo(()=>{if(!e)return t;const m=O.find(R=>R.value===e)??((i==null?void 0:i.value)===e?i:null);return(m==null?void 0:m.label)??t},[O,t,i,e]);return f.jsxs(Tt,{open:y,onOpenChange:w,modal:!0,children:[f.jsx(Vt,{asChild:!0,children:f.jsxs(ft,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,"aria-label":g,disabled:l,className:M("h-8 w-full justify-between px-2 text-sm font-normal",!e&&"text-muted-foreground",h),children:[f.jsx("span",{className:"truncate",children:I}),f.jsx(xt,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),f.jsx(Le,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:m=>m.stopPropagation(),children:f.jsxs(Ge,{shouldFilter:!1,className:"h-full",children:[f.jsx(Ue,{placeholder:s,value:k,onValueChange:T}),f.jsx(Qe,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:Z?f.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[f.jsx(gt,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):O.length===0?f.jsx(Ze,{children:o}):f.jsx(Je,{children:O.map(m=>f.jsxs(Xe,{value:m.value,onSelect:()=>{r(m.value),w(!1)},children:[f.jsx(ut,{className:M("mr-2 h-4 w-4",e===m.value?"opacity-100":"opacity-0")}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate",children:m.label}),m.description?f.jsx("div",{className:"truncate text-xs text-muted-foreground",children:m.description}):null]})]},m.value))})})]})})]})}export{bt as S,xr as a}; diff --git a/assets/shield-alert-D9bH_bs8.js b/assets/shield-alert-BS0sYsit.js similarity index 97% rename from assets/shield-alert-D9bH_bs8.js rename to assets/shield-alert-BS0sYsit.js index 55d5c519aa2d9d6aa2f0c45b4de196b8a467daec..63000b03ecf7f0a1ebd1fb5c433666d18c26ce6b 100644 --- a/assets/shield-alert-D9bH_bs8.js +++ b/assets/shield-alert-BS0sYsit.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-LWBjDGUR.js";/** +import{c as e}from"./index-DsjIhQkx.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-B1Kg5w0V.js b/assets/skeleton-B1Kg5w0V.js new file mode 100644 index 0000000000000000000000000000000000000000..90a6c4258e20e7255451ac171dba2ee8bb95596b --- /dev/null +++ b/assets/skeleton-B1Kg5w0V.js @@ -0,0 +1 @@ +import{j as s,t as n}from"./index-DsjIhQkx.js";function m({className:e,...t}){return s.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...t})}export{m as S}; diff --git a/assets/skeleton-JE1BtvIJ.js b/assets/skeleton-JE1BtvIJ.js deleted file mode 100644 index 462f1f3e0ce7c829fb3c4c9ef1b89dbc5e61fc58..0000000000000000000000000000000000000000 --- a/assets/skeleton-JE1BtvIJ.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t,s as n}from"./index-LWBjDGUR.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/switch-Brp2Ns-5.js b/assets/switch-Brp2Ns-5.js deleted file mode 100644 index 2a66ea1132ca3775d264e3cd6505a3f43bb75c72..0000000000000000000000000000000000000000 --- a/assets/switch-Brp2Ns-5.js +++ /dev/null @@ -1 +0,0 @@ -import{r as s,n as C,m as I,j as a,l as y,o as M,p as H,q,s as x}from"./index-LWBjDGUR.js";import{u as A}from"./index-CIXIMLCe.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:l="on",onCheckedChange:v,form:i,...w}=t,[u,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),g=u?i||!!u.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:l,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&a.jsx(N,{control:u,bubbles:!k.current,name:n,value:l,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),l=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(l!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[l,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:x("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:x("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/switch-DIM4i6Fu.js b/assets/switch-DIM4i6Fu.js new file mode 100644 index 0000000000000000000000000000000000000000..61956acb103a619da04780baba13cc204cfca52b --- /dev/null +++ b/assets/switch-DIM4i6Fu.js @@ -0,0 +1 @@ +import{r as s,o as C,n as I,j as a,m as y,p as M,q as H,s as q,t as x}from"./index-DsjIhQkx.js";import{u as A}from"./index-DUeJ-D3M.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),g=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),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&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:x("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:x("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-sAKp6aGF.js b/assets/textarea-BMnjM1hO.js similarity index 74% rename from assets/textarea-sAKp6aGF.js rename to assets/textarea-BMnjM1hO.js index 3955de86f9125598877efd5972fae5b900d7c6f5..42b42af3fad5e3025af47396d039edae41a1fbd2 100644 --- a/assets/textarea-sAKp6aGF.js +++ b/assets/textarea-BMnjM1hO.js @@ -1 +1 @@ -import{r as s,j as i,s as t}from"./index-LWBjDGUR.js";const a=s.forwardRef(({className:e,type:r,...o},n)=>i.jsx("input",{type:r,className:t("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:n,...o}));a.displayName="Input";const d=s.forwardRef(({className:e,...r},o)=>i.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}));d.displayName="Textarea";export{a as I,d as T}; +import{r as s,j as t,t as i}from"./index-DsjIhQkx.js";const a=s.forwardRef(({className:e,type:r,...o},n)=>t.jsx("input",{type:r,className:i("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...o}));a.displayName="Input";const d=s.forwardRef(({className:e,...r},o)=>t.jsx("textarea",{className:i("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}));d.displayName="Textarea";export{a as I,d as T}; diff --git a/assets/transform-BSMO2egg.js b/assets/transform-BSMO2egg.js deleted file mode 100644 index acc1eb13b888e7336de4028d298d65f2205dd645..0000000000000000000000000000000000000000 --- a/assets/transform-BSMO2egg.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as $}from"./index-LWBjDGUR.js";function pe(t){let e=2166136261;const n=t||"";for(let r=0;r=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function _(t){const e=w(t);return e.setHours(0,0,0,0),e}function F(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=_(t),r=_(e),a=+n-F(n),i=+r-F(r);return Math.round((a-i)/z)}function K(t){const e=A(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function Z(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!Z(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 Y(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:Y({formats:at,defaultWidth:"full"}),time:Y({formats:it,defaultWidth:"full"}),dateTime:Y({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 k(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:k({values:dt,defaultWidth:"wide"}),quarter:k({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:k({values:ft,defaultWidth:"wide"}),day:k({values:ht,defaultWidth:"wide"}),dayPeriod:k({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Ot=/^(\d+)(th|st|nd|rd)?/i,kt=/\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]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:Ot,parsePattern:kt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+T(e)-+K(e);return Math.round(n/H)+1}function j(t,e){var f,g,l,O;const n=w(t),r=n.getFullYear(),a=S(),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??((O=(l=a.locale)==null?void 0:l.options)==null?void 0:O.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=x(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=x(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Lt(t,e){var s,u,d,f;const n=S(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=j(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),x(i,e)}function Ut(t,e){const n=w(t),r=+x(n,e)-+Lt(n,e);return Math.round(r/H)+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"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=j(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=A(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return 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=Ut(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"+q(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"+q(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 q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):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 U=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Q=(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 U(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",U(r,e)).replace("{{time}}",Q(a,e))},It={p:Q,P:Ht},Rt=/^D+$/,At=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return Rt.test(t)}function Xt(t){return At.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,Kt=/[a-zA-Z]/;function Zt(t,e,n){var f,g,l,O;const r=S(),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??((O=(l=r.locale)==null?void 0:l.options)==null?void 0:O.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 W=It[h];return W(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(E[h])return{isToken:!0,value:m};if(h.match(Kt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const W=E[h[0]];return W(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function X(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const v={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(v.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],v.timeZoneDelimiter.test(e.date)&&(e.date=t.split(v.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=v.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*I+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*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function B(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]||(B(t)?29:28))}function fe(t,e){return e>=1&&e<=(B(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"?X(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return X(t).getFullYear()}catch{return null}}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=(t.leaderboard_ranks||[]).filter(l=>l.best_rank>=1&&l.best_rank<=3).map(l=>({name:l.dataset_name,slug:l.dataset_slug||null,rank:l.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:s,methods:u,citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:$(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=G.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return C.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const C=new Set(["OCR"]),G=new Map([["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 Te(t,e){const n=t||Oe(e||""),r=G.get((e==null?void 0:e.toLowerCase())||ke(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function ke(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{w as a,x as b,be as c,Te as d,xe as e,Oe as f,pe as h,_ as s,ve as t}; diff --git a/assets/transform-C1LieBU0.js b/assets/transform-C1LieBU0.js new file mode 100644 index 0000000000000000000000000000000000000000..259d2e6dc53c619575b5c0949ada32e6c4d24f3d --- /dev/null +++ b/assets/transform-C1LieBU0.js @@ -0,0 +1 @@ +import{$}from"./index-DsjIhQkx.js";function pe(t){let e=2166136261;const n=t||"";for(let r=0;r=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function _(t){const e=w(t);return e.setHours(0,0,0,0),e}function F(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=_(t),r=_(e),a=+n-F(n),i=+r-F(r);return Math.round((a-i)/z)}function K(t){const e=A(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function Z(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!Z(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 Y(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:Y({formats:at,defaultWidth:"full"}),time:Y({formats:it,defaultWidth:"full"}),dateTime:Y({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 k(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:k({values:dt,defaultWidth:"wide"}),quarter:k({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:k({values:ft,defaultWidth:"wide"}),day:k({values:ht,defaultWidth:"wide"}),dayPeriod:k({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Ot=/^(\d+)(th|st|nd|rd)?/i,kt=/\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]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:Ot,parsePattern:kt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+T(e)-+K(e);return Math.round(n/H)+1}function j(t,e){var f,g,l,O;const n=w(t),r=n.getFullYear(),a=S(),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??((O=(l=a.locale)==null?void 0:l.options)==null?void 0:O.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=x(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=x(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Lt(t,e){var s,u,d,f;const n=S(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=j(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),x(i,e)}function Ut(t,e){const n=w(t),r=+x(n,e)-+Lt(n,e);return Math.round(r/H)+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"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=j(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=A(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return 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=Ut(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"+q(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"+q(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 q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):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 U=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Q=(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 U(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",U(r,e)).replace("{{time}}",Q(a,e))},It={p:Q,P:Ht},Rt=/^D+$/,At=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return Rt.test(t)}function Xt(t){return At.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,Kt=/[a-zA-Z]/;function Zt(t,e,n){var f,g,l,O;const r=S(),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??((O=(l=r.locale)==null?void 0:l.options)==null?void 0:O.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 W=It[h];return W(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(E[h])return{isToken:!0,value:m};if(h.match(Kt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const W=E[h[0]];return W(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function X(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const v={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(v.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],v.timeZoneDelimiter.test(e.date)&&(e.date=t.split(v.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=v.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*I+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*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function B(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]||(B(t)?29:28))}function fe(t,e){return e>=1&&e<=(B(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"?X(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return X(t).getFullYear()}catch{return null}}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=(t.leaderboard_ranks||[]).filter(l=>l.best_rank>=1&&l.best_rank<=3).map(l=>({name:l.dataset_name,slug:l.dataset_slug||null,rank:l.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:s,methods:u,citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:$(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=G.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return C.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const C=new Set(["OCR"]),G=new Map([["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 Te(t,e){const n=t||Oe(e||""),r=G.get((e==null?void 0:e.toLowerCase())||ke(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function ke(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{w as a,x as b,be as c,Te as d,xe as e,Oe as f,pe as h,_ as s,ve as t}; diff --git a/assets/useBaseQuery-CSyvHxAw.js b/assets/useBaseQuery-CSyvHxAw.js deleted file mode 100644 index 94c0e9acb2fb9e9ad312f484a5529b2cfefbf7cf..0000000000000000000000000000000000000000 --- a/assets/useBaseQuery-CSyvHxAw.js +++ /dev/null @@ -1 +0,0 @@ -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{aq as wt,aL as gt,aM as S,as as q,aN as j,au as tt,aO as et,aP as vt,aQ as Mt,aR as J,aS as Qt,aT as xt,aU as Rt,ar as Ct,r as O,aG as Ot,t as _t}from"./index-LWBjDGUR.js";var v,a,H,g,x,P,C,T,W,D,L,_,U,w,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Kt=(Et=class extends wt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,x);p(this,P);p(this,C);p(this,T);p(this,W);p(this,D);p(this,L);p(this,_);p(this,U);p(this,w);p(this,N,new Set);this.options=e,u(this,v,t),u(this,T,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),mt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||j(this.options.staleTime,i(this,a))!==j(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,w))&&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 Ft(this,r)&&(u(this,g,r),u(this,P,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,P),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const m=this.hasListeners(),k=!m&&mt(t,e),V=m&&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:R}=d;f=d.data;let z=!1;if(e.placeholderData!==void 0&&f===void 0&&R==="pending"){let m;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(m=o.data,z=!0):m=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,m!==void 0&&(R="success",f=Rt(o==null?void 0:o.data,m,e),M=!0)}if(e.select&&f!==void 0&&!z)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,W))f=i(this,D);else try{u(this,W,e.select),f=e.select(f),f=Rt(o==null?void 0:o.data,f,e),u(this,D,f),u(this,T,null)}catch(m){u(this,T,m)}i(this,T)&&(Q=i(this,T),f=i(this,D),B=Date.now(),R="error");const X=d.fetchStatus==="fetching",Y=R==="pending",Z=R==="error",lt=Y&&X,dt=f!==void 0,I={status:R,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:R==="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 m=I.data!==void 0,k=I.status==="error"&&!m,V=K=>{k?K.reject(I.error):m&&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,P,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 F=y;return i(this,g)[F]!==t[F]&&c.has(F)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,H=new WeakMap,g=new WeakMap,x=new WeakMap,P=new WeakMap,C=new WeakMap,T=new WeakMap,W=new WeakMap,D=new WeakMap,L=new WeakMap,_=new WeakMap,U=new WeakMap,w=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=j(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=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,w,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,w))||i(this,w)===0)&&u(this,U,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,w)))},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,U)!==void 0&&(J.clearInterval(i(this,U)),u(this,U,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Ut(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function mt(s,t){return Ut(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&j(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(j(t.staleTime,s))}function Ft(s,t){return!q(s.getCurrentResult(),t)}var Tt=O.createContext(!1),Pt=()=>O.useContext(Tt);Tt.Provider;function Dt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Lt=O.createContext(Dt()),Nt=()=>O.useContext(Lt),Bt=(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))},kt=s=>{O.useEffect(()=>{s.clearReset()},[s])},At=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),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))}},Ht=(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 Jt(s,t,e){var M,f,Q,B;const r=Pt(),h=Nt(),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),Bt(c,h,y),kt(h);const F=!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(R=>{const z=d?b.subscribe(Ct.batchCalls(R)):tt;return b.updateResult(),z},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(At({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&Ht(E,r)){const R=F?yt(c,b,h):y==null?void 0:y.promise;R==null||R.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}export{Kt as Q,Nt as a,Bt as b,kt as c,Jt as d,jt as e,yt as f,At as g,Wt as s,Pt as u}; diff --git a/assets/useBaseQuery-D4kcdcVW.js b/assets/useBaseQuery-D4kcdcVW.js new file mode 100644 index 0000000000000000000000000000000000000000..ac04eafe49506730103c9a7fe83b5532fa050b60 --- /dev/null +++ b/assets/useBaseQuery-D4kcdcVW.js @@ -0,0 +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),l=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),u=(s,t,e)=>($(s,t,"access private method"),e);import{ar as wt,aM as vt,aN as S,at as q,aO as H,av as tt,aP as et,aQ as gt,aR as Mt,aS as J,aT as Qt,aU as xt,aV as Rt,as as Ct,r as O,aH as Ot,v as _t}from"./index-DsjIhQkx.js";var g,a,j,v,x,P,C,T,V,D,L,_,U,w,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Gt=(Et=class extends wt{constructor(t,e){super();p(this,n);p(this,g);p(this,a);p(this,j);p(this,v);p(this,x);p(this,P);p(this,C);p(this,T);p(this,V);p(this,D);p(this,L);p(this,_);p(this,U);p(this,w);p(this,N,new Set);this.options=e,l(this,g,t),l(this,T,null),l(this,C,vt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),mt(i(this,a),this.options)?u(this,n,A).call(this):this.updateResult(),u(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,u(this,n,nt).call(this),u(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,g).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");u(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,g).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&u(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)))&&u(this,n,st).call(this);const o=u(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,w))&&u(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,g).getQueryCache().build(i(this,g),t),r=this.createResult(e,t);return Ft(this,r)&&(l(this,v,r),l(this,P,this.options),l(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,v)}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,g).defaultQueryOptions(t),r=i(this,g).getQueryCache().build(i(this,g),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return u(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,v)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,v),c=i(this,x),y=i(this,P),b=t!==r?t.state:i(this,j),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const m=this.hasListeners(),k=!m&&mt(t,e),z=m&&St(t,r,e,h);(k||z)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:R}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&R==="pending"){let m;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(m=o.data,W=!0):m=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,m!==void 0&&(R="success",f=Rt(o==null?void 0:o.data,m,e),M=!0)}if(e.select&&f!==void 0&&!W)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,V))f=i(this,D);else try{l(this,V,e.select),f=e.select(f),f=Rt(o==null?void 0:o.data,f,e),l(this,D,f),l(this,T,null)}catch(m){l(this,T,m)}i(this,T)&&(Q=i(this,T),f=i(this,D),B=Date.now(),R="error");const X=d.fetchStatus==="fetching",Y=R==="pending",Z=R==="error",ut=Y&&X,dt=f!==void 0,I={status:R,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:R==="success",isError:Z,isInitialLoading:ut,isLoading:ut,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:lt(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const m=I.data!==void 0,k=I.status==="error"&&!m,z=G=>{k?G.reject(I.error):m&&G.resolve(I.data)},pt=()=>{const G=l(this,C,I.promise=vt());z(G)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&z(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,v),e=this.createResult(i(this,a),this.options);if(l(this,x,i(this,a).state),l(this,P,this.options),i(this,x).data!==void 0&&l(this,L,i(this,a)),q(e,t))return;l(this,v,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,v)).some(y=>{const F=y;return i(this,v)[F]!==t[F]&&c.has(F)})};u(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&u(this,n,at).call(this)}},g=new WeakMap,a=new WeakMap,j=new WeakMap,v=new WeakMap,x=new WeakMap,P=new WeakMap,C=new WeakMap,T=new WeakMap,V=new WeakMap,D=new WeakMap,L=new WeakMap,_=new WeakMap,U=new WeakMap,w=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){u(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(){u(this,n,nt).call(this);const t=H(this.options.staleTime,i(this,a));if(et.isServer()||i(this,v).isStale||!gt(t))return;const r=Mt(i(this,v).dataUpdatedAt,t)+1;l(this,_,J.setTimeout(()=>{i(this,v).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){u(this,n,ht).call(this),l(this,w,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!gt(i(this,w))||i(this,w)===0)&&l(this,U,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&u(this,n,A).call(this)},i(this,w)))},at=function(){u(this,n,st).call(this),u(this,n,rt).call(this,u(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),l(this,_,void 0))},ht=function(){i(this,U)!==void 0&&(J.clearInterval(i(this,U)),l(this,U,void 0))},ot=function(){const t=i(this,g).getQueryCache().build(i(this,g),this.options);if(t===i(this,a))return;const e=i(this,a);l(this,a,t),l(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,v))}),i(this,g).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Ut(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function mt(s,t){return Ut(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&H(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&<(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&<(s,e)}function lt(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(H(t.staleTime,s))}function Ft(s,t){return!q(s.getCurrentResult(),t)}var Tt=O.createContext(!1),Pt=()=>O.useContext(Tt);Tt.Provider;function Dt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Lt=O.createContext(Dt()),Nt=()=>O.useContext(Lt),Bt=(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))},kt=s=>{O.useEffect(()=>{s.clearReset()},[s])},At=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),Ht=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},jt=(s,t)=>s.isLoading&&s.isFetching&&!t,Vt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Jt(s,t,e){var M,f,Q,B;const r=Pt(),h=Nt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),Bt(c,h,y),kt(h);const F=!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(R=>{const W=d?b.subscribe(Ct.batchCalls(R)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Vt(c,E))throw yt(c,b,h);if(At({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&jt(E,r)){const R=F?yt(c,b,h):y==null?void 0:y.promise;R==null||R.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}export{Gt as Q,Nt as a,Bt as b,kt as c,Jt as d,Ht as e,yt as f,At as g,Vt as s,Pt as u}; diff --git a/assets/useDebounce-Cr0VFQou.js b/assets/useDebounce-DuVaIR_H.js similarity index 66% rename from assets/useDebounce-Cr0VFQou.js rename to assets/useDebounce-DuVaIR_H.js index 99ec4b6bc5cc206bb65e347f4e15b0081c24c5aa..584dfca104a254824bf6fd2124c9a154d0411ebe 100644 --- a/assets/useDebounce-Cr0VFQou.js +++ b/assets/useDebounce-DuVaIR_H.js @@ -1 +1 @@ -import{r as o}from"./index-LWBjDGUR.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-DsjIhQkx.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-CdDNcC4u.js b/assets/useInfiniteQuery-BfqUfQDk.js similarity index 89% rename from assets/useInfiniteQuery-CdDNcC4u.js rename to assets/useInfiniteQuery-BfqUfQDk.js index 6aa82177d73e9b0af14791d4fbf5284190f9b83a..e4b6d0c75b985a057661e74c883290fe151f5407 100644 --- a/assets/useInfiniteQuery-CdDNcC4u.js +++ b/assets/useInfiniteQuery-BfqUfQDk.js @@ -1 +1 @@ -import{Q as v,d as p}from"./useBaseQuery-CSyvHxAw.js";import{aH as x,aI as b}from"./index-LWBjDGUR.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function w(e,t){return p(e,l)}export{w as u}; +import{Q as v,d as p}from"./useBaseQuery-D4kcdcVW.js";import{aI as x,aJ as b}from"./index-DsjIhQkx.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function w(e,t){return p(e,l)}export{w as u}; diff --git a/assets/useIntersectionObserver-CTkoMSzM.js b/assets/useIntersectionObserver-DdSZQ78X.js similarity index 86% rename from assets/useIntersectionObserver-CTkoMSzM.js rename to assets/useIntersectionObserver-DdSZQ78X.js index b8ae9cbb7e37847899945f6ab757d94b7a81a362..d9cf27accefa95d20db9c8938cd675e02b5ceb82 100644 --- a/assets/useIntersectionObserver-CTkoMSzM.js +++ b/assets/useIntersectionObserver-DdSZQ78X.js @@ -1 +1 @@ -import{r}from"./index-LWBjDGUR.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-DsjIhQkx.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-Cm0dU_OR.js b/assets/useMutation-B-lCv88U.js similarity index 70% rename from assets/useMutation-Cm0dU_OR.js rename to assets/useMutation-B-lCv88U.js index f1650682407235fa30b915c567a9b61b5dba5267..1e3d1df5c700a715de9a47cf51c3f0a766724b28 100644 --- a/assets/useMutation-Cm0dU_OR.js +++ b/assets/useMutation-B-lCv88U.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{aq as q,as as U,aE as j,aF as k,ar as P,t as L,r as v,au as A,aG as D}from"./index-LWBjDGUR.js";var a,c,o,h,n,C,S,w,F=(w=class extends q{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),U(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)??k();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 Q(i,t){const s=L(),[r]=v.useState(()=>new F(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{Q 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),v=(i,t,s)=>(E(i,t,"access private method"),s);import{ar as U,at as k,aF as j,aG as q,as as P,v as L,r as y,av as A,aH as D}from"./index-DsjIhQkx.js";var a,c,o,h,n,C,S,w,F=(w=class extends U{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),v(this,n,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){v(this,n,C).call(this),v(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),v(this,n,C).call(this),v(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,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 I(i,t){const s=L(),[r]=y.useState(()=>new F(s,i));y.useEffect(()=>{r.setOptions(i)},[r,i]);const u=y.useSyncExternalStore(y.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=y.useCallback((d,O)=>{r.mutate(d,O).catch(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{I as u}; diff --git a/assets/usePapers-Cexc6lbX.js b/assets/usePapers-CHYNlILt.js similarity index 89% rename from assets/usePapers-Cexc6lbX.js rename to assets/usePapers-CHYNlILt.js index 9f9ef336241054703cae24e67af6ce54ef4dc23f..09af326cae75f6e5a85b70203c57ef9370c43401 100644 --- a/assets/usePapers-Cexc6lbX.js +++ b/assets/usePapers-CHYNlILt.js @@ -1 +1 @@ -import{b as p,ak as _}from"./index-LWBjDGUR.js";import{u as y}from"./useQuery-CVb9j2D6.js";import{u as g}from"./useInfiniteQuery-CdDNcC4u.js";function q(a,e=!0){return y({queryKey:["paper",a],queryFn:()=>p.getPaper(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function F(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:s="desc",time:n,published_after:i,published_before:u,conference:o,latest_only:c=!0,include_resources:l=!1,has_code:d=!1,has_hf_artifacts:f=!1,enabled:P=!0}=a;return g({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:u,conference:o,latest_only:c,include_resources:l,has_code:d,has_hf_artifacts:f}],queryFn:({pageParam:h=1})=>p.getPapers({page:h,page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:u,conference:o,latest_only:c,include_resources:l,has_code:d,has_hf_artifacts:f}),getNextPageParam:h=>h.next_page,initialPageParam:1,enabled:P,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function x(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:s="desc",latest_only:n=!0,include_resources:i=!0,has_code:u=!1,has_hf_artifacts:o=!1,enabled:c=!0}=a;return g({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:u,has_hf_artifacts:o}],queryFn:({pageParam:l=1})=>p.getTaskPapers(e,{page:l,page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:u,has_hf_artifacts:o}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function z(a){const{conferenceSlug:e,taskSlug:r,presentation:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:u=!0,include_resources:o=!0,has_code:c=!1,has_hf_artifacts:l=!1,enabled:d=!0}=a;return g({queryKey:["conference-papers-infinite",e,r,t,{page_size:s,order_by:n,order_dir:i,latest_only:u,include_resources:o,has_code:c,has_hf_artifacts:l}],queryFn:({pageParam:f=1})=>p.getConferencePapers(e,{task:r,presentation:t,page:f,page_size:s,order_by:n,order_dir:i,latest_only:u,include_resources:o,has_code:c,has_hf_artifacts:l}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:d&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function O(a){const{organizationSlug:e,taskSlug:r,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:u=!0,has_code:o=!1,has_hf_artifacts:c=!1,enabled:l=!0}=a;return g({queryKey:["organization-papers-infinite",e,r,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:u,has_code:o,has_hf_artifacts:c}],queryFn:({pageParam:d=1})=>p.getOrganizationPapers(e,{task:r,page:d,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:u,has_code:o,has_hf_artifacts:c}),getNextPageParam:d=>d.next_page,initialPageParam:1,enabled:l&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}export{q as a,x as b,z as c,O as d,F as u}; +import{b as p,al as _}from"./index-DsjIhQkx.js";import{u as y}from"./useQuery-xOve4y-6.js";import{u as g}from"./useInfiniteQuery-BfqUfQDk.js";function F(a,e=!0){return y({queryKey:["paper",a],queryFn:()=>p.getPaper(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function k(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:s="desc",time:n,published_after:i,published_before:u,conference:o,latest_only:c=!0,include_resources:l=!1,has_code:d=!1,has_hf_artifacts:f=!1,enabled:P=!0}=a;return g({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:u,conference:o,latest_only:c,include_resources:l,has_code:d,has_hf_artifacts:f}],queryFn:({pageParam:h=1})=>p.getPapers({page:h,page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:u,conference:o,latest_only:c,include_resources:l,has_code:d,has_hf_artifacts:f}),getNextPageParam:h=>h.next_page,initialPageParam:1,enabled:P,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function x(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:s="desc",latest_only:n=!0,include_resources:i=!0,has_code:u=!1,has_hf_artifacts:o=!1,enabled:c=!0}=a;return g({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:u,has_hf_artifacts:o}],queryFn:({pageParam:l=1})=>p.getTaskPapers(e,{page:l,page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:u,has_hf_artifacts:o}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function z(a){const{conferenceSlug:e,taskSlug:r,presentation:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:u=!0,include_resources:o=!0,has_code:c=!1,has_hf_artifacts:l=!1,enabled:d=!0}=a;return g({queryKey:["conference-papers-infinite",e,r,t,{page_size:s,order_by:n,order_dir:i,latest_only:u,include_resources:o,has_code:c,has_hf_artifacts:l}],queryFn:({pageParam:f=1})=>p.getConferencePapers(e,{task:r,presentation:t,page:f,page_size:s,order_by:n,order_dir:i,latest_only:u,include_resources:o,has_code:c,has_hf_artifacts:l}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:d&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function O(a){const{organizationSlug:e,taskSlug:r,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:u=!0,has_code:o=!1,has_hf_artifacts:c=!1,enabled:l=!0}=a;return g({queryKey:["organization-papers-infinite",e,r,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:u,has_code:o,has_hf_artifacts:c}],queryFn:({pageParam:d=1})=>p.getOrganizationPapers(e,{task:r,page:d,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:u,has_code:o,has_hf_artifacts:c}),getNextPageParam:d=>d.next_page,initialPageParam:1,enabled:l&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}export{F as a,x as b,z as c,O as d,k as u}; diff --git a/assets/usePeriodFilter-DR8ybPj0.js b/assets/usePeriodFilter-veYjaFZT.js similarity index 74% rename from assets/usePeriodFilter-DR8ybPj0.js rename to assets/usePeriodFilter-veYjaFZT.js index 1dbcf42f32e2e03cbaedcd06d5dfa5ed43561b87..cc0c1c315ec5e9f69ae91fa5857a4e876226571a 100644 --- a/assets/usePeriodFilter-DR8ybPj0.js +++ b/assets/usePeriodFilter-veYjaFZT.js @@ -1 +1 @@ -import{r}from"./index-LWBjDGUR.js";import{a as n,s as f,b as u}from"./transform-BSMO2egg.js";function l(s){const t=n(s);return t.setDate(1),t.setHours(0,0,0,0),t}const h=["Today","This Week","This Month","All Time"];function T(s="All Time"){const[t,a]=r.useState(s),i=r.useMemo(()=>{const o=new Date;let e=null;return t==="Today"?e=f(o):t==="This Week"?e=u(o,{weekStartsOn:1}):t==="This Month"&&(e=l(o)),e?e.toISOString():void 0},[t]);return{period:t,setPeriod:a,publishedAfter:i}}export{h as P,T as u}; +import{r}from"./index-DsjIhQkx.js";import{a as n,s as f,b as u}from"./transform-C1LieBU0.js";function l(s){const t=n(s);return t.setDate(1),t.setHours(0,0,0,0),t}const h=["Today","This Week","This Month","All Time"];function T(s="All Time"){const[t,a]=r.useState(s),i=r.useMemo(()=>{const o=new Date;let e=null;return t==="Today"?e=f(o):t==="This Week"?e=u(o,{weekStartsOn:1}):t==="This Month"&&(e=l(o)),e?e.toISOString():void 0},[t]);return{period:t,setPeriod:a,publishedAfter:i}}export{h as P,T as u}; diff --git a/assets/useQuery-CVb9j2D6.js b/assets/useQuery-CVb9j2D6.js deleted file mode 100644 index e80ba33b66e4e5a593c6ac64219f0dc34cea0488..0000000000000000000000000000000000000000 --- a/assets/useQuery-CVb9j2D6.js +++ /dev/null @@ -1 +0,0 @@ -import{d as r,Q as u}from"./useBaseQuery-CSyvHxAw.js";function a(e,s){return r(e,u)}export{a as u}; diff --git a/assets/useQuery-xOve4y-6.js b/assets/useQuery-xOve4y-6.js new file mode 100644 index 0000000000000000000000000000000000000000..52b173b4cd18d7d950ba32e24c575a7a878646f6 --- /dev/null +++ b/assets/useQuery-xOve4y-6.js @@ -0,0 +1 @@ +import{d as r,Q as u}from"./useBaseQuery-D4kcdcVW.js";function a(e,s){return r(e,u)}export{a as u}; diff --git a/index.html b/index.html index ed10440b6935b1f98aaeafd5604438b658af52a8..7091f1801c88876d52a6aa5ccf781bbb0c24bb73 100644 --- a/index.html +++ b/index.html @@ -73,7 +73,7 @@ plausible.init(); })(); - +