1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2991],{20504:(e,s,t)=>{t.d(s,{A:()=>o});var r=t(62384),a=t(10691),n=t.n(a);t(35260);var d=t(59123);function l({href:e,children:s,className:t,openInNewTab:a=!0}){let n="/docs"===e||e.startsWith("/docs/")?(0,d.J)(e):e;return(0,r.jsx)("a",{href:n,className:t,target:a?"_blank":void 0,rel:a?"noopener noreferrer":void 0,children:s})}var i=t(12002);function o({backHref:e="/admin",label:s="â Back to Admin",className:t,helpHref:a,helpLabel:d="Need help?"}){return(0,r.jsxs)("div",{className:(0,i.cn)("dashboard-view-header flex items-center justify-between gap-4",t),children:[(0,r.jsx)(n(),{href:e,className:"dashboard-back-link inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:s}),a&&(0,r.jsx)(l,{href:a,className:"inline-flex items-center gap-2 text-xs font-medium text-primary hover:underline",children:d})]})}},59123:(e,s,t)=>{t.d(s,{J:()=>r});function r(e){return`/api/admin/docs-handoff?to=${encodeURIComponent(e)}`}},72991:(e,s,t)=>{t.r(s),t.d(s,{default:()=>p});var r=t(62384),a=t(35260),n=t(10691),d=t.n(n),l=t(20504),i=t(77303),o=t(93270),c=t(84485),m=t(99519),u=t(73273),x=t(37536);function h({item:e,onMove:s}){return(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-3",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsx)(d(),{href:e.adminUrl,className:"text-sm font-medium hover:underline line-clamp-2",children:e.title}),(0,r.jsx)(o.E,{variant:"outline",className:"shrink-0",children:e.status.replace(/_/g," ")})]}),(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1",children:[e.groups.slice(0,2).map(e=>(0,r.jsx)(o.E,{variant:"secondary",children:e.name},e.id)),e.grants.slice(0,1).map(e=>(0,r.jsx)(o.E,{variant:"outline",children:e.name},e.id))]}),(0,r.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:["backlog","in_progress","blocked","done"].map(t=>(0,r.jsx)(c.$,{size:"sm",variant:t===e.status?"default":"outline",onClick:()=>s(e.id,t),children:t.replace(/_/g," ")},t))})]})}function p(){let[e,s]=(0,a.useState)(null),[t,n]=(0,a.useState)(""),[p,f]=(0,a.useState)(null),[g,j]=(0,a.useState)(!0),[b,v]=(0,a.useState)(null),N=async()=>{let e=await fetch("/api/admin/org-os/groups",{credentials:"include"}),s=await e.json();if(!e.ok||!s||!0!==s.success)throw Error("error"in s&&"string"==typeof s.error&&s.error||"Failed to load");return s.data},y=async e=>{let s=await fetch(`/api/admin/org-os/group?groupId=${encodeURIComponent(e)}`,{credentials:"include"}),t=await s.json();if(!s.ok||!t||!0!==t.success)throw Error("error"in t&&"string"==typeof t.error&&t.error||"Failed to load");return t.data},w=async e=>{j(!0),v(null);try{let r=await N();s({groups:r.groups,orgRole:r.orgRole});let a=e||t||r.groups[0]?.id||"";if(n(a),!a)return void f(null);let d=await y(a);f(d)}catch(e){v(e instanceof Error?e.message:"Failed to load group dashboard")}finally{j(!1)}};(0,a.useEffect)(()=>{w()},[]);let k=async(e,s)=>{let r=await (0,x.XX)("/api/admin/org-os/activity",{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({id:e,status:s})}),a=await r.json();if(!r.ok)throw Error(a?.error||"Failed to update activity");await w(t)},C=(0,a.useMemo)(()=>[{key:"backlog",title:"Backlog"},{key:"in_progress",title:"In progress"},{key:"blocked",title:"Blocked"},{key:"done",title:"Done"}],[]);return g?(0,r.jsx)("div",{className:"dashboard-scope",children:(0,r.jsx)(i.default,{children:(0,r.jsxs)(i.default.Content,{children:[(0,r.jsx)("div",{className:"h-10 w-64 animate-pulse rounded-xl bg-muted"}),(0,r.jsx)("div",{className:"mt-6 grid gap-4 lg:grid-cols-4",children:Array.from({length:4}).map((e,s)=>(0,r.jsx)("div",{className:"h-80 animate-pulse rounded-2xl bg-muted"},s))})]})})}):b?(0,r.jsx)("div",{className:"dashboard-scope",children:(0,r.jsx)(i.default,{children:(0,r.jsx)(i.default.Content,{children:(0,r.jsx)("div",{className:"rounded-2xl border border-destructive/40 bg-destructive/5 p-4 text-sm text-destructive",children:b})})})}):(0,r.jsx)("div",{className:"dashboard-scope",children:(0,r.jsxs)(i.default,{children:[(0,r.jsx)(i.default.Header,{children:(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(l.A,{}),(0,r.jsx)("div",{className:"hidden sm:block text-sm text-muted-foreground",children:"Org OS â Group"})]})}),(0,r.jsxs)(i.default.Content,{children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:"Group"}),(0,r.jsxs)(u.l6,{value:t,onValueChange:e=>{n(e),w(e)},children:[(0,r.jsx)(u.bq,{className:"w-[260px]",children:(0,r.jsx)(u.yv,{placeholder:"Select group"})}),(0,r.jsx)(u.gC,{children:(e?.groups||[]).map(e=>(0,r.jsx)(u.eb,{value:e.id,children:e.name},e.id))})]})]}),p?.group?(0,r.jsx)(c.$,{asChild:!0,variant:"outline",children:(0,r.jsx)(d(),{href:p.group.adminUrl,children:"Open group record"})}):null]}),p?(0,r.jsxs)(r.Fragment,{children:[p.kanbanCounts.isTruncated?(0,r.jsxs)("div",{className:"mt-4 rounded-xl border border-border bg-card p-3 text-xs text-muted-foreground",children:["Showing the most recent ",p.kanbanCounts.limit," activities (of"," ",p.kanbanCounts.total,"). Column counts reflect totals across all activities."]}):(0,r.jsx)("div",{className:"mt-4 text-xs text-muted-foreground",children:"Column counts reflect totals across all activities."}),(0,r.jsx)("div",{className:"mt-6 grid gap-4 lg:grid-cols-4",children:C.map(e=>(0,r.jsxs)(m.Zp,{children:[(0,r.jsx)(m.aR,{children:(0,r.jsxs)(m.ZB,{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{children:e.title}),(0,r.jsx)(o.E,{variant:"outline",children:p.kanbanCounts[e.key]})]})}),(0,r.jsxs)(m.Wu,{className:"space-y-3",children:[p.kanban[e.key].slice(0,20).map(e=>(0,r.jsx)(h,{item:e,onMove:k},e.id)),p.kanban[e.key].length?null:(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:"No items."})]})]},e.key))}),(0,r.jsxs)("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[(0,r.jsxs)(m.Zp,{children:[(0,r.jsx)(m.aR,{children:(0,r.jsx)(m.ZB,{children:"Dependencies"})}),(0,r.jsx)(m.Wu,{className:"space-y-3",children:p.dependencies.length?p.dependencies.slice(0,12).map(e=>(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)(d(),{href:e.adminUrl,className:"text-sm font-medium hover:underline",children:e.title}),(0,r.jsx)(o.E,{variant:"outline",children:e.status})]}),(0,r.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:e.groups.map(e=>e.name).join(", ")})]},e.id)):(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:"No cross-group dependencies."})})]}),(0,r.jsxs)(m.Zp,{children:[(0,r.jsx)(m.aR,{children:(0,r.jsx)(m.ZB,{children:"Related grants"})}),(0,r.jsx)(m.Wu,{className:"space-y-3",children:p.grants.length?p.grants.slice(0,12).map(e=>(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)(d(),{href:e.adminUrl,className:"text-sm font-medium hover:underline",children:e.name}),(0,r.jsxs)(o.E,{variant:"outline",children:[Math.round(e.utilizationPercent),"%"]})]}),(0,r.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:["Remaining ",e.remainingAmou
1nt," ",e.currency]})]},e.id)):(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:"No linked grants yet."})})]})]})]}):(0,r.jsx)("div",{className:"mt-6 rounded-2xl border border-border bg-card p-6 text-sm text-muted-foreground",children:"No group selected."})]})]})})}},73273:(e,s,t)=>{t.d(s,{bq:()=>u,eb:()=>f,gC:()=>p,l6:()=>o,s3:()=>c,yv:()=>m});var r=t(62384),a=t(12002),n=t(22291),d=t(33573),l=t(91144),i=t(21017);t(35260);let o=n.bL,c=n.YJ,m=n.WT,u=({children:e,className:s,ref:t,...l})=>(0,r.jsxs)(n.l9,{"data-slot":"select-trigger",className:(0,a.cn)("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),ref:t,...l,children:[e,(0,r.jsx)(n.In,{asChild:!0,children:(0,r.jsx)(d.A,{className:"h-4 w-4 opacity-50"})})]}),x=({className:e,ref:s,...t})=>(0,r.jsx)(n.PP,{"data-slot":"select-scroll-up",className:(0,a.cn)("flex cursor-default items-center justify-center py-1",e),ref:s,...t,children:(0,r.jsx)(l.A,{className:"h-4 w-4"})}),h=({className:e,ref:s,...t})=>(0,r.jsx)(n.wn,{"data-slot":"select-scroll-down",className:(0,a.cn)("flex cursor-default items-center justify-center py-1",e),ref:s,...t,children:(0,r.jsx)(d.A,{className:"h-4 w-4"})}),p=({children:e,className:s,position:t="popper",ref:d,...l})=>(0,r.jsx)(n.ZL,{children:(0,r.jsxs)(n.UC,{"data-slot":"select-content",className:(0,a.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===t&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:t,ref:d,...l,children:[(0,r.jsx)(x,{}),(0,r.jsx)(n.LM,{className:(0,a.cn)("p-1","popper"===t&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,r.jsx)(h,{})]})}),f=({children:e,className:s,ref:t,...d})=>(0,r.jsxs)(n.q7,{"data-slot":"select-item",className:(0,a.cn)("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none bg-popover text-popover-foreground hover:bg-muted focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),ref:t,...d,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(n.VF,{children:(0,r.jsx)(i.A,{className:"h-4 w-4"})})}),(0,r.jsx)(n.p4,{children:e})]})},77303:(e,s,t)=>{t.d(s,{default:()=>l});var r=t(62384);t(35260);var a=t(12002);let n="dashboard-shell__container mx-auto max-w-[1100px] px-4 sm:px-6 lg:px-8",d=({children:e,className:s})=>(0,r.jsx)("div",{className:(0,a.cn)(n,s),children:e});d.Header=function({children:e,className:s}){return(0,r.jsx)("header",{className:(0,a.cn)("dashboard-shell__header sticky top-0 z-[100] border-b border-border/70 bg-background",s),children:(0,r.jsx)("div",{className:(0,a.cn)(n,"dashboard-shell__header-inner flex min-h-[52px] items-center justify-between gap-4"),children:e})})},d.Content=function({children:e,className:s}){return(0,r.jsx)("main",{className:(0,a.cn)("dashboard-shell__content space-y-6 py-7",s),children:e})};let l=d}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.