@kubitnodes/stellaris 0.3.26 → 0.3.27

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 (47) hide show
  1. package/dist/cli/index.js +340 -131
  2. package/dist/server/index.js +808 -181
  3. package/package.json +1 -1
  4. package/web/dist/assets/{BackLink-UTiLF1J4.js → BackLink-qSxOMeEG.js} +1 -1
  5. package/web/dist/assets/{Button-Cp4cNRUX.js → Button-CxjWy598.js} +1 -1
  6. package/web/dist/assets/{ChannelForms-DD2B0tey.js → ChannelForms-BVidWMId.js} +1 -1
  7. package/web/dist/assets/{ChannelView-CY3oG9hZ.js → ChannelView-rqfk1Tyu.js} +1 -1
  8. package/web/dist/assets/{CitizenView-BNK5ro-6.js → CitizenView-xU99R8hS.js} +1 -1
  9. package/web/dist/assets/{CitizensView-WPQ6Jhl3.js → CitizensView-Bgw6PRSo.js} +1 -1
  10. package/web/dist/assets/{CliIcon-C7bwChMP.js → CliIcon-BB2NdLxN.js} +1 -1
  11. package/web/dist/assets/{CronsView-_pdgwX1I.js → CronsView-BrXrcfC6.js} +1 -1
  12. package/web/dist/assets/{FileTree-jyDUSu7g.js → FileTree-CHDmrOhY.js} +1 -1
  13. package/web/dist/assets/{FileView-DcQvlc8V.js → FileView-DUMfKYRW.js} +1 -1
  14. package/web/dist/assets/{KnowledgeView-DDl0HQPG.js → KnowledgeView-Qog6c92V.js} +1 -1
  15. package/web/dist/assets/{Markdown-DT3V-EVe.js → Markdown-C7RbUEZE.js} +1 -1
  16. package/web/dist/assets/{MessageItem-agtEugfG.js → MessageItem-DgWh5pJF.js} +1 -1
  17. package/web/dist/assets/{MetricsView-DiXyYeWP.js → MetricsView-DuOyISk1.js} +1 -1
  18. package/web/dist/assets/{NeedsYouView-CKmuYan_.js → NeedsYouView-CrmHXZAn.js} +1 -1
  19. package/web/dist/assets/{Overview-CKcTqsMM.js → Overview-xatORJK6.js} +1 -1
  20. package/web/dist/assets/{Pane-BaM0TdE6.js → Pane-BlIRwUtQ.js} +1 -1
  21. package/web/dist/assets/{Picker-C2ig-0dT.js → Picker-BSOB2JM_.js} +1 -1
  22. package/web/dist/assets/ProjectView-CVt28SoI.js +1 -0
  23. package/web/dist/assets/{ProposalView-B5yjTAcn.js → ProposalView-DJ0aJm7J.js} +1 -1
  24. package/web/dist/assets/{ProposalsView-p4KjwV9p.js → ProposalsView-C0r1ya8_.js} +1 -1
  25. package/web/dist/assets/{Quota-CfFGIql9.js → Quota-59QJZrPa.js} +1 -1
  26. package/web/dist/assets/{RunnersView-DdvwoOur.js → RunnersView-CcAAfw6y.js} +1 -1
  27. package/web/dist/assets/{SkillFileList-CgrCnuaC.js → SkillFileList-Cs_f3RPo.js} +1 -1
  28. package/web/dist/assets/{SkillView-Di5Z9h2L.js → SkillView-BvVx3LSL.js} +1 -1
  29. package/web/dist/assets/{SocietyView-BDiVxUC5.js → SocietyView-CJRrypjI.js} +1 -1
  30. package/web/dist/assets/{StickyList-BaV_KZ8x.js → StickyList-BbGq82Jj.js} +1 -1
  31. package/web/dist/assets/{SubjectThread-DD_ZCCnr.js → SubjectThread-DdkyhVqK.js} +1 -1
  32. package/web/dist/assets/{TaskView-CKcs-MOC.js → TaskView-CyEWpCvS.js} +1 -1
  33. package/web/dist/assets/{TasksView-oZMjncOU.js → TasksView-D10XP1uk.js} +1 -1
  34. package/web/dist/assets/{ThreadForms-CG5Y926b.js → ThreadForms-D94Jj0ES.js} +1 -1
  35. package/web/dist/assets/{ThreadItem-D-n2arFA.js → ThreadItem-CYmdCPOf.js} +1 -1
  36. package/web/dist/assets/{ThreadView-CT9vd0P4.js → ThreadView-D79G2zgF.js} +1 -1
  37. package/web/dist/assets/{citizen-BiHfph2A.js → citizen-CgA4vJjy.js} +1 -1
  38. package/web/dist/assets/{compose-DY1WL8zB.js → compose-3ksQaHF6.js} +1 -1
  39. package/web/dist/assets/format-DpQyO6r1.js +55 -0
  40. package/web/dist/assets/{governance-C6ez5MLh.js → governance-YialJVYK.js} +1 -1
  41. package/web/dist/assets/{index-CPXALUV6.js → index-DhuCp-VF.js} +3 -3
  42. package/web/dist/assets/{mentions-BEL5U6ra.js → mentions-Buc5vs-j.js} +1 -1
  43. package/web/dist/assets/{tasks-CAI8Eci7.js → tasks-DLTeaHys.js} +1 -1
  44. package/web/dist/assets/{useMatch-CINzyDWa.js → useMatch-DPEg8ohe.js} +1 -1
  45. package/web/dist/index.html +8 -8
  46. package/web/dist/assets/ProjectView-T2OHTh5j.js +0 -1
  47. package/web/dist/assets/format-CENiwkJC.js +0 -55
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "codex",
9
9
  "multi-agent"
10
10
  ],
11
- "version": "0.3.26",
11
+ "version": "0.3.27",
12
12
  "license": "MIT",
13
13
  "homepage": "https://github.com/kr4t0n/stellaris",
14
14
  "repository": {
@@ -1 +1 @@
1
- import{S as e,Un as t,Xt as n}from"./format-CENiwkJC.js";import{O as r,n as i,r as a,t as o,v as s}from"./index-CPXALUV6.js";var c=t(),l=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function u({fallback:t}){let u=n(),d=r({select:e=>e.location.state.__TSR_index}),f=a(),p=s(),m=e(),h=i(f,d);if(h===null)return t;let g=o(h,{entity:e=>p.get(e)?.title,project:e=>m.data?.find(t=>t.slug===e)?.name});return(0,c.jsx)(`button`,{type:`button`,onClick:()=>u.history.back(),"aria-label":`Back to ${g}`,title:`Back to ${g}`,className:l,children:`←`})}export{u as t};
1
+ import{S as e,Un as t,Xt as n}from"./format-DpQyO6r1.js";import{O as r,n as i,r as a,t as o,v as s}from"./index-DhuCp-VF.js";var c=t(),l=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function u({fallback:t}){let u=n(),d=r({select:e=>e.location.state.__TSR_index}),f=a(),p=s(),m=e(),h=i(f,d);if(h===null)return t;let g=o(h,{entity:e=>p.get(e)?.title,project:e=>m.data?.find(t=>t.slug===e)?.name});return(0,c.jsx)(`button`,{type:`button`,onClick:()=>u.history.back(),"aria-label":`Back to ${g}`,title:`Back to ${g}`,className:l,children:`←`})}export{u as t};
@@ -1 +1 @@
1
- import{Dn as e,Fn as t,Hn as n,Rn as r,Tn as i,Un as a,Wn as o,jn as s,kn as c,qn as l,wn as u,zn as d}from"./format-CENiwkJC.js";var f=class extends u{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||p(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=i({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),a=this.state.status===`pending`,o=!r.canStart();try{if(a)t();else{this.#i({type:`pending`,variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:o})}let i=await r.start();return await this.#n.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#n.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#i({type:`success`,data:i}),i}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(t){let n=e=>{switch(t.type){case`failed`:return{...e,failureCount:t.failureCount,failureReason:t.error};case`pause`:return{...e,isPaused:!0};case`continue`:return{...e,isPaused:!1};case`pending`:return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:`pending`,variables:t.variables,submittedAt:Date.now()};case`success`:return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:`error`}}};this.state=n(this.state),e.batch(()=>{this.#t.forEach(e=>{e.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:`updated`,action:t})})}};function p(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var m=class extends c{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),r(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&s(t.mutationKey)!==s(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??p();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(t){e.batch(()=>{if(this.#r&&this.hasListeners()){let e=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type===`success`){try{this.#r.onSuccess?.(t.data,e,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(t.data,null,e,n,r)}catch(e){Promise.reject(e)}}else if(t?.type===`error`){try{this.#r.onError?.(t.error,e,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,t.error,e,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},h=l(o(),1);function g(r,i){let a=n(i),[o]=h.useState(()=>new m(a,r));h.useEffect(()=>{o.setOptions(r)},[o,r]);let s=h.useSyncExternalStore(h.useCallback(t=>o.subscribe(e.batchCalls(t)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),c=h.useCallback((...e)=>{o.mutate(e[0],e[1]).catch(t)},[o]);if(s.error&&d(o.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}var _=a(),v={primary:`bg-fg-primary font-medium text-surface-0 hover:bg-white`,ghost:`text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`};function y({variant:e=`ghost`,className:t=``,...n}){return(0,_.jsx)(`button`,{type:`button`,...n,className:`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs transition-colors focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-40 ${v[e]} ${t}`})}export{g as n,f as r,y as t};
1
+ import{Dn as e,Fn as t,Hn as n,Rn as r,Tn as i,Un as a,Wn as o,jn as s,kn as c,qn as l,wn as u,zn as d}from"./format-DpQyO6r1.js";var f=class extends u{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||p(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=i({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),a=this.state.status===`pending`,o=!r.canStart();try{if(a)t();else{this.#i({type:`pending`,variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:o})}let i=await r.start();return await this.#n.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#n.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#i({type:`success`,data:i}),i}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(t){let n=e=>{switch(t.type){case`failed`:return{...e,failureCount:t.failureCount,failureReason:t.error};case`pause`:return{...e,isPaused:!0};case`continue`:return{...e,isPaused:!1};case`pending`:return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:`pending`,variables:t.variables,submittedAt:Date.now()};case`success`:return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:`error`}}};this.state=n(this.state),e.batch(()=>{this.#t.forEach(e=>{e.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:`updated`,action:t})})}};function p(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var m=class extends c{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),r(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&s(t.mutationKey)!==s(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??p();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(t){e.batch(()=>{if(this.#r&&this.hasListeners()){let e=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type===`success`){try{this.#r.onSuccess?.(t.data,e,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(t.data,null,e,n,r)}catch(e){Promise.reject(e)}}else if(t?.type===`error`){try{this.#r.onError?.(t.error,e,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,t.error,e,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},h=l(o(),1);function g(r,i){let a=n(i),[o]=h.useState(()=>new m(a,r));h.useEffect(()=>{o.setOptions(r)},[o,r]);let s=h.useSyncExternalStore(h.useCallback(t=>o.subscribe(e.batchCalls(t)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),c=h.useCallback((...e)=>{o.mutate(e[0],e[1]).catch(t)},[o]);if(s.error&&d(o.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}var _=a(),v={primary:`bg-fg-primary font-medium text-surface-0 hover:bg-white`,ghost:`text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`};function y({variant:e=`ghost`,className:t=``,...n}){return(0,_.jsx)(`button`,{type:`button`,...n,className:`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs transition-colors focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-40 ${v[e]} ${t}`})}export{g as n,f as r,y as t};
@@ -1 +1 @@
1
- import{Hn as e,Jt as t,Un as n,Wn as r,j as i,qn as a,t as o}from"./format-CENiwkJC.js";import{n as s,t as c}from"./Button-Cp4cNRUX.js";import{i as l}from"./compose-DY1WL8zB.js";import{n as u,r as d}from"./ThreadForms-CG5Y926b.js";var f=a(r(),1),p=n();function m({project:t,onDone:n}){let{api:r}=i(),a=e(),o=l(),[m,h]=(0,f.useState)(``),[g,_]=(0,f.useState)(``),v=(0,f.useRef)(null);(0,f.useEffect)(()=>v.current?.focus(),[]);let y=s({mutationFn:()=>r.createChannel({project:t,name:m.trim(),purpose:g.trim()}),onSuccess:async e=>{await a.invalidateQueries({queryKey:[`channels`]}),n(),await o({to:`/c/$`,params:{_splat:e}})}});return(0,p.jsxs)(`form`,{"aria-label":`New channel`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),y.mutate()},children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`div`,{className:`w-40 shrink-0`,children:(0,p.jsx)(`input`,{ref:v,value:m,maxLength:64,spellCheck:!1,"aria-label":`Channel name`,placeholder:`release-0-4`,onChange:e=>h(e.target.value),className:`${u} font-mono`})}),(0,p.jsx)(`input`,{value:g,"aria-label":`Purpose`,placeholder:`What the channel is for`,onChange:e=>_(e.target.value),className:`${u} min-w-0 flex-1`}),(0,p.jsx)(c,{onClick:n,children:`Cancel`}),(0,p.jsx)(c,{variant:`primary`,type:`submit`,disabled:y.isPending||m.trim()===``||g.trim()===``,children:y.isPending?`Opening…`:`Open`})]}),(0,p.jsx)(d,{error:y.error})]})}function h({channel:t,onDone:n}){let{api:r}=i(),a=e(),[o,l]=(0,f.useState)(``),m=s({mutationFn:()=>r.archiveChannel({channel:t,reason:o.trim()}),onSuccess:async()=>{await a.invalidateQueries({queryKey:[`channels`]}),n()}});return(0,p.jsxs)(`form`,{"aria-label":`Archive the channel`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),m.mutate()},children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`input`,{value:o,"aria-label":`Reason`,placeholder:`Why its work is done`,onChange:e=>l(e.target.value),className:`${u} min-w-0 flex-1`}),(0,p.jsx)(c,{onClick:n,children:`Cancel`}),(0,p.jsx)(c,{variant:`primary`,type:`submit`,disabled:m.isPending||o.trim()===``,children:m.isPending?`Archiving…`:`Archive channel`})]}),(0,p.jsx)(d,{error:m.error})]})}function g({channels:e,now:n}){return e.length===0?(0,p.jsx)(`p`,{className:`text-meta`,children:`No channels.`}):(0,p.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsxs)(t,{to:`/c/$`,params:{_splat:e.ref},className:`text-sm hover:text-fg-primary ${e.archived===void 0?`text-fg-secondary`:`text-fg-tertiary`}`,children:[`# `,e.name]}),(0,p.jsxs)(`span`,{className:`text-meta`,children:[` `,`· `,e.messages,` messages`,e.archived===void 0?``:` · archived ${o(e.archived.at,n)}`]})]},e.ref))})}export{g as n,m as r,h as t};
1
+ import{Hn as e,Jt as t,Un as n,Wn as r,j as i,qn as a,t as o}from"./format-DpQyO6r1.js";import{n as s,t as c}from"./Button-CxjWy598.js";import{i as l}from"./compose-3ksQaHF6.js";import{n as u,r as d}from"./ThreadForms-D94Jj0ES.js";var f=a(r(),1),p=n();function m({project:t,onDone:n}){let{api:r}=i(),a=e(),o=l(),[m,h]=(0,f.useState)(``),[g,_]=(0,f.useState)(``),v=(0,f.useRef)(null);(0,f.useEffect)(()=>v.current?.focus(),[]);let y=s({mutationFn:()=>r.createChannel({project:t,name:m.trim(),purpose:g.trim()}),onSuccess:async e=>{await a.invalidateQueries({queryKey:[`channels`]}),n(),await o({to:`/c/$`,params:{_splat:e}})}});return(0,p.jsxs)(`form`,{"aria-label":`New channel`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),y.mutate()},children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`div`,{className:`w-40 shrink-0`,children:(0,p.jsx)(`input`,{ref:v,value:m,maxLength:64,spellCheck:!1,"aria-label":`Channel name`,placeholder:`release-0-4`,onChange:e=>h(e.target.value),className:`${u} font-mono`})}),(0,p.jsx)(`input`,{value:g,"aria-label":`Purpose`,placeholder:`What the channel is for`,onChange:e=>_(e.target.value),className:`${u} min-w-0 flex-1`}),(0,p.jsx)(c,{onClick:n,children:`Cancel`}),(0,p.jsx)(c,{variant:`primary`,type:`submit`,disabled:y.isPending||m.trim()===``||g.trim()===``,children:y.isPending?`Opening…`:`Open`})]}),(0,p.jsx)(d,{error:y.error})]})}function h({channel:t,onDone:n}){let{api:r}=i(),a=e(),[o,l]=(0,f.useState)(``),m=s({mutationFn:()=>r.archiveChannel({channel:t,reason:o.trim()}),onSuccess:async()=>{await a.invalidateQueries({queryKey:[`channels`]}),n()}});return(0,p.jsxs)(`form`,{"aria-label":`Archive the channel`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),m.mutate()},children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`input`,{value:o,"aria-label":`Reason`,placeholder:`Why its work is done`,onChange:e=>l(e.target.value),className:`${u} min-w-0 flex-1`}),(0,p.jsx)(c,{onClick:n,children:`Cancel`}),(0,p.jsx)(c,{variant:`primary`,type:`submit`,disabled:m.isPending||o.trim()===``,children:m.isPending?`Archiving…`:`Archive channel`})]}),(0,p.jsx)(d,{error:m.error})]})}function g({channels:e,now:n}){return e.length===0?(0,p.jsx)(`p`,{className:`text-meta`,children:`No channels.`}):(0,p.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsxs)(t,{to:`/c/$`,params:{_splat:e.ref},className:`text-sm hover:text-fg-primary ${e.archived===void 0?`text-fg-secondary`:`text-fg-tertiary`}`,children:[`# `,e.name]}),(0,p.jsxs)(`span`,{className:`text-meta`,children:[` `,`· `,e.messages,` messages`,e.archived===void 0?``:` · archived ${o(e.archived.at,n)}`]})]},e.ref))})}export{g as n,m as r,h as t};
@@ -1,2 +1,2 @@
1
- import{Jt as e,K as t,S as n,Sn as r,Un as i,V as a,Wn as o,j as s,l as c,qn as l,t as u,v as d,x as f,xt as p}from"./format-CENiwkJC.js";import{t as m}from"./Button-Cp4cNRUX.js";import{A as h,C as g,i as _,k as v,s as y}from"./index-CPXALUV6.js";import{t as b}from"./BackLink-UTiLF1J4.js";import{i as x}from"./ThreadForms-CG5Y926b.js";import{t as S}from"./ChannelForms-DD2B0tey.js";import{t as C}from"./MessageItem-agtEugfG.js";import{n as w,t as T}from"./Pane-BaM0TdE6.js";import{t as E}from"./StickyList-BaV_KZ8x.js";import{n as D}from"./ThreadItem-D-n2arFA.js";var O=l(o(),1);function k(e,t){let n=e.notices.at(-1);return n!==void 0&&n.kind===`knowledge`&&t.kind===`knowledge`&&n.action!==`removed`&&t.action===`updated`&&n.topic===t.topic&&n.project===t.project}function A(e,t){let n=[],r=null;for(let i of e){let e=t(i),a=e?.notice;e===void 0||a===void 0?(n.push({kind:`item`,item:i}),r=null):r!==null&&k(r,a)?(r.messages.push(e),r.notices.push(a)):(r={messages:[e],notices:[a]},n.push({kind:`notices`,run:r}))}return n}function j(e){let[t]=e,n=e.length-1;return t===void 0||t.action===`removed`?{did:`removed`,times:null}:t.action===`written`?{did:`wrote`,times:n===0?null:`then updated it ${n===1?`once`:`${n} times`}`}:{did:`updated`,times:n===0?null:`${e.length} times`}}function M(e){let t=[...new Set(e)];return t.length<=2?t.join(` and `):`${t.slice(0,-1).join(`, `)}, and ${t.at(-1)??``}`}var N=i();function P(){return(0,N.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`size-3.5`,children:(0,N.jsx)(`path`,{d:`M8 4.2C6.4 3 4.4 2.8 2.2 3.4v9.2c2.2-.6 4.2-.4 5.8.8m0-9.2c1.6-1.2 3.6-1.4 5.8-.8v9.2c-2.2-.6-4.2-.4-5.8.8m0-9.2v9.2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinejoin:`round`})})}function F({notices:t}){let[n]=t;if(n===void 0)return null;let{did:r,times:i}=j(t);return(0,N.jsxs)(N.Fragment,{children:[r,` knowledge`,` `,n.action===`removed`?(0,N.jsx)(`span`,{className:`text-fg-secondary`,children:n.topic}):(0,N.jsx)(e,{to:`/knowledge/$scope/$topic`,params:{scope:n.project??`society`,topic:n.topic},className:`text-fg-secondary hover:text-fg-primary`,children:n.topic}),i===null?null:` · ${i}`]})}function I(e){let t=e.notices.filter(e=>e.kind===`knowledge`);return{mark:(0,N.jsx)(P,{}),text:(0,N.jsx)(F,{notices:t})}}function L({run:e,now:t}){let n=y(),r=e.messages.at(-1);if(r===void 0)return null;let{mark:i,text:a}=I(e);return(0,N.jsxs)(`div`,{className:`flex gap-3 px-4 py-1`,children:[(0,N.jsx)(`span`,{className:`grid h-5 w-7 shrink-0 place-items-center text-fg-muted`,children:i}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-3`,children:[(0,N.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm text-fg-tertiary`,children:[M(e.messages.map(e=>n(e.author))),` `,a]}),(0,N.jsx)(`time`,{dateTime:r.ts,title:e.messages.map(e=>`${n(e.author)} ${e.ts}`).join(`
1
+ import{Jt as e,K as t,S as n,Sn as r,Un as i,V as a,Wn as o,j as s,l as c,qn as l,t as u,v as d,x as f,xt as p}from"./format-DpQyO6r1.js";import{t as m}from"./Button-CxjWy598.js";import{A as h,C as g,i as _,k as v,s as y}from"./index-DhuCp-VF.js";import{t as b}from"./BackLink-qSxOMeEG.js";import{i as x}from"./ThreadForms-D94Jj0ES.js";import{t as S}from"./ChannelForms-BVidWMId.js";import{t as C}from"./MessageItem-DgWh5pJF.js";import{n as w,t as T}from"./Pane-BlIRwUtQ.js";import{t as E}from"./StickyList-BbGq82Jj.js";import{n as D}from"./ThreadItem-CYmdCPOf.js";var O=l(o(),1);function k(e,t){let n=e.notices.at(-1);return n!==void 0&&n.kind===`knowledge`&&t.kind===`knowledge`&&n.action!==`removed`&&t.action===`updated`&&n.topic===t.topic&&n.project===t.project}function A(e,t){let n=[],r=null;for(let i of e){let e=t(i),a=e?.notice;e===void 0||a===void 0?(n.push({kind:`item`,item:i}),r=null):r!==null&&k(r,a)?(r.messages.push(e),r.notices.push(a)):(r={messages:[e],notices:[a]},n.push({kind:`notices`,run:r}))}return n}function j(e){let[t]=e,n=e.length-1;return t===void 0||t.action===`removed`?{did:`removed`,times:null}:t.action===`written`?{did:`wrote`,times:n===0?null:`then updated it ${n===1?`once`:`${n} times`}`}:{did:`updated`,times:n===0?null:`${e.length} times`}}function M(e){let t=[...new Set(e)];return t.length<=2?t.join(` and `):`${t.slice(0,-1).join(`, `)}, and ${t.at(-1)??``}`}var N=i();function P(){return(0,N.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`size-3.5`,children:(0,N.jsx)(`path`,{d:`M8 4.2C6.4 3 4.4 2.8 2.2 3.4v9.2c2.2-.6 4.2-.4 5.8.8m0-9.2c1.6-1.2 3.6-1.4 5.8-.8v9.2c-2.2-.6-4.2-.4-5.8.8m0-9.2v9.2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinejoin:`round`})})}function F({notices:t}){let[n]=t;if(n===void 0)return null;let{did:r,times:i}=j(t);return(0,N.jsxs)(N.Fragment,{children:[r,` knowledge`,` `,n.action===`removed`?(0,N.jsx)(`span`,{className:`text-fg-secondary`,children:n.topic}):(0,N.jsx)(e,{to:`/knowledge/$scope/$topic`,params:{scope:n.project??`society`,topic:n.topic},className:`text-fg-secondary hover:text-fg-primary`,children:n.topic}),i===null?null:` · ${i}`]})}function I(e){let t=e.notices.filter(e=>e.kind===`knowledge`);return{mark:(0,N.jsx)(P,{}),text:(0,N.jsx)(F,{notices:t})}}function L({run:e,now:t}){let n=y(),r=e.messages.at(-1);if(r===void 0)return null;let{mark:i,text:a}=I(e);return(0,N.jsxs)(`div`,{className:`flex gap-3 px-4 py-1`,children:[(0,N.jsx)(`span`,{className:`grid h-5 w-7 shrink-0 place-items-center text-fg-muted`,children:i}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-3`,children:[(0,N.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm text-fg-tertiary`,children:[M(e.messages.map(e=>n(e.author))),` `,a]}),(0,N.jsx)(`time`,{dateTime:r.ts,title:e.messages.map(e=>`${n(e.author)} ${e.ts}`).join(`
2
2
  `),className:`shrink-0 text-meta`,children:u(r.ts,t)})]})]})}var R=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function z(){let{_splat:e=`general`}=h({from:`/c/$`}),{message:t}=v({from:`/c/$`});return(0,N.jsx)(B,{channel:e,target:t},e)}function B({channel:i,target:o}){let{api:l}=s(),h=r({queryKey:[`channel`,i],queryFn:()=>l.channel(i)}),v=a(),y=d(),k=n(),j=c(),M=f(3e4),[P,F]=(0,O.useState)(!1),[I,z]=(0,O.useState)(!1),B=(0,O.useMemo)(()=>{let e=(h.data??[]).map(e=>({kind:`message`,at:e.ts,id:e.id,message:e})),t=(v.data??[]).filter(e=>e.channel===i).map(e=>({kind:`thread`,at:e.openedAt,id:e.id,thread:e}));return[...e,...t].toSorted((e,t)=>e.at.localeCompare(t.at)||e.id.localeCompare(t.id))},[h.data,v.data,i]),V=(0,O.useMemo)(()=>A(B,e=>e.kind===`message`?e.message:void 0),[B]),H=h.data?.at(-1)?.id??null;(0,O.useEffect)(()=>g(i,H),[i,H]);let[U,W]=i.split(`/`),G=W??U??i,K=W===void 0?void 0:k.data?.find(e=>e.slug===U),q=W===void 0?`society`:K?.name??U,J=j.data?.find(e=>e.ref===i)?.archived,Y=K?.archived!==void 0||J!==void 0,X=!Y&&!p(W===void 0?null:U??null,G),Z=B.filter(e=>e.kind===`thread`&&e.thread.state===`open`),Q=W===void 0||U===void 0?(0,N.jsx)(e,{to:`/society`,"aria-label":`Back to the society`,className:R,children:`←`}):(0,N.jsx)(e,{to:`/p/$slug`,params:{slug:U},"aria-label":`Back to ${q}`,className:R,children:`←`});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(T,{leading:(0,N.jsx)(b,{fallback:Q}),title:`# ${G}`,subtitle:`${q} · ${h.data?.length??0} messages${Z.length>0?` · ${Z.length} open threads`:``}`,trailing:P||I||Y?null:(0,N.jsxs)(N.Fragment,{children:[X?(0,N.jsx)(m,{onClick:()=>z(!0),children:`Archive…`}):null,(0,N.jsx)(m,{onClick:()=>F(!0),children:`New thread`})]})}),P?(0,N.jsx)(x,{channel:i,onDone:()=>F(!1)}):null,I?(0,N.jsx)(S,{channel:i,onDone:()=>z(!1)}):null,(0,N.jsx)(E,{stick:o===void 0,ids:h.data?.map(e=>e.id),className:`py-2`,children:h.error instanceof t&&h.error.status===404?(0,N.jsxs)(w,{children:[`There is no channel `,i,`.`]}):h.data===void 0?(0,N.jsx)(w,{children:`Reading the channel…`}):B.length===0?(0,N.jsx)(w,{children:`Nothing has been said here yet.`}):V.map(e=>{if(e.kind===`notices`){let t=e.run.messages[0]?.id??``;return(0,N.jsx)(L,{run:e.run,now:M},t)}let{item:t}=e;return t.kind===`message`?(0,N.jsx)(C,{message:t.message,members:y.data,now:M,target:t.id===o},t.id):(0,N.jsx)(D,{thread:t.thread,now:M},t.id)})}),h.data===void 0?null:J===void 0?Y?(0,N.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-meta`,children:[q,` is archived, so its channels are read-only.`]}):(0,N.jsx)(_,{target:{channel:i},placeholder:`Message #${G}`}):(0,N.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-meta`,children:[`Archived `,u(J.at,M),` by `,J.by,`: `,J.reason,`.`]})]})}export{z as ChannelView};
@@ -1,2 +1,2 @@
1
- import{D as e,Hn as t,Ht as n,Jt as r,K as i,O as a,S as o,U as s,Un as c,Vt as l,W as u,Wn as d,X as f,a as p,h as m,j as h,k as g,m as _,o as v,p as y,qn as b,t as x,u as S,v as C,x as w,y as T,yt as ee,z as E}from"./format-CENiwkJC.js";import{n as D,t as O}from"./Button-Cp4cNRUX.js";import{t as te}from"./CliIcon-C7bwChMP.js";import{A as k,_ as A,c as j,d as M,f as N,h as P,i as F,k as I,l as L,m as R,p as ne,u as z,v as B}from"./index-CPXALUV6.js";import{t as V}from"./Markdown-DT3V-EVe.js";import{n as re,r as H}from"./ThreadForms-CG5Y926b.js";import{n as U,t as ie}from"./Pane-BaM0TdE6.js";import{t as ae}from"./StickyList-BaV_KZ8x.js";import{a as W,c as oe,d as se,f as ce,i as le,l as ue,n as de,s as fe,t as pe}from"./citizen-BiHfph2A.js";import{n as G}from"./Picker-C2ig-0dT.js";import{t as me}from"./Quota-CfFGIql9.js";var K=b(d(),1),q=c(),he={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`was interrupted`,blocked:`was blocked`,stopped:`was stopped by you`};function J(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}function ge({label:e,tone:t,children:n}){return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`px-0.5 pb-0.5 text-[10px] tracking-wider text-fg-muted uppercase`,children:e}),(0,q.jsx)(`pre`,{className:`max-h-72 overflow-auto rounded-md bg-surface-0/60 p-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words ${t}`,children:n})]})}function _e({step:e,open:t}){if(e.kind===`say`)return(0,q.jsx)(`li`,{className:`py-1.5 text-sm`,title:J(e.at),children:(0,q.jsx)(V,{text:e.text})});if(e.kind===`error`)return(0,q.jsx)(`li`,{className:`py-1 font-mono text-xs break-words text-red-400`,title:J(e.at),children:e.message});if(e.kind===`steer`)return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,q.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md px-1.5 py-1 text-xs hover:bg-surface-2/40`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`grid w-3 shrink-0 place-items-center text-sky-300`,children:`↳`}),(0,q.jsxs)(`span`,{className:`shrink-0 text-fg-tertiary`,children:[`Took `,M(e.posts.length)]}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-secondary`,children:e.from.length===0?``:`from ${e.from.join(`, `)}, delivered mid-turn`}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:J(e.at)})]}),(0,q.jsx)(`ul`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:e.posts.map(e=>(0,q.jsxs)(`li`,{className:`rounded-md bg-surface-0/40 px-2.5 py-2`,children:[(0,q.jsxs)(`p`,{className:`flex gap-1.5 text-meta`,children:[(0,q.jsx)(`span`,{className:`text-fg-secondary`,children:e.author}),(0,q.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`in `,e.where]}),e.at===``?null:(0,q.jsx)(`span`,{className:`ml-auto shrink-0 font-mono`,children:J(e.at)})]}),(0,q.jsx)(`div`,{className:`mt-1 text-sm`,children:(0,q.jsx)(V,{text:e.body})})]},`${e.at}-${e.author}`))})]})});let n=e.ok===null?(0,q.jsx)(`span`,{"aria-label":`running`,className:`size-1.5 animate-pulse rounded-full bg-amber-300`}):e.ok?(0,q.jsx)(`span`,{"aria-label":`succeeded`,className:`text-[11px] text-emerald-400`,children:`✓`}):(0,q.jsx)(`span`,{"aria-label":`failed`,className:`text-[11px] text-red-400`,children:`✕`});return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,q.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md px-1.5 py-1 text-xs hover:bg-surface-2/40`,children:[(0,q.jsx)(`span`,{className:`grid w-3 shrink-0 place-items-center`,children:n}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-fg-tertiary`,children:N(e.name)}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-fg-secondary`,children:e.summary}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:J(e.at)})]}),(0,q.jsxs)(`div`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:[(0,q.jsx)(ge,{label:`Input`,tone:`text-fg-secondary`,children:e.detail}),e.output===null?null:(0,q.jsx)(ge,{label:e.ok===!1?`Returned an error`:`Returned`,tone:e.ok===!1?`text-red-300`:`text-fg-tertiary`,children:e.output})]})]})})}function ve({steps:e}){let[t,n]=(0,K.useState)(!1),r=e.filter(e=>e.kind===`tool`).length;return e.length===0?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:`No steps yet.`}):(0,q.jsxs)(q.Fragment,{children:[r===0?null:(0,q.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-meta`,children:[r===1?`1 tool call`:`${r} tool calls`,(0,q.jsx)(`button`,{type:`button`,onClick:()=>n(!t),className:`rounded-md px-1.5 py-0.5 text-fg-tertiary transition-colors hover:bg-surface-2/60 hover:text-fg-primary`,children:t?`Collapse all`:`Expand all`})]}),(0,q.jsx)(`ol`,{className:`mt-1 space-y-0.5`,children:e.map(e=>(0,q.jsx)(_e,{step:e,open:t},e.seq))})]})}function ye({turn:e,running:t,now:n}){return e.end===null?t?(0,q.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-meta`,"aria-live":`polite`,children:[(0,q.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}),`Working · last step `,x(e.lastAt,n)]}):(0,q.jsx)(`p`,{className:`mt-3 text-meta`,children:`The turn ended without a report.`}):(0,q.jsxs)(`section`,{className:`mt-3 rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]`,children:[(0,q.jsxs)(`p`,{className:`text-caps`,children:[`The turn `,he[e.end.exitReason],` `,x(e.end.at,n),e.fromStart?` · ${L(e.startedAt,Date.parse(e.end.at))}`:``]}),e.end.summary===null?null:(0,q.jsx)(`p`,{className:`mt-1 text-sm text-fg-secondary`,children:e.end.summary})]})}var be=30,xe={turn:`turn`,board:`board`,merge:`both kept`},Se={turn:`Changed by a turn`,board:`Written by the board`,merge:`Both versions kept`};function Ce(e){return e.status===`added`?`new`:e.status===`deleted`?`deleted`:e.added===null||e.removed===null?`binary`:`+${e.added} −${e.removed}`}function we(e){return e.files.map(e=>`${e.path} ${Ce(e)}`).join(`, `)}function Te(e){return e.startsWith(`@@`)||e.startsWith(`\\`)?`text-fg-muted`:e.startsWith(`+`)?`text-emerald-300`:e.startsWith(`-`)?`text-red-300`:`text-fg-tertiary`}function Ee({file:e}){return(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`p`,{className:`text-xs text-fg-secondary`,children:[e.path,e.status===`modified`?``:(0,q.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,e.status]})]}),e.patch===null?(0,q.jsx)(`p`,{className:`mt-1 text-meta`,children:`A binary file; its contents are not shown.`}):e.patch===``?(0,q.jsx)(`p`,{className:`mt-1 text-meta`,children:`Empty.`}):(0,q.jsx)(`pre`,{className:`mt-1 max-h-96 overflow-auto rounded-md bg-surface-0/60 p-2 font-mono text-[11px] leading-relaxed`,children:e.patch.split(`
1
+ import{D as e,Hn as t,Ht as n,Jt as r,K as i,O as a,S as o,U as s,Un as c,Vt as l,W as u,Wn as d,X as f,a as p,h as m,j as h,k as g,m as _,o as v,p as y,qn as b,t as x,u as S,v as C,x as w,y as T,yt as ee,z as E}from"./format-DpQyO6r1.js";import{n as D,t as O}from"./Button-CxjWy598.js";import{t as te}from"./CliIcon-BB2NdLxN.js";import{A as k,_ as A,c as j,d as M,f as N,h as P,i as F,k as I,l as L,m as R,p as ne,u as z,v as B}from"./index-DhuCp-VF.js";import{t as V}from"./Markdown-C7RbUEZE.js";import{n as re,r as H}from"./ThreadForms-D94Jj0ES.js";import{n as U,t as ie}from"./Pane-BlIRwUtQ.js";import{t as ae}from"./StickyList-BbGq82Jj.js";import{a as W,c as oe,d as se,f as ce,i as le,l as ue,n as de,s as fe,t as pe}from"./citizen-CgA4vJjy.js";import{n as G}from"./Picker-BSOB2JM_.js";import{t as me}from"./Quota-59QJZrPa.js";var K=b(d(),1),q=c(),he={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`was interrupted`,blocked:`was blocked`,stopped:`was stopped by you`};function J(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}function ge({label:e,tone:t,children:n}){return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`px-0.5 pb-0.5 text-[10px] tracking-wider text-fg-muted uppercase`,children:e}),(0,q.jsx)(`pre`,{className:`max-h-72 overflow-auto rounded-md bg-surface-0/60 p-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words ${t}`,children:n})]})}function _e({step:e,open:t}){if(e.kind===`say`)return(0,q.jsx)(`li`,{className:`py-1.5 text-sm`,title:J(e.at),children:(0,q.jsx)(V,{text:e.text})});if(e.kind===`error`)return(0,q.jsx)(`li`,{className:`py-1 font-mono text-xs break-words text-red-400`,title:J(e.at),children:e.message});if(e.kind===`steer`)return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,q.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md px-1.5 py-1 text-xs hover:bg-surface-2/40`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`grid w-3 shrink-0 place-items-center text-sky-300`,children:`↳`}),(0,q.jsxs)(`span`,{className:`shrink-0 text-fg-tertiary`,children:[`Took `,M(e.posts.length)]}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-secondary`,children:e.from.length===0?``:`from ${e.from.join(`, `)}, delivered mid-turn`}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:J(e.at)})]}),(0,q.jsx)(`ul`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:e.posts.map(e=>(0,q.jsxs)(`li`,{className:`rounded-md bg-surface-0/40 px-2.5 py-2`,children:[(0,q.jsxs)(`p`,{className:`flex gap-1.5 text-meta`,children:[(0,q.jsx)(`span`,{className:`text-fg-secondary`,children:e.author}),(0,q.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`in `,e.where]}),e.at===``?null:(0,q.jsx)(`span`,{className:`ml-auto shrink-0 font-mono`,children:J(e.at)})]}),(0,q.jsx)(`div`,{className:`mt-1 text-sm`,children:(0,q.jsx)(V,{text:e.body})})]},`${e.at}-${e.author}`))})]})});let n=e.ok===null?(0,q.jsx)(`span`,{"aria-label":`running`,className:`size-1.5 animate-pulse rounded-full bg-amber-300`}):e.ok?(0,q.jsx)(`span`,{"aria-label":`succeeded`,className:`text-[11px] text-emerald-400`,children:`✓`}):(0,q.jsx)(`span`,{"aria-label":`failed`,className:`text-[11px] text-red-400`,children:`✕`});return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,q.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md px-1.5 py-1 text-xs hover:bg-surface-2/40`,children:[(0,q.jsx)(`span`,{className:`grid w-3 shrink-0 place-items-center`,children:n}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-fg-tertiary`,children:N(e.name)}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-fg-secondary`,children:e.summary}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:J(e.at)})]}),(0,q.jsxs)(`div`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:[(0,q.jsx)(ge,{label:`Input`,tone:`text-fg-secondary`,children:e.detail}),e.output===null?null:(0,q.jsx)(ge,{label:e.ok===!1?`Returned an error`:`Returned`,tone:e.ok===!1?`text-red-300`:`text-fg-tertiary`,children:e.output})]})]})})}function ve({steps:e}){let[t,n]=(0,K.useState)(!1),r=e.filter(e=>e.kind===`tool`).length;return e.length===0?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:`No steps yet.`}):(0,q.jsxs)(q.Fragment,{children:[r===0?null:(0,q.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-meta`,children:[r===1?`1 tool call`:`${r} tool calls`,(0,q.jsx)(`button`,{type:`button`,onClick:()=>n(!t),className:`rounded-md px-1.5 py-0.5 text-fg-tertiary transition-colors hover:bg-surface-2/60 hover:text-fg-primary`,children:t?`Collapse all`:`Expand all`})]}),(0,q.jsx)(`ol`,{className:`mt-1 space-y-0.5`,children:e.map(e=>(0,q.jsx)(_e,{step:e,open:t},e.seq))})]})}function ye({turn:e,running:t,now:n}){return e.end===null?t?(0,q.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-meta`,"aria-live":`polite`,children:[(0,q.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}),`Working · last step `,x(e.lastAt,n)]}):(0,q.jsx)(`p`,{className:`mt-3 text-meta`,children:`The turn ended without a report.`}):(0,q.jsxs)(`section`,{className:`mt-3 rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]`,children:[(0,q.jsxs)(`p`,{className:`text-caps`,children:[`The turn `,he[e.end.exitReason],` `,x(e.end.at,n),e.fromStart?` · ${L(e.startedAt,Date.parse(e.end.at))}`:``]}),e.end.summary===null?null:(0,q.jsx)(`p`,{className:`mt-1 text-sm text-fg-secondary`,children:e.end.summary})]})}var be=30,xe={turn:`turn`,board:`board`,merge:`both kept`},Se={turn:`Changed by a turn`,board:`Written by the board`,merge:`Both versions kept`};function Ce(e){return e.status===`added`?`new`:e.status===`deleted`?`deleted`:e.added===null||e.removed===null?`binary`:`+${e.added} −${e.removed}`}function we(e){return e.files.map(e=>`${e.path} ${Ce(e)}`).join(`, `)}function Te(e){return e.startsWith(`@@`)||e.startsWith(`\\`)?`text-fg-muted`:e.startsWith(`+`)?`text-emerald-300`:e.startsWith(`-`)?`text-red-300`:`text-fg-tertiary`}function Ee({file:e}){return(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`p`,{className:`text-xs text-fg-secondary`,children:[e.path,e.status===`modified`?``:(0,q.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,e.status]})]}),e.patch===null?(0,q.jsx)(`p`,{className:`mt-1 text-meta`,children:`A binary file; its contents are not shown.`}):e.patch===``?(0,q.jsx)(`p`,{className:`mt-1 text-meta`,children:`Empty.`}):(0,q.jsx)(`pre`,{className:`mt-1 max-h-96 overflow-auto rounded-md bg-surface-0/60 p-2 font-mono text-[11px] leading-relaxed`,children:e.patch.split(`
2
2
  `).map((e,t)=>(0,q.jsx)(`span`,{className:`block whitespace-pre-wrap break-words ${Te(e)}`,children:e===``?` `:e},t))}),e.truncated?(0,q.jsx)(`p`,{className:`mt-1 text-meta`,children:`The rest of this file's change is cut.`}):null]})}function De({name:e,change:t}){let n=y(e,t.commit,!0);return(0,q.jsxs)(`div`,{className:`space-y-3 px-4 pt-1 pb-3`,children:[(0,q.jsxs)(`p`,{className:`text-xs text-fg-secondary`,children:[t.kind===`merge`?Se.merge:t.kind===`board`?`Written by the board: ${t.subject.replace(/^home: /,``)}.`:t.turnId===void 0?t.subject:(0,q.jsx)(r,{to:`/citizen/$name`,params:{name:e},search:{tab:`turns`,turn:t.turnId},className:`text-fg-secondary underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Open the turn that made it`}),(0,q.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,J(t.at)]})]}),n.data===void 0?(0,q.jsx)(`p`,{className:`text-meta`,children:n.isError?`Could not read the change.`:`Reading the change…`}):n.data.map(e=>(0,q.jsx)(Ee,{file:e},e.path))]})}function Oe({name:e,change:t,now:n}){let[r,i]=(0,K.useState)(!1),a=t.files.length===0?t.subject:we(t);return(0,q.jsx)(`li`,{className:`border-b border-line/60 last:border-b-0`,children:(0,q.jsxs)(`details`,{className:`group`,onToggle:e=>i(e.currentTarget.open),children:[(0,q.jsx)(`summary`,{"aria-label":`${Se[t.kind]} ${x(t.at,n)}: ${a}`,className:`block cursor-pointer list-none px-4 py-2.5 transition-colors hover:bg-surface-2/30 group-open:bg-surface-2/20`,children:(0,q.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:xe[t.kind]}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-secondary`,children:a}),(0,q.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:x(t.at,n)}),(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-[10px] text-fg-muted transition-transform group-open:rotate-90`,children:`▸`})]})}),r?(0,q.jsx)(De,{name:e,change:t}):null]})})}function ke({name:e}){let[t,n]=(0,K.useState)(be),r=m(e,t),i=w(3e4);if(r.data===void 0)return(0,q.jsx)(U,{children:r.isError?`Could not read the home's history.`:`Reading the history…`});let{changes:a,more:o}=r.data;return a.length===0?(0,q.jsx)(U,{children:`No history yet.`}):(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,q.jsx)(`ol`,{children:a.map(t=>(0,q.jsx)(Oe,{name:e,change:t,now:i},t.commit))}),o?(0,q.jsx)(`button`,{type:`button`,onClick:()=>n(t+be),className:`px-4 py-3 text-xs text-fg-tertiary hover:text-fg-primary`,children:`Show earlier changes`}):null]})}function Y({title:e,children:t}){return(0,q.jsxs)(`section`,{className:`border-t border-line pt-4 first:border-t-0 first:pt-0`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:e}),(0,q.jsx)(`div`,{className:`mt-2`,children:t})]})}function Ae({member:e,charter:t}){let n=T(e.name),r=v(e.name),i=_(e.name),a=w(3e4);return(0,q.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[i.data===void 0||i.data.length===0?null:(0,q.jsx)(Y,{title:`Edits to reconcile`,children:(0,q.jsx)(`ul`,{className:`space-y-1.5`,children:i.data.map(e=>(0,q.jsxs)(`li`,{className:`text-sm`,children:[(0,q.jsx)(`span`,{className:`text-fg-primary`,children:e.file}),(0,q.jsxs)(`span`,{className:`text-meta`,children:[` `,`· `,e.path.slice(e.path.lastIndexOf(`/`)+1),` · left`,` `,x(e.since,a)]})]},e.path))})}),(0,q.jsx)(Y,{title:`Profile`,children:e.profile.trim()===``?(0,q.jsx)(`p`,{className:`text-meta`,children:`No profile yet.`}):(0,q.jsx)(V,{text:ce(e.profile,`Profile`)})}),(0,q.jsx)(Y,{title:`Core memory`,children:n.data===void 0?(0,q.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):n.data.body.trim()===``?(0,q.jsx)(`p`,{className:`text-meta`,children:`Empty.`}):(0,q.jsx)(V,{text:ce(n.data.body,`Core memory`)})}),(0,q.jsx)(Y,{title:`Own skills`,children:r.data===void 0?(0,q.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):r.data.length===0?(0,q.jsx)(`p`,{className:`text-meta`,children:`None yet.`}):(0,q.jsx)(`ul`,{className:`space-y-1.5`,children:r.data.map(e=>(0,q.jsxs)(`li`,{className:`text-sm`,children:[(0,q.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,q.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})}),t===void 0?null:(0,q.jsxs)(Y,{title:`Charter of ${t.name}`,children:[(0,q.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:t.purpose}),(0,q.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Wakes on mentions, stages, and `,t.wakeTriggers.join(`, `)||`nothing else`,t.resident?` · keeps a warm session`:``,t.reflects?` · reflects`:``]}),(0,q.jsx)(`p`,{className:`mt-2 flex flex-wrap gap-1`,children:t.verbs.map(e=>(0,q.jsx)(`span`,{className:`rounded-md bg-surface-2/70 px-1.5 py-px font-mono text-[11px] text-fg-tertiary`,children:e},e))})]})]})}function je(e,t){let n=s(e,t?.turnId??null);return{turn:(0,K.useMemo)(()=>t===void 0||n.data===void 0?void 0:ne(n.data,e,t.project,t),[t,n.data,e]),loading:t?.turnId!==void 0&&n.isPending,missing:t!==void 0&&(t.turnId===void 0||n.isError)}}var X=50;function Me({name:e,entry:t,now:n,opened:r}){let[i,a]=(0,K.useState)(r),o=(0,K.useRef)(null);(0,K.useEffect)(()=>{r&&o.current?.scrollIntoView({block:`start`})},[r]);let s=B(),c=ue(t),l=t.thread===void 0?t.channel===void 0?t.place===void 0?null:`${t.place}'s channels`:`#${t.channel}`:s.get(t.thread)?.title??`a thread`,u=t.error??t.summary??``,d=t.error===null?`text-fg-secondary`:`text-red-300`;return(0,q.jsx)(`li`,{ref:o,className:`border-b border-line/60 last:border-b-0`,children:(0,q.jsxs)(`details`,{className:`group`,open:i,onToggle:e=>a(e.currentTarget.open),children:[(0,q.jsxs)(`summary`,{className:`block cursor-pointer list-none px-4 py-2.5 transition-colors hover:bg-surface-2/30 group-open:bg-surface-2/20`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsxs)(`span`,{className:`min-w-0 truncate text-fg-secondary`,children:[W(t.project),l===null?``:` · ${l}`]}),(0,q.jsx)(`span`,{className:`text-fg-muted`,children:t.trigger}),(0,q.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-fg-muted`,children:[pe(t),` `,x(t.ts,n)]}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-fg-tertiary`,title:t.usage===void 0?void 0:fe(t.usage),children:[c,t.toolCalls===void 0?null:`${t.toolCalls} tools`,t.usage===void 0?null:oe(t.usage)].filter(e=>e!==null).join(` · `)}),(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-[10px] text-fg-muted transition-transform group-open:rotate-90`,children:`▸`})]}),u.trim()===``?null:(0,q.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-xs leading-relaxed group-open:hidden ${d}`,children:(0,q.jsx)(A,{text:u,links:!1})})]}),i?(0,q.jsx)(Ne,{name:e,entry:t,text:u,tone:d}):null]})})}function Ne({name:e,entry:t,text:n,tone:r}){let i=je(e,t);return(0,q.jsxs)(`div`,{className:`px-4 pt-1 pb-3`,children:[n.trim()===``?null:(0,q.jsx)(`p`,{className:`text-xs leading-relaxed whitespace-pre-wrap ${r}`,children:(0,q.jsx)(A,{text:n})}),(0,q.jsx)(`div`,{className:`mt-2`,children:t.turnId===void 0?(0,q.jsx)(`p`,{className:`text-meta`,children:`This turn ran before turns kept their steps.`}):i.loading?(0,q.jsx)(`p`,{className:`text-meta`,children:`Reading the steps…`}):i.turn===void 0?(0,q.jsx)(`p`,{className:`text-meta`,children:`No steps were kept for this turn.`}):(0,q.jsxs)(q.Fragment,{children:[t.startedAt===void 0?null:(0,q.jsxs)(`p`,{className:`text-caps`,children:[`Started `,J(t.startedAt)]}),(0,q.jsx)(ve,{steps:i.turn.steps})]})})]})}function Pe({name:e,opened:t}){let[n,r]=(0,K.useState)(X),i=u(e,n),a=w(3e4);if(i.data===void 0)return(0,q.jsx)(U,{children:`Reading the turns…`});let o=i.data.toReversed();if(o.length===0)return(0,q.jsxs)(U,{children:[e,` has not finished a turn yet.`]});let s=de(o),c=s.usage===null?``:` · ${oe(s.usage)}${s.withUsage<s.turns?` over ${s.withUsage} of them`:``}`;return(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,q.jsxs)(`p`,{className:`px-4 pt-3 pb-1 text-meta`,title:s.usage===null?void 0:fe(s.usage),children:[s.turns===1?`1 turn`:`${s.turns} turns`,s.failed===0?``:`, ${s.failed} not completed`,c]}),t!==null&&!o.some(e=>e.turnId===t)?(0,q.jsx)(`p`,{className:`px-4 pb-1 text-meta`,children:i.data.length===n?`The turn this address opens is further back.`:`The turn this address opens is not in this citizen's history.`}):null,(0,q.jsx)(`ol`,{children:o.map(n=>(0,q.jsx)(Me,{name:e,entry:n,now:a,opened:t!==null&&n.turnId===t},n.id))}),i.data.length===n?(0,q.jsxs)(`button`,{type:`button`,onClick:()=>r(n+X),className:`px-4 py-3 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show `,X,` earlier turns`]}):null]})}var Z=``,Q=``;function Fe(e,t){return[{value:Z,name:`CLI default`,id:e.find(e=>e.isDefault)?.name??null,description:`Whatever the CLI runs when no model is set.`},...e.map(e=>({value:e.id,name:e.name,id:e.name===e.id?null:e.id,description:e.description})),...t===null?[]:[{value:t,name:t,id:null,description:`Not in the CLI's list.`}]]}function Ie(e,t){return[{value:Q,name:`Default`,id:e?.defaultEffort??null,description:`Whatever the model runs unset.`},...(e?.efforts??[]).map(e=>({value:e.id,name:e.id,id:null,description:e.description})),...t===null?[]:[{value:t,name:t,id:null,description:`Not in the model's list.`}]]}function Le({member:e,onDone:n}){let{api:r}=h(),a=t(),o=p(e.name),s=e.model??Z,c=e.effort??Q,[l,u]=(0,K.useState)(s),[d,f]=(0,K.useState)(c),m=D({mutationFn:async()=>{l!==s&&await r.setModel(e.name,l===Z?null:l),d!==c&&await r.setEffort(e.name,d===Q?null:d)},onSettled:()=>void a.invalidateQueries({queryKey:[`members`]}),onSuccess:n}),g=o.data?.models??[],_=e.model!==void 0&&!g.some(t=>t.id===e.model)?e.model:null,v=e=>g.find(t=>e===Z?t.isDefault:t.id===e),y=v(l)?.efforts??[],b=d!==Q&&!y.some(e=>e.id===d)?d:null,x=e=>{u(e);let t=v(e)?.efforts??[];d!==Q&&!t.some(e=>e.id===d)&&f(Q)},S=l!==s||d!==c;return(0,q.jsxs)(`form`,{"aria-label":`Model of ${e.name}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),m.mutate()},children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o.isPending?(0,q.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:[`Asking `,e.cli,` for its models…`]}):o.error===null?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(G,{label:`Model`,choices:Fe(g,_),value:l,onChange:x}),y.length===0&&b===null?null:(0,q.jsx)(`div`,{className:`flex w-32 shrink-0`,children:(0,q.jsx)(G,{label:`Effort`,choices:Ie(v(l),b),value:d,onChange:f,listClassName:`right-0 w-64`})})]}):(0,q.jsxs)(`p`,{role:`alert`,className:`min-w-0 flex-1 truncate text-xs text-red-400`,children:[e.cli,` did not list its models:`,` `,o.error instanceof i?o.error.message:`the board server did not answer`]}),(0,q.jsx)(O,{onClick:n,children:`Cancel`}),(0,q.jsx)(O,{variant:`primary`,type:`submit`,disabled:m.isPending||!S||o.error!==null,children:m.isPending?`Saving…`:`Save`})]}),o.data===void 0?null:(0,q.jsxs)(`p`,{className:`text-meta`,children:[`Listed by `,o.data.cli,` on `,o.data.runner]}),(0,q.jsx)(H,{error:m.error})]})}var $=``;function Re(e,t){let n=t.cli;return[e.status,e.clis.length===0?`offers no CLI yet`:e.clis.join(`, `),n!==null&&e.clis.length>0&&!e.clis.includes(n)?`has no ${n}`:``,e.capabilities.length===0?``:e.capabilities.join(`, `)].filter(e=>e!==``).join(` · `)}function ze(e,t){return[{value:$,name:`Any runner`,id:null,description:`Pinned to the least busy runner on its next turn outside a project.`},...e.map(e=>({value:e.name,name:e.name,id:e.os,description:Re(e,t)}))]}function Be({member:e,onDone:n}){let{api:r}=h(),i=t(),o=a(),s=e.homeRunner??$,[c,l]=(0,K.useState)(s),u=D({mutationFn:()=>r.setRunner(e.name,c===$?null:c),onSuccess:()=>{i.invalidateQueries({queryKey:[`members`]}),n()}});return(0,q.jsxs)(`form`,{"aria-label":`Runner of ${e.name}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),u.mutate()},children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o.data===void 0?(0,q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`Reading the runners…`}):(0,q.jsx)(G,{label:`Runner`,choices:ze(o.data,e),value:c,onChange:l}),(0,q.jsx)(O,{onClick:n,children:`Cancel`}),(0,q.jsx)(O,{variant:`primary`,type:`submit`,disabled:u.isPending||c===s,children:u.isPending?`Saving…`:`Run here`})]}),(0,q.jsx)(H,{error:u.error})]})}function Ve(e){if(e.thread!==void 0)return{threadId:e.thread};let t=e.scope===`society`?null:e.scope;return e.channel===void 0?e.place===void 0?{channel:e.askedIn??l(t,`general`)}:{channel:e.askedIn!==void 0&&n(e.askedIn).project===e.place?e.askedIn:l(e.place,`general`)}:{channel:l(t,e.channel)}}function He({name:e,turn:n}){let{api:r}=h(),i=t(),[a,o]=(0,K.useState)(!1),s=D({mutationFn:()=>r.stopTurn(n.turnId),onSuccess:()=>{o(!1),i.invalidateQueries({queryKey:[`scheduler`]})}});return(0,q.jsxs)(`div`,{className:`border-t border-line`,children:[(0,q.jsx)(F,{target:Ve(n),initialText:`@${e} `,placeholder:n.steerable?`Message ${e} while it works`:`Message ${e} for its next turn`,className:`px-3 pt-3 pb-2`},n.turnId),n.stoppable?(0,q.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pb-3`,children:[(0,q.jsx)(`p`,{className:`min-w-0 flex-1 text-[11px] leading-snug text-fg-muted`,children:a?`Stop ${e}'s turn?`:n.steerable?`Posts reach the turn at its next step.`:`This runner delivers posts after the turn ends.`}),a?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(O,{onClick:()=>{o(!1),s.reset()},children:`Keep it running`}),(0,q.jsx)(O,{variant:`primary`,disabled:s.isPending,onClick:()=>{s.mutate()},children:s.isPending?`Stopping…`:`Stop the turn`})]}):(0,q.jsx)(O,{onClick:()=>o(!0),children:`Stop…`})]}):null,s.error===null?null:(0,q.jsx)(`div`,{className:`px-3 pb-3`,children:(0,q.jsx)(H,{error:s.error})})]})}function Ue({member:e,scopes:n,preferred:r,running:i,paused:a,onDone:o}){let{api:s}=h(),c=t(),[l,u]=(0,K.useState)(`manual`),[d,f]=(0,K.useState)(r!==null&&n.includes(r)?r:n[0]??``),[p,m]=(0,K.useState)(``),g=(0,K.useRef)(null);(0,K.useEffect)(()=>g.current?.focus(),[]);let _=D({mutationFn:()=>s.wake({agent:e.name,project:d,kind:l,...p.trim()===``?{}:{reason:p.trim()}}),onSuccess:()=>{c.invalidateQueries({queryKey:[`scheduler`]}),o()}}),v=a?`The society is paused.`:i.includes(d)?`${e.name} is in a turn there now.`:null;return(0,q.jsxs)(`form`,{"aria-label":`Wake ${e.name}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),_.mutate()},children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`fieldset`,{className:`flex gap-1`,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:`Kind of turn`}),[`manual`,`reflection`].map(e=>(0,q.jsxs)(`label`,{className:`cursor-pointer rounded-md px-2.5 py-1 text-xs transition-colors has-focus-visible:ring-2 has-focus-visible:ring-fg-primary/30 ${l===e?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`kind`,value:e,checked:l===e,onChange:()=>u(e),className:`sr-only`}),e===`manual`?`A turn`:`A reflection`]},e))]}),(0,q.jsxs)(`div`,{className:`ml-auto flex w-52 items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-xs text-fg-tertiary`,children:`at`}),(0,q.jsx)(G,{label:`Where`,choices:le(n),value:d,onChange:f})]})]}),(0,q.jsx)(`textarea`,{ref:g,value:p,rows:2,placeholder:l===`reflection`?`What to reflect on, optional`:`What it should look at`,"aria-label":`Reason`,onChange:e=>m(e.target.value),className:`${re} resize-none`}),v===null?null:(0,q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:v}),(0,q.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,q.jsx)(O,{onClick:o,children:`Cancel`}),(0,q.jsx)(O,{variant:`primary`,type:`submit`,disabled:_.isPending||d===``,children:_.isPending?`Waking…`:l===`reflection`?`Ask for a reflection`:`Wake ${e.name}`})]}),(0,q.jsx)(H,{error:_.error})]})}var We={working:`bg-emerald-500/15 text-emerald-300`,queued:`bg-amber-500/15 text-amber-300`,idle:`bg-surface-2 text-fg-tertiary`};function Ge({project:e,name:t}){let n=(E(e).data??[]).filter(e=>e.status===`claimed`&&e.claimedBy===t);return n.length===0?null:(0,q.jsx)(`ul`,{className:`mt-1.5 space-y-1`,children:n.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsxs)(r,{to:`/task/$taskId`,params:{taskId:e.id},className:`flex items-center gap-2 rounded-md text-xs text-fg-secondary hover:text-fg-primary`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`text-fg-muted`,children:`◇`}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,q.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate font-mono text-[11px] text-fg-muted`,children:ee(e)?.name??e.stage})]})},e.id))})}function Ke(){let{name:e}=k({from:`/citizen/$name`}),{scope:t,tab:n,turn:r}=I({from:`/citizen/$name`});return(0,q.jsx)(Je,{name:e,chosen:t??null,tab:n??`now`,turn:r??null},e)}var qe=[{tab:`now`,label:`Now`},{tab:`turns`,label:`Turns`},{tab:`memory`,label:`Memory`},{tab:`history`,label:`History`}];function Je({name:t,chosen:n,tab:i,turn:s}){let c=C(),l=e(),u=g(),d=P(),p=S(),m=a(),h=o(),_=w(3e4),[v,y]=(0,K.useState)(null),b=c.data?.find(e=>e.name===t);if(b===void 0)return(0,q.jsx)(U,{children:c.data===void 0?`Reading the roster…`:`There is no citizen ${t}.`});let x=f(u.data?.running??[]).filter(e=>e.agent===t),T=[...new Set(x.map(e=>e.scope))],ee=x.map(e=>z(e.agent,e.scope,e)),E=f(u.data?.pending??[]).find(e=>e.agent===t),D=T.length>0?`working`:E===void 0?`idle`:`queued`,k=R(d,t)[0],A=k?.model??b.lastModel,j=A??b.model??`CLI default`,M=b.model!==void 0&&b.model!==A?b.model:null,N=l.data?.find(e=>e.name===b.role),F=se(b),I=b.status===`active`&&b.cli!==null,L=(p.data??[]).filter(e=>e.agent===t&&e.ended===void 0).length;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ie,{leading:b.cli===null?null:(0,q.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-2/70`,children:(0,q.jsx)(te,{cli:b.cli,size:20})}),title:t,subtitle:(0,q.jsxs)(q.Fragment,{children:[b.role,` · `,j,M===null?``:` · set to ${M}`,b.effort===void 0?``:` · ${b.effort} effort`,b.homeRunner===void 0?``:` · on ${b.homeRunner}`,b.status===`retired`?` · retired`:``]}),trailing:(0,q.jsxs)(q.Fragment,{children:[L===0?null:(0,q.jsx)(r,{to:`/crons`,search:{agent:t},className:`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none`,children:L===1?`1 cron`:`${L} crons`}),I&&v===null?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(O,{onClick:()=>y(`model`),children:`Model…`}),(0,q.jsx)(O,{onClick:()=>y(`runner`),children:`Runner…`}),(0,q.jsx)(O,{onClick:()=>y(`wake`),children:`Wake…`})]}):null,(0,q.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${We[D]}`,children:D})]})}),(0,q.jsx)(me,{member:b,runners:m.data??[],placed:new Map((h.data??[]).flatMap(e=>e.runner===void 0?[]:[[e.slug,e.runner]])),now:_}),v===`wake`?(0,q.jsx)(Ue,{member:b,scopes:F,preferred:n?.split(`/`)[0]??k?.scope??null,running:T,paused:u.data?.paused??!1,onDone:()=>y(null)}):v===`model`?(0,q.jsx)(Le,{member:b,onDone:()=>y(null)}):v===`runner`?(0,q.jsx)(Be,{member:b,onDone:()=>y(null)}):null,(0,q.jsx)(`nav`,{"aria-label":`Citizen views`,className:`flex gap-1 border-b border-line px-3 py-2`,children:qe.map(e=>(0,q.jsx)(r,{to:`/citizen/$name`,params:{name:t},search:{...n===null?{}:{scope:n},...e.tab===`now`?{}:{tab:e.tab}},replace:!0,"aria-current":e.tab===i?`page`:void 0,className:`rounded-md px-2.5 py-1 text-xs transition-colors ${e.tab===i?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:e.label},e.tab))}),i===`turns`?(0,q.jsx)(Pe,{name:t,opened:s},s):i===`memory`?(0,q.jsx)(Ae,{member:b,charter:N}):i===`history`?(0,q.jsx)(ke,{name:t}):(0,q.jsx)(Xe,{name:t,chosen:n,lastTurnAt:b.lastTurnAt,state:D,runningScopes:T,runningKeys:ee,runningTurns:(u.data?.turns??[]).filter(e=>e.agent===t),queuedScope:E?.scope??null})]})}function Ye(e){return e.toSorted((e,t)=>e.startedAt.localeCompare(t.startedAt))[0]}function Xe({name:e,chosen:t,lastTurnAt:n,state:i,runningScopes:a,runningKeys:o,runningTurns:s,queuedScope:c}){let l=P(),d=w(5e3),f=R(l,e),p=u(e,1),m=je(e,f.length===0?p.data?.at(-1):void 0),h=B(),g=e=>e.end===null&&o.includes(z(e.agent,e.scope,e)),_=t?.split(`/`)[0]??null,v=(t?.includes(`/`)===!0?f.find(e=>j(e)===t):void 0)??Ye(f.filter(e=>e.scope===_&&g(e)))??f.find(e=>j(e)===t)??Ye(f.filter(g))??f[0]??m.turn,y=e=>e.thread===void 0?e.channel===void 0?e.place===void 0?W(e.scope):`${W(e.scope)} · ${e.place}'s channels`:`${W(e.scope)} · #${e.channel}`:`${W(e.scope)} · ${h.get(e.thread)?.title??`a thread`}`,b=v!==void 0&&g(v),S=v?.scope??a[0]??c,C=(v===void 0?void 0:s.find(e=>e.scope===v.scope&&e.thread===v.thread&&e.channel===v.channel&&e.place===v.place))??(b?void 0:s[0]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`section`,{className:`border-b border-line px-4 py-3 text-xs text-fg-tertiary`,children:[(0,q.jsx)(`p`,{children:b?`In a turn at ${W(v.scope)} for ${v.fromStart?``:`at least `}${L(v.startedAt,d)}`:a.length>0?`In a turn at ${a.map(W).join(` and `)}`:c===null?n===void 0?`No turns yet`:`Last turn ${x(n,d)}`:`Queued for a turn at ${W(c)}`}),S===null||S===`society`?null:(0,q.jsx)(Ge,{project:S,name:e})]}),(0,q.jsx)(ae,{className:`px-4 py-3`,children:v===void 0?(0,q.jsx)(U,{children:i===`working`?`The turn has not reported a step yet.`:m.loading?`Reading the last turn…`:n===void 0?`${e} has not taken a turn yet.`:`${e}'s last turn kept no steps.`}):(0,q.jsxs)(q.Fragment,{children:[f.length>1?(0,q.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-1.5`,"aria-label":`Turns by conversation`,children:f.toSorted((e,t)=>j(e).localeCompare(j(t))).map(t=>(0,q.jsxs)(r,{to:`/citizen/$name`,params:{name:e},search:{scope:j(t)},replace:!0,"aria-current":t===v?`true`:void 0,className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[11px] transition-colors ${t===v?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[g(t)?(0,q.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}):null,y(t)]},j(t)))}):null,(0,q.jsxs)(`p`,{className:`text-caps`,children:[b?`This turn`:`Last turn`,` · `,y(v),` · started`,` `,v.fromStart?J(v.startedAt):`before the earliest step shown`]}),(0,q.jsx)(ve,{steps:v.steps}),(0,q.jsx)(ye,{turn:v,running:b,now:d})]})}),C===void 0?null:(0,q.jsx)(He,{name:e,turn:C})]})}export{Ke as CitizenView};
@@ -1 +1 @@
1
- import{H as e,Jt as t,O as n,S as r,Un as i,Wn as a,X as o,k as s,qn as c,t as l,v as u,x as d}from"./format-CENiwkJC.js";import{t as f}from"./CliIcon-C7bwChMP.js";import{k as p}from"./index-CPXALUV6.js";import{n as m,t as h}from"./Pane-BaM0TdE6.js";import{a as g,o as _,r as v}from"./citizen-BiHfph2A.js";import{r as y}from"./Quota-CfFGIql9.js";var b=c(a(),1),x=i(),S=[{window:`24h`,label:`24h`,title:`the last 24 hours`},{window:`7d`,label:`7d`,title:`the last 7 days`},{window:`all`,label:`All`,title:`all time`}];function C(e){let t=e.lastModel??e.model??`CLI default`,n=e.model!==void 0&&e.model!==t?`${t} · set to ${e.model}`:t;return e.effort===void 0?n:`${n} · ${e.effort}`}function w(e,t){return e.name.localeCompare(t.name)}function T(e,t){return e.role.localeCompare(t.role)||w(e,t)}function E({member:e,state:n,tokens:r,outputs:i,runners:a,placed:o,now:s}){let c=C(e),l=e.memberships.length===0?`no projects`:e.memberships.join(`, `),u=v(e,o);return(0,x.jsx)(`li`,{className:`col-span-full grid grid-cols-subgrid`,children:(0,x.jsxs)(t,{to:`/citizen/$name`,params:{name:e.name},className:`col-span-full grid grid-cols-subgrid items-center rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-surface-2/50`,children:[(0,x.jsxs)(`span`,{className:`relative grid size-4 place-items-center`,children:[e.cli===null?null:(0,x.jsx)(f,{cli:e.cli,size:13}),e.status===`active`?(0,x.jsx)(y,{member:e,runners:a,placed:o,now:s}):null]}),(0,x.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,x.jsx)(`span`,{className:`text-fg-secondary`,children:e.role}),(0,x.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:c,children:c}),(0,x.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:u.detail,children:u.label}),(0,x.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:l,children:l}),(0,x.jsxs)(`span`,{className:`col-[2/-1] row-start-2 text-right text-xs whitespace-nowrap text-fg-muted tabular-nums @min-[560px]:col-auto @min-[560px]:row-auto`,title:r.detail,children:[r.counts===null?r.label:(0,x.jsxs)(x.Fragment,{children:[`${r.counts.input} · `,(0,x.jsxs)(`span`,{className:`inline-grid justify-items-end`,children:[(0,x.jsx)(`span`,{className:`[grid-area:1/1]`,children:r.counts.output}),i.map(e=>(0,x.jsx)(`span`,{"data-width":e,className:`invisible [grid-area:1/1] before:content-[attr(data-width)]`},e))]})]}),r.spoken===null?null:(0,x.jsxs)(`span`,{className:`sr-only`,children:[`, `,r.spoken]})]}),(0,x.jsxs)(`span`,{className:`text-right text-xs whitespace-nowrap @min-[560px]:-ml-2 @min-[560px]:text-left`,children:[(0,x.jsxs)(`span`,{"aria-hidden":`true`,className:`hidden text-fg-muted @min-[560px]:inline`,children:[`·`,` `]}),(0,x.jsx)(`span`,{className:n.tone,title:n.detail,children:n.label})]})]})})}function D(){let{window:i=`24h`}=p({from:`/citizens`}),a=u(),c=s(),f=r(),v=n(),y=e(i),C=d(3e4),D=(0,b.useId)(),O=(0,b.useId)();if(a.data===void 0)return(0,x.jsx)(m,{children:`Reading the roster…`});let k=a.data.filter(e=>e.cli!==null),A=k.filter(e=>e.status===`active`).toSorted(T),j=k.filter(e=>e.status!==`active`).toSorted(w),M=new Set(A.map(e=>e.role)).size,N=o(c.data?.running??[]),P=o(c.data?.pending??[]),F=new Map((f.data??[]).flatMap(e=>e.runner===void 0?[]:[[e.slug,e.runner]])),I=new Map((y.data?.citizens??[]).map(e=>[e.agent,e])),L=e=>{if(e.status!==`active`)return{label:`retired`,detail:e.retiredAt===void 0?`retired`:`retired ${l(e.retiredAt,C)}`,tone:`text-fg-muted`};let t=[...new Set(N.filter(t=>t.agent===e.name).map(e=>e.scope))];return t.length>0?{label:`working`,detail:`in a turn at ${t.map(g).join(` and `)}`,tone:`text-emerald-300`}:P.some(t=>t.agent===e.name)?{label:`queued`,detail:`queued for a turn`,tone:`text-amber-300`}:{label:`resting`,detail:`resting`,tone:`text-fg-muted`}},R=e=>y.data===void 0?y.error===null?{label:`counting…`,counts:null,detail:void 0,spoken:null}:{label:`tokens unknown`,counts:null,detail:y.error.message,spoken:null}:_(I.get(e.name),i),z=[...new Set([...A,...j].flatMap(e=>R(e).counts?.output??[]))],B=e=>(0,x.jsx)(E,{member:e,state:L(e),tokens:R(e),outputs:z,runners:v.data??[],placed:F,now:C},e.name),V=(0,x.jsxs)(`nav`,{"aria-labelledby":D,className:`flex shrink-0 items-center gap-1`,children:[(0,x.jsx)(`span`,{id:D,className:`mr-1 text-caps`,children:`Tokens`}),S.map(e=>(0,x.jsx)(t,{to:`/citizens`,search:{window:e.window},title:e.title,"aria-current":e.window===i?`page`:void 0,className:`rounded-md px-2 py-1 text-xs transition-colors ${e.window===i?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`}`,children:e.label},e.window))]});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(h,{title:`Citizens`,subtitle:`${A.length} active in ${M===1?`1 role`:`${M} roles`}${j.length===0?``:` · ${j.length} retired`}`,trailing:V}),(0,x.jsxs)(`div`,{className:`@container flex-1 overflow-y-auto px-2 py-2`,children:[A.length===0?(0,x.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:j.length===0?`No citizens yet.`:`No active citizens.`}):null,(0,x.jsxs)(`div`,{className:`grid grid-cols-[auto_auto_auto_minmax(0,max-content)_minmax(0,max-content)_minmax(3rem,1fr)_auto] gap-x-3 @min-[560px]:grid-cols-[auto_auto_auto_minmax(0,max-content)_minmax(0,max-content)_minmax(0,max-content)_minmax(max-content,1fr)_auto]`,children:[(0,x.jsx)(`ul`,{className:`col-span-full grid grid-cols-subgrid`,children:A.map(B)}),j.length===0?null:(0,x.jsxs)(`section`,{"aria-labelledby":O,className:`col-span-full mt-2 grid grid-cols-subgrid border-t border-line pt-2`,children:[(0,x.jsx)(`h3`,{id:O,className:`col-span-full px-2 py-1 text-section`,children:`Retired`}),(0,x.jsx)(`ul`,{className:`col-span-full grid grid-cols-subgrid`,children:j.map(B)})]})]})]})]})}export{D as CitizensView};
1
+ import{H as e,Jt as t,O as n,S as r,Un as i,Wn as a,X as o,k as s,qn as c,t as l,v as u,x as d}from"./format-DpQyO6r1.js";import{t as f}from"./CliIcon-BB2NdLxN.js";import{k as p}from"./index-DhuCp-VF.js";import{n as m,t as h}from"./Pane-BlIRwUtQ.js";import{a as g,o as _,r as v}from"./citizen-CgA4vJjy.js";import{r as y}from"./Quota-59QJZrPa.js";var b=c(a(),1),x=i(),S=[{window:`24h`,label:`24h`,title:`the last 24 hours`},{window:`7d`,label:`7d`,title:`the last 7 days`},{window:`all`,label:`All`,title:`all time`}];function C(e){let t=e.lastModel??e.model??`CLI default`,n=e.model!==void 0&&e.model!==t?`${t} · set to ${e.model}`:t;return e.effort===void 0?n:`${n} · ${e.effort}`}function w(e,t){return e.name.localeCompare(t.name)}function T(e,t){return e.role.localeCompare(t.role)||w(e,t)}function E({member:e,state:n,tokens:r,outputs:i,runners:a,placed:o,now:s}){let c=C(e),l=e.memberships.length===0?`no projects`:e.memberships.join(`, `),u=v(e,o);return(0,x.jsx)(`li`,{className:`col-span-full grid grid-cols-subgrid`,children:(0,x.jsxs)(t,{to:`/citizen/$name`,params:{name:e.name},className:`col-span-full grid grid-cols-subgrid items-center rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-surface-2/50`,children:[(0,x.jsxs)(`span`,{className:`relative grid size-4 place-items-center`,children:[e.cli===null?null:(0,x.jsx)(f,{cli:e.cli,size:13}),e.status===`active`?(0,x.jsx)(y,{member:e,runners:a,placed:o,now:s}):null]}),(0,x.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,x.jsx)(`span`,{className:`text-fg-secondary`,children:e.role}),(0,x.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:c,children:c}),(0,x.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:u.detail,children:u.label}),(0,x.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:l,children:l}),(0,x.jsxs)(`span`,{className:`col-[2/-1] row-start-2 text-right text-xs whitespace-nowrap text-fg-muted tabular-nums @min-[560px]:col-auto @min-[560px]:row-auto`,title:r.detail,children:[r.counts===null?r.label:(0,x.jsxs)(x.Fragment,{children:[`${r.counts.input} · `,(0,x.jsxs)(`span`,{className:`inline-grid justify-items-end`,children:[(0,x.jsx)(`span`,{className:`[grid-area:1/1]`,children:r.counts.output}),i.map(e=>(0,x.jsx)(`span`,{"data-width":e,className:`invisible [grid-area:1/1] before:content-[attr(data-width)]`},e))]})]}),r.spoken===null?null:(0,x.jsxs)(`span`,{className:`sr-only`,children:[`, `,r.spoken]})]}),(0,x.jsxs)(`span`,{className:`text-right text-xs whitespace-nowrap @min-[560px]:-ml-2 @min-[560px]:text-left`,children:[(0,x.jsxs)(`span`,{"aria-hidden":`true`,className:`hidden text-fg-muted @min-[560px]:inline`,children:[`·`,` `]}),(0,x.jsx)(`span`,{className:n.tone,title:n.detail,children:n.label})]})]})})}function D(){let{window:i=`24h`}=p({from:`/citizens`}),a=u(),c=s(),f=r(),v=n(),y=e(i),C=d(3e4),D=(0,b.useId)(),O=(0,b.useId)();if(a.data===void 0)return(0,x.jsx)(m,{children:`Reading the roster…`});let k=a.data.filter(e=>e.cli!==null),A=k.filter(e=>e.status===`active`).toSorted(T),j=k.filter(e=>e.status!==`active`).toSorted(w),M=new Set(A.map(e=>e.role)).size,N=o(c.data?.running??[]),P=o(c.data?.pending??[]),F=new Map((f.data??[]).flatMap(e=>e.runner===void 0?[]:[[e.slug,e.runner]])),I=new Map((y.data?.citizens??[]).map(e=>[e.agent,e])),L=e=>{if(e.status!==`active`)return{label:`retired`,detail:e.retiredAt===void 0?`retired`:`retired ${l(e.retiredAt,C)}`,tone:`text-fg-muted`};let t=[...new Set(N.filter(t=>t.agent===e.name).map(e=>e.scope))];return t.length>0?{label:`working`,detail:`in a turn at ${t.map(g).join(` and `)}`,tone:`text-emerald-300`}:P.some(t=>t.agent===e.name)?{label:`queued`,detail:`queued for a turn`,tone:`text-amber-300`}:{label:`resting`,detail:`resting`,tone:`text-fg-muted`}},R=e=>y.data===void 0?y.error===null?{label:`counting…`,counts:null,detail:void 0,spoken:null}:{label:`tokens unknown`,counts:null,detail:y.error.message,spoken:null}:_(I.get(e.name),i),z=[...new Set([...A,...j].flatMap(e=>R(e).counts?.output??[]))],B=e=>(0,x.jsx)(E,{member:e,state:L(e),tokens:R(e),outputs:z,runners:v.data??[],placed:F,now:C},e.name),V=(0,x.jsxs)(`nav`,{"aria-labelledby":D,className:`flex shrink-0 items-center gap-1`,children:[(0,x.jsx)(`span`,{id:D,className:`mr-1 text-caps`,children:`Tokens`}),S.map(e=>(0,x.jsx)(t,{to:`/citizens`,search:{window:e.window},title:e.title,"aria-current":e.window===i?`page`:void 0,className:`rounded-md px-2 py-1 text-xs transition-colors ${e.window===i?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`}`,children:e.label},e.window))]});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(h,{title:`Citizens`,subtitle:`${A.length} active in ${M===1?`1 role`:`${M} roles`}${j.length===0?``:` · ${j.length} retired`}`,trailing:V}),(0,x.jsxs)(`div`,{className:`@container flex-1 overflow-y-auto px-2 py-2`,children:[A.length===0?(0,x.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:j.length===0?`No citizens yet.`:`No active citizens.`}):null,(0,x.jsxs)(`div`,{className:`grid grid-cols-[auto_auto_auto_minmax(0,max-content)_minmax(0,max-content)_minmax(3rem,1fr)_auto] gap-x-3 @min-[560px]:grid-cols-[auto_auto_auto_minmax(0,max-content)_minmax(0,max-content)_minmax(0,max-content)_minmax(max-content,1fr)_auto]`,children:[(0,x.jsx)(`ul`,{className:`col-span-full grid grid-cols-subgrid`,children:A.map(B)}),j.length===0?null:(0,x.jsxs)(`section`,{"aria-labelledby":O,className:`col-span-full mt-2 grid grid-cols-subgrid border-t border-line pt-2`,children:[(0,x.jsx)(`h3`,{id:O,className:`col-span-full px-2 py-1 text-section`,children:`Retired`}),(0,x.jsx)(`ul`,{className:`col-span-full grid grid-cols-subgrid`,children:j.map(B)})]})]})]})]})}export{D as CitizensView};
@@ -1 +1 @@
1
- import{Un as e}from"./format-CENiwkJC.js";var t=`M6.766 11.328c-2.063-.25-3.516-1.734-3.516-3.656 0-.781.281-1.625.75-2.188-.203-.515-.172-1.609.063-2.062.625-.078 1.468.25 1.968.703.594-.187 1.219-.281 1.985-.281.765 0 1.39.094 1.953.265.484-.437 1.344-.765 1.969-.687.218.422.25 1.515.046 2.047.5.593.766 1.39.766 2.203 0 1.922-1.453 3.375-3.547 3.64.531.344.89 1.094.89 1.954v1.625c0 .468.391.734.86.547C13.781 14.359 16 11.53 16 8.03 16 3.61 12.406 0 7.984 0 3.563 0 0 3.61 0 8.031a7.88 7.88 0 0 0 5.172 7.422c.422.156.828-.125.828-.547v-1.25c-.219.094-.5.156-.75.156-1.031 0-1.64-.562-2.078-1.609-.172-.422-.36-.672-.719-.719-.187-.015-.25-.093-.25-.187 0-.188.313-.328.625-.328.453 0 .844.281 1.25.86.313.452.64.655 1.031.655s.641-.14 1-.5c.266-.265.47-.5.657-.656`,n={claude:{label:`Claude Code`,path:`M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z`,fill:`#D97757`,accent:`#fb923c`},codex:{label:`Codex`,path:`M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z`,fill:`#f5f5f5`,accent:`#10b981`}},r=e();function i({cli:e,size:t=16}){let i=n[e];return(0,r.jsx)(`svg`,{viewBox:`0 0 24 24`,width:t,height:t,"aria-hidden":`true`,className:`shrink-0`,children:(0,r.jsx)(`path`,{d:i.path,fill:i.fill,fillRule:`evenodd`,clipRule:`evenodd`})})}export{n,t as r,i as t};
1
+ import{Un as e}from"./format-DpQyO6r1.js";var t=`M6.766 11.328c-2.063-.25-3.516-1.734-3.516-3.656 0-.781.281-1.625.75-2.188-.203-.515-.172-1.609.063-2.062.625-.078 1.468.25 1.968.703.594-.187 1.219-.281 1.985-.281.765 0 1.39.094 1.953.265.484-.437 1.344-.765 1.969-.687.218.422.25 1.515.046 2.047.5.593.766 1.39.766 2.203 0 1.922-1.453 3.375-3.547 3.64.531.344.89 1.094.89 1.954v1.625c0 .468.391.734.86.547C13.781 14.359 16 11.53 16 8.03 16 3.61 12.406 0 7.984 0 3.563 0 0 3.61 0 8.031a7.88 7.88 0 0 0 5.172 7.422c.422.156.828-.125.828-.547v-1.25c-.219.094-.5.156-.75.156-1.031 0-1.64-.562-2.078-1.609-.172-.422-.36-.672-.719-.719-.187-.015-.25-.093-.25-.187 0-.188.313-.328.625-.328.453 0 .844.281 1.25.86.313.452.64.655 1.031.655s.641-.14 1-.5c.266-.265.47-.5.657-.656`,n={claude:{label:`Claude Code`,path:`M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z`,fill:`#D97757`,accent:`#fb923c`},codex:{label:`Codex`,path:`M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z`,fill:`#f5f5f5`,accent:`#10b981`}},r=e();function i({cli:e,size:t=16}){let i=n[e];return(0,r.jsx)(`svg`,{viewBox:`0 0 24 24`,width:t,height:t,"aria-hidden":`true`,className:`shrink-0`,children:(0,r.jsx)(`path`,{d:i.path,fill:i.fill,fillRule:`evenodd`,clipRule:`evenodd`})})}export{n,t as r,i as t};
@@ -1 +1 @@
1
- import{F as e,Hn as t,Jt as n,Pt as r,S as i,Un as a,V as o,Wn as s,gt as c,j as l,qn as u,t as d,u as f,v as p,x as m}from"./format-CENiwkJC.js";import{n as h,t as g}from"./Button-Cp4cNRUX.js";import{t as _}from"./CliIcon-C7bwChMP.js";import{D as v,E as y,T as b,k as x,w as S}from"./index-CPXALUV6.js";import{t as C}from"./Markdown-DT3V-EVe.js";import{a as w,o as T,r as E}from"./ThreadForms-CG5Y926b.js";import{n as D,t as O}from"./Pane-BaM0TdE6.js";import{a as k,d as A,i as j}from"./citizen-BiHfph2A.js";import{n as M,r as N,t as P}from"./Picker-C2ig-0dT.js";var F=u(s(),1),I=a(),L=[`UTC`,...Intl.supportedValuesOf(`timeZone`).filter(e=>e!==`UTC`)],R=50;function z(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value??``;return n===`GMT`?`UTC`:n.replace(`GMT`,`UTC`)}function B({value:e,onChange:t,label:n,placeholder:r}){let[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(0),c=(0,F.useRef)(null),l=(0,F.useRef)([]),u=e.trim().toLowerCase(),d=(0,F.useMemo)(()=>(u===``?L:L.filter(e=>e.toLowerCase().includes(u))).slice(0,R),[u]),f=(0,F.useMemo)(()=>new Date,[]);(0,F.useEffect)(()=>{i&&l.current[o]?.scrollIntoView({block:`nearest`})},[i,o]),(0,F.useEffect)(()=>{if(!i)return;let e=e=>{e.target instanceof Node&&c.current?.contains(e.target)===!0||a(!1)};return window.addEventListener(`click`,e),()=>window.removeEventListener(`click`,e)},[i]);let p=e=>{t(e),a(!1)};return(0,I.jsxs)(`div`,{ref:c,className:`relative min-w-0 flex-1`,children:[(0,I.jsx)(`input`,{"aria-label":n,value:e,spellCheck:!1,autoComplete:`off`,placeholder:r,onChange:e=>{t(e.target.value),s(0),a(!0)},onClick:()=>a(!0),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!i){a(!0);return}let t=e.key===`ArrowDown`?1:-1;s(e=>(e+t+d.length)%Math.max(d.length,1))}else e.key===`Enter`&&i&&d[o]!==void 0?(e.preventDefault(),p(d[o])):e.key===`Tab`?a(!1):e.key===`Escape`&&i&&(e.preventDefault(),e.stopPropagation(),a(!1))},className:T}),i&&d.length>0&&(d.length!==1||d[0]!==e)?(0,I.jsx)(`div`,{className:`max-h-48 ${P}`,children:d.map((e,t)=>(0,I.jsxs)(`button`,{ref:e=>{l.current[t]=e},type:`button`,tabIndex:-1,"aria-current":t===o?`true`:void 0,onPointerDown:e=>e.preventDefault(),onPointerEnter:()=>s(t),onClick:()=>p(e),className:N(t===o),children:[(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-secondary`,children:e}),(0,I.jsx)(`span`,{className:`shrink-0 text-[11px] text-fg-muted`,children:z(e,f)})]},e))}):null]})}function V({word:e,children:t}){return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,I.jsx)(`span`,{className:`shrink-0 text-xs text-fg-tertiary`,children:e}),t]})}function H(e,t){return r(typeof e==`string`?new Date(e):e,t)}function U({cron:e}){let t=o(),r=b(e);if(r.kind===`thread`){let e=t.data?.find(e=>e.id===r.id)?.title??r.id;return(0,I.jsxs)(n,{to:`/thread/$threadId`,params:{threadId:r.id},className:`truncate hover:text-fg-primary`,children:[`thread “`,e,`”`]})}return r.kind===`channel`?(0,I.jsxs)(n,{to:`/c/$`,params:{_splat:r.ref},className:`hover:text-fg-primary`,children:[`#`,r.ref]}):r.kind===`place`?(0,I.jsxs)(n,{to:`/p/$slug`,params:{slug:r.project},className:`hover:text-fg-primary`,children:[r.project,`'s channels`]}):(0,I.jsxs)(`span`,{children:[`home at `,k(r.scope)]})}function W({cron:e,next:r,member:i,zone:a,now:o,focused:s}){let c=(0,F.useRef)(null);(0,F.useEffect)(()=>{s&&c.current!==null&&(c.current.open=!0,c.current.scrollIntoView({block:`nearest`}))},[s]);let{api:u}=l(),f=t(),[p,m]=(0,F.useState)(!1),[v,b]=(0,F.useState)(``),x=()=>void f.invalidateQueries({queryKey:[`crons`]}),S=h({mutationFn:t=>u.pauseCron(e.id,t),onSuccess:x}),w=h({mutationFn:()=>u.removeCron(e.id,v.trim()),onSuccess:x}),D=`at`in e.schedule?`once, ${H(e.schedule.at,a)}`:`${e.schedule.cron} · ${e.schedule.timezone??a}`,O=e.ended===void 0?e.paused===void 0?r===null?`no time to come`:r.getTime()<=o?`due, waiting for its turn`:d(r.toISOString(),o):`paused`:`ended ${d(e.ended.at,o)}`,k=y(e);return(0,I.jsx)(`li`,{className:`rounded-lg ${s?`bg-surface-2/30`:``}`,children:(0,I.jsxs)(`details`,{ref:c,className:`group`,children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer list-none rounded-lg px-2 py-2 hover:bg-surface-2/40 focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none`,children:[(0,I.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[i?.cli===void 0||i.cli===null?null:(0,I.jsx)(_,{cli:i.cli,size:13}),(0,I.jsx)(`span`,{className:`shrink-0 text-fg-secondary`,children:e.agent}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-primary`,children:e.title}),(0,I.jsx)(`span`,{className:`shrink-0 text-xs ${e.paused===void 0?`text-fg-muted`:`text-amber-300`}`,title:r===null?void 0:`${H(r,a)}, ${a}`,children:O})]}),(0,I.jsxs)(`p`,{className:`mt-0.5 flex items-baseline gap-1.5 truncate text-meta`,children:[(0,I.jsx)(`span`,{children:D}),(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsx)(U,{cron:e}),e.lastRun===void 0?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsxs)(`span`,{children:[`last turn `,e.lastRun.outcome,` `,d(e.lastRun.at,o)]})]}),k?(0,I.jsxs)(`span`,{className:`text-amber-300`,children:[`· `,e.failures,` failed in a row`]}):null]})]}),(0,I.jsxs)(`div`,{className:`space-y-3 px-2 pt-1 pb-3`,children:[(0,I.jsx)(`div`,{className:`rounded-lg bg-surface-2/30 px-3 py-2`,children:(0,I.jsx)(C,{text:e.note})}),(0,I.jsxs)(`p`,{className:`text-meta`,children:[`Set by `,e.createdBy,` `,d(e.createdAt,o),e.lastFiredAt===void 0?``:` · fired last ${H(e.lastFiredAt,a)}`,e.ended===void 0?``:` · ended by ${e.ended.by}: ${e.ended.reason}`]}),r===null?null:(0,I.jsxs)(`p`,{className:`text-meta`,children:[`Next `,H(r,a),` (`,a,`)`]}),e.lastRun===void 0?null:(0,I.jsx)(n,{to:`/citizen/$name`,params:{name:e.agent},search:{tab:`turns`,turn:e.lastRun.turnId},className:`text-meta underline-offset-2 hover:text-fg-primary hover:underline`,children:`Open its last turn`}),e.ended===void 0?p?(0,I.jsxs)(`form`,{"aria-label":`Remove ${e.title}`,className:`space-y-2`,onSubmit:e=>{e.preventDefault(),w.mutate()},children:[(0,I.jsx)(`input`,{value:v,"aria-label":`Why it ends`,placeholder:`Why it ends`,onChange:e=>b(e.target.value),className:T}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:()=>m(!1),children:`Cancel`}),(0,I.jsx)(g,{variant:`primary`,type:`submit`,disabled:w.isPending||v.trim()===``,children:w.isPending?`Removing…`:`Remove cron`})]}),(0,I.jsx)(E,{error:w.error})]}):(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:()=>S.mutate(e.paused===void 0),disabled:S.isPending,children:e.paused===void 0?`Pause`:`Resume`}),(0,I.jsx)(g,{onClick:()=>m(!0),children:`Remove…`}),(0,I.jsx)(E,{error:S.error})]}):null]})]})})}function G({zone:e,onDone:n}){let{api:r}=l(),i=t(),[a,o]=(0,F.useState)(e),s=new Intl.DateTimeFormat().resolvedOptions().timeZone,c=h({mutationFn:()=>r.setTimezone(a.trim()),onSuccess:()=>{i.invalidateQueries({queryKey:[`society`]}),i.invalidateQueries({queryKey:[`crons`]}),n()}});return(0,I.jsxs)(`form`,{"aria-label":`Time zone`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),c.mutate()},children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(B,{value:a,onChange:o,label:`Society time zone`}),s===a?null:(0,I.jsxs)(g,{onClick:()=>o(s),children:[`Use `,s]})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:n,children:`Cancel`}),(0,I.jsx)(g,{variant:`primary`,type:`submit`,disabled:c.isPending||a.trim()===``||a.trim()===e,children:c.isPending?`Saving…`:`Save`})]}),(0,I.jsx)(E,{error:c.error})]})}function K({members:n,preferred:r,zone:a,onDone:o}){let{api:s}=l(),u=t(),d=i(),f=e(),[p,_]=(0,F.useState)(n.find(e=>e.name===r)?.name??n[0]?.name??``),y=n.find(e=>e.name===p),b=y===void 0?[]:A(y),[x,S]=(0,F.useState)(b[0]??`society`),[C,D]=(0,F.useState)(``),[O,k]=(0,F.useState)(`repeats`),[N,P]=(0,F.useState)(`0 9 * * 1-5`),[L,R]=(0,F.useState)(``),[z,U]=(0,F.useState)(``),[W,G]=(0,F.useState)(``),[K,q]=(0,F.useState)(``),J=(0,F.useRef)(null);(0,F.useEffect)(()=>J.current?.focus(),[]);let Y=m(3e4),ee=(x===`society`?f.data?.channels??[]:d.data?.find(e=>e.slug===x)?.channels??[]).filter(e=>e!==`general`),X=O===`repeats`?{cron:N,...L.trim()===``?{}:{timezone:L.trim()}}:{at:z===``?``:new Date(z).toISOString()},Z=v(O===`once`&&z===``?{at:`invalid`}:X,a,new Date(Y)),Q=O===`repeats`?L.trim()===``?a:L.trim():a,$=h({mutationFn:()=>s.createCron({agent:p,title:W.trim(),note:K.trim(),project:x,...C===``?{}:{channel:C},...X}),onSuccess:()=>{u.invalidateQueries({queryKey:[`crons`]}),o()}});return(0,I.jsxs)(`form`,{"aria-label":`New cron`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),$.mutate()},children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(V,{word:`wakes`,children:(0,I.jsx)(M,{label:`Citizen`,choices:n.map(e=>({value:e.name,name:e.name,id:e.role,description:e.memberships.length===0?`in no project`:`in ${e.memberships.join(`, `)}`})),value:p,onChange:e=>{let t=n.find(t=>t.name===e);_(e),S(t===void 0?c:A(t)[0]??`society`),D(``)}})}),(0,I.jsx)(V,{word:`at`,children:(0,I.jsx)(M,{label:`Where`,choices:j(b),value:x,onChange:e=>{S(e),D(``)}})}),(0,I.jsx)(V,{word:`in`,children:(0,I.jsx)(M,{label:`Conversation`,choices:[{value:``,name:`its home`,id:null,description:`general, and work tied to no other channel`},...ee.map(e=>({value:e,name:`#${e}`,id:null,description:`a workstream's own conversation`}))],value:C,onChange:D})})]}),(0,I.jsx)(`input`,{ref:J,value:W,maxLength:120,"aria-label":`Title`,placeholder:`Title, such as Morning report`,onChange:e=>G(e.target.value),className:T}),(0,I.jsx)(`textarea`,{value:K,rows:3,"aria-label":`Note`,placeholder:`What to do when it fires`,onChange:e=>q(e.target.value),className:w}),(0,I.jsxs)(`fieldset`,{className:`flex gap-1`,children:[(0,I.jsx)(`legend`,{className:`sr-only`,children:`How often`}),[`repeats`,`once`].map(e=>(0,I.jsxs)(`label`,{className:`cursor-pointer rounded-md px-2.5 py-1 text-xs transition-colors has-focus-visible:ring-2 has-focus-visible:ring-fg-primary/30 ${O===e?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[(0,I.jsx)(`input`,{type:`radio`,name:`kind`,value:e,checked:O===e,onChange:()=>k(e),className:`sr-only`}),e===`repeats`?`Repeats`:`Once`]},e))]}),O===`repeats`?(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`w-44 shrink-0`,children:(0,I.jsx)(`input`,{value:N,spellCheck:!1,"aria-label":`Cron expression`,placeholder:`minute hour day month weekday`,onChange:e=>P(e.target.value),className:T})}),(0,I.jsx)(B,{value:L,onChange:R,label:`Its time zone`,placeholder:`${a}, the society's`})]}):(0,I.jsx)(`input`,{type:`datetime-local`,value:z,"aria-label":`When, in this browser's time`,onChange:e=>U(e.target.value),className:T}),(0,I.jsx)(`p`,{"aria-live":`polite`,className:`text-xs leading-relaxed text-fg-muted`,children:`error`in Z?(0,I.jsx)(`span`,{className:`text-amber-300`,children:Z.error}):(0,I.jsxs)(I.Fragment,{children:[Z.times.length===1?`Fires `:`Fires next `,Z.times.map(e=>H(e,Q)).join(`, `),` (`,Q,`).`]})}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:o,children:`Cancel`}),(0,I.jsx)(g,{variant:`primary`,type:`submit`,disabled:$.isPending||p===``||W.trim()===``||K.trim()===``||`error`in Z,children:$.isPending?`Setting…`:`Set cron`})]}),(0,I.jsx)(E,{error:$.error})]})}function q(){let{agent:t,cron:r}=x({from:`/crons`}),i=f(),a=p(),o=e(),s=m(3e4),[c,l]=(0,F.useState)(null),u=o.data?.timezone??`UTC`,d=(i.data??[]).filter(e=>t===void 0||e.agent===t),h=S(d,u),_=d.filter(y).length,v=(a.data??[]).filter(e=>e.status===`active`&&e.cli!==null),b=e=>a.data?.find(t=>t.name===e);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(O,{title:t===void 0?`Crons`:`Crons of ${t}`,subtitle:[`${h.active.length} running`,...h.paused.length===0?[]:[`${h.paused.length} paused`],..._===0?[]:[`${_} failing`],`times in ${u}`].join(` · `),trailing:c===null?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(g,{onClick:()=>l(`zone`),children:`Time zone…`}),(0,I.jsx)(g,{onClick:()=>l(`new`),disabled:v.length===0,children:`New cron…`})]}):null}),c===`new`?(0,I.jsx)(K,{members:v,preferred:t,zone:u,onDone:()=>l(null)}):c===`zone`?(0,I.jsx)(G,{zone:u,onDone:()=>l(null)}):null,(0,I.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[t===void 0?null:(0,I.jsx)(n,{to:`/crons`,className:`block px-2 pb-2 text-meta hover:text-fg-primary`,children:`Show every citizen's crons`}),i.error!==null&&i.data===void 0?(0,I.jsxs)(D,{children:[`Could not read the crons: `,i.error.message]}):i.data===void 0?(0,I.jsx)(D,{children:`Reading the crons…`}):h.active.length+h.paused.length+h.ended.length===0?(0,I.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:`No crons yet.`}):null,h.active.length===0?null:(0,I.jsx)(`ul`,{"aria-label":`Running`,className:`space-y-0.5`,children:h.active.map(({cron:e,next:t})=>(0,I.jsx)(W,{cron:e,next:t,member:b(e.agent),zone:u,now:s,focused:e.id===r},e.id))}),h.paused.length===0?null:(0,I.jsxs)(`section`,{"aria-label":`Paused`,className:`mt-3`,children:[(0,I.jsx)(`h3`,{className:`px-2 pb-1 text-section`,children:`Paused`}),(0,I.jsx)(`ul`,{className:`space-y-0.5`,children:h.paused.map(e=>(0,I.jsx)(W,{cron:e,next:null,member:b(e.agent),zone:u,now:s,focused:e.id===r},e.id))})]}),h.ended.length===0?null:(0,I.jsxs)(`details`,{className:`mt-3`,open:h.ended.some(e=>e.id===r),children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer px-2 pb-1 text-section`,children:[`Ended (`,h.ended.length,`)`]}),(0,I.jsx)(`ul`,{"aria-label":`Ended`,className:`space-y-0.5`,children:h.ended.map(e=>(0,I.jsx)(W,{cron:e,next:null,member:b(e.agent),zone:u,now:s,focused:e.id===r},e.id))})]})]})]})}export{q as CronsView};
1
+ import{F as e,Hn as t,Jt as n,Pt as r,S as i,Un as a,V as o,Wn as s,gt as c,j as l,qn as u,t as d,u as f,v as p,x as m}from"./format-DpQyO6r1.js";import{n as h,t as g}from"./Button-CxjWy598.js";import{t as _}from"./CliIcon-BB2NdLxN.js";import{D as v,E as y,T as b,k as x,w as S}from"./index-DhuCp-VF.js";import{t as C}from"./Markdown-C7RbUEZE.js";import{a as w,o as T,r as E}from"./ThreadForms-D94Jj0ES.js";import{n as D,t as O}from"./Pane-BlIRwUtQ.js";import{a as k,d as A,i as j}from"./citizen-CgA4vJjy.js";import{n as M,r as N,t as P}from"./Picker-BSOB2JM_.js";var F=u(s(),1),I=a(),L=[`UTC`,...Intl.supportedValuesOf(`timeZone`).filter(e=>e!==`UTC`)],R=50;function z(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value??``;return n===`GMT`?`UTC`:n.replace(`GMT`,`UTC`)}function B({value:e,onChange:t,label:n,placeholder:r}){let[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(0),c=(0,F.useRef)(null),l=(0,F.useRef)([]),u=e.trim().toLowerCase(),d=(0,F.useMemo)(()=>(u===``?L:L.filter(e=>e.toLowerCase().includes(u))).slice(0,R),[u]),f=(0,F.useMemo)(()=>new Date,[]);(0,F.useEffect)(()=>{i&&l.current[o]?.scrollIntoView({block:`nearest`})},[i,o]),(0,F.useEffect)(()=>{if(!i)return;let e=e=>{e.target instanceof Node&&c.current?.contains(e.target)===!0||a(!1)};return window.addEventListener(`click`,e),()=>window.removeEventListener(`click`,e)},[i]);let p=e=>{t(e),a(!1)};return(0,I.jsxs)(`div`,{ref:c,className:`relative min-w-0 flex-1`,children:[(0,I.jsx)(`input`,{"aria-label":n,value:e,spellCheck:!1,autoComplete:`off`,placeholder:r,onChange:e=>{t(e.target.value),s(0),a(!0)},onClick:()=>a(!0),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!i){a(!0);return}let t=e.key===`ArrowDown`?1:-1;s(e=>(e+t+d.length)%Math.max(d.length,1))}else e.key===`Enter`&&i&&d[o]!==void 0?(e.preventDefault(),p(d[o])):e.key===`Tab`?a(!1):e.key===`Escape`&&i&&(e.preventDefault(),e.stopPropagation(),a(!1))},className:T}),i&&d.length>0&&(d.length!==1||d[0]!==e)?(0,I.jsx)(`div`,{className:`max-h-48 ${P}`,children:d.map((e,t)=>(0,I.jsxs)(`button`,{ref:e=>{l.current[t]=e},type:`button`,tabIndex:-1,"aria-current":t===o?`true`:void 0,onPointerDown:e=>e.preventDefault(),onPointerEnter:()=>s(t),onClick:()=>p(e),className:N(t===o),children:[(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-secondary`,children:e}),(0,I.jsx)(`span`,{className:`shrink-0 text-[11px] text-fg-muted`,children:z(e,f)})]},e))}):null]})}function V({word:e,children:t}){return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,I.jsx)(`span`,{className:`shrink-0 text-xs text-fg-tertiary`,children:e}),t]})}function H(e,t){return r(typeof e==`string`?new Date(e):e,t)}function U({cron:e}){let t=o(),r=b(e);if(r.kind===`thread`){let e=t.data?.find(e=>e.id===r.id)?.title??r.id;return(0,I.jsxs)(n,{to:`/thread/$threadId`,params:{threadId:r.id},className:`truncate hover:text-fg-primary`,children:[`thread “`,e,`”`]})}return r.kind===`channel`?(0,I.jsxs)(n,{to:`/c/$`,params:{_splat:r.ref},className:`hover:text-fg-primary`,children:[`#`,r.ref]}):r.kind===`place`?(0,I.jsxs)(n,{to:`/p/$slug`,params:{slug:r.project},className:`hover:text-fg-primary`,children:[r.project,`'s channels`]}):(0,I.jsxs)(`span`,{children:[`home at `,k(r.scope)]})}function W({cron:e,next:r,member:i,zone:a,now:o,focused:s}){let c=(0,F.useRef)(null);(0,F.useEffect)(()=>{s&&c.current!==null&&(c.current.open=!0,c.current.scrollIntoView({block:`nearest`}))},[s]);let{api:u}=l(),f=t(),[p,m]=(0,F.useState)(!1),[v,b]=(0,F.useState)(``),x=()=>void f.invalidateQueries({queryKey:[`crons`]}),S=h({mutationFn:t=>u.pauseCron(e.id,t),onSuccess:x}),w=h({mutationFn:()=>u.removeCron(e.id,v.trim()),onSuccess:x}),D=`at`in e.schedule?`once, ${H(e.schedule.at,a)}`:`${e.schedule.cron} · ${e.schedule.timezone??a}`,O=e.ended===void 0?e.paused===void 0?r===null?`no time to come`:r.getTime()<=o?`due, waiting for its turn`:d(r.toISOString(),o):`paused`:`ended ${d(e.ended.at,o)}`,k=y(e);return(0,I.jsx)(`li`,{className:`rounded-lg ${s?`bg-surface-2/30`:``}`,children:(0,I.jsxs)(`details`,{ref:c,className:`group`,children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer list-none rounded-lg px-2 py-2 hover:bg-surface-2/40 focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none`,children:[(0,I.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[i?.cli===void 0||i.cli===null?null:(0,I.jsx)(_,{cli:i.cli,size:13}),(0,I.jsx)(`span`,{className:`shrink-0 text-fg-secondary`,children:e.agent}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-primary`,children:e.title}),(0,I.jsx)(`span`,{className:`shrink-0 text-xs ${e.paused===void 0?`text-fg-muted`:`text-amber-300`}`,title:r===null?void 0:`${H(r,a)}, ${a}`,children:O})]}),(0,I.jsxs)(`p`,{className:`mt-0.5 flex items-baseline gap-1.5 truncate text-meta`,children:[(0,I.jsx)(`span`,{children:D}),(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsx)(U,{cron:e}),e.lastRun===void 0?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsxs)(`span`,{children:[`last turn `,e.lastRun.outcome,` `,d(e.lastRun.at,o)]})]}),k?(0,I.jsxs)(`span`,{className:`text-amber-300`,children:[`· `,e.failures,` failed in a row`]}):null]})]}),(0,I.jsxs)(`div`,{className:`space-y-3 px-2 pt-1 pb-3`,children:[(0,I.jsx)(`div`,{className:`rounded-lg bg-surface-2/30 px-3 py-2`,children:(0,I.jsx)(C,{text:e.note})}),(0,I.jsxs)(`p`,{className:`text-meta`,children:[`Set by `,e.createdBy,` `,d(e.createdAt,o),e.lastFiredAt===void 0?``:` · fired last ${H(e.lastFiredAt,a)}`,e.ended===void 0?``:` · ended by ${e.ended.by}: ${e.ended.reason}`]}),r===null?null:(0,I.jsxs)(`p`,{className:`text-meta`,children:[`Next `,H(r,a),` (`,a,`)`]}),e.lastRun===void 0?null:(0,I.jsx)(n,{to:`/citizen/$name`,params:{name:e.agent},search:{tab:`turns`,turn:e.lastRun.turnId},className:`text-meta underline-offset-2 hover:text-fg-primary hover:underline`,children:`Open its last turn`}),e.ended===void 0?p?(0,I.jsxs)(`form`,{"aria-label":`Remove ${e.title}`,className:`space-y-2`,onSubmit:e=>{e.preventDefault(),w.mutate()},children:[(0,I.jsx)(`input`,{value:v,"aria-label":`Why it ends`,placeholder:`Why it ends`,onChange:e=>b(e.target.value),className:T}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:()=>m(!1),children:`Cancel`}),(0,I.jsx)(g,{variant:`primary`,type:`submit`,disabled:w.isPending||v.trim()===``,children:w.isPending?`Removing…`:`Remove cron`})]}),(0,I.jsx)(E,{error:w.error})]}):(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:()=>S.mutate(e.paused===void 0),disabled:S.isPending,children:e.paused===void 0?`Pause`:`Resume`}),(0,I.jsx)(g,{onClick:()=>m(!0),children:`Remove…`}),(0,I.jsx)(E,{error:S.error})]}):null]})]})})}function G({zone:e,onDone:n}){let{api:r}=l(),i=t(),[a,o]=(0,F.useState)(e),s=new Intl.DateTimeFormat().resolvedOptions().timeZone,c=h({mutationFn:()=>r.setTimezone(a.trim()),onSuccess:()=>{i.invalidateQueries({queryKey:[`society`]}),i.invalidateQueries({queryKey:[`crons`]}),n()}});return(0,I.jsxs)(`form`,{"aria-label":`Time zone`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),c.mutate()},children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(B,{value:a,onChange:o,label:`Society time zone`}),s===a?null:(0,I.jsxs)(g,{onClick:()=>o(s),children:[`Use `,s]})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:n,children:`Cancel`}),(0,I.jsx)(g,{variant:`primary`,type:`submit`,disabled:c.isPending||a.trim()===``||a.trim()===e,children:c.isPending?`Saving…`:`Save`})]}),(0,I.jsx)(E,{error:c.error})]})}function K({members:n,preferred:r,zone:a,onDone:o}){let{api:s}=l(),u=t(),d=i(),f=e(),[p,_]=(0,F.useState)(n.find(e=>e.name===r)?.name??n[0]?.name??``),y=n.find(e=>e.name===p),b=y===void 0?[]:A(y),[x,S]=(0,F.useState)(b[0]??`society`),[C,D]=(0,F.useState)(``),[O,k]=(0,F.useState)(`repeats`),[N,P]=(0,F.useState)(`0 9 * * 1-5`),[L,R]=(0,F.useState)(``),[z,U]=(0,F.useState)(``),[W,G]=(0,F.useState)(``),[K,q]=(0,F.useState)(``),J=(0,F.useRef)(null);(0,F.useEffect)(()=>J.current?.focus(),[]);let Y=m(3e4),ee=(x===`society`?f.data?.channels??[]:d.data?.find(e=>e.slug===x)?.channels??[]).filter(e=>e!==`general`),X=O===`repeats`?{cron:N,...L.trim()===``?{}:{timezone:L.trim()}}:{at:z===``?``:new Date(z).toISOString()},Z=v(O===`once`&&z===``?{at:`invalid`}:X,a,new Date(Y)),Q=O===`repeats`?L.trim()===``?a:L.trim():a,$=h({mutationFn:()=>s.createCron({agent:p,title:W.trim(),note:K.trim(),project:x,...C===``?{}:{channel:C},...X}),onSuccess:()=>{u.invalidateQueries({queryKey:[`crons`]}),o()}});return(0,I.jsxs)(`form`,{"aria-label":`New cron`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),$.mutate()},children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(V,{word:`wakes`,children:(0,I.jsx)(M,{label:`Citizen`,choices:n.map(e=>({value:e.name,name:e.name,id:e.role,description:e.memberships.length===0?`in no project`:`in ${e.memberships.join(`, `)}`})),value:p,onChange:e=>{let t=n.find(t=>t.name===e);_(e),S(t===void 0?c:A(t)[0]??`society`),D(``)}})}),(0,I.jsx)(V,{word:`at`,children:(0,I.jsx)(M,{label:`Where`,choices:j(b),value:x,onChange:e=>{S(e),D(``)}})}),(0,I.jsx)(V,{word:`in`,children:(0,I.jsx)(M,{label:`Conversation`,choices:[{value:``,name:`its home`,id:null,description:`general, and work tied to no other channel`},...ee.map(e=>({value:e,name:`#${e}`,id:null,description:`a workstream's own conversation`}))],value:C,onChange:D})})]}),(0,I.jsx)(`input`,{ref:J,value:W,maxLength:120,"aria-label":`Title`,placeholder:`Title, such as Morning report`,onChange:e=>G(e.target.value),className:T}),(0,I.jsx)(`textarea`,{value:K,rows:3,"aria-label":`Note`,placeholder:`What to do when it fires`,onChange:e=>q(e.target.value),className:w}),(0,I.jsxs)(`fieldset`,{className:`flex gap-1`,children:[(0,I.jsx)(`legend`,{className:`sr-only`,children:`How often`}),[`repeats`,`once`].map(e=>(0,I.jsxs)(`label`,{className:`cursor-pointer rounded-md px-2.5 py-1 text-xs transition-colors has-focus-visible:ring-2 has-focus-visible:ring-fg-primary/30 ${O===e?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[(0,I.jsx)(`input`,{type:`radio`,name:`kind`,value:e,checked:O===e,onChange:()=>k(e),className:`sr-only`}),e===`repeats`?`Repeats`:`Once`]},e))]}),O===`repeats`?(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`w-44 shrink-0`,children:(0,I.jsx)(`input`,{value:N,spellCheck:!1,"aria-label":`Cron expression`,placeholder:`minute hour day month weekday`,onChange:e=>P(e.target.value),className:T})}),(0,I.jsx)(B,{value:L,onChange:R,label:`Its time zone`,placeholder:`${a}, the society's`})]}):(0,I.jsx)(`input`,{type:`datetime-local`,value:z,"aria-label":`When, in this browser's time`,onChange:e=>U(e.target.value),className:T}),(0,I.jsx)(`p`,{"aria-live":`polite`,className:`text-xs leading-relaxed text-fg-muted`,children:`error`in Z?(0,I.jsx)(`span`,{className:`text-amber-300`,children:Z.error}):(0,I.jsxs)(I.Fragment,{children:[Z.times.length===1?`Fires `:`Fires next `,Z.times.map(e=>H(e,Q)).join(`, `),` (`,Q,`).`]})}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:o,children:`Cancel`}),(0,I.jsx)(g,{variant:`primary`,type:`submit`,disabled:$.isPending||p===``||W.trim()===``||K.trim()===``||`error`in Z,children:$.isPending?`Setting…`:`Set cron`})]}),(0,I.jsx)(E,{error:$.error})]})}function q(){let{agent:t,cron:r}=x({from:`/crons`}),i=f(),a=p(),o=e(),s=m(3e4),[c,l]=(0,F.useState)(null),u=o.data?.timezone??`UTC`,d=(i.data??[]).filter(e=>t===void 0||e.agent===t),h=S(d,u),_=d.filter(y).length,v=(a.data??[]).filter(e=>e.status===`active`&&e.cli!==null),b=e=>a.data?.find(t=>t.name===e);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(O,{title:t===void 0?`Crons`:`Crons of ${t}`,subtitle:[`${h.active.length} running`,...h.paused.length===0?[]:[`${h.paused.length} paused`],..._===0?[]:[`${_} failing`],`times in ${u}`].join(` · `),trailing:c===null?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(g,{onClick:()=>l(`zone`),children:`Time zone…`}),(0,I.jsx)(g,{onClick:()=>l(`new`),disabled:v.length===0,children:`New cron…`})]}):null}),c===`new`?(0,I.jsx)(K,{members:v,preferred:t,zone:u,onDone:()=>l(null)}):c===`zone`?(0,I.jsx)(G,{zone:u,onDone:()=>l(null)}):null,(0,I.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[t===void 0?null:(0,I.jsx)(n,{to:`/crons`,className:`block px-2 pb-2 text-meta hover:text-fg-primary`,children:`Show every citizen's crons`}),i.error!==null&&i.data===void 0?(0,I.jsxs)(D,{children:[`Could not read the crons: `,i.error.message]}):i.data===void 0?(0,I.jsx)(D,{children:`Reading the crons…`}):h.active.length+h.paused.length+h.ended.length===0?(0,I.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:`No crons yet.`}):null,h.active.length===0?null:(0,I.jsx)(`ul`,{"aria-label":`Running`,className:`space-y-0.5`,children:h.active.map(({cron:e,next:t})=>(0,I.jsx)(W,{cron:e,next:t,member:b(e.agent),zone:u,now:s,focused:e.id===r},e.id))}),h.paused.length===0?null:(0,I.jsxs)(`section`,{"aria-label":`Paused`,className:`mt-3`,children:[(0,I.jsx)(`h3`,{className:`px-2 pb-1 text-section`,children:`Paused`}),(0,I.jsx)(`ul`,{className:`space-y-0.5`,children:h.paused.map(e=>(0,I.jsx)(W,{cron:e,next:null,member:b(e.agent),zone:u,now:s,focused:e.id===r},e.id))})]}),h.ended.length===0?null:(0,I.jsxs)(`details`,{className:`mt-3`,open:h.ended.some(e=>e.id===r),children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer px-2 pb-1 text-section`,children:[`Ended (`,h.ended.length,`)`]}),(0,I.jsx)(`ul`,{"aria-label":`Ended`,className:`space-y-0.5`,children:h.ended.map(e=>(0,I.jsx)(W,{cron:e,next:null,member:b(e.agent),zone:u,now:s,focused:e.id===r},e.id))})]})]})]})}export{q as CronsView};
@@ -1 +1 @@
1
- import{Un as e}from"./format-CENiwkJC.js";var t=e(),n=`flex w-full items-baseline gap-2 rounded-md py-0.5 text-left text-sm hover:bg-surface-2/40`;function r({nested:e,children:n}){return(0,t.jsx)(`ul`,{className:e?`ml-[5px] border-l border-line-strong pl-2`:`mt-2`,children:n})}function i({name:e,open:r,onToggle:i,children:a}){return(0,t.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:i,className:n,children:[(0,t.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block w-2.5 shrink-0 text-[10px] text-fg-muted transition-transform ${r?`rotate-90`:``}`,children:`▸`}),(0,t.jsxs)(`span`,{className:`min-w-0 truncate text-fg-primary`,children:[e,`/`]}),a]})}function a(){return(0,t.jsx)(`span`,{"aria-hidden":`true`,className:`w-2.5 shrink-0`})}export{r as i,i as n,n as r,a as t};
1
+ import{Un as e}from"./format-DpQyO6r1.js";var t=e(),n=`flex w-full items-baseline gap-2 rounded-md py-0.5 text-left text-sm hover:bg-surface-2/40`;function r({nested:e,children:n}){return(0,t.jsx)(`ul`,{className:e?`ml-[5px] border-l border-line-strong pl-2`:`mt-2`,children:n})}function i({name:e,open:r,onToggle:i,children:a}){return(0,t.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:i,className:n,children:[(0,t.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block w-2.5 shrink-0 text-[10px] text-fg-muted transition-transform ${r?`rotate-90`:``}`,children:`▸`}),(0,t.jsxs)(`span`,{className:`min-w-0 truncate text-fg-primary`,children:[e,`/`]}),a]})}function a(){return(0,t.jsx)(`span`,{"aria-hidden":`true`,className:`w-2.5 shrink-0`})}export{r as i,i as n,n as r,a as t};
@@ -1,4 +1,4 @@
1
- import{I as e,Jt as t,K as n,S as r,Un as i,Wn as a,c as o,it as s,qn as c,t as l,x as u}from"./format-CENiwkJC.js";import{A as d,k as f}from"./index-CPXALUV6.js";import{t as p}from"./BackLink-UTiLF1J4.js";import{_ as m,a as h,d as g,g as _,h as v,i as y,n as b,p as x,r as S,s as C,t as w,u as T}from"./Markdown-DT3V-EVe.js";import{n as E,t as D}from"./Pane-BaM0TdE6.js";var O=c(a(),1),k=i(),A=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,j=`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary`,M=1e3,N=2e4;function P({source:e,path:t}){let n=t===``?[]:t.split(`/`),r=`text-fg-tertiary hover:text-fg-primary`;return(0,k.jsxs)(`nav`,{"aria-label":`Path`,className:`flex flex-wrap items-center gap-x-1 text-meta`,children:[n.length===0?(0,k.jsx)(`span`,{children:`Files`}):(0,k.jsx)(b,{source:e,path:``,className:r,children:`Files`}),n.map((t,i)=>(0,k.jsxs)(O.Fragment,{children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i===n.length-1?(0,k.jsx)(`span`,{className:`text-fg-secondary`,children:t}):(0,k.jsx)(b,{source:e,path:n.slice(0,i+1).join(`/`),className:r,children:t})]},n.slice(0,i+1).join(`/`)))]})}function F({rows:e}){let[t,...n]=e;if(t===void 0)return(0,k.jsx)(`p`,{className:`mt-3 text-meta`,children:`The table is empty.`});let r=n.slice(0,M),i=`border border-line px-2 py-1 text-left align-top whitespace-pre-wrap`;return(0,k.jsxs)(`div`,{className:`mt-3 overflow-x-auto`,children:[(0,k.jsxs)(`table`,{className:`text-xs text-fg-secondary`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsx)(`tr`,{children:t.map((e,t)=>(0,k.jsx)(`th`,{scope:`col`,className:`${i} font-medium text-fg-primary`,children:e},t))})}),(0,k.jsx)(`tbody`,{children:r.map((e,t)=>(0,k.jsx)(`tr`,{children:e.map((e,t)=>(0,k.jsx)(`td`,{className:i,children:e},t))},t))})]}),n.length>r.length?(0,k.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,M,` of `,n.length,` rows`]}):null]})}function I({text:e,line:t}){let n=e.endsWith(`
1
+ import{I as e,Jt as t,K as n,S as r,Un as i,Wn as a,c as o,it as s,qn as c,t as l,x as u}from"./format-DpQyO6r1.js";import{A as d,k as f}from"./index-DhuCp-VF.js";import{t as p}from"./BackLink-qSxOMeEG.js";import{_ as m,a as h,d as g,g as _,h as v,i as y,n as b,p as x,r as S,s as C,t as w,u as T}from"./Markdown-C7RbUEZE.js";import{n as E,t as D}from"./Pane-BlIRwUtQ.js";var O=c(a(),1),k=i(),A=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,j=`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary`,M=1e3,N=2e4;function P({source:e,path:t}){let n=t===``?[]:t.split(`/`),r=`text-fg-tertiary hover:text-fg-primary`;return(0,k.jsxs)(`nav`,{"aria-label":`Path`,className:`flex flex-wrap items-center gap-x-1 text-meta`,children:[n.length===0?(0,k.jsx)(`span`,{children:`Files`}):(0,k.jsx)(b,{source:e,path:``,className:r,children:`Files`}),n.map((t,i)=>(0,k.jsxs)(O.Fragment,{children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i===n.length-1?(0,k.jsx)(`span`,{className:`text-fg-secondary`,children:t}):(0,k.jsx)(b,{source:e,path:n.slice(0,i+1).join(`/`),className:r,children:t})]},n.slice(0,i+1).join(`/`)))]})}function F({rows:e}){let[t,...n]=e;if(t===void 0)return(0,k.jsx)(`p`,{className:`mt-3 text-meta`,children:`The table is empty.`});let r=n.slice(0,M),i=`border border-line px-2 py-1 text-left align-top whitespace-pre-wrap`;return(0,k.jsxs)(`div`,{className:`mt-3 overflow-x-auto`,children:[(0,k.jsxs)(`table`,{className:`text-xs text-fg-secondary`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsx)(`tr`,{children:t.map((e,t)=>(0,k.jsx)(`th`,{scope:`col`,className:`${i} font-medium text-fg-primary`,children:e},t))})}),(0,k.jsx)(`tbody`,{children:r.map((e,t)=>(0,k.jsx)(`tr`,{children:e.map((e,t)=>(0,k.jsx)(`td`,{className:i,children:e},t))},t))})]}),n.length>r.length?(0,k.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,M,` of `,n.length,` rows`]}):null]})}function I({text:e,line:t}){let n=e.endsWith(`
2
2
  `)?e.slice(0,-1).split(`
3
3
  `):e.split(`
4
4
  `),r=`mt-3 overflow-x-auto rounded-lg bg-surface-0/80 p-3 font-mono text-[12px] leading-relaxed text-fg-secondary shadow-[inset_0_0_0_1px_rgba(255,255,255,0.05)]`;return n.length>N?(0,k.jsx)(`pre`,{className:r,children:e}):(0,k.jsx)(`pre`,{className:r,children:n.map((e,n)=>(0,k.jsxs)(`span`,{className:`flex ${n+1===t?`line-target`:``}`,children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`w-10 shrink-0 pr-3 text-right text-fg-muted select-none`,children:n+1}),(0,k.jsx)(`span`,{className:`whitespace-pre`,children:e===``?` `:e})]},n))})}function L({source:e,file:t,url:n,line:r}){let i=(0,O.useMemo)(()=>t.content===null?null:m(t.path,h(t.content)),[t.path,t.content]),a=t.path.split(`/`).at(-1)??t.path;return i===null?(0,k.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[a,` is `,_(t.size),`, more than the `,_(s),` the board shows.`]}):i.kind===`markdown`?(0,k.jsx)(`div`,{className:`mt-3`,children:(0,k.jsx)(w,{text:i.text,base:{source:e,dir:x(t.path)},line:r})}):i.kind===`image`?n===null?null:(0,k.jsx)(`img`,{src:n,alt:a,className:`mt-3 max-w-full rounded-lg`}):i.kind===`table`?(0,k.jsx)(F,{rows:i.rows}):i.kind===`text`?(0,k.jsx)(I,{text:i.text,line:r}):(0,k.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[a,` is not text (`,_(t.size),`).`]})}function R(e,t){let n=C(g(e??``)??``);return{path:n.path,line:t.line??n.line}}function z({source:e,path:t,line:r,where:i,parent:a,missing:s,away:c,readFrom:d}){let f=o(e,t),m=u(3e4),h=f.data,g=h?.kind===`file`?h.content:null,_=y(g,T(t)??`application/octet-stream`),v=t===``?`Files`:t.split(`/`).at(-1)??t,b=(0,O.useRef)(null);(0,O.useEffect)(()=>{r!==void 0&&h!==void 0&&b.current?.querySelector(`.line-target`)?.scrollIntoView({block:`center`})},[r,h]);let x;return x=h===void 0?f.error instanceof n&&f.error.status===404?(0,k.jsx)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:s}):f.error instanceof n&&f.error.status===503?(0,k.jsx)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:c}):f.error===null?(0,k.jsxs)(E,{children:[`Reading `,v,` from `,d,`…`]}):(0,k.jsx)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:f.error.message}):h.kind===`dir`?(0,k.jsx)(S,{source:e,file:h,className:`mt-3 space-y-1`}):(0,k.jsx)(L,{source:e,file:h,url:_,line:r}),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(D,{leading:(0,k.jsx)(p,{fallback:a}),title:v,subtitle:h===void 0?i:`${i}${r===void 0?``:` · line ${r}`} · committed by ${h.commit.author} ${l(h.commit.at,m)} · ${h.commit.id.slice(0,7)}`,trailing:_===null?null:(0,k.jsx)(`a`,{href:_,download:v,className:j,children:`Download`})}),(0,k.jsxs)(`div`,{ref:b,className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,k.jsx)(P,{source:e,path:t}),x]})]})}function B(){let{taskId:n,_splat:i}=d({from:`/task/$taskId/files/$`}),{path:a,line:o}=R(i,f({from:`/task/$taskId/files/$`})),s=e(n),c=r(),l=s.data?.title??n,u=c.data?.find(e=>e.slug===s.data?.project);return(0,k.jsx)(z,{source:{kind:`task`,taskId:n},path:a,line:o,where:l,parent:(0,k.jsx)(t,{to:`/task/$taskId`,params:{taskId:n},"aria-label":`Back to the task ${l}`,className:A,children:`←`}),missing:`${a===``?`Nothing`:a} is not on task/${n} yet.`,away:`${v(u)}, is not connected, so the task's files cannot be read now.`,readFrom:`the task's runner`})}function V(){let{slug:e,_splat:n}=d({from:`/p/$slug/files/$`}),{path:i,line:a}=R(n,f({from:`/p/$slug/files/$`})),o=r(),s=o.data?.find(t=>t.slug===e),c=s?.name??e,l=s?.defaultBranch;return o.data!==void 0&&s===void 0?(0,k.jsxs)(E,{children:[`There is no project `,e,`.`]}):(0,k.jsx)(z,{source:{kind:`project`,slug:e},path:i,line:a,where:l===void 0?c:`${c} · ${l}`,parent:(0,k.jsx)(t,{to:`/p/$slug`,params:{slug:e},"aria-label":`Back to the project ${c}`,className:A,children:`←`}),missing:i===``?`Nothing on ${l??`the default branch`} yet.`:`${i} is not on ${l??`the default branch`}.`,away:`${v(s)}, is not connected, so the project's files cannot be read now.`,readFrom:`the project's runner`})}export{V as ProjectFileView,B as TaskFileView};
@@ -1 +1 @@
1
- import{Hn as e,Jt as t,S as n,Un as r,Wn as i,g as a,gt as o,j as s,qn as c,t as l,x as u}from"./format-CENiwkJC.js";import{n as d,t as f}from"./Button-Cp4cNRUX.js";import{i as p}from"./compose-DY1WL8zB.js";import{A as m}from"./index-CPXALUV6.js";import{t as h}from"./BackLink-UTiLF1J4.js";import{t as g}from"./Markdown-DT3V-EVe.js";import{r as _}from"./ThreadForms-CG5Y926b.js";import{n as v,t as y}from"./Pane-BaM0TdE6.js";var b=c(i(),1),x=r(),S=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function C(){let{scope:r,topic:i}=m({from:`/knowledge/$scope/$topic`}),{api:c}=s(),C=e(),w=p(),T=a(r),E=n(),D=u(3e4),[O,k]=(0,b.useState)(!1),A=r===o,j=A?`the society`:E.data?.find(e=>e.slug===r)?.name??r,M=T.data?.find(e=>e.topic===i),N=d({mutationFn:()=>c.removeKnowledge({project:A?null:r,topic:i}),onSuccess:async()=>{await C.invalidateQueries({queryKey:[`knowledge`,r]}),await w(A?{to:`/society`}:{to:`/p/$slug`,params:{slug:r}})}}),P=A?(0,x.jsx)(t,{to:`/society`,"aria-label":`Back to the society`,className:S,children:`←`}):(0,x.jsx)(t,{to:`/p/$slug`,params:{slug:r},"aria-label":`Back to ${j}`,className:S,children:`←`});return M===void 0?(0,x.jsx)(v,{children:T.data===void 0?`Reading…`:`${j} has no topic ${i}.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(y,{leading:(0,x.jsx)(h,{fallback:P}),title:M.topic,subtitle:`Knowledge of ${j} · written by ${M.updatedBy} ${l(M.updatedAt,D)}`,trailing:O?null:(0,x.jsx)(f,{onClick:()=>k(!0),children:`Remove…`})}),O?(0,x.jsxs)(`form`,{"aria-label":`Remove the topic`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),N.mutate()},children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:[`Remove `,M.topic,`?`]}),(0,x.jsx)(f,{onClick:()=>k(!1),children:`Cancel`}),(0,x.jsx)(f,{variant:`primary`,type:`submit`,disabled:N.isPending,children:N.isPending?`Removing…`:`Remove topic`})]}),(0,x.jsx)(_,{error:N.error})]}):null,(0,x.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:(0,x.jsx)(g,{text:M.body})})]})}export{C as KnowledgeView};
1
+ import{Hn as e,Jt as t,S as n,Un as r,Wn as i,g as a,gt as o,j as s,qn as c,t as l,x as u}from"./format-DpQyO6r1.js";import{n as d,t as f}from"./Button-CxjWy598.js";import{i as p}from"./compose-3ksQaHF6.js";import{A as m}from"./index-DhuCp-VF.js";import{t as h}from"./BackLink-qSxOMeEG.js";import{t as g}from"./Markdown-C7RbUEZE.js";import{r as _}from"./ThreadForms-D94Jj0ES.js";import{n as v,t as y}from"./Pane-BlIRwUtQ.js";var b=c(i(),1),x=r(),S=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function C(){let{scope:r,topic:i}=m({from:`/knowledge/$scope/$topic`}),{api:c}=s(),C=e(),w=p(),T=a(r),E=n(),D=u(3e4),[O,k]=(0,b.useState)(!1),A=r===o,j=A?`the society`:E.data?.find(e=>e.slug===r)?.name??r,M=T.data?.find(e=>e.topic===i),N=d({mutationFn:()=>c.removeKnowledge({project:A?null:r,topic:i}),onSuccess:async()=>{await C.invalidateQueries({queryKey:[`knowledge`,r]}),await w(A?{to:`/society`}:{to:`/p/$slug`,params:{slug:r}})}}),P=A?(0,x.jsx)(t,{to:`/society`,"aria-label":`Back to the society`,className:S,children:`←`}):(0,x.jsx)(t,{to:`/p/$slug`,params:{slug:r},"aria-label":`Back to ${j}`,className:S,children:`←`});return M===void 0?(0,x.jsx)(v,{children:T.data===void 0?`Reading…`:`${j} has no topic ${i}.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(y,{leading:(0,x.jsx)(h,{fallback:P}),title:M.topic,subtitle:`Knowledge of ${j} · written by ${M.updatedBy} ${l(M.updatedAt,D)}`,trailing:O?null:(0,x.jsx)(f,{onClick:()=>k(!0),children:`Remove…`})}),O?(0,x.jsxs)(`form`,{"aria-label":`Remove the topic`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),N.mutate()},children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:[`Remove `,M.topic,`?`]}),(0,x.jsx)(f,{onClick:()=>k(!1),children:`Cancel`}),(0,x.jsx)(f,{variant:`primary`,type:`submit`,disabled:N.isPending,children:N.isPending?`Removing…`:`Remove topic`})]}),(0,x.jsx)(_,{error:N.error})]}):null,(0,x.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:(0,x.jsx)(g,{text:M.body})})]})}export{C as KnowledgeView};
@@ -1,4 +1,4 @@
1
- import{G as e,Gn as t,Jt as n,Kn as r,Un as i,Wn as a,c as o,lt as s,qn as c}from"./format-CENiwkJC.js";import{b as l,g as u,j as d,x as f,y as p}from"./index-CPXALUV6.js";import{a as m,c as h,d as g,i as _,l as ee,o as te,r as ne,s as v,t as re,u as y}from"./mentions-BEL5U6ra.js";function ie(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function b(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&v(e.charCodeAt(n+1))&&v(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function ae(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var oe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,x=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,S={};function se(e,t){return((t||S).jsx?x:oe).test(e)}var ce=/[ \t\n\f\r]/g;function le(e){return typeof e==`object`?e.type===`text`&&ue(e.value):ue(e)}function ue(e){return e.replace(ce,``)===``}var C=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};C.prototype.normal={},C.prototype.property={},C.prototype.space=void 0;function de(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new C(n,r,t)}function w(e){return e.toLowerCase()}var T=class{constructor(e,t){this.attribute=t,this.property=e}};T.prototype.attribute=``,T.prototype.booleanish=!1,T.prototype.boolean=!1,T.prototype.commaOrSpaceSeparated=!1,T.prototype.commaSeparated=!1,T.prototype.defined=!1,T.prototype.mustUseProperty=!1,T.prototype.number=!1,T.prototype.overloadedBoolean=!1,T.prototype.property=``,T.prototype.spaceSeparated=!1,T.prototype.space=void 0;var E=r({boolean:()=>D,booleanish:()=>O,commaOrSpaceSeparated:()=>N,commaSeparated:()=>M,number:()=>A,overloadedBoolean:()=>k,spaceSeparated:()=>j}),fe=0,D=P(),O=P(),k=P(),A=P(),j=P(),M=P(),N=P();function P(){return 2**++fe}var pe=Object.keys(E),F=class extends T{constructor(e,t,n,r){let i=-1;if(super(e,t),I(this,`space`,r),typeof n==`number`)for(;++i<pe.length;){let e=pe[i];I(this,pe[i],(n&E[e])===E[e])}}};F.prototype.defined=!0;function I(e,t,n){n&&(e[t]=n)}function L(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new F(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[w(r)]=r,n[w(a.attribute)]=r}return new C(t,n,e.space)}var me=L({properties:{ariaActiveDescendant:null,ariaAtomic:O,ariaAutoComplete:null,ariaBusy:O,ariaChecked:O,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:j,ariaCurrent:null,ariaDescribedBy:j,ariaDetails:null,ariaDisabled:O,ariaDropEffect:j,ariaErrorMessage:null,ariaExpanded:O,ariaFlowTo:j,ariaGrabbed:O,ariaHasPopup:null,ariaHidden:O,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:j,ariaLevel:A,ariaLive:null,ariaModal:O,ariaMultiLine:O,ariaMultiSelectable:O,ariaOrientation:null,ariaOwns:j,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:O,ariaReadOnly:O,ariaRelevant:null,ariaRequired:O,ariaRoleDescription:j,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:O,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function he(e,t){return t in e?e[t]:t}function R(e,t){return he(e,t.toLowerCase())}var ge=L({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:M,acceptCharset:j,accessKey:j,action:null,allow:null,allowFullScreen:D,allowPaymentRequest:D,allowUserMedia:D,alpha:D,alt:null,as:null,async:D,autoCapitalize:null,autoComplete:j,autoFocus:D,autoPlay:D,blocking:j,capture:null,charSet:null,checked:D,cite:null,className:j,closedBy:null,colorSpace:null,cols:A,colSpan:A,command:null,commandFor:null,content:null,contentEditable:O,controls:D,controlsList:j,coords:A|M,crossOrigin:null,data:null,dateTime:null,decoding:null,default:D,defer:D,dir:null,dirName:null,disabled:D,download:k,draggable:O,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:D,formTarget:null,headers:j,height:A,hidden:k,high:A,href:null,hrefLang:null,htmlFor:j,httpEquiv:j,id:null,imageSizes:null,imageSrcSet:null,inert:D,inputMode:null,integrity:null,is:null,isMap:D,itemId:null,itemProp:j,itemRef:j,itemScope:D,itemType:j,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:D,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:D,muted:D,name:null,nonce:null,noModule:D,noValidate:D,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:D,optimum:A,pattern:null,ping:j,placeholder:null,playsInline:D,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:D,referrerPolicy:null,rel:j,required:D,reversed:D,rows:A,rowSpan:A,sandbox:j,scope:null,scoped:D,seamless:D,selected:D,shadowRootClonable:D,shadowRootCustomElementRegistry:D,shadowRootDelegatesFocus:D,shadowRootMode:null,shadowRootSerializable:D,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:O,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:D,useMap:null,value:O,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:j,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:D,declare:D,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:D,noHref:D,noShade:D,noWrap:D,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:O,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:D,disablePictureInPicture:D,disableRemotePlayback:D,exportParts:M,part:j,prefix:null,property:null,results:A,security:null,unselectable:null},space:`html`,transform:R}),_e=L({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:N,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:j,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:D,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:M,g2:M,glyphName:M,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:N,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:j,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:N,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:N,rev:N,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:N,requiredFeatures:N,requiredFonts:N,requiredFormats:N,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:N,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:N,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:N,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:he}),ve=L({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),z=L({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:R}),B=L({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ye={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},be=/[A-Z]/g,xe=/-[a-z]/g,Se=/^data[-\w.:]+$/i;function Ce(e,t){let n=w(t),r=t,i=T;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Se.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(xe,Te);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!xe.test(e)){let n=e.replace(be,we);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=F}return new i(r,t)}function we(e){return`-`+e.toLowerCase()}function Te(e){return e.charAt(1).toUpperCase()}var Ee=de([me,ge,ve,z,B],`html`),De=de([me,_e,ve,z,B],`svg`);function Oe(e){return e.join(` `).trim()}var ke=t(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
1
+ import{G as e,Gn as t,Jt as n,Kn as r,Un as i,Wn as a,c as o,lt as s,qn as c}from"./format-DpQyO6r1.js";import{b as l,g as u,j as d,x as f,y as p}from"./index-DhuCp-VF.js";import{a as m,c as h,d as g,i as _,l as ee,o as te,r as ne,s as v,t as re,u as y}from"./mentions-Buc5vs-j.js";function ie(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function b(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&v(e.charCodeAt(n+1))&&v(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function ae(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var oe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,x=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,S={};function se(e,t){return((t||S).jsx?x:oe).test(e)}var ce=/[ \t\n\f\r]/g;function le(e){return typeof e==`object`?e.type===`text`&&ue(e.value):ue(e)}function ue(e){return e.replace(ce,``)===``}var C=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};C.prototype.normal={},C.prototype.property={},C.prototype.space=void 0;function de(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new C(n,r,t)}function w(e){return e.toLowerCase()}var T=class{constructor(e,t){this.attribute=t,this.property=e}};T.prototype.attribute=``,T.prototype.booleanish=!1,T.prototype.boolean=!1,T.prototype.commaOrSpaceSeparated=!1,T.prototype.commaSeparated=!1,T.prototype.defined=!1,T.prototype.mustUseProperty=!1,T.prototype.number=!1,T.prototype.overloadedBoolean=!1,T.prototype.property=``,T.prototype.spaceSeparated=!1,T.prototype.space=void 0;var E=r({boolean:()=>D,booleanish:()=>O,commaOrSpaceSeparated:()=>N,commaSeparated:()=>M,number:()=>A,overloadedBoolean:()=>k,spaceSeparated:()=>j}),fe=0,D=P(),O=P(),k=P(),A=P(),j=P(),M=P(),N=P();function P(){return 2**++fe}var pe=Object.keys(E),F=class extends T{constructor(e,t,n,r){let i=-1;if(super(e,t),I(this,`space`,r),typeof n==`number`)for(;++i<pe.length;){let e=pe[i];I(this,pe[i],(n&E[e])===E[e])}}};F.prototype.defined=!0;function I(e,t,n){n&&(e[t]=n)}function L(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new F(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[w(r)]=r,n[w(a.attribute)]=r}return new C(t,n,e.space)}var me=L({properties:{ariaActiveDescendant:null,ariaAtomic:O,ariaAutoComplete:null,ariaBusy:O,ariaChecked:O,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:j,ariaCurrent:null,ariaDescribedBy:j,ariaDetails:null,ariaDisabled:O,ariaDropEffect:j,ariaErrorMessage:null,ariaExpanded:O,ariaFlowTo:j,ariaGrabbed:O,ariaHasPopup:null,ariaHidden:O,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:j,ariaLevel:A,ariaLive:null,ariaModal:O,ariaMultiLine:O,ariaMultiSelectable:O,ariaOrientation:null,ariaOwns:j,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:O,ariaReadOnly:O,ariaRelevant:null,ariaRequired:O,ariaRoleDescription:j,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:O,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function he(e,t){return t in e?e[t]:t}function R(e,t){return he(e,t.toLowerCase())}var ge=L({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:M,acceptCharset:j,accessKey:j,action:null,allow:null,allowFullScreen:D,allowPaymentRequest:D,allowUserMedia:D,alpha:D,alt:null,as:null,async:D,autoCapitalize:null,autoComplete:j,autoFocus:D,autoPlay:D,blocking:j,capture:null,charSet:null,checked:D,cite:null,className:j,closedBy:null,colorSpace:null,cols:A,colSpan:A,command:null,commandFor:null,content:null,contentEditable:O,controls:D,controlsList:j,coords:A|M,crossOrigin:null,data:null,dateTime:null,decoding:null,default:D,defer:D,dir:null,dirName:null,disabled:D,download:k,draggable:O,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:D,formTarget:null,headers:j,height:A,hidden:k,high:A,href:null,hrefLang:null,htmlFor:j,httpEquiv:j,id:null,imageSizes:null,imageSrcSet:null,inert:D,inputMode:null,integrity:null,is:null,isMap:D,itemId:null,itemProp:j,itemRef:j,itemScope:D,itemType:j,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:D,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:D,muted:D,name:null,nonce:null,noModule:D,noValidate:D,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:D,optimum:A,pattern:null,ping:j,placeholder:null,playsInline:D,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:D,referrerPolicy:null,rel:j,required:D,reversed:D,rows:A,rowSpan:A,sandbox:j,scope:null,scoped:D,seamless:D,selected:D,shadowRootClonable:D,shadowRootCustomElementRegistry:D,shadowRootDelegatesFocus:D,shadowRootMode:null,shadowRootSerializable:D,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:O,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:D,useMap:null,value:O,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:j,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:D,declare:D,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:D,noHref:D,noShade:D,noWrap:D,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:O,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:D,disablePictureInPicture:D,disableRemotePlayback:D,exportParts:M,part:j,prefix:null,property:null,results:A,security:null,unselectable:null},space:`html`,transform:R}),_e=L({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:N,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:j,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:D,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:M,g2:M,glyphName:M,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:N,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:j,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:N,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:N,rev:N,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:N,requiredFeatures:N,requiredFonts:N,requiredFormats:N,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:N,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:N,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:N,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:he}),ve=L({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),z=L({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:R}),B=L({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ye={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},be=/[A-Z]/g,xe=/-[a-z]/g,Se=/^data[-\w.:]+$/i;function Ce(e,t){let n=w(t),r=t,i=T;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Se.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(xe,Te);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!xe.test(e)){let n=e.replace(be,we);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=F}return new i(r,t)}function we(e){return`-`+e.toLowerCase()}function Te(e){return e.charAt(1).toUpperCase()}var Ee=de([me,ge,ve,z,B],`html`),De=de([me,_e,ve,z,B],`svg`);function Oe(e){return e.join(` `).trim()}var ke=t(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
2
2
  `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function ee(e){var t;for(e||=[];t=te();)t!==!1&&e.push(t);return e}function te(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function ne(){var e=p(),t=g(a);if(t){if(te(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function v(){var e=[];ee(e);for(var t;t=ne();)t!==!1&&(e.push(t),ee(e));return e}return _(),v()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Ae=t(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(ke());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),je=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Me=t(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ae()),i=je();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),Ne=Fe(`end`),Pe=Fe(`start`);function Fe(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Ie(e){let t=Pe(e),n=Ne(e);if(t&&n)return{start:t,end:n}}function V(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Re(e.position):`start`in e||`end`in e?Re(e):`line`in e||`column`in e?Le(e):``}function Le(e){return ze(e&&e.line)+`:`+ze(e&&e.column)}function Re(e){return Le(e&&e.start)+`-`+Le(e&&e.end)}function ze(e){return e&&typeof e==`number`?e:1}var H=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=V(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};H.prototype.file=``,H.prototype.name=``,H.prototype.reason=``,H.prototype.message=``,H.prototype.stack=``,H.prototype.column=void 0,H.prototype.line=void 0,H.prototype.ancestors=void 0,H.prototype.cause=void 0,H.prototype.fatal=void 0,H.prototype.place=void 0,H.prototype.ruleId=void 0,H.prototype.source=void 0;var Be=c(Me(),1),Ve={}.hasOwnProperty,He=new Map,Ue=/[A-Z]/g,We=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ge=new Set([`td`,`th`]),Ke=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function qe(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=it(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=rt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?De:Ee,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Je(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Je(e,t,n){if(t.type===`element`)return Ye(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Xe(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Qe(e,t,n);if(t.type===`mdxjsEsm`)return Ze(e,t);if(t.type===`root`)return $e(e,t,n);if(t.type===`text`)return et(e,t)}function Ye(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=De,e.schema=i),e.ancestors.push(t);let a=ut(e,t.tagName,!1),o=at(e,t),s=st(e,t);return We.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!le(e)})),tt(e,o,a,t),nt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Xe(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}U(e,t.position)}function Ze(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);U(e,t.position)}function Qe(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=De,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ut(e,t.name,!0),o=ot(e,t),s=st(e,t);return tt(e,o,a,t),nt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function $e(e,t,n){let r={};return nt(r,st(e,t)),e.create(t,e.Fragment,r,n)}function et(e,t){return t.value}function tt(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nt(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function rt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function it(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Pe(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function at(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ve.call(t.properties,i)){let a=ct(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ge.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ot(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else U(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else U(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function st(e,t){let n=[],r=-1,i=e.passKeys?new Map:He;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Je(e,a,o);s!==void 0&&n.push(s)}return n}function ct(e,t,n){let r=Ce(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ae(n):Oe(n)),r.property===`style`){let t=typeof n==`object`?n:lt(e,String(n));return e.stylePropertyNameCase===`css`&&(t=dt(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?ye[r.property]||r.property:r.attribute,n]}}function lt(e,t){try{return(0,Be.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new H("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Ke+`#cannot-parse-style-attribute`,r}}function ut(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=se(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=se(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ve.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);U(e)}function U(e,t){let n=new H("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Ke+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function dt(e){let t={},n;for(n in e)Ve.call(e,n)&&(t[ft(n)]=e[n]);return t}function ft(e){let t=e.replace(Ue,pt);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function pt(e){return`-`+e.toLowerCase()}var mt={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},ht={};function gt(e,t){let n=t||ht;return _t(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function _t(e,t,n){if(yt(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return vt(e.children,t,n)}return Array.isArray(e)?vt(e,t,n):``}function vt(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=_t(e[i],t,n);return r.join(``)}function yt(e){return!!(e&&typeof e==`object`)}var bt=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xt(e){return e.replace(bt,St)}function St(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return ie(n.slice(t?2:1),t?16:10)}return g(n)||e}var Ct={}.hasOwnProperty;function wt(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Tt(n)(m(te(n).document().write(_()(e,t,!0))))}function Tt(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(z),autolinkProtocol:x,autolinkEmail:x,atxHeading:a(R),blockQuote:a(F),characterEscape:x,characterReference:x,codeFenced:a(I),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(I,o),codeText:a(L,o),codeTextData:x,data:x,codeFlowValue:x,definition:a(me),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(he),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a(_e,o),htmlFlowData:x,htmlText:a(_e,o),htmlTextData:x,image:a(ve),label:o,link:a(z),listItem:a(ye),listItemValue:f,listOrdered:a(B,d),listUnordered:a(B),paragraph:a(be),reference:k,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(R),strong:a(xe),thematicBreak:a(Ce)},exit:{atxHeading:c(),atxHeadingSequence:re,autolink:c(),autolinkEmail:pe,autolinkProtocol:P,blockQuote:c(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:j,characterReferenceMarkerNumeric:j,characterReferenceValue:M,characterReference:N,codeFenced:c(_),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:S,codeIndented:c(ee),codeText:c(C),codeTextData:S,data:S,definition:c(),definitionDestinationString:v,definitionLabelString:te,definitionTitleString:ne,emphasis:c(),hardBreakEscape:c(ce),hardBreakTrailing:c(ce),htmlFlow:c(le),htmlFlowData:S,htmlText:c(ue),htmlTextData:S,image:c(w),label:E,labelText:T,lineEnding:se,link:c(de),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:A,resourceDestinationString:fe,resourceTitleString:D,resource:O,setextHeading:c(oe),setextHeadingLineSequence:ae,setextHeadingText:b,strong:c(),thematicBreak:c()}};Et(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Ct.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ot).call(a,void 0,e[0])}for(r.position={start:W(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:W(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:W(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ot).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+V({start:e.start,end:e.end})+`): it’s not open`);n.position.end=W(e.end)}function u(){return gt(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=y(this.sliceSerialize(e)).toLowerCase()}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function b(){this.data.setextHeadingSlurpLineEnding=!0}function ae(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function oe(){this.data.setextHeadingSlurpLineEnding=void 0}function x(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Se(),n.position={start:W(e.start),end:void 0},t.push(n)),this.stack.push(n)}function S(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=W(e.end)}function se(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=W(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(x.call(this,e),S.call(this,e))}function ce(){this.data.atHardBreak=!0}function le(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ue(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function C(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function de(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function w(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function T(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=xt(t),n.identifier=y(t).toLowerCase()}function E(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function fe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function D(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function O(){this.data.inReference=void 0}function k(){this.data.referenceType=`collapsed`}function A(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=y(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function j(e){this.data.characterReferenceType=e.type}function M(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=ie(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=g(t);let i=this.stack[this.stack.length-1];i.value+=r}function N(e){let t=this.stack.pop();t.position.end=W(e.end)}function P(e){S.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){S.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function F(){return{type:`blockquote`,children:[]}}function I(){return{type:`code`,lang:null,meta:null,value:``}}function L(){return{type:`inlineCode`,value:``}}function me(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function he(){return{type:`emphasis`,children:[]}}function R(){return{type:`heading`,depth:0,children:[]}}function ge(){return{type:`break`}}function _e(){return{type:`html`,value:``}}function ve(){return{type:`image`,title:null,url:``,alt:null}}function z(){return{type:`link`,title:null,url:``,children:[]}}function B(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ye(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function be(){return{type:`paragraph`,children:[]}}function xe(){return{type:`strong`,children:[]}}function Se(){return{type:`text`,value:``}}function Ce(){return{type:`thematicBreak`}}}function W(e){return{line:e.line,column:e.column,offset:e.offset}}function Et(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Et(e,r):Dt(e,r)}}function Dt(e,t){let n;for(n in t)if(Ct.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Ot(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+V({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+V({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+V({start:t.start,end:t.end})+`) is still open`)}function kt(e){let t=this;t.parser=n;function n(n){return wt(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function At(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function jt(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
3
3
  `}]}function Mt(e,t){let n=t.value?t.value+`
4
4
  `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Nt(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pt(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ft(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=b(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function It(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lt(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Rt(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function zt(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Rt(e,t);let i={src:b(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Bt(e,t){let n={src:b(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Vt(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Ht(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Rt(e,t);let i={href:b(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ut(e,t){let n={href:b(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Wt(e,t,n){let r=e.all(t),i=n?Gt(n):Kt(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
@@ -1 +1 @@
1
- import{Un as e,Wn as t,qn as n,t as r}from"./format-CENiwkJC.js";import{u as i}from"./tasks-CAI8Eci7.js";import{a,s as o}from"./index-CPXALUV6.js";import{t as s}from"./Markdown-DT3V-EVe.js";var c=n(t(),1),l=e(),u=1400;function d({message:e,members:t,now:n,task:d,target:f=!1}){let p=e.body.length>u,[m,h]=(0,c.useState)(null),g=m??f,_=o(),v=e.author===`board`,y=e.step===void 0?null:i(e.step,d),b=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let e=b.current;if(!f||e===null)return;let t=e.parentElement,n=t!==null&&e.offsetHeight>t.clientHeight;e.scrollIntoView({block:n?`start`:`center`})},[f]),(0,l.jsxs)(`article`,{ref:b,"aria-current":f?`true`:void 0,className:`flex gap-3 px-4 py-2.5 ${v?`opacity-70`:``} ${f?`message-target`:``}`,children:[(0,l.jsx)(a,{name:e.author,members:t}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsxs)(`header`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,l.jsx)(`span`,{className:`text-title`,children:_(e.author)}),y===null?null:(0,l.jsx)(`span`,{className:`min-w-0 truncate rounded-md px-1.5 py-px text-[11px] ${y.tone}`,children:y.text}),(0,l.jsx)(`time`,{dateTime:e.ts,title:e.ts,className:`shrink-0 text-meta`,children:r(e.ts,n)})]}),(0,l.jsxs)(`div`,{className:p&&!g?`relative max-h-72 overflow-hidden`:``,children:[(0,l.jsx)(s,{text:e.body}),p&&!g?(0,l.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 h-16 bg-linear-to-t from-surface-1 to-transparent`}):null]}),p?(0,l.jsx)(`button`,{type:`button`,onClick:()=>h(!g),className:`mt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:g?`Show less`:`Show more`}):null]})]})}export{d as t};
1
+ import{Un as e,Wn as t,qn as n,t as r}from"./format-DpQyO6r1.js";import{u as i}from"./tasks-DLTeaHys.js";import{a,s as o}from"./index-DhuCp-VF.js";import{t as s}from"./Markdown-C7RbUEZE.js";var c=n(t(),1),l=e(),u=1400;function d({message:e,members:t,now:n,task:d,target:f=!1}){let p=e.body.length>u,[m,h]=(0,c.useState)(null),g=m??f,_=o(),v=e.author===`board`,y=e.step===void 0?null:i(e.step,d),b=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let e=b.current;if(!f||e===null)return;let t=e.parentElement,n=t!==null&&e.offsetHeight>t.clientHeight;e.scrollIntoView({block:n?`start`:`center`})},[f]),(0,l.jsxs)(`article`,{ref:b,"aria-current":f?`true`:void 0,className:`flex gap-3 px-4 py-2.5 ${v?`opacity-70`:``} ${f?`message-target`:``}`,children:[(0,l.jsx)(a,{name:e.author,members:t}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsxs)(`header`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,l.jsx)(`span`,{className:`text-title`,children:_(e.author)}),y===null?null:(0,l.jsx)(`span`,{className:`min-w-0 truncate rounded-md px-1.5 py-px text-[11px] ${y.tone}`,children:y.text}),(0,l.jsx)(`time`,{dateTime:e.ts,title:e.ts,className:`shrink-0 text-meta`,children:r(e.ts,n)})]}),(0,l.jsxs)(`div`,{className:p&&!g?`relative max-h-72 overflow-hidden`:``,children:[(0,l.jsx)(s,{text:e.body}),p&&!g?(0,l.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 h-16 bg-linear-to-t from-surface-1 to-transparent`}):null]}),p?(0,l.jsx)(`button`,{type:`button`,onClick:()=>h(!g),className:`mt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:g?`Show less`:`Show more`}):null]})]})}export{d as t};
@@ -1 +1 @@
1
- import{Jt as e,K as t,Un as n,b as r,r as i,t as a,x as o}from"./format-CENiwkJC.js";import{g as s,k as c,s as l}from"./index-CPXALUV6.js";import{n as u,t as d}from"./Pane-BaM0TdE6.js";import{n as f}from"./Overview-CKcTqsMM.js";var p=n(),m=[{window:`24h`,label:`24 hours`},{window:`7d`,label:`7 days`},{window:`all`,label:`All time`}],h={stage:`a stage to take`,mention:`a mention`,user_post:`your post`,heartbeat:`a heartbeat`,task_done:`a finished task`,proposal_decided:`a decided proposal`,ops_event:`a signal`,onboarding:`joining`,manual:`your wake`},g=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`});function _(e,t){return t===0?``:`${Math.round(e/t*100)}%`}function v(e){return e.toFixed(1).replace(/\.0$/,``)}function y({part:e,whole:t}){return(0,p.jsxs)(p.Fragment,{children:[e,(0,p.jsx)(`span`,{className:`ml-1.5 inline-block w-9 text-right text-fg-muted`,children:e===0?``:_(e,t)})]})}function b({children:e}){return(0,p.jsx)(`p`,{className:`text-sm text-fg-primary`,children:e})}function x({children:e}){return(0,p.jsx)(`p`,{className:`mt-1 text-meta`,children:e})}function S({label:e,columns:t,rows:n}){return n.length===0?null:(0,p.jsxs)(`table`,{"aria-label":e,className:`mt-3 w-full table-fixed text-sm`,children:[(0,p.jsxs)(`colgroup`,{children:[(0,p.jsx)(`col`,{}),t.slice(1).map(e=>(0,p.jsx)(`col`,{className:`w-24`},e))]}),(0,p.jsx)(`thead`,{children:(0,p.jsx)(`tr`,{children:t.map((e,t)=>(0,p.jsx)(`th`,{scope:`col`,className:`text-caps pb-1 font-normal ${t===0?`text-left`:`text-right`}`,children:e},e))})}),(0,p.jsx)(`tbody`,{children:n.map((e,t)=>(0,p.jsx)(`tr`,{className:`border-t border-line/50`,children:e.map((e,t)=>(0,p.jsx)(`td`,{className:`py-1.5 ${t===0?`pr-3 text-fg-primary`:`text-right text-fg-secondary tabular-nums`}`,children:e},t))},t))})]})}function C({name:t}){let n=l();return t===`user`?(0,p.jsx)(`span`,{children:n(t)}):(0,p.jsx)(e,{to:`/citizen/$name`,params:{name:t},className:`hover:underline`,children:t})}function w(e){return e.window===`24h`?1:e.window===`7d`?7:Math.max(1,e.decisions.byDay.length)}function T(){let{window:n=`7d`}=c({from:`/metrics`}),l=r(n),T=o(6e4),E=(0,p.jsx)(`nav`,{"aria-label":`Window`,className:`flex shrink-0 gap-1`,children:m.map(t=>(0,p.jsx)(e,{to:`/metrics`,search:{window:t.window},"aria-current":t.window===n?`page`:void 0,className:`rounded-md px-2 py-1 text-xs transition-colors ${t.window===n?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`}`,children:t.label},t.window))}),D=(0,p.jsx)(d,{title:`Metrics`,trailing:E});if(l.data===void 0)return(0,p.jsxs)(p.Fragment,{children:[D,(0,p.jsx)(u,{children:l.error instanceof t?l.error.message:`Counting the event log…`})]});let{idle:O,sentBack:k,messages:A,latency:j,decisions:M,blocked:N}=l.data,P=w(l.data);return(0,p.jsxs)(p.Fragment,{children:[D,(0,p.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,p.jsxs)(f,{title:`Turns that did nothing`,children:[O.turns===0?(0,p.jsx)(x,{children:`No finished turns in this window.`}):(0,p.jsxs)(b,{children:[O.idle,` of `,O.turns,` working turns changed nothing on the board`,` `,(0,p.jsx)(`span`,{className:`text-fg-muted`,children:_(O.idle,O.turns)})]}),O.unknown>0?(0,p.jsxs)(x,{children:[O.unknown,` `,O.unknown===1?`turn`:`turns`,` kept no transcript and could not be counted.`]}):null,(0,p.jsx)(S,{label:`By what woke them`,columns:[`Woken by`,`Turns`,`Did nothing`],rows:O.byTrigger.map(e=>[h[e.trigger]??e.trigger,e.turns,(0,p.jsx)(y,{part:e.idle,whole:e.turns},`idle`)])}),(0,p.jsx)(S,{label:`By citizen`,columns:[`Citizen`,`Turns`,`Did nothing`],rows:O.byAgent.map(e=>[(0,p.jsxs)(`span`,{children:[(0,p.jsx)(C,{name:e.agent}),e.role===null?null:(0,p.jsxs)(`span`,{className:`text-meta`,children:[` · `,e.role]})]},`who`),e.turns,(0,p.jsx)(y,{part:e.idle,whole:e.turns},`idle`)])})]}),(0,p.jsxs)(f,{title:`Work sent back`,children:[k.finished===0?(0,p.jsx)(x,{children:`No task finished in this window.`}):(0,p.jsxs)(b,{children:[k.tasksSentBack,` of `,k.finished,` finished tasks were sent back,`,` `,k.sendBacks,` `,k.sendBacks===1?`time`:`times`,` in all`]}),(0,p.jsx)(S,{label:`Where work came back from`,columns:[`Came back from`,`Times`],rows:k.byStage.map(e=>[`${e.project} · ${e.stage}`,e.count])}),(0,p.jsx)(S,{label:`Who sent work back`,columns:[`Sent back by`,`Times`],rows:k.bySender.map(e=>[(0,p.jsx)(C,{name:e.agent},`who`),e.count])})]}),(0,p.jsxs)(f,{title:`Messages per finished task`,children:[A.finished===0?(0,p.jsx)(x,{children:`No task finished in this window.`}):(0,p.jsxs)(b,{children:[v(A.messages/A.finished),` posts a task, across`,` `,A.finished,` finished `,A.finished===1?`task`:`tasks`]}),(0,p.jsx)(S,{label:`By project`,columns:[`Project`,`Tasks`,`Posts a task`],rows:A.byProject.map(e=>[e.project,e.finished,v(e.messages/e.finished)])}),(0,p.jsx)(S,{label:`Most talked-over tasks`,columns:[`Task`,`Posts`],rows:A.busiest.map(e=>[(0,p.jsx)(s,{kind:`task`,id:e.taskId,children:e.title},`task`),e.messages])})]}),(0,p.jsxs)(f,{title:`Wake latency`,children:[j.medianMs===null||j.slowestMs===null?(0,p.jsx)(x,{children:`No mention led to a turn in this window.`}):(0,p.jsxs)(b,{children:[i(j.medianMs),` from a mention to its turn, at the median; the slowest took`,` `,i(j.slowestMs)]}),j.unanswered>0?(0,p.jsxs)(x,{children:[j.unanswered,` `,j.unanswered===1?`mention has`:`mentions have`,` no turn yet.`]}):null,(0,p.jsx)(S,{label:`By citizen`,columns:[`Citizen`,`Mentions`,`Median`,`Slowest`],rows:j.byAgent.map(e=>[(0,p.jsx)(C,{name:e.agent},`who`),e.mentions,i(e.medianMs),i(e.slowestMs)])})]}),(0,p.jsxs)(f,{title:`Your decisions`,children:[M.total===0?(0,p.jsx)(x,{children:`You decided nothing in this window.`}):(0,p.jsxs)(b,{children:[M.total,` `,M.total===1?`decision`:`decisions`,`, about`,` `,v(M.total/P),` a day`]}),(0,p.jsx)(S,{label:`By day`,columns:[`Day`,`Proposals`,`Answers`,`Stages`],rows:M.byDay.map(e=>[g.format(new Date(`${e.day}T00:00:00Z`)),e.proposals,e.answers,e.stages])})]}),(0,p.jsx)(f,{title:`Blocked on a capability`,children:N.length===0?(0,p.jsx)(x,{children:`No task waited for a capability no runner offers.`}):(0,p.jsx)(`ul`,{className:`space-y-2`,children:N.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsxs)(`p`,{className:`text-sm text-fg-primary`,children:[(0,p.jsx)(s,{kind:`task`,id:e.taskId,children:e.title??e.taskId}),(0,p.jsx)(`span`,{className:e.holds?`text-amber-300`:`text-fg-muted`,children:e.holds?` · blocked now`:` · cleared`})]}),(0,p.jsxs)(`p`,{className:`text-meta`,children:[e.summary,` · since `,a(e.firstAt,T)]})]},e.taskId))})})]})]})}export{T as MetricsView};
1
+ import{Jt as e,K as t,Un as n,b as r,r as i,t as a,x as o}from"./format-DpQyO6r1.js";import{g as s,k as c,s as l}from"./index-DhuCp-VF.js";import{n as u,t as d}from"./Pane-BlIRwUtQ.js";import{n as f}from"./Overview-xatORJK6.js";var p=n(),m=[{window:`24h`,label:`24 hours`},{window:`7d`,label:`7 days`},{window:`all`,label:`All time`}],h={stage:`a stage to take`,mention:`a mention`,user_post:`your post`,heartbeat:`a heartbeat`,task_done:`a finished task`,proposal_decided:`a decided proposal`,ops_event:`a signal`,onboarding:`joining`,manual:`your wake`},g=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`});function _(e,t){return t===0?``:`${Math.round(e/t*100)}%`}function v(e){return e.toFixed(1).replace(/\.0$/,``)}function y({part:e,whole:t}){return(0,p.jsxs)(p.Fragment,{children:[e,(0,p.jsx)(`span`,{className:`ml-1.5 inline-block w-9 text-right text-fg-muted`,children:e===0?``:_(e,t)})]})}function b({children:e}){return(0,p.jsx)(`p`,{className:`text-sm text-fg-primary`,children:e})}function x({children:e}){return(0,p.jsx)(`p`,{className:`mt-1 text-meta`,children:e})}function S({label:e,columns:t,rows:n}){return n.length===0?null:(0,p.jsxs)(`table`,{"aria-label":e,className:`mt-3 w-full table-fixed text-sm`,children:[(0,p.jsxs)(`colgroup`,{children:[(0,p.jsx)(`col`,{}),t.slice(1).map(e=>(0,p.jsx)(`col`,{className:`w-24`},e))]}),(0,p.jsx)(`thead`,{children:(0,p.jsx)(`tr`,{children:t.map((e,t)=>(0,p.jsx)(`th`,{scope:`col`,className:`text-caps pb-1 font-normal ${t===0?`text-left`:`text-right`}`,children:e},e))})}),(0,p.jsx)(`tbody`,{children:n.map((e,t)=>(0,p.jsx)(`tr`,{className:`border-t border-line/50`,children:e.map((e,t)=>(0,p.jsx)(`td`,{className:`py-1.5 ${t===0?`pr-3 text-fg-primary`:`text-right text-fg-secondary tabular-nums`}`,children:e},t))},t))})]})}function C({name:t}){let n=l();return t===`user`?(0,p.jsx)(`span`,{children:n(t)}):(0,p.jsx)(e,{to:`/citizen/$name`,params:{name:t},className:`hover:underline`,children:t})}function w(e){return e.window===`24h`?1:e.window===`7d`?7:Math.max(1,e.decisions.byDay.length)}function T(){let{window:n=`7d`}=c({from:`/metrics`}),l=r(n),T=o(6e4),E=(0,p.jsx)(`nav`,{"aria-label":`Window`,className:`flex shrink-0 gap-1`,children:m.map(t=>(0,p.jsx)(e,{to:`/metrics`,search:{window:t.window},"aria-current":t.window===n?`page`:void 0,className:`rounded-md px-2 py-1 text-xs transition-colors ${t.window===n?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`}`,children:t.label},t.window))}),D=(0,p.jsx)(d,{title:`Metrics`,trailing:E});if(l.data===void 0)return(0,p.jsxs)(p.Fragment,{children:[D,(0,p.jsx)(u,{children:l.error instanceof t?l.error.message:`Counting the event log…`})]});let{idle:O,sentBack:k,messages:A,latency:j,decisions:M,blocked:N}=l.data,P=w(l.data);return(0,p.jsxs)(p.Fragment,{children:[D,(0,p.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,p.jsxs)(f,{title:`Turns that did nothing`,children:[O.turns===0?(0,p.jsx)(x,{children:`No finished turns in this window.`}):(0,p.jsxs)(b,{children:[O.idle,` of `,O.turns,` working turns changed nothing on the board`,` `,(0,p.jsx)(`span`,{className:`text-fg-muted`,children:_(O.idle,O.turns)})]}),O.unknown>0?(0,p.jsxs)(x,{children:[O.unknown,` `,O.unknown===1?`turn`:`turns`,` kept no transcript and could not be counted.`]}):null,(0,p.jsx)(S,{label:`By what woke them`,columns:[`Woken by`,`Turns`,`Did nothing`],rows:O.byTrigger.map(e=>[h[e.trigger]??e.trigger,e.turns,(0,p.jsx)(y,{part:e.idle,whole:e.turns},`idle`)])}),(0,p.jsx)(S,{label:`By citizen`,columns:[`Citizen`,`Turns`,`Did nothing`],rows:O.byAgent.map(e=>[(0,p.jsxs)(`span`,{children:[(0,p.jsx)(C,{name:e.agent}),e.role===null?null:(0,p.jsxs)(`span`,{className:`text-meta`,children:[` · `,e.role]})]},`who`),e.turns,(0,p.jsx)(y,{part:e.idle,whole:e.turns},`idle`)])})]}),(0,p.jsxs)(f,{title:`Work sent back`,children:[k.finished===0?(0,p.jsx)(x,{children:`No task finished in this window.`}):(0,p.jsxs)(b,{children:[k.tasksSentBack,` of `,k.finished,` finished tasks were sent back,`,` `,k.sendBacks,` `,k.sendBacks===1?`time`:`times`,` in all`]}),(0,p.jsx)(S,{label:`Where work came back from`,columns:[`Came back from`,`Times`],rows:k.byStage.map(e=>[`${e.project} · ${e.stage}`,e.count])}),(0,p.jsx)(S,{label:`Who sent work back`,columns:[`Sent back by`,`Times`],rows:k.bySender.map(e=>[(0,p.jsx)(C,{name:e.agent},`who`),e.count])})]}),(0,p.jsxs)(f,{title:`Messages per finished task`,children:[A.finished===0?(0,p.jsx)(x,{children:`No task finished in this window.`}):(0,p.jsxs)(b,{children:[v(A.messages/A.finished),` posts a task, across`,` `,A.finished,` finished `,A.finished===1?`task`:`tasks`]}),(0,p.jsx)(S,{label:`By project`,columns:[`Project`,`Tasks`,`Posts a task`],rows:A.byProject.map(e=>[e.project,e.finished,v(e.messages/e.finished)])}),(0,p.jsx)(S,{label:`Most talked-over tasks`,columns:[`Task`,`Posts`],rows:A.busiest.map(e=>[(0,p.jsx)(s,{kind:`task`,id:e.taskId,children:e.title},`task`),e.messages])})]}),(0,p.jsxs)(f,{title:`Wake latency`,children:[j.medianMs===null||j.slowestMs===null?(0,p.jsx)(x,{children:`No mention led to a turn in this window.`}):(0,p.jsxs)(b,{children:[i(j.medianMs),` from a mention to its turn, at the median; the slowest took`,` `,i(j.slowestMs)]}),j.unanswered>0?(0,p.jsxs)(x,{children:[j.unanswered,` `,j.unanswered===1?`mention has`:`mentions have`,` no turn yet.`]}):null,(0,p.jsx)(S,{label:`By citizen`,columns:[`Citizen`,`Mentions`,`Median`,`Slowest`],rows:j.byAgent.map(e=>[(0,p.jsx)(C,{name:e.agent},`who`),e.mentions,i(e.medianMs),i(e.slowestMs)])})]}),(0,p.jsxs)(f,{title:`Your decisions`,children:[M.total===0?(0,p.jsx)(x,{children:`You decided nothing in this window.`}):(0,p.jsxs)(b,{children:[M.total,` `,M.total===1?`decision`:`decisions`,`, about`,` `,v(M.total/P),` a day`]}),(0,p.jsx)(S,{label:`By day`,columns:[`Day`,`Proposals`,`Answers`,`Stages`],rows:M.byDay.map(e=>[g.format(new Date(`${e.day}T00:00:00Z`)),e.proposals,e.answers,e.stages])})]}),(0,p.jsx)(f,{title:`Blocked on a capability`,children:N.length===0?(0,p.jsx)(x,{children:`No task waited for a capability no runner offers.`}):(0,p.jsx)(`ul`,{className:`space-y-2`,children:N.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsxs)(`p`,{className:`text-sm text-fg-primary`,children:[(0,p.jsx)(s,{kind:`task`,id:e.taskId,children:e.title??e.taskId}),(0,p.jsx)(`span`,{className:e.holds?`text-amber-300`:`text-fg-muted`,children:e.holds?` · blocked now`:` · cleared`})]}),(0,p.jsxs)(`p`,{className:`text-meta`,children:[e.summary,` · since `,a(e.firstAt,T)]})]},e.taskId))})})]})]})}export{T as MetricsView};
@@ -1 +1 @@
1
- import{Jt as e,S as t,Un as n,n as r,t as i,x as a}from"./format-CENiwkJC.js";import{o}from"./governance-C6ez5MLh.js";import{S as s,_ as c,s as l}from"./index-CPXALUV6.js";import{n as u,t as d}from"./Pane-BaM0TdE6.js";var f=n(),p=[{kind:`proposal`,label:`Proposals to decide`},{kind:`stage`,label:`Stages that name you`},{kind:`request`,label:`Asked of you`}],m=`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`;function h({title:e,meta:t}){return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:`text-title block truncate`,children:e}),(0,f.jsx)(`span`,{className:`mt-1 block truncate text-meta`,children:t})]})}function g(){let n=s(),g=t(),_=a(3e4),v=l(),y=e=>g.data?.find(t=>t.slug===e)?.name??e;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d,{title:`Needs you`,subtitle:n.length===0?`Nothing waits on you`:`${n.length} waiting on you, oldest first`}),(0,f.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:n.length===0?(0,f.jsx)(u,{children:`Nothing waits on you.`}):p.map(({kind:t,label:a})=>{let s=n.filter(e=>e.kind===t);return s.length===0?null:(0,f.jsxs)(`section`,{className:`mb-3`,children:[(0,f.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[a,` · `,s.length]}),(0,f.jsx)(`ul`,{children:s.map(t=>{if(t.kind===`proposal`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(e,{to:`/proposal/$proposalId`,params:{proposalId:t.proposal.id},className:m,children:(0,f.jsx)(h,{title:o(t.proposal),meta:`proposed by ${v(t.proposal.proposedBy)} ${i(t.since,_)}`})})},t.proposal.id);if(t.kind===`stage`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(e,{to:`/task/$taskId`,params:{taskId:t.task.id},className:m,children:(0,f.jsx)(h,{title:t.task.title,meta:`${t.stage.name}${t.stage.gate?` (gate)`:``} in ${y(t.task.project)} · waiting since ${i(t.since,_)}`})})},t.task.id);let n=`${v(t.message.author)} in ${t.thread===null?`#${t.message.channel}`:t.thread.title} ${i(t.since,_)}`,a=(0,f.jsx)(h,{title:(0,f.jsx)(c,{text:r(t.message.body,160),links:!1}),meta:n}),s=t.thread?.subject;return(0,f.jsx)(`li`,{children:s?.kind===`task`?(0,f.jsx)(e,{to:`/task/$taskId`,params:{taskId:s.id},className:m,children:a}):s?.kind===`proposal`?(0,f.jsx)(e,{to:`/proposal/$proposalId`,params:{proposalId:s.id},className:m,children:a}):t.thread===null?(0,f.jsx)(e,{to:`/c/$`,params:{_splat:t.message.channel},className:m,children:a}):(0,f.jsx)(e,{to:`/thread/$threadId`,params:{threadId:t.thread.id},className:m,children:a})},t.message.id)})})]},t)})})]})}export{g as NeedsYouView};
1
+ import{Jt as e,S as t,Un as n,n as r,t as i,x as a}from"./format-DpQyO6r1.js";import{o}from"./governance-YialJVYK.js";import{S as s,_ as c,s as l}from"./index-DhuCp-VF.js";import{n as u,t as d}from"./Pane-BlIRwUtQ.js";var f=n(),p=[{kind:`proposal`,label:`Proposals to decide`},{kind:`stage`,label:`Stages that name you`},{kind:`request`,label:`Asked of you`}],m=`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`;function h({title:e,meta:t}){return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:`text-title block truncate`,children:e}),(0,f.jsx)(`span`,{className:`mt-1 block truncate text-meta`,children:t})]})}function g(){let n=s(),g=t(),_=a(3e4),v=l(),y=e=>g.data?.find(t=>t.slug===e)?.name??e;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d,{title:`Needs you`,subtitle:n.length===0?`Nothing waits on you`:`${n.length} waiting on you, oldest first`}),(0,f.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:n.length===0?(0,f.jsx)(u,{children:`Nothing waits on you.`}):p.map(({kind:t,label:a})=>{let s=n.filter(e=>e.kind===t);return s.length===0?null:(0,f.jsxs)(`section`,{className:`mb-3`,children:[(0,f.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[a,` · `,s.length]}),(0,f.jsx)(`ul`,{children:s.map(t=>{if(t.kind===`proposal`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(e,{to:`/proposal/$proposalId`,params:{proposalId:t.proposal.id},className:m,children:(0,f.jsx)(h,{title:o(t.proposal),meta:`proposed by ${v(t.proposal.proposedBy)} ${i(t.since,_)}`})})},t.proposal.id);if(t.kind===`stage`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(e,{to:`/task/$taskId`,params:{taskId:t.task.id},className:m,children:(0,f.jsx)(h,{title:t.task.title,meta:`${t.stage.name}${t.stage.gate?` (gate)`:``} in ${y(t.task.project)} · waiting since ${i(t.since,_)}`})})},t.task.id);let n=`${v(t.message.author)} in ${t.thread===null?`#${t.message.channel}`:t.thread.title} ${i(t.since,_)}`,a=(0,f.jsx)(h,{title:(0,f.jsx)(c,{text:r(t.message.body,160),links:!1}),meta:n}),s=t.thread?.subject;return(0,f.jsx)(`li`,{children:s?.kind===`task`?(0,f.jsx)(e,{to:`/task/$taskId`,params:{taskId:s.id},className:m,children:a}):s?.kind===`proposal`?(0,f.jsx)(e,{to:`/proposal/$proposalId`,params:{proposalId:s.id},className:m,children:a}):t.thread===null?(0,f.jsx)(e,{to:`/c/$`,params:{_splat:t.message.channel},className:m,children:a}):(0,f.jsx)(e,{to:`/thread/$threadId`,params:{threadId:t.thread.id},className:m,children:a})},t.message.id)})})]},t)})})]})}export{g as NeedsYouView};