local-operator-ui 0.46.8 → 0.46.9
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/out/main/index.js +437 -116
- package/out/preload/index.js +44 -3
- package/out/renderer/assets/{_basePickBy-CuPgdlLe.js → _basePickBy-CmV8tUi7.js} +1 -1
- package/out/renderer/assets/{_baseUniq-q-GzZKBS.js → _baseUniq-CqLJn7yF.js} +1 -1
- package/out/renderer/assets/{agent-details-page-DY1Orohr.js → agent-details-page-CThfGsfm.js} +2 -2
- package/out/renderer/assets/{agent-hub-page-Ds9nvIYv.js → agent-hub-page-C-ywDllh.js} +1 -1
- package/out/renderer/assets/{agents-page-BVcJyyR_.js → agents-page-D2eIVwhf.js} +4 -4
- package/out/renderer/assets/{approvalsOverlay-C68maBuQ.js → approvalsOverlay-Cv9MbybD.js} +1 -1
- package/out/renderer/assets/{arc-CvDdm6jq.js → arc-BVQgIxwP.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-D5bGZEoB.js → architectureDiagram-IEHRJDOE-DdbMaMwS.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-u_IQ3eSj.js → blockDiagram-JOT3LUYC-DDAtl1Lt.js} +1 -1
- package/out/renderer/assets/{book-open-B73Yn-SK.js → book-open-CeunfhSF.js} +1 -1
- package/out/renderer/assets/browser-page-CadC5uNA.js +1 -0
- package/out/renderer/assets/browser-webauthn-prompt-VS4NQrvt.js +1 -0
- package/out/renderer/assets/{building-2-kkfx6Z-U.js → building-2-BWeh2E3P.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-DuV50TR8.js → c4Diagram-VJAJSXHY-B12uDjjf.js} +1 -1
- package/out/renderer/assets/channel-Suj07EGc.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-b8PaCOoy.js → chunk-4BMEZGHF-foEHiunp.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT--IoMT2Md.js → chunk-A2AXSNBT-BlmvSRn1.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-Cn6DKXBB.js → chunk-AEK57VVT-CkEGTEDe.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-lJEgZlOA.js → chunk-D6G4REZN-BLo7frpY.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-C8sAhN9F.js → chunk-RZ5BOZE2-B0hU-XtI.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-Dz0Asp2E.js → chunk-XZIHB7SX-C3L5H5--.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-DrBr2QVl.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-DrBr2QVl.js +1 -0
- package/out/renderer/assets/clone-IC0Y2Pcm.js +1 -0
- package/out/renderer/assets/{console-mirror-BuskFu7W.js → console-mirror-DSfvk7aY.js} +1 -1
- package/out/renderer/assets/{consoleCapture-BTnR6yic.js → consoleCapture-QVYhdp95.js} +1 -1
- package/out/renderer/assets/{conversation-input-sync-C8YlJ1EX.js → conversation-input-sync-Br_LaiwW.js} +252 -252
- package/out/renderer/assets/{dagre-OKDRZEBW-CWV5OLm9.js → dagre-OKDRZEBW-dK2s1YgC.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-zuN0OTZq.js → diagram-SSKATNLV-Bmo9h1px.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-CmuSOifO.js → diagram-VNBRO52H-nHwnyPUX.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-DHKnHal4.js → erDiagram-Q7BY3M3F-C3vsgDiA.js} +1 -1
- package/out/renderer/assets/{error-boundary-B-SnNd1V.js → error-boundary-BeNln_og.js} +2 -2
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-VKzBZ2jt.js → flowDiagram-4HSFHLVR-W0GotF8Y.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-Bs6uJHyW.js → ganttDiagram-APWFNJXF-CprKLUCj.js} +3 -3
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-DcdTu2Ol.js → gitGraphDiagram-7IBYFJ6S-DouuOzIa.js} +1 -1
- package/out/renderer/assets/{graph-DfDDEBXe.js → graph-D7bwyWvv.js} +1 -1
- package/out/renderer/assets/{hash-DhlPNaTy.js → hash-CHO8bk3B.js} +1 -1
- package/out/renderer/assets/{heart-8AHpaFmI.js → heart-CPhdB7Hf.js} +1 -1
- package/out/renderer/assets/{index-DtSIpYnZ.js → index-B3MeYPrR.js} +1 -1
- package/out/renderer/assets/{index-D4bPuJfm.js → index-BzoM-fQ-.js} +1 -1
- package/out/renderer/assets/{index-CRerltBd.js → index-C1YrmbYU.js} +1 -1
- package/out/renderer/assets/{index-Bk9OdcdM.js → index-DYcPQD_y.js} +190 -190
- package/out/renderer/assets/index-DngsIcF9.css +1 -0
- package/out/renderer/assets/infoDiagram-PH2N3AL5-rZMu5s6k.js +2 -0
- package/out/renderer/assets/{installer-BhonfpX_.js → installer-DhFGWknS.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-BT0NIe6A.js → journeyDiagram-U35MCT3I-DlGp9otc.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-OuX3rwr7.js → kanban-definition-NDS4AKOZ-B8ZpYKjf.js} +1 -1
- package/out/renderer/assets/{layout-DVPWCCDD.js → layout-C6AyPwmI.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-wrdhQmf1.js → legacy-agents-page-cEqmMwic.js} +4 -4
- package/out/renderer/assets/{library-page-Bonc93mo.js → library-page-DIw1Wz-h.js} +29 -29
- package/out/renderer/assets/{mermaid.core-X0bVMmvQ.js → mermaid.core-bzNFRZFB.js} +5 -5
- package/out/renderer/assets/{mesh-page-D8kHAV-F.js → mesh-page-CZGaW_cn.js} +1 -1
- package/out/renderer/assets/{messages-DoRCUI0R.js → messages-Bs_2O37q.js} +9 -9
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-BpHABkH9.js → mindmap-definition-ALO5MXBD-BiVOG70b.js} +1 -1
- package/out/renderer/assets/mini-DpXlo_RZ.js +1 -0
- package/out/renderer/assets/{notebook-pen-DNNnAD8q.js → notebook-pen-BXM9jjVx.js} +1 -1
- package/out/renderer/assets/notifications-page-3bGziwyf.js +1 -0
- package/out/renderer/assets/{org-access-DpEprwED.js → org-access-8CwZ12nL.js} +1 -1
- package/out/renderer/assets/{org-surface-gate-Bgxn8h2L.js → org-surface-gate-DPdbVwFU.js} +1 -1
- package/out/renderer/assets/{page-header-etXTK1uO.js → page-header-BwHGmPoG.js} +1 -1
- package/out/renderer/assets/path-utils-CLcWuT9Z.js +62 -0
- package/out/renderer/assets/pieDiagram-IB7DONF6-DGDMcAF5.js +30 -0
- package/out/renderer/assets/{project-markdown-g0FzepON.js → project-markdown-Di6EEdP0.js} +1 -1
- package/out/renderer/assets/{projects-page-BmKB0PA4.js → projects-page-B1vf_RMG.js} +9 -9
- package/out/renderer/assets/{publication-validation-DSRRYhuA.js → publication-validation-C2Gq3ZoZ.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-DDv5SDgc.js → quadrantDiagram-7GDLP6J5-D4VNXM73.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-YYba11Gt.js → radar-MK3ICKWK-oBs47UIY.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-B-ByI1-F.js → radient-auth-buttons-l30F7sIf.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-B3uBj0oP.js → requirementDiagram-KVF5MWMF-CvI7G4Io.js} +1 -1
- package/out/renderer/assets/sankeyDiagram-QLVOVGJD-BjPVrMvn.js +10 -0
- package/out/renderer/assets/{schedules-page-DgYW6h6L.js → schedules-page-CngC6bwN.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-B17mhZ42.js → sequenceDiagram-X6HHIX6F-BD6w5QHM.js} +1 -1
- package/out/renderer/assets/{settings-page-DyKAzrQ1.js → settings-page-BaGTIAFb.js} +9 -9
- package/out/renderer/assets/{smartart-feL8OxQl.js → smartart-CIJF1Wev.js} +1 -1
- package/out/renderer/assets/{stateDiagram-DGXRK772-BBbbN5zx.js → stateDiagram-DGXRK772-DdOQoabi.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-C4fpVXUb.js +1 -0
- package/out/renderer/assets/{team-bridge-page-bogDmcnp.js → team-bridge-page-Bk179Gkc.js} +8 -8
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-AovjX9qj.js → timeline-definition-BDJGKUSR-XPuXrTAl.js} +1 -1
- package/out/renderer/assets/{use-default-on-banner-DwI-Hr5I.js → use-default-on-banner-19jcUz7X.js} +1 -1
- package/out/renderer/assets/{use-download-agent-mutation-CxAcIvee.js → use-download-agent-mutation-oZFCaSbk.js} +4 -4
- package/out/renderer/assets/{use-session-snapshot-ke5QHVta.js → use-session-snapshot-ljpf6Yx5.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-wYpHenXz.js → xychartDiagram-VJFVF3MP-BfxsDAMz.js} +1 -1
- package/out/renderer/browser-approvals-overlay.html +2 -2
- package/out/renderer/console-capture.html +6 -6
- package/out/renderer/index.html +8 -8
- package/out/renderer/installer.html +5 -5
- package/out/renderer/mini.html +8 -8
- package/package.json +2 -2
- package/out/renderer/assets/browser-page-R9ESMyP9.js +0 -1
- package/out/renderer/assets/browser-webauthn-prompt-XpefFmFX.js +0 -1
- package/out/renderer/assets/channel-AaX39fsm.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-CQ6AEPOh.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-CQ6AEPOh.js +0 -1
- package/out/renderer/assets/clone-VutwkgZH.js +0 -1
- package/out/renderer/assets/index-BrSYlT0K.css +0 -1
- package/out/renderer/assets/infoDiagram-PH2N3AL5-D60ouGYJ.js +0 -2
- package/out/renderer/assets/mini-3YwvoUzA.js +0 -1
- package/out/renderer/assets/notifications-page-CGGNrnlN.js +0 -1
- package/out/renderer/assets/path-utils-CPXsvvn9.js +0 -62
- package/out/renderer/assets/pieDiagram-IB7DONF6-B0uHwbFa.js +0 -30
- package/out/renderer/assets/sankeyDiagram-QLVOVGJD-BAXr023A.js +0 -10
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-DZNDSiPs.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as e,c as J}from"./index-D4bPuJfm.js";import{o as Gt}from"./console-mirror-BuskFu7W.js";import{d as fe,A as Vt,B as Xt,a as Yt,C as Jt,E as Zt,i as ei,r as ti}from"./path-utils-CPXsvvn9.js";import{P as lt}from"./page-header-etXTK1uO.js";import{B as v,X as He,A as Se,b as Ct,C as _t,D as ve,d as be,e as we,f as ct,g as ee,u as Dt,S as dt,h as Rt,i as ii,j as si,k as ni,l as Ne,m as qe,n as ue,o as ai,p as oi,q as ri}from"./error-boundary-B-SnNd1V.js";import{as as We,at as li,au as ci,av as di,aw as ut,ax as ft,ay as Tt,az as ui,aA as fi,aB as W,aC as mi,aD as hi,aE as xi,aF as pi,aG as gi,aH as ki,aI as ji,aJ as At,aK as yi,aL as $e,aM as vi,aN as bi,aO as wi,aP as Ni,aQ as Si,aR as mt,aS as Ci,aT as _i,aU as Di,aV as Ri,aW as Ti,aX as Le,aY as ht,aZ as xt,a_ as je,a$ as pt,b0 as Be,b1 as Et,W as gt,b2 as Ai,b3 as kt,b4 as It,b5 as ye,b6 as Ei,b7 as Ii,b8 as zi}from"./conversation-input-sync-C8YlJ1EX.js";import{t as i}from"./messages-DoRCUI0R.js";import{P as Mi}from"./project-markdown-g0FzepON.js";import{A as Fi,F as Oi,h as jt,R as qi,C as zt}from"./index-Bk9OdcdM.js";async function yt(s,n){const f=Object.freeze({...n.scope}),r=n.throughSeq,l=new Map;if(n.verb==="read"&&"all"in f)for(const d of n.waiting)l.set(d.id,Object.freeze({...d}));let p;const g=new Set;do{const d=await s({state:n.verb==="read"?"unread":"all",limit:100,throughSeq:r,source:"notify",..."sessionId"in f?{sessionId:f.sessionId}:{},...p?{cursor:p}:{}});for(const m of d.observed)!m.id.startsWith("ask:")&&!l.has(m.id)&&l.set(m.id,Object.freeze({...m}));if(p=d.next_cursor||void 0,p&&g.has(p))throw new Error("Notification cursor did not advance");p&&g.add(p)}while(p);return Object.freeze({scope:f,throughSeq:r,tokens:Object.freeze([...l.values()])})}const Ce=s=>({changed:s.changed.length,skipped:s.skipped.length,pending:s.pending.length}),Li=(s,n)=>s.changed.length===n&&s.skipped.length===0&&s.pending.length===0&&s.error===void 0,Bi=s=>s==="read"?"unread":s==="unread"?"read":s==="dismiss"?"undismiss":"dismiss";async function vt(s,n,f,r,l){const p=[...new Map(f.map(m=>[m.id,{...m}])).values()],g={changed:[],skipped:[],pending:p},d=new Set;l?.(Ce(g));for(let m=0;m<p.length;m+=500){const _=p.slice(m,m+500),z=new Map(_.map(S=>[S.id,S]));try{const S=await s(n,r?{...r.scope,throughSeq:r.throughSeq,observed:_}:{items:_});for(const C of S.changed){const b=z.get(C);b&&!d.has(C)&&(g.changed.push(b),d.add(C))}for(const C of S.skipped)z.has(C.id)&&!d.has(C.id)&&(g.skipped.push(C),d.add(C.id))}catch(S){g.error=S}if(g.pending=p.filter(S=>!d.has(S.id)),l?.(Ce(g)),g.error)break}return g}const Ki={},Pi=({item:s,detail:n,loading:f,error:r,nowMs:l,narrow:p,writesPaused:g,sessionDismissCount:d,onClose:m,onOpenConversation:_,onToggleRead:z,onDismiss:S,onDismissSession:C,onCopyLink:b,onOpenProject:R,onAsksSettled:T})=>{const x=n?.item??s,B=x.dismissed,$=We(x),M=g||B,O=x.session.title||i("ui.notifications.group.untitled"),h=x.repeat_count>1?x.repeat_count:0,[N,H]=o.useState(!1),P=n?.history??[],G=N?P:P.slice(0,5),V=n?.projects??x.projects??[],F=n?.item.body_md??"";return e.jsxs("section",{"aria-label":i("ui.notifications.detail.label"),"data-notification-detail":x.id,className:"flex min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden px-6 py-4 [scrollbar-gutter:stable]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p?e.jsxs(v,{variant:"ghost",size:"sm",onClick:m,children:[e.jsx(Fi,{className:"rtl:-scale-x-100","aria-hidden":"true"}),i("ui.notifications.detail.back")]}):e.jsxs("span",{className:"flex items-center gap-2 text-meta",children:[x.source==="ask"?e.jsx(li,{size:14,"aria-hidden":"true",className:"text-info"}):e.jsx(ci,{priority:x.priority}),e.jsx("span",{className:J(x.priority==="high"?"text-warning":"text-ink-muted"),children:di(x)}),e.jsx("span",{"aria-hidden":"true",className:"text-ink-dim",children:"·"}),e.jsx("span",{className:"text-ink-muted",children:x.source==="ask"?i("ui.notifications.detail.kind.ask"):i("ui.notifications.detail.kind.update")})]}),!p&&e.jsx(v,{variant:"ghost",size:"icon-sm","aria-label":i("ui.notifications.detail.close"),title:i("ui.notifications.detail.close"),onClick:m,children:e.jsx(He,{"aria-hidden":"true"})})]}),e.jsx("h2",{className:"mt-3 text-heading text-ink","data-notification-detail-title":"",tabIndex:-1,children:x.title}),e.jsxs("p",{className:"mt-1 flex flex-wrap items-center gap-x-1.5 text-ink-dim text-meta",children:[e.jsx("span",{className:"text-ink-muted",children:O}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("span",{children:ut(ft(x.updated_at,l))}),h>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("span",{children:i("ui.notifications.detail.meta.updates_since",{count:h,time:Tt(x.created_at,{hour:"2-digit",minute:"2-digit"})})})]})]}),B&&e.jsx(Se,{variant:"neutral",className:"mt-3",role:"status",children:i("ui.notifications.detail.gone.dismissed")}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsxs(v,{variant:"primary",size:"sm",onClick:()=>_(x.session.id),"data-notification-open-conversation":"",children:[e.jsx(ui,{"aria-hidden":"true",className:"rtl:-scale-x-100"}),i("ui.notifications.detail.open_conversation")]}),e.jsxs(v,{variant:"secondary",size:"sm","aria-disabled":M||void 0,className:M?"text-ink-disabled":void 0,title:g?i("ui.notifications.writes_paused_tip"):void 0,onClick:()=>{M||z(x)},"data-notification-toggle-read":"",children:[x.read?e.jsx(Ct,{"aria-hidden":"true"}):e.jsx(_t,{"aria-hidden":"true"}),x.read?i("ui.notifications.row.mark_unread"):i("ui.notifications.row.mark_read")]}),!$&&e.jsxs(v,{variant:"secondary",size:"sm","aria-disabled":M||void 0,className:M?"text-ink-disabled":void 0,title:g?i("ui.notifications.writes_paused_tip"):void 0,onClick:()=>{M||S(x)},"data-notification-dismiss":"",children:[e.jsx(He,{"aria-hidden":"true"}),i("ui.notifications.detail.dismiss")]}),e.jsxs(ve,{children:[e.jsx(be,{asChild:!0,children:e.jsx(v,{variant:"ghost",size:"icon-sm","aria-label":i("ui.notifications.row.more"),title:i("ui.notifications.row.more"),children:e.jsx(fi,{"aria-hidden":"true"})})}),e.jsxs(we,{align:"end",children:[e.jsx(ct,{disabled:M||(d===null?!1:d===0),onSelect:()=>C(x.session.id,O),children:i("ui.notifications.detail.more.dismiss_session",{source:O})}),e.jsx(ct,{onSelect:()=>b(x),children:i("ui.notifications.detail.more.copy_link")})]})]})]}),r&&!n&&e.jsx(Se,{variant:"danger",className:"mt-4",role:"alert",children:i("ui.notifications.detail.error")}),f&&!n?e.jsxs("div",{className:"mt-4 flex flex-col gap-2",role:"status","aria-label":i("ui.notifications.detail.loading"),children:[e.jsx(ee,{className:"h-3 w-full bg-elevated"}),e.jsx(ee,{className:"h-3 w-5/6 bg-elevated"}),e.jsx(ee,{className:"h-3 w-2/3 bg-elevated"})]}):F?e.jsx(Mi,{className:"mt-4 text-body text-ink",children:F}):x.excerpt?e.jsx("p",{className:"mt-4 text-body text-ink",children:x.excerpt}):null,(n?.item.links?.length??0)>0&&e.jsx(oe,{title:i("ui.notifications.detail.section.links"),children:e.jsx("ul",{className:"flex flex-col gap-1",children:n?.item.links?.map(k=>e.jsx("li",{children:e.jsx("a",{href:k.url,target:"_blank",rel:"noreferrer",className:"text-accent text-body-sm underline-offset-2 hover:underline",children:k.label||k.url})},k.url))})}),n?.anchor?.excerpt&&e.jsx(oe,{title:i("ui.notifications.detail.section.context"),children:e.jsx("p",{className:"line-clamp-4 text-body-sm text-ink-muted",children:n.anchor.excerpt})}),(n?.asks?.length??0)>0&&e.jsx(oe,{title:i("ui.notifications.detail.section.waiting"),children:e.jsx(Qi,{sessionId:x.session.id,asks:n?.asks??[],nowMs:l,onSettled:T})}),e.jsx(oe,{title:i("ui.notifications.detail.section.from"),children:e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md bg-surface px-3 py-2",children:[e.jsx("button",{type:"button",onClick:()=>_(x.session.id),className:"min-w-0 truncate text-start text-body-sm text-ink hover:underline",children:n?.session.title||O}),d!==0&&e.jsx(v,{variant:"ghost",size:"sm",className:"min-w-[6.5rem] shrink-0 tabular-nums","data-detail-dismiss-all":d===null?"counting":"ready","aria-busy":d===null||void 0,"aria-disabled":M||d===null||void 0,onClick:()=>{M||d===null||C(x.session.id,O)},children:i("ui.notifications.detail.from.dismiss_all",{count:d===null?"…":W(d)})})]})}),V.length>0&&e.jsx(oe,{title:i("ui.notifications.detail.section.projects"),children:e.jsx("ul",{className:"flex flex-col gap-1",children:V.map(k=>e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>R(k.key),className:"flex items-center gap-2 rounded-sm px-2 py-1 text-start text-body-sm text-ink hover:bg-row-hover",children:[e.jsx(Oi,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-muted"}),e.jsx("span",{className:"min-w-0 truncate",children:k.name}),k.status&&e.jsx("span",{className:"text-ink-dim text-meta",children:k.status})]})},k.key))})}),P.length>0&&e.jsxs(oe,{title:i("ui.notifications.detail.section.history"),children:[e.jsx("ol",{className:"flex flex-col gap-2",children:G.map(k=>e.jsxs("li",{className:"flex flex-col gap-0.5","data-history-revision":k.revision,children:[e.jsxs("span",{className:"flex items-baseline justify-between gap-2 text-body-sm text-ink",children:[e.jsx("span",{className:"min-w-0 truncate",children:k.title}),e.jsx("span",{className:"shrink-0 text-ink-dim text-meta tabular-nums",children:ut(ft(k.at,l))})]}),k.excerpt&&e.jsx("span",{className:"truncate text-ink-dim text-meta",children:k.excerpt})]},k.revision))}),P.length>5&&!N&&e.jsx(v,{variant:"ghost",size:"sm",className:"self-start",onClick:()=>H(!0),children:i("ui.notifications.detail.history.show_all",{count:W(P.length)})})]})]})},oe=({title:s,children:n})=>e.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[e.jsx("h3",{className:"text-ink-muted text-meta",children:s}),n]}),Qi=({sessionId:s,asks:n,nowMs:f,onSettled:r})=>{const l=o.useRef(mi()).current,[p,g]=o.useState(Ki),[d,m]=o.useState({}),[_,z]=o.useState(!1),S=o.useMemo(()=>hi({asks:n,asks_open:n.filter(b=>b.status==="open").length,asks_truncated:!1},d),[n,d]),C=o.useCallback((b,R)=>{l.held||(z(!0),m(T=>({...T,[b]:{sending:!0,refused:null}})),(async()=>{let T;try{T=await R()}finally{z(!1)}m(x=>({...x,[b]:{sending:!1,refused:T.status==="failed"?xi(T.error):null}})),T.status==="sent"&&r()})())},[l,r]);return e.jsx(pi,{view:S,nowMs:f,answering:_,outcomes:d,drafts:p,onDraftChange:(b,R)=>g(T=>({...T,[b]:R})),onAnswer:(b,R)=>C(b.ask_id,()=>ji({taskId:b.ask_id,answers:R,sessionId:s,lock:l},T=>fe(T))),onDecline:b=>C(b.ask_id,()=>ki({taskId:b.ask_id,sessionId:s,lock:l},R=>fe(R))),onDismiss:(b,R)=>C(b.ask_id,()=>gi({taskId:b.ask_id,reason:R,sessionId:s,lock:l},T=>fe(T)))})},Ke=120,Pe=180,Ui=({exiting:s,children:n,onExited:f})=>{const r=At("(prefers-reduced-motion: reduce)"),[l,p]=o.useState("idle"),[g,d]=o.useState(null),m=o.useRef(null),_=o.useRef(!1);o.useLayoutEffect(()=>{if(s&&!_.current){if(_.current=!0,r){f();return}d(m.current?.getBoundingClientRect().height??56),p("leaving")}else!s&&_.current&&(_.current=!1,p("idle"),d(null))},[s,r,f]),o.useEffect(()=>{if(!s||r||l==="idle")return;if(l==="leaving"){const C=setTimeout(()=>p("collapsing"),Ke);return()=>clearTimeout(C)}const S=setTimeout(f,Pe);return()=>clearTimeout(S)},[s,l,r,f]);const z={height:l==="collapsing"?0:g??void 0,overflow:l==="idle"?void 0:"hidden",transition:l==="idle"||r?void 0:l==="leaving"?`opacity ${Ke}ms var(--ease-out-quart), transform ${Ke}ms var(--ease-out-quart)`:`height ${Pe}ms var(--ease-out-quart), opacity ${Pe}ms var(--ease-out-quart)`,opacity:l==="idle"?void 0:0,transform:l==="leaving"?"translateY(-8px)":void 0,pointerEvents:l==="idle"?void 0:"none"};return e.jsx("div",{ref:m,style:z,className:J("shrink-0",l!=="idle"&&"motion-reduce:hidden"),"aria-hidden":l!=="idle"||void 0,...l!=="idle"?{inert:""}:{},"data-notification-exit":l==="idle"?void 0:l,children:n})},Hi=({progress:s})=>(Dt(),e.jsx("output",{className:"shrink-0 px-6 py-1 text-meta text-ink-muted","data-notification-operation":"",children:i("ui.notifications.operation.progress",s)})),bt=(s,n)=>{s&&(s.pending.length>0||s.error!==void 0)||n(null)},Wi=(s,n,f)=>{const r=o.useRef(s);r.current=s;const l=ei({queryKey:["desktop","notifications","session-scope-counts",f],enabled:n&&s!==void 0,queryFn:()=>Ii(zi(r.current)),retry:ti,staleTime:5e3,refetchOnWindowFocus:!1});return{counts:l.data,pending:s===void 0||l.data===void 0}},wt=s=>i("ui.notifications.operation.progress",s),Qe="notifications-read-state",Mt="notifications-grouping",Nt=(s,n,f)=>{try{const r=localStorage.getItem(s);return n.includes(r)?r:f}catch{return f}},Ge=(s,n)=>{try{localStorage.setItem(s,n)}catch{}},cs=({nowMs:s})=>{Dt();const{notificationId:n}=Vt(),f=Xt(),r=Yt(),p=Jt(r.data,"notifications",1)==="enabled",g=s??Date.now(),d=!At("(min-width: 1100px)"),{client:m}=Zt(),[_,z]=o.useState(()=>Nt(Qe,["unread","all"],"unread")),[S,C]=o.useState(()=>Nt(Mt,["time","conversation"],"time")),[b]=yi(),[R,T]=o.useState(()=>({...$e,from:b.get("from")||null})),[x,B]=o.useState(()=>new Set),[$,M]=o.useState(null),[O,h]=o.useState(null),[N,H]=o.useState(null),[P,G]=o.useState(null),[V,F]=o.useState(!1),k=o.useRef(!1),[_e,te]=o.useState(()=>new Map),De=o.useRef(new Map),[Ft,Ve]=o.useState(0),[Xe,Ot]=o.useState(null),[qt,Ye]=o.useState(!0),me=o.useRef(null),E=vi(_,p,{atTop:qt}),Je=bi(),U=wi(n??null,p),Lt=Ni(U.data?.item.session.id??null,p&&!!U.data?.item.session.id);o.useEffect(()=>{E.isSuccess&&!E.isFetching&&Ot(E.dataUpdatedAt)},[E.isSuccess,E.isFetching,E.dataUpdatedAt]);const I=E.data,ie=o.useMemo(()=>{const t=Si(I?.items??[],De.current);if(_!=="unread"||_e.size===0)return t;const a=new Set(t.map(c=>c.id));return[...t,...[..._e.values()].filter(c=>!a.has(c.id))]},[I,_,_e,Ft]),se=I?.waiting??[],Re=o.useMemo(()=>mt(ie,R),[ie,R]),Te=o.useMemo(()=>mt(se,R),[se,R]),Bt=Re.filter(t=>!t.read).length+Te.filter(t=>!t.read).length,Ae=o.useMemo(()=>Ci(Re,Te,S,g),[Re,Te,S,g]),w=o.useMemo(()=>_i(Ae),[Ae]),Ee=o.useMemo(()=>{const t=new Map;for(const a of[...se,...ie])t.set(a.id,a);return t},[ie,se]),Kt=o.useMemo(()=>{const t=new Map;for(const a of[...se,...ie]){const c=t.get(a.session.id)??[a.session.id,a.session.title||i("ui.notifications.group.untitled"),0];c[2]+=1,t.set(a.session.id,c)}return[...t.values()].sort((a,c)=>c[2]-a[2])},[ie,se]),Ze=E.isError&&!!I,et=Wi(I?.high_water,!!I&&Ti(S,!!n),[Di(I?.items??[],U.data?.item.session.id??""),Ri(U.data?.item.session.id?Lt.data:void 0)].join("|")).counts,K=Ze||V,[Pt,Ie]=o.useState(()=>new Set),he=o.useCallback(t=>{Ie(a=>new Set([...a,...t]))},[]),tt=o.useCallback(t=>{Ie(a=>{const c=new Set(a);for(const u of t)c.delete(u);return c})},[]),Qt=o.useCallback(t=>{Ie(a=>{const c=new Set(a);return c.delete(t),c})},[]),ne=n?Ee.get(n)??U.data?.item??null:null,ze=o.useRef(null);o.useEffect(()=>{if(!n){ze.current=null;return}const t=U.data?.item;!t||t.id!==n||ze.current===t.id||(ze.current=t.id,!(t.read||t.dismissed||K)&&Je.mutate({verb:"read",target:{items:Le([t])}}))},[n,U.data,Je,K]);const xe=o.useCallback(()=>{B(new Set),M(null)},[]),Z=o.useRef(null),Me=o.useCallback(async(t,a)=>{if(k.current)return;k.current=!0,F(!0),Z.current=null;let c=null;try{const u=await vt(ht,t,a,void 0,G),D=Ce(u);t==="unread"&&te(j=>{const q=new Map(j);for(const y of u.changed)q.delete(y.id);return q}),Li(u,a.length)?xt(i("ui.notifications.toast.undone")):je(wt(D)),c=u,pt(m,t,u.changed.map(j=>j.id))}finally{k.current=!1,F(!1),bt(c,G)}},[m]),X=o.useCallback(async(t,a,c,u,D=!1)=>{if(k.current&&!D)return;k.current=!0,F(!0);let j=null;Z.current=null;try{const q="items"in a?void 0:{scope:"sessionId"in a?{sessionId:a.sessionId}:{all:!0},throughSeq:a.throughSeq,tokens:c},y=await vt(ht,t,c,q,G),A=Ce(y);t==="read"?(te(Q=>{const de=new Map(Q);for(const ae of y.changed){const Oe=Ee.get(ae.id);Oe?de.set(Oe.id,{...Oe,read:!0,read_via:"explicit"}):De.current.set(ae.id,ae.revision)}return de}),Ve(Q=>Q+1)):t==="unread"&&(te(Q=>{const de=new Map(Q);for(const ae of y.changed)de.delete(ae.id),De.current.delete(ae.id);return de}),Ve(Q=>Q+1));const L=y.changed.length?{verb:Bi(t),items:y.changed,at:Date.now()}:null;Z.current=L;const Y=u({changed:y.changed.map(Q=>Q.id),skipped:y.skipped}),ce=A.pending>0||A.skipped>0;je([Y,ce?wt(A):null].filter(Boolean).join(". "),{duration:Be,action:L?{label:i("ui.notifications.toast.undo"),onClick:()=>{Z.current===L&&Date.now()-L.at<=Be&&Me(L.verb,L.items)}}:void 0}),j=y,pt(m,t,y.changed.map(Q=>Q.id))}finally{k.current=!1,F(!1),j?.error&&tt(new Set(c.map(q=>q.id))),bt(j,G)}},[m,Ee,tt,Me]),pe=o.useCallback(t=>{if(t.length===0||K)return;const a=t.some(j=>!j.read),c=a?"read":"unread",u=t.filter(j=>a?!j.read:j.read),D=Le(u);X(c,{items:D},D,j=>c==="read"?i("ui.notifications.toast.marked_read",{count:W(j.changed.length)}):i("ui.notifications.toast.marked_unread",{count:W(j.changed.length)}))},[X,K]),ge=o.useCallback(t=>{if(K)return;const{dismissable:a,asksStaying:c}=Et(t);if(a.length===0){c>0&&je(i("ui.notifications.ask.stays"));return}const u=Le(a),D=new Set(a.map(y=>y.id));he(D);const j=w.findIndex(y=>D.has(y.id)),q=w.slice(j+1).find(y=>!D.has(y.id))??[...w.slice(0,j)].reverse().find(y=>!D.has(y.id));h(q?.id??null),n&&D.has(n)&&f("/notifications"),xe(),X("dismiss",{items:u},u,y=>{const A=y.skipped.filter(ce=>ce.reason==="live_ask").length,L=i("ui.notifications.toast.dismissed",{count:y.changed.length}),Y=c+A;return Y>0?`${L}. ${i("ui.notifications.select.asks_stay",{count:Y})}`:L})},[he,xe,f,n,w,X,K]),Fe=o.useCallback(async(t,a)=>{if(!(!I||K||k.current)){k.current=!0,F(!0);try{const c=await yt(u=>fe({op:"notifications.list",...u}),{scope:{sessionId:t},throughSeq:I.high_water,waiting:[],verb:"dismiss"});c.tokens.length&&H({sessionId:t,title:a,count:c.tokens.length,snapshot:c})}catch{gt(i("ui.notifications.error.load.title"))}finally{k.current=!1,F(!1)}}},[I,K]),Ut=o.useCallback(()=>{if(!N)return;const{snapshot:t}=N;H(null),n&&t.tokens.some(a=>a.id===n)&&f("/notifications"),X("dismiss",{...t.scope,throughSeq:t.throughSeq,observed:[...t.tokens]},[...t.tokens],a=>{const c=new Set(w.map(D=>D.id)),u=Ai(c,a.changed);return u.size>0&&(he(u),te(D=>{const j=new Map(D);for(const q of u)j.delete(q);return j})),i("ui.notifications.toast.dismissed",{count:a.changed.length})})},[N,f,n,X,w,he]),Ht=o.useCallback(async()=>{if(!(!I||K||k.current)){k.current=!0,F(!0);try{const t=new Set((I.waiting??[]).filter(c=>!c.read).map(c=>c.id)),a=await yt(c=>fe({op:"notifications.list",...c}),{scope:{all:!0},throughSeq:I.high_water,waiting:I.observed.filter(c=>t.has(c.id)),verb:"read"});await X("read",{all:!0,throughSeq:a.throughSeq,observed:[...a.tokens]},[...a.tokens],c=>i("ui.notifications.toast.marked_read",{count:W(c.changed.length)}),!0)}catch{gt(i("ui.notifications.error.load.title"))}finally{k.current=!1,F(!1)}}},[I,X,K]),re=o.useCallback(t=>{h(t.id),f(`/notifications/${encodeURIComponent(t.id)}`)},[f]),it=o.useCallback(()=>{const t=n;f("/notifications"),t&&h(t)},[f,n]),st=o.useCallback(t=>{Gt(f,t)},[f]),nt=o.useCallback((t,a)=>{B(c=>{if(a)return kt(w,$,t.id,c);const u=new Set(c);return u.has(t.id)?u.delete(t.id):u.add(t.id),u}),M(t.id)},[$,w]),at=o.useCallback(t=>{re(t),je(i("ui.notifications.ask.stays"))},[re]),ot=O&&w.some(t=>t.id===O)?O:w[0]?.id??null;o.useEffect(()=>{if(!O)return;const t=me.current?.querySelector(`[data-notification-row="${CSS.escape(O)}"]`);t&&me.current?.contains(document.activeElement)&&t.focus()},[O]);const Wt=t=>{if(t.target.closest("input, textarea, [contenteditable='true']"))return;const c=w.findIndex(A=>A.id===ot),u=c>=0?w[c]:void 0,D=A=>{const L=Math.max(0,Math.min(w.length-1,A)),Y=w[L];Y&&(t.shiftKey&&u&&B(ce=>kt(w,u.id,Y.id,ce)),h(Y.id))},j=t.metaKey||t.ctrlKey,q=w.filter(A=>x.has(A.id)),y=q.length>0?q:u?[u]:[];switch(t.key){case"ArrowDown":case"j":case"J":if(j)return;t.preventDefault(),D(c+1);return;case"ArrowUp":case"k":case"K":if(j)return;t.preventDefault(),D(c-1);return;case"Home":t.preventDefault(),D(0);return;case"End":t.preventDefault(),D(w.length-1);return;case"Enter":u&&(t.preventDefault(),re(u));return;case"o":case"O":u&&!j&&(t.preventDefault(),st(u.session.id));return;case"x":case"X":u&&!j&&(t.preventDefault(),nt(u,!1));return;case"a":case"A":if(j){t.preventDefault(),B(new Set(w.map(A=>A.id)));return}if(u){t.preventDefault();const A=w.find(L=>L.session.id===u.session.id&&We(L));re(A??u)}return;case"e":case"E":if(j||!u)return;if(t.preventDefault(),t.shiftKey){Fe(u.session.id,u.session.title||i("ui.notifications.group.untitled"));return}if(q.length===0&&We(u)){at(u);return}ge(y);return;case"u":case"U":if(j)return;t.preventDefault(),pe(y);return;case"z":case"Z":if(j&&Z.current){t.preventDefault();const A=Z.current;Z.current=null,Date.now()-A.at<=Be&&A.items.length>0&&Me(A.verb,A.items)}return;case"Escape":if(x.size>0){t.preventDefault(),xe();return}n&&(t.preventDefault(),it());return}};if(!p)return e.jsxs("div",{className:"flex h-full flex-col gap-8 p-6",children:[e.jsx(lt,{title:i("ui.notifications.page.title"),icon:jt}),r.isLoading?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(dt,{label:i("ui.notifications.page.checking")})}):e.jsx(Se,{variant:"warning",children:i("ui.notifications.page.unavailable")})]});const le=w.filter(t=>x.has(t.id)),ke=!!(n&&ne),$t=d&&ke,rt=I&&w.length===0?It(R)?"filtered":_==="unread"?"caught_up":"none":null;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col","data-notifications-page":"",children:[e.jsxs("div",{className:"flex shrink-0 flex-col gap-4 px-6 pt-6",children:[e.jsx(lt,{title:i("ui.notifications.page.title"),icon:jt,subtitle:i("ui.notifications.page.subtitle"),children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[E.newerCount>0&&e.jsxs(v,{size:"sm",variant:"secondary","data-notifications-back-to-top":"",onClick:()=>{me.current?.scrollTo({top:0}),Ye(!0),E.resetToTop()},children:[e.jsx(Rt,{"aria-hidden":"true"}),i("ui.notifications.new_pill",{count:W(E.newerCount)})]}),e.jsx(v,{variant:"ghost",size:"icon","aria-label":i("ui.notifications.page.refresh"),title:i("ui.notifications.page.refresh"),"aria-busy":E.isFetching||void 0,disabled:E.isFetching,onClick:()=>{te(new Map),E.resetToTop()},children:e.jsx(qi,{})})]})}),e.jsx(Xi,{loaded:I,readState:_,onReadState:t=>{z(t),te(new Map),Ge(Qe,t)},filters:R,setFilters:T,grouping:S,setGrouping:C,sources:Kt,writesPaused:K,markAllRead:Ht,selection:le,visibleCount:w.length,visibleUnread:Bt,onSelectAll:()=>B(le.length===w.length?new Set:new Set(w.map(t=>t.id))),onClearSelection:xe,onBulkRead:t=>pe(t==="read"?le.filter(a=>!a.read):le.filter(a=>a.read)),onBulkDismiss:()=>ge(le)})]}),Ze&&e.jsx("div",{className:"px-6 pt-3",children:e.jsxs(Se,{variant:"danger",role:"alert","data-notifications-refresh-error":"",children:[e.jsx("span",{className:"font-medium",children:i("ui.notifications.error.refresh.title")})," ",i("ui.notifications.error.refresh.body",{time:Xe?Tt(Xe,{hour:"2-digit",minute:"2-digit"}):""})]})}),e.jsxs("div",{className:"mt-3 flex min-h-0 flex-1",children:[!$t&&e.jsx("div",{className:J("flex min-h-0 flex-col",ke||!d?"w-[min(560px,46%)] shrink-0":"flex-1",d&&"w-full"),children:E.isError&&!I?e.jsxs("div",{className:"flex flex-col items-start gap-3 px-6 py-6",role:"alert",children:[e.jsx("p",{className:"text-body text-ink",children:i("ui.notifications.error.load.title")}),e.jsx(v,{variant:"secondary",onClick:()=>void E.refetch(),children:i("ui.notifications.error.retry")})]}):I?rt?e.jsx(Gi,{kind:rt,onShowAll:()=>{z("all"),Ge(Qe,"all")},onClearFilters:()=>T($e)}):e.jsx("div",{ref:me,role:"grid","aria-multiselectable":"true","aria-label":i("ui.notifications.page.list_label"),onKeyDown:Wt,onScroll:t=>{const a=t.currentTarget;Ye(a.scrollTop<=24),E.hasNextPage&&!E.isFetchingNextPage&&a.scrollHeight-a.scrollTop-a.clientHeight<160&&E.fetchNextPage()},className:"flex min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pb-6 [scrollbar-gutter:stable]","data-notifications-list":"",children:Ae.map(t=>e.jsx($i,{group:t,nowMs:g,openId:n??null,selected:x,focusedId:ot,writesPaused:K,exitingIds:Pt,onExitFinished:Qt,onOpen:re,onToggleSelect:nt,onToggleRead:a=>pe([a]),onDismiss:a=>ge([a]),onAnswer:at,onFocusRow:a=>h(a.id),onDismissSession:Fe,sessionCount:a=>et?.[a]??null},t.key))}):e.jsx(Ji,{})}),!d||ke?e.jsx("div",{className:J("flex min-h-0 flex-1 flex-col bg-surface",d&&"w-full"),children:ke&&ne?e.jsx(Pi,{item:ne,detail:U.data,loading:U.isLoading,error:U.isError,nowMs:g,narrow:d,writesPaused:K,sessionDismissCount:et?.[ne.session.id]??null,onClose:it,onOpenConversation:st,onToggleRead:t=>pe([t]),onDismiss:t=>ge([t]),onDismissSession:Fe,onCopyLink:t=>{navigator.clipboard?.writeText(`/notifications/${t.id}`).then(()=>xt(i("ui.notifications.toast.copied")))},onOpenProject:t=>f(`/projects/${encodeURIComponent(t)}`),onAsksSettled:()=>{m.invalidateQueries({queryKey:ye.factsRoot}),m.invalidateQueries({queryKey:ye.sessionFactsAll}),m.invalidateQueries({queryKey:ye.count}),m.invalidateQueries({queryKey:ye.detail(ne.id)})}},ne.id):e.jsx(Yi,{})}):null]}),V&&!P&&e.jsx(dt,{label:i("ui.notifications.page.loading")}),P&&e.jsx(Hi,{progress:P}),N&&e.jsx(Vi,{title:N.title,count:N.count,onConfirm:Ut,onCancel:()=>H(null)})]})},St=s=>{switch(s.kind){case"waiting":return i("ui.notifications.group.waiting");case"conversation":return s.title||i("ui.notifications.group.untitled");case"time":return s.key==="today"?i("ui.notifications.group.today"):s.key==="yesterday"?i("ui.notifications.group.yesterday"):s.key==="week"?i("ui.notifications.group.week"):i("ui.notifications.group.older")}},$i=({group:s,onDismissSession:n,sessionCount:f,...r})=>{const[l,p]=o.useState(s.kind==="time"&&s.key==="older"),g=s.kind==="conversation"?f(s.sessionId):0;return e.jsxs("div",{role:"rowgroup","data-notification-group":s.key,children:[e.jsxs("div",{role:"row",tabIndex:-1,className:"sticky top-0 z-[1] flex h-8 items-center gap-2 bg-canvas px-3 text-ink-muted text-meta",children:[e.jsx("span",{role:"rowheader",className:"flex min-w-0 items-center gap-1.5",children:s.kind==="time"&&s.key==="older"?e.jsxs("button",{type:"button",className:"inline-flex min-h-6 items-center gap-1 hover:text-ink","aria-expanded":!l,onClick:()=>p(d=>!d),children:[St(s),e.jsx("span",{className:"text-ink-dim tabular-nums",children:s.items.length}),l?e.jsx(Ne,{size:12}):e.jsx(Rt,{size:12})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"truncate",children:St(s)}),e.jsx("span",{className:"text-ink-dim tabular-nums",children:s.items.length})]})}),s.kind==="conversation"&&g!==null&&g>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",className:"h-px flex-1 bg-hairline"}),e.jsx(v,{variant:"ghost",size:"sm",onClick:()=>n(s.sessionId,s.title),children:i("ui.notifications.group.dismiss_session",{count:W(g)})})]})]}),!l&&s.items.map(d=>e.jsx(Ui,{exiting:r.exitingIds.has(d.id),onExited:()=>r.onExitFinished(d.id),children:e.jsx(Ei,{item:d,nowMs:r.nowMs,open:r.openId===d.id,picked:r.selected.has(d.id),selecting:r.selected.size>0,focused:r.focusedId===d.id,writesPaused:r.writesPaused,onOpen:r.onOpen,onToggleSelect:r.onToggleSelect,onToggleRead:r.onToggleRead,onDismiss:r.onDismiss,onAnswer:r.onAnswer,onFocusRow:r.onFocusRow})},d.id))]})},Gi=({kind:s,onShowAll:n,onClearFilters:f})=>e.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-6 py-16 text-center","data-notifications-empty":s,children:[s==="caught_up"&&e.jsx(zt,{size:24,"aria-hidden":"true",className:"text-ink-muted"}),e.jsx("p",{className:"text-heading text-ink",children:s==="caught_up"?i("ui.notifications.empty.caught_up.title"):s==="none"?i("ui.notifications.empty.none.title"):i("ui.notifications.empty.filtered.title")}),s!=="filtered"&&e.jsx("p",{className:"max-w-96 text-body-sm text-ink-muted",children:s==="caught_up"?i("ui.notifications.empty.caught_up.body"):i("ui.notifications.empty.none.body")}),s==="caught_up"&&e.jsx(v,{variant:"secondary",onClick:n,children:i("ui.notifications.empty.caught_up.show_all")}),s==="filtered"&&e.jsx(v,{variant:"secondary",onClick:f,children:i("ui.notifications.filter.clear")})]}),Vi=({title:s,count:n,onConfirm:f,onCancel:r})=>e.jsx(ai,{open:!0,onOpenChange:l=>!l&&r(),children:e.jsxs(oi,{className:"max-w-sm",children:[e.jsx(ri,{children:i("ui.notifications.confirm.dismiss_session",{count:n,source:s})}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx(v,{variant:"secondary",onClick:r,children:i("ui.notifications.confirm.cancel")}),e.jsx(v,{variant:"primary",autoFocus:!0,onClick:f,"data-notifications-confirm":"",children:i("ui.notifications.confirm.dismiss_session_ok")})]})]})}),Xi=({loaded:s,readState:n,onReadState:f,filters:r,setFilters:l,grouping:p,setGrouping:g,sources:d,writesPaused:m,markAllRead:_,selection:z,visibleCount:S,visibleUnread:C,onSelectAll:b,onClearSelection:R,onBulkRead:T,onBulkDismiss:x})=>{const{dismissable:B,asksStaying:$}=Et(z),M=z.length>0,O=z.length===0?!1:z.length===S?!0:"indeterminate";return e.jsx("div",{className:"flex min-h-11 shrink-0 flex-wrap items-center gap-2 border-hairline border-b py-2","data-notifications-toolbar":M?"selection":"filters",children:M?e.jsxs(e.Fragment,{children:[e.jsx(ii,{checked:O,"aria-label":i("ui.notifications.select.all"),onCheckedChange:b}),e.jsx("span",{className:"font-medium text-body-sm text-ink",children:i("ui.notifications.select.count",{count:W(z.length)})}),e.jsxs(v,{variant:"secondary",size:"sm","aria-disabled":m||void 0,onClick:()=>!m&&T("read"),children:[e.jsx(_t,{}),i("ui.notifications.select.mark_read")]}),e.jsxs(v,{variant:"secondary",size:"sm","aria-disabled":m||void 0,onClick:()=>!m&&T("unread"),children:[e.jsx(Ct,{}),i("ui.notifications.select.mark_unread")]}),e.jsxs(v,{variant:"secondary",size:"sm","aria-disabled":m||B.length===0||void 0,onClick:()=>!m&&B.length>0&&x(),"data-notifications-bulk-dismiss":B.length,children:[e.jsx(He,{}),i("ui.notifications.select.dismiss",{count:W(B.length)})]}),$>0&&e.jsx("span",{className:"text-ink-dim text-meta",role:"status","data-notifications-asks-stay":$,children:i("ui.notifications.select.asks_stay",{count:$})}),e.jsx("span",{className:"flex-1"}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:R,children:[i("ui.notifications.select.clear"),e.jsx("kbd",{className:"ms-1 text-ink-dim text-meta",children:"Esc"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{role:"radiogroup","aria-label":i("ui.notifications.filter.read_state"),className:"flex items-center gap-0.5 rounded-sm bg-sunken p-0.5",children:["unread","all"].map(h=>e.jsxs("button",{type:"button",role:"radio","aria-checked":n===h,onClick:()=>f(h),className:J("flex h-7 items-center gap-1.5 rounded-xs px-2.5 text-body-sm",n===h?"bg-elevated text-ink":"text-ink-muted hover:text-ink"),children:[h==="unread"?i("ui.notifications.filter.unread"):i("ui.notifications.filter.all"),h==="unread"&&C>0&&e.jsx(si,{variant:"neutral",size:"count",children:ni(C,99)})]},h))}),[{label:i("ui.notifications.filter.kind"),value:r.kind,options:["all","asks","updates"],isDefault:r.kind==="all",set:h=>l(N=>({...N,kind:h})),optionLabel:h=>h==="asks"?i("ui.notifications.filter.kind_asks"):h==="updates"?i("ui.notifications.filter.kind_updates"):i("ui.notifications.filter.kind_all")},{label:i("ui.notifications.filter.priority"),value:r.priority,options:["any","high","normal_up"],isDefault:r.priority==="any",set:h=>l(N=>({...N,priority:h})),optionLabel:h=>h==="high"?i("ui.notifications.filter.priority_high"):h==="normal_up"?i("ui.notifications.filter.priority_normal_up"):i("ui.notifications.filter.priority_any")}].map(({label:h,value:N,options:H,isDefault:P,set:G,optionLabel:V})=>e.jsxs(ve,{children:[e.jsx(be,{asChild:!0,children:e.jsxs(v,{variant:"secondary",size:"sm",disabled:!s,children:[e.jsx(Ue,{label:h,value:V(N),emphasised:!P}),e.jsx(Ne,{})]})}),e.jsx(we,{align:"start",children:e.jsx(qe,{value:N,onValueChange:G,children:H.map(F=>e.jsx(ue,{value:F,children:V(F)},F))})})]},h)),d.length>0&&e.jsxs(ve,{children:[e.jsx(be,{asChild:!0,children:e.jsxs(v,{variant:"secondary",size:"sm",disabled:!s,children:[e.jsx(Ue,{label:i("ui.notifications.filter.from"),value:r.from===null?i("ui.notifications.filter.from_all"):d.find(([h])=>h===r.from)?.[1]??i("ui.notifications.group.untitled"),emphasised:r.from!==null}),e.jsx(Ne,{})]})}),e.jsx(we,{align:"start",children:e.jsxs(qe,{value:r.from??"",onValueChange:h=>l(N=>({...N,from:h||null})),children:[e.jsx(ue,{value:"",children:i("ui.notifications.filter.from_all")}),d.map(([h,N,H])=>e.jsxs(ue,{value:h,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:N}),e.jsx("span",{className:"ms-3 text-ink-dim text-meta tabular-nums",children:H})]},h))]})})]}),It(r)&&e.jsx(v,{variant:"ghost",size:"sm",onClick:()=>l(()=>$e),children:i("ui.notifications.filter.clear")}),e.jsx("span",{className:"flex-1"}),e.jsxs(ve,{children:[e.jsx(be,{asChild:!0,children:e.jsxs(v,{variant:"secondary",size:"sm",children:[e.jsx(Ue,{label:i("ui.notifications.filter.group"),value:p==="time"?i("ui.notifications.filter.group_time"):i("ui.notifications.filter.group_conversation"),emphasised:p!=="time"}),e.jsx(Ne,{})]})}),e.jsx(we,{align:"end",children:e.jsxs(qe,{value:p,onValueChange:h=>{const N=h==="conversation"?"conversation":"time";g(N),Ge(Mt,N)},children:[e.jsx(ue,{value:"time",children:i("ui.notifications.filter.group_time")}),e.jsx(ue,{value:"conversation",children:i("ui.notifications.filter.group_conversation")})]})})]}),e.jsxs(v,{variant:"secondary",size:"sm",disabled:!s||(s?.unread_count??0)+(s?.waiting_unread_count??0)===0,"aria-disabled":m||void 0,title:m?i("ui.notifications.writes_paused_tip"):void 0,onClick:()=>{!s||m||s.unread_count+s.waiting_unread_count===0||_()},"data-notifications-mark-all":"",children:[e.jsx(zt,{}),i("ui.notifications.action.mark_all_read")]})]})})},Ue=({label:s,value:n,emphasised:f})=>{const r=i("ui.notifications.filter.chip",{label:s,value:n}),l=r.lastIndexOf(n);return l<0?e.jsx("span",{children:r}):e.jsxs("span",{children:[r.slice(0,l),e.jsx("span",{className:J(f&&"font-semibold"),children:n}),r.slice(l+n.length)]})},Yi=()=>e.jsx("div",{className:"flex h-full items-center justify-center p-6 text-center text-ink-dim text-body-sm",children:i("ui.notifications.detail.empty")}),Ji=()=>e.jsx("div",{role:"status","aria-label":i("ui.notifications.page.loading"),className:"flex flex-col",children:Array.from({length:7},(s,n)=>e.jsxs("div",{className:"flex h-14 items-center gap-3 px-3","data-notification-skeleton":"",children:[e.jsx(ee,{className:"size-1.5 rounded-full bg-elevated"}),e.jsx(ee,{className:"size-4 bg-elevated"}),e.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[e.jsx(ee,{className:J("h-3 bg-elevated",n%2?"w-2/3":"w-1/2")}),e.jsx(ee,{className:J("h-2.5 bg-elevated",n%3?"w-1/3":"w-2/5")})]})]},n))});export{cs as NotificationsPage,Be as UNDO_WINDOW_MS};
|