@kaitranntt/ccs 7.75.0-dev.9 → 7.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/profile-registry.d.ts.map +1 -1
- package/dist/auth/profile-registry.js +9 -0
- package/dist/auth/profile-registry.js.map +1 -1
- package/dist/ccs.js +77 -9
- package/dist/ccs.js.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +20 -0
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +4 -0
- package/dist/commands/command-catalog.js.map +1 -1
- package/dist/commands/doctor-command.d.ts.map +1 -1
- package/dist/commands/doctor-command.js +9 -0
- package/dist/commands/doctor-command.js.map +1 -1
- package/dist/copilot/copilot-auth.d.ts.map +1 -1
- package/dist/copilot/copilot-auth.js +22 -0
- package/dist/copilot/copilot-auth.js.map +1 -1
- package/dist/copilot/copilot-daemon.d.ts.map +1 -1
- package/dist/copilot/copilot-daemon.js +26 -0
- package/dist/copilot/copilot-daemon.js.map +1 -1
- package/dist/copilot/copilot-executor.d.ts.map +1 -1
- package/dist/copilot/copilot-executor.js +22 -0
- package/dist/copilot/copilot-executor.js.map +1 -1
- package/dist/cursor/cursor-daemon.d.ts.map +1 -1
- package/dist/cursor/cursor-daemon.js +28 -1
- package/dist/cursor/cursor-daemon.js.map +1 -1
- package/dist/cursor/cursor-executor.d.ts.map +1 -1
- package/dist/cursor/cursor-executor.js +17 -1
- package/dist/cursor/cursor-executor.js.map +1 -1
- package/dist/delegation/delegation-handler.d.ts.map +1 -1
- package/dist/delegation/delegation-handler.js +4 -1
- package/dist/delegation/delegation-handler.js.map +1 -1
- package/dist/glmt/glmt-proxy.d.ts.map +1 -1
- package/dist/glmt/glmt-proxy.js +7 -0
- package/dist/glmt/glmt-proxy.js.map +1 -1
- package/dist/glmt/glmt-transformer.d.ts.map +1 -1
- package/dist/glmt/glmt-transformer.js +1 -3
- package/dist/glmt/glmt-transformer.js.map +1 -1
- package/dist/management/instance-manager.d.ts.map +1 -1
- package/dist/management/instance-manager.js +9 -0
- package/dist/management/instance-manager.js.map +1 -1
- package/dist/proxy/server/messages-route.d.ts.map +1 -1
- package/dist/proxy/server/messages-route.js +27 -7
- package/dist/proxy/server/messages-route.js.map +1 -1
- package/dist/proxy/server/proxy-server.d.ts.map +1 -1
- package/dist/proxy/server/proxy-server.js +24 -6
- package/dist/proxy/server/proxy-server.js.map +1 -1
- package/dist/services/logging/index.d.ts +6 -1
- package/dist/services/logging/index.d.ts.map +1 -1
- package/dist/services/logging/index.js +16 -1
- package/dist/services/logging/index.js.map +1 -1
- package/dist/services/logging/log-context.d.ts +41 -0
- package/dist/services/logging/log-context.d.ts.map +1 -0
- package/dist/services/logging/log-context.js +51 -0
- package/dist/services/logging/log-context.js.map +1 -0
- package/dist/services/logging/log-redaction.d.ts +8 -0
- package/dist/services/logging/log-redaction.d.ts.map +1 -1
- package/dist/services/logging/log-redaction.js +40 -3
- package/dist/services/logging/log-redaction.js.map +1 -1
- package/dist/services/logging/log-types.d.ts +30 -0
- package/dist/services/logging/log-types.d.ts.map +1 -1
- package/dist/services/logging/log-types.js +15 -1
- package/dist/services/logging/log-types.js.map +1 -1
- package/dist/services/logging/logger.d.ts +17 -0
- package/dist/services/logging/logger.d.ts.map +1 -1
- package/dist/services/logging/logger.js +23 -4
- package/dist/services/logging/logger.js.map +1 -1
- package/dist/targets/claude-adapter.d.ts.map +1 -1
- package/dist/targets/claude-adapter.js +11 -0
- package/dist/targets/claude-adapter.js.map +1 -1
- package/dist/targets/codex-adapter.d.ts.map +1 -1
- package/dist/targets/codex-adapter.js +11 -0
- package/dist/targets/codex-adapter.js.map +1 -1
- package/dist/targets/droid-adapter.d.ts.map +1 -1
- package/dist/targets/droid-adapter.js +11 -0
- package/dist/targets/droid-adapter.js.map +1 -1
- package/dist/ui/assets/{accounts-C11yNnFn.js → accounts-CDgKt-GZ.js} +1 -1
- package/dist/ui/assets/{alert-dialog-BDhZ9T12.js → alert-dialog-CRqbTpjm.js} +1 -1
- package/dist/ui/assets/{api-DXFMasvG.js → api-C7W2ibtd.js} +1 -1
- package/dist/ui/assets/{auth-section-BQpO_21y.js → auth-section-RBgQQrdk.js} +1 -1
- package/dist/ui/assets/{backups-section-BM2lP-ap.js → backups-section-DptarTls.js} +1 -1
- package/dist/ui/assets/{channels-qstH8YTZ.js → channels-BMQs4wmY.js} +1 -1
- package/dist/ui/assets/{charts-BBPXh0Ar.js → charts-CeK2xCSo.js} +1 -1
- package/dist/ui/assets/{checkbox-BPx7K8To.js → checkbox-BrRyK0T3.js} +1 -1
- package/dist/ui/assets/{claude-extension-BD6uQlc-.js → claude-extension-DrSuOyf4.js} +1 -1
- package/dist/ui/assets/{cliproxy-5-BIu9Wb.js → cliproxy-CdqYwRJH.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-BNffQh5X.js → cliproxy-ai-providers-B8aZTWIe.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-CjExrU2o.js → cliproxy-control-panel-BpXgvmht.js} +1 -1
- package/dist/ui/assets/{code-highlight-BRUf_pqB.js → code-highlight-D4E79GKQ.js} +1 -1
- package/dist/ui/assets/{codex-Dd2XIT8b.js → codex-CYoq5g4z.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-BZP3xwZi.js → confirm-dialog-CP-4T1Wp.js} +1 -1
- package/dist/ui/assets/{copilot-gf-rTcY8.js → copilot-aEdlrY3S.js} +1 -1
- package/dist/ui/assets/{cursor-CJGCGy-H.js → cursor-CSJ0aqxS.js} +1 -1
- package/dist/ui/assets/{droid-D1Wq6rRO.js → droid-DTdvqOvV.js} +1 -1
- package/dist/ui/assets/{form-utils-Bcoyqxpq.js → form-utils-CuHzLhJZ.js} +1 -1
- package/dist/ui/assets/{globalenv-section-DBqYbsuu.js → globalenv-section-DXbRVgOM.js} +1 -1
- package/dist/ui/assets/{health-DW8M92nq.js → health-CDce37cB.js} +1 -1
- package/dist/ui/assets/icons-DQFHtVq5.js +1 -0
- package/dist/ui/assets/index-6xrth3Oz.css +1 -0
- package/dist/ui/assets/{index-CoeauyY0.js → index-Bm9k7s_T.js} +1 -1
- package/dist/ui/assets/{index-B5cw5Mhf.js → index-D_FmvtnX.js} +1 -1
- package/dist/ui/assets/{index-B0dun58L.js → index-DjxqZO4B.js} +1 -1
- package/dist/ui/assets/{index-ubH9RpKo.js → index-Fd17BSGq.js} +3 -3
- package/dist/ui/assets/{index-IiaQMFco.js → index-KK76yIJk.js} +1 -1
- package/dist/ui/assets/{index-BczU222d.js → index-dnIWLkjb.js} +1 -1
- package/dist/ui/assets/{index-JIaHpwil.js → index-vN-yw8kw.js} +1 -1
- package/dist/ui/assets/logs-C_MtpQIE.js +1 -0
- package/dist/ui/assets/{masked-input-Bmo6mlTB.js → masked-input-BAWBYIqo.js} +1 -1
- package/dist/ui/assets/{notifications-B2HqRBj7.js → notifications-B4_o8bcr.js} +1 -1
- package/dist/ui/assets/{proxy-g4_N-fbB.js → proxy-C4-M_9kB.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-EX_Raok7.js → proxy-status-widget-DUqasX3c.js} +1 -1
- package/dist/ui/assets/{radix-ui-Zb8sVEtn.js → radix-ui-nu4wz29m.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-C4DFuY4g.js → raw-json-settings-editor-panel-DuVlOXFi.js} +1 -1
- package/dist/ui/assets/{react-vendor-CNOkPC89.js → react-vendor-Bjx91N7w.js} +1 -1
- package/dist/ui/assets/{searchable-select-CLhlrHkQ.js → searchable-select-BCxZHr8N.js} +1 -1
- package/dist/ui/assets/{separator-BEJQ4e4O.js → separator-BV4BKMsB.js} +1 -1
- package/dist/ui/assets/{shared-4QlIu64T.js → shared-D-Cu_o1h.js} +1 -1
- package/dist/ui/assets/{table-B6xzmyfm.js → table-DW66THR9.js} +1 -1
- package/dist/ui/assets/{tanstack-CrmUhA7Z.js → tanstack-bhJxV1h8.js} +1 -1
- package/dist/ui/assets/{updates-DBkXWRpR.js → updates-V0D_Q8n4.js} +1 -1
- package/dist/ui/index.html +9 -9
- package/package.json +1 -1
- package/scripts/run-test-bucket.js +2 -0
- package/dist/ui/assets/icons-DyorC3Xk.js +0 -1
- package/dist/ui/assets/index-Bbiq6Xkt.css +0 -1
- package/dist/ui/assets/logs-DbWcj2t5.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{a as q,bq as ee,br as se,bs as te,Q as ae,R as re,U as ne,B as $,bi as S,bj as M,bk as L,d as I,I as le,n as B,c as Q,C as ie,b as de}from"./index-ubH9RpKo.js";import{a3 as ce,aa as oe,b7 as me,T as E,R as T,F as he,av as ue,w as xe}from"./icons-DyorC3Xk.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Se(){const{t:s}=q(),[a,l]=j.useState("commands"),t={commands:s("sharedPage.commands"),skills:s("sharedPage.skills"),agents:s("sharedPage.agents")},[r,d]=j.useState(""),[n,o]=j.useState(null),{data:c,isError:h,error:p,refetch:w}=ee(),{data:m,isLoading:x,isFetching:y,isError:g,error:U,refetch:D}=se(a),N=m?.items??[],C=r.trim().toLowerCase(),b=r.trim(),u=j.useMemo(()=>{const i=m?.items??[];return C?i.filter(v=>[v.name,v.description,v.path].some(Y=>Y.toLowerCase().includes(C))):i},[m,C]),f=j.useMemo(()=>u.length===0?null:n?u.find(i=>i.path===n)??u[0]:u[0],[u,n]),{data:P,isLoading:O,isError:_,error:W,refetch:V}=te(a,f?.path??null),z=[{id:"commands",label:t.commands,icon:ce,count:c?.commands??0},{id:"skills",label:t.skills,icon:oe,count:c?.skills??0},{id:"agents",label:t.agents,icon:me,count:c?.agents??0}],H=z.reduce((i,v)=>i+v.count,0),K=!x&&!g&&N.length===0,Z=!x&&!g&&N.length>0&&u.length===0,G=A(p,"Shared item totals could not be loaded. Listing still works."),J=A(U,`Unable to fetch shared ${a}. Please try again.`),X=A(W,`Unable to load content for ${f?.name??"selected item"}.`);return e.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-6 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("sharedPage.title")}),e.jsx("p",{className:"text-muted-foreground",children:s("sharedPage.subtitle")})]}),e.jsx(ae,{value:a,onValueChange:i=>{l(i),d(""),o(null)},children:e.jsx(re,{className:"h-auto flex-wrap justify-start",children:z.map(i=>e.jsxs(ne,{value:i.id,className:"flex items-center gap-2",children:[e.jsx(i.icon,{className:"w-4 h-4"}),e.jsx("span",{children:i.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.count,")"]})]},i.id))})})]}),e.jsxs("div",{className:"flex flex-col gap-2 lg:items-end",children:[e.jsxs("div",{className:"grid w-full gap-2 sm:w-auto sm:min-w-[340px] sm:grid-cols-3",children:[e.jsx(F,{label:s("sharedPage.totalShared"),value:H}),e.jsx(F,{label:t[a],value:N.length}),e.jsx(F,{label:s("sharedPage.visible"),value:u.length})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx($,{variant:"secondary",children:s("sharedPage.markdownDetail")}),b?e.jsxs($,{variant:"outline",children:[s("sharedPage.filterPrefix")," ",b]}):null]})]})]}),c&&!c.symlinkStatus.valid&&e.jsxs(S,{variant:"warning",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.configurationRequired")}),e.jsxs(L,{children:[c.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),h&&e.jsxs(S,{variant:"info",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.countsUnavailable")}),e.jsxs(L,{children:[e.jsx("p",{children:G}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{w()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryCounts")]})})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.jsx("div",{className:"h-full rounded-lg border overflow-hidden bg-background",children:e.jsxs("div",{className:"grid h-full min-h-0 lg:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"min-h-0 border-b lg:border-b-0 lg:border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(he,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:t[a]})]}),!x&&!g&&e.jsxs($,{variant:"outline",className:"text-[10px] h-5",children:[u.length,"/",N.length]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(ue,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(le,{value:r,onChange:i=>d(i.target.value),placeholder:s("sharedPage.filterPlaceholder",{tab:a}),"aria-label":s("sharedPage.filterPlaceholder",{tab:a}),className:"pl-8 h-9"})]}),!x&&!g&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("sharedPage.showing",{visible:u.length,total:N.length,tab:a}),b?s("sharedPage.showingQuery",{query:b}):"",y?s("sharedPage.refreshing"):""]})]}),e.jsx(B,{className:"flex-1 min-h-0",children:x?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.loadingShared",{tab:a})}):g?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(xe,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("sharedPage.failedLoadShared",{tab:a})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:J})]}),e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{D()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retry")]})]})}):K?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noSharedFound",{tab:a})}):Z?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noMatch",{tab:a,query:b})}):e.jsx("div",{className:"p-2 space-y-1",children:u.map(i=>e.jsxs("button",{type:"button",onClick:()=>o(i.path),className:Q("w-full text-left p-3 rounded-md border transition-colors",f?.path===i.path?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent"),children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.description}),e.jsx("p",{className:"text-[11px] text-muted-foreground/90 mt-2 font-mono truncate",children:i.path})]},`${i.type}:${i.path}`))})})]}),e.jsx("div",{className:"min-w-0 min-h-0 flex flex-col bg-muted/20",children:f?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:f.name}),e.jsx($,{variant:"outline",className:"uppercase text-[10px]",children:f.type})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(R,{label:s("sharedPage.pathLabel"),value:f.path,mono:!0}),P?.contentPath&&P.contentPath!==f.path&&e.jsx(R,{label:s("sharedPage.resolvedSource"),value:P.contentPath,mono:!0})]})}),e.jsx(ie,{className:"min-h-0 flex-1",children:e.jsx(de,{className:"p-0 h-full",children:e.jsx(B,{className:"h-full px-5 py-4",children:O?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("sharedPage.loadingMarkdown")}):_?e.jsxs(S,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.failedLoadContent")}),e.jsxs(L,{children:[e.jsx("p",{children:X}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{V()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryContent")]})})]})]}):e.jsx(pe,{content:P?.content??""})})})})]})]}):e.jsx("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:s("sharedPage.selectOne",{tab:a.slice(0,-1)})})})]})})})]})}function F({label:s,value:a}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:a})]})}function R({label:s,value:a,mono:l=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:Q("text-xs mt-1 break-words",l?"font-mono":"text-sm"),children:a})]})}function A(s,a){if(!(s instanceof Error))return a;const l=s.message.toLowerCase();return l.includes("failed to fetch")||l.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":s.message||a}function pe({content:s}){const{t:a}=q(),l=j.useMemo(()=>fe(s),[s]);return l.blocks.length===0&&l.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:a("sharedPage.noMarkdown")}):e.jsxs("div",{className:"space-y-5",children:[l.frontmatter.length>0?e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:l.frontmatter.map(t=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:ge(t.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:t.value})]},`${t.key}:${t.value}`))})}):null,l.blocks.map((t,r)=>{if(t.type==="heading"){const d=t.level<=1?"text-xl font-semibold":t.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:d,children:k(t.text,`heading-${r}`)},`heading-${r}`)}return t.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:k(t.text,`paragraph-${r}`)},`paragraph-${r}`):t.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ul-item-${r}-${n}`)},`ul-item-${r}-${n}`))},`ul-${r}`):t.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ol-item-${r}-${n}`)},`ol-item-${r}-${n}`))},`ol-${r}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[t.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:t.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:t.content})]},`code-${r}`)})]})}function ge(s){return s.replace(/[-_]/g," ")}function k(s,a){const l=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,t=[];let r=0,d=0;for(const n of s.matchAll(l)){const o=n[0],c=n.index??0;if(c>r&&t.push(s.slice(r,c)),n[2])t.push(e.jsx("strong",{className:"font-semibold",children:n[2]},`${a}-strong-${d}`));else if(n[3])t.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:n[3]},`${a}-code-${d}`));else if(n[4])t.push(e.jsx("em",{className:"italic",children:n[4]},`${a}-em-${d}`));else if(n[5]&&n[6]){const h=n[6].trim();/^(https?:\/\/|mailto:)/i.test(h)?t.push(e.jsx("a",{href:h,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:n[5]},`${a}-link-${d}`)):t.push(n[5])}else t.push(o);r=c+o.length,d+=1}return r<s.length&&t.push(s.slice(r)),t.length===0?[s]:t}function fe(s){const a=s.replace(/\r\n/g,`
|
|
1
|
+
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as j}from"./react-vendor-Bjx91N7w.js";import{a as Q,bv as ee,bw as se,bx as te,Q as ae,R as re,U as ne,B as $,bi as S,bj as M,bk as L,d as I,I as le,n as B,c as U,C as ie,b as de}from"./index-Fd17BSGq.js";import{a3 as ce,aa as oe,b7 as me,T as E,R as T,F as he,av as ue,w as xe}from"./icons-DQFHtVq5.js";import"./tanstack-bhJxV1h8.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";function Se(){const{t:s}=Q(),[a,l]=j.useState("commands"),t={commands:s("sharedPage.commands"),skills:s("sharedPage.skills"),agents:s("sharedPage.agents")},[r,d]=j.useState(""),[n,o]=j.useState(null),{data:c,isError:h,error:p,refetch:w}=ee(),{data:m,isLoading:x,isFetching:y,isError:g,error:q,refetch:D}=se(a),N=m?.items??[],C=r.trim().toLowerCase(),b=r.trim(),u=j.useMemo(()=>{const i=m?.items??[];return C?i.filter(v=>[v.name,v.description,v.path].some(Y=>Y.toLowerCase().includes(C))):i},[m,C]),f=j.useMemo(()=>u.length===0?null:n?u.find(i=>i.path===n)??u[0]:u[0],[u,n]),{data:P,isLoading:O,isError:_,error:W,refetch:V}=te(a,f?.path??null),z=[{id:"commands",label:t.commands,icon:ce,count:c?.commands??0},{id:"skills",label:t.skills,icon:oe,count:c?.skills??0},{id:"agents",label:t.agents,icon:me,count:c?.agents??0}],H=z.reduce((i,v)=>i+v.count,0),K=!x&&!g&&N.length===0,Z=!x&&!g&&N.length>0&&u.length===0,G=A(p,"Shared item totals could not be loaded. Listing still works."),J=A(q,`Unable to fetch shared ${a}. Please try again.`),X=A(W,`Unable to load content for ${f?.name??"selected item"}.`);return e.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-6 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("sharedPage.title")}),e.jsx("p",{className:"text-muted-foreground",children:s("sharedPage.subtitle")})]}),e.jsx(ae,{value:a,onValueChange:i=>{l(i),d(""),o(null)},children:e.jsx(re,{className:"h-auto flex-wrap justify-start",children:z.map(i=>e.jsxs(ne,{value:i.id,className:"flex items-center gap-2",children:[e.jsx(i.icon,{className:"w-4 h-4"}),e.jsx("span",{children:i.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.count,")"]})]},i.id))})})]}),e.jsxs("div",{className:"flex flex-col gap-2 lg:items-end",children:[e.jsxs("div",{className:"grid w-full gap-2 sm:w-auto sm:min-w-[340px] sm:grid-cols-3",children:[e.jsx(F,{label:s("sharedPage.totalShared"),value:H}),e.jsx(F,{label:t[a],value:N.length}),e.jsx(F,{label:s("sharedPage.visible"),value:u.length})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx($,{variant:"secondary",children:s("sharedPage.markdownDetail")}),b?e.jsxs($,{variant:"outline",children:[s("sharedPage.filterPrefix")," ",b]}):null]})]})]}),c&&!c.symlinkStatus.valid&&e.jsxs(S,{variant:"warning",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.configurationRequired")}),e.jsxs(L,{children:[c.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),h&&e.jsxs(S,{variant:"info",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.countsUnavailable")}),e.jsxs(L,{children:[e.jsx("p",{children:G}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{w()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryCounts")]})})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.jsx("div",{className:"h-full rounded-lg border overflow-hidden bg-background",children:e.jsxs("div",{className:"grid h-full min-h-0 lg:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"min-h-0 border-b lg:border-b-0 lg:border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(he,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:t[a]})]}),!x&&!g&&e.jsxs($,{variant:"outline",className:"text-[10px] h-5",children:[u.length,"/",N.length]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(ue,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(le,{value:r,onChange:i=>d(i.target.value),placeholder:s("sharedPage.filterPlaceholder",{tab:a}),"aria-label":s("sharedPage.filterPlaceholder",{tab:a}),className:"pl-8 h-9"})]}),!x&&!g&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("sharedPage.showing",{visible:u.length,total:N.length,tab:a}),b?s("sharedPage.showingQuery",{query:b}):"",y?s("sharedPage.refreshing"):""]})]}),e.jsx(B,{className:"flex-1 min-h-0",children:x?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.loadingShared",{tab:a})}):g?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(xe,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("sharedPage.failedLoadShared",{tab:a})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:J})]}),e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{D()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retry")]})]})}):K?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noSharedFound",{tab:a})}):Z?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noMatch",{tab:a,query:b})}):e.jsx("div",{className:"p-2 space-y-1",children:u.map(i=>e.jsxs("button",{type:"button",onClick:()=>o(i.path),className:U("w-full text-left p-3 rounded-md border transition-colors",f?.path===i.path?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent"),children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.description}),e.jsx("p",{className:"text-[11px] text-muted-foreground/90 mt-2 font-mono truncate",children:i.path})]},`${i.type}:${i.path}`))})})]}),e.jsx("div",{className:"min-w-0 min-h-0 flex flex-col bg-muted/20",children:f?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:f.name}),e.jsx($,{variant:"outline",className:"uppercase text-[10px]",children:f.type})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(R,{label:s("sharedPage.pathLabel"),value:f.path,mono:!0}),P?.contentPath&&P.contentPath!==f.path&&e.jsx(R,{label:s("sharedPage.resolvedSource"),value:P.contentPath,mono:!0})]})}),e.jsx(ie,{className:"min-h-0 flex-1",children:e.jsx(de,{className:"p-0 h-full",children:e.jsx(B,{className:"h-full px-5 py-4",children:O?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("sharedPage.loadingMarkdown")}):_?e.jsxs(S,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.failedLoadContent")}),e.jsxs(L,{children:[e.jsx("p",{children:X}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{V()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryContent")]})})]})]}):e.jsx(pe,{content:P?.content??""})})})})]})]}):e.jsx("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:s("sharedPage.selectOne",{tab:a.slice(0,-1)})})})]})})})]})}function F({label:s,value:a}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:a})]})}function R({label:s,value:a,mono:l=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:U("text-xs mt-1 break-words",l?"font-mono":"text-sm"),children:a})]})}function A(s,a){if(!(s instanceof Error))return a;const l=s.message.toLowerCase();return l.includes("failed to fetch")||l.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":s.message||a}function pe({content:s}){const{t:a}=Q(),l=j.useMemo(()=>fe(s),[s]);return l.blocks.length===0&&l.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:a("sharedPage.noMarkdown")}):e.jsxs("div",{className:"space-y-5",children:[l.frontmatter.length>0?e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:l.frontmatter.map(t=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:ge(t.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:t.value})]},`${t.key}:${t.value}`))})}):null,l.blocks.map((t,r)=>{if(t.type==="heading"){const d=t.level<=1?"text-xl font-semibold":t.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:d,children:k(t.text,`heading-${r}`)},`heading-${r}`)}return t.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:k(t.text,`paragraph-${r}`)},`paragraph-${r}`):t.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ul-item-${r}-${n}`)},`ul-item-${r}-${n}`))},`ul-${r}`):t.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ol-item-${r}-${n}`)},`ol-item-${r}-${n}`))},`ol-${r}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[t.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:t.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:t.content})]},`code-${r}`)})]})}function ge(s){return s.replace(/[-_]/g," ")}function k(s,a){const l=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,t=[];let r=0,d=0;for(const n of s.matchAll(l)){const o=n[0],c=n.index??0;if(c>r&&t.push(s.slice(r,c)),n[2])t.push(e.jsx("strong",{className:"font-semibold",children:n[2]},`${a}-strong-${d}`));else if(n[3])t.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:n[3]},`${a}-code-${d}`));else if(n[4])t.push(e.jsx("em",{className:"italic",children:n[4]},`${a}-em-${d}`));else if(n[5]&&n[6]){const h=n[6].trim();/^(https?:\/\/|mailto:)/i.test(h)?t.push(e.jsx("a",{href:h,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:n[5]},`${a}-link-${d}`)):t.push(n[5])}else t.push(o);r=c+o.length,d+=1}return r<s.length&&t.push(s.slice(r)),t.length===0?[s]:t}function fe(s){const a=s.replace(/\r\n/g,`
|
|
2
2
|
`).trim();if(!a)return{blocks:[],frontmatter:[]};let l=a;const t=[];if(l.startsWith(`---
|
|
3
3
|
`)){const r=l.indexOf(`
|
|
4
4
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./radix-ui-
|
|
1
|
+
import{j as t}from"./radix-ui-nu4wz29m.js";import"./react-vendor-Bjx91N7w.js";import{c as l}from"./index-Fd17BSGq.js";function n({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function c({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function d({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function b({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...e})}function i({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}function m({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}export{n as T,c as a,b,i as c,d,m as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as w}from"./react-vendor-CNOkPC89.js";import{j as vt}from"./radix-ui-Zb8sVEtn.js";var k=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(){}},St={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ct=class{#t=St;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},z=new Ct;function yt(e){setTimeout(e,0)}var Q=typeof window>"u"||"Deno"in globalThis;function M(){}function Rt(e,t){return typeof e=="function"?e(t):e}function de(e){return typeof e=="number"&&e>=0&&e!==1/0}function je(e,t){return Math.max(e+(t||0)-Date.now(),0)}function H(e,t){return typeof e=="function"?e(t):e}function E(e,t){return typeof e=="function"?e(t):e}function Ee(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:r,queryKey:o,stale:u}=e;if(o){if(s){if(t.queryHash!==Fe(o,t.options))return!1}else if(!N(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||r&&!r(t))}function Ve(e,t){const{exact:n,status:s,predicate:i,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(n){if(q(t.options.mutationKey)!==q(r))return!1}else if(!N(t.options.mutationKey,r))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function Fe(e,t){return(t?.queryKeyHashFn||q)(e)}function q(e){return JSON.stringify(e,(t,n)=>ge(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function N(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>N(e[n],t[n])):!1}var wt=Object.prototype.hasOwnProperty;function ne(e,t){if(e===t)return e;const n=De(e)&&De(t);if(!n&&!(ge(e)&&ge(t)))return t;const i=(n?e:Object.keys(e)).length,r=n?t:Object.keys(t),o=r.length,u=n?new Array(o):{};let l=0;for(let c=0;c<o;c++){const a=n?c:r[c],p=e[a],g=t[a];if(p===g){u[a]=p,(n?c<i:wt.call(e,a))&&l++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){u[a]=g;continue}const d=ne(p,g);u[a]=d,d===p&&l++}return i===o&&l===i?e:u}function K(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function De(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ge(e){if(!Ae(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ae(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ae(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ft(e){return new Promise(t=>{z.setTimeout(t,e)})}function fe(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ne(e,t):t}function Ln(e){return e}function _t(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function Pt(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var _e=Symbol();function Be(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===_e?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ne(e,t){return typeof e=="function"?e(...t):!!e}var Mt=class extends k{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Q&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Pe=new Mt;function he(){let e,t;const n=new Promise((i,r)=>{e=i,t=r});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),e(i)},n.reject=i=>{s({status:"rejected",reason:i}),t(i)},n}var Ot=yt;function xt(){let e=[],t=0,n=u=>{u()},s=u=>{u()},i=Ot;const r=u=>{t?e.push(u):i(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&i(()=>{s(()=>{u.forEach(l=>{n(l)})})})};return{batch:u=>{let l;t++;try{l=u()}finally{t--,t||o()}return l},batchCalls:u=>(...l)=>{r(()=>{u(...l)})},schedule:r,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{s=u},setScheduler:u=>{i=u}}}var F=xt(),It=class extends k{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Q&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},ee=new It;function $t(e){return Math.min(1e3*2**e,3e4)}function Ke(e){return(e??"online")==="online"?ee.isOnline():!0}var pe=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Xe(e){let t=!1,n=0,s;const i=he(),r=()=>i.status!=="pending",o=f=>{if(!r()){const v=new pe(f);g(v),e.onCancel?.(v)}},u=()=>{t=!0},l=()=>{t=!1},c=()=>Pe.isFocused()&&(e.networkMode==="always"||ee.isOnline())&&e.canRun(),a=()=>Ke(e.networkMode)&&e.canRun(),p=f=>{r()||(s?.(),i.resolve(f))},g=f=>{r()||(s?.(),i.reject(f))},d=()=>new Promise(f=>{s=v=>{(r()||c())&&f(v)},e.onPause?.()}).then(()=>{s=void 0,r()||e.onContinue?.()}),h=()=>{if(r())return;let f;const v=n===0?e.initialPromise:void 0;try{f=v??e.fn()}catch(m){f=Promise.reject(m)}Promise.resolve(f).then(p).catch(m=>{if(r())return;const y=e.retry??(Q?0:3),R=e.retryDelay??$t,_=typeof R=="function"?R(n,m):R,O=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,m);if(t||!O){g(m);return}n++,e.onFail?.(n,m),Ft(_).then(()=>c()?void 0:d()).then(()=>{t?g(m):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(s?.(),i),cancelRetry:u,continueRetry:l,canStart:a,start:()=>(a()?h():d().then(h),i)}}var We=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),de(this.gcTime)&&(this.#t=z.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Q?1/0:300*1e3))}clearGcTimeout(){this.#t&&(z.clearTimeout(this.#t),this.#t=void 0)}},Et=class extends We{#t;#e;#n;#i;#s;#r;#u;constructor(e){super(),this.#u=!1,this.#r=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=He(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#r,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=He(this.options);t.data!==void 0&&(this.setState(be(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=fe(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(M).catch(M):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>E(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_e||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>H(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!je(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#u?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(l=>l.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,s=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#u=!0,n.signal)})},i=()=>{const u=Be(this.options,t),c=(()=>{const a={client:this.#i,queryKey:this.queryKey,meta:this.meta};return s(a),a})();return this.#u=!1,this.options.persister?this.options.persister(u,c,this):u(c)},o=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return s(u),u})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#o({type:"fetch",meta:o.fetchOptions?.meta}),this.#s=Xe({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:u=>{u instanceof pe&&u.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(u,l)=>{this.#o({type:"failed",failureCount:u,error:l})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const u=await this.#s.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof pe){if(u.silent)return this.#s.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#o({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Je(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...be(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?s:void 0,s;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),F.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Je(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ke(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function be(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function He(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Me=class extends k{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#u=he(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#r;#u;#o;#f;#d;#g;#a;#c;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Le(this.#e,this.options)?this.#h():this.updateResult(),this.#C())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return me(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return me(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#R(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof E(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),t._defaulted&&!K(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&Ge(this.#e,n,this.options,t)&&this.#h(),this.updateResult(),s&&(this.#e!==n||E(this.options.enabled,this.#e)!==E(t.enabled,this.#e)||H(this.options.staleTime,this.#e)!==H(t.staleTime,this.#e))&&this.#m();const i=this.#v();s&&(this.#e!==n||E(this.options.enabled,this.#e)!==E(t.enabled,this.#e)||i!==this.#l)&&this.#S(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return Dt(this,n)&&(this.#i=n,this.#r=this.options,this.#s=this.#e.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#u.status==="pending"&&this.#u.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#h(e){this.#w();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(M)),t}#m(){this.#y();const e=H(this.options.staleTime,this.#e);if(Q||this.#i.isStale||!de(e))return;const n=je(this.#i.dataUpdatedAt,e)+1;this.#a=z.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#S(e){this.#R(),this.#l=e,!(Q||E(this.options.enabled,this.#e)===!1||!de(this.#l)||this.#l===0)&&(this.#c=z.setInterval(()=>{(this.options.refetchIntervalInBackground||Pe.isFocused())&&this.#h()},this.#l))}#C(){this.#m(),this.#S(this.#v())}#y(){this.#a&&(z.clearTimeout(this.#a),this.#a=void 0)}#R(){this.#c&&(z.clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#e,s=this.options,i=this.#i,r=this.#s,o=this.#r,l=e!==n?e.state:this.#n,{state:c}=e;let a={...c},p=!1,g;if(t._optimisticResults){const x=this.hasListeners(),U=!x&&Le(e,t),A=x&&Ge(e,n,t,s);(U||A)&&(a={...a,...Je(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(a.fetchStatus="idle")}let{error:d,errorUpdatedAt:h,status:f}=a;g=a.data;let v=!1;if(t.placeholderData!==void 0&&g===void 0&&f==="pending"){let x;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(x=i.data,v=!0):x=typeof t.placeholderData=="function"?t.placeholderData(this.#g?.state.data,this.#g):t.placeholderData,x!==void 0&&(f="success",g=fe(i?.data,x,t),p=!0)}if(t.select&&g!==void 0&&!v)if(i&&g===r?.data&&t.select===this.#f)g=this.#d;else try{this.#f=t.select,g=t.select(g),g=fe(i?.data,g,t),this.#d=g,this.#o=null}catch(x){this.#o=x}this.#o&&(d=this.#o,g=this.#d,h=Date.now(),f="error");const m=a.fetchStatus==="fetching",y=f==="pending",R=f==="error",_=y&&m,O=g!==void 0,I={status:f,fetchStatus:a.fetchStatus,isPending:y,isSuccess:f==="success",isError:R,isInitialLoading:_,isLoading:_,data:g,dataUpdatedAt:a.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:a.fetchFailureCount,failureReason:a.fetchFailureReason,errorUpdateCount:a.errorUpdateCount,isFetched:a.dataUpdateCount>0||a.errorUpdateCount>0,isFetchedAfterMount:a.dataUpdateCount>l.dataUpdateCount||a.errorUpdateCount>l.errorUpdateCount,isFetching:m,isRefetching:m&&!y,isLoadingError:R&&!O,isPaused:a.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:R&&O,isStale:Oe(e,t),refetch:this.refetch,promise:this.#u,isEnabled:E(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const x=T=>{I.status==="error"?T.reject(I.error):I.data!==void 0&&T.resolve(I.data)},U=()=>{const T=this.#u=I.promise=he();x(T)},A=this.#u;switch(A.status){case"pending":e.queryHash===n.queryHash&&x(A);break;case"fulfilled":(I.status==="error"||I.data!==A.value)&&U();break;case"rejected":(I.status!=="error"||I.error!==A.reason)&&U();break}}return I}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#r=this.options,this.#s.data!==void 0&&(this.#g=this.#e),K(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#p.size)return!0;const r=new Set(i??this.#p);return this.options.throwOnError&&r.add("error"),Object.keys(this.#i).some(o=>{const u=o;return this.#i[u]!==e[u]&&r.has(u)})};this.#F({listeners:n()})}#w(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#C()}#F(e){F.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Vt(e,t){return E(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Le(e,t){return Vt(e,t)||e.state.data!==void 0&&me(e,t,t.refetchOnMount)}function me(e,t,n){if(E(t.enabled,e)!==!1&&H(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Oe(e,t)}return!1}function Ge(e,t,n,s){return(e!==t||E(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Oe(e,n)}function Oe(e,t){return E(t.enabled,e)!==!1&&e.isStaleByTime(H(t.staleTime,e))}function Dt(e,t){return!K(e.getCurrentResult(),t)}function Te(e){return{onFetch:(t,n)=>{const s=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,r=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},l=0;const c=async()=>{let a=!1;const p=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(t.signal.aborted?a=!0:t.signal.addEventListener("abort",()=>{a=!0}),t.signal)})},g=Be(t.options,t.fetchOptions),d=async(h,f,v)=>{if(a)return Promise.reject();if(f==null&&h.pages.length)return Promise.resolve(h);const y=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:f,direction:v?"backward":"forward",meta:t.options.meta};return p(G),G})(),R=await g(y),{maxPages:_}=t.options,O=v?Pt:_t;return{pages:O(h.pages,R,_),pageParams:O(h.pageParams,f,_)}};if(i&&r.length){const h=i==="backward",f=h?At:ze,v={pages:r,pageParams:o},m=f(s,v);u=await d(v,m,h)}else{const h=e??r.length;do{const f=l===0?o[0]??s.initialPageParam:ze(s,u);if(l>0&&f==null)break;u=await d(u,f),l++}while(l<h)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function ze(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function At(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var bt=class extends We{#t;#e;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||Ze(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Xe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#s({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",i=!this.#i.canStart();try{if(s)t();else{this.#s({type:"pending",variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#s({type:"pending",context:o,variables:e,isPaused:i})}const r=await this.#i.start();return await this.#n.config.onSuccess?.(r,e,this.state.context,this,n),await this.options.onSuccess?.(r,e,this.state.context,n),await this.#n.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,e,this.state.context,n),this.#s({type:"success",data:r}),r}catch(r){try{throw await this.#n.config.onError?.(r,e,this.state.context,this,n),await this.options.onError?.(r,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,r,e,this.state.context,n),r}finally{this.#s({type:"error",error:r})}}finally{this.#n.runNext(this)}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),F.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Ze(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ht=class extends k{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const s=new bt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#t.add(e);const t=W(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=W(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=W(e);if(typeof t=="string"){const s=this.#e.get(t)?.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=W(e);return typeof t=="string"?this.#e.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){F.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ve(t,n))}findAll(e={}){return this.getAll().filter(t=>Ve(e,t))}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return F.batch(()=>Promise.all(e.map(t=>t.continue().catch(M))))}};function W(e){return e.options.scope?.id}var Lt=class extends k{#t;#e=void 0;#n;#i;constructor(e,t){super(),this.#t=e,this.setOptions(t),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#t.defaultMutationOptions(e),K(this.options,t)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&q(t.mutationKey)!==q(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#s(),this.#r(e)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#r()}mutate(e,t){return this.#i=t,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(e)}#s(){const e=this.#n?.state??Ze();this.#e={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#r(e){F.batch(()=>{if(this.#i&&this.hasListeners()){const t=this.#e.variables,n=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#i.onSuccess?.(e.data,t,n,s),this.#i.onSettled?.(e.data,null,t,n,s)):e?.type==="error"&&(this.#i.onError?.(e.error,t,n,s),this.#i.onSettled?.(void 0,e.error,t,n,s))}this.listeners.forEach(t=>{t(this.#e)})})}};function Qe(e,t){const n=new Set(t);return e.filter(s=>!n.has(s))}function Gt(e,t,n){const s=e.slice(0);return s[t]=n,s}var Tt=class extends k{#t;#e;#n;#i;#s;#r;#u;#o;#f=[];constructor(e,t,n){super(),this.#t=e,this.#i=n,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,F.batch(()=>{const n=this.#s,s=this.#a(this.#n);this.#f=s,s.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const i=s.map(a=>a.observer),r=i.map(a=>a.getCurrentResult()),o=n.length!==i.length,u=i.some((a,p)=>a!==n[p]),l=o||u,c=l?!0:r.some((a,p)=>{const g=this.#e[p];return!g||!K(a,g)});!l&&!c||(l&&(this.#s=i),this.#e=r,this.hasListeners()&&(l&&(Qe(n,i).forEach(a=>{a.destroy()}),Qe(i,n).forEach(a=>{a.subscribe(p=>{this.#c(a,p)})})),this.#l()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const n=this.#a(e),s=n.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[s,i=>this.#g(i??s,t),()=>this.#d(s,n)]}#d(e,t){return t.map((n,s)=>{const i=e[s];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,r=>{t.forEach(o=>{o.observer.trackProp(r)})})})}#g(e,t){return t?((!this.#r||this.#e!==this.#o||t!==this.#u)&&(this.#u=t,this.#o=this.#e,this.#r=ne(this.#r,t(e))),this.#r):e}#a(e){const t=new Map;this.#s.forEach(s=>{const i=s.options.queryHash;if(!i)return;const r=t.get(i);r?r.push(s):t.set(i,[s])});const n=[];return e.forEach(s=>{const i=this.#t.defaultQueryOptions(s),o=t.get(i.queryHash)?.shift()??new Me(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#c(e,t){const n=this.#s.indexOf(e);n!==-1&&(this.#e=Gt(this.#e,n,t),this.#l())}#l(){if(this.hasListeners()){const e=this.#r,t=this.#d(this.#e,this.#f),n=this.#g(t,this.#i?.combine);e!==n&&F.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},zt=class extends k{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const s=t.queryKey,i=t.queryHash??Fe(s,t);let r=this.get(i);return r||(r=new Et({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(r)),r}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){F.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ee(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ee(e,n)):t}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){F.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){F.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Gn=class{#t;#e;#n;#i;#s;#r;#u;#o;constructor(e={}){this.#t=e.queryCache||new zt,this.#e=e.mutationCache||new Ht,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#u=Pe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=ee.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#u?.(),this.#u=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(H(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),r=this.#t.get(s.queryHash)?.state.data,o=Rt(t,r);if(o!==void 0)return this.#t.build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return F.batch(()=>this.#t.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;F.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return F.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=F.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(M).catch(M)}invalidateQueries(e,t={}){return F.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=F.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let r=i.fetch(void 0,n);return n.throwOnError||(r=r.catch(M)),i.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(s).then(M)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(H(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(M).catch(M)}fetchInfiniteQuery(e){return e.behavior=Te(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(M).catch(M)}ensureInfiniteQueryData(e){return e.behavior=Te(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ee.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(q(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(s=>{N(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(q(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{N(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fe(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===_e&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},Ye=w.createContext(void 0),X=e=>{const t=w.useContext(Ye);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Tn=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),vt.jsx(Ye.Provider,{value:e,children:t})),et=w.createContext(!1),tt=()=>w.useContext(et);et.Provider;function Qt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qt=w.createContext(Qt()),nt=()=>w.useContext(qt),st=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},it=e=>{w.useEffect(()=>{e.clearReset()},[e])},rt=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||Ne(n,[e.error,s])),ot=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ut=(e,t)=>e.isLoading&&e.isFetching&&!t,ve=(e,t)=>e?.suspense&&t.isPending,te=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zn({queries:e,...t},n){const s=X(n),i=tt(),r=nt(),o=w.useMemo(()=>e.map(f=>{const v=s.defaultQueryOptions(f);return v._optimisticResults=i?"isRestoring":"optimistic",v}),[e,s,i]);o.forEach(f=>{ot(f),st(f,r)}),it(r);const[u]=w.useState(()=>new Tt(s,o,t)),[l,c,a]=u.getOptimisticResult(o,t.combine),p=!i&&t.subscribed!==!1;w.useSyncExternalStore(w.useCallback(f=>p?u.subscribe(F.batchCalls(f)):M,[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),w.useEffect(()=>{u.setQueries(o,t)},[o,t,u]);const d=l.some((f,v)=>ve(o[v],f))?l.flatMap((f,v)=>{const m=o[v];if(m){const y=new Me(s,m);if(ve(m,f))return te(m,y,r);ut(f,i)&&te(m,y,r)}return[]}):[];if(d.length>0)throw Promise.all(d);const h=l.find((f,v)=>{const m=o[v];return m&&rt({result:f,errorResetBoundary:r,throwOnError:m.throwOnError,query:s.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(h?.error)throw h.error;return c(a())}function kt(e,t,n){const s=tt(),i=nt(),r=X(n),o=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=s?"isRestoring":"optimistic",ot(o),st(o,i),it(i);const u=!r.getQueryCache().get(o.queryHash),[l]=w.useState(()=>new t(r,o)),c=l.getOptimisticResult(o),a=!s&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(p=>{const g=a?l.subscribe(F.batchCalls(p)):M;return l.updateResult(),g},[l,a]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(o)},[o,l]),ve(o,c))throw te(o,l,i);if(rt({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(o,c),o.experimental_prefetchInRender&&!Q&&ut(c,s)&&(u?te(o,l,i):r.getQueryCache().get(o.queryHash)?.promise)?.catch(M).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?c:l.trackResult(c)}function Qn(e,t){return kt(e,Me,t)}function qn(e,t){const n=X(t);return Ut({filters:{...e,status:"pending"}},n).length}function qe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ut(e={},t){const n=X(t).getMutationCache(),s=w.useRef(e),i=w.useRef(null);return i.current===null&&(i.current=qe(n,e)),w.useEffect(()=>{s.current=e}),w.useSyncExternalStore(w.useCallback(r=>n.subscribe(()=>{const o=ne(i.current,qe(n,s.current));i.current!==o&&(i.current=o,F.schedule(r))}),[n]),()=>i.current,()=>i.current)}function kn(e,t){const n=X(t),[s]=w.useState(()=>new Lt(n,e));w.useEffect(()=>{s.setOptions(e)},[s,e]);const i=w.useSyncExternalStore(w.useCallback(o=>s.subscribe(F.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),r=w.useCallback((o,u)=>{s.mutate(o,u).catch(M)},[s]);if(i.error&&Ne(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:r,mutateAsync:i.mutate}}function b(e,t){return typeof e=="function"?e(t):e}function $(e,t){return n=>{t.setState(s=>({...s,[e]:b(n,s[e])}))}}function se(e){return e instanceof Function}function jt(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Bt(e,t){const n=[],s=i=>{i.forEach(r=>{n.push(r);const o=t(r);o!=null&&o.length&&s(o)})};return s(e),n}function S(e,t,n){let s=[],i;return r=>{let o;n.key&&n.debug&&(o=Date.now());const u=e(r);if(!(u.length!==s.length||u.some((a,p)=>s[p]!==a)))return i;s=u;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...u),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const a=Math.round((Date.now()-o)*100)/100,p=Math.round((Date.now()-c)*100)/100,g=p/16,d=(h,f)=>{for(h=String(h);h.length<f;)h=" "+h;return h};console.info(`%c⏱ ${d(p,5)} /${d(a,5)} ms`,`
|
|
1
|
+
import{r as w}from"./react-vendor-Bjx91N7w.js";import{j as vt}from"./radix-ui-nu4wz29m.js";var k=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(){}},St={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ct=class{#t=St;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},z=new Ct;function yt(e){setTimeout(e,0)}var Q=typeof window>"u"||"Deno"in globalThis;function M(){}function Rt(e,t){return typeof e=="function"?e(t):e}function de(e){return typeof e=="number"&&e>=0&&e!==1/0}function je(e,t){return Math.max(e+(t||0)-Date.now(),0)}function H(e,t){return typeof e=="function"?e(t):e}function E(e,t){return typeof e=="function"?e(t):e}function Ee(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:r,queryKey:o,stale:u}=e;if(o){if(s){if(t.queryHash!==Fe(o,t.options))return!1}else if(!N(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||r&&!r(t))}function Ve(e,t){const{exact:n,status:s,predicate:i,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(n){if(q(t.options.mutationKey)!==q(r))return!1}else if(!N(t.options.mutationKey,r))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function Fe(e,t){return(t?.queryKeyHashFn||q)(e)}function q(e){return JSON.stringify(e,(t,n)=>ge(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function N(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>N(e[n],t[n])):!1}var wt=Object.prototype.hasOwnProperty;function ne(e,t){if(e===t)return e;const n=De(e)&&De(t);if(!n&&!(ge(e)&&ge(t)))return t;const i=(n?e:Object.keys(e)).length,r=n?t:Object.keys(t),o=r.length,u=n?new Array(o):{};let l=0;for(let c=0;c<o;c++){const a=n?c:r[c],p=e[a],g=t[a];if(p===g){u[a]=p,(n?c<i:wt.call(e,a))&&l++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){u[a]=g;continue}const d=ne(p,g);u[a]=d,d===p&&l++}return i===o&&l===i?e:u}function K(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function De(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ge(e){if(!Ae(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ae(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ae(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ft(e){return new Promise(t=>{z.setTimeout(t,e)})}function fe(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ne(e,t):t}function Ln(e){return e}function _t(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function Pt(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var _e=Symbol();function Be(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===_e?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ne(e,t){return typeof e=="function"?e(...t):!!e}var Mt=class extends k{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Q&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Pe=new Mt;function he(){let e,t;const n=new Promise((i,r)=>{e=i,t=r});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),e(i)},n.reject=i=>{s({status:"rejected",reason:i}),t(i)},n}var Ot=yt;function xt(){let e=[],t=0,n=u=>{u()},s=u=>{u()},i=Ot;const r=u=>{t?e.push(u):i(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&i(()=>{s(()=>{u.forEach(l=>{n(l)})})})};return{batch:u=>{let l;t++;try{l=u()}finally{t--,t||o()}return l},batchCalls:u=>(...l)=>{r(()=>{u(...l)})},schedule:r,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{s=u},setScheduler:u=>{i=u}}}var F=xt(),It=class extends k{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Q&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},ee=new It;function $t(e){return Math.min(1e3*2**e,3e4)}function Ke(e){return(e??"online")==="online"?ee.isOnline():!0}var pe=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Xe(e){let t=!1,n=0,s;const i=he(),r=()=>i.status!=="pending",o=f=>{if(!r()){const v=new pe(f);g(v),e.onCancel?.(v)}},u=()=>{t=!0},l=()=>{t=!1},c=()=>Pe.isFocused()&&(e.networkMode==="always"||ee.isOnline())&&e.canRun(),a=()=>Ke(e.networkMode)&&e.canRun(),p=f=>{r()||(s?.(),i.resolve(f))},g=f=>{r()||(s?.(),i.reject(f))},d=()=>new Promise(f=>{s=v=>{(r()||c())&&f(v)},e.onPause?.()}).then(()=>{s=void 0,r()||e.onContinue?.()}),h=()=>{if(r())return;let f;const v=n===0?e.initialPromise:void 0;try{f=v??e.fn()}catch(m){f=Promise.reject(m)}Promise.resolve(f).then(p).catch(m=>{if(r())return;const y=e.retry??(Q?0:3),R=e.retryDelay??$t,_=typeof R=="function"?R(n,m):R,O=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,m);if(t||!O){g(m);return}n++,e.onFail?.(n,m),Ft(_).then(()=>c()?void 0:d()).then(()=>{t?g(m):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(s?.(),i),cancelRetry:u,continueRetry:l,canStart:a,start:()=>(a()?h():d().then(h),i)}}var We=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),de(this.gcTime)&&(this.#t=z.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Q?1/0:300*1e3))}clearGcTimeout(){this.#t&&(z.clearTimeout(this.#t),this.#t=void 0)}},Et=class extends We{#t;#e;#n;#i;#s;#r;#u;constructor(e){super(),this.#u=!1,this.#r=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=He(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#r,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=He(this.options);t.data!==void 0&&(this.setState(be(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=fe(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(M).catch(M):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>E(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_e||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>H(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!je(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#u?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(l=>l.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,s=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#u=!0,n.signal)})},i=()=>{const u=Be(this.options,t),c=(()=>{const a={client:this.#i,queryKey:this.queryKey,meta:this.meta};return s(a),a})();return this.#u=!1,this.options.persister?this.options.persister(u,c,this):u(c)},o=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return s(u),u})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#o({type:"fetch",meta:o.fetchOptions?.meta}),this.#s=Xe({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:u=>{u instanceof pe&&u.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(u,l)=>{this.#o({type:"failed",failureCount:u,error:l})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const u=await this.#s.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof pe){if(u.silent)return this.#s.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#o({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Je(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...be(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?s:void 0,s;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),F.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Je(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ke(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function be(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function He(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Me=class extends k{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#u=he(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#r;#u;#o;#f;#d;#g;#a;#c;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Le(this.#e,this.options)?this.#h():this.updateResult(),this.#C())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return me(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return me(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#R(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof E(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),t._defaulted&&!K(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&Ge(this.#e,n,this.options,t)&&this.#h(),this.updateResult(),s&&(this.#e!==n||E(this.options.enabled,this.#e)!==E(t.enabled,this.#e)||H(this.options.staleTime,this.#e)!==H(t.staleTime,this.#e))&&this.#m();const i=this.#v();s&&(this.#e!==n||E(this.options.enabled,this.#e)!==E(t.enabled,this.#e)||i!==this.#l)&&this.#S(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return Dt(this,n)&&(this.#i=n,this.#r=this.options,this.#s=this.#e.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#u.status==="pending"&&this.#u.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#h(e){this.#w();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(M)),t}#m(){this.#y();const e=H(this.options.staleTime,this.#e);if(Q||this.#i.isStale||!de(e))return;const n=je(this.#i.dataUpdatedAt,e)+1;this.#a=z.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#S(e){this.#R(),this.#l=e,!(Q||E(this.options.enabled,this.#e)===!1||!de(this.#l)||this.#l===0)&&(this.#c=z.setInterval(()=>{(this.options.refetchIntervalInBackground||Pe.isFocused())&&this.#h()},this.#l))}#C(){this.#m(),this.#S(this.#v())}#y(){this.#a&&(z.clearTimeout(this.#a),this.#a=void 0)}#R(){this.#c&&(z.clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#e,s=this.options,i=this.#i,r=this.#s,o=this.#r,l=e!==n?e.state:this.#n,{state:c}=e;let a={...c},p=!1,g;if(t._optimisticResults){const x=this.hasListeners(),U=!x&&Le(e,t),A=x&&Ge(e,n,t,s);(U||A)&&(a={...a,...Je(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(a.fetchStatus="idle")}let{error:d,errorUpdatedAt:h,status:f}=a;g=a.data;let v=!1;if(t.placeholderData!==void 0&&g===void 0&&f==="pending"){let x;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(x=i.data,v=!0):x=typeof t.placeholderData=="function"?t.placeholderData(this.#g?.state.data,this.#g):t.placeholderData,x!==void 0&&(f="success",g=fe(i?.data,x,t),p=!0)}if(t.select&&g!==void 0&&!v)if(i&&g===r?.data&&t.select===this.#f)g=this.#d;else try{this.#f=t.select,g=t.select(g),g=fe(i?.data,g,t),this.#d=g,this.#o=null}catch(x){this.#o=x}this.#o&&(d=this.#o,g=this.#d,h=Date.now(),f="error");const m=a.fetchStatus==="fetching",y=f==="pending",R=f==="error",_=y&&m,O=g!==void 0,I={status:f,fetchStatus:a.fetchStatus,isPending:y,isSuccess:f==="success",isError:R,isInitialLoading:_,isLoading:_,data:g,dataUpdatedAt:a.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:a.fetchFailureCount,failureReason:a.fetchFailureReason,errorUpdateCount:a.errorUpdateCount,isFetched:a.dataUpdateCount>0||a.errorUpdateCount>0,isFetchedAfterMount:a.dataUpdateCount>l.dataUpdateCount||a.errorUpdateCount>l.errorUpdateCount,isFetching:m,isRefetching:m&&!y,isLoadingError:R&&!O,isPaused:a.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:R&&O,isStale:Oe(e,t),refetch:this.refetch,promise:this.#u,isEnabled:E(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const x=T=>{I.status==="error"?T.reject(I.error):I.data!==void 0&&T.resolve(I.data)},U=()=>{const T=this.#u=I.promise=he();x(T)},A=this.#u;switch(A.status){case"pending":e.queryHash===n.queryHash&&x(A);break;case"fulfilled":(I.status==="error"||I.data!==A.value)&&U();break;case"rejected":(I.status!=="error"||I.error!==A.reason)&&U();break}}return I}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#r=this.options,this.#s.data!==void 0&&(this.#g=this.#e),K(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#p.size)return!0;const r=new Set(i??this.#p);return this.options.throwOnError&&r.add("error"),Object.keys(this.#i).some(o=>{const u=o;return this.#i[u]!==e[u]&&r.has(u)})};this.#F({listeners:n()})}#w(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#C()}#F(e){F.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Vt(e,t){return E(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Le(e,t){return Vt(e,t)||e.state.data!==void 0&&me(e,t,t.refetchOnMount)}function me(e,t,n){if(E(t.enabled,e)!==!1&&H(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Oe(e,t)}return!1}function Ge(e,t,n,s){return(e!==t||E(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Oe(e,n)}function Oe(e,t){return E(t.enabled,e)!==!1&&e.isStaleByTime(H(t.staleTime,e))}function Dt(e,t){return!K(e.getCurrentResult(),t)}function Te(e){return{onFetch:(t,n)=>{const s=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,r=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},l=0;const c=async()=>{let a=!1;const p=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(t.signal.aborted?a=!0:t.signal.addEventListener("abort",()=>{a=!0}),t.signal)})},g=Be(t.options,t.fetchOptions),d=async(h,f,v)=>{if(a)return Promise.reject();if(f==null&&h.pages.length)return Promise.resolve(h);const y=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:f,direction:v?"backward":"forward",meta:t.options.meta};return p(G),G})(),R=await g(y),{maxPages:_}=t.options,O=v?Pt:_t;return{pages:O(h.pages,R,_),pageParams:O(h.pageParams,f,_)}};if(i&&r.length){const h=i==="backward",f=h?At:ze,v={pages:r,pageParams:o},m=f(s,v);u=await d(v,m,h)}else{const h=e??r.length;do{const f=l===0?o[0]??s.initialPageParam:ze(s,u);if(l>0&&f==null)break;u=await d(u,f),l++}while(l<h)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function ze(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function At(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var bt=class extends We{#t;#e;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||Ze(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Xe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#s({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",i=!this.#i.canStart();try{if(s)t();else{this.#s({type:"pending",variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#s({type:"pending",context:o,variables:e,isPaused:i})}const r=await this.#i.start();return await this.#n.config.onSuccess?.(r,e,this.state.context,this,n),await this.options.onSuccess?.(r,e,this.state.context,n),await this.#n.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,e,this.state.context,n),this.#s({type:"success",data:r}),r}catch(r){try{throw await this.#n.config.onError?.(r,e,this.state.context,this,n),await this.options.onError?.(r,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,r,e,this.state.context,n),r}finally{this.#s({type:"error",error:r})}}finally{this.#n.runNext(this)}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),F.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Ze(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ht=class extends k{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const s=new bt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#t.add(e);const t=W(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=W(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=W(e);if(typeof t=="string"){const s=this.#e.get(t)?.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=W(e);return typeof t=="string"?this.#e.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){F.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ve(t,n))}findAll(e={}){return this.getAll().filter(t=>Ve(e,t))}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return F.batch(()=>Promise.all(e.map(t=>t.continue().catch(M))))}};function W(e){return e.options.scope?.id}var Lt=class extends k{#t;#e=void 0;#n;#i;constructor(e,t){super(),this.#t=e,this.setOptions(t),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#t.defaultMutationOptions(e),K(this.options,t)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&q(t.mutationKey)!==q(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#s(),this.#r(e)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#r()}mutate(e,t){return this.#i=t,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(e)}#s(){const e=this.#n?.state??Ze();this.#e={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#r(e){F.batch(()=>{if(this.#i&&this.hasListeners()){const t=this.#e.variables,n=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#i.onSuccess?.(e.data,t,n,s),this.#i.onSettled?.(e.data,null,t,n,s)):e?.type==="error"&&(this.#i.onError?.(e.error,t,n,s),this.#i.onSettled?.(void 0,e.error,t,n,s))}this.listeners.forEach(t=>{t(this.#e)})})}};function Qe(e,t){const n=new Set(t);return e.filter(s=>!n.has(s))}function Gt(e,t,n){const s=e.slice(0);return s[t]=n,s}var Tt=class extends k{#t;#e;#n;#i;#s;#r;#u;#o;#f=[];constructor(e,t,n){super(),this.#t=e,this.#i=n,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,F.batch(()=>{const n=this.#s,s=this.#a(this.#n);this.#f=s,s.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const i=s.map(a=>a.observer),r=i.map(a=>a.getCurrentResult()),o=n.length!==i.length,u=i.some((a,p)=>a!==n[p]),l=o||u,c=l?!0:r.some((a,p)=>{const g=this.#e[p];return!g||!K(a,g)});!l&&!c||(l&&(this.#s=i),this.#e=r,this.hasListeners()&&(l&&(Qe(n,i).forEach(a=>{a.destroy()}),Qe(i,n).forEach(a=>{a.subscribe(p=>{this.#c(a,p)})})),this.#l()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const n=this.#a(e),s=n.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[s,i=>this.#g(i??s,t),()=>this.#d(s,n)]}#d(e,t){return t.map((n,s)=>{const i=e[s];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,r=>{t.forEach(o=>{o.observer.trackProp(r)})})})}#g(e,t){return t?((!this.#r||this.#e!==this.#o||t!==this.#u)&&(this.#u=t,this.#o=this.#e,this.#r=ne(this.#r,t(e))),this.#r):e}#a(e){const t=new Map;this.#s.forEach(s=>{const i=s.options.queryHash;if(!i)return;const r=t.get(i);r?r.push(s):t.set(i,[s])});const n=[];return e.forEach(s=>{const i=this.#t.defaultQueryOptions(s),o=t.get(i.queryHash)?.shift()??new Me(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#c(e,t){const n=this.#s.indexOf(e);n!==-1&&(this.#e=Gt(this.#e,n,t),this.#l())}#l(){if(this.hasListeners()){const e=this.#r,t=this.#d(this.#e,this.#f),n=this.#g(t,this.#i?.combine);e!==n&&F.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},zt=class extends k{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const s=t.queryKey,i=t.queryHash??Fe(s,t);let r=this.get(i);return r||(r=new Et({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(r)),r}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){F.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ee(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ee(e,n)):t}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){F.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){F.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Gn=class{#t;#e;#n;#i;#s;#r;#u;#o;constructor(e={}){this.#t=e.queryCache||new zt,this.#e=e.mutationCache||new Ht,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#u=Pe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=ee.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#u?.(),this.#u=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(H(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),r=this.#t.get(s.queryHash)?.state.data,o=Rt(t,r);if(o!==void 0)return this.#t.build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return F.batch(()=>this.#t.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;F.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return F.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=F.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(M).catch(M)}invalidateQueries(e,t={}){return F.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=F.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let r=i.fetch(void 0,n);return n.throwOnError||(r=r.catch(M)),i.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(s).then(M)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(H(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(M).catch(M)}fetchInfiniteQuery(e){return e.behavior=Te(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(M).catch(M)}ensureInfiniteQueryData(e){return e.behavior=Te(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ee.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(q(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(s=>{N(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(q(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{N(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fe(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===_e&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},Ye=w.createContext(void 0),X=e=>{const t=w.useContext(Ye);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Tn=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),vt.jsx(Ye.Provider,{value:e,children:t})),et=w.createContext(!1),tt=()=>w.useContext(et);et.Provider;function Qt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qt=w.createContext(Qt()),nt=()=>w.useContext(qt),st=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},it=e=>{w.useEffect(()=>{e.clearReset()},[e])},rt=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||Ne(n,[e.error,s])),ot=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ut=(e,t)=>e.isLoading&&e.isFetching&&!t,ve=(e,t)=>e?.suspense&&t.isPending,te=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zn({queries:e,...t},n){const s=X(n),i=tt(),r=nt(),o=w.useMemo(()=>e.map(f=>{const v=s.defaultQueryOptions(f);return v._optimisticResults=i?"isRestoring":"optimistic",v}),[e,s,i]);o.forEach(f=>{ot(f),st(f,r)}),it(r);const[u]=w.useState(()=>new Tt(s,o,t)),[l,c,a]=u.getOptimisticResult(o,t.combine),p=!i&&t.subscribed!==!1;w.useSyncExternalStore(w.useCallback(f=>p?u.subscribe(F.batchCalls(f)):M,[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),w.useEffect(()=>{u.setQueries(o,t)},[o,t,u]);const d=l.some((f,v)=>ve(o[v],f))?l.flatMap((f,v)=>{const m=o[v];if(m){const y=new Me(s,m);if(ve(m,f))return te(m,y,r);ut(f,i)&&te(m,y,r)}return[]}):[];if(d.length>0)throw Promise.all(d);const h=l.find((f,v)=>{const m=o[v];return m&&rt({result:f,errorResetBoundary:r,throwOnError:m.throwOnError,query:s.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(h?.error)throw h.error;return c(a())}function kt(e,t,n){const s=tt(),i=nt(),r=X(n),o=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=s?"isRestoring":"optimistic",ot(o),st(o,i),it(i);const u=!r.getQueryCache().get(o.queryHash),[l]=w.useState(()=>new t(r,o)),c=l.getOptimisticResult(o),a=!s&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(p=>{const g=a?l.subscribe(F.batchCalls(p)):M;return l.updateResult(),g},[l,a]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(o)},[o,l]),ve(o,c))throw te(o,l,i);if(rt({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(o,c),o.experimental_prefetchInRender&&!Q&&ut(c,s)&&(u?te(o,l,i):r.getQueryCache().get(o.queryHash)?.promise)?.catch(M).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?c:l.trackResult(c)}function Qn(e,t){return kt(e,Me,t)}function qn(e,t){const n=X(t);return Ut({filters:{...e,status:"pending"}},n).length}function qe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ut(e={},t){const n=X(t).getMutationCache(),s=w.useRef(e),i=w.useRef(null);return i.current===null&&(i.current=qe(n,e)),w.useEffect(()=>{s.current=e}),w.useSyncExternalStore(w.useCallback(r=>n.subscribe(()=>{const o=ne(i.current,qe(n,s.current));i.current!==o&&(i.current=o,F.schedule(r))}),[n]),()=>i.current,()=>i.current)}function kn(e,t){const n=X(t),[s]=w.useState(()=>new Lt(n,e));w.useEffect(()=>{s.setOptions(e)},[s,e]);const i=w.useSyncExternalStore(w.useCallback(o=>s.subscribe(F.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),r=w.useCallback((o,u)=>{s.mutate(o,u).catch(M)},[s]);if(i.error&&Ne(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:r,mutateAsync:i.mutate}}function b(e,t){return typeof e=="function"?e(t):e}function $(e,t){return n=>{t.setState(s=>({...s,[e]:b(n,s[e])}))}}function se(e){return e instanceof Function}function jt(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Bt(e,t){const n=[],s=i=>{i.forEach(r=>{n.push(r);const o=t(r);o!=null&&o.length&&s(o)})};return s(e),n}function S(e,t,n){let s=[],i;return r=>{let o;n.key&&n.debug&&(o=Date.now());const u=e(r);if(!(u.length!==s.length||u.some((a,p)=>s[p]!==a)))return i;s=u;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...u),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const a=Math.round((Date.now()-o)*100)/100,p=Math.round((Date.now()-c)*100)/100,g=p/16,d=(h,f)=>{for(h=String(h);h.length<f;)h=" "+h;return h};console.info(`%c⏱ ${d(p,5)} /${d(a,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return i}}function C(e,t,n,s){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:s}}function Nt(e,t,n,s){const i=()=>{var o;return(o=r.getValue())!=null?o:e.options.renderFallbackValue},r={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(s),renderValue:i,getContext:S(()=>[e,n,t,r],(o,u,l,c)=>({table:o,column:u,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),C(e.options,"debugCells"))};return e._features.forEach(o=>{o.createCell==null||o.createCell(r,n,t,e)},{}),r}function Kt(e,t,n,s){var i,r;const u={...e._getDefaultColumnDef(),...t},l=u.accessorKey;let c=(i=(r=u.id)!=null?r:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?i:typeof u.header=="string"?u.header:void 0,a;if(u.accessorFn?a=u.accessorFn:l&&(l.includes(".")?a=g=>{let d=g;for(const f of l.split(".")){var h;d=(h=d)==null?void 0:h[f]}return d}:a=g=>g[u.accessorKey]),!c)throw new Error;let p={id:`${String(c)}`,accessorFn:a,parent:s,depth:n,columnDef:u,columns:[],getFlatColumns:S(()=>[!0],()=>{var g;return[p,...(g=p.columns)==null?void 0:g.flatMap(d=>d.getFlatColumns())]},C(e.options,"debugColumns")),getLeafColumns:S(()=>[e._getOrderColumnsFn()],g=>{var d;if((d=p.columns)!=null&&d.length){let h=p.columns.flatMap(f=>f.getLeafColumns());return g(h)}return[p]},C(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(p,e);return p}const P="debugHeaders";function ke(e,t,n){var s;let r={id:(s=n.id)!=null?s:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],u=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(u),o.push(l)};return u(r),o},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(o=>{o.createHeader==null||o.createHeader(r,e)}),r}const Xt={createTable:e=>{e.getHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,s,i)=>{var r,o;const u=(r=s?.map(p=>n.find(g=>g.id===p)).filter(Boolean))!=null?r:[],l=(o=i?.map(p=>n.find(g=>g.id===p)).filter(Boolean))!=null?o:[],c=n.filter(p=>!(s!=null&&s.includes(p.id))&&!(i!=null&&i.includes(p.id)));return J(t,[...u,...c,...l],e)},C(e.options,P)),e.getCenterHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,s,i)=>(n=n.filter(r=>!(s!=null&&s.includes(r.id))&&!(i!=null&&i.includes(r.id))),J(t,n,e,"center")),C(e.options,P)),e.getLeftHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,s)=>{var i;const r=(i=s?.map(o=>n.find(u=>u.id===o)).filter(Boolean))!=null?i:[];return J(t,r,e,"left")},C(e.options,P)),e.getRightHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,s)=>{var i;const r=(i=s?.map(o=>n.find(u=>u.id===o)).filter(Boolean))!=null?i:[];return J(t,r,e,"right")},C(e.options,P)),e.getFooterGroups=S(()=>[e.getHeaderGroups()],t=>[...t].reverse(),C(e.options,P)),e.getLeftFooterGroups=S(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),C(e.options,P)),e.getCenterFooterGroups=S(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),C(e.options,P)),e.getRightFooterGroups=S(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),C(e.options,P)),e.getFlatHeaders=S(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),C(e.options,P)),e.getLeftFlatHeaders=S(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),C(e.options,P)),e.getCenterFlatHeaders=S(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),C(e.options,P)),e.getRightFlatHeaders=S(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),C(e.options,P)),e.getCenterLeafHeaders=S(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var s;return!((s=n.subHeaders)!=null&&s.length)}),C(e.options,P)),e.getLeftLeafHeaders=S(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var s;return!((s=n.subHeaders)!=null&&s.length)}),C(e.options,P)),e.getRightLeafHeaders=S(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var s;return!((s=n.subHeaders)!=null&&s.length)}),C(e.options,P)),e.getLeafHeaders=S(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,s)=>{var i,r,o,u,l,c;return[...(i=(r=t[0])==null?void 0:r.headers)!=null?i:[],...(o=(u=n[0])==null?void 0:u.headers)!=null?o:[],...(l=(c=s[0])==null?void 0:c.headers)!=null?l:[]].map(a=>a.getLeafHeaders()).flat()},C(e.options,P))}};function J(e,t,n,s){var i,r;let o=0;const u=function(g,d){d===void 0&&(d=1),o=Math.max(o,d),g.filter(h=>h.getIsVisible()).forEach(h=>{var f;(f=h.columns)!=null&&f.length&&u(h.columns,d+1)},0)};u(e);let l=[];const c=(g,d)=>{const h={depth:d,id:[s,`${d}`].filter(Boolean).join("_"),headers:[]},f=[];g.forEach(v=>{const m=[...f].reverse()[0],y=v.column.depth===h.depth;let R,_=!1;if(y&&v.column.parent?R=v.column.parent:(R=v.column,_=!0),m&&m?.column===R)m.subHeaders.push(v);else{const O=ke(n,R,{id:[s,d,R.id,v?.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${f.filter(G=>G.column===R).length}`:void 0,depth:d,index:f.length});O.subHeaders.push(v),f.push(O)}h.headers.push(v),v.headerGroup=h}),l.push(h),d>0&&c(f,d-1)},a=t.map((g,d)=>ke(n,g,{depth:o,index:d}));c(a,o-1),l.reverse();const p=g=>g.filter(h=>h.column.getIsVisible()).map(h=>{let f=0,v=0,m=[0];h.subHeaders&&h.subHeaders.length?(m=[],p(h.subHeaders).forEach(R=>{let{colSpan:_,rowSpan:O}=R;f+=_,m.push(O)})):f=1;const y=Math.min(...m);return v=v+y,h.colSpan=f,h.rowSpan=v,{colSpan:f,rowSpan:v}});return p((i=(r=l[0])==null?void 0:r.headers)!=null?i:[]),l}const Wt=(e,t,n,s,i,r,o)=>{let u={id:t,index:s,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(u._valuesCache.hasOwnProperty(l))return u._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return u._valuesCache[l]=c.accessorFn(u.original,s),u._valuesCache[l]},getUniqueValues:l=>{if(u._uniqueValuesCache.hasOwnProperty(l))return u._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(u._uniqueValuesCache[l]=c.columnDef.getUniqueValues(u.original,s),u._uniqueValuesCache[l]):(u._uniqueValuesCache[l]=[u.getValue(l)],u._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=u.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Bt(u.subRows,l=>l.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let l=[],c=u;for(;;){const a=c.getParentRow();if(!a)break;l.push(a),c=a}return l.reverse()},getAllCells:S(()=>[e.getAllLeafColumns()],l=>l.map(c=>Nt(e,u,c,c.id)),C(e.options,"debugRows")),_getAllCellsByColumnId:S(()=>[u.getAllCells()],l=>l.reduce((c,a)=>(c[a.column.id]=a,c),{}),C(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(u,e)}return u},Jt={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},lt=(e,t,n)=>{var s,i;const r=n==null||(s=n.toString())==null?void 0:s.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(r))};lt.autoRemove=e=>V(e);const at=(e,t,n)=>{var s;return!!(!((s=e.getValue(t))==null||(s=s.toString())==null)&&s.includes(n))};at.autoRemove=e=>V(e);const ct=(e,t,n)=>{var s;return((s=e.getValue(t))==null||(s=s.toString())==null?void 0:s.toLowerCase())===n?.toLowerCase()};ct.autoRemove=e=>V(e);const dt=(e,t,n)=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(n)};dt.autoRemove=e=>V(e);const gt=(e,t,n)=>!n.some(s=>{var i;return!((i=e.getValue(t))!=null&&i.includes(s))});gt.autoRemove=e=>V(e)||!(e!=null&&e.length);const ft=(e,t,n)=>n.some(s=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(s)});ft.autoRemove=e=>V(e)||!(e!=null&&e.length);const ht=(e,t,n)=>e.getValue(t)===n;ht.autoRemove=e=>V(e);const pt=(e,t,n)=>e.getValue(t)==n;pt.autoRemove=e=>V(e);const xe=(e,t,n)=>{let[s,i]=n;const r=e.getValue(t);return r>=s&&r<=i};xe.resolveFilterValue=e=>{let[t,n]=e,s=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,r=t===null||Number.isNaN(s)?-1/0:s,o=n===null||Number.isNaN(i)?1/0:i;if(r>o){const u=r;r=o,o=u}return[r,o]};xe.autoRemove=e=>V(e)||V(e[0])&&V(e[1]);const D={includesString:lt,includesStringSensitive:at,equalsString:ct,arrIncludes:dt,arrIncludesAll:gt,arrIncludesSome:ft,equals:ht,weakEquals:pt,inNumberRange:xe};function V(e){return e==null||e===""}const Zt={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],s=n?.getValue(e.id);return typeof s=="string"?D.includesString:typeof s=="number"?D.inNumberRange:typeof s=="boolean"||s!==null&&typeof s=="object"?D.equals:Array.isArray(s)?D.arrIncludes:D.weakEquals},e.getFilterFn=()=>{var n,s;return se(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(s=t.options.filterFns)==null?void 0:s[e.columnDef.filterFn])!=null?n:D[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,s,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((s=t.options.enableColumnFilters)!=null?s:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(s=>s.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,s;return(n=(s=t.getState().columnFilters)==null?void 0:s.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(s=>{const i=e.getFilterFn(),r=s?.find(a=>a.id===e.id),o=b(n,r?r.value:void 0);if(Ue(i,o,e)){var u;return(u=s?.filter(a=>a.id!==e.id))!=null?u:[]}const l={id:e.id,value:o};if(r){var c;return(c=s?.map(a=>a.id===e.id?l:a))!=null?c:[]}return s!=null&&s.length?[...s,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),s=i=>{var r;return(r=b(t,i))==null?void 0:r.filter(o=>{const u=n.find(l=>l.id===o.id);if(u){const l=u.getFilterFn();if(Ue(l,o.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(s)},e.resetColumnFilters=t=>{var n,s;e.setColumnFilters(t?[]:(n=(s=e.initialState)==null?void 0:s.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ue(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Yt=(e,t,n)=>n.reduce((s,i)=>{const r=i.getValue(e);return s+(typeof r=="number"?r:0)},0),en=(e,t,n)=>{let s;return n.forEach(i=>{const r=i.getValue(e);r!=null&&(s>r||s===void 0&&r>=r)&&(s=r)}),s},tn=(e,t,n)=>{let s;return n.forEach(i=>{const r=i.getValue(e);r!=null&&(s<r||s===void 0&&r>=r)&&(s=r)}),s},nn=(e,t,n)=>{let s,i;return n.forEach(r=>{const o=r.getValue(e);o!=null&&(s===void 0?o>=o&&(s=i=o):(s>o&&(s=o),i<o&&(i=o)))}),[s,i]},sn=(e,t)=>{let n=0,s=0;if(t.forEach(i=>{let r=i.getValue(e);r!=null&&(r=+r)>=r&&(++n,s+=r)}),n)return s/n},rn=(e,t)=>{if(!t.length)return;const n=t.map(r=>r.getValue(e));if(!jt(n))return;if(n.length===1)return n[0];const s=Math.floor(n.length/2),i=n.sort((r,o)=>r-o);return n.length%2!==0?i[s]:(i[s-1]+i[s])/2},on=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),un=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,ln=(e,t)=>t.length,ie={sum:Yt,min:en,max:tn,extent:nn,mean:sn,median:rn,unique:on,uniqueCount:un,count:ln},an={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(s=>s!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,s;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((s=t.options.enableGrouping)!=null?s:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],s=n?.getValue(e.id);if(typeof s=="number")return ie.sum;if(Object.prototype.toString.call(s)==="[object Date]")return ie.extent},e.getAggregationFn=()=>{var n,s;if(!e)throw new Error;return se(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(s=t.options.aggregationFns)==null?void 0:s[e.columnDef.aggregationFn])!=null?n:ie[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,s;e.setGrouping(t?[]:(n=(s=e.initialState)==null?void 0:s.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const s=t.getColumn(n);return s!=null&&s.columnDef.getGroupingValue?(e._groupingValuesCache[n]=s.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,s)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function cn(e,t,n){if(!(t!=null&&t.length)||!n)return e;const s=e.filter(r=>!t.includes(r.id));return n==="remove"?s:[...t.map(r=>e.find(o=>o.id===r)).filter(Boolean),...s]}const dn={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=S(n=>[B(t,n)],n=>n.findIndex(s=>s.id===e.id),C(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var s;return((s=B(t,n)[0])==null?void 0:s.id)===e.id},e.getIsLastColumn=n=>{var s;const i=B(t,n);return((s=i[i.length-1])==null?void 0:s.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=S(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,s)=>i=>{let r=[];if(!(t!=null&&t.length))r=i;else{const o=[...t],u=[...i];for(;u.length&&o.length;){const l=o.shift(),c=u.findIndex(a=>a.id===l);c>-1&&r.push(u.splice(c,1)[0])}r=[...r,...u]}return cn(r,n,s)},C(e.options,"debugTable"))}},re=()=>({left:[],right:[]}),gn={getInitialState:e=>({columnPinning:re(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const s=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var r,o;if(n==="right"){var u,l;return{left:((u=i?.left)!=null?u:[]).filter(p=>!(s!=null&&s.includes(p))),right:[...((l=i?.right)!=null?l:[]).filter(p=>!(s!=null&&s.includes(p))),...s]}}if(n==="left"){var c,a;return{left:[...((c=i?.left)!=null?c:[]).filter(p=>!(s!=null&&s.includes(p))),...s],right:((a=i?.right)!=null?a:[]).filter(p=>!(s!=null&&s.includes(p)))}}return{left:((r=i?.left)!=null?r:[]).filter(p=>!(s!=null&&s.includes(p))),right:((o=i?.right)!=null?o:[]).filter(p=>!(s!=null&&s.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(s=>{var i,r,o;return((i=s.columnDef.enablePinning)!=null?i:!0)&&((r=(o=t.options.enableColumnPinning)!=null?o:t.options.enablePinning)!=null?r:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:s,right:i}=t.getState().columnPinning,r=n.some(u=>s?.includes(u)),o=n.some(u=>i?.includes(u));return r?"left":o?"right":!1},e.getPinnedIndex=()=>{var n,s;const i=e.getIsPinned();return i?(n=(s=t.getState().columnPinning)==null||(s=s[i])==null?void 0:s.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=S(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,s,i)=>{const r=[...s??[],...i??[]];return n.filter(o=>!r.includes(o.column.id))},C(t.options,"debugRows")),e.getLeftVisibleCells=S(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,s)=>(s??[]).map(r=>n.find(o=>o.column.id===r)).filter(Boolean).map(r=>({...r,position:"left"})),C(t.options,"debugRows")),e.getRightVisibleCells=S(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,s)=>(s??[]).map(r=>n.find(o=>o.column.id===r)).filter(Boolean).map(r=>({...r,position:"right"})),C(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,s;return e.setColumnPinning(t?re():(n=(s=e.initialState)==null?void 0:s.columnPinning)!=null?n:re())},e.getIsSomeColumnsPinned=t=>{var n;const s=e.getState().columnPinning;if(!t){var i,r;return!!((i=s.left)!=null&&i.length||(r=s.right)!=null&&r.length)}return!!((n=s[t])!=null&&n.length)},e.getLeftLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(s=>t.find(i=>i.id===s)).filter(Boolean),C(e.options,"debugColumns")),e.getRightLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(s=>t.find(i=>i.id===s)).filter(Boolean),C(e.options,"debugColumns")),e.getCenterLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,s)=>{const i=[...n??[],...s??[]];return t.filter(r=>!i.includes(r.id))},C(e.options,"debugColumns"))}};function fn(e){return e||(typeof document<"u"?document:null)}const Z={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},oe=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),hn={getDefaultColumnDef:()=>Z,getInitialState:e=>({columnSizing:{},columnSizingInfo:oe(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$("columnSizing",e),onColumnSizingInfoChange:$("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,s,i;const r=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Z.minSize,(s=r??e.columnDef.size)!=null?s:Z.size),(i=e.columnDef.maxSize)!=null?i:Z.maxSize)},e.getStart=S(n=>[n,B(t,n),t.getState().columnSizing],(n,s)=>s.slice(0,e.getIndex(n)).reduce((i,r)=>i+r.getSize(),0),C(t.options,"debugColumns")),e.getAfter=S(n=>[n,B(t,n),t.getState().columnSizing],(n,s)=>s.slice(e.getIndex(n)+1).reduce((i,r)=>i+r.getSize(),0),C(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:s,...i}=n;return i})},e.getCanResize=()=>{var n,s;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((s=t.options.enableColumnResizing)!=null?s:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const s=i=>{if(i.subHeaders.length)i.subHeaders.forEach(s);else{var r;n+=(r=i.column.getSize())!=null?r:0}};return s(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const s=t.getColumn(e.column.id),i=s?.getCanResize();return r=>{if(!s||!i||(r.persist==null||r.persist(),ue(r)&&r.touches&&r.touches.length>1))return;const o=e.getSize(),u=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[s.id,s.getSize()]],l=ue(r)?Math.round(r.touches[0].clientX):r.clientX,c={},a=(m,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(R=>{var _,O;const G=t.options.columnResizeDirection==="rtl"?-1:1,I=(y-((_=R?.startOffset)!=null?_:0))*G,x=Math.max(I/((O=R?.startSize)!=null?O:0),-.999999);return R.columnSizingStart.forEach(U=>{let[A,T]=U;c[A]=Math.round(Math.max(T+T*x,0)*100)/100}),{...R,deltaOffset:I,deltaPercentage:x}}),(t.options.columnResizeMode==="onChange"||m==="end")&&t.setColumnSizing(R=>({...R,...c})))},p=m=>a("move",m),g=m=>{a("end",m),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d=fn(n),h={moveHandler:m=>p(m.clientX),upHandler:m=>{d?.removeEventListener("mousemove",h.moveHandler),d?.removeEventListener("mouseup",h.upHandler),g(m.clientX)}},f={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),p(m.touches[0].clientX),!1),upHandler:m=>{var y;d?.removeEventListener("touchmove",f.moveHandler),d?.removeEventListener("touchend",f.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),g((y=m.touches[0])==null?void 0:y.clientX)}},v=pn()?{passive:!1}:!1;ue(r)?(d?.addEventListener("touchmove",f.moveHandler,v),d?.addEventListener("touchend",f.upHandler,v)):(d?.addEventListener("mousemove",h.moveHandler,v),d?.addEventListener("mouseup",h.upHandler,v)),t.setColumnSizingInfo(m=>({...m,startOffset:l,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:s.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?oe():(n=e.initialState.columnSizingInfo)!=null?n:oe())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((s,i)=>s+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((s,i)=>s+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((s,i)=>s+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((s,i)=>s+i.getSize(),0))!=null?t:0}}};let Y=null;function pn(){if(typeof Y=="boolean")return Y;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Y=e,Y}function ue(e){return e.type==="touchstart"}const mn={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(s=>({...s,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,s;const i=e.columns;return(n=i.length?i.some(r=>r.getIsVisible()):(s=t.getState().columnVisibility)==null?void 0:s[e.id])!=null?n:!0},e.getCanHide=()=>{var n,s;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((s=t.options.enableHiding)!=null?s:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=S(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(s=>s.column.getIsVisible()),C(t.options,"debugRows")),e.getVisibleCells=S(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,s,i)=>[...n,...s,...i],C(t.options,"debugRows"))},createTable:e=>{const t=(n,s)=>S(()=>[s(),s().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(r=>r.getIsVisible==null?void 0:r.getIsVisible()),C(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var s;e.setColumnVisibility(n?{}:(s=e.initialState.columnVisibility)!=null?s:{})},e.toggleAllColumnsVisible=n=>{var s;n=(s=n)!=null?s:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,r)=>({...i,[r.id]:n||!(r.getCanHide!=null&&r.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var s;e.toggleAllColumnsVisible((s=n.target)==null?void 0:s.checked)}}};function B(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const vn={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Sn={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const s=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof s=="string"||typeof s=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,s,i,r;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((s=t.options.enableGlobalFilter)!=null?s:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((r=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?r:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>D.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:s}=e.options;return se(s)?s:s==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[s])!=null?t:D[s]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Cn={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var s,i;if(!t){e._queue(()=>{t=!0});return}if((s=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?s:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=s=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(s),e.toggleAllRowsExpanded=s=>{s??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=s=>{var i,r;e.setExpanded(s?{}:(i=(r=e.initialState)==null?void 0:r.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(s=>s.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>s=>{s.persist==null||s.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const s=e.getState().expanded;return s===!0||Object.values(s).some(Boolean)},e.getIsAllRowsExpanded=()=>{const s=e.getState().expanded;return typeof s=="boolean"?s===!0:!(!Object.keys(s).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let s=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(r=>{const o=r.split(".");s=Math.max(s,o.length)}),s},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(s=>{var i;const r=s===!0?!0:!!(s!=null&&s[e.id]);let o={};if(s===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{o[u]=!0}):o=s,n=(i=n)!=null?i:!r,!r&&n)return{...o,[e.id]:!0};if(r&&!n){const{[e.id]:u,...l}=o;return l}return s})},e.getIsExpanded=()=>{var n;const s=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:s===!0||s?.[e.id])},e.getCanExpand=()=>{var n,s,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((s=t.options.enableExpanding)!=null?s:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,s=e;for(;n&&s.parentId;)s=t.getRow(s.parentId,!0),n=s.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Se=0,Ce=10,le=()=>({pageIndex:Se,pageSize:Ce}),yn={getInitialState:e=>({...e,pagination:{...le(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:$("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var s,i;if(!t){e._queue(()=>{t=!0});return}if((s=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?s:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=s=>{const i=r=>b(s,r);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=s=>{var i;e.setPagination(s?le():(i=e.initialState.pagination)!=null?i:le())},e.setPageIndex=s=>{e.setPagination(i=>{let r=b(s,i.pageIndex);const o=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,o)),{...i,pageIndex:r}})},e.resetPageIndex=s=>{var i,r;e.setPageIndex(s?Se:(i=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageIndex)!=null?i:Se)},e.resetPageSize=s=>{var i,r;e.setPageSize(s?Ce:(i=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageSize)!=null?i:Ce)},e.setPageSize=s=>{e.setPagination(i=>{const r=Math.max(1,b(s,i.pageSize)),o=i.pageSize*i.pageIndex,u=Math.floor(o/r);return{...i,pageIndex:u,pageSize:r}})},e.setPageCount=s=>e.setPagination(i=>{var r;let o=b(s,(r=e.options.pageCount)!=null?r:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...i,pageCount:o}}),e.getPageOptions=S(()=>[e.getPageCount()],s=>{let i=[];return s&&s>0&&(i=[...new Array(s)].fill(null).map((r,o)=>o)),i},C(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:s}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:s<i-1},e.previousPage=()=>e.setPageIndex(s=>s-1),e.nextPage=()=>e.setPageIndex(s=>s+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var s;return(s=e.options.pageCount)!=null?s:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var s;return(s=e.options.rowCount)!=null?s:e.getPrePaginationRowModel().rows.length}}},ae=()=>({top:[],bottom:[]}),Rn={getInitialState:e=>({rowPinning:ae(),...e}),getDefaultOptions:e=>({onRowPinningChange:$("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,s,i)=>{const r=s?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],o=i?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],u=new Set([...o,e.id,...r]);t.setRowPinning(l=>{var c,a;if(n==="bottom"){var p,g;return{top:((p=l?.top)!=null?p:[]).filter(f=>!(u!=null&&u.has(f))),bottom:[...((g=l?.bottom)!=null?g:[]).filter(f=>!(u!=null&&u.has(f))),...Array.from(u)]}}if(n==="top"){var d,h;return{top:[...((d=l?.top)!=null?d:[]).filter(f=>!(u!=null&&u.has(f))),...Array.from(u)],bottom:((h=l?.bottom)!=null?h:[]).filter(f=>!(u!=null&&u.has(f)))}}return{top:((c=l?.top)!=null?c:[]).filter(f=>!(u!=null&&u.has(f))),bottom:((a=l?.bottom)!=null?a:[]).filter(f=>!(u!=null&&u.has(f)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:s,enablePinning:i}=t.options;return typeof s=="function"?s(e):(n=s??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:s,bottom:i}=t.getState().rowPinning,r=n.some(u=>s?.includes(u)),o=n.some(u=>i?.includes(u));return r?"top":o?"bottom":!1},e.getPinnedIndex=()=>{var n,s;const i=e.getIsPinned();if(!i)return-1;const r=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(o=>{let{id:u}=o;return u});return(s=r?.indexOf(e.id))!=null?s:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,s;return e.setRowPinning(t?ae():(n=(s=e.initialState)==null?void 0:s.rowPinning)!=null?n:ae())},e.getIsSomeRowsPinned=t=>{var n;const s=e.getState().rowPinning;if(!t){var i,r;return!!((i=s.top)!=null&&i.length||(r=s.bottom)!=null&&r.length)}return!!((n=s[t])!=null&&n.length)},e._getPinnedRows=(t,n,s)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(o=>{const u=e.getRow(o,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(o=>t.find(u=>u.id===o))).filter(Boolean).map(o=>({...o,position:s}))},e.getTopRows=S(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),C(e.options,"debugRows")),e.getBottomRows=S(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),C(e.options,"debugRows")),e.getCenterRows=S(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,s)=>{const i=new Set([...n??[],...s??[]]);return t.filter(r=>!i.has(r.id))},C(e.options,"debugRows"))}},wn={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const s={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(r=>{r.getCanSelect()&&(s[r.id]=!0)}):i.forEach(r=>{delete s[r.id]}),s})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const s=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(r=>{ye(i,r.id,s,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=S(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?ce(e,n):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getFilteredSelectedRowModel=S(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?ce(e,n):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getGroupedSelectedRowModel=S(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?ce(e,n):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let s=!!(t.length&&Object.keys(n).length);return s&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(s=!1),s},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let s=!!t.length;return s&&t.some(i=>!n[i.id])&&(s=!1),s},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,s)=>{const i=e.getIsSelected();t.setRowSelection(r=>{var o;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return r;const u={...r};return ye(u,e.id,n,(o=s?.selectChildren)!=null?o:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Ie(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Re(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Re(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return s=>{var i;n&&e.toggleSelected((i=s.target)==null?void 0:i.checked)}}}},ye=(e,t,n,s,i)=>{var r;const o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),o.getCanSelect()&&(e[t]=!0)):delete e[t],s&&(r=o.subRows)!=null&&r.length&&o.getCanSelectSubRows()&&o.subRows.forEach(u=>ye(e,u.id,n,s,i))};function ce(e,t){const n=e.getState().rowSelection,s=[],i={},r=function(o,u){return o.map(l=>{var c;const a=Ie(l,n);if(a&&(s.push(l),i[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:r(l.subRows)}),a)return l}).filter(Boolean)};return{rows:r(t.rows),flatRows:s,rowsById:i}}function Ie(e,t){var n;return(n=t[e.id])!=null?n:!1}function Re(e,t,n){var s;if(!((s=e.subRows)!=null&&s.length))return!1;let i=!0,r=!1;return e.subRows.forEach(o=>{if(!(r&&!i)&&(o.getCanSelect()&&(Ie(o,t)?r=!0:i=!1),o.subRows&&o.subRows.length)){const u=Re(o,t);u==="all"?r=!0:(u==="some"&&(r=!0),i=!1)}}),i?"all":r?"some":!1}const we=/([0-9]+)/gm,Fn=(e,t,n)=>mt(L(e.getValue(n)).toLowerCase(),L(t.getValue(n)).toLowerCase()),_n=(e,t,n)=>mt(L(e.getValue(n)),L(t.getValue(n))),Pn=(e,t,n)=>$e(L(e.getValue(n)).toLowerCase(),L(t.getValue(n)).toLowerCase()),Mn=(e,t,n)=>$e(L(e.getValue(n)),L(t.getValue(n))),On=(e,t,n)=>{const s=e.getValue(n),i=t.getValue(n);return s>i?1:s<i?-1:0},xn=(e,t,n)=>$e(e.getValue(n),t.getValue(n));function $e(e,t){return e===t?0:e>t?1:-1}function L(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function mt(e,t){const n=e.split(we).filter(Boolean),s=t.split(we).filter(Boolean);for(;n.length&&s.length;){const i=n.shift(),r=s.shift(),o=parseInt(i,10),u=parseInt(r,10),l=[o,u].sort();if(isNaN(l[0])){if(i>r)return 1;if(r>i)return-1;continue}if(isNaN(l[1]))return isNaN(o)?-1:1;if(o>u)return 1;if(u>o)return-1}return n.length-s.length}const j={alphanumeric:Fn,alphanumericCaseSensitive:_n,text:Pn,textCaseSensitive:Mn,datetime:On,basic:xn},In={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let s=!1;for(const i of n){const r=i?.getValue(e.id);if(Object.prototype.toString.call(r)==="[object Date]")return j.datetime;if(typeof r=="string"&&(s=!0,r.split(we).length>1))return j.alphanumeric}return s?j.text:j.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,s;if(!e)throw new Error;return se(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(s=t.options.sortingFns)==null?void 0:s[e.columnDef.sortingFn])!=null?n:j[e.columnDef.sortingFn]},e.toggleSorting=(n,s)=>{const i=e.getNextSortingOrder(),r=typeof n<"u"&&n!==null;t.setSorting(o=>{const u=o?.find(d=>d.id===e.id),l=o?.findIndex(d=>d.id===e.id);let c=[],a,p=r?n:i==="desc";if(o!=null&&o.length&&e.getCanMultiSort()&&s?u?a="toggle":a="add":o!=null&&o.length&&l!==o.length-1?a="replace":u?a="toggle":a="replace",a==="toggle"&&(r||i||(a="remove")),a==="add"){var g;c=[...o,{id:e.id,desc:p}],c.splice(0,c.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else a==="toggle"?c=o.map(d=>d.id===e.id?{...d,desc:p}:d):a==="remove"?c=o.filter(d=>d.id!==e.id):c=[{id:e.id,desc:p}];return c})},e.getFirstSortDir=()=>{var n,s;return((n=(s=e.columnDef.sortDescFirst)!=null?s:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var s,i;const r=e.getFirstSortDir(),o=e.getIsSorted();return o?o!==r&&((s=t.options.enableSortingRemoval)==null||s)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:o==="desc"?"asc":"desc":r},e.getCanSort=()=>{var n,s;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((s=t.options.enableSorting)!=null?s:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,s;return(n=(s=e.columnDef.enableMultiSort)!=null?s:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const s=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return s?s.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,s;return(n=(s=t.getState().sorting)==null?void 0:s.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(s=>s.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return s=>{n&&(s.persist==null||s.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(s):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,s;e.setSorting(t?[]:(n=(s=e.initialState)==null?void 0:s.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},$n=[Xt,mn,dn,gn,Jt,Zt,vn,Sn,In,an,Cn,yn,Rn,wn,hn];function En(e){var t,n;const s=[...$n,...(t=e._features)!=null?t:[]];let i={_features:s};const r=i._features.reduce((g,d)=>Object.assign(g,d.getDefaultOptions==null?void 0:d.getDefaultOptions(i)),{}),o=g=>i.options.mergeOptions?i.options.mergeOptions(r,g):{...r,...g};let l={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(g=>{var d;l=(d=g.getInitialState==null?void 0:g.getInitialState(l))!=null?d:l});const c=[];let a=!1;const p={_features:s,options:{...r,...e},initialState:l,_queue:g=>{c.push(g),a||(a=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();a=!1}).catch(d=>setTimeout(()=>{throw d})))},reset:()=>{i.setState(i.initialState)},setOptions:g=>{const d=b(g,i.options);i.options=o(d)},getState:()=>i.options.state,setState:g=>{i.options.onStateChange==null||i.options.onStateChange(g)},_getRowId:(g,d,h)=>{var f;return(f=i.options.getRowId==null?void 0:i.options.getRowId(g,d,h))!=null?f:`${h?[h.id,d].join("."):d}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(g,d)=>{let h=(d?i.getPrePaginationRowModel():i.getRowModel()).rowsById[g];if(!h&&(h=i.getCoreRowModel().rowsById[g],!h))throw new Error;return h},_getDefaultColumnDef:S(()=>[i.options.defaultColumn],g=>{var d;return g=(d=g)!=null?d:{},{header:h=>{const f=h.header.column.columnDef;return f.accessorKey?f.accessorKey:f.accessorFn?f.id:null},cell:h=>{var f,v;return(f=(v=h.renderValue())==null||v.toString==null?void 0:v.toString())!=null?f:null},...i._features.reduce((h,f)=>Object.assign(h,f.getDefaultColumnDef==null?void 0:f.getDefaultColumnDef()),{}),...g}},C(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:S(()=>[i._getColumnDefs()],g=>{const d=function(h,f,v){return v===void 0&&(v=0),h.map(m=>{const y=Kt(i,m,v,f),R=m;return y.columns=R.columns?d(R.columns,y,v+1):[],y})};return d(g)},C(e,"debugColumns")),getAllFlatColumns:S(()=>[i.getAllColumns()],g=>g.flatMap(d=>d.getFlatColumns()),C(e,"debugColumns")),_getAllFlatColumnsById:S(()=>[i.getAllFlatColumns()],g=>g.reduce((d,h)=>(d[h.id]=h,d),{}),C(e,"debugColumns")),getAllLeafColumns:S(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(g,d)=>{let h=g.flatMap(f=>f.getLeafColumns());return d(h)},C(e,"debugColumns")),getColumn:g=>i._getAllFlatColumnsById()[g]};Object.assign(i,p);for(let g=0;g<i._features.length;g++){const d=i._features[g];d==null||d.createTable==null||d.createTable(i)}return i}function Un(){return e=>S(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},s=function(i,r,o){r===void 0&&(r=0);const u=[];for(let c=0;c<i.length;c++){const a=Wt(e,e._getRowId(i[c],c,o),i[c],c,r,void 0,o?.id);if(n.flatRows.push(a),n.rowsById[a.id]=a,u.push(a),e.options.getSubRows){var l;a.originalSubRows=e.options.getSubRows(i[c],c),(l=a.originalSubRows)!=null&&l.length&&(a.subRows=s(a.originalSubRows,r+1,a))}}return u};return n.rows=s(t),n},C(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function jn(e,t){return e?Vn(e)?w.createElement(e,t):e:null}function Vn(e){return Dn(e)||typeof e=="function"||An(e)}function Dn(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function An(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Bn(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=w.useState(()=>({current:En(t)})),[s,i]=w.useState(()=>n.current.initialState);return n.current.setOptions(r=>({...r,...e,state:{...s,...e.state},onStateChange:o=>{i(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}export{Gn as Q,X as a,kn as b,zn as c,Tn as d,Bn as e,jn as f,Un as g,qn as h,Ln as k,Qn as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{L,r as c}from"./react-vendor-CNOkPC89.js";import{a as x,B as P,c as S,W as M,d as u,x as U,C,j as v,k as N,_ as w,b as j,n as b,I as B}from"./index-ubH9RpKo.js";import{a1 as F,$ as z,b8 as W,x as H,E as Q,Q as G,aa as K,C as q,b9 as J,av as V}from"./icons-DyorC3Xk.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const Y={new:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-300",stable:"border-green-200 bg-green-50 text-green-700 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-300",planned:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/50 dark:bg-amber-900/20 dark:text-amber-300"};function Z({status:s,className:t}){const{t:r}=x(),i={new:r("updates.statusNew"),stable:r("updates.statusStable"),planned:r("updates.statusPlanned")};return e.jsx(P,{variant:"outline",className:S("font-medium",Y[s],t),children:i[s]})}const g={target:"Target CLI",cliproxy:"CLIProxy Provider","api-profiles":"API Profile",websearch:"WebSearch"},X=[{id:"codex-target-runtime-support",title:"Native Codex runtime support is live",summary:"Codex now participates as a first-class runtime target through ccs-codex, ccsx, ccsxp, or --target codex.",primaryAction:"Use Codex as a runtime target for native Codex sessions and Codex-routed CLIProxy flows.",publishedAt:"2026-03-28",status:"new",scopes:["target","cliproxy","api-profiles"],entryIds:["codex-target","codex-cliproxy"],highlights:["Use ccs-codex or ccsx for native Codex runs.","Use ccsxp for native Codex with the cliproxy provider shortcut.","Use ccs codex --target codex when you want the explicit CCS-managed Codex bridge.","Codex remains runtime-only for saved defaults; use runtime aliases or --target codex at launch time."],actions:[{id:"copy-codex-alias-command",label:"Open native Codex",description:"Launch Codex through the explicit CCS runtime alias.",type:"command",command:"ccs-codex"},{id:"copy-codex-provider-command",label:"Run native Codex with cliproxy",description:"Use the native Codex cliproxy shortcut through CCS.",type:"command",command:'ccsxp "your prompt"'},{id:"copy-codex-provider-command-explicit",label:"Run the managed Codex bridge explicitly",description:"Use the explicit CCS-managed Codex bridge on native Codex.",type:"command",command:'ccs codex --target codex "your prompt"'},{id:"open-codex-dashboard",label:"Open Codex dashboard",description:"Review Codex runtime support, config layers, and dashboard setup flows.",type:"route",path:"/codex"}],routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx",'ccsxp "your prompt"','ccs codex --target codex "your prompt"']},{id:"droid-target-support",title:"Factory Droid support is live",summary:"API Profiles and CLIProxy variants now support Droid as a first-class execution target.",primaryAction:"Set Droid as your default execution target for non-Claude workflows.",publishedAt:"2026-02-25",status:"new",scopes:["target","api-profiles","cliproxy"],entryIds:["droid-target","custom-api-profiles","codex-cliproxy","agy-cliproxy"],highlights:["Set default target to Droid when creating or editing API Profiles.","Set default target to Droid for CLIProxy variants, including Codex and Antigravity flows.","Use ccs-droid as the explicit alias, with ccsd kept as the legacy shortcut."],actions:[{id:"open-api-profiles",label:"Set default target in API Profiles",description:"Open API Profiles and set Default Target to Droid for profiles you run often.",type:"route",path:"/providers"},{id:"open-cliproxy",label:"Set default target in CLIProxy variants",description:"Open CLIProxy variants and set target to Droid for Codex/Antigravity or custom variants.",type:"route",path:"/cliproxy"},{id:"copy-ccs-droid-command",label:"Run once with explicit Droid alias",description:"Use ccs-droid to force the Droid target with your current profile.",type:"command",command:"ccs-droid glm"},{id:"copy-target-override",label:"Run once with --target override",description:"Keep your default profile but force Droid for a single command.",type:"command",command:'ccs codex --target droid "your prompt"'}],routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm",'ccs codex --target droid "your prompt"',"ccs cliproxy create mycodex --provider codex --target droid"]},{id:"updates-center-launch",title:"Updates Center is available for rollout tasks",summary:"A focused Updates Center exists for setup tasks and rollout guidance when you need it.",primaryAction:"Use this page only when needed for rollout tasks, then return to your normal workflow.",publishedAt:"2026-02-25",status:"new",scopes:["target","cliproxy","api-profiles","websearch"],entryIds:["droid-target","codex-cliproxy","custom-api-profiles","opencode-websearch"],highlights:["Single data source powers update content and integration mapping.","Notices can be tracked as new, seen, done, or dismissed.","Catalog covers target CLI, CLIProxy providers, and WebSearch integrations."],actions:[{id:"open-updates-page",label:"Open Updates Center when needed",description:"Review rollout tasks only when you want guided setup changes.",type:"route",path:"/updates"},{id:"copy-open-dashboard",label:"Open dashboard from terminal",description:"Re-open config dashboard anytime from CLI.",type:"command",command:"ccs config"}],routes:[{label:"Updates Center",path:"/updates"}],commands:["ccs config"]}],ee=[{id:"claude-target",name:"Claude Code",scope:"target",status:"stable",summary:"Default runtime target for all CCS profile types.",pillars:{baseUrl:"From profile settings (ANTHROPIC_BASE_URL)",auth:"From profile settings (ANTHROPIC_AUTH_TOKEN)",model:"From profile settings (ANTHROPIC_MODEL)"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs",'ccs glm "your prompt"']},{id:"droid-target",name:"Factory Droid",scope:"target",status:"new",summary:"First-class target for API Profiles and CLIProxy variants.",pillars:{baseUrl:"From profile or variant settings",auth:"From profile or variant settings",model:"From profile or variant settings"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm","ccs km --target droid","ccs codex --target droid"],notes:"Use ccs-droid as the explicit runtime alias. Legacy ccsd still works."},{id:"codex-target",name:"Codex CLI",scope:"target",status:"new",summary:"First-class runtime target for native Codex sessions and Codex-routed CLIProxy flows.",pillars:{baseUrl:"Native ~/.codex config for default mode, transient -c overrides for CCS-backed routes",auth:"Native Codex auth for default mode, env_key injection for CCS-backed routes",model:"Native Codex config or routed Codex model mapping from CLIProxy"},routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx","ccs codex --target codex","ccs codex-api --target codex"],notes:"Codex is still runtime-only for saved defaults; use --target codex or the runtime aliases at launch time."},{id:"codex-cliproxy",name:"Codex via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed provider with configurable variant model and a native Codex shortcut.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:['ccsxp "your prompt"',"ccs codex --target codex","ccs codex","ccs cliproxy create mycodex --provider codex","ccs api create codex-api --cliproxy-provider codex"],notes:"Use ccsxp when you want native Codex with the cliproxy shortcut; use ccs codex --target codex for the explicit managed bridge."},{id:"gemini-cliproxy",name:"Gemini via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Gemini provider with multi-account management.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs gemini","ccs cliproxy create mygem --provider gemini"]},{id:"agy-cliproxy",name:"Antigravity via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Antigravity provider with variant target controls.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs agy","ccs cliproxy create myagy --provider agy --target droid"]},{id:"custom-api-profiles",name:"Custom API Profiles",scope:"api-profiles",status:"stable",summary:"Any Anthropic-compatible endpoint with per-profile target and model mapping.",pillars:{baseUrl:"User-defined endpoint",auth:"User-defined token/key",model:"User-defined model identifier"},routes:[{label:"API Profiles",path:"/providers"}],commands:["ccs api create myprofile",'ccs myprofile "your prompt"']},{id:"opencode-websearch",name:"OpenCode WebSearch",scope:"websearch",status:"stable",summary:"WebSearch provider surfaced in Settings for third-party profile workflows.",pillars:{baseUrl:"Managed by OpenCode CLI integration",auth:"Provider-specific (managed externally)",model:"Configurable in WebSearch settings"},routes:[{label:"Settings",path:"/settings"}],commands:["ccs config",'ccs codex "your prompt"'],notes:"Enable OpenCode in Settings > WebSearch to activate fallback search."}];function l(s,t,r){return M.t(s,{defaultValue:t,...r})}function se(){return{target:l("supportCatalog.scope.target",g.target),cliproxy:l("supportCatalog.scope.cliproxy",g.cliproxy),"api-profiles":l("supportCatalog.scope.apiProfiles",g["api-profiles"]),websearch:l("supportCatalog.scope.websearch",g.websearch)}}function te(s){return{...s,title:l(`supportCatalog.notice.${s.id}.title`,s.title),summary:l(`supportCatalog.notice.${s.id}.summary`,s.summary),primaryAction:l(`supportCatalog.notice.${s.id}.primaryAction`,s.primaryAction),highlights:s.highlights.map((t,r)=>l(`supportCatalog.notice.${s.id}.highlight.${r}`,t)),actions:s.actions.map(t=>({...t,label:l(`supportCatalog.notice.${s.id}.action.${t.id}.label`,t.label),description:l(`supportCatalog.notice.${s.id}.action.${t.id}.description`,t.description)})),routes:s.routes.map((t,r)=>({...t,label:l(`supportCatalog.notice.${s.id}.route.${r}.label`,t.label)}))}}function re(s){return{...s,name:l(`supportCatalog.entry.${s.id}.name`,s.name),summary:l(`supportCatalog.entry.${s.id}.summary`,s.summary),pillars:{baseUrl:l(`supportCatalog.entry.${s.id}.pillar.baseUrl`,s.pillars.baseUrl),auth:l(`supportCatalog.entry.${s.id}.pillar.auth`,s.pillars.auth),model:l(`supportCatalog.entry.${s.id}.pillar.model`,s.pillars.model)},routes:s.routes.map((t,r)=>({...t,label:l(`supportCatalog.entry.${s.id}.route.${r}.label`,t.label)})),notes:s.notes?l(`supportCatalog.entry.${s.id}.notes`,s.notes):s.notes}}function ae(){return X.map(te)}function oe(){return ee.map(re)}function ie(s){const t=new Map(oe().map(r=>[r.id,r]));return s.entryIds.map(r=>t.get(r)).filter(r=>!!r)}function O(s){const t=new Date(`${s}T00:00:00Z`);return Number.isNaN(t.getTime())?s:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}).format(t)}const $="ccs:updates:notice-progress:v1";function de(s){return s==="new"?"new":"seen"}function m(s,t){return t[s.id]??de(s.status)}function A(s){return s!=="done"&&s!=="dismissed"}function le(){if(typeof window>"u")return{};try{const s=window.localStorage.getItem($);if(!s)return{};const t=JSON.parse(s);if(!t||typeof t!="object"||Array.isArray(t))return{};const r={};for(const[i,d]of Object.entries(t))typeof i=="string"&&(d==="new"||d==="seen"||d==="done"||d==="dismissed")&&(r[i]=d);return r}catch{return{}}}function ne(s){typeof window>"u"||window.localStorage.setItem($,JSON.stringify(s))}function D({state:s,className:t}){const{t:r}=x(),i={new:{label:r("updates.progressNeedsAction"),className:"border-amber-300/70 bg-amber-100/70 text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/15 dark:text-amber-300",showDot:!0},seen:{label:r("updates.progressInReview"),className:"border-blue-300/70 bg-blue-100/70 text-blue-800 dark:border-blue-500/40 dark:bg-blue-500/15 dark:text-blue-300"},done:{label:r("updates.progressDone"),className:"border-emerald-300/70 bg-emerald-100/70 text-emerald-800 dark:border-emerald-500/40 dark:bg-emerald-500/15 dark:text-emerald-300"},dismissed:{label:r("updates.progressDismissed"),className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}}[s];return e.jsxs(P,{variant:"outline",className:S("gap-1.5 border text-[10px] font-medium",i.className,t),children:[i.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),i.label]})}function ce({action:s}){const{t}=x();return e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-0.5",children:[e.jsx("p",{className:"text-sm font-medium",children:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]}),s.type==="route"&&s.path&&e.jsx(u,{size:"sm",asChild:!0,children:e.jsxs(L,{to:s.path,children:[t("updates.open"),e.jsx(F,{className:"h-3.5 w-3.5"})]})})]}),s.type==="command"&&s.command&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-md border bg-background px-2 py-1.5",children:[e.jsx(z,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",children:s.command}),e.jsx(U,{value:s.command})]})]})}function pe({notice:s,progress:t,relatedEntries:r,onUpdateProgress:i}){const{t:d}=x(),f=se();return s?e.jsxs("div",{className:"flex-1 min-w-0 bg-background grid grid-rows-[auto_minmax(0,1fr)] overflow-hidden",children:[e.jsxs("div",{className:"border-b bg-background px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("h2",{className:"text-base font-semibold leading-tight",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.summary})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t&&e.jsx(D,{state:t}),e.jsx(Z,{status:s.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:d("updates.published",{date:O(s.publishedAt)})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(u,{size:"sm",onClick:()=>i("done"),children:[e.jsx(H,{className:"h-4 w-4"}),d("updates.markDone")]}),e.jsxs(u,{size:"sm",variant:"outline",onClick:()=>i("dismissed"),children:[e.jsx(Q,{className:"h-4 w-4"}),d("updates.dismiss")]}),e.jsxs(u,{size:"sm",variant:"ghost",onClick:()=>i("new"),children:[e.jsx(G,{className:"h-4 w-4"}),d("updates.reopen")]})]})]}),e.jsx("div",{className:"min-h-0 p-4",children:e.jsxs("div",{className:"grid h-full gap-4 xl:grid-cols-[minmax(0,1.5fr)_minmax(320px,1fr)] overflow-hidden",children:[e.jsxs(C,{className:"h-full overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(K,{className:"h-4 w-4 text-primary"}),e.jsx(N,{className:"text-base",children:d("updates.doNext")})]}),e.jsx(w,{children:s.primaryAction})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:s.actions.map(o=>e.jsx(ce,{action:o},`${s.id}-${o.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(C,{className:"overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:d("updates.impactedIntegrations")}),e.jsx(w,{children:d("updates.impactedDesc")})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:r.map(o=>e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"min-w-0 truncate text-sm font-medium",children:o.name}),e.jsx(P,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:f[o.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[o.routes[0]&&e.jsx(u,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(L,{to:o.routes[0].path,children:o.routes[0].label})}),o.commands[0]&&e.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-1.5",children:[e.jsx("code",{className:"truncate rounded bg-background px-1.5 py-0.5 text-[11px]",children:o.commands[0]}),e.jsx(U,{value:o.commands[0]})]})]})]},o.id))})})})]}),e.jsxs(C,{className:"overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:d("updates.whyMatters")}),e.jsx(w,{children:d("updates.whyMattersDesc")})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:s.highlights.map(o=>e.jsxs("li",{children:["- ",o]},`${s.id}-${o}`))})})})]})]})]})})]}):e.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-6",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:d("updates.noUpdates")})})}function me({notice:s,progress:t,selected:r,onSelect:i}){return e.jsxs("button",{type:"button",onClick:i,className:S("w-full rounded-lg border px-3 py-3 text-left transition-colors",r?"border-primary/30 bg-primary/10":"border-transparent bg-background/40 hover:border-border hover:bg-muted/70"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:s.primaryAction})]}),e.jsx(q,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:O(s.publishedAt)}),e.jsx(D,{state:t})]})]})}function ue(s,t){return t?[s.title,s.summary,s.primaryAction,...s.highlights,...s.commands,...s.actions.map(i=>`${i.label} ${i.description} ${i.command||""}`),...s.routes.map(i=>i.label)].join(" ").toLowerCase().includes(t):!0}function je(){const{t:s}=x(),t=[...ae()].sort((a,n)=>n.publishedAt.localeCompare(a.publishedAt)),[r,i]=c.useState("inbox"),[d,f]=c.useState(""),[o,k]=c.useState(()=>le()),[I,E]=c.useState(null);c.useEffect(()=>{ne(o)},[o]);const h=c.useMemo(()=>{const a=d.trim().toLowerCase();return t.filter(n=>{const y=m(n,o);return ue(n,a)?r==="done"?y==="done":r==="inbox"?A(y):!0:!1})},[t,o,d,r]),p=c.useMemo(()=>{const a=r==="all"?t:h;return a.find(n=>n.id===I)??a[0]??null},[t,I,r,h]),R=a=>{E(a.id),k(n=>m(a,n)!=="new"?n:{...n,[a.id]:"seen"})},T=c.useMemo(()=>t.filter(a=>A(m(a,o))).length,[t,o]),_=c.useMemo(()=>t.filter(a=>m(a,o)==="done").length,[t,o]);return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r bg-muted/30 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("updates.inboxTitle")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("updates.inboxSubtitle")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:s("updates.needsAction")}),e.jsx("p",{className:"text-base font-semibold",children:T})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:s("updates.doneCount")}),e.jsx("p",{className:"text-base font-semibold",children:_})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(V,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(B,{value:d,onChange:a=>f(a.target.value),placeholder:s("updates.searchPlaceholder"),className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:[{id:"inbox",label:s("updates.actionRequired")},{id:"done",label:s("updates.done")},{id:"all",label:s("updates.all")}].map(a=>e.jsx(u,{size:"sm",variant:r===a.id?"default":"outline",onClick:()=>i(a.id),children:a.label},a.id))})]}),e.jsx(b,{className:"flex-1",children:e.jsx("div",{className:"space-y-2 p-2",children:h.length===0?e.jsx("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:s("updates.noNotices")}):h.map(a=>e.jsx(me,{notice:a,progress:m(a,o),selected:p?.id===a.id,onSelect:()=>R(a)},a.id))})})]}),e.jsx(pe,{notice:p,progress:p?m(p,o):null,relatedEntries:p?ie(p):[],onUpdateProgress:a=>{p&&k(n=>({...n,[p.id]:a}))}})]})}export{je as UpdatesPage};
|
|
1
|
+
import{j as e}from"./radix-ui-nu4wz29m.js";import{L,r as c}from"./react-vendor-Bjx91N7w.js";import{a as x,B as P,c as S,W as M,d as u,x as U,C,j as v,k as N,_ as w,b as j,n as b,I as B}from"./index-Fd17BSGq.js";import{a1 as F,$ as z,b8 as W,x as H,E as Q,Q as G,aa as K,C as q,b9 as J,av as V}from"./icons-DQFHtVq5.js";import"./tanstack-bhJxV1h8.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";const Y={new:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-300",stable:"border-green-200 bg-green-50 text-green-700 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-300",planned:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/50 dark:bg-amber-900/20 dark:text-amber-300"};function Z({status:s,className:t}){const{t:r}=x(),i={new:r("updates.statusNew"),stable:r("updates.statusStable"),planned:r("updates.statusPlanned")};return e.jsx(P,{variant:"outline",className:S("font-medium",Y[s],t),children:i[s]})}const g={target:"Target CLI",cliproxy:"CLIProxy Provider","api-profiles":"API Profile",websearch:"WebSearch"},X=[{id:"codex-target-runtime-support",title:"Native Codex runtime support is live",summary:"Codex now participates as a first-class runtime target through ccs-codex, ccsx, ccsxp, or --target codex.",primaryAction:"Use Codex as a runtime target for native Codex sessions and Codex-routed CLIProxy flows.",publishedAt:"2026-03-28",status:"new",scopes:["target","cliproxy","api-profiles"],entryIds:["codex-target","codex-cliproxy"],highlights:["Use ccs-codex or ccsx for native Codex runs.","Use ccsxp for native Codex with the cliproxy provider shortcut.","Use ccs codex --target codex when you want the explicit CCS-managed Codex bridge.","Codex remains runtime-only for saved defaults; use runtime aliases or --target codex at launch time."],actions:[{id:"copy-codex-alias-command",label:"Open native Codex",description:"Launch Codex through the explicit CCS runtime alias.",type:"command",command:"ccs-codex"},{id:"copy-codex-provider-command",label:"Run native Codex with cliproxy",description:"Use the native Codex cliproxy shortcut through CCS.",type:"command",command:'ccsxp "your prompt"'},{id:"copy-codex-provider-command-explicit",label:"Run the managed Codex bridge explicitly",description:"Use the explicit CCS-managed Codex bridge on native Codex.",type:"command",command:'ccs codex --target codex "your prompt"'},{id:"open-codex-dashboard",label:"Open Codex dashboard",description:"Review Codex runtime support, config layers, and dashboard setup flows.",type:"route",path:"/codex"}],routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx",'ccsxp "your prompt"','ccs codex --target codex "your prompt"']},{id:"droid-target-support",title:"Factory Droid support is live",summary:"API Profiles and CLIProxy variants now support Droid as a first-class execution target.",primaryAction:"Set Droid as your default execution target for non-Claude workflows.",publishedAt:"2026-02-25",status:"new",scopes:["target","api-profiles","cliproxy"],entryIds:["droid-target","custom-api-profiles","codex-cliproxy","agy-cliproxy"],highlights:["Set default target to Droid when creating or editing API Profiles.","Set default target to Droid for CLIProxy variants, including Codex and Antigravity flows.","Use ccs-droid as the explicit alias, with ccsd kept as the legacy shortcut."],actions:[{id:"open-api-profiles",label:"Set default target in API Profiles",description:"Open API Profiles and set Default Target to Droid for profiles you run often.",type:"route",path:"/providers"},{id:"open-cliproxy",label:"Set default target in CLIProxy variants",description:"Open CLIProxy variants and set target to Droid for Codex/Antigravity or custom variants.",type:"route",path:"/cliproxy"},{id:"copy-ccs-droid-command",label:"Run once with explicit Droid alias",description:"Use ccs-droid to force the Droid target with your current profile.",type:"command",command:"ccs-droid glm"},{id:"copy-target-override",label:"Run once with --target override",description:"Keep your default profile but force Droid for a single command.",type:"command",command:'ccs codex --target droid "your prompt"'}],routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm",'ccs codex --target droid "your prompt"',"ccs cliproxy create mycodex --provider codex --target droid"]},{id:"updates-center-launch",title:"Updates Center is available for rollout tasks",summary:"A focused Updates Center exists for setup tasks and rollout guidance when you need it.",primaryAction:"Use this page only when needed for rollout tasks, then return to your normal workflow.",publishedAt:"2026-02-25",status:"new",scopes:["target","cliproxy","api-profiles","websearch"],entryIds:["droid-target","codex-cliproxy","custom-api-profiles","opencode-websearch"],highlights:["Single data source powers update content and integration mapping.","Notices can be tracked as new, seen, done, or dismissed.","Catalog covers target CLI, CLIProxy providers, and WebSearch integrations."],actions:[{id:"open-updates-page",label:"Open Updates Center when needed",description:"Review rollout tasks only when you want guided setup changes.",type:"route",path:"/updates"},{id:"copy-open-dashboard",label:"Open dashboard from terminal",description:"Re-open config dashboard anytime from CLI.",type:"command",command:"ccs config"}],routes:[{label:"Updates Center",path:"/updates"}],commands:["ccs config"]}],ee=[{id:"claude-target",name:"Claude Code",scope:"target",status:"stable",summary:"Default runtime target for all CCS profile types.",pillars:{baseUrl:"From profile settings (ANTHROPIC_BASE_URL)",auth:"From profile settings (ANTHROPIC_AUTH_TOKEN)",model:"From profile settings (ANTHROPIC_MODEL)"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs",'ccs glm "your prompt"']},{id:"droid-target",name:"Factory Droid",scope:"target",status:"new",summary:"First-class target for API Profiles and CLIProxy variants.",pillars:{baseUrl:"From profile or variant settings",auth:"From profile or variant settings",model:"From profile or variant settings"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm","ccs km --target droid","ccs codex --target droid"],notes:"Use ccs-droid as the explicit runtime alias. Legacy ccsd still works."},{id:"codex-target",name:"Codex CLI",scope:"target",status:"new",summary:"First-class runtime target for native Codex sessions and Codex-routed CLIProxy flows.",pillars:{baseUrl:"Native ~/.codex config for default mode, transient -c overrides for CCS-backed routes",auth:"Native Codex auth for default mode, env_key injection for CCS-backed routes",model:"Native Codex config or routed Codex model mapping from CLIProxy"},routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx","ccs codex --target codex","ccs codex-api --target codex"],notes:"Codex is still runtime-only for saved defaults; use --target codex or the runtime aliases at launch time."},{id:"codex-cliproxy",name:"Codex via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed provider with configurable variant model and a native Codex shortcut.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:['ccsxp "your prompt"',"ccs codex --target codex","ccs codex","ccs cliproxy create mycodex --provider codex","ccs api create codex-api --cliproxy-provider codex"],notes:"Use ccsxp when you want native Codex with the cliproxy shortcut; use ccs codex --target codex for the explicit managed bridge."},{id:"gemini-cliproxy",name:"Gemini via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Gemini provider with multi-account management.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs gemini","ccs cliproxy create mygem --provider gemini"]},{id:"agy-cliproxy",name:"Antigravity via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Antigravity provider with variant target controls.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs agy","ccs cliproxy create myagy --provider agy --target droid"]},{id:"custom-api-profiles",name:"Custom API Profiles",scope:"api-profiles",status:"stable",summary:"Any Anthropic-compatible endpoint with per-profile target and model mapping.",pillars:{baseUrl:"User-defined endpoint",auth:"User-defined token/key",model:"User-defined model identifier"},routes:[{label:"API Profiles",path:"/providers"}],commands:["ccs api create myprofile",'ccs myprofile "your prompt"']},{id:"opencode-websearch",name:"OpenCode WebSearch",scope:"websearch",status:"stable",summary:"WebSearch provider surfaced in Settings for third-party profile workflows.",pillars:{baseUrl:"Managed by OpenCode CLI integration",auth:"Provider-specific (managed externally)",model:"Configurable in WebSearch settings"},routes:[{label:"Settings",path:"/settings"}],commands:["ccs config",'ccs codex "your prompt"'],notes:"Enable OpenCode in Settings > WebSearch to activate fallback search."}];function l(s,t,r){return M.t(s,{defaultValue:t,...r})}function se(){return{target:l("supportCatalog.scope.target",g.target),cliproxy:l("supportCatalog.scope.cliproxy",g.cliproxy),"api-profiles":l("supportCatalog.scope.apiProfiles",g["api-profiles"]),websearch:l("supportCatalog.scope.websearch",g.websearch)}}function te(s){return{...s,title:l(`supportCatalog.notice.${s.id}.title`,s.title),summary:l(`supportCatalog.notice.${s.id}.summary`,s.summary),primaryAction:l(`supportCatalog.notice.${s.id}.primaryAction`,s.primaryAction),highlights:s.highlights.map((t,r)=>l(`supportCatalog.notice.${s.id}.highlight.${r}`,t)),actions:s.actions.map(t=>({...t,label:l(`supportCatalog.notice.${s.id}.action.${t.id}.label`,t.label),description:l(`supportCatalog.notice.${s.id}.action.${t.id}.description`,t.description)})),routes:s.routes.map((t,r)=>({...t,label:l(`supportCatalog.notice.${s.id}.route.${r}.label`,t.label)}))}}function re(s){return{...s,name:l(`supportCatalog.entry.${s.id}.name`,s.name),summary:l(`supportCatalog.entry.${s.id}.summary`,s.summary),pillars:{baseUrl:l(`supportCatalog.entry.${s.id}.pillar.baseUrl`,s.pillars.baseUrl),auth:l(`supportCatalog.entry.${s.id}.pillar.auth`,s.pillars.auth),model:l(`supportCatalog.entry.${s.id}.pillar.model`,s.pillars.model)},routes:s.routes.map((t,r)=>({...t,label:l(`supportCatalog.entry.${s.id}.route.${r}.label`,t.label)})),notes:s.notes?l(`supportCatalog.entry.${s.id}.notes`,s.notes):s.notes}}function ae(){return X.map(te)}function oe(){return ee.map(re)}function ie(s){const t=new Map(oe().map(r=>[r.id,r]));return s.entryIds.map(r=>t.get(r)).filter(r=>!!r)}function O(s){const t=new Date(`${s}T00:00:00Z`);return Number.isNaN(t.getTime())?s:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}).format(t)}const $="ccs:updates:notice-progress:v1";function de(s){return s==="new"?"new":"seen"}function m(s,t){return t[s.id]??de(s.status)}function A(s){return s!=="done"&&s!=="dismissed"}function le(){if(typeof window>"u")return{};try{const s=window.localStorage.getItem($);if(!s)return{};const t=JSON.parse(s);if(!t||typeof t!="object"||Array.isArray(t))return{};const r={};for(const[i,d]of Object.entries(t))typeof i=="string"&&(d==="new"||d==="seen"||d==="done"||d==="dismissed")&&(r[i]=d);return r}catch{return{}}}function ne(s){typeof window>"u"||window.localStorage.setItem($,JSON.stringify(s))}function D({state:s,className:t}){const{t:r}=x(),i={new:{label:r("updates.progressNeedsAction"),className:"border-amber-300/70 bg-amber-100/70 text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/15 dark:text-amber-300",showDot:!0},seen:{label:r("updates.progressInReview"),className:"border-blue-300/70 bg-blue-100/70 text-blue-800 dark:border-blue-500/40 dark:bg-blue-500/15 dark:text-blue-300"},done:{label:r("updates.progressDone"),className:"border-emerald-300/70 bg-emerald-100/70 text-emerald-800 dark:border-emerald-500/40 dark:bg-emerald-500/15 dark:text-emerald-300"},dismissed:{label:r("updates.progressDismissed"),className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}}[s];return e.jsxs(P,{variant:"outline",className:S("gap-1.5 border text-[10px] font-medium",i.className,t),children:[i.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),i.label]})}function ce({action:s}){const{t}=x();return e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-0.5",children:[e.jsx("p",{className:"text-sm font-medium",children:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]}),s.type==="route"&&s.path&&e.jsx(u,{size:"sm",asChild:!0,children:e.jsxs(L,{to:s.path,children:[t("updates.open"),e.jsx(F,{className:"h-3.5 w-3.5"})]})})]}),s.type==="command"&&s.command&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-md border bg-background px-2 py-1.5",children:[e.jsx(z,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",children:s.command}),e.jsx(U,{value:s.command})]})]})}function pe({notice:s,progress:t,relatedEntries:r,onUpdateProgress:i}){const{t:d}=x(),f=se();return s?e.jsxs("div",{className:"flex-1 min-w-0 bg-background grid grid-rows-[auto_minmax(0,1fr)] overflow-hidden",children:[e.jsxs("div",{className:"border-b bg-background px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("h2",{className:"text-base font-semibold leading-tight",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.summary})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t&&e.jsx(D,{state:t}),e.jsx(Z,{status:s.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:d("updates.published",{date:O(s.publishedAt)})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(u,{size:"sm",onClick:()=>i("done"),children:[e.jsx(H,{className:"h-4 w-4"}),d("updates.markDone")]}),e.jsxs(u,{size:"sm",variant:"outline",onClick:()=>i("dismissed"),children:[e.jsx(Q,{className:"h-4 w-4"}),d("updates.dismiss")]}),e.jsxs(u,{size:"sm",variant:"ghost",onClick:()=>i("new"),children:[e.jsx(G,{className:"h-4 w-4"}),d("updates.reopen")]})]})]}),e.jsx("div",{className:"min-h-0 p-4",children:e.jsxs("div",{className:"grid h-full gap-4 xl:grid-cols-[minmax(0,1.5fr)_minmax(320px,1fr)] overflow-hidden",children:[e.jsxs(C,{className:"h-full overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(K,{className:"h-4 w-4 text-primary"}),e.jsx(N,{className:"text-base",children:d("updates.doNext")})]}),e.jsx(w,{children:s.primaryAction})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:s.actions.map(o=>e.jsx(ce,{action:o},`${s.id}-${o.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(C,{className:"overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:d("updates.impactedIntegrations")}),e.jsx(w,{children:d("updates.impactedDesc")})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:r.map(o=>e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"min-w-0 truncate text-sm font-medium",children:o.name}),e.jsx(P,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:f[o.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[o.routes[0]&&e.jsx(u,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(L,{to:o.routes[0].path,children:o.routes[0].label})}),o.commands[0]&&e.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-1.5",children:[e.jsx("code",{className:"truncate rounded bg-background px-1.5 py-0.5 text-[11px]",children:o.commands[0]}),e.jsx(U,{value:o.commands[0]})]})]})]},o.id))})})})]}),e.jsxs(C,{className:"overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:d("updates.whyMatters")}),e.jsx(w,{children:d("updates.whyMattersDesc")})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:s.highlights.map(o=>e.jsxs("li",{children:["- ",o]},`${s.id}-${o}`))})})})]})]})]})})]}):e.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-6",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:d("updates.noUpdates")})})}function me({notice:s,progress:t,selected:r,onSelect:i}){return e.jsxs("button",{type:"button",onClick:i,className:S("w-full rounded-lg border px-3 py-3 text-left transition-colors",r?"border-primary/30 bg-primary/10":"border-transparent bg-background/40 hover:border-border hover:bg-muted/70"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:s.primaryAction})]}),e.jsx(q,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:O(s.publishedAt)}),e.jsx(D,{state:t})]})]})}function ue(s,t){return t?[s.title,s.summary,s.primaryAction,...s.highlights,...s.commands,...s.actions.map(i=>`${i.label} ${i.description} ${i.command||""}`),...s.routes.map(i=>i.label)].join(" ").toLowerCase().includes(t):!0}function je(){const{t:s}=x(),t=[...ae()].sort((a,n)=>n.publishedAt.localeCompare(a.publishedAt)),[r,i]=c.useState("inbox"),[d,f]=c.useState(""),[o,k]=c.useState(()=>le()),[I,E]=c.useState(null);c.useEffect(()=>{ne(o)},[o]);const h=c.useMemo(()=>{const a=d.trim().toLowerCase();return t.filter(n=>{const y=m(n,o);return ue(n,a)?r==="done"?y==="done":r==="inbox"?A(y):!0:!1})},[t,o,d,r]),p=c.useMemo(()=>{const a=r==="all"?t:h;return a.find(n=>n.id===I)??a[0]??null},[t,I,r,h]),R=a=>{E(a.id),k(n=>m(a,n)!=="new"?n:{...n,[a.id]:"seen"})},T=c.useMemo(()=>t.filter(a=>A(m(a,o))).length,[t,o]),_=c.useMemo(()=>t.filter(a=>m(a,o)==="done").length,[t,o]);return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r bg-muted/30 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("updates.inboxTitle")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("updates.inboxSubtitle")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:s("updates.needsAction")}),e.jsx("p",{className:"text-base font-semibold",children:T})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:s("updates.doneCount")}),e.jsx("p",{className:"text-base font-semibold",children:_})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(V,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(B,{value:d,onChange:a=>f(a.target.value),placeholder:s("updates.searchPlaceholder"),className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:[{id:"inbox",label:s("updates.actionRequired")},{id:"done",label:s("updates.done")},{id:"all",label:s("updates.all")}].map(a=>e.jsx(u,{size:"sm",variant:r===a.id?"default":"outline",onClick:()=>i(a.id),children:a.label},a.id))})]}),e.jsx(b,{className:"flex-1",children:e.jsx("div",{className:"space-y-2 p-2",children:h.length===0?e.jsx("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:s("updates.noNotices")}):h.map(a=>e.jsx(me,{notice:a,progress:m(a,o),selected:p?.id===a.id,onSelect:()=>R(a)},a.id))})})]}),e.jsx(pe,{notice:p,progress:p?m(p,o):null,relatedEntries:p?ie(p):[],onUpdateProgress:a=>{p&&k(n=>({...n,[p.id]:a}))}})]})}export{je as UpdatesPage};
|
package/dist/ui/index.html
CHANGED
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap"
|
|
25
25
|
rel="stylesheet"
|
|
26
26
|
/>
|
|
27
|
-
<script type="module" crossorigin src="/assets/index-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/react-vendor-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/radix-ui-
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/tanstack-
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/notifications-
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/icons-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-Fd17BSGq.js"></script>
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/react-vendor-Bjx91N7w.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/radix-ui-nu4wz29m.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/tanstack-bhJxV1h8.js">
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/assets/notifications-B4_o8bcr.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/assets/icons-DQFHtVq5.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/utils-CzKF5WmX.js">
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/form-utils-
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/code-highlight-
|
|
36
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/form-utils-CuHzLhJZ.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/code-highlight-D4E79GKQ.js">
|
|
36
|
+
<link rel="stylesheet" crossorigin href="/assets/index-6xrth3Oz.css">
|
|
37
37
|
</head>
|
|
38
38
|
<body>
|
|
39
39
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ const candidateRoots = ['tests/unit', 'tests/integration', 'tests/npm', 'src'];
|
|
|
20
20
|
// Automated perf-budget enforcement tracked in issue #1071.
|
|
21
21
|
const slowTests = [
|
|
22
22
|
'tests/integration/cursor-daemon-lifecycle.test.ts',
|
|
23
|
+
'tests/integration/logging-request-context.test.ts',
|
|
23
24
|
'tests/integration/proxy/daemon-lifecycle.test.ts',
|
|
24
25
|
'tests/unit/commands/persist-command-handler.test.ts',
|
|
25
26
|
'tests/unit/hooks/browser-mcp-advanced-interactions.test.ts',
|
|
@@ -32,6 +33,7 @@ const slowTests = [
|
|
|
32
33
|
'tests/unit/targets/codex-settings-bridge-launch.test.ts',
|
|
33
34
|
'tests/unit/targets/droid-command-routing-integration.test.ts',
|
|
34
35
|
'tests/unit/targets/droid-config-manager.test.ts',
|
|
36
|
+
'tests/unit/targets/native-claude-effort-launch.test.ts',
|
|
35
37
|
'tests/unit/targets/settings-profile-browser-launch.test.ts',
|
|
36
38
|
'tests/unit/targets/settings-profile-image-analysis-launch.test.ts',
|
|
37
39
|
'tests/unit/targets/settings-profile-websearch-launch.test.ts',
|