@kaitranntt/ccs 7.51.0-dev.1 → 7.51.0-dev.10

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.
Files changed (159) hide show
  1. package/README.md +16 -0
  2. package/dist/api/services/profile-writer.d.ts.map +1 -1
  3. package/dist/api/services/profile-writer.js +33 -0
  4. package/dist/api/services/profile-writer.js.map +1 -1
  5. package/dist/auth/profile-continuity-inheritance.d.ts +20 -0
  6. package/dist/auth/profile-continuity-inheritance.d.ts.map +1 -0
  7. package/dist/auth/profile-continuity-inheritance.js +139 -0
  8. package/dist/auth/profile-continuity-inheritance.js.map +1 -0
  9. package/dist/ccs.js +39 -3
  10. package/dist/ccs.js.map +1 -1
  11. package/dist/cliproxy/catalog-cache.d.ts.map +1 -1
  12. package/dist/cliproxy/catalog-cache.js +10 -3
  13. package/dist/cliproxy/catalog-cache.js.map +1 -1
  14. package/dist/cliproxy/composite-validator.d.ts.map +1 -1
  15. package/dist/cliproxy/composite-validator.js +9 -0
  16. package/dist/cliproxy/composite-validator.js.map +1 -1
  17. package/dist/cliproxy/config/env-builder.d.ts.map +1 -1
  18. package/dist/cliproxy/config/env-builder.js +69 -8
  19. package/dist/cliproxy/config/env-builder.js.map +1 -1
  20. package/dist/cliproxy/config/generator.d.ts +3 -1
  21. package/dist/cliproxy/config/generator.d.ts.map +1 -1
  22. package/dist/cliproxy/config/generator.js +17 -6
  23. package/dist/cliproxy/config/generator.js.map +1 -1
  24. package/dist/cliproxy/executor/env-resolver.d.ts +2 -0
  25. package/dist/cliproxy/executor/env-resolver.d.ts.map +1 -1
  26. package/dist/cliproxy/executor/env-resolver.js +2 -1
  27. package/dist/cliproxy/executor/env-resolver.js.map +1 -1
  28. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  29. package/dist/cliproxy/executor/index.js +15 -0
  30. package/dist/cliproxy/executor/index.js.map +1 -1
  31. package/dist/cliproxy/model-catalog.d.ts.map +1 -1
  32. package/dist/cliproxy/model-catalog.js +3 -39
  33. package/dist/cliproxy/model-catalog.js.map +1 -1
  34. package/dist/cliproxy/model-config.d.ts.map +1 -1
  35. package/dist/cliproxy/model-config.js +12 -11
  36. package/dist/cliproxy/model-config.js.map +1 -1
  37. package/dist/cliproxy/model-id-normalizer.d.ts +30 -2
  38. package/dist/cliproxy/model-id-normalizer.d.ts.map +1 -1
  39. package/dist/cliproxy/model-id-normalizer.js +88 -7
  40. package/dist/cliproxy/model-id-normalizer.js.map +1 -1
  41. package/dist/cliproxy/services/variant-service.d.ts.map +1 -1
  42. package/dist/cliproxy/services/variant-service.js +12 -0
  43. package/dist/cliproxy/services/variant-service.js.map +1 -1
  44. package/dist/cliproxy/services/variant-settings.d.ts.map +1 -1
  45. package/dist/cliproxy/services/variant-settings.js +5 -3
  46. package/dist/cliproxy/services/variant-settings.js.map +1 -1
  47. package/dist/cliproxy/stats-fetcher.d.ts +41 -0
  48. package/dist/cliproxy/stats-fetcher.d.ts.map +1 -1
  49. package/dist/cliproxy/stats-fetcher.js +32 -1
  50. package/dist/cliproxy/stats-fetcher.js.map +1 -1
  51. package/dist/cliproxy/tool-sanitization-proxy.d.ts.map +1 -1
  52. package/dist/cliproxy/tool-sanitization-proxy.js +6 -0
  53. package/dist/cliproxy/tool-sanitization-proxy.js.map +1 -1
  54. package/dist/cliproxy/types.d.ts +2 -0
  55. package/dist/cliproxy/types.d.ts.map +1 -1
  56. package/dist/commands/config-command.js +2 -2
  57. package/dist/commands/config-command.js.map +1 -1
  58. package/dist/commands/help-command.d.ts.map +1 -1
  59. package/dist/commands/help-command.js +4 -0
  60. package/dist/commands/help-command.js.map +1 -1
  61. package/dist/config/unified-config-loader.d.ts +5 -0
  62. package/dist/config/unified-config-loader.d.ts.map +1 -1
  63. package/dist/config/unified-config-loader.js +62 -1
  64. package/dist/config/unified-config-loader.js.map +1 -1
  65. package/dist/config/unified-config-types.d.ts +10 -0
  66. package/dist/config/unified-config-types.d.ts.map +1 -1
  67. package/dist/config/unified-config-types.js.map +1 -1
  68. package/dist/copilot/copilot-executor.d.ts +2 -2
  69. package/dist/copilot/copilot-executor.d.ts.map +1 -1
  70. package/dist/copilot/copilot-executor.js +4 -3
  71. package/dist/copilot/copilot-executor.js.map +1 -1
  72. package/dist/types/config.d.ts +2 -0
  73. package/dist/types/config.d.ts.map +1 -1
  74. package/dist/types/config.js.map +1 -1
  75. package/dist/ui/assets/accounts-C0a1t7jn.js +1 -0
  76. package/dist/ui/assets/{alert-dialog-B_Bdo2ou.js → alert-dialog-CdeUwye7.js} +1 -1
  77. package/dist/ui/assets/api-C9zwFFut.js +1 -0
  78. package/dist/ui/assets/auth-section-DN4BD8GL.js +1 -0
  79. package/dist/ui/assets/backups-section-CybLESWH.js +1 -0
  80. package/dist/ui/assets/{checkbox-D19h9xqD.js → checkbox-vEe6qcYo.js} +1 -1
  81. package/dist/ui/assets/cliproxy-BqfDDSqL.js +3 -0
  82. package/dist/ui/assets/cliproxy-control-panel-Bge72LT-.js +1 -0
  83. package/dist/ui/assets/{confirm-dialog-7-N-o1DD.js → confirm-dialog-OyJIM_hE.js} +1 -1
  84. package/dist/ui/assets/copilot-CkAJrz8o.js +3 -0
  85. package/dist/ui/assets/cursor-C9LZa_BA.js +1 -0
  86. package/dist/ui/assets/droid-QWGtb0RV.js +2 -0
  87. package/dist/ui/assets/globalenv-section-DOFqIs-8.js +1 -0
  88. package/dist/ui/assets/health-C3ElQ1Lv.js +1 -0
  89. package/dist/ui/assets/{icons-DrewC9c3.js → icons-kPbuhVdj.js} +1 -1
  90. package/dist/ui/assets/index-3GEclgP5.js +1 -0
  91. package/dist/ui/assets/index-BAKFUe-l.js +1 -0
  92. package/dist/ui/assets/index-Bz6l7LGz.js +47 -0
  93. package/dist/ui/assets/index-CMCDJeIA.js +1 -0
  94. package/dist/ui/assets/index-eLGkeVzr.js +1 -0
  95. package/dist/ui/assets/proxy-status-widget-srJDTpWy.js +1 -0
  96. package/dist/ui/assets/{radix-ui-C1Gpgz6I.js → radix-ui-BR1vy4kf.js} +3 -3
  97. package/dist/ui/assets/{separator-51ocJFnp.js → separator-CmlWHN0k.js} +1 -1
  98. package/dist/ui/assets/shared-COklsZr3.js +8 -0
  99. package/dist/ui/assets/{switch-B3t2TDvW.js → switch-Cv3ybiIH.js} +1 -1
  100. package/dist/ui/assets/{tanstack-DDJIhNJd.js → tanstack-e99Cjjy2.js} +1 -1
  101. package/dist/ui/assets/updates-CGOjPqS1.js +1 -0
  102. package/dist/ui/index.html +4 -4
  103. package/dist/web-server/index.d.ts.map +1 -1
  104. package/dist/web-server/index.js +2 -0
  105. package/dist/web-server/index.js.map +1 -1
  106. package/dist/web-server/model-pricing.d.ts.map +1 -1
  107. package/dist/web-server/model-pricing.js +50 -1
  108. package/dist/web-server/model-pricing.js.map +1 -1
  109. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  110. package/dist/web-server/routes/cliproxy-stats-routes.js +27 -3
  111. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  112. package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
  113. package/dist/web-server/routes/profile-routes.js +7 -2
  114. package/dist/web-server/routes/profile-routes.js.map +1 -1
  115. package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
  116. package/dist/web-server/routes/route-helpers.js +55 -0
  117. package/dist/web-server/routes/route-helpers.js.map +1 -1
  118. package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
  119. package/dist/web-server/routes/settings-routes.js +137 -28
  120. package/dist/web-server/routes/settings-routes.js.map +1 -1
  121. package/dist/web-server/usage/aggregator.d.ts +9 -0
  122. package/dist/web-server/usage/aggregator.d.ts.map +1 -1
  123. package/dist/web-server/usage/aggregator.js +63 -7
  124. package/dist/web-server/usage/aggregator.js.map +1 -1
  125. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts +34 -0
  126. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts.map +1 -0
  127. package/dist/web-server/usage/cliproxy-usage-syncer.js +155 -0
  128. package/dist/web-server/usage/cliproxy-usage-syncer.js.map +1 -0
  129. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts +26 -0
  130. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts.map +1 -0
  131. package/dist/web-server/usage/cliproxy-usage-transformer.js +141 -0
  132. package/dist/web-server/usage/cliproxy-usage-transformer.js.map +1 -0
  133. package/dist/web-server/usage/disk-cache.d.ts.map +1 -1
  134. package/dist/web-server/usage/disk-cache.js +2 -1
  135. package/dist/web-server/usage/disk-cache.js.map +1 -1
  136. package/dist/web-server/usage/handlers.d.ts +1 -1
  137. package/dist/web-server/usage/handlers.d.ts.map +1 -1
  138. package/dist/web-server/usage/handlers.js +8 -3
  139. package/dist/web-server/usage/handlers.js.map +1 -1
  140. package/package.json +1 -1
  141. package/dist/ui/assets/accounts-p8Gb9myI.js +0 -1
  142. package/dist/ui/assets/api-Bw82I4NV.js +0 -1
  143. package/dist/ui/assets/auth-section-CswwM0bu.js +0 -1
  144. package/dist/ui/assets/backups-section-6slvPh7p.js +0 -1
  145. package/dist/ui/assets/cliproxy-BxWh_a8E.js +0 -3
  146. package/dist/ui/assets/cliproxy-control-panel-BEaTM1tV.js +0 -1
  147. package/dist/ui/assets/copilot-C2ADI_mS.js +0 -3
  148. package/dist/ui/assets/cursor-BzUnxDMC.js +0 -1
  149. package/dist/ui/assets/droid-BOC3J2_I.js +0 -2
  150. package/dist/ui/assets/globalenv-section-Caco9nNS.js +0 -1
  151. package/dist/ui/assets/health-Cn_YNAry.js +0 -1
  152. package/dist/ui/assets/index-0LBl1v7D.js +0 -1
  153. package/dist/ui/assets/index-B_ON5mBa.js +0 -1
  154. package/dist/ui/assets/index-CVKOwyBR.js +0 -1
  155. package/dist/ui/assets/index-CnAQ8t2b.js +0 -1
  156. package/dist/ui/assets/index-DNFjYwGe.js +0 -47
  157. package/dist/ui/assets/proxy-status-widget-B31OXK00.js +0 -1
  158. package/dist/ui/assets/shared-k-J_KXcM.js +0 -8
  159. package/dist/ui/assets/updates-CYChhYqV.js +0 -1
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-C1Gpgz6I.js";import{r as y}from"./react-vendor-CNOkPC89.js";import{bf as W,aL as X,bg as Z,bh as J,bi as ee,bj as se,bk as te,c as d,B as E,ax as ae,K as ne,N as re,q as oe,r as ie,s as le,t as ce,v as de,b as I,T as xe,o as me,p as ue,W as he}from"./index-DNFjYwGe.js";import{A as ge,a as pe,b as fe,c as be,d as je,e as ye,f as Ne,g as Ce}from"./alert-dialog-B_Bdo2ou.js";import{u as $,a as we,b as ve,e as Se}from"./tanstack-DDJIhNJd.js";import{t as P}from"./notifications-B2HqRBj7.js";import{a3 as ke,A as Ae,R as f,aV as Pe,aW as Ve,aX as Ie,X as Te,b as Re,aY as De,aZ as Ue,U as Ee,q as Ke,k as $e,a2 as qe,aq as Le,T as K,ax as Fe}from"./icons-DrewC9c3.js";const ts="2026-02-24-antigravity-oauth-v2",_e="I ACCEPT RISK",Me=_e,as={reviewedIssue509:!1,understandsBanRisk:!1,acceptsFullResponsibility:!1,typedPhrase:""};function ns(s){return s.reviewedIssue509&&s.understandsBanRisk&&s.acceptsFullResponsibility&&s.typedPhrase.trim().replace(/\s+/g," ").toUpperCase()===Me}async function Be(){const s=await fetch("/api/cliproxy/sync/status");if(!s.ok){let n="Failed to fetch sync status";try{const t=await s.json();n=t.error||t.message||n}catch{}throw new Error(n)}return s.json()}async function He(){const s=new AbortController,n=setTimeout(()=>s.abort(),3e4);try{const t=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:s.signal});if(!t.ok){let a="Sync failed";try{const r=await t.json();a=r.error||r.message||a}catch{}throw new Error(a)}return t.json()}catch(t){throw t instanceof Error&&t.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):t}finally{clearTimeout(n)}}function Ye(){return $({queryKey:["cliproxy-sync-status"],queryFn:Be,refetchInterval:3e4,retry:1,staleTime:1e4})}function Ge(){const s=we();return ve({mutationFn:He,onSuccess:n=>{s.invalidateQueries({queryKey:["cliproxy-sync-status"]}),s.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?P.info("No profiles to sync"):P.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{P.error(`Sync failed: ${n.message}`)}})}function V(s,n){const t=s.replace(/-\d+$/,"").split(".").map(Number),a=n.replace(/-\d+$/,"").split(".").map(Number);for(let r=0;r<3;r++){if((t[r]||0)>(a[r]||0))return!0;if((t[r]||0)<(a[r]||0))return!1}return!1}function Oe(s){if(!s)return"";const n=new Date(s).getTime(),a=Date.now()-n,r=Math.floor(a/(1e3*60*60)),i=Math.floor(a%(1e3*60*60)/(1e3*60));return r>0?`${r}h ${i}m`:`${i}m`}function Qe(s){if(!s)return"";const n=Date.now()-s,t=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return t<1?"just now":t<60?`${t}m ago`:`${a}h ago`}function N({icon:s,tooltip:n,onClick:t,disabled:a,isPending:r,className:i,variant:l="ghost"}){return e.jsxs(xe,{children:[e.jsx(me,{asChild:!0,children:e.jsx(I,{variant:l==="destructive-ghost"?"ghost":l,size:"sm",className:d("h-7 w-7 p-0",l==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:t,disabled:a,children:r?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(s,{className:"w-3.5 h-3.5"})})}),e.jsx(ue,{side:"bottom",className:"text-xs",children:n})]})}function rs(){const{data:s,isLoading:n}=W(),{data:t}=X(),{data:a,isLoading:r}=Z(),i=J(),l=ee(),C=se(),u=te(),{data:q}=Ye(),{mutate:L,isPending:w}=Ge(),[h,T]=y.useState(!1),[g,F]=y.useState(""),[_,b]=y.useState(!1),[v,S]=y.useState(null),{data:M}=$({queryKey:["cliproxy-server-config"],queryFn:()=>he.cliproxyServer.get(),staleTime:3e4}),B=Se({mutationKey:["update-backend"]})>0,x=M?.remote,R=x?.enabled&&x?.host,p=s?.running??!1,k=i.isPending||l.isPending||C.isPending||u.isPending||B||w,H=t?.hasUpdate??!1,m=t?.isStable===!1,D=t?.currentVersion,j=q?.configured??!1,Y=j?"Sync Ready":"No Config",A=m?t?.maxStableVersion||a?.latestStable:t?.latestVersion,U=o=>{if(!o)return;const c=a?.maxStableVersion||"6.6.80";if(V(o,c)){S(o),b(!0);return}u.mutate({version:o})},G=()=>{v&&u.mutate({version:v,force:!0}),b(!1),S(null)},O=()=>{b(!1),S(null)},Q=R?(()=>{const o=x.protocol||"http",c=x.port||(o==="https"?443:80);return o==="https"&&c===443||o==="http"&&c===80?x.host:`${x.host}:${c}`})():null;return R?e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Remote Proxy"}),e.jsx(E,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:"Active"})]}),e.jsx(Ae,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:Q})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:"Traffic auto-routed to remote server"})]})]}):e.jsx(ae,{delayDuration:300,children:e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors",p?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:d("w-2 h-2 rounded-full",p?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:t?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(f,{className:"w-3 h-3 animate-spin text-muted-foreground"}):p?e.jsxs(e.Fragment,{children:[e.jsx(N,{icon:w?f:Pe,tooltip:"Sync profiles to CLIProxy",onClick:()=>L(),disabled:!j||k,isPending:w}),e.jsx(N,{icon:Ve,tooltip:"Restart",onClick:()=>C.mutate(),disabled:k,isPending:C.isPending}),e.jsx(N,{icon:Ie,tooltip:"Stop",onClick:()=>l.mutate(),disabled:k,isPending:l.isPending,variant:"destructive-ghost"})]}):null,e.jsx(N,{icon:h?Te:Re,tooltip:h?"Close":"Version settings",onClick:()=>T(!h),className:h?"bg-muted":void 0})]})]}),D&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:d("text-xs font-mono text-muted-foreground",m&&"text-amber-600 dark:text-amber-400"),children:["v",D]}),(H||m)&&A&&e.jsxs(E,{variant:"secondary",className:d("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",m?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>U(A),title:`Click to ${m?"downgrade":"update"}`,children:[m?e.jsx(De,{className:"w-2.5 h-2.5"}):e.jsx(Ue,{className:"w-2.5 h-2.5"}),A]})]}),p&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:["Port ",s.port]}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ee,{className:"w-3 h-3"}),s.sessionCount," session",s.sessionCount!==1?"s":""]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ke,{className:"w-3 h-3"}),Oe(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[j?e.jsx($e,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(qe,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:d("text-xs",j?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:Y})]}),e.jsx(ne,{open:h,onOpenChange:T,children:e.jsxs(re,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:"Version Management"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(oe,{value:g,onValueChange:F,disabled:r,children:[e.jsx(ie,{className:"h-8 text-xs flex-1",children:e.jsx(le,{placeholder:"Select version to install..."})}),e.jsx(ce,{children:a?.versions.slice(0,20).map(o=>{const c=a?.maxStableVersion&&V(o,a.maxStableVersion);return e.jsx(de,{value:o,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",o,o===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"(stable)"}),c&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},o)})})]}),e.jsxs(I,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>U(g),disabled:u.isPending||!g,children:[u.isPending?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Le,{className:"w-3.5 h-3.5"}),"Install"]})]}),g&&a?.maxStableVersion&&V(g,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(K,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{children:["Versions above ",a.maxStableVersion," have known issues"]})]}),t?.checkedAt&&e.jsxs("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:["Last checked ",Qe(t.checkedAt)]})]})}),!p&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not running"}),e.jsxs(I,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>i.mutate(),disabled:i.isPending,children:[i.isPending?e.jsx(f,{className:"w-3 h-3 animate-spin"}):e.jsx(Fe,{className:"w-3 h-3"}),"Start"]})]}),e.jsx(ge,{open:_,onOpenChange:b,children:e.jsxs(pe,{children:[e.jsxs(fe,{children:[e.jsxs(be,{className:"flex items-center gap-2",children:[e.jsx(K,{className:"w-5 h-5 text-amber-500"}),"Install Unstable Version?"]}),e.jsxs(je,{className:"space-y-2",children:[e.jsxs("p",{children:["You are about to install ",e.jsxs("strong",{children:["v",v]}),", which is above the maximum stable version"," ",e.jsxs("strong",{children:["v",a?.maxStableVersion||"6.6.80"]}),"."]}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:"This version has known stability issues and may cause unexpected behavior."}),e.jsx("p",{children:"Are you sure you want to proceed?"})]})]}),e.jsxs(ye,{children:[e.jsx(Ne,{onClick:O,children:"Cancel"}),e.jsx(Ce,{onClick:G,className:"bg-amber-500 hover:bg-amber-600 text-white",children:"Install Anyway"})]})]})})]})})}export{Me as A,as as D,rs as P,_e as R,ts as a,ns as i};
@@ -1,8 +0,0 @@
1
- import{j as e}from"./radix-ui-C1Gpgz6I.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{b1 as X,b2 as Y,b3 as ee,O as se,Q as te,R as re,B as C,b4 as L,b5 as I,b6 as E,b as F,I as ae,m as P,c as D,C as ne,a as le}from"./index-DNFjYwGe.js";import{O as ie,a1 as ce,aN as oe,T as R,R as T,F as de,aj as me,a2 as he}from"./icons-DrewC9c3.js";import"./tanstack-DDJIhNJd.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const y={commands:"Commands",skills:"Skills",agents:"Agents"};function Ce(){const[t,n]=j.useState("commands"),[s,r]=j.useState(""),[l,c]=j.useState(null),{data:a,isError:o,error:d,refetch:m}=X(),{data:u,isLoading:f,isFetching:h,isError:p,error:w,refetch:$}=Y(t),N=u?.items??[],M=s.trim().toLowerCase(),v=s.trim(),x=j.useMemo(()=>{const i=u?.items??[];return M?i.filter(b=>[b.name,b.description,b.path].some(J=>J.toLowerCase().includes(M))):i},[u,M]),g=j.useMemo(()=>x.length===0?null:l?x.find(i=>i.path===l)??x[0]:x[0],[x,l]),{data:k,isLoading:Q,isError:_,error:U,refetch:V}=ee(t,g?.path??null),B=[{id:"commands",label:y.commands,icon:ie,count:a?.commands??0},{id:"skills",label:y.skills,icon:ce,count:a?.skills??0},{id:"agents",label:y.agents,icon:oe,count:a?.agents??0}],W=B.reduce((i,b)=>i+b.count,0),q=!f&&!p&&N.length===0,H=!f&&!p&&N.length>0&&x.length===0,K=z(d,"Shared item totals could not be loaded. Listing still works."),Z=z(w,`Unable to fetch shared ${t}. Please try again.`),G=z(U,`Unable to load content for ${g?.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:"Shared Data"}),e.jsx("p",{className:"text-muted-foreground",children:"Commands, skills, and agents shared across Claude instances"})]}),e.jsx(se,{value:t,onValueChange:i=>{n(i),r(""),c(null)},children:e.jsx(te,{className:"h-auto flex-wrap justify-start",children:B.map(i=>e.jsxs(re,{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(A,{label:"Total Shared",value:W}),e.jsx(A,{label:y[t],value:N.length}),e.jsx(A,{label:"Visible",value:x.length})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(C,{variant:"secondary",children:"Markdown detail view"}),v?e.jsxs(C,{variant:"outline",children:["Filter: ",v]}):null]})]})]}),a&&!a.symlinkStatus.valid&&e.jsxs(L,{variant:"warning",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(I,{children:"Configuration Required"}),e.jsxs(E,{children:[a.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),o&&e.jsxs(L,{variant:"info",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(I,{children:"Counts unavailable"}),e.jsxs(E,{children:[e.jsx("p",{children:K}),e.jsx("div",{className:"mt-3",children:e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{m()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Retry counts"]})})]})]})]}),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(de,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:y[t]})]}),!f&&!p&&e.jsxs(C,{variant:"outline",className:"text-[10px] h-5",children:[x.length,"/",N.length]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(me,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ae,{value:s,onChange:i=>r(i.target.value),placeholder:`Filter ${t} by name, description, or path`,"aria-label":`Filter ${t} by name, description, or path`,className:"pl-8 h-9"})]}),!f&&!p&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",x.length," of ",N.length," ",t,v?` for "${v}"`:"",h?" (refreshing...)":""]})]}),e.jsx(P,{className:"flex-1 min-h-0",children:f?e.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Loading shared ",t,"..."]}):p?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(he,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium",children:["Failed to load shared ",t]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:Z})]}),e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{$()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Retry"]})]})}):q?e.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["No shared ",t," found. Run `ccs sync` or add items in your shared directory."]}):H?e.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["No ",t,' match "',v,'".']}):e.jsx("div",{className:"p-2 space-y-1",children:x.map(i=>e.jsxs("button",{type:"button",onClick:()=>c(i.path),className:D("w-full text-left p-3 rounded-md border transition-colors",g?.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:g?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:g.name}),e.jsx(C,{variant:"outline",className:"uppercase text-[10px]",children:g.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(O,{label:"Path",value:g.path,mono:!0}),k?.contentPath&&k.contentPath!==g.path&&e.jsx(O,{label:"Resolved Source",value:k.contentPath,mono:!0})]})}),e.jsx(ne,{className:"min-h-0 flex-1",children:e.jsx(le,{className:"p-0 h-full",children:e.jsx(P,{className:"h-full px-5 py-4",children:Q?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown content..."}):_?e.jsxs(L,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(I,{children:"Failed to load content"}),e.jsxs(E,{children:[e.jsx("p",{children:G}),e.jsx("div",{className:"mt-3",children:e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{V()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Retry content"]})})]})]}):e.jsx(ue,{content:k?.content??""})})})})]})]}):e.jsxs("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:["Select a ",t.slice(0,-1)," to view full content."]})})]})})})]})}function A({label:t,value:n}){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:t}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:n})]})}function O({label:t,value:n,mono:s=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("p",{className:D("text-xs mt-1 break-words",s?"font-mono":"text-sm"),children:n})]})}function z(t,n){if(!(t instanceof Error))return n;const s=t.message.toLowerCase();return s.includes("failed to fetch")||s.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":t.message||n}function ue({content:t}){const n=j.useMemo(()=>pe(t),[t]);return n.blocks.length===0&&n.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No markdown content available."}):e.jsxs("div",{className:"space-y-5",children:[n.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:n.frontmatter.map(s=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:xe(s.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:s.value})]},`${s.key}:${s.value}`))})}):null,n.blocks.map((s,r)=>{if(s.type==="heading"){const l=s.level<=1?"text-xl font-semibold":s.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:l,children:S(s.text,`heading-${r}`)},`heading-${r}`)}return s.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:S(s.text,`paragraph-${r}`)},`paragraph-${r}`):s.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:s.items.map((l,c)=>e.jsx("li",{children:S(l,`ul-item-${r}-${c}`)},`ul-item-${r}-${c}`))},`ul-${r}`):s.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:s.items.map((l,c)=>e.jsx("li",{children:S(l,`ol-item-${r}-${c}`)},`ol-item-${r}-${c}`))},`ol-${r}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[s.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:s.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:s.content})]},`code-${r}`)})]})}function xe(t){return t.replace(/[-_]/g," ")}function S(t,n){const s=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,r=[];let l=0,c=0;for(const a of t.matchAll(s)){const o=a[0],d=a.index??0;if(d>l&&r.push(t.slice(l,d)),a[2])r.push(e.jsx("strong",{className:"font-semibold",children:a[2]},`${n}-strong-${c}`));else if(a[3])r.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:a[3]},`${n}-code-${c}`));else if(a[4])r.push(e.jsx("em",{className:"italic",children:a[4]},`${n}-em-${c}`));else if(a[5]&&a[6]){const m=a[6].trim();/^(https?:\/\/|mailto:)/i.test(m)?r.push(e.jsx("a",{href:m,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:a[5]},`${n}-link-${c}`)):r.push(a[5])}else r.push(o);l=d+o.length,c+=1}return l<t.length&&r.push(t.slice(l)),r.length===0?[t]:r}function pe(t){const n=t.replace(/\r\n/g,`
2
- `).trim();if(!n)return{blocks:[],frontmatter:[]};let s=n;const r=[];if(s.startsWith(`---
3
- `)){const l=s.indexOf(`
4
- ---
5
- `,4);if(l!==-1){const c=s.slice(4,l).trim();for(const a of c.split(`
6
- `)){const o=a.match(/^([A-Za-z0-9_-]+)\s*:\s*(.+)$/);o&&r.push({key:o[1],value:o[2].trim().replace(/^['"]|['"]$/g,"")})}s=s.slice(l+5).trim()}}return{blocks:fe(s),frontmatter:r}}function fe(t){if(!t.trim())return[];const n=t.split(`
7
- `),s=[];let r=[],l=[],c=[],a="",o=null;const d=()=>{r.length!==0&&(s.push({type:"paragraph",text:r.join(" ")}),r=[])},m=()=>{l.length!==0&&(s.push({type:"unordered-list",items:l}),l=[])},u=()=>{c.length!==0&&(s.push({type:"ordered-list",items:c}),c=[])},f=()=>{o&&(s.push({type:"code",language:a,content:o.join(`
8
- `)}),a="",o=null)};for(const h of n){if(o){h.trim().startsWith("```")?f():o.push(h);continue}if(h.trim().startsWith("```")){d(),m(),u(),a=h.trim().replace(/^```/,"").trim(),o=[];continue}if(h.trim().length===0){d(),m(),u();continue}const p=h.match(/^(#{1,6})\s+(.*)$/);if(p){d(),m(),u(),s.push({type:"heading",level:p[1].length,text:p[2].trim()});continue}const w=h.match(/^\s*[-*]\s+(.*)$/);if(w){d(),u(),l.push(w[1].trim());continue}const $=h.match(/^\s*\d+\.\s+(.*)$/);if($){d(),m(),c.push($[1].trim());continue}m(),u(),r.push(h.trim())}return d(),m(),u(),f(),s}export{Ce as SharedPage};
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-C1Gpgz6I.js";import{L as C,r as c}from"./react-vendor-CNOkPC89.js";import{B as w,c as v,b as x,w as A,b7 as E,C as b,i as f,j as g,Y as j,a as N,m as h,b8 as _,b9 as D,I as L,ba as U}from"./index-DNFjYwGe.js";import{J as z,z as B,aO as $,r as Q,E as G,w as J,a1 as V,c as Y,aP as q,aj as F}from"./icons-DrewC9c3.js";import"./tanstack-DDJIhNJd.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const W={new:"New",stable:"Stable",planned:"Planned"},H={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 K({status:s,className:a}){return e.jsx(w,{variant:"outline",className:v("font-medium",H[s],a),children:W[s]})}const I="ccs:updates:notice-progress:v1";function X(s){return s==="new"?"new":"seen"}function m(s,a){return a[s.id]??X(s.status)}function S(s){return s!=="done"&&s!=="dismissed"}function Z(){if(typeof window>"u")return{};try{const s=window.localStorage.getItem(I);if(!s)return{};const a=JSON.parse(s);if(!a||typeof a!="object"||Array.isArray(a))return{};const l={};for(const[d,t]of Object.entries(a))typeof d=="string"&&(t==="new"||t==="seen"||t==="done"||t==="dismissed")&&(l[d]=t);return l}catch{return{}}}function ee(s){typeof window>"u"||window.localStorage.setItem(I,JSON.stringify(s))}const se={new:{label:"Needs Action",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:"In Review",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:"Done",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:"Dismissed",className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}};function P({state:s,className:a}){const l=se[s];return e.jsxs(w,{variant:"outline",className:v("gap-1.5 border text-[10px] font-medium",l.className,a),children:[l.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),l.label]})}function re({action:s}){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(x,{size:"sm",asChild:!0,children:e.jsxs(C,{to:s.path,children:["Open",e.jsx(z,{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(B,{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(A,{value:s.command})]})]})}function ae({notice:s,progress:a,relatedEntries:l,onUpdateProgress:d}){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:[a&&e.jsx(P,{state:a}),e.jsx(K,{status:s.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx($,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:["Published ",E(s.publishedAt)]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(x,{size:"sm",onClick:()=>d("done"),children:[e.jsx(Q,{className:"h-4 w-4"}),"Mark done"]}),e.jsxs(x,{size:"sm",variant:"outline",onClick:()=>d("dismissed"),children:[e.jsx(G,{className:"h-4 w-4"}),"Dismiss"]}),e.jsxs(x,{size:"sm",variant:"ghost",onClick:()=>d("new"),children:[e.jsx(J,{className:"h-4 w-4"}),"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(b,{className:"h-full overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4 text-primary"}),e.jsx(g,{className:"text-base",children:"Do Next"})]}),e.jsx(j,{children:s.primaryAction})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:s.actions.map(t=>e.jsx(re,{action:t},`${s.id}-${t.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(b,{className:"overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsx(g,{className:"text-base",children:"Impacted Integrations"}),e.jsx(j,{children:"Related areas based on update scope and routing."})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:l.map(t=>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:t.name}),e.jsx(w,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:_[t.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[t.routes[0]&&e.jsx(x,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(C,{to:t.routes[0].path,children:t.routes[0].label})}),t.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:t.commands[0]}),e.jsx(A,{value:t.commands[0]})]})]})]},t.id))})})})]}),e.jsxs(b,{className:"overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsx(g,{className:"text-base",children:"Why It Matters"}),e.jsx(j,{children:"Short context only, no wall-of-text release notes."})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:s.highlights.map(t=>e.jsxs("li",{children:["- ",t]},`${s.id}-${t}`))})})})]})]})]})})]}):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:"No updates available."})})}function te({notice:s,progress:a,selected:l,onSelect:d}){return e.jsxs("button",{type:"button",onClick:d,className:v("w-full rounded-lg border px-3 py-3 text-left transition-colors",l?"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(Y,{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:E(s.publishedAt)}),e.jsx(P,{state:a})]})]})}const de=[{id:"inbox",label:"Action Required"},{id:"done",label:"Done"},{id:"all",label:"All"}];function le(s,a){return a?[s.title,s.summary,s.primaryAction,...s.highlights,...s.commands,...s.actions.map(d=>`${d.label} ${d.description} ${d.command||""}`),...s.routes.map(d=>d.label)].join(" ").toLowerCase().includes(a):!0}function fe(){const s=c.useMemo(()=>[...D].sort((r,n)=>n.publishedAt.localeCompare(r.publishedAt)),[]),[a,l]=c.useState("inbox"),[d,t]=c.useState(""),[i,y]=c.useState(()=>Z()),[k,M]=c.useState(null);c.useEffect(()=>{ee(i)},[i]);const u=c.useMemo(()=>{const r=d.trim().toLowerCase();return s.filter(n=>{const p=m(n,i);return le(n,r)?a==="done"?p==="done":a==="inbox"?S(p):!0:!1})},[s,i,d,a]),o=c.useMemo(()=>{const r=a==="all"?s:u;return r.find(n=>n.id===k)??r[0]??null},[s,k,a,u]),O=r=>{M(r.id),y(n=>m(r,n)!=="new"?n:{...n,[r.id]:"seen"})},R=c.useMemo(()=>s.filter(r=>S(m(r,i))).length,[s,i]),T=c.useMemo(()=>s.filter(r=>m(r,i)==="done").length,[s,i]);return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex 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(q,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"Updates Inbox"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Focus on actions, then mark updates done or dismissed."})]}),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:"Needs Action"}),e.jsx("p",{className:"text-base font-semibold",children:R})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:"Done"}),e.jsx("p",{className:"text-base font-semibold",children:T})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(F,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(L,{value:d,onChange:r=>t(r.target.value),placeholder:"Search actions or commands",className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:de.map(r=>e.jsx(x,{size:"sm",variant:a===r.id?"default":"outline",onClick:()=>l(r.id),children:r.label},r.id))})]}),e.jsx(h,{className:"flex-1",children:e.jsx("div",{className:"space-y-2 p-2",children:u.length===0?e.jsx("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:"No notices match this view."}):u.map(r=>e.jsx(te,{notice:r,progress:m(r,i),selected:o?.id===r.id,onSelect:()=>O(r)},r.id))})})]}),e.jsx(ae,{notice:o,progress:o?m(o,i):null,relatedEntries:o?U(o):[],onUpdateProgress:r=>{o&&y(n=>({...n,[o.id]:r}))}})]})}export{fe as UpdatesPage};