@kubitnodes/stellaris 0.3.22 → 0.3.24

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 (67) hide show
  1. package/README.md +4 -4
  2. package/dist/cli/index.js +1029 -571
  3. package/dist/server/index.js +1256 -656
  4. package/package.json +1 -1
  5. package/web/dist/assets/BackLink-DKMw_rHu.js +1 -0
  6. package/web/dist/assets/{Button-Yoe21NQ2.js → Button-BYJGqZ3Q.js} +1 -1
  7. package/web/dist/assets/{ChannelForms-55otlg-m.js → ChannelForms-CkYupEL2.js} +1 -1
  8. package/web/dist/assets/ChannelView-BIXouQMX.js +2 -0
  9. package/web/dist/assets/CitizenView-C3AMFixP.js +2 -0
  10. package/web/dist/assets/CitizensView-CYFS3f9U.js +1 -0
  11. package/web/dist/assets/{CliIcon-DbMYJdlU.js → CliIcon-DVX5iLhG.js} +1 -1
  12. package/web/dist/assets/CronsView-BGCcO7bH.js +1 -0
  13. package/web/dist/assets/KnowledgeView-DLLYjd1G.js +1 -0
  14. package/web/dist/assets/Markdown--whKJBYV.js +30 -0
  15. package/web/dist/assets/MessageItem-BvDOeJci.js +1 -0
  16. package/web/dist/assets/MetricsView-B-KUNOZm.js +1 -0
  17. package/web/dist/assets/NeedsYouView-Dee_bOKj.js +1 -0
  18. package/web/dist/assets/{Overview-BveU1yJj.js → Overview-DFiHDFnA.js} +1 -1
  19. package/web/dist/assets/{Pane-CLjdfBMM.js → Pane-DTmByqgA.js} +1 -1
  20. package/web/dist/assets/{Picker-CXOe5Xdu.js → Picker-DsHm4f7s.js} +1 -1
  21. package/web/dist/assets/{ProjectView-oa4Z46ED.js → ProjectView-DsRXW-qk.js} +1 -1
  22. package/web/dist/assets/ProposalView-B-4P1S-s.js +1 -0
  23. package/web/dist/assets/{ProposalsView-BZHivSEm.js → ProposalsView-uEuj-ooV.js} +1 -1
  24. package/web/dist/assets/Quota-D8WDWp5H.js +1 -0
  25. package/web/dist/assets/{RunnersView-BrJF-aLU.js → RunnersView-BB3q65rG.js} +1 -1
  26. package/web/dist/assets/SkillFileList-DhdEcFQA.js +2 -0
  27. package/web/dist/assets/SkillView-vAv7zvtJ.js +1 -0
  28. package/web/dist/assets/SocietyView-Dv4phSkz.js +1 -0
  29. package/web/dist/assets/{StickyList-7tAlUDCN.js → StickyList-C4fC_KJv.js} +1 -1
  30. package/web/dist/assets/SubjectThread-BEXt-tub.js +1 -0
  31. package/web/dist/assets/{TaskFileView-BEXQJQQ6.js → TaskFileView-B9sex0tS.js} +2 -2
  32. package/web/dist/assets/{TaskView-Cfhb7NuO.js → TaskView-BCT388kb.js} +2 -2
  33. package/web/dist/assets/{TasksView-3XljXcoi.js → TasksView-CuPay34-.js} +1 -1
  34. package/web/dist/assets/{ThreadForms-D2y5dXSC.js → ThreadForms-DzoRDeBh.js} +1 -1
  35. package/web/dist/assets/ThreadItem-CDVppcOZ.js +1 -0
  36. package/web/dist/assets/ThreadView-B4F10_j1.js +1 -0
  37. package/web/dist/assets/citizen-BPIJzKdn.js +1 -0
  38. package/web/dist/assets/{compose-DNc3_c5x.js → compose-BUhbVoI-.js} +1 -1
  39. package/web/dist/assets/format-CvfmDNoY.js +55 -0
  40. package/web/dist/assets/{governance-RBQ4Lam0.js → governance-Bba0OHvJ.js} +1 -1
  41. package/web/dist/assets/index-Bj8MlyAn.css +2 -0
  42. package/web/dist/assets/index-DD3J11PT.js +23 -0
  43. package/web/dist/assets/{mentions-B2Qchd_6.js → mentions-D838wlfQ.js} +1 -1
  44. package/web/dist/assets/{tasks-DCUj5w_d.js → tasks-CTaxXtGL.js} +1 -1
  45. package/web/dist/assets/useMatch-B8j0hm1q.js +1 -0
  46. package/web/dist/index.html +9 -9
  47. package/web/dist/assets/BackLink-CD-iuy-h.js +0 -1
  48. package/web/dist/assets/ChannelView-DJvLzg0N.js +0 -2
  49. package/web/dist/assets/CitizenView-m1K2aTvK.js +0 -2
  50. package/web/dist/assets/CitizensView-BeTgmrKE.js +0 -1
  51. package/web/dist/assets/CronsView-B4kXk5Ld.js +0 -1
  52. package/web/dist/assets/KnowledgeView-aSGxDDKy.js +0 -1
  53. package/web/dist/assets/Markdown-c9bCCLHg.js +0 -30
  54. package/web/dist/assets/MessageItem-DKJKMqs-.js +0 -1
  55. package/web/dist/assets/MetricsView-D2TTry5O.js +0 -1
  56. package/web/dist/assets/NeedsYouView-C3celRei.js +0 -1
  57. package/web/dist/assets/ProposalView-B4T-EoX9.js +0 -2
  58. package/web/dist/assets/Quota-BC7dpnwd.js +0 -1
  59. package/web/dist/assets/SocietyView-C1yosPuf.js +0 -1
  60. package/web/dist/assets/SubjectThread-CCq6ZAnR.js +0 -1
  61. package/web/dist/assets/ThreadItem-DeIhhmyu.js +0 -1
  62. package/web/dist/assets/ThreadView-CbUnt9WL.js +0 -1
  63. package/web/dist/assets/citizen--bqux6i_.js +0 -1
  64. package/web/dist/assets/format-B6fjC0_a.js +0 -55
  65. package/web/dist/assets/index-CyCty7a2.js +0 -23
  66. package/web/dist/assets/index-GRqxKN35.css +0 -2
  67. package/web/dist/assets/useMatch-CfbBQirn.js +0 -1
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "codex",
9
9
  "multi-agent"
10
10
  ],
11
- "version": "0.3.22",
11
+ "version": "0.3.24",
12
12
  "license": "MIT",
13
13
  "homepage": "https://github.com/kr4t0n/stellaris",
14
14
  "repository": {
@@ -0,0 +1 @@
1
+ import{Wn as e,Zt as t,x as n}from"./format-CvfmDNoY.js";import{O as r,n as i,r as a,t as o,v as s}from"./index-DD3J11PT.js";var c=e(),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:e}){let u=t(),d=r({select:e=>e.location.state.__TSR_index}),f=a(),p=s(),m=n(),h=i(f,d);if(h===null)return e;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{Bn as e,Cn as t,Dn as n,Fn as r,Pn as i,Rn as a,Tn as o,Un as s,bn as c,jn as l,xn as u,zn as d}from"./format-B6fjC0_a.js";var f=class extends c{#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=u({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)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),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:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}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(e){let n=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=n(this.state),t.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};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 o{#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),i(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&n(t.mutationKey)!==n(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(e){t.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},h=s(e(),1);function g(e,n){let i=a(n),[o]=h.useState(()=>new m(i,e));h.useEffect(()=>{o.setOptions(e)},[o,e]);let s=h.useSyncExternalStore(h.useCallback(e=>o.subscribe(t.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),c=h.useCallback((...e)=>{o.mutate(e[0],e[1]).catch(l)},[o]);if(s.error&&r(o.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}var _=d(),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{An as e,Bn as t,En as n,Gn as r,In as i,Jn as a,Mn as o,On as s,Tn as c,Un as l,Wn as u,zn as d}from"./format-CvfmDNoY.js";var f=class extends c{#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`})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},i=this.#r=n({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):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=!i.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,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:o})}let n=await i.start();return await this.#n.config.onSuccess?.(n,e,this.state.context,this,r),await this.options.onSuccess?.(n,e,this.state.context,r),await this.#n.config.onSettled?.(n,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(n,null,e,this.state.context,r),this.#i({type:`success`,data:n}),n}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===i&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),s.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};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 e{#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),d(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&o(t.mutationKey)!==o(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(e){s.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},h=a(r(),1);function g(e,n){let r=l(n),[a]=h.useState(()=>new m(r,e));h.useEffect(()=>{a.setOptions(e)},[a,e]);let o=h.useSyncExternalStore(h.useCallback(e=>a.subscribe(s.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c=h.useCallback((...e)=>{a.mutate(e[0],e[1]).catch(i)},[a]);if(o.error&&t(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}var _=u(),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{A as e,Bn as t,Rn as n,Un as r,Wt as i,t as a,zn as o}from"./format-B6fjC0_a.js";import{n as s,t as c}from"./Button-Yoe21NQ2.js";import{i as l}from"./compose-DNc3_c5x.js";import{n as u,r as d}from"./ThreadForms-D2y5dXSC.js";var f=r(t(),1),p=o();function m({project:t,onDone:r}){let{api:i}=e(),a=n(),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:()=>i.createChannel({project:t,name:m.trim(),purpose:g.trim()}),onSuccess:async e=>{await a.invalidateQueries({queryKey:[`channels`]}),r(),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:r,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)(`p`,{className:`text-meta`,children:t===null?`Announced in the society's general, and followed by whoever subscribes to it; you read every channel without following one.`:`Announced in ${t}'s general, where its members choose to follow it; you read every channel without following one. Tasks filed in it hang their threads here, and it is archived once its tasks are done.`}),(0,p.jsx)(d,{error:y.error})]})}function h({channel:t,onDone:r}){let{api:i}=e(),a=n(),[o,l]=(0,f.useState)(``),m=s({mutationFn:()=>i.archiveChannel({channel:t,reason:o.trim()}),onSuccess:async()=>{await a.invalidateQueries({queryKey:[`channels`]}),r()}});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:r,children:`Cancel`}),(0,p.jsx)(c,{variant:`primary`,type:`submit`,disabled:m.isPending||o.trim()===``,children:m.isPending?`Archiving…`:`Archive channel`})]}),(0,p.jsx)(`p`,{className:`text-meta`,children:`Its open threads close, nobody follows it, and nothing more is posted or filed here; its posts, threads, and tasks stay readable. The board refuses while a task filed here is in play.`}),(0,p.jsx)(d,{error:m.error})]})}function g({channels:e,now:t}){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)(i,{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 ${a(e.archived.at,t)}`]})]},e.ref))})}export{g as n,m as r,h as t};
1
+ import{A as e,Gn as t,Jn as n,Un as r,Wn as i,Yt as a,t as o}from"./format-CvfmDNoY.js";import{n as s,t as c}from"./Button-BYJGqZ3Q.js";import{i as l}from"./compose-BUhbVoI-.js";import{n as u,r as d}from"./ThreadForms-DzoRDeBh.js";var f=n(t(),1),p=i();function m({project:t,onDone:n}){let{api:i}=e(),a=r(),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:()=>i.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)(`p`,{className:`text-meta`,children:t===null?`Announced in the society's general, and followed by whoever subscribes to it; you read every channel without following one.`:`Announced in ${t}'s general, where its members choose to follow it; you read every channel without following one. Tasks filed in it hang their threads here, and it is archived once its tasks are done.`}),(0,p.jsx)(d,{error:y.error})]})}function h({channel:t,onDone:n}){let{api:i}=e(),a=r(),[o,l]=(0,f.useState)(``),m=s({mutationFn:()=>i.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)(`p`,{className:`text-meta`,children:`Its open threads close, nobody follows it, and nothing more is posted or filed here; its posts, threads, and tasks stay readable. The board refuses while a task filed here is in play.`}),(0,p.jsx)(d,{error:m.error})]})}function g({channels:e,now:t}){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)(a,{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,t)}`]})]},e.ref))})}export{g as n,m as r,h as t};
@@ -0,0 +1,2 @@
1
+ import{A as e,Cn as t,Gn as n,Jn as r,K as i,St as a,V as o,Wn as s,Yt as c,_ as l,b as u,c as d,t as f,x as p}from"./format-CvfmDNoY.js";import{t as m}from"./Button-BYJGqZ3Q.js";import{A as h,C as g,i as _,k as v,s as y}from"./index-DD3J11PT.js";import{t as b}from"./BackLink-DKMw_rHu.js";import{i as x}from"./ThreadForms-DzoRDeBh.js";import{t as S}from"./ChannelForms-CkYupEL2.js";import{t as C}from"./MessageItem-BvDOeJci.js";import{n as w,t as T}from"./Pane-DTmByqgA.js";import{t as E}from"./StickyList-C4fC_KJv.js";import{n as D}from"./ThreadItem-CDVppcOZ.js";var O=r(n(),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=s();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:e}){let[t]=e;if(t===void 0)return null;let{did:n,times:r}=j(e);return(0,N.jsxs)(N.Fragment,{children:[n,` knowledge`,` `,t.action===`removed`?(0,N.jsx)(`span`,{className:`text-fg-secondary`,children:t.topic}):(0,N.jsx)(c,{to:`/knowledge/$scope/$topic`,params:{scope:t.project??`society`,topic:t.topic},className:`text-fg-secondary hover:text-fg-primary`,children:t.topic}),r===null?null:` · ${r}`]})}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
+ `),className:`shrink-0 text-meta`,children:f(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:n,target:r}){let{api:s}=e(),h=t({queryKey:[`channel`,n],queryFn:()=>s.channel(n)}),v=o(),y=l(),k=p(),j=d(),M=u(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===n).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,n]),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(n,H),[n,H]);let[U,W]=n.split(`/`),G=W??U??n,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===n)?.archived,Y=K?.archived!==void 0||J!==void 0,X=!Y&&!a(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)(c,{to:`/society`,"aria-label":`Back to the society`,className:R,children:`←`}):(0,N.jsx)(c,{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:n,onDone:()=>F(!1)}):null,I?(0,N.jsx)(S,{channel:n,onDone:()=>z(!1)}):null,(0,N.jsx)(E,{stick:r===void 0,ids:h.data?.map(e=>e.id),className:`py-2`,children:h.error instanceof i&&h.error.status===404?(0,N.jsxs)(w,{children:[`There is no channel `,n,`.`]}):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===r},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:n},placeholder:`Message #${G}`}):(0,N.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-meta`,children:[`Archived `,f(J.at,M),` by `,J.by,`: `,J.reason,`.`]})]})}export{z as ChannelView};
@@ -0,0 +1,2 @@
1
+ import{A as e,D as t,E as n,Gn as r,Ht as i,Jn as a,K as o,O as s,U as c,Un as l,Ut as u,W as d,Wn as f,X as p,Yt as m,_ as h,a as g,b as _,bt as v,f as y,l as b,m as x,o as S,p as C,t as w,v as T,x as ee,z as E}from"./format-CvfmDNoY.js";import{n as D,t as O}from"./Button-BYJGqZ3Q.js";import{t as te}from"./CliIcon-DVX5iLhG.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 ne,p as re,u as ie,v as ae}from"./index-DD3J11PT.js";import{t as R}from"./Markdown--whKJBYV.js";import{n as oe,r as z}from"./ThreadForms-DzoRDeBh.js";import{n as B,t as se}from"./Pane-DTmByqgA.js";import{t as ce}from"./StickyList-C4fC_KJv.js";import{a as V,c as H,d as le,f as U,i as ue,l as de,n as fe,s as W,t as pe}from"./citizen-BPIJzKdn.js";import{n as G}from"./Picker-DsHm4f7s.js";import{t as me}from"./Quota-D8WDWp5H.js";var K=a(r(),1),q=f(),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)(R,{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)(R,{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 `,w(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],` `,w(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
+ `).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`?`Two turns on different runners changed the same lines at once. The file kept one turn's version, and this copy holds the other's until the citizen reconciles them.`:t.kind===`board`?`Written by the board: ${t.subject.replace(/^home: /,``)}.`:t.turnId===void 0?t.subject:(0,q.jsx)(m,{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]} ${w(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:w(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=x(e,t),i=_(3e4);if(r.data===void 0)return(0,q.jsx)(B,{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.jsxs)(B,{children:[e,`'s home has no history yet; it starts with the citizen's first turn.`]}):(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,q.jsxs)(`p`,{className:`px-4 pt-3 pb-1 text-meta`,children:[`What `,e,`'s turns changed in its memory, skills, and profile, newest first.`]}),(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=S(e.name),i=C(e.name),a=_(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.jsxs)(Y,{title:`Edits to reconcile`,children:[(0,q.jsxs)(`p`,{className:`text-sm text-fg-secondary`,children:[`Two turns on different runners changed these files at once. Each file kept one version; the other waits beside it until `,e.name,` merges it in and deletes the copy.`]}),(0,q.jsx)(`ul`,{className:`mt-2 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`,` `,w(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. The citizen writes its own profile.md.`}):(0,q.jsx)(R,{text:U(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. Every turn loads this file in full.`}):(0,q.jsx)(R,{text:U(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=c(e,t?.turnId??null);return{turn:(0,K.useMemo)(()=>t===void 0||n.data===void 0?void 0:re(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=ae(),c=de(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:[V(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),` `,w(t.ts,n)]}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-fg-tertiary`,title:t.usage===void 0?void 0:W(t.usage),children:[c,t.toolCalls===void 0?null:`${t.toolCalls} tools`,t.usage===void 0?null:H(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=d(e,n),a=_(3e4);if(i.data===void 0)return(0,q.jsx)(B,{children:`Reading the turns…`});let o=i.data.toReversed();if(o.length===0)return(0,q.jsxs)(B,{children:[e,` has not finished a turn yet.`]});let s=fe(o),c=s.usage===null?``:` · ${H(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:W(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; show earlier turns to reach it.`:`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:t,onDone:n}){let{api:r}=e(),i=l(),a=g(t.name),s=t.model??Z,c=t.effort??Q,[u,d]=(0,K.useState)(s),[f,p]=(0,K.useState)(c),m=D({mutationFn:async()=>{u!==s&&await r.setModel(t.name,u===Z?null:u),f!==c&&await r.setEffort(t.name,f===Q?null:f)},onSettled:()=>void i.invalidateQueries({queryKey:[`members`]}),onSuccess:n}),h=a.data?.models??[],_=t.model!==void 0&&!h.some(e=>e.id===t.model)?t.model:null,v=e=>h.find(t=>e===Z?t.isDefault:t.id===e),y=v(u)?.efforts??[],b=f!==Q&&!y.some(e=>e.id===f)?f:null,x=e=>{d(e);let t=v(e)?.efforts??[];f!==Q&&!t.some(e=>e.id===f)&&p(Q)},S=u!==s||f!==c;return(0,q.jsxs)(`form`,{"aria-label":`Model of ${t.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:[a.isPending?(0,q.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:[`Asking `,t.cli,` for its models…`]}):a.error===null?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(G,{label:`Model`,choices:Fe(h,_),value:u,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(u),b),value:f,onChange:p,listClassName:`right-0 w-64`})})]}):(0,q.jsxs)(`p`,{role:`alert`,className:`min-w-0 flex-1 truncate text-xs text-red-400`,children:[t.cli,` did not list its models:`,` `,a.error instanceof o?a.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||a.error!==null,children:m.isPending?`Saving…`:`Save`})]}),a.data===void 0?null:(0,q.jsxs)(`p`,{className:`text-meta`,children:[`As `,a.data.cli,` on `,a.data.runner,` lists them, where this citizen's turns run.`]}),(0,q.jsx)(z,{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:n,onDone:r}){let{api:i}=e(),a=l(),o=t(),s=n.homeRunner??$,[c,u]=(0,K.useState)(s),d=D({mutationFn:()=>i.setRunner(n.name,c===$?null:c),onSuccess:()=>{a.invalidateQueries({queryKey:[`members`]}),r()}});return(0,q.jsxs)(`form`,{"aria-label":`Runner of ${n.name}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),d.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,n),value:c,onChange:u}),(0,q.jsx)(O,{onClick:r,children:`Cancel`}),(0,q.jsx)(O,{variant:`primary`,type:`submit`,disabled:d.isPending||c===s,children:d.isPending?`Saving…`:`Run here`})]}),(0,q.jsx)(`p`,{className:`text-meta`,children:`Its conversations outside projects start afresh there from its next turn; its memory and skills follow it. Project work runs where each project lives.`}),(0,q.jsx)(z,{error:d.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??i(t,`general`)}:{channel:e.askedIn!==void 0&&u(e.askedIn).project===e.place?e.askedIn:i(e.place,`general`)}:{channel:i(t,e.channel)}}function He({name:t,turn:n}){let{api:r}=e(),i=l(),[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:`@${t} `,placeholder:n.steerable?`Message ${t} while it works`:`Message ${t} 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?`Ends the turn now. What it was shown counts as read; its stages stay held.`: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)(z,{error:s.error})})]})}function Ue({member:t,scopes:n,preferred:r,running:i,paused:a,onDone:o}){let{api:s}=e(),c=l(),[u,d]=(0,K.useState)(`manual`),[f,p]=(0,K.useState)(r!==null&&n.includes(r)?r:n[0]??``),[m,h]=(0,K.useState)(``),g=(0,K.useRef)(null);(0,K.useEffect)(()=>g.current?.focus(),[]);let _=D({mutationFn:()=>s.wake({agent:t.name,project:f,kind:u,...m.trim()===``?{}:{reason:m.trim()}}),onSuccess:()=>{c.invalidateQueries({queryKey:[`scheduler`]}),o()}}),v=V(f),y=u===`reflection`?`Asks ${t.name} to reflect at ${v}: consolidate its memory, skills, and profile, and take no new work. It restarts the reflection clock.`:`Starts a turn for ${t.name} at ${v} as soon as the scheduler takes it.`,b=a?` The society is paused, so it waits until you resume.`:i.includes(f)?` ${t.name} is in a turn there now; this one follows it.`:``;return(0,q.jsxs)(`form`,{"aria-label":`Wake ${t.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 ${u===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:u===e,onChange:()=>d(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:ue(n),value:f,onChange:p})]})]}),(0,q.jsx)(`textarea`,{ref:g,value:m,rows:2,placeholder:u===`reflection`?`Anything to reflect on in particular? Optional.`:`What should it look at? It reads this as the reason it was woken.`,"aria-label":`Reason`,onChange:e=>h(e.target.value),className:`${oe} resize-none`}),(0,q.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:[y,b,` Each turn costs money.`]}),(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||f===``,children:_.isPending?`Waking…`:u===`reflection`?`Ask for a reflection`:`Wake ${t.name}`})]}),(0,q.jsx)(z,{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)(m,{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:v(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:e,chosen:r,tab:i,turn:a}){let o=h(),c=n(),l=s(),u=P(),d=b(),f=t(),g=ee(),v=_(3e4),[y,x]=(0,K.useState)(null),S=o.data?.find(t=>t.name===e);if(S===void 0)return(0,q.jsx)(B,{children:o.data===void 0?`Reading the roster…`:`There is no citizen ${e}.`});let C=p(l.data?.running??[]).filter(t=>t.agent===e),w=[...new Set(C.map(e=>e.scope))],T=C.map(e=>ie(e.agent,e.scope,e)),E=p(l.data?.pending??[]).find(t=>t.agent===e),D=w.length>0?`working`:E===void 0?`idle`:`queued`,k=ne(u,e)[0],A=k?.model??S.lastModel,j=A??S.model??`CLI default`,M=S.model!==void 0&&S.model!==A?S.model:null,N=c.data?.find(e=>e.name===S.role),F=le(S),I=S.status===`active`&&S.cli!==null,L=(d.data??[]).filter(t=>t.agent===e&&t.ended===void 0).length;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(se,{leading:S.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:S.cli,size:20})}),title:e,subtitle:(0,q.jsxs)(q.Fragment,{children:[S.role,` · `,j,M===null?``:` · set to ${M}`,S.effort===void 0?``:` · ${S.effort} effort`,S.homeRunner===void 0?``:` · on ${S.homeRunner}`,S.status===`retired`?` · retired`:``]}),trailing:(0,q.jsxs)(q.Fragment,{children:[L===0?null:(0,q.jsx)(m,{to:`/crons`,search:{agent:e},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&&y===null?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(O,{onClick:()=>x(`model`),children:`Model…`}),(0,q.jsx)(O,{onClick:()=>x(`runner`),children:`Runner…`}),(0,q.jsx)(O,{onClick:()=>x(`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:S,runners:f.data??[],placed:new Map((g.data??[]).flatMap(e=>e.runner===void 0?[]:[[e.slug,e.runner]])),now:v}),y===`wake`?(0,q.jsx)(Ue,{member:S,scopes:F,preferred:r?.split(`/`)[0]??k?.scope??null,running:w,paused:l.data?.paused??!1,onDone:()=>x(null)}):y===`model`?(0,q.jsx)(Le,{member:S,onDone:()=>x(null)}):y===`runner`?(0,q.jsx)(Be,{member:S,onDone:()=>x(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(t=>(0,q.jsx)(m,{to:`/citizen/$name`,params:{name:e},search:{...r===null?{}:{scope:r},...t.tab===`now`?{}:{tab:t.tab}},replace:!0,"aria-current":t.tab===i?`page`:void 0,className:`rounded-md px-2.5 py-1 text-xs transition-colors ${t.tab===i?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:t.label},t.tab))}),i===`turns`?(0,q.jsx)(Pe,{name:e,opened:a},a):i===`memory`?(0,q.jsx)(Ae,{member:S,charter:N}):i===`history`?(0,q.jsx)(ke,{name:e}):(0,q.jsx)(Xe,{name:e,chosen:r,lastTurnAt:S.lastTurnAt,state:D,runningScopes:w,runningKeys:T,runningTurns:(l.data?.turns??[]).filter(t=>t.agent===e),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:r,runningScopes:i,runningKeys:a,runningTurns:o,queuedScope:s}){let c=P(),l=_(5e3),u=ne(c,e),f=d(e,1),p=je(e,u.length===0?f.data?.at(-1):void 0),h=ae(),g=e=>e.end===null&&a.includes(ie(e.agent,e.scope,e)),v=t?.split(`/`)[0]??null,y=(t?.includes(`/`)===!0?u.find(e=>j(e)===t):void 0)??Ye(u.filter(e=>e.scope===v&&g(e)))??u.find(e=>j(e)===t)??Ye(u.filter(g))??u[0]??p.turn,b=e=>e.thread===void 0?e.channel===void 0?e.place===void 0?V(e.scope):`${V(e.scope)} · ${e.place}'s channels`:`${V(e.scope)} · #${e.channel}`:`${V(e.scope)} · ${h.get(e.thread)?.title??`a thread`}`,x=y!==void 0&&g(y),S=y?.scope??i[0]??s,C=(y===void 0?void 0:o.find(e=>e.scope===y.scope&&e.thread===y.thread&&e.channel===y.channel&&e.place===y.place))??(x?void 0:o[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:x?`In a turn at ${V(y.scope)} for ${y.fromStart?``:`at least `}${L(y.startedAt,l)}`:i.length>0?`In a turn at ${i.map(V).join(` and `)}`:s===null?n===void 0?`No turns yet`:`Last turn ${w(n,l)}`:`Queued for a turn at ${V(s)}`}),S===null||S===`society`?null:(0,q.jsx)(Ge,{project:S,name:e})]}),(0,q.jsx)(ce,{className:`px-4 py-3`,children:y===void 0?(0,q.jsx)(B,{children:r===`working`?`The turn has not reported a step yet.`:p.loading?`Reading the last turn…`:n===void 0?`${e} has not taken a turn yet.`:`${e}'s last turn kept no steps; Turns lists every finished one.`}):(0,q.jsxs)(q.Fragment,{children:[u.length>1?(0,q.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-1.5`,"aria-label":`Turns by conversation`,children:u.toSorted((e,t)=>j(e).localeCompare(j(t))).map(t=>(0,q.jsxs)(m,{to:`/citizen/$name`,params:{name:e},search:{scope:j(t)},replace:!0,"aria-current":t===y?`true`:void 0,className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[11px] transition-colors ${t===y?`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,b(t)]},j(t)))}):null,(0,q.jsxs)(`p`,{className:`text-caps`,children:[x?`This turn`:`Last turn`,` · `,b(y),` · started`,` `,y.fromStart?J(y.startedAt):`before the earliest step shown`]}),y.fromStart?null:(0,q.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`Earlier steps of this turn are no longer in the server's live buffer`,x?``:`; Turns has the whole turn`,`.`]}),(0,q.jsx)(ve,{steps:y.steps}),(0,q.jsx)(ye,{turn:y,running:x,now:l})]})}),C===void 0?null:(0,q.jsx)(He,{name:e,turn:C})]})}export{Ke as CitizenView};
@@ -0,0 +1 @@
1
+ import{D as e,Gn as t,H as n,Jn as r,O as i,Wn as a,X as o,Yt as s,_ as c,b as l,t as u,x as d}from"./format-CvfmDNoY.js";import{t as f}from"./CliIcon-DVX5iLhG.js";import{k as p}from"./index-DD3J11PT.js";import{n as m,t as h}from"./Pane-DTmByqgA.js";import{a as g,o as _,r as v}from"./citizen-BPIJzKdn.js";import{r as y}from"./Quota-D8WDWp5H.js";var b=r(t(),1),x=a(),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:t,tokens:n,outputs:r,runners:i,placed:a,now:o}){let c=C(e),l=e.memberships.length===0?`no projects`:e.memberships.join(`, `),u=v(e,a);return(0,x.jsx)(`li`,{className:`col-span-full grid grid-cols-subgrid`,children:(0,x.jsxs)(s,{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:i,placed:a,now:o}):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:n.detail,children:[n.counts===null?n.label:(0,x.jsxs)(x.Fragment,{children:[`${n.counts.input} · `,(0,x.jsxs)(`span`,{className:`inline-grid justify-items-end`,children:[(0,x.jsx)(`span`,{className:`[grid-area:1/1]`,children:n.counts.output}),r.map(e=>(0,x.jsx)(`span`,{"data-width":e,className:`invisible [grid-area:1/1] before:content-[attr(data-width)]`},e))]})]}),n.spoken===null?null:(0,x.jsxs)(`span`,{className:`sr-only`,children:[`, `,n.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:t.tone,title:t.detail,children:t.label})]})]})})}function D(){let{window:t=`24h`}=p({from:`/citizens`}),r=c(),a=i(),f=d(),v=e(),y=n(t),C=l(3e4),D=(0,b.useId)(),O=(0,b.useId)();if(r.data===void 0)return(0,x.jsx)(m,{children:`Reading the roster…`});let k=r.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(a.data?.running??[]),P=o(a.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 ${u(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),t),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)(s,{to:`/citizens`,search:{window:e.window},title:e.title,"aria-current":e.window===t?`page`:void 0,className:`rounded-md px-2 py-1 text-xs transition-colors ${e.window===t?`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{zn as e}from"./format-B6fjC0_a.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{Wn as e}from"./format-CvfmDNoY.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};
@@ -0,0 +1 @@
1
+ import{A as e,Ft as t,Gn as n,Jn as r,P as i,Un as a,V as o,Wn as s,Yt as c,_ as l,_t as u,b as d,l as f,t as p,x as m}from"./format-CvfmDNoY.js";import{n as h,t as g}from"./Button-BYJGqZ3Q.js";import{t as _}from"./CliIcon-DVX5iLhG.js";import{D as v,E as y,T as b,k as x,w as S}from"./index-DD3J11PT.js";import{t as C}from"./Markdown--whKJBYV.js";import{a as w,o as T,r as E}from"./ThreadForms-DzoRDeBh.js";import{n as D,t as O}from"./Pane-DTmByqgA.js";import{a as k,d as A,i as j}from"./citizen-BPIJzKdn.js";import{n as M,r as N,t as P}from"./Picker-DsHm4f7s.js";var F=r(n(),1),I=s(),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));return}if(e.key===`Enter`&&i&&d[o]!==void 0){e.preventDefault(),p(d[o]);return}if(e.key===`Tab`){a(!1);return}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,n){return t(typeof e==`string`?new Date(e):e,n)}function U({cron:e}){let t=o(),n=b(e);if(n.kind===`thread`){let e=t.data?.find(e=>e.id===n.id)?.title??n.id;return(0,I.jsxs)(c,{to:`/thread/$threadId`,params:{threadId:n.id},className:`truncate hover:text-fg-primary`,children:[`thread “`,e,`”`]})}return n.kind===`channel`?(0,I.jsxs)(c,{to:`/c/$`,params:{_splat:n.ref},className:`hover:text-fg-primary`,children:[`#`,n.ref]}):n.kind===`place`?(0,I.jsxs)(c,{to:`/p/$slug`,params:{slug:n.project},className:`hover:text-fg-primary`,children:[n.project,`'s channels`]}):(0,I.jsxs)(`span`,{children:[`home at `,k(n.scope)]})}function W({cron:t,next:n,member:r,zone:i,now:o,focused:s}){let l=(0,F.useRef)(null);(0,F.useEffect)(()=>{s&&l.current!==null&&(l.current.open=!0,l.current.scrollIntoView({block:`nearest`}))},[s]);let{api:u}=e(),d=a(),[f,m]=(0,F.useState)(!1),[v,b]=(0,F.useState)(``),x=()=>void d.invalidateQueries({queryKey:[`crons`]}),S=h({mutationFn:e=>u.pauseCron(t.id,e),onSuccess:x}),w=h({mutationFn:()=>u.removeCron(t.id,v.trim()),onSuccess:x}),D=`at`in t.schedule?`once, ${H(t.schedule.at,i)}`:`${t.schedule.cron} · ${t.schedule.timezone??i}`,O=t.ended===void 0?t.paused===void 0?n===null?`no time to come`:n.getTime()<=o?`due, waiting for its turn`:p(n.toISOString(),o):`paused`:`ended ${p(t.ended.at,o)}`,k=y(t);return(0,I.jsx)(`li`,{className:`rounded-lg ${s?`bg-surface-2/30`:``}`,children:(0,I.jsxs)(`details`,{ref:l,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:[r?.cli===void 0||r.cli===null?null:(0,I.jsx)(_,{cli:r.cli,size:13}),(0,I.jsx)(`span`,{className:`shrink-0 text-fg-secondary`,children:t.agent}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-primary`,children:t.title}),(0,I.jsx)(`span`,{className:`shrink-0 text-xs ${t.paused===void 0?`text-fg-muted`:`text-amber-300`}`,title:n===null?void 0:`${H(n,i)}, ${i}`,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:t}),t.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 `,t.lastRun.outcome,` `,p(t.lastRun.at,o)]})]}),k?(0,I.jsxs)(`span`,{className:`text-amber-300`,children:[`· `,t.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:t.note})}),(0,I.jsxs)(`p`,{className:`text-meta`,children:[`Set by `,t.createdBy,` `,p(t.createdAt,o),t.lastFiredAt===void 0?``:` · fired last ${H(t.lastFiredAt,i)}`,t.ended===void 0?``:` · ended by ${t.ended.by}: ${t.ended.reason}`]}),n===null?null:(0,I.jsxs)(`p`,{className:`text-meta`,children:[`Next `,H(n,i),` (`,i,`)`]}),t.lastRun===void 0?null:(0,I.jsx)(c,{to:`/citizen/$name`,params:{name:t.agent},search:{tab:`turns`,turn:t.lastRun.turnId},className:`text-meta underline-offset-2 hover:text-fg-primary hover:underline`,children:`Open its last turn`}),t.ended===void 0?f?(0,I.jsxs)(`form`,{"aria-label":`Remove ${t.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, which the cron keeps`,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(t.paused===void 0),disabled:S.isPending,children:t.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:t,onDone:n}){let{api:r}=e(),i=a(),[o,s]=(0,F.useState)(t),c=new Intl.DateTimeFormat().resolvedOptions().timeZone,l=h({mutationFn:()=>r.setTimezone(o.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(),l.mutate()},children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(B,{value:o,onChange:s,label:`Society time zone`}),c===o?null:(0,I.jsxs)(g,{onClick:()=>s(c),children:[`Use `,c]})]}),(0,I.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:`Crons that name no zone are read in it, so their times move with it, and every turn's prompt tells the time in it.`}),(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:l.isPending||o.trim()===``||o.trim()===t,children:l.isPending?`Saving…`:`Save`})]}),(0,I.jsx)(E,{error:l.error})]})}function K({members:t,preferred:n,zone:r,onDone:o}){let{api:s}=e(),c=a(),l=m(),f=i(),[p,_]=(0,F.useState)(t.find(e=>e.name===n)?.name??t[0]?.name??``),y=t.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=d(3e4),ee=(x===`society`?f.data?.channels??[]:l.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,r,new Date(Y)),Q=O===`repeats`?L.trim()===``?r:L.trim():r,$=h({mutationFn:()=>s.createCron({agent:p,title:W.trim(),note:K.trim(),project:x,...C===``?{}:{channel:C},...X}),onSuccess:()=>{c.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:t.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 n=t.find(t=>t.name===e);_(e),S(n===void 0?u:A(n)[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; the citizen reads this in every turn it starts.`,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:`${r}, 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.jsxs)(`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,`).`]}),` `,`Each fire is a turn for `,p===``?`the citizen`:p,`, which costs money.`]}),(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:e,cron:t}=x({from:`/crons`}),n=f(),r=l(),a=i(),o=d(3e4),[s,u]=(0,F.useState)(null),p=a.data?.timezone??`UTC`,m=(n.data??[]).filter(t=>e===void 0||t.agent===e),h=S(m,p),_=m.filter(y).length,v=(r.data??[]).filter(e=>e.status===`active`&&e.cli!==null),b=e=>r.data?.find(t=>t.name===e);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(O,{title:e===void 0?`Crons`:`Crons of ${e}`,subtitle:[`${h.active.length} running`,...h.paused.length===0?[]:[`${h.paused.length} paused`],..._===0?[]:[`${_} failing`],`times in ${p}`].join(` · `),trailing:s===null?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(g,{onClick:()=>u(`zone`),children:`Time zone…`}),(0,I.jsx)(g,{onClick:()=>u(`new`),disabled:v.length===0,children:`New cron…`})]}):null}),s===`new`?(0,I.jsx)(K,{members:v,preferred:e,zone:p,onDone:()=>u(null)}):s===`zone`?(0,I.jsx)(G,{zone:p,onDone:()=>u(null)}):null,(0,I.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[e===void 0?null:(0,I.jsx)(c,{to:`/crons`,className:`block px-2 pb-2 text-meta hover:text-fg-primary`,children:`Show every citizen's crons`}),n.error!==null&&n.data===void 0?(0,I.jsxs)(D,{children:[`The board server did not list its crons (`,n.error.message,`); one older than this interface has none.`]}):n.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. A citizen sets one with create_cron when it needs to come back to something later; you can set one for any citizen here.`}):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:n})=>(0,I.jsx)(W,{cron:e,next:n,member:b(e.agent),zone:p,now:o,focused:e.id===t},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:p,now:o,focused:e.id===t},e.id))})]}),h.ended.length===0?null:(0,I.jsxs)(`details`,{className:`mt-3`,open:h.ended.some(e=>e.id===t),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:p,now:o,focused:e.id===t},e.id))})]})]})]})}export{q as CronsView};
@@ -0,0 +1 @@
1
+ import{A as e,Gn as t,Jn as n,Un as r,Wn as i,Yt as a,_t as o,b as s,h as c,t as l,x as u}from"./format-CvfmDNoY.js";import{n as d,t as f}from"./Button-BYJGqZ3Q.js";import{i as p}from"./compose-BUhbVoI-.js";import{A as m}from"./index-DD3J11PT.js";import{t as h}from"./BackLink-DKMw_rHu.js";import{t as g}from"./Markdown--whKJBYV.js";import{r as _}from"./ThreadForms-DzoRDeBh.js";import{n as v,t as y}from"./Pane-DTmByqgA.js";var b=n(t(),1),x=i(),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:t,topic:n}=m({from:`/knowledge/$scope/$topic`}),{api:i}=e(),C=r(),w=p(),T=c(t),E=u(),D=s(3e4),[O,k]=(0,b.useState)(!1),A=t===o,j=A?`the society`:E.data?.find(e=>e.slug===t)?.name??t,M=T.data?.find(e=>e.topic===n),N=d({mutationFn:()=>i.removeKnowledge({project:A?null:t,topic:n}),onSuccess:async()=>{await C.invalidateQueries({queryKey:[`knowledge`,t]}),await w(A?{to:`/society`}:{to:`/p/$slug`,params:{slug:t}})}}),P=A?(0,x.jsx)(a,{to:`/society`,"aria-label":`Back to the society`,className:S,children:`←`}):(0,x.jsx)(a,{to:`/p/$slug`,params:{slug:t},"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 ${n}.`}):(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 text-meta`,children:[`No turn or search finds `,M.topic,` again, and a note in`,` `,A?`#general`:`#${t}/general`,` says so without waking anyone. The server keeps its text aside.`]}),(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};
@@ -0,0 +1,30 @@
1
+ import{G as e,Gn as t,Jn as n,Kn as r,R as i,Wn as a,Yt as o,lt as s,qn as c}from"./format-CvfmDNoY.js";import{b as l,g as u,j as d,x as f,y as p}from"./index-DD3J11PT.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-D838wlfQ.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=c({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=r(((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
+ `);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=r((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(ke());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),je=r((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=r(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ae()),r=je();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),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=n(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;return}!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
+ `}]}function Mt(e,t){let n=t.value?t.value+`
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:`
5
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
6
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Gt(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Kt(n[r])}return t}function Kt(e){return e.spread??e.children.length>1}function qt(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Jt(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yt(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Xt(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zt(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Pe(t.children[1]),o=Ne(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Qt(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function $t(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var en=9,tn=32;function nn(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(rn(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(rn(t.slice(i),i>0,!1)),a.join(``)}function rn(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===en||t===tn;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===en||t===tn;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function an(e,t){let n={type:`text`,value:nn(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function on(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var sn={blockquote:At,break:jt,code:Mt,delete:Nt,emphasis:Pt,footnoteReference:Ft,heading:It,html:Lt,imageReference:zt,image:Bt,inlineCode:Vt,linkReference:Ht,link:Ut,listItem:Wt,list:qt,paragraph:Jt,root:Yt,strong:Xt,table:Zt,tableCell:$t,tableRow:Qt,text:an,thematicBreak:on,toml:G,yaml:G,definition:G,footnoteDefinition:G};function G(){}var{defineProperty:cn}=Object,ln=typeof self==`object`?self:globalThis,un=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new ln[e](t)},dn=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?cn(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof ln[e]==`function`?un(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(un(a,o),i)};return r},fn=e=>dn(new Map,e)(0),K=``,{toString:pn}={},{keys:mn,is:hn}=Object,q=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=pn.call(e).slice(8,-1);switch(n){case`Array`:return[1,K];case`Object`:return[2,K];case`Date`:return[3,K];case`RegExp`:return[4,K];case`Map`:return[5,K];case`Set`:return[6,K];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},J=([e,t])=>e===0&&(t===`function`||t===`symbol`),gn=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=q(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&hn(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of mn(o))(e||!J(q(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?K:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(J(q(n))||J(q(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!J(q(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},_n=(e,{json:t,lossy:n}={})=>{let r=[];return gn(!(t||n),!!t,new Map,r)(e),r},Y=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?fn(_n(e,t)):structuredClone(e):(e,t)=>fn(_n(e,t));function vn(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function yn(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function bn(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||vn,r=e.options.footnoteBackLabel||yn,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=b(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Y(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
7
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
8
+ `}]}}var xn=(function(e){if(e==null)return En;if(typeof e==`function`)return Tn(e);if(typeof e==`object`)return Array.isArray(e)?Sn(e):Cn(e);if(typeof e==`string`)return wn(e);throw Error(`Expected function, string, or object as test`)});function Sn(e){let t=[],n=-1;for(;++n<e.length;)t[n]=xn(e[n]);return Tn(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Cn(e){let t=e;return Tn(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function wn(e){return Tn(t);function t(t){return t&&t.type===e}}function Tn(e){return t;function t(t,n,r){return!!(Dn(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function En(){return!0}function Dn(e){return typeof e==`object`&&!!e&&`type`in e}function On(e){return e}var kn=[];function An(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=xn(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+On(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=kn,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=jn(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function jn(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?kn:[e]}function Mn(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),An(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Nn={}.hasOwnProperty,Pn={};function Fn(e,t){let n=t||Pn,r=new Map,i=new Map,a={all:s,applyData:Ln,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...sn,...n.handlers},one:o,options:n,patch:In,wrap:zn};return Mn(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Nn.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Y(n);return r.children=a.all(e),r}return Y(e)}return(a.options.unknownHandler||Rn)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Bn(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Bn(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function In(e,t){e.position&&(t.position=Ie(e))}function Ln(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Y(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Rn(e,t){let n=t.data||{},r=`value`in t&&!(Nn.call(n,`hProperties`)||Nn.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zn(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
9
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
10
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
11
+ `}),n}function Bn(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Vn(e,t){let n=Fn(e,t),r=n.one(e,void 0),i=bn(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
12
+ `},i)),a}function Hn(e,t){return e&&`run`in e?async function(n,r){let i=Vn(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Vn(n,{file:r,...e||t})}}function Un(e){if(e)throw e}var Wn=n(r(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function Gn(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Kn(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?qn(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function qn(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var X={basename:Jn,dirname:Yn,extname:Xn,join:Zn,sep:`/`};function Jn(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Z(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Yn(e){if(Z(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Xn(e){Z(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Zn(...e){let t=-1,n;for(;++t<e.length;)Z(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Qn(n)}function Qn(e){Z(e);let t=e.codePointAt(0)===47,n=$n(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function $n(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Z(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var er={cwd:tr};function tr(){return`/`}function nr(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function rr(e){if(typeof e==`string`)e=new URL(e);else if(!nr(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return ir(e)}function ir(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var ar=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],or=class{constructor(e){let t;t=e?nr(e)?{path:e}:typeof e==`string`||ur(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:er.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<ar.length;){let e=ar[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)ar.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?X.basename(this.path):void 0}set basename(e){cr(e,`basename`),sr(e,`basename`),this.path=X.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?X.dirname(this.path):void 0}set dirname(e){lr(this.basename,`dirname`),this.path=X.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?X.extname(this.path):void 0}set extname(e){if(sr(e,`extname`),lr(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=X.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){nr(e)&&(e=rr(e)),cr(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?X.basename(this.path,this.extname):void 0}set stem(e){cr(e,`stem`),sr(e,`stem`),this.path=X.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new H(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function sr(e,t){if(e&&e.includes(X.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+X.sep+"`")}function cr(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function lr(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function ur(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var dr=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),fr={}.hasOwnProperty,pr=new class e extends dr{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Kn()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Wn.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(gr(`data`,this.frozen),this.namespace[e]=t,this):fr.call(this.namespace,e)&&this.namespace[e]||void 0:e?(gr(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=yr(e),n=this.parser||this.Parser;return mr(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),mr(`process`,this.parser||this.Parser),hr(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=yr(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);xr(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),mr(`processSync`,this.parser||this.Parser),hr(`processSync`,this.compiler||this.Compiler),this.process(e,r),vr(`processSync`,`process`,t),n;function r(e,r){t=!0,Un(e),n=r}}run(e,t,n){_r(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=yr(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),vr(`runSync`,`run`,n),r;function i(e,t){Un(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=yr(t),r=this.compiler||this.Compiler;return hr(`stringify`,r),_r(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(gr(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Wn.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Gn(o)&&Gn(r)&&(r=(0,Wn.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function mr(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function hr(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function gr(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _r(e){if(!Gn(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function vr(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function yr(e){return br(e)?e:new or(e)}function br(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function xr(e){return typeof e==`string`||Sr(e)}function Sr(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Q=a(),$=n(t(),1),Cr=[],wr={allowDangerousHtml:!0},Tr=/^(https?|ircs?|mailto|xmpp)$/i,Er=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Dr(e){let t=Or(e),n=kr(e);return Ar(t.runSync(t.parse(n),n),e)}function Or(e){let t=e.rehypePlugins||Cr,n=e.remarkPlugins||Cr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...wr}:wr;return pr().use(kt).use(n).use(Hn,r).use(t)}function kr(e){let t=e.children||``,n=new or;return typeof t==`string`?n.value=t:``+t,n}function Ar(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||jr;for(let e of Er)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Mn(e,l),qe(e,{Fragment:Q.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Q.jsx,jsxs:Q.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in mt)if(Object.hasOwn(mt,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=mt[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function jr(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Tr.test(e.slice(0,t))?e:``}function Mr(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Nr(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Pr(e,t,n){let r=xn((n||{}).ignore||[]),i=Fr(t),a=-1;for(;++a<i.length;)An(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Fr(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Ir(e[0]),Lr(e[1])])}return t}function Ir(e){return typeof e==`string`?new RegExp(Nr(e),`g`):e}function Lr(e){return typeof e==`function`?e:function(){return e}}var Rr=`phrasing`,zr=[`autolink`,`link`,`image`,`label`];function Br(){return{transforms:[Jr],enter:{literalAutolink:Hr,literalAutolinkEmail:Ur,literalAutolinkHttp:Ur,literalAutolinkWww:Ur},exit:{literalAutolink:qr,literalAutolinkEmail:Kr,literalAutolinkHttp:Wr,literalAutolinkWww:Gr}}}function Vr(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Rr,notInConstruct:zr},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Rr,notInConstruct:zr},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Rr,notInConstruct:zr}]}}function Hr(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Ur(e){this.config.enter.autolinkProtocol.call(this,e)}function Wr(e){this.config.exit.autolinkProtocol.call(this,e)}function Gr(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Kr(e){this.config.exit.autolinkEmail.call(this,e)}function qr(e){this.exit(e)}function Jr(e){Pr(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Yr],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Xr]],{ignore:[`link`,`linkReference`]})}function Yr(e,t,n,r,i){let a=``;if(!$r(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Zr(n)))return!1;let o=Qr(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Xr(e,t,n,r){return!$r(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Zr(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Qr(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Mr(e,`(`),a=Mr(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function $r(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||ee(n)||h(n))&&(!t||n!==47)}li.peek=ci;function ei(){this.buffer()}function ti(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function ni(){this.buffer()}function ri(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function ii(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=y(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ai(e){this.exit(e)}function oi(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=y(this.sliceSerialize(e)).toLowerCase(),n.label=t}function si(e){this.exit(e)}function ci(){return`[`}function li(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function ui(){return{enter:{gfmFootnoteCallString:ei,gfmFootnoteCall:ti,gfmFootnoteDefinitionLabelString:ni,gfmFootnoteDefinition:ri},exit:{gfmFootnoteCallString:ii,gfmFootnoteCall:ai,gfmFootnoteDefinitionLabelString:oi,gfmFootnoteDefinition:si}}}function di(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:li},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
13
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?pi:fi))),s(),o}}function fi(e,t,n){return t===0?e:pi(e,t,n)}function pi(e,t,n){return(n?``:` `)+e}var mi=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];yi.attention=bi,yi.peek=xi;function hi(){return{canContainEols:[`delete`],enter:{strikethrough:_i},exit:{strikethrough:vi}}}function gi(){return{handlers:{delete:yi},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:mi}]}}function _i(e){this.enter({type:`delete`,children:[],position:void 0},e)}function vi(e){this.exit(e)}function yi(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function bi(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function xi(){return`~`}function Si(e){return e.length}function Ci(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Si,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=wi(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Ti(r[d]);else{let e=Ti(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
14
+ `)}function wi(e){return e==null?``:String(e)}function Ti(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var Ei=xn([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Di(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Oi);return i(),o}function Oi(e,t,n){return`>`+(n?``:` `)+e}function ki(e,t){return Ai(e,t.inConstruct,!0)&&!Ai(e,t.notInConstruct,!1)}function Ai(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ji(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
15
+ `&&!e.before&&!e.after&&ki(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
16
+ `}function Mi(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Ni(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function Pi(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Fi(e,t,n,r){let i=Pi(n),a=e.value||``;if(Ni(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Ii);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(Mi(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
17
+ `,encode:["`"],...o.current()})),t()}return u+=o.move(`
18
+ `),a&&(u+=o.move(a+`
19
+ `)),u+=o.move(s),c(),u}function Ii(e,t,n){return(n?``:` `)+e}function Li(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ri(e,t,n,r){let i=Li(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
20
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function zi(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Bi.attention=Vi,Bi.peek=Hi;function Bi(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function Vi(e,t){return{construct:`emphasis`,markers:zi(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Hi(e,t,n){return n.options.emphasis||`*`}function Ui(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Wi(e,t){let n=!1;return Mn(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&gt(e)&&(t.options.setext||n))}function Gi(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Wi(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
21
+ `,after:`
22
+ `});return r(),t(),o+`
23
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
24
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
25
+ `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=Ui(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Ki.peek=qi;function Ki(e){return e.value||``}function qi(){return`<`}Ji.peek=Yi;function Ji(e,t,n,r){let i=Li(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Yi(){return`!`}Xi.peek=Zi;function Xi(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Zi(){return`!`}Qi.peek=$i;function Qi(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function $i(){return"`"}function ea(e,t){let n=gt(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}ta.peek=na;function ta(e,t,n,r){let i=Li(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(ea(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function na(e,t,n){return ea(e,n)?`<`:`[`}ra.peek=ia;function ra(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ia(){return`[`}function aa(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function oa(e){let t=aa(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function sa(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ca(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function la(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?sa(n):aa(n),s=e.ordered?o===`.`?`)`:`.`:oa(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),ca(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function ua(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function da(e,t,n,r){let i=ua(n),a=n.bulletCurrent||aa(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function fa(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function pa(e,t,n,r){if(!e.children.some(function(e){return Ei(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function ma(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ha.attention=ga,ha.peek=_a;function ha(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function ga(e,t){return{construct:`strong`,markers:ma(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function _a(e,t,n){return n.options.strong||`*`}function va(e,t,n,r){return n.safe(e.value,r)}function ya(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ba(e,t,n){let r=(ca(n)+(n.options.ruleSpaces?` `:``)).repeat(ya(n));return n.options.ruleSpaces?r.slice(0,-1):r}var xa={blockquote:Di,break:ji,code:Fi,definition:Ri,emphasis:Bi,hardBreak:ji,heading:Gi,html:Ki,image:Ji,imageReference:Xi,inlineCode:Qi,link:ta,linkReference:ra,list:la,listItem:da,paragraph:fa,root:pa,strong:ha,text:va,thematicBreak:ba};function Sa(){return{enter:{table:Ca,tableData:Da,tableHeader:Da,tableRow:Ta},exit:{codeText:Oa,table:wa,tableData:Ea,tableHeader:Ea,tableRow:Ea}}}function Ca(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function wa(e){this.exit(e),this.data.inTable=void 0}function Ta(e){this.enter({type:`tableRow`,children:[]},e)}function Ea(e){this.exit(e)}function Da(e){this.enter({type:`tableCell`,children:[]},e)}function Oa(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ka));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ka(e,t){return t===`|`?t:e}function Aa(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
26
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
27
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Ci(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=xa.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function ja(){return{exit:{taskListCheckValueChecked:Na,taskListCheckValueUnchecked:Na,paragraph:Pa}}}function Ma(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Fa}}}function Na(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Pa(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Fa(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=xa.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Ia(){return[Br(),ui(),hi(),Sa(),ja()]}function La(e){return{extensions:[Vr(),di(e),gi(),Aa(e),Ma()]}}var Ra={};function za(e){let t=this,n=e||Ra,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(ne(n)),a.push(Ia()),o.push(La(n))}var Ba={kind:`local`},Va=/(?:^|\/)worktrees\/[^/]+\/\.tasks\/([0-9A-HJKMNP-TV-Z]{26})(?:\/(.*))?$/,Ha=/^[a-z][a-z0-9+.-]*:/i,Ua=/:(\d+)(?::\d+)?$/,Wa=/#L(\d+)/,Ga=/^[^/?#:]*\.[^/?#:]*:\d+(?::\d+)?(?:[?#].*)?$/;function Ka(e){return Ga.test(e)}function qa(e){let t=Ua.exec(e),n=Number(t?.[1]);return t===null||!(n>0)?{path:e}:{path:e.slice(0,t.index),line:n}}function Ja(e){let t=[];for(let n of e.split(`/`))if(n!==``&&n!==`.`){if(n===`..`){if(t.pop()===void 0)return null;continue}t.push(n)}return t.join(`/`)}function Ya(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function Xa(e){try{return decodeURIComponent(e)}catch{return e}}function Za(e,t){if(e===void 0||e===``)return Ba;let n=s(e);if(n!==null)return{kind:`upload`,id:n};if(e.startsWith(`#`)||e.startsWith(`//`)||Ha.test(e)&&!Ka(e))return null;let r=qa(Xa(e.replace(/[?#].*$/,``))),i=r.path,a=Number(Wa.exec(e)?.[1]),o=r.line??(a>0?a:void 0),c=o===void 0?{}:{line:o},l=Va.exec(i);if(l?.[1]!==void 0){let e=Ja(l[2]??``);return e===null?Ba:{kind:`task-file`,taskId:l[1],path:e,...c}}if(t!==void 0&&!i.startsWith(`/`)){let e=Ja(`${t.dir}/${i}`);return e===null?Ba:{kind:`task-file`,taskId:t.taskId,path:e,...c}}return Ba}var Qa={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,avif:`image/avif`,bmp:`image/bmp`,ico:`image/x-icon`,svg:`image/svg+xml`};function $a(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?``:t.slice(n+1).toLowerCase()}function eo(e){return Qa[$a(e)]??null}function to(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return n}function no(e){try{let t=new TextDecoder(`utf-8`,{fatal:!0}).decode(e);return t.includes(`\0`)?null:t}catch{return null}}function ro(e,t){let n=[],r=[],i=``,a=!1;for(let o=0;o<e.length;o+=1){let s=e.charAt(o);a?s===`"`?e.charAt(o+1)===`"`?(i+=`"`,o+=1):a=!1:i+=s:s===`"`&&i===``?a=!0:s===t?(r.push(i),i=``):s===`
28
+ `||s===`\r`?(s===`\r`&&e.charAt(o+1)===`
29
+ `&&(o+=1),r.push(i),n.push(r),r=[],i=``):i+=s}return(i!==``||r.length>0)&&(r.push(i),n.push(r)),n}function io(e,t){let n=eo(e);if(n!==null)return{kind:`image`,type:n};let r=no(t);if(r===null)return{kind:`binary`};let i=$a(e);return i===`md`||i===`markdown`?{kind:`markdown`,text:r}:i===`csv`||i===`tsv`?{kind:`table`,rows:ro(r,i===`csv`?`,`:` `)}:{kind:`text`,text:r}}var ao=new Set([`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`li`,`pre`,`blockquote`,`table`,`tr`,`hr`]);function oo(e){return t=>{let n=[],r=e=>{e.tagName!==void 0&&ao.has(e.tagName)&&e.position&&n.push({node:e,start:e.position.start.line,end:e.position.end.line});for(let t of e.children??[])r(t)};r(t);let{line:i}=e,a=n.filter(e=>e.start<=i&&i<=e.end).at(-1)??n.find(e=>e.start>i);if(a!==void 0){let e=a.node.properties?.className;a.node.properties={...a.node.properties,className:[...Array.isArray(e)?e:[],`line-target`]}}}}function so(e){if(e.status===`deleted`)return`deleted`;let t=e.added===null||e.removed===null?`binary`:e.status===`added`?`+${e.added}`:`+${e.added} −${e.removed}`;return e.status===`added`?`new · ${t}`:t}function co(e){if(e===``)return[];let t=0;return e.split(`
30
+ `).map(e=>{let n=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(e);return n===null?e.startsWith(`-`)?{kind:`removed`,text:e}:e.startsWith(`\\`)?{kind:`note`,text:e}:(t+=1,{kind:e.startsWith(`+`)?`added`:`context`,text:e,line:t-1}):(t=Number(n[1]),{kind:`hunk`,text:e})})}function lo(e){let t=[...[...e.folders.values()].map(lo).toSorted((e,t)=>e.name.localeCompare(t.name)),...e.files.toSorted((e,t)=>e.name.localeCompare(t.name))],{name:n,path:r}=e,[i]=t;e.path!==``&&t.length===1&&i?.kind===`dir`&&(n=`${n}/${i.name}`,r=i.path,t=[...i.children]);let a=0,o;for(let e of t){a+=e.kind===`dir`?e.files:1;let t=e.kind===`dir`?e.lastChange:e.change.lastChange;t!==void 0&&(o===void 0||t.at>o.at)&&(o=t)}return{kind:`dir`,name:n,path:r,children:t,files:a,...o===void 0?{}:{lastChange:o}}}function uo(e){let t={name:``,path:``,folders:new Map,files:[]};for(let n of e){let e=n.path.split(`/`),r=t;for(let t of e.slice(0,-1)){let e=r.folders.get(t);e===void 0&&(e={name:t,path:r.path===``?t:`${r.path}/${t}`,folders:new Map,files:[]},r.folders.set(t,e)),r=e}r.files.push({kind:`file`,name:e.at(-1)??n.path,change:n})}return lo(t)}function fo(e,t=24){let n=new Set,r=e.children.length,i=e.children.filter(e=>e.kind===`dir`);for(let e=i.shift();e!==void 0;e=i.shift())r+e.children.length>t||(n.add(e.path),r+=e.children.length,i.push(...e.children.filter(e=>e.kind===`dir`)));return n}function po(e){if(e<1024)return`${e} B`;let t=e/1024;return t<1024?`${t.toFixed(1)} KB`:`${(t/1024).toFixed(1)} MB`}var mo=new Set([`code`,`inlineCode`,`link`,`linkReference`,`html`]);function ho(e){let t=[],n=0;for(let r of e.matchAll(re)){let i=(r.index??0)+(r[1]?.length??0);i>n&&t.push({type:`text`,value:e.slice(n,i)});let a=r[2]??``;t.push({type:`mention`,data:{hName:`span`,hProperties:{className:[`mention`]},hChildren:[{type:`text`,value:`@${a}`}]}}),n=i+a.length+1}return n<e.length&&t.push({type:`text`,value:e.slice(n)}),t}function go(e){e.children!==void 0&&(e.children=e.children.flatMap(e=>e.type===`text`&&e.value!==void 0?ho(e.value):(mo.has(e.type)||go(e),[e])))}function _o(){return e=>go(e)}var vo=d(),yo=`max-h-[32rem] max-w-full rounded-lg`,bo=(0,$.createContext)(!1);function xo({src:e,alt:t}){let n=(0,$.useContext)(bo),[r,i]=(0,$.useState)(!1),[a,o]=(0,$.useState)(null),s=(0,$.useRef)(null),c=(0,$.useCallback)(()=>{(0,vo.flushSync)(()=>i(!1)),s.current?.focus({preventScroll:!0})},[]);return n||a===e?(0,Q.jsx)(`img`,{src:e,alt:t,className:yo}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{ref:s,type:`button`,"aria-label":`Enlarge ${t===``?`the image`:t}`,"aria-haspopup":`dialog`,onClick:()=>i(!0),className:`group pointer-events-none block w-full rounded-lg focus-visible:outline-none`,children:(0,Q.jsx)(`img`,{src:e,alt:t,onError:()=>o(e),className:`pointer-events-auto block cursor-zoom-in ${yo} group-focus-visible:ring-2 group-focus-visible:ring-fg-primary/30`})}),r?(0,vo.createPortal)((0,Q.jsx)(So,{src:e,alt:t,onClose:c}),document.body):null]})}function So({src:e,alt:t,onClose:n}){let r=(0,$.useRef)(null);return(0,$.useLayoutEffect)(()=>{r.current?.open===!1&&r.current.showModal()},[]),(0,Q.jsx)(`dialog`,{ref:r,"aria-label":t===``?`The image`:t,onCancel:n,className:`m-0 size-full max-h-none max-w-none cursor-zoom-out border-0 bg-transparent p-0 text-fg-primary backdrop:bg-black/85`,children:(0,Q.jsxs)(`div`,{role:`presentation`,onClick:n,className:`grid size-full grid-rows-[auto_minmax(0,1fr)] gap-2 p-4`,children:[(0,Q.jsxs)(`header`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm text-fg-secondary`,children:t}),(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Close`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-secondary hover:bg-surface-2/70 hover:text-fg-primary focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none`,children:`✕`})]}),(0,Q.jsx)(`div`,{className:`flex min-h-0 items-center justify-center`,children:(0,Q.jsx)(`img`,{src:e,alt:t,className:`max-h-full max-w-full rounded-lg ring-1 ring-white/10`})})]})})}var Co=`text-fg-primary underline decoration-fg-muted underline-offset-2 hover:decoration-fg-primary`,wo=(0,$.createContext)(void 0);function To(e,t){return(0,$.useMemo)(()=>e==null?null:`data:${t};base64,${e}`,[e,t])}function Eo({taskId:e,path:t,line:n,className:r=Co,children:i}){return(0,Q.jsx)(o,{to:`/task/$taskId/files/$`,params:{taskId:e,_splat:t},search:n===void 0?{}:{line:n},title:`${t===``?`The files`:t}${n===void 0?``:`:${n}`} on task/${e}`,className:r,children:i})}function Do({taskId:e,path:t,alt:n}){let r=i(e,t),a=To(r.data?.kind===`file`?r.data.content:null,eo(t)??`application/octet-stream`),o=n===``?t.split(`/`).at(-1)??t:n;return(0,Q.jsx)(Eo,{taskId:e,path:t,children:a===null?(0,Q.jsx)(`span`,{className:`text-meta`,children:r.isPending?`Loading ${o}…`:`${o} cannot be shown here`}):(0,Q.jsx)(`img`,{src:a,alt:n,className:`max-h-[32rem] max-w-full rounded-lg`})})}function Oo({id:t,alt:n}){let r=e(t),i=n===``?`an image`:n;return r.data===void 0?r.isPending?(0,Q.jsxs)(`span`,{className:`text-meta`,children:[`Loading `,i,`…`]}):(0,Q.jsx)(`span`,{title:r.error?.message,children:i}):(0,Q.jsx)(xo,{src:r.data,alt:n})}function ko({href:e,children:t}){return(0,Q.jsx)(`span`,{title:e===void 0||e===``?void 0:`${e}, on a runner's machine`,children:t})}function Ao({href:e,children:t}){let n=(0,$.useContext)(wo),r=l(e);if(r!==null)return(0,Q.jsx)(u,{kind:r.kind,id:r.id,place:r.place,children:(0,Q.jsx)(bo,{value:!0,children:t})});let i=Za(e,n);return i?.kind===`task-file`?(0,Q.jsx)(Eo,{taskId:i.taskId,path:i.path,line:i.line,children:(0,Q.jsx)(bo,{value:!0,children:t})}):i?.kind===`local`?(0,Q.jsx)(ko,{href:e,children:t}):i?.kind===`upload`?(0,Q.jsx)(`span`,{children:t}):(0,Q.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:(0,Q.jsx)(bo,{value:!0,children:t})})}function jo({src:e,alt:t}){let n=(0,$.useContext)(wo),r=Za(typeof e==`string`?e:void 0,n);if(r?.kind===`task-file`)return(0,Q.jsx)(Do,{taskId:r.taskId,path:r.path,alt:t??``});if(r?.kind===`upload`)return(0,Q.jsx)(Oo,{id:r.id,alt:t??``});if(r?.kind===`local`){let n=typeof e==`string`?e:void 0;return(0,Q.jsx)(ko,{href:n,children:t===void 0||t===``?n:t})}return typeof e==`string`?(0,Q.jsx)(xo,{src:e,alt:t??``}):(0,Q.jsx)(`img`,{alt:t,className:yo})}var Mo={a:Ao,img:jo};function No(e){return Ka(e)||s(e)!==null?e:jr(e)}function Po({text:e,base:t,line:n}){let r=p(e),i=(0,$.useMemo)(()=>[za,[f,{index:r}],_o],[r]),a=(0,$.useMemo)(()=>n===void 0?[]:[[oo,{line:n}]],[n]),o=t?.taskId,s=t?.dir,c=(0,$.useMemo)(()=>o===void 0||s===void 0?void 0:{taskId:o,dir:s},[o,s]);return(0,Q.jsx)(`div`,{className:`board-markdown`,children:(0,Q.jsx)(wo,{value:c,children:(0,Q.jsx)(Dr,{remarkPlugins:i,rehypePlugins:a,components:Mo,urlTransform:No,children:e})})})}export{so as a,eo as c,Ya as d,co as f,to as i,Ja as l,io as m,Eo as n,qa as o,po as p,To as r,uo as s,Po as t,fo as u};
@@ -0,0 +1 @@
1
+ import{Gn as e,Jn as t,Wn as n,t as r}from"./format-CvfmDNoY.js";import{u as i}from"./tasks-CTaxXtGL.js";import{a,s as o}from"./index-DD3J11PT.js";import{t as s}from"./Markdown--whKJBYV.js";var c=t(e(),1),l=n(),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};
@@ -0,0 +1 @@
1
+ import{K as e,Wn as t,Yt as n,b as r,r as i,t as a,y as o}from"./format-CvfmDNoY.js";import{g as s,k as c,s as l}from"./index-DD3J11PT.js";import{n as u,t as d}from"./Pane-DTmByqgA.js";import{n as f}from"./Overview-DFiHDFnA.js";var p=t(),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:e}){let t=l();return e===`user`?(0,p.jsx)(`span`,{children:t(e)}):(0,p.jsx)(n,{to:`/citizen/$name`,params:{name:e},className:`hover:underline`,children:e})}function w(e){return e.window===`24h`?1:e.window===`7d`?7:Math.max(1,e.decisions.byDay.length)}function T(){let{window:t=`7d`}=c({from:`/metrics`}),l=o(t),T=r(6e4),E=(0,p.jsx)(`nav`,{"aria-label":`Window`,className:`flex shrink-0 gap-1`,children:m.map(e=>(0,p.jsx)(n,{to:`/metrics`,search:{window:e.window},"aria-current":e.window===t?`page`:void 0,className:`rounded-md px-2 py-1 text-xs transition-colors ${e.window===t?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`}`,children:e.label},e.window))}),D=(0,p.jsx)(d,{title:`Metrics`,subtitle:`How the society works, counted from its event log`,trailing:E});if(l.data===void 0)return(0,p.jsxs)(p.Fragment,{children:[D,(0,p.jsx)(u,{children:l.error instanceof e?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,` turns changed nothing on the board`,` `,(0,p.jsx)(`span`,{className:`text-fg-muted`,children:_(O.idle,O.turns)})]}),(0,p.jsxs)(x,{children:[`A turn that took no board action: no post, claim, handover, plan, proposal, decision, or knowledge. Reflections are left out, since they write memory.`,O.unknown>0?` ${O.unknown} ${O.unknown===1?`turn`:`turns`} kept no transcript and could not be counted.`:``]}),(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)(x,{children:`Posts in each finished task's thread, handovers included, the board's own left out.`}),(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)]}),(0,p.jsxs)(x,{children:[`From a post that mentions a citizen to the start of its turn in the same conversation, debounce included.`,j.unanswered>0?` ${j.unanswered} ${j.unanswered===1?`mention has`:`mentions have`} no turn yet.`:``]}),(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)(x,{children:`Proposals you decided, questions to you that you answered, and stages you passed or sent back.`}),(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};
@@ -0,0 +1 @@
1
+ import{Wn as e,Yt as t,b as n,n as r,t as i,x as a}from"./format-CvfmDNoY.js";import{o}from"./governance-Bba0OHvJ.js";import{S as s,_ as c,s as l}from"./index-DD3J11PT.js";import{n as u,t as d}from"./Pane-DTmByqgA.js";var f=e(),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 e=s(),g=a(),_=n(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:e.length===0?`Nothing waits on you`:`${e.length} waiting on you, oldest first`}),(0,f.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:e.length===0?(0,f.jsx)(u,{children:`Nothing waits on you. Proposals you may decide, stages that name you, and questions citizens ask you with @user appear here until you answer where they asked.`}):p.map(({kind:n,label:a})=>{let s=e.filter(e=>e.kind===n);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(e=>{if(e.kind===`proposal`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(t,{to:`/proposal/$proposalId`,params:{proposalId:e.proposal.id},className:m,children:(0,f.jsx)(h,{title:o(e.proposal),meta:`proposed by ${v(e.proposal.proposedBy)} ${i(e.since,_)}`})})},e.proposal.id);if(e.kind===`stage`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(t,{to:`/task/$taskId`,params:{taskId:e.task.id},className:m,children:(0,f.jsx)(h,{title:e.task.title,meta:`${e.stage.name}${e.stage.gate?` (gate)`:``} in ${y(e.task.project)} · waiting since ${i(e.since,_)}`})})},e.task.id);let n=`${v(e.message.author)} in ${e.thread===null?`#${e.message.channel}`:e.thread.title} ${i(e.since,_)}`,a=(0,f.jsx)(h,{title:(0,f.jsx)(c,{text:r(e.message.body,160),links:!1}),meta:n}),s=e.thread?.subject;return(0,f.jsx)(`li`,{children:s?.kind===`task`?(0,f.jsx)(t,{to:`/task/$taskId`,params:{taskId:s.id},className:m,children:a}):s?.kind===`proposal`?(0,f.jsx)(t,{to:`/proposal/$proposalId`,params:{proposalId:s.id},className:m,children:a}):e.thread===null?(0,f.jsx)(t,{to:`/c/$`,params:{_splat:e.message.channel},className:m,children:a}):(0,f.jsx)(t,{to:`/thread/$threadId`,params:{threadId:e.thread.id},className:m,children:a})},e.message.id)})})]},n)})})]})}export{g as NeedsYouView};
@@ -1 +1 @@
1
- import{J as e,O as t,Wt as n,n as r,t as i,zn as a}from"./format-B6fjC0_a.js";import{t as o}from"./CliIcon-DbMYJdlU.js";import{_ as s}from"./index-CyCty7a2.js";import{a as c}from"./citizen--bqux6i_.js";var l=a();function u({title:e,aside:t,children:n}){return(0,l.jsxs)(`section`,{className:`border-t border-line pt-4 first:border-t-0 first:pt-0`,children:[(0,l.jsxs)(`h3`,{className:`flex items-baseline justify-between gap-2`,children:[(0,l.jsx)(`span`,{className:`text-section`,children:e}),t]}),(0,l.jsx)(`div`,{className:`mt-2`,children:n})]})}function d({members:r,scope:i}){let a=t(),s=e(a.data?.running??[]),u=e(a.data?.pending??[]);return r.length===0?(0,l.jsx)(`p`,{className:`text-meta`,children:`Nobody yet.`}):(0,l.jsx)(`ul`,{className:`-mx-2`,children:r.map(e=>{let t=s.filter(t=>t.agent===e.name).map(e=>e.scope),r=t.includes(i),a=u.some(t=>t.agent===e.name),d=r?`in a turn here`:t.length>0?`in a turn at ${t.map(c).join(` and `)}`:a?`queued`:`resting`;return(0,l.jsx)(`li`,{children:(0,l.jsxs)(n,{to:`/citizen/$name`,params:{name:e.name},search:r&&i!==`society`?{scope:i}:{},className:`flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-surface-2/50`,children:[(0,l.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center`,children:e.cli===null?null:(0,l.jsx)(o,{cli:e.cli,size:13})}),(0,l.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,l.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-muted`,children:e.role}),(0,l.jsx)(`span`,{className:`shrink-0 text-xs ${t.length>0?`text-emerald-300`:a?`text-amber-300`:`text-fg-muted`}`,children:d})]})},e.name)})})}function f({scope:e,topics:t,now:a}){return t===void 0?(0,l.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):t.length===0?(0,l.jsxs)(`p`,{className:`text-meta`,children:[`No knowledge yet. `,e===`society`?`The steward and you`:`Members`,` write it with write_knowledge.`]}):(0,l.jsx)(`ul`,{className:`-mx-2`,children:t.toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt)).map(t=>(0,l.jsx)(`li`,{children:(0,l.jsxs)(n,{to:`/knowledge/$scope/$topic`,params:{scope:e,topic:t.topic},className:`block rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-2/50`,children:[(0,l.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,l.jsx)(`span`,{className:`text-sm text-fg-primary`,children:t.topic}),(0,l.jsxs)(`span`,{className:`text-meta`,children:[`by `,t.updatedBy,` `,i(t.updatedAt,a)]})]}),(0,l.jsx)(`span`,{className:`mt-0.5 line-clamp-2 block text-sm leading-relaxed text-fg-secondary`,children:(0,l.jsx)(s,{text:r(t.body,240),links:!1})})]})},t.topic))})}export{u as n,f as r,d as t};
1
+ import{O as e,Wn as t,X as n,Yt as r,n as i,t as a}from"./format-CvfmDNoY.js";import{t as o}from"./CliIcon-DVX5iLhG.js";import{_ as s}from"./index-DD3J11PT.js";import{a as c}from"./citizen-BPIJzKdn.js";var l=t();function u({title:e,aside:t,children:n}){return(0,l.jsxs)(`section`,{className:`border-t border-line pt-4 first:border-t-0 first:pt-0`,children:[(0,l.jsxs)(`h3`,{className:`flex items-baseline justify-between gap-2`,children:[(0,l.jsx)(`span`,{className:`text-section`,children:e}),t]}),(0,l.jsx)(`div`,{className:`mt-2`,children:n})]})}function d({members:t,scope:i}){let a=e(),s=n(a.data?.running??[]),u=n(a.data?.pending??[]);return t.length===0?(0,l.jsx)(`p`,{className:`text-meta`,children:`Nobody yet.`}):(0,l.jsx)(`ul`,{className:`-mx-2`,children:t.map(e=>{let t=s.filter(t=>t.agent===e.name).map(e=>e.scope),n=t.includes(i),a=u.some(t=>t.agent===e.name),d=n?`in a turn here`:t.length>0?`in a turn at ${t.map(c).join(` and `)}`:a?`queued`:`resting`;return(0,l.jsx)(`li`,{children:(0,l.jsxs)(r,{to:`/citizen/$name`,params:{name:e.name},search:n&&i!==`society`?{scope:i}:{},className:`flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-surface-2/50`,children:[(0,l.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center`,children:e.cli===null?null:(0,l.jsx)(o,{cli:e.cli,size:13})}),(0,l.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,l.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-muted`,children:e.role}),(0,l.jsx)(`span`,{className:`shrink-0 text-xs ${t.length>0?`text-emerald-300`:a?`text-amber-300`:`text-fg-muted`}`,children:d})]})},e.name)})})}function f({scope:e,topics:t,now:n}){return t===void 0?(0,l.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):t.length===0?(0,l.jsxs)(`p`,{className:`text-meta`,children:[`No knowledge yet. `,e===`society`?`The steward and you`:`Members`,` write it with write_knowledge.`]}):(0,l.jsx)(`ul`,{className:`-mx-2`,children:t.toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt)).map(t=>(0,l.jsx)(`li`,{children:(0,l.jsxs)(r,{to:`/knowledge/$scope/$topic`,params:{scope:e,topic:t.topic},className:`block rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-2/50`,children:[(0,l.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,l.jsx)(`span`,{className:`text-sm text-fg-primary`,children:t.topic}),(0,l.jsxs)(`span`,{className:`text-meta`,children:[`by `,t.updatedBy,` `,a(t.updatedAt,n)]})]}),(0,l.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:(0,l.jsx)(s,{text:i(t.body,240),links:!1})})]})},t.topic))})}export{u as n,f as r,d as t};
@@ -1 +1 @@
1
- import{zn as e}from"./format-B6fjC0_a.js";var t=e();function n({title:e,subtitle:n,leading:r,trailing:i}){return(0,t.jsxs)(`header`,{className:`flex items-center gap-3 border-b border-line px-4 py-3`,children:[r,(0,t.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,t.jsx)(`h2`,{className:`text-heading truncate`,children:e}),n===void 0?null:(0,t.jsx)(`p`,{className:`truncate text-meta`,children:n})]}),i]})}function r({children:e}){return(0,t.jsx)(`p`,{className:`px-4 py-10 text-center text-meta`,"aria-live":`polite`,children:e})}export{r as n,n as t};
1
+ import{Wn as e}from"./format-CvfmDNoY.js";var t=e();function n({title:e,subtitle:n,leading:r,trailing:i}){return(0,t.jsxs)(`header`,{className:`flex items-center gap-3 border-b border-line px-4 py-3`,children:[r,(0,t.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,t.jsx)(`h2`,{className:`text-heading truncate`,children:e}),n===void 0?null:(0,t.jsx)(`p`,{className:`truncate text-meta`,children:n})]}),i]})}function r({children:e}){return(0,t.jsx)(`p`,{className:`px-4 py-10 text-center text-meta`,"aria-live":`polite`,children:e})}export{r as n,n as t};