@uniqbit/mate-core 1.0.0-canary.8 → 1.0.0-canary.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
  2. package/package.json +1 -1
  3. package/src/cli/commands/doctor.ts +17 -0
  4. package/src/cli/commands/vscode/release-vsix.json +2 -2
  5. package/src/create-mate.ts +4 -1
  6. package/src/lib/mcp-manager/resolve.ts +70 -0
  7. package/src/lib/mcp-manager/store.ts +109 -0
  8. package/src/lib/mcp-manager/types.ts +58 -0
  9. package/src/lib/mcp-manager/validate.ts +246 -0
  10. package/src/lib/orchestrator/config-store.ts +30 -7
  11. package/src/lib/orchestrator/engine-floor.ts +16 -4
  12. package/src/lib/orchestrator/engine-guard.ts +7 -1
  13. package/src/lib/orchestrator/types.ts +4 -0
  14. package/src/runtime/workflow/turn.ts +14 -12
  15. package/src/studio.ts +17 -0
  16. package/src/tools/setup/capabilities/mcp-manager.ts +74 -0
  17. package/src/tools/setup/context-services.ts +35 -6
  18. package/src/tools/setup/dynamic-plugins/audiences.ts +3 -2
  19. package/src/tools/setup/engine.ts +55 -3
  20. package/src/tools/setup/plugin.ts +14 -0
  21. package/src/tools/setup/providers/claude-format.ts +39 -2
  22. package/src/tools/setup/providers/claude.ts +10 -0
  23. package/src/tools/setup/providers/opencode-format.ts +13 -3
  24. package/studio-dist/client/assets/{button-amJ3g5oD.js → button-C9SQW3kI.js} +1 -1
  25. package/studio-dist/client/assets/{cn-BQPKiwI4.js → cn-DC80MJV0.js} +1 -1
  26. package/studio-dist/client/assets/{combobox-CJ7aGFid.js → combobox-D7mKYCBb.js} +1 -1
  27. package/studio-dist/client/assets/{companion-view-C_N237bf.js → companion-view-C1F0_jbt.js} +1 -1
  28. package/studio-dist/client/assets/{fields-BAiGkJ5N.js → fields-CEep8IFT.js} +1 -1
  29. package/studio-dist/client/assets/{friction-DqOU59v7.js → friction-D9dBU7WN.js} +1 -1
  30. package/studio-dist/client/assets/getting-started-BDyGvHhc.js +1 -0
  31. package/studio-dist/client/assets/{getting-started-djaQeWlu.js → getting-started-BN4aTpsz.js} +1 -1
  32. package/studio-dist/client/assets/getting-started._topic-B9ajbF4o.js +1 -0
  33. package/studio-dist/client/assets/getting-started.index-CYiBPtb7.js +1 -0
  34. package/studio-dist/client/assets/{graph-BYaD_5Bq.js → graph-ah7ZXfTa.js} +2 -2
  35. package/studio-dist/client/assets/{graph-canvas-ySGKMhmk.js → graph-canvas-Be5qgdDt.js} +1 -1
  36. package/studio-dist/client/assets/guides-CsL0660B.js +1 -0
  37. package/studio-dist/client/assets/{index-Qx7reRPD.js → index-zmRH87D4.js} +3 -3
  38. package/studio-dist/client/assets/{markdown-view-jMiaBTSO.js → markdown-view-dku7MGPn.js} +1 -1
  39. package/studio-dist/client/assets/{panel-C4bf_h2W.js → panel-COgk0vP5.js} +1 -1
  40. package/studio-dist/client/assets/{plugins._service._view-y6f2FDAB.js → plugins._service._view-Cn3WBHab.js} +1 -1
  41. package/studio-dist/client/assets/{prepaint-CKsXyJOR.js → prepaint-BkoDSw5X.js} +1 -1
  42. package/studio-dist/client/assets/{queries-Dfp5deWj.js → queries-CMvC2OkU.js} +1 -1
  43. package/studio-dist/client/assets/{reports-JFSwSueq.js → reports-C_AqLBYH.js} +1 -1
  44. package/studio-dist/client/assets/{routes-BdOWSgzK.js → routes-BokQmHtC.js} +1 -1
  45. package/studio-dist/client/assets/{search-CXosfvYh.js → search-DxidNK2M.js} +1 -1
  46. package/studio-dist/client/assets/{select-BHYYWPhK.js → select-CYFCbHUd.js} +1 -1
  47. package/studio-dist/client/assets/{skills-Bo9FLsBd.js → skills-R3vttWHM.js} +1 -1
  48. package/studio-dist/client/assets/{specs-BrCOjOch.js → specs-Bqd1ajyD.js} +1 -1
  49. package/studio-dist/client/assets/{specs-view-CdE2rlli.js → specs-view-znqFPx9p.js} +1 -1
  50. package/studio-dist/client/assets/{steps-CKUno4lh.js → steps-tVDWn7j6.js} +1 -1
  51. package/studio-dist/client/assets/{store-C3vJq8Wj.js → store-BYnEU33C.js} +1 -1
  52. package/studio-dist/client/assets/studio-ndtFcS2Y.js +100 -0
  53. package/studio-dist/client/assets/{studio-queries-BflKt9va.js → studio-queries-CkUSByy7.js} +1 -1
  54. package/studio-dist/client/assets/{usage-BLsLy0nN.js → usage-Kuhr8dSl.js} +1 -1
  55. package/studio-dist/client/assets/{useAnchoredPopupScrollLock-DC7f8GOp.js → useAnchoredPopupScrollLock-dc_kP4Go.js} +1 -1
  56. package/studio-dist/client/assets/{useMutation-uJUrejsi.js → useMutation-CqtM9COw.js} +1 -1
  57. package/studio-dist/client/assets/{vault-BB1B_OhR.js → vault-CSP8kwRg.js} +1 -1
  58. package/studio-dist/client/assets/{warnings-CqOOGlPD.js → warnings-Cnw99ugO.js} +1 -1
  59. package/studio-dist/client/assets/{workflow-BFzmI-06.js → workflow-BPJAmmZi.js} +1 -1
  60. package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-gVfW5vIV.js → __23tanstack-start-server-fn-resolver-CS3QRY4Q.js} +18 -18
  61. package/studio-dist/server/assets/_tanstack-start-manifest_v.js +58 -58
  62. package/studio-dist/server/assets/{button-D6bvrFmm.js → button-Ct_WeYLc.js} +1 -1
  63. package/studio-dist/server/assets/{cn-FXJAM0KO.js → cn-DWFJaP_9.js} +1 -1
  64. package/studio-dist/server/assets/{combobox-D2MbYV1O.js → combobox-17vO5Uz8.js} +6 -6
  65. package/studio-dist/server/assets/{companion-view-Mf1ANbMb.js → companion-view-JkxnGLlp.js} +2 -2
  66. package/studio-dist/server/assets/{companions-Dr6IpNAb.js → companions-YNLsbnch.js} +1 -1
  67. package/studio-dist/server/assets/{fields-B4mAPETz.js → fields-VytPpqBq.js} +2 -2
  68. package/studio-dist/server/assets/{friction-9a5S1m7U.js → friction-B6osqFSm.js} +8 -8
  69. package/studio-dist/server/assets/{friction-CWOTjpCV.js → friction-BW86PCPM.js} +2 -2
  70. package/studio-dist/server/assets/{getting-started-RU6tYU2Q.js → getting-started-CFHSeX5h.js} +2 -2
  71. package/studio-dist/server/assets/{getting-started._topic-C02HGrC6.js → getting-started._topic-BK2eU6AS.js} +2 -2
  72. package/studio-dist/server/assets/{getting-started.index-EzLRosbb.js → getting-started.index-DZLuXnNO.js} +2 -2
  73. package/studio-dist/server/assets/{graph-CZ2H9Fzr.js → graph-BJVZBevL.js} +8 -8
  74. package/studio-dist/server/assets/{graph-B11ITte0.js → graph-DGZHV-Ek.js} +1 -1
  75. package/studio-dist/server/assets/{graph-canvas-rP5TT14Z.js → graph-canvas-lrNT6jbl.js} +2 -2
  76. package/studio-dist/server/assets/{guides-B8HdeK_C.js → guides-CEwLOZb9.js} +1 -1
  77. package/studio-dist/server/assets/{guides-BGftp4wf.js → guides-_G8Vucsk.js} +1 -1
  78. package/studio-dist/server/assets/{guides.server-DqFQAStf.js → guides.server-ZWFKX2XJ.js} +1 -1
  79. package/studio-dist/server/assets/{markdown-view-CArpV-CS.js → markdown-view-Bmjghg_Z.js} +1 -1
  80. package/studio-dist/server/assets/{panel-DR0iq46J.js → panel-DvRjyil3.js} +4 -4
  81. package/studio-dist/server/assets/{plugins._service._view-n7u2k5dF.js → plugins._service._view-B32LzraG.js} +4 -4
  82. package/studio-dist/server/assets/{prepaint-B28ClcPN.js → prepaint-BEHwKl51.js} +1 -1
  83. package/studio-dist/server/assets/{queries-D-yVP9i0.js → queries-D6Vq0AuZ.js} +1 -1
  84. package/studio-dist/server/assets/{reports-B9k98oE6.js → reports-DDaH5k0H.js} +1 -1
  85. package/studio-dist/server/assets/{reports-C2SmTgqh.js → reports-Dn92pLap.js} +7 -7
  86. package/studio-dist/server/assets/{router-CPt0TAk_.js → router-Bjf4S9tO.js} +25 -25
  87. package/studio-dist/server/assets/{routes-CwH8LEy2.js → routes-B4sNiE0X.js} +8 -8
  88. package/studio-dist/server/assets/{search-b-yQesv3.js → search-DKeJRvg8.js} +1 -1
  89. package/studio-dist/server/assets/{select-C3i6TTX-.js → select-CVHYL7oR.js} +5 -5
  90. package/studio-dist/server/assets/{shell-CagqZZMZ.js → shell-BxbYYaAk.js} +2 -2
  91. package/studio-dist/server/assets/{skills-C21Mg_8-.js → skills-B4-0qpqN.js} +8 -8
  92. package/studio-dist/server/assets/{skills-DGg0mWDM.js → skills-Bj8eOgzR.js} +1 -1
  93. package/studio-dist/server/assets/{specs-DetoMiaB.js → specs-rfMug6qW.js} +4 -4
  94. package/studio-dist/server/assets/{specs-view-CmbfLDwN.js → specs-view-qi1SE1Sl.js} +10 -10
  95. package/studio-dist/server/assets/{steps-D1tYAyWZ.js → steps-rger6HJc.js} +1 -1
  96. package/studio-dist/server/assets/{store-aC-I6f6o.js → store-Dg9T7oWs.js} +1 -1
  97. package/studio-dist/server/assets/{studio-qRvQjRpz.js → studio-D79JzDLc.js} +1347 -0
  98. package/studio-dist/server/assets/{studio-queries-Dqf-3nzj.js → studio-queries-CeFfmIuM.js} +3 -3
  99. package/studio-dist/server/assets/{usage-CS4CBK9D.js → usage-BJgYWRCX.js} +9 -9
  100. package/studio-dist/server/assets/{usage-Cwle9-xY.js → usage-Dw_UQFX-.js} +1 -1
  101. package/studio-dist/server/assets/{useAnchoredPopupScrollLock-BjMNgXv9.js → useAnchoredPopupScrollLock-ciS_sEq3.js} +2 -2
  102. package/studio-dist/server/assets/{useMutation-DpBIuWXt.js → useMutation-DnWK0PhO.js} +2 -2
  103. package/studio-dist/server/assets/{vault-CEBBRLMb.js → vault-BzarssiL.js} +1 -1
  104. package/studio-dist/server/assets/{vault-DVQidlId.js → vault-CvlrLd2H.js} +6 -6
  105. package/studio-dist/server/assets/{views-UgO0Qz_g.js → views-CAxwKHMK.js} +2 -2
  106. package/studio-dist/server/assets/{warnings-C7hgXpdk.js → warnings-BpVCugHm.js} +2 -2
  107. package/studio-dist/server/assets/{workflow-6dZZ1ofw.js → workflow-BdrzcCt8.js} +9 -9
  108. package/studio-dist/server/server.js +2 -2
  109. package/studio-dist/client/assets/getting-started-yp42dj5S.js +0 -1
  110. package/studio-dist/client/assets/getting-started._topic-C9zVXz_m.js +0 -1
  111. package/studio-dist/client/assets/getting-started.index-DWbDKICP.js +0 -1
  112. package/studio-dist/client/assets/guides-D6T6W_jV.js +0 -1
  113. package/studio-dist/client/assets/studio-0ueISxwP.js +0 -100
@@ -1 +1 @@
1
- import{it as e}from"./studio-queries-BflKt9va.js";import{a as t,n,t as r}from"./jsx-runtime-MZURdZre.js";var i=t(n(),1),a=r(),o=new Set(`h1.h2.h3.h4.h5.h6.p.pre.code.span.blockquote.hr.ol.ul.li.div.dl.dt.dd.table.thead.tbody.tr.th.td.strong.em.del.br`.split(`.`));function s(t,n,r){let s=t.c?.map((e,t)=>c(e,t,r)),{a:l}=t;if(t.t===`a`){if(r&&l?.guide){let[t,i]=l.guide.split(`#`);return t&&!/^\/getting-started(?:\/(?:worktrees|vscode))?$/.test(t)?(0,a.jsx)(`span`,{children:s},n):(0,a.jsx)(e,{to:t||`.`,hash:i,search:r,children:s},n)}return l?.note?(0,a.jsx)(e,{to:`/vault`,search:e=>({...e,path:l.note,dir:void 0,mode:void 0}),"data-vault-entry":l.note,children:s},n):l?.href&&/^https?:\/\//i.test(l.href)?(0,a.jsx)(`a`,{href:l.href,target:`_blank`,rel:`noopener noreferrer`,children:s},n):(0,a.jsx)(`span`,{children:s},n)}return t.t===`input`?(0,a.jsx)(`input`,{type:`checkbox`,checked:!!l?.checked,disabled:!0,readOnly:!0,"aria-label":`Task`},n):o.has(t.t)?(r&&l?.id&&s&&s.push((0,a.jsx)(e,{to:`.`,hash:l.id,search:r,className:`guide-anchor`,"aria-label":`Link to ${l.id}`,children:`#`},`anchor`)),(0,i.createElement)(t.t,{key:n,className:l?.className,id:r?l?.id:void 0,tabIndex:r&&l?.id?-1:void 0,start:l?.start,style:l?.align?{textAlign:l.align}:void 0},s&&s.length>0?s:void 0)):(0,a.jsx)(`span`,{children:s},n)}function c(e,t,n){return typeof e==`string`?e:s(e,t,n)}function l({nodes:e,guideSearch:t}){return(0,a.jsx)(`div`,{className:`markdown-body`,children:e.map((e,n)=>c(e,n,t))})}export{l as t};
1
+ import{it as e}from"./studio-queries-CkUSByy7.js";import{a as t,n,t as r}from"./jsx-runtime-MZURdZre.js";var i=t(n(),1),a=r(),o=new Set(`h1.h2.h3.h4.h5.h6.p.pre.code.span.blockquote.hr.ol.ul.li.div.dl.dt.dd.table.thead.tbody.tr.th.td.strong.em.del.br`.split(`.`));function s(t,n,r){let s=t.c?.map((e,t)=>c(e,t,r)),{a:l}=t;if(t.t===`a`){if(r&&l?.guide){let[t,i]=l.guide.split(`#`);return t&&!/^\/getting-started(?:\/(?:worktrees|vscode))?$/.test(t)?(0,a.jsx)(`span`,{children:s},n):(0,a.jsx)(e,{to:t||`.`,hash:i,search:r,children:s},n)}return l?.note?(0,a.jsx)(e,{to:`/vault`,search:e=>({...e,path:l.note,dir:void 0,mode:void 0}),"data-vault-entry":l.note,children:s},n):l?.href&&/^https?:\/\//i.test(l.href)?(0,a.jsx)(`a`,{href:l.href,target:`_blank`,rel:`noopener noreferrer`,children:s},n):(0,a.jsx)(`span`,{children:s},n)}return t.t===`input`?(0,a.jsx)(`input`,{type:`checkbox`,checked:!!l?.checked,disabled:!0,readOnly:!0,"aria-label":`Task`},n):o.has(t.t)?(r&&l?.id&&s&&s.push((0,a.jsx)(e,{to:`.`,hash:l.id,search:r,className:`guide-anchor`,"aria-label":`Link to ${l.id}`,children:`#`},`anchor`)),(0,i.createElement)(t.t,{key:n,className:l?.className,id:r?l?.id:void 0,tabIndex:r&&l?.id?-1:void 0,start:l?.start,style:l?.align?{textAlign:l.align}:void 0},s&&s.length>0?s:void 0)):(0,a.jsx)(`span`,{children:s},n)}function c(e,t,n){return typeof e==`string`?e:s(e,t,n)}function l({nodes:e,guideSearch:t}){return(0,a.jsx)(`div`,{className:`markdown-body`,children:e.map((e,n)=>c(e,n,t))})}export{l as t};
@@ -1 +1 @@
1
- import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{r,t as i}from"./button-amJ3g5oD.js";import{F as a,I as o,L as s,M as c,N as l,P as u,j as d}from"./index-Qx7reRPD.js";import{n as f}from"./fields-BAiGkJ5N.js";import{t as p}from"./cn-BQPKiwI4.js";var m=e(t(),1),h=n();function g(e){return(0,h.jsx)(l,{"data-slot":`sheet`,...e})}var _=o;function v({className:e,wide:t=!1,...n}){return(0,h.jsxs)(u,{children:[(0,h.jsx)(s,{"data-slot":`sheet-overlay`,className:`fixed inset-0 z-30 bg-[color-mix(in_srgb,var(--bg)_45%,transparent)] transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`}),(0,h.jsx)(a,{"data-slot":`sheet-content`,"data-wide":t?``:void 0,className:p(`fixed top-2 right-2 bottom-2 z-30 flex w-[min(560px,calc(100vw-16px))] flex-col overflow-hidden rounded-panel border border-rule bg-surface text-text shadow-float outline-none transition-[transform,width] duration-250 ease-[cubic-bezier(.16,1,.3,1)] data-ending-style:translate-x-[calc(100%+16px)] data-starting-style:translate-x-[calc(100%+16px)] data-wide:w-[min(760px,calc(100vw-16px))]`,e),...n})]})}function y({className:e,...t}){return(0,h.jsx)(c,{"data-slot":`sheet-title`,className:p(`m-0 text-lg font-semibold break-words`,e),...t})}function b({items:e,current:t,onSelect:n,pass:a,wide:o,title:s,children:c}){let l=(0,m.useRef)(null),u=t!==null,p=t===null?-1:e.indexOf(t),b=p>0?e[p-1]:void 0,x=p>=0&&p<e.length-1?e[p+1]:void 0;(0,m.useEffect)(()=>{let e=e=>{let t=e.target;t?.closest&&!t.closest(`[data-slot=sheet-content]`)&&(l.current=t)};return document.addEventListener(`focusin`,e),()=>document.removeEventListener(`focusin`,e)},[]);let S=(0,m.useEffectEvent)(e=>{if(e.metaKey||e.ctrlKey||e.altKey||d(e.target))return;let t=e.key===`ArrowRight`?x:e.key===`ArrowLeft`?b:void 0;t!==void 0&&(e.preventDefault(),n(t))});return(0,m.useEffect)(()=>{if(!u)return;let e=e=>S(e);return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[u]),(0,h.jsx)(g,{open:u,onOpenChange:e=>{e||n(null)},children:(0,h.jsxs)(v,{wide:o,"aria-label":s,finalFocus:()=>!l.current?.isConnected||l.current,initialFocus:()=>document.getElementById(`side-panel-close`),children:[(0,h.jsx)(y,{className:`sr-only`,children:s}),(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-rule py-2.5 pr-3 pl-5`,children:[(0,h.jsxs)(`span`,{className:`mr-auto font-mono text-xs text-muted`,"aria-live":`polite`,children:[p>=0?`${p+1} of ${e.length}`:null,a?` · ${a}`:null]}),(0,h.jsx)(i,{size:`icon-sm`,variant:`ghost`,"aria-label":`Previous`,disabled:b===void 0,onClick:()=>b!==void 0&&n(b),children:(0,h.jsx)(r,{name:`left`})}),(0,h.jsx)(i,{size:`icon-sm`,variant:`ghost`,"aria-label":`Next`,disabled:x===void 0,onClick:()=>x!==void 0&&n(x),children:(0,h.jsx)(r,{name:`right`})}),(0,h.jsx)(_,{id:`side-panel-close`,render:(0,h.jsx)(i,{size:`icon-sm`,variant:`ghost`,"aria-label":`Close`}),children:(0,h.jsx)(r,{name:`close`})})]}),(0,h.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-auto`,children:c}),(0,h.jsxs)(`div`,{className:`flex gap-3.5 border-t border-rule px-5 py-2.5 text-2xs text-muted max-sm:hidden`,children:[(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,h.jsx)(f,{children:`←`}),(0,h.jsx)(f,{children:`→`}),` previous, next`]}),(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,h.jsx)(f,{children:`esc`}),` close`]})]})]})})}function x({kicker:e,title:t,mono:n=!1,children:r}){return(0,h.jsxs)(`div`,{className:`grid gap-1.5 border-b border-rule px-5 pt-4 pb-3.5`,children:[e?(0,h.jsx)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:e}):null,(0,h.jsx)(`h2`,{className:n?`m-0 font-mono text-md font-semibold break-words`:`m-0 text-lg font-semibold`,children:t}),r]})}function S({title:e,aside:t,children:n}){return(0,h.jsxs)(`section`,{className:`grid gap-2.5 border-b border-rule-soft px-5 py-4`,"aria-label":e,children:[(0,h.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 text-sm font-semibold`,children:[e,t?(0,h.jsx)(`span`,{className:`ml-auto font-mono text-2xs font-normal text-muted`,children:t}):null]}),n]})}export{S as n,b as r,x as t};
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{r,t as i}from"./button-C9SQW3kI.js";import{F as a,I as o,L as s,M as c,N as l,P as u,j as d}from"./index-zmRH87D4.js";import{n as f}from"./fields-CEep8IFT.js";import{t as p}from"./cn-DC80MJV0.js";var m=e(t(),1),h=n();function g(e){return(0,h.jsx)(l,{"data-slot":`sheet`,...e})}var _=o;function v({className:e,wide:t=!1,...n}){return(0,h.jsxs)(u,{children:[(0,h.jsx)(s,{"data-slot":`sheet-overlay`,className:`fixed inset-0 z-30 bg-[color-mix(in_srgb,var(--bg)_45%,transparent)] transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`}),(0,h.jsx)(a,{"data-slot":`sheet-content`,"data-wide":t?``:void 0,className:p(`fixed top-2 right-2 bottom-2 z-30 flex w-[min(560px,calc(100vw-16px))] flex-col overflow-hidden rounded-panel border border-rule bg-surface text-text shadow-float outline-none transition-[transform,width] duration-250 ease-[cubic-bezier(.16,1,.3,1)] data-ending-style:translate-x-[calc(100%+16px)] data-starting-style:translate-x-[calc(100%+16px)] data-wide:w-[min(760px,calc(100vw-16px))]`,e),...n})]})}function y({className:e,...t}){return(0,h.jsx)(c,{"data-slot":`sheet-title`,className:p(`m-0 text-lg font-semibold break-words`,e),...t})}function b({items:e,current:t,onSelect:n,pass:a,wide:o,title:s,children:c}){let l=(0,m.useRef)(null),u=t!==null,p=t===null?-1:e.indexOf(t),b=p>0?e[p-1]:void 0,x=p>=0&&p<e.length-1?e[p+1]:void 0;(0,m.useEffect)(()=>{let e=e=>{let t=e.target;t?.closest&&!t.closest(`[data-slot=sheet-content]`)&&(l.current=t)};return document.addEventListener(`focusin`,e),()=>document.removeEventListener(`focusin`,e)},[]);let S=(0,m.useEffectEvent)(e=>{if(e.metaKey||e.ctrlKey||e.altKey||d(e.target))return;let t=e.key===`ArrowRight`?x:e.key===`ArrowLeft`?b:void 0;t!==void 0&&(e.preventDefault(),n(t))});return(0,m.useEffect)(()=>{if(!u)return;let e=e=>S(e);return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[u]),(0,h.jsx)(g,{open:u,onOpenChange:e=>{e||n(null)},children:(0,h.jsxs)(v,{wide:o,"aria-label":s,finalFocus:()=>!l.current?.isConnected||l.current,initialFocus:()=>document.getElementById(`side-panel-close`),children:[(0,h.jsx)(y,{className:`sr-only`,children:s}),(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-rule py-2.5 pr-3 pl-5`,children:[(0,h.jsxs)(`span`,{className:`mr-auto font-mono text-xs text-muted`,"aria-live":`polite`,children:[p>=0?`${p+1} of ${e.length}`:null,a?` · ${a}`:null]}),(0,h.jsx)(i,{size:`icon-sm`,variant:`ghost`,"aria-label":`Previous`,disabled:b===void 0,onClick:()=>b!==void 0&&n(b),children:(0,h.jsx)(r,{name:`left`})}),(0,h.jsx)(i,{size:`icon-sm`,variant:`ghost`,"aria-label":`Next`,disabled:x===void 0,onClick:()=>x!==void 0&&n(x),children:(0,h.jsx)(r,{name:`right`})}),(0,h.jsx)(_,{id:`side-panel-close`,render:(0,h.jsx)(i,{size:`icon-sm`,variant:`ghost`,"aria-label":`Close`}),children:(0,h.jsx)(r,{name:`close`})})]}),(0,h.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-auto`,children:c}),(0,h.jsxs)(`div`,{className:`flex gap-3.5 border-t border-rule px-5 py-2.5 text-2xs text-muted max-sm:hidden`,children:[(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,h.jsx)(f,{children:`←`}),(0,h.jsx)(f,{children:`→`}),` previous, next`]}),(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,h.jsx)(f,{children:`esc`}),` close`]})]})]})})}function x({kicker:e,title:t,mono:n=!1,children:r}){return(0,h.jsxs)(`div`,{className:`grid gap-1.5 border-b border-rule px-5 pt-4 pb-3.5`,children:[e?(0,h.jsx)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:e}):null,(0,h.jsx)(`h2`,{className:n?`m-0 font-mono text-md font-semibold break-words`:`m-0 text-lg font-semibold`,children:t}),r]})}function S({title:e,aside:t,children:n}){return(0,h.jsxs)(`section`,{className:`grid gap-2.5 border-b border-rule-soft px-5 py-4`,"aria-label":e,children:[(0,h.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 text-sm font-semibold`,children:[e,t?(0,h.jsx)(`span`,{className:`ml-auto font-mono text-2xs font-normal text-muted`,children:t}):null]}),n]})}export{S as n,b as r,x as t};
@@ -1 +1 @@
1
- import{lt as e,rt as t,t as n}from"./index-Qx7reRPD.js";import"./studio-0ueISxwP.js";import{S as r,u as i}from"./studio-queries-BflKt9va.js";import{a,n as o,t as s}from"./jsx-runtime-MZURdZre.js";import{t as c}from"./cn-BQPKiwI4.js";var l=a(o(),1),u=s(),d=e=>import(e);async function f(e,t,n,r=d){let i=(await r(t)).mount;if(typeof i!=`function`)throw Error(`the view module has no mount export`);let a=i(e,n);return typeof a==`function`?a:()=>{}}function p({moduleUrl:e,context:n,layout:r=`page`,load:i}){let a=(0,l.useRef)(null),[o,s]=(0,l.useState)(null),{companion:d,apiBase:p,writable:m}=n;return(0,l.useEffect)(()=>{let n=a.current;if(!n)return;let r=null,o=!1;s(null);let c=t()??void 0;return f(n,e,{companion:d,apiBase:p,writable:m,connection:c},i).then(e=>{o?e():r=e},e=>{o||s(e instanceof Error?e.message:String(e))}),()=>{o=!0,r?.(),n.replaceChildren()}},[e,d,p,m,i]),(0,u.jsxs)(`section`,{className:c(`plugin-view min-h-0 flex-1`,r===`workspace`?void 0:`mx-8 max-sm:mx-4`),"data-layout":r,children:[o?(0,u.jsxs)(`p`,{className:`m-0 rounded-card border border-dashed border-rule px-6 py-7 text-muted`,children:[`The view could not load: `,o]}):null,(0,u.jsx)(`div`,{ref:a,"data-plugin-view":e})]})}var m=function(){let{service:t,view:a}=n.useParams(),o=n.useSearch(),{data:s}=e(i(o)),c=s.pluginViews.find(e=>e.service===t&&e.view===a);return c?(0,u.jsx)(p,{moduleUrl:c.moduleUrl,layout:c.layout,context:{companion:s.selected?.digest??null,apiBase:`${r}${t}`,writable:s.writable}}):(0,u.jsx)(`section`,{className:`mx-8 max-sm:mx-4`,children:(0,u.jsx)(`p`,{className:`empty m-0 rounded-card border border-dashed border-rule px-6 py-7 text-muted`,children:`No running service offers this view.`})})};export{m as component};
1
+ import{lt as e,rt as t,t as n}from"./index-zmRH87D4.js";import"./studio-ndtFcS2Y.js";import{S as r,u as i}from"./studio-queries-CkUSByy7.js";import{a,n as o,t as s}from"./jsx-runtime-MZURdZre.js";import{t as c}from"./cn-DC80MJV0.js";var l=a(o(),1),u=s(),d=e=>import(e);async function f(e,t,n,r=d){let i=(await r(t)).mount;if(typeof i!=`function`)throw Error(`the view module has no mount export`);let a=i(e,n);return typeof a==`function`?a:()=>{}}function p({moduleUrl:e,context:n,layout:r=`page`,load:i}){let a=(0,l.useRef)(null),[o,s]=(0,l.useState)(null),{companion:d,apiBase:p,writable:m}=n;return(0,l.useEffect)(()=>{let n=a.current;if(!n)return;let r=null,o=!1;s(null);let c=t()??void 0;return f(n,e,{companion:d,apiBase:p,writable:m,connection:c},i).then(e=>{o?e():r=e},e=>{o||s(e instanceof Error?e.message:String(e))}),()=>{o=!0,r?.(),n.replaceChildren()}},[e,d,p,m,i]),(0,u.jsxs)(`section`,{className:c(`plugin-view min-h-0 flex-1`,r===`workspace`?void 0:`mx-8 max-sm:mx-4`),"data-layout":r,children:[o?(0,u.jsxs)(`p`,{className:`m-0 rounded-card border border-dashed border-rule px-6 py-7 text-muted`,children:[`The view could not load: `,o]}):null,(0,u.jsx)(`div`,{ref:a,"data-plugin-view":e})]})}var m=function(){let{service:t,view:a}=n.useParams(),o=n.useSearch(),{data:s}=e(i(o)),c=s.pluginViews.find(e=>e.service===t&&e.view===a);return c?(0,u.jsx)(p,{moduleUrl:c.moduleUrl,layout:c.layout,context:{companion:s.selected?.digest??null,apiBase:`${r}${t}`,writable:s.writable}}):(0,u.jsx)(`section`,{className:`mx-8 max-sm:mx-4`,children:(0,u.jsx)(`p`,{className:`empty m-0 rounded-card border border-dashed border-rule px-6 py-7 text-muted`,children:`No running service offers this view.`})})};export{m as component};
@@ -1,4 +1,4 @@
1
- import{b as e,x as t}from"./studio-0ueISxwP.js";var n=`mate-studio-theme`,r=`mate-studio-companion`,i=`mate-studio-vault-tree`,a=`mate-studio-rail`,o=`(function () {
1
+ import{b as e,x as t}from"./studio-ndtFcS2Y.js";var n=`mate-studio-theme`,r=`mate-studio-companion`,i=`mate-studio-vault-tree`,a=`mate-studio-rail`,o=`(function () {
2
2
  try {
3
3
  var chosen = localStorage.getItem(${JSON.stringify(n)});
4
4
  if (chosen === "dark" || chosen === "light") {
@@ -1 +1 @@
1
- import{u as e}from"./studio-queries-BflKt9va.js";function t(e,t){return e.query({...t,staleTime:`static`})}async function n(n,r){return r.companion?(await t(n,e({companion:r.companion,studioMode:r.studioMode}))).selected?.digest??null:null}async function r(e,n,r=!1){return r?t(e,n):(t(e,n).catch(()=>{}),null)}export{r as n,n as r,t};
1
+ import{u as e}from"./studio-queries-CkUSByy7.js";function t(e,t){return e.query({...t,staleTime:`static`})}async function n(n,r){return r.companion?(await t(n,e({companion:r.companion,studioMode:r.studioMode}))).selected?.digest??null:null}async function r(e,n,r=!1){return r?t(e,n):(t(e,n).catch(()=>{}),null)}export{r as n,n as r,t};
@@ -1 +1 @@
1
- import{Lr as e,ct as t,it as n,nt as r,r as i,rt as a}from"./button-amJ3g5oD.js";import{a as o,t as s}from"./useSelector-AYcH7lB0.js";import{l as c,st as l,x as u}from"./studio-queries-BflKt9va.js";import{a as d,n as f,t as p}from"./jsx-runtime-MZURdZre.js";import{t as m}from"./cn-BQPKiwI4.js";import{r as h,t as g}from"./panel-C4bf_h2W.js";import{et as _,l as v,nt as y}from"./index-Qx7reRPD.js";import"./studio-0ueISxwP.js";function b(e){let t=o();return s(t.stores.location,l(e,t))}var x=d(f(),1),S=e=>String(e).padStart(2,`0`);function C(e){let t=new Date(e);return`${t.getFullYear()}-${S(t.getMonth()+1)}-${S(t.getDate())} ${S(t.getHours())}:${S(t.getMinutes())}`}function w(e,t){let n=t===`system`?``:`?scheme=${t}`;return`${u}${e}${n}`}var T=p(),E=/(?:^|[#&])report=([0-9a-f]{32})/;function D(e){try{let t=`${location.pathname}${location.search}${e?`#report=${e}`:``}`;history.replaceState(history.state,``,t)}catch{}}function O({report:e,src:t}){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(g,{title:e.title,kicker:(0,T.jsx)(`span`,{children:C(e.createdAt)}),children:(0,T.jsxs)(`a`,{id:`reports-open`,className:`inline-flex items-center gap-1.5 text-sm`,href:t,target:`_blank`,rel:`noopener noreferrer`,children:[(0,T.jsx)(i,{name:`external`,className:`size-3.5`}),` Open in new tab`]})}),(0,T.jsx)(`iframe`,{id:`reports-frame`,className:`min-h-0 w-full flex-1 border-0 bg-page`,title:`Hosted report`,sandbox:`allow-scripts allow-modals`,referrerPolicy:`no-referrer`,src:t},t)]})}function k({companion:i}){let o=e(c(i)),s=_(e=>e.theme),l=y(e=>e.clearReports),u=E.exec(b({select:e=>`#${e.hash}`}))?.[1],[d,f]=(0,x.useState)(void 0);(0,x.useEffect)(l,[l]);let p=o.data??[],g=d===void 0?u??null:d,v=p.find(e=>e.id===g)??null,S=e=>{f(e),D(e)},k=v?w(v.id,s):null;return(0,T.jsxs)(`section`,{className:m(n,`grid content-start gap-3 pb-10`),"data-reports-view":!0,"aria-label":`Hosted reports`,children:[p.length===0?(0,T.jsx)(r,{children:(0,T.jsx)(`span`,{id:`reports-empty`,children:`No hosted reports yet.`})}):(0,T.jsx)(a,{title:`Reports`,count:p.length,hint:`Newest first`,children:(0,T.jsx)(`ul`,{id:`reports-list`,className:`m-0 list-none p-0`,"aria-label":`Reports`,children:p.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,className:m(t,`grid grid-cols-[minmax(0,1fr)_auto]`),"data-report-id":e.id,"aria-current":e.id===v?.id?`true`:void 0,onClick:()=>S(e.id),children:[(0,T.jsx)(`span`,{className:`truncate text-sm`,"data-report-title":!0,children:e.title}),(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted`,"data-report-time":!0,children:C(e.createdAt)})]})},e.id))})}),(0,T.jsx)(h,{items:p.map(e=>e.id),current:v?.id??null,onSelect:S,wide:!0,title:v?`Report ${v.title}`:`Report`,children:v&&k?(0,T.jsx)(O,{report:v,src:k}):null})]})}var A=function(){let{companion:e}=v.useSearch();return e?(0,T.jsx)(k,{companion:e}):null};export{A as component};
1
+ import{Lr as e,ct as t,it as n,nt as r,r as i,rt as a}from"./button-C9SQW3kI.js";import{a as o,t as s}from"./useSelector-AYcH7lB0.js";import{l as c,st as l,x as u}from"./studio-queries-CkUSByy7.js";import{a as d,n as f,t as p}from"./jsx-runtime-MZURdZre.js";import{t as m}from"./cn-DC80MJV0.js";import{r as h,t as g}from"./panel-COgk0vP5.js";import{et as _,l as v,nt as y}from"./index-zmRH87D4.js";import"./studio-ndtFcS2Y.js";function b(e){let t=o();return s(t.stores.location,l(e,t))}var x=d(f(),1),S=e=>String(e).padStart(2,`0`);function C(e){let t=new Date(e);return`${t.getFullYear()}-${S(t.getMonth()+1)}-${S(t.getDate())} ${S(t.getHours())}:${S(t.getMinutes())}`}function w(e,t){let n=t===`system`?``:`?scheme=${t}`;return`${u}${e}${n}`}var T=p(),E=/(?:^|[#&])report=([0-9a-f]{32})/;function D(e){try{let t=`${location.pathname}${location.search}${e?`#report=${e}`:``}`;history.replaceState(history.state,``,t)}catch{}}function O({report:e,src:t}){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(g,{title:e.title,kicker:(0,T.jsx)(`span`,{children:C(e.createdAt)}),children:(0,T.jsxs)(`a`,{id:`reports-open`,className:`inline-flex items-center gap-1.5 text-sm`,href:t,target:`_blank`,rel:`noopener noreferrer`,children:[(0,T.jsx)(i,{name:`external`,className:`size-3.5`}),` Open in new tab`]})}),(0,T.jsx)(`iframe`,{id:`reports-frame`,className:`min-h-0 w-full flex-1 border-0 bg-page`,title:`Hosted report`,sandbox:`allow-scripts allow-modals`,referrerPolicy:`no-referrer`,src:t},t)]})}function k({companion:i}){let o=e(c(i)),s=_(e=>e.theme),l=y(e=>e.clearReports),u=E.exec(b({select:e=>`#${e.hash}`}))?.[1],[d,f]=(0,x.useState)(void 0);(0,x.useEffect)(l,[l]);let p=o.data??[],g=d===void 0?u??null:d,v=p.find(e=>e.id===g)??null,S=e=>{f(e),D(e)},k=v?w(v.id,s):null;return(0,T.jsxs)(`section`,{className:m(n,`grid content-start gap-3 pb-10`),"data-reports-view":!0,"aria-label":`Hosted reports`,children:[p.length===0?(0,T.jsx)(r,{children:(0,T.jsx)(`span`,{id:`reports-empty`,children:`No hosted reports yet.`})}):(0,T.jsx)(a,{title:`Reports`,count:p.length,hint:`Newest first`,children:(0,T.jsx)(`ul`,{id:`reports-list`,className:`m-0 list-none p-0`,"aria-label":`Reports`,children:p.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,className:m(t,`grid grid-cols-[minmax(0,1fr)_auto]`),"data-report-id":e.id,"aria-current":e.id===v?.id?`true`:void 0,onClick:()=>S(e.id),children:[(0,T.jsx)(`span`,{className:`truncate text-sm`,"data-report-title":!0,children:e.title}),(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted`,"data-report-time":!0,children:C(e.createdAt)})]})},e.id))})}),(0,T.jsx)(h,{items:p.map(e=>e.id),current:v?.id??null,onSelect:S,wide:!0,title:v?`Report ${v.title}`:`Report`,children:v&&k?(0,T.jsx)(O,{report:v,src:k}):null})]})}var A=function(){let{companion:e}=v.useSearch();return e?(0,T.jsx)(k,{companion:e}):null};export{A as component};
@@ -1 +1 @@
1
- import{t as e}from"./companion-view-C_N237bf.js";import{at as t,f as n,it as r,m as i}from"./studio-queries-BflKt9va.js";import{a,n as o,t as s}from"./jsx-runtime-MZURdZre.js";import{$ as c,Lr as l,ct as u,et as d,it as f,lt as p,nt as m,ot as h,r as g,rt as _,st as v,t as y,tt as b}from"./button-amJ3g5oD.js";import{t as x}from"./cn-BQPKiwI4.js";import{n as S,r as C,t as w}from"./panel-C4bf_h2W.js";import{t as T}from"./warnings-CqOOGlPD.js";import{t as E}from"./markdown-view-jMiaBTSO.js";import{A as ee,C as D,D as O,E as k,O as A,T as te,f as ne,k as j,w as M}from"./index-Qx7reRPD.js";var N=a(o(),1);function re(e){let t=new Set,n=[];for(let r of e)for(let e of r.specs)t.has(e)||(t.add(e),n.push({capability:e,change:r.name,archivedOn:r.archivedOn}));return n}var P=s(),ie=20,ae=12,F=`openspec/changes/archive`,I=e=>`openspec/specs/${e}/spec.md`,L=x(u,`grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 py-2`);function R({payload:e}){let[t,n]=(0,N.useState)(null),r=e.shipped.slice(0,ie),i=r.find(e=>e.anchor===t)??null;return(0,P.jsxs)(`div`,{className:`analyst-overview`,children:[(0,P.jsx)(T,{warnings:e.warnings}),(0,P.jsx)(`div`,{className:x(f,`@container pb-10`),children:(0,P.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)] items-start gap-3 @max-[760px]:grid-cols-1`,children:[(0,P.jsx)(V,{all:e.shipped.length,shown:r,current:t,onOpen:n}),(0,P.jsx)(U,{shipped:e.shipped})]})}),(0,P.jsx)(C,{items:r.map(e=>e.anchor),current:i?.anchor??null,onSelect:n,title:i?`Shipped change ${i.name}`:`Shipped change`,children:i?(0,P.jsx)(H,{change:i}):null})]})}function z(e){let t=[];for(let n of e){let e=t.at(-1);e?.[0]===n.archivedOn?e[1].push(n):t.push([n.archivedOn,[n]])}return t}function B(e){let t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(`en`,{weekday:`long`,timeZone:`UTC`})}function V({all:e,shown:t,current:n,onOpen:r}){return(0,P.jsx)(_,{title:`Recently shipped`,count:e,hint:e>t.length?`newest ${t.length}`:void 0,children:t.length===0?(0,P.jsx)(`p`,{className:`empty m-0 px-4 py-3 text-sm text-muted`,children:`No shipped changes yet.`}):(0,P.jsx)(`ol`,{className:`analyst-days m-0 list-none p-0`,children:z(t).map(([e,t])=>(0,P.jsxs)(`li`,{className:`border-t border-rule first:border-t-0`,children:[(0,P.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 bg-[color-mix(in_srgb,var(--surface)_45%,transparent)] px-4 pt-2.5 pb-1.5 text-xs font-semibold text-muted`,children:[(0,P.jsx)(`time`,{dateTime:e,className:`font-mono text-text`,children:e}),B(e),(0,P.jsx)(b,{value:t.length})]}),(0,P.jsx)(`ol`,{className:`analyst-list m-0 list-none p-0`,children:t.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:x(u,`grid gap-0.5 py-2`),"aria-current":n===e.anchor?`true`:void 0,onClick:()=>r(e.anchor),children:[(0,P.jsx)(`span`,{className:`analyst-row-title truncate font-mono text-sm`,children:e.name}),(0,P.jsx)(`span`,{className:`truncate text-xs text-muted`,children:e.specs.length===0?`no spec changes`:e.specs.join(`, `)})]})},e.anchor))})]},e))})})}function H({change:e}){let t=`${F}/${e.anchor}`;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{mono:!0,title:e.name,kicker:(0,P.jsxs)(`span`,{children:[`Shipped `,e.archivedOn]})}),(0,P.jsx)(S,{title:`Proposal`,children:e.hasProposal?(0,P.jsxs)(r,{className:`inline-flex items-center gap-2 text-sm`,to:`/vault`,search:e=>({...e,path:`${t}/proposal.md`}),children:[(0,P.jsx)(g,{name:`doc`}),` Read the proposal`]}):(0,P.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`This change has no proposal.`,` `,(0,P.jsx)(r,{to:`/vault`,search:e=>({...e,dir:t}),children:`Open its folder`})]})}),(0,P.jsx)(S,{title:`Specs it changed`,aside:String(e.specs.length),children:e.specs.length===0?(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No spec changed.`}):(0,P.jsx)(`ul`,{className:`m-0 grid list-none gap-1 p-0`,children:e.specs.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(r,{className:`font-mono text-sm`,to:`/vault`,search:t=>({...t,path:I(e)}),children:e})},e))})})]})}function U({shipped:e}){let t=re(e).slice(0,ae);return(0,P.jsx)(_,{title:`Recently changed specs`,hint:(0,P.jsx)(r,{to:`/specs`,search:e=>e,children:`All specs`}),children:t.length===0?(0,P.jsx)(`p`,{className:`empty m-0 px-4 py-3 text-sm text-muted`,children:`No specs changed by shipped changes yet.`}):(0,P.jsx)(`ol`,{className:`analyst-list m-0 list-none p-0`,children:t.map((e,n)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(r,{className:L,to:`/vault`,search:t=>({...t,path:I(e.capability)}),children:[(0,P.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,P.jsx)(`span`,{className:`analyst-row-title truncate font-mono text-sm`,children:e.capability}),(0,P.jsxs)(`span`,{className:`truncate text-xs text-muted`,children:[`by `,e.change]})]}),(0,P.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e.archivedOn===t[n-1]?.archivedOn?null:e.archivedOn})]})},e.capability))})})}var W={accent:`before:bg-accent`,warn:`before:bg-warn`,why:`before:bg-why`,bad:`before:bg-bad`},G={accent:`bg-accent`,warn:`bg-warn`,why:`bg-why`,bad:`bg-bad`},K={accent:`text-text`,warn:`text-warn`,why:`text-why`,bad:`text-bad`};function q({steps:e,current:t,tone:n}){let r=`Step ${t+1} of ${e.length} · ${e[t]}`;return t<0?r=`Saved for later`:t>=e.length&&(r=`Delivered`),(0,P.jsxs)(`div`,{className:`grid gap-2`,role:`group`,"aria-label":`Delivery Path`,children:[(0,P.jsx)(`p`,{className:x(`m-0 text-xs font-semibold`,t>=0?K[n]:`text-muted`),children:r}),(0,P.jsx)(`ol`,{className:`m-0 grid list-none gap-1 p-0`,style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},children:e.map((e,r)=>(0,P.jsx)(`li`,{"aria-current":r===t?`step`:void 0,className:x(`h-1 rounded-full bg-rule`,r<t&&`bg-[color-mix(in_srgb,var(--accent)_55%,var(--border))]`,r===t&&G[n]),children:(0,P.jsx)(`span`,{className:`sr-only`,children:e})},e))})]})}function J({steps:e,current:t,tone:n=`accent`,compact:r=!1}){return r?(0,P.jsx)(q,{steps:e,current:t,tone:n}):(0,P.jsx)(`ol`,{className:`m-0 grid list-none gap-1 p-0`,style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},"aria-label":`Delivery Path`,children:e.map((e,r)=>(0,P.jsx)(`li`,{"aria-current":r===t?`step`:void 0,className:x(`grid gap-1.5 text-2xs text-muted before:h-1 before:rounded-full before:bg-rule before:content-['']`,r<t&&`before:bg-[color-mix(in_srgb,var(--accent)_55%,var(--border))]`,r===t&&`font-semibold text-text`,r===t&&W[n]),children:e},e))})}var oe=`openspec/changes`,Y=e=>`${oe}/${e.name}`,X=`flex w-full min-w-0 items-center gap-2.5 rounded-control border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-surface-soft disabled:cursor-default disabled:hover:bg-transparent`;function se({done:e}){return(0,P.jsx)(`span`,{className:x(`grid size-3.5 flex-none place-items-center rounded-[4px] border`,e?`border-accent bg-accent text-on-accent`:`border-rule bg-page`),"aria-hidden":`true`,children:e?(0,P.jsx)(g,{name:`check`,className:`size-2.5 [stroke-width:2.4]`}):null})}function ce({companion:e,dir:t,onRead:i}){let a=l(n(e,`${t}/specs`));if(a.isPending)return(0,P.jsx)(`p`,{className:`m-0 pl-8 text-xs text-muted`,children:`Listing specs…`});let o=(a.data?.entries??[]).filter(e=>e.kind===`directory`);return a.isError||o.length===0?(0,P.jsx)(`p`,{className:`m-0 pl-8 text-xs text-muted`,children:(0,P.jsx)(r,{to:`/vault`,search:e=>({...e,dir:`${t}/specs`}),children:`Open the specs folder`})}):(0,P.jsx)(`ul`,{className:`m-0 grid list-none gap-0.5 p-0 pl-6`,children:o.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:X,"data-artifact-file":`${e.path}/spec.md`,onClick:()=>i(`${e.path}/spec.md`),children:[(0,P.jsx)(g,{name:`doc`,className:`flex-none text-muted`}),(0,P.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.name})]})},e.path))})}function le(e){return e.declared?e.folder?`folder`:`read`:e.done?e.folder?`per capability`:`read`:`not yet`}function ue({change:e,companion:t,onRead:n}){if(e.artifacts.length===0)return(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No artifacts yet.`});let r=Y(e);return(0,P.jsx)(`ul`,{className:`m-0 -mx-2 grid list-none gap-0.5 p-0`,children:e.artifacts.map(e=>{let i=e.path!==void 0,a=e.status===`done`,o=(a||i)&&t!==void 0,s=e.path===void 0?e.id===`specs`:e.path.endsWith(`/`);return(0,P.jsxs)(`li`,{children:[(0,P.jsxs)(`button`,{type:`button`,className:X,disabled:!o||s,"data-artifact":e.id,onClick:()=>n(e.path??`${r}/${e.id}.md`),children:[i?null:(0,P.jsx)(se,{done:a}),(0,P.jsx)(`span`,{className:a||i?`text-text`:`text-muted`,children:e.id}),(0,P.jsx)(`span`,{className:`ml-auto text-xs text-muted`,children:le({declared:i,done:a,folder:s})}),o&&!s?(0,P.jsx)(g,{name:`right`,className:`text-muted`}):null]}),o&&s&&!i?(0,P.jsx)(ce,{companion:t,dir:r,onRead:n}):null]},e.id)})})}function de({companion:e,path:t}){let n=l(i(e,{path:t})),r=n.data?.open?.markdown;return r?(0,P.jsx)(`div`,{className:`prose-panel`,children:(0,P.jsx)(E,{nodes:r})}):(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:n.isPending?`Loading…`:`The file could not be read.`})}function fe({companion:e,path:t,change:n,onBack:i}){let a=t.slice(Y(n).length+1);return(0,P.jsxs)(`section`,{className:`grid content-start gap-3 px-5 py-4`,"aria-label":`Artifact ${a}`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(y,{size:`sm`,variant:`ghost`,className:`-ml-2`,onClick:i,children:[(0,P.jsx)(g,{name:`left`}),` Artifacts`]}),(0,P.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted`,children:a}),(0,P.jsxs)(r,{className:`ml-auto inline-flex flex-none items-center gap-1.5 text-xs`,to:`/vault`,search:e=>({...e,path:t}),children:[(0,P.jsx)(g,{name:`external`,className:`size-3.5`}),` Open in Vault`]})]}),(0,P.jsx)(de,{companion:e,path:t})]})}var Z=`Awaiting publication`,pe=[],me={"needs-you":`Review or fix before the build goes on`,building:`Some tasks are done; others remain`,ready:`Every task is done`};function Q(e){if(e.valid===!1)return{marker:`issue`,word:`Invalid`};let t=k(e);if(e.planned===!1){let n=e.position?.stage;return n?t===`ready`?{marker:`done`,word:n.label}:{marker:n.kind===`review`?`review`:`build`,word:n.label}:{marker:`idle`,word:e.dropped?`Dropped`:`Not placed`}}return t===`needs-you`?(e.totalTasks??0)===0?{marker:`warn`,word:`No tasks`}:{marker:`review`,word:`Review`}:t===`building`?{marker:`build`,word:M.building}:{marker:`done`,word:`Ready`}}function he({change:e,workflow:t,companion:n,reading:r,onRead:i}){let a=j(e,t),o=O(t),s=A(e),{marker:l,word:u}=Q(e),f=(0,P.jsx)(S,{title:`Artifacts`,aside:e.schemaName,children:(0,P.jsx)(ue,{change:e,companion:n,onRead:i})}),m=k(e)===`needs-you`;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{mono:!0,title:e.name,kicker:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(p,{marker:l,children:u}),(0,P.jsx)(c,{at:e.lastModified,className:`ml-auto`})]}),children:(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:a.situation})}),r&&n?(0,P.jsx)(fe,{companion:n,path:r,change:e,onBack:()=>i(null)}):(0,P.jsxs)(P.Fragment,{children:[m?f:null,(0,P.jsx)(S,{title:`Delivery Path`,aside:a.stage,children:(0,P.jsx)(J,{steps:o.map(e=>e.label),current:o.findIndex(e=>e.id===a.stageId),tone:a.review?`why`:`accent`})}),(0,P.jsxs)(S,{title:`Next step`,children:[(0,P.jsxs)(`p`,{className:`m-0 text-sm`,children:[a.next,`.`]}),(0,P.jsx)(d,{text:a.prompt})]}),e.planned===!1?null:(0,P.jsx)(S,{title:s.unit===`tasks`?`Tasks`:`Plan`,aside:`${s.done}/${s.total}`,children:(0,P.jsx)(v,{...s})}),m?null:f]})]})}function ge({change:e,workflow:t,current:n,onOpen:r}){let{marker:i,word:a}=Q(e),o=j(e,t);return(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:x(u,`grid grid-cols-[minmax(0,1fr)_max-content_150px_72px] @max-[640px]:grid-cols-[minmax(0,1fr)_auto]`),"aria-current":n?`true`:void 0,"data-change":e.name,onClick:r,children:[(0,P.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.name}),(0,P.jsx)(`span`,{className:x(`truncate text-xs`,e.valid===!1?`text-bad`:`text-muted`),children:o.situation})]}),(0,P.jsx)(p,{marker:i,children:a}),(0,P.jsx)(`span`,{className:`@max-[640px]:hidden`,children:e.planned===!1?null:(0,P.jsx)(v,{...A(e)})}),(0,P.jsx)(c,{at:e.lastModified,className:`text-right @max-[640px]:hidden`})]})})}function $({change:e}){return(0,P.jsxs)(`li`,{className:x(u,`grid grid-cols-[minmax(0,1fr)_max-content] hover:bg-transparent`),"data-submitted":e.name,children:[(0,P.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.name}),(0,P.jsxs)(`span`,{className:`truncate text-xs text-muted`,children:[(0,P.jsx)(`span`,{className:e.mine?`font-semibold text-accent`:void 0,children:e.mine?`Yours`:e.author??`Someone else`}),` · ${e.group||`no delivery branch`}`]})]}),e.blocked?(0,P.jsx)(p,{marker:`issue`,children:`Blocked`}):(0,P.jsx)(p,{marker:`idle`,children:`Submitted`})]})}function _e({submitted:e}){return e.length===0?null:(0,P.jsx)(_,{title:Z,count:e.length,hint:`Publish with /mate-publish-artifact once merged`,children:(0,P.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.map(e=>(0,P.jsx)($,{change:e},e.name))})})}function ve(e,t){return[{value:`all`,label:`All`,count:D.reduce((t,n)=>t+e[n].length,0)+t},...D.map(t=>({value:t,label:M[t],count:e[t].length,tone:t===`needs-you`?`warn`:void 0})),...t>0?[{value:`submitted`,label:Z,count:t}]:[]]}function ye({changes:e,submitted:n=pe,selected:r,companion:i,workflow:a}){let o=t(),[s,c]=(0,N.useState)(`all`),[l,u]=(0,N.useState)(!1),[d,p]=(0,N.useState)(null),g=te(e,n),v=ee(g),S=D.filter(e=>s===`all`||s===e),w=S.flatMap(e=>v[e]),T=l?v[`needs-you`]:w,E=g.find(e=>e.name===r)??null,O=d&&d.change===E?.name?d.path:null,k=e=>{e===null&&u(!1),o({to:`.`,search:t=>({...t,change:e??void 0}),replace:!0})};return g.length===0&&n.length===0?(0,P.jsx)(`section`,{className:x(f,`pb-10`),"aria-label":`Changes`,children:(0,P.jsx)(m,{children:`No change is in flight in this companion.`})}):(0,P.jsxs)(`section`,{className:x(f,`@container grid content-start gap-3 pb-10`),"aria-label":`Changes`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(h,{label:`Show changes`,value:s,onChange:c,options:ve(v,n.length)}),v[`needs-you`].length>0?(0,P.jsxs)(y,{variant:`primary`,size:`sm`,className:`ml-auto`,onClick:()=>{u(!0),k(v[`needs-you`][0].name)},children:[`Start review pass`,(0,P.jsx)(b,{value:v[`needs-you`].length})]}):null]}),S.map(e=>v[e].length===0?null:(0,P.jsx)(_,{title:M[e],count:v[e].length,hint:me[e],tone:e===`needs-you`?`warn`:void 0,children:(0,P.jsx)(`ul`,{className:`m-0 list-none p-0`,children:v[e].map(e=>(0,P.jsx)(ge,{change:e,workflow:a,current:e.name===r,onOpen:()=>{u(!1),k(e.name)}},e.name))})},e)),s===`all`||s===`submitted`?(0,P.jsx)(_e,{submitted:n}):null,(0,P.jsx)(C,{items:T.map(e=>e.name),current:E?.name??null,onSelect:k,pass:l?`Needs you`:void 0,wide:O!==null,title:E?`Change ${E.name}`:`Change`,children:E?(0,P.jsx)(he,{change:E,workflow:a,companion:i,reading:O,onRead:e=>p(e?{change:E.name,path:e}:null)}):null})]})}function be({payload:e,selected:t,companion:n}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(T,{warnings:e.warnings}),(0,P.jsx)(ye,{changes:e.changes,submitted:e.submitted,selected:t,companion:n,workflow:e.workflow??void 0})]})}function xe(){let t=ne.useSearch();return(0,P.jsx)(e,{view:`dashboard`,search:t,children:e=>e.studioMode===`analysis`?(0,P.jsx)(R,{payload:{shipped:e.shipped??[],warnings:e.warnings}}):(0,P.jsx)(be,{payload:{changes:e.changes??[],submitted:e.submitted,warnings:e.warnings,workflow:e.workflow},selected:t.change,companion:t.companion})})}export{xe as component};
1
+ import{t as e}from"./companion-view-C1F0_jbt.js";import{at as t,f as n,it as r,m as i}from"./studio-queries-CkUSByy7.js";import{a,n as o,t as s}from"./jsx-runtime-MZURdZre.js";import{$ as c,Lr as l,ct as u,et as d,it as f,lt as p,nt as m,ot as h,r as g,rt as _,st as v,t as y,tt as b}from"./button-C9SQW3kI.js";import{t as x}from"./cn-DC80MJV0.js";import{n as S,r as C,t as w}from"./panel-COgk0vP5.js";import{t as T}from"./warnings-Cnw99ugO.js";import{t as E}from"./markdown-view-dku7MGPn.js";import{A as ee,C as D,D as O,E as k,O as A,T as te,f as ne,k as j,w as M}from"./index-zmRH87D4.js";var N=a(o(),1);function re(e){let t=new Set,n=[];for(let r of e)for(let e of r.specs)t.has(e)||(t.add(e),n.push({capability:e,change:r.name,archivedOn:r.archivedOn}));return n}var P=s(),ie=20,ae=12,F=`openspec/changes/archive`,I=e=>`openspec/specs/${e}/spec.md`,L=x(u,`grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 py-2`);function R({payload:e}){let[t,n]=(0,N.useState)(null),r=e.shipped.slice(0,ie),i=r.find(e=>e.anchor===t)??null;return(0,P.jsxs)(`div`,{className:`analyst-overview`,children:[(0,P.jsx)(T,{warnings:e.warnings}),(0,P.jsx)(`div`,{className:x(f,`@container pb-10`),children:(0,P.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)] items-start gap-3 @max-[760px]:grid-cols-1`,children:[(0,P.jsx)(V,{all:e.shipped.length,shown:r,current:t,onOpen:n}),(0,P.jsx)(U,{shipped:e.shipped})]})}),(0,P.jsx)(C,{items:r.map(e=>e.anchor),current:i?.anchor??null,onSelect:n,title:i?`Shipped change ${i.name}`:`Shipped change`,children:i?(0,P.jsx)(H,{change:i}):null})]})}function z(e){let t=[];for(let n of e){let e=t.at(-1);e?.[0]===n.archivedOn?e[1].push(n):t.push([n.archivedOn,[n]])}return t}function B(e){let t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(`en`,{weekday:`long`,timeZone:`UTC`})}function V({all:e,shown:t,current:n,onOpen:r}){return(0,P.jsx)(_,{title:`Recently shipped`,count:e,hint:e>t.length?`newest ${t.length}`:void 0,children:t.length===0?(0,P.jsx)(`p`,{className:`empty m-0 px-4 py-3 text-sm text-muted`,children:`No shipped changes yet.`}):(0,P.jsx)(`ol`,{className:`analyst-days m-0 list-none p-0`,children:z(t).map(([e,t])=>(0,P.jsxs)(`li`,{className:`border-t border-rule first:border-t-0`,children:[(0,P.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 bg-[color-mix(in_srgb,var(--surface)_45%,transparent)] px-4 pt-2.5 pb-1.5 text-xs font-semibold text-muted`,children:[(0,P.jsx)(`time`,{dateTime:e,className:`font-mono text-text`,children:e}),B(e),(0,P.jsx)(b,{value:t.length})]}),(0,P.jsx)(`ol`,{className:`analyst-list m-0 list-none p-0`,children:t.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:x(u,`grid gap-0.5 py-2`),"aria-current":n===e.anchor?`true`:void 0,onClick:()=>r(e.anchor),children:[(0,P.jsx)(`span`,{className:`analyst-row-title truncate font-mono text-sm`,children:e.name}),(0,P.jsx)(`span`,{className:`truncate text-xs text-muted`,children:e.specs.length===0?`no spec changes`:e.specs.join(`, `)})]})},e.anchor))})]},e))})})}function H({change:e}){let t=`${F}/${e.anchor}`;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{mono:!0,title:e.name,kicker:(0,P.jsxs)(`span`,{children:[`Shipped `,e.archivedOn]})}),(0,P.jsx)(S,{title:`Proposal`,children:e.hasProposal?(0,P.jsxs)(r,{className:`inline-flex items-center gap-2 text-sm`,to:`/vault`,search:e=>({...e,path:`${t}/proposal.md`}),children:[(0,P.jsx)(g,{name:`doc`}),` Read the proposal`]}):(0,P.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`This change has no proposal.`,` `,(0,P.jsx)(r,{to:`/vault`,search:e=>({...e,dir:t}),children:`Open its folder`})]})}),(0,P.jsx)(S,{title:`Specs it changed`,aside:String(e.specs.length),children:e.specs.length===0?(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No spec changed.`}):(0,P.jsx)(`ul`,{className:`m-0 grid list-none gap-1 p-0`,children:e.specs.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(r,{className:`font-mono text-sm`,to:`/vault`,search:t=>({...t,path:I(e)}),children:e})},e))})})]})}function U({shipped:e}){let t=re(e).slice(0,ae);return(0,P.jsx)(_,{title:`Recently changed specs`,hint:(0,P.jsx)(r,{to:`/specs`,search:e=>e,children:`All specs`}),children:t.length===0?(0,P.jsx)(`p`,{className:`empty m-0 px-4 py-3 text-sm text-muted`,children:`No specs changed by shipped changes yet.`}):(0,P.jsx)(`ol`,{className:`analyst-list m-0 list-none p-0`,children:t.map((e,n)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(r,{className:L,to:`/vault`,search:t=>({...t,path:I(e.capability)}),children:[(0,P.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,P.jsx)(`span`,{className:`analyst-row-title truncate font-mono text-sm`,children:e.capability}),(0,P.jsxs)(`span`,{className:`truncate text-xs text-muted`,children:[`by `,e.change]})]}),(0,P.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e.archivedOn===t[n-1]?.archivedOn?null:e.archivedOn})]})},e.capability))})})}var W={accent:`before:bg-accent`,warn:`before:bg-warn`,why:`before:bg-why`,bad:`before:bg-bad`},G={accent:`bg-accent`,warn:`bg-warn`,why:`bg-why`,bad:`bg-bad`},K={accent:`text-text`,warn:`text-warn`,why:`text-why`,bad:`text-bad`};function q({steps:e,current:t,tone:n}){let r=`Step ${t+1} of ${e.length} · ${e[t]}`;return t<0?r=`Saved for later`:t>=e.length&&(r=`Delivered`),(0,P.jsxs)(`div`,{className:`grid gap-2`,role:`group`,"aria-label":`Delivery Path`,children:[(0,P.jsx)(`p`,{className:x(`m-0 text-xs font-semibold`,t>=0?K[n]:`text-muted`),children:r}),(0,P.jsx)(`ol`,{className:`m-0 grid list-none gap-1 p-0`,style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},children:e.map((e,r)=>(0,P.jsx)(`li`,{"aria-current":r===t?`step`:void 0,className:x(`h-1 rounded-full bg-rule`,r<t&&`bg-[color-mix(in_srgb,var(--accent)_55%,var(--border))]`,r===t&&G[n]),children:(0,P.jsx)(`span`,{className:`sr-only`,children:e})},e))})]})}function J({steps:e,current:t,tone:n=`accent`,compact:r=!1}){return r?(0,P.jsx)(q,{steps:e,current:t,tone:n}):(0,P.jsx)(`ol`,{className:`m-0 grid list-none gap-1 p-0`,style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},"aria-label":`Delivery Path`,children:e.map((e,r)=>(0,P.jsx)(`li`,{"aria-current":r===t?`step`:void 0,className:x(`grid gap-1.5 text-2xs text-muted before:h-1 before:rounded-full before:bg-rule before:content-['']`,r<t&&`before:bg-[color-mix(in_srgb,var(--accent)_55%,var(--border))]`,r===t&&`font-semibold text-text`,r===t&&W[n]),children:e},e))})}var oe=`openspec/changes`,Y=e=>`${oe}/${e.name}`,X=`flex w-full min-w-0 items-center gap-2.5 rounded-control border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-surface-soft disabled:cursor-default disabled:hover:bg-transparent`;function se({done:e}){return(0,P.jsx)(`span`,{className:x(`grid size-3.5 flex-none place-items-center rounded-[4px] border`,e?`border-accent bg-accent text-on-accent`:`border-rule bg-page`),"aria-hidden":`true`,children:e?(0,P.jsx)(g,{name:`check`,className:`size-2.5 [stroke-width:2.4]`}):null})}function ce({companion:e,dir:t,onRead:i}){let a=l(n(e,`${t}/specs`));if(a.isPending)return(0,P.jsx)(`p`,{className:`m-0 pl-8 text-xs text-muted`,children:`Listing specs…`});let o=(a.data?.entries??[]).filter(e=>e.kind===`directory`);return a.isError||o.length===0?(0,P.jsx)(`p`,{className:`m-0 pl-8 text-xs text-muted`,children:(0,P.jsx)(r,{to:`/vault`,search:e=>({...e,dir:`${t}/specs`}),children:`Open the specs folder`})}):(0,P.jsx)(`ul`,{className:`m-0 grid list-none gap-0.5 p-0 pl-6`,children:o.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:X,"data-artifact-file":`${e.path}/spec.md`,onClick:()=>i(`${e.path}/spec.md`),children:[(0,P.jsx)(g,{name:`doc`,className:`flex-none text-muted`}),(0,P.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.name})]})},e.path))})}function le(e){return e.declared?e.folder?`folder`:`read`:e.done?e.folder?`per capability`:`read`:`not yet`}function ue({change:e,companion:t,onRead:n}){if(e.artifacts.length===0)return(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No artifacts yet.`});let r=Y(e);return(0,P.jsx)(`ul`,{className:`m-0 -mx-2 grid list-none gap-0.5 p-0`,children:e.artifacts.map(e=>{let i=e.path!==void 0,a=e.status===`done`,o=(a||i)&&t!==void 0,s=e.path===void 0?e.id===`specs`:e.path.endsWith(`/`);return(0,P.jsxs)(`li`,{children:[(0,P.jsxs)(`button`,{type:`button`,className:X,disabled:!o||s,"data-artifact":e.id,onClick:()=>n(e.path??`${r}/${e.id}.md`),children:[i?null:(0,P.jsx)(se,{done:a}),(0,P.jsx)(`span`,{className:a||i?`text-text`:`text-muted`,children:e.id}),(0,P.jsx)(`span`,{className:`ml-auto text-xs text-muted`,children:le({declared:i,done:a,folder:s})}),o&&!s?(0,P.jsx)(g,{name:`right`,className:`text-muted`}):null]}),o&&s&&!i?(0,P.jsx)(ce,{companion:t,dir:r,onRead:n}):null]},e.id)})})}function de({companion:e,path:t}){let n=l(i(e,{path:t})),r=n.data?.open?.markdown;return r?(0,P.jsx)(`div`,{className:`prose-panel`,children:(0,P.jsx)(E,{nodes:r})}):(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:n.isPending?`Loading…`:`The file could not be read.`})}function fe({companion:e,path:t,change:n,onBack:i}){let a=t.slice(Y(n).length+1);return(0,P.jsxs)(`section`,{className:`grid content-start gap-3 px-5 py-4`,"aria-label":`Artifact ${a}`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(y,{size:`sm`,variant:`ghost`,className:`-ml-2`,onClick:i,children:[(0,P.jsx)(g,{name:`left`}),` Artifacts`]}),(0,P.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted`,children:a}),(0,P.jsxs)(r,{className:`ml-auto inline-flex flex-none items-center gap-1.5 text-xs`,to:`/vault`,search:e=>({...e,path:t}),children:[(0,P.jsx)(g,{name:`external`,className:`size-3.5`}),` Open in Vault`]})]}),(0,P.jsx)(de,{companion:e,path:t})]})}var Z=`Awaiting publication`,pe=[],me={"needs-you":`Review or fix before the build goes on`,building:`Some tasks are done; others remain`,ready:`Every task is done`};function Q(e){if(e.valid===!1)return{marker:`issue`,word:`Invalid`};let t=k(e);if(e.planned===!1){let n=e.position?.stage;return n?t===`ready`?{marker:`done`,word:n.label}:{marker:n.kind===`review`?`review`:`build`,word:n.label}:{marker:`idle`,word:e.dropped?`Dropped`:`Not placed`}}return t===`needs-you`?(e.totalTasks??0)===0?{marker:`warn`,word:`No tasks`}:{marker:`review`,word:`Review`}:t===`building`?{marker:`build`,word:M.building}:{marker:`done`,word:`Ready`}}function he({change:e,workflow:t,companion:n,reading:r,onRead:i}){let a=j(e,t),o=O(t),s=A(e),{marker:l,word:u}=Q(e),f=(0,P.jsx)(S,{title:`Artifacts`,aside:e.schemaName,children:(0,P.jsx)(ue,{change:e,companion:n,onRead:i})}),m=k(e)===`needs-you`;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{mono:!0,title:e.name,kicker:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(p,{marker:l,children:u}),(0,P.jsx)(c,{at:e.lastModified,className:`ml-auto`})]}),children:(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:a.situation})}),r&&n?(0,P.jsx)(fe,{companion:n,path:r,change:e,onBack:()=>i(null)}):(0,P.jsxs)(P.Fragment,{children:[m?f:null,(0,P.jsx)(S,{title:`Delivery Path`,aside:a.stage,children:(0,P.jsx)(J,{steps:o.map(e=>e.label),current:o.findIndex(e=>e.id===a.stageId),tone:a.review?`why`:`accent`})}),(0,P.jsxs)(S,{title:`Next step`,children:[(0,P.jsxs)(`p`,{className:`m-0 text-sm`,children:[a.next,`.`]}),(0,P.jsx)(d,{text:a.prompt})]}),e.planned===!1?null:(0,P.jsx)(S,{title:s.unit===`tasks`?`Tasks`:`Plan`,aside:`${s.done}/${s.total}`,children:(0,P.jsx)(v,{...s})}),m?null:f]})]})}function ge({change:e,workflow:t,current:n,onOpen:r}){let{marker:i,word:a}=Q(e),o=j(e,t);return(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:x(u,`grid grid-cols-[minmax(0,1fr)_max-content_150px_72px] @max-[640px]:grid-cols-[minmax(0,1fr)_auto]`),"aria-current":n?`true`:void 0,"data-change":e.name,onClick:r,children:[(0,P.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.name}),(0,P.jsx)(`span`,{className:x(`truncate text-xs`,e.valid===!1?`text-bad`:`text-muted`),children:o.situation})]}),(0,P.jsx)(p,{marker:i,children:a}),(0,P.jsx)(`span`,{className:`@max-[640px]:hidden`,children:e.planned===!1?null:(0,P.jsx)(v,{...A(e)})}),(0,P.jsx)(c,{at:e.lastModified,className:`text-right @max-[640px]:hidden`})]})})}function $({change:e}){return(0,P.jsxs)(`li`,{className:x(u,`grid grid-cols-[minmax(0,1fr)_max-content] hover:bg-transparent`),"data-submitted":e.name,children:[(0,P.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.name}),(0,P.jsxs)(`span`,{className:`truncate text-xs text-muted`,children:[(0,P.jsx)(`span`,{className:e.mine?`font-semibold text-accent`:void 0,children:e.mine?`Yours`:e.author??`Someone else`}),` · ${e.group||`no delivery branch`}`]})]}),e.blocked?(0,P.jsx)(p,{marker:`issue`,children:`Blocked`}):(0,P.jsx)(p,{marker:`idle`,children:`Submitted`})]})}function _e({submitted:e}){return e.length===0?null:(0,P.jsx)(_,{title:Z,count:e.length,hint:`Publish with /mate-publish-artifact once merged`,children:(0,P.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.map(e=>(0,P.jsx)($,{change:e},e.name))})})}function ve(e,t){return[{value:`all`,label:`All`,count:D.reduce((t,n)=>t+e[n].length,0)+t},...D.map(t=>({value:t,label:M[t],count:e[t].length,tone:t===`needs-you`?`warn`:void 0})),...t>0?[{value:`submitted`,label:Z,count:t}]:[]]}function ye({changes:e,submitted:n=pe,selected:r,companion:i,workflow:a}){let o=t(),[s,c]=(0,N.useState)(`all`),[l,u]=(0,N.useState)(!1),[d,p]=(0,N.useState)(null),g=te(e,n),v=ee(g),S=D.filter(e=>s===`all`||s===e),w=S.flatMap(e=>v[e]),T=l?v[`needs-you`]:w,E=g.find(e=>e.name===r)??null,O=d&&d.change===E?.name?d.path:null,k=e=>{e===null&&u(!1),o({to:`.`,search:t=>({...t,change:e??void 0}),replace:!0})};return g.length===0&&n.length===0?(0,P.jsx)(`section`,{className:x(f,`pb-10`),"aria-label":`Changes`,children:(0,P.jsx)(m,{children:`No change is in flight in this companion.`})}):(0,P.jsxs)(`section`,{className:x(f,`@container grid content-start gap-3 pb-10`),"aria-label":`Changes`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(h,{label:`Show changes`,value:s,onChange:c,options:ve(v,n.length)}),v[`needs-you`].length>0?(0,P.jsxs)(y,{variant:`primary`,size:`sm`,className:`ml-auto`,onClick:()=>{u(!0),k(v[`needs-you`][0].name)},children:[`Start review pass`,(0,P.jsx)(b,{value:v[`needs-you`].length})]}):null]}),S.map(e=>v[e].length===0?null:(0,P.jsx)(_,{title:M[e],count:v[e].length,hint:me[e],tone:e===`needs-you`?`warn`:void 0,children:(0,P.jsx)(`ul`,{className:`m-0 list-none p-0`,children:v[e].map(e=>(0,P.jsx)(ge,{change:e,workflow:a,current:e.name===r,onOpen:()=>{u(!1),k(e.name)}},e.name))})},e)),s===`all`||s===`submitted`?(0,P.jsx)(_e,{submitted:n}):null,(0,P.jsx)(C,{items:T.map(e=>e.name),current:E?.name??null,onSelect:k,pass:l?`Needs you`:void 0,wide:O!==null,title:E?`Change ${E.name}`:`Change`,children:E?(0,P.jsx)(he,{change:E,workflow:a,companion:i,reading:O,onRead:e=>p(e?{change:E.name,path:e}:null)}):null})]})}function be({payload:e,selected:t,companion:n}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(T,{warnings:e.warnings}),(0,P.jsx)(ye,{changes:e.changes,submitted:e.submitted,selected:t,companion:n,workflow:e.workflow??void 0})]})}function xe(){let t=ne.useSearch();return(0,P.jsx)(e,{view:`dashboard`,search:t,children:e=>e.studioMode===`analysis`?(0,P.jsx)(R,{payload:{shipped:e.shipped??[],warnings:e.warnings}}):(0,P.jsx)(be,{payload:{changes:e.changes??[],submitted:e.submitted,warnings:e.warnings,workflow:e.workflow},selected:t.change,companion:t.companion})})}export{xe as component};
@@ -1 +1 @@
1
- import{C as e,D as t,O as n,_ as r,b as i,g as a,k as o,v as s,x as c}from"./studio-0ueISxwP.js";var l=[7,30,90];function u(e){return l.find(t=>String(t)===String(e))}var d=[`repeats`,`recent`],f=(e,t)=>e.find(e=>e===t);function p(o){let c={};typeof o.companion==`string`&&i.test(o.companion)&&(c.companion=o.companion);let l=new URLSearchParams;o.studioMode!==void 0&&l.set(t,String(o.studioMode)),typeof o.role==`string`&&l.set(e,o.role);let p=n(l);p&&(c.studioMode=p);let m=Number(o.usageDays);/^\d+$/.test(String(o.usageDays))&&Number.isInteger(m)&&m>=1&&m<=365&&(c.usageDays=m),typeof o.usageRepository==`string`&&/^[a-zA-Z0-9_-]{1,64}$/.test(o.usageRepository)&&(c.usageRepository=o.usageRepository);let h=u(o.frictionDays);h&&(c.frictionDays=h);let g=f(r,o.frictionState);g&&(c.frictionState=g);let _=f(s,o.frictionType);_&&(c.frictionType=_);let v=f(a,o.frictionKind);v&&(c.frictionKind=v);let y=f(d,o.frictionSort);return y&&(c.frictionSort=y),c}function m(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return String(e).trim()||void 0}function h(e){let t=m(e.q),n=m(e.repo),r=m(e.area);return{...t?{q:t}:{},...n?{repo:n}:{},...r?{area:r}:{}}}function g(n,r,i,a){let s=new URLSearchParams(r),l=i===void 0||o(a).includes(i);if(s.get(`studioMode`)===a&&!s.has(`role`)&&l)return null;if(!l){let e=new URLSearchParams,n=s.get(c);return n!==null&&e.set(c,n),e.set(t,a),`/?${e}`}return s.delete(e),s.set(t,a),`${n}?${s}`}export{l as a,p as i,f as n,h as r,g as t};
1
+ import{C as e,D as t,O as n,_ as r,b as i,g as a,k as o,v as s,x as c}from"./studio-ndtFcS2Y.js";var l=[7,30,90];function u(e){return l.find(t=>String(t)===String(e))}var d=[`repeats`,`recent`],f=(e,t)=>e.find(e=>e===t);function p(o){let c={};typeof o.companion==`string`&&i.test(o.companion)&&(c.companion=o.companion);let l=new URLSearchParams;o.studioMode!==void 0&&l.set(t,String(o.studioMode)),typeof o.role==`string`&&l.set(e,o.role);let p=n(l);p&&(c.studioMode=p);let m=Number(o.usageDays);/^\d+$/.test(String(o.usageDays))&&Number.isInteger(m)&&m>=1&&m<=365&&(c.usageDays=m),typeof o.usageRepository==`string`&&/^[a-zA-Z0-9_-]{1,64}$/.test(o.usageRepository)&&(c.usageRepository=o.usageRepository);let h=u(o.frictionDays);h&&(c.frictionDays=h);let g=f(r,o.frictionState);g&&(c.frictionState=g);let _=f(s,o.frictionType);_&&(c.frictionType=_);let v=f(a,o.frictionKind);v&&(c.frictionKind=v);let y=f(d,o.frictionSort);return y&&(c.frictionSort=y),c}function m(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return String(e).trim()||void 0}function h(e){let t=m(e.q),n=m(e.repo),r=m(e.area);return{...t?{q:t}:{},...n?{repo:n}:{},...r?{area:r}:{}}}function g(n,r,i,a){let s=new URLSearchParams(r),l=i===void 0||o(a).includes(i);if(s.get(`studioMode`)===a&&!s.has(`role`)&&l)return null;if(!l){let e=new URLSearchParams,n=s.get(c);return n!==null&&e.set(c,n),e.set(t,a),`/?${e}`}return s.delete(e),s.set(t,a),`${n}?${s}`}export{l as a,p as i,f as n,h as r,g as t};
@@ -1 +1 @@
1
- import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{$n as r,Ar as i,Bn as a,Dn as o,Dr as s,Dt as c,Er as l,Fn as u,G as d,H as f,Ir as p,L as m,M as h,Mr as g,Nn as _,Nr as v,Or as y,Pn as b,Qt as x,S,T as C,Tn as w,V as T,W as E,Wn as D,Xt as O,Y as k,a as A,ar as j,cn as M,dn as N,er as P,f as F,gr as I,ht as L,ir as R,kn as ee,kr as z,kt as B,l as V,mt as te,nr as H,or as U,pt as ne,q as re,qn as ie,qt as ae,r as oe,rr as se,sr as W,tn as ce,un as le,vn as G,w as K,x as ue}from"./button-amJ3g5oD.js";import{t as q}from"./cn-BQPKiwI4.js";import{_ as J,a as de,c as fe,d as pe,g as Y,l as me,m as he,o as ge,s as _e,u as ve,v as ye}from"./fields-BAiGkJ5N.js";import{S as be,_ as xe,a as Se,b as Ce,c as we,d as Te,f as Ee,g as De,h as Oe,l as ke,m as Ae,n as je,p as Me,s as Ne,t as Pe,u as Fe,x as Ie,y as Le}from"./useAnchoredPopupScrollLock-DC7f8GOp.js";import{at as Re,ct as ze,ot as Be,st as Ve}from"./index-Qx7reRPD.js";var X=e(t(),1);function He(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=W(s),p=e.useState(`open`),m=k(),h=X.useRef(``),g=X.useRef(d??i??-1),_=X.useRef(null),v=W(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!c(n)||n?.matches(`:disabled`)?!1:o==null||!B(y,e,o)}function l(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let v=n.current;if(h.current.length>0&&e.key===` `&&(x(e),f?.(!0)),h.current.length>0&&h.current[0]!==` `&&l(v,h.current)===-1&&e.key!==` `&&f?.(!1),v==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(x(e),f?.(!0));let b=h.current===``;b&&(g.current=d??i??-1),v.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(u,()=>{h.current=``,g.current=_.current,f?.(!1)});let S=((b?d??i??-1:g.current)??0)+1,C=l(v,h.current,S);C===-1?e.key!==` `&&(h.current=``,f?.(!1)):(a?.(C,e),_.current=C)}),b=W(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);w(r,n)||w(i,n)||(m.clear(),h.current=``,g.current=_.current,f?.(!1))});U(()=>{(p||d===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,f?.(!1)))},[p,d,m,f]);let S=X.useMemo(()=>({onKeyDown:v,onBlur:b}),[v,b]);return X.useMemo(()=>l?{reference:S,floating:S}:{},[l,S])}function Ue(e){let[t,n]=X.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var Z=n(),We=5;function Q(e,t){let n=Ge(t);return e.clientX>=n.left-We&&e.clientX<=n.right+We&&e.clientY>=n.top-We&&e.clientY<=n.bottom+We}function Ge(e){let t=e.getBoundingClientRect(),n=I(e);if(o)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=parseFloat(i.width)||0,l=parseFloat(i.height)||0,u=Math.max(t.width,a,c),d=Math.max(t.height,s,l),f=u-t.width,p=d-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-p/2,bottom:t.bottom+p/2}}function Ke(e,t){return e??t}var qe=X.createContext(void 0),Je=X.createContext(void 0);function $(){let e=X.useContext(qe);if(e===void 0)throw Error(j(60));return e}function Ye(){let e=X.useContext(Je);if(e===void 0)throw Error(j(61));return e}var Xe={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Fe(t,r)!==``},hasNullItemLabel:(e,t)=>t?Se(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>Te(t,e,n)):Te(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function Ze(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Qe(e,t){return Math.max(0,e-t)}function $e(e,t){if(t<=0)return 0;let n=Ze(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function et(e){let{id:t,value:n,defaultValue:r=null,onValueChange:o,open:c,defaultOpen:l=!1,onOpenChange:u,name:m,form:h,autoComplete:b,disabled:x=!1,readOnly:S=!1,required:w=!1,modal:E=!0,actionsRef:D,inputRef:O,onOpenChangeComplete:k,items:j,multiple:M=!1,itemToStringLabel:N,itemToStringValue:I,isItemEqualToValue:L=Ee,highlightItemOnHover:R=!0,children:ee}=e,{clearErrors:B}=ve(),{setDirty:te,setTouched:H,setFocused:ne,validityData:re,setFilled:ae,name:oe,disabled:se,validation:ce,validationMode:le}=he(),G=fe({id:t}),K=se||x,q=oe??m,[J,de]=p({controlled:n,default:M?r??y:r,name:`Select`,state:`value`}),[Y,me]=p({controlled:c,default:l,name:`Select`,state:`open`}),ge=X.useRef([]),ye=X.useRef([]),xe=X.useRef(null),Se=X.useRef(null),we=X.useRef(0),Te=X.useRef(null),De=X.useRef([]),Me=X.useRef(!1),Ne=X.useRef(null),Pe=X.useRef(null),Re=X.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ze=X.useRef(!1),Be=X.useRef(J),{openMethod:Ve,triggerProps:We}=je(Y),Q=v(()=>new A({id:G,labelId:void 0,modal:E,multiple:M,disabled:K,readOnly:S,required:w,highlightItemOnHover:R,itemToStringLabel:N,itemToStringValue:I,isItemEqualToValue:L,value:J,open:Y,mounted:Y,transitionStatus:void 0,items:j,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:z,triggerProps:z,itemRoot:{props:z,multiple:M,disabled:K,readOnly:S,isItemEqualToValue:L},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:i,setOpen:i,handleScrollArrowVisibility:i,onOpenChangeComplete:i,listRef:ge,popupRef:xe,scrollHandlerRef:Se,scrollArrowsMountedCountRef:we,valueRef:Te,valuesRef:De,labelsRef:ye,typingRef:Me,selectionRef:Re,firstItemTextRef:Ne,selectedItemTextRef:Pe,alignItemWithTriggerActiveRef:ze,initialValueRef:Be},Xe)).current,[Ge,Ke]=X.useState(!1),{mounted:$,transitionStatus:Ye,forceUnmount:Ze}=ue({open:Y,ref:xe,preventUnmountOnClose:Ge,setPreventUnmountOnClose:Ke,onUnmount(){Q.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),k?.(!1)}}),et=Q.useState(`activeIndex`),tt=Q.useState(`selectedIndex`),nt=Q.useState(`triggerElement`),rt=Q.useState(`positionerElement`),it=Ue(Ve),at=Ve??it,ot=X.useMemo(()=>M?``:Fe(J,I),[M,J,I]),st=X.useMemo(()=>M&&Array.isArray(J)?J.map(e=>Fe(e,I)):Fe(J,I),[M,J,I]),ct=d(nt),lt=W(()=>st);pe(ct,G,J,lt,!K,m);let ut=M?Array.isArray(J)&&J.length>0:J!=null&&ot!==``;U(()=>{ae(ut)},[ut,ae]),U(function(){let e=Ae(De.current,J,L,M);e===null&&(Pe.current=null),Y||Q.set(`selectedIndex`,e)},[M,Y,J,L,Q]),_e(J,()=>{B(q),te(Oe(J,re.initialValue,L)),ce.change(J)});let dt=W((e,t)=>{let n=t,r=F(n);u?.(e,n),t.isCanceled||(e||Ke(r()),me(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(H(!0),ne(!1),le===`onBlur`&&ce.commit(J)))});X.useImperativeHandle(D,()=>({unmount:Ze,close:()=>{Q.state.open&&dt(!1,P(a))}}),[Ze,dt,Q]);let ft=W((e,t)=>{o?.(e,t),t.isCanceled||de(e)}),pt=W(e=>{let t=Qe(e.scrollHeight,e.clientHeight),n=$e(e.scrollTop,t),r=n>0,i=n<t;Q.set(`scrollUpArrowVisible`,r),Q.set(`scrollDownArrowVisible`,i)}),mt=Ie({open:Y,onOpenChange:dt,elements:{reference:nt,floating:rt}}),ht=be(mt,{enabled:!K,event:`mousedown`}),gt=C(mt),_t=Ce(mt,{enabled:!K,listRef:ge,activeIndex:et,selectedIndex:tt,disabledIndices:y,onNavigate(e){(e!==null||Y)&&Q.set(`activeIndex`,e)},focusItemOnHover:R}),vt=He(mt,{enabled:!K&&(Y||!S&&!M),listRef:ye,activeIndex:et,selectedIndex:tt,disabledIndices:e=>_(ge.current[e]),onMatch(e){Y?Q.set(`activeIndex`,e):ft(De.current[e],P(ie))},onTyping(e){Me.current=e}}),yt=X.useMemo(()=>s(vt.reference,_t.reference,gt.reference,ht.reference,We),[ht.reference,vt.reference,_t.reference,gt.reference,We]),bt=X.useMemo(()=>s(V,vt.floating,_t.floating,gt.floating),[vt.floating,_t.floating,gt.floating]),xt=_t.item??z,St=X.useMemo(()=>({props:xt,multiple:M,disabled:K,readOnly:S,isItemEqualToValue:L}),[xt,M,K,S,L]);Q.useContextCallback(`setValue`,ft),Q.useContextCallback(`setOpen`,dt),Q.useContextCallback(`handleScrollArrowVisibility`,pt),Q.useContextCallback(`onOpenChangeComplete`,k),Le(()=>{Q.update({popupProps:bt,triggerProps:yt,itemRoot:St})}),Q.useSyncedValues({id:G,modal:E,multiple:M,disabled:K,readOnly:S,required:w,highlightItemOnHover:R,value:J,open:Y,mounted:$,transitionStatus:Ye,popupProps:bt,triggerProps:yt,itemRoot:St,items:j,itemToStringLabel:N,itemToStringValue:I,isItemEqualToValue:L,openMethod:at});let Ct=g(O,ce.inputRef),wt=M?void 0:q,Tt=X.useMemo(()=>!M||!Array.isArray(J)||!q?null:J.map(e=>{let t=Fe(e,I);return(0,Z.jsx)(`input`,{type:`hidden`,form:h,name:q,value:t,disabled:K},t)}),[M,J,h,q,I,K]);return(0,Z.jsxs)(qe.Provider,{value:Q,children:[(0,Z.jsx)(Je.Provider,{value:mt,children:ee}),(0,Z.jsx)(`input`,{...ce.getValidationProps(K,{onFocus(){Q.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||K||S)return;let t=e.currentTarget.value,n=P(ie,e.nativeEvent);function r(){if(M)return;let e=t.toLowerCase(),r=De.current.findIndex(t=>Fe(t,I).toLowerCase()===e||ke(t,N).toLowerCase()===e);r===-1&&(r=De.current.findIndex((t,n)=>{let r=ye.current[n];return r!=null&&r.toLowerCase()===e}));let i=De.current[r];i!=null&&ft(i,n)}Q.set(`forceMount`,!0),queueMicrotask(r)}}),id:G&&wt==null?`${G}-hidden-input`:void 0,form:h,name:wt,autoComplete:b,value:ot,disabled:K,required:w&&!(M&&ut),readOnly:S,ref:Ct,style:q?f:T,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tt]})}var tt=`data-popup-side`,nt=400,rt={...le,...Y,popupSide:e=>e?{[tt]:e}:null,value:()=>null},it=X.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:c,...f}=e,{setTouched:p,validationMode:m,validation:h,state:g,disabled:_}=he(),{labelId:v}=me(),y=$(),b=y.useState(`readOnly`),x=y.useState(`required`),S=y.useState(`disabled`),C=_||S||a,T=y.useState(`open`),E=y.useState(`mounted`),D=y.useState(`value`),O=y.useState(`triggerProps`),A=y.useState(`positionerElement`),j=y.useState(`listElement`),M=y.useState(`popupSide`),N=y.useState(`id`),F=y.useState(`labelId`),I=y.useState(`hasSelectedValue`),L=E&&A?M:null,ee=i??N,z=Ke(v,F);fe({id:i});let B=d(A),V=X.useRef(null),te=ge(C,V),{getButtonProps:H,buttonRef:U}=se({disabled:C,native:o}),ne=y.useStateSetter(`triggerElement`),re=k(),ae=k(),oe=k();X.useEffect(()=>{if(T)return oe.start(nt,()=>{y.context.selectionRef.current.allowUnselectedMouseUp=!0,y.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{oe.clear()};y.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},ae.clear()},[T,y,ae,oe]);let W=s(O,{id:ee,role:`combobox`,"aria-expanded":T,"aria-haspopup":`listbox`,"aria-controls":T?j?.id??ce(A)?.id:void 0,"aria-labelledby":z,"aria-readonly":b||void 0,"aria-required":x||void 0,tabIndex:C?-1:0,onFocus(e){te(!0),T&&y.context.alignItemWithTriggerActiveRef.current&&y.context.setOpen(!1,P(ie,e.nativeEvent)),re.start(0,()=>{y.set(`forceMount`,!0)})},onBlur(e){w(A,e.relatedTarget)||(p(!0),te(!1),m===`onBlur`&&h.commit(D))},onMouseDown(e){if(T)return;let t=R(e.currentTarget);function n(e){if(!V.current)return;let t=e.target;w(V.current,t)||w(B.current,t)||Q(e,V.current)||y.context.setOpen(!1,P(u,e))}ae.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},f,H),le=h.getValidationProps(C,W);le.role=`combobox`;let G={...g,open:T,disabled:C,value:D,readOnly:b,popupSide:L,placeholder:!I};return l(`button`,e,{ref:[t,V,U,ne],state:G,stateAttributesMapping:rt,props:le})}),at={value:()=>null},ot=X.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=$(),u=c.useState(`value`),d=c.useState(`items`),f=c.useState(`itemToStringLabel`),p=c.useState(`hasSelectedValue`),m=!p&&a!=null&&i==null,h=c.useState(`hasNullItemLabel`,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(m&&!h?a:Array.isArray(u)?Ne(u,d,f):we(u,d,f)),l(`span`,e,{state:g,ref:[t,c.context.valueRef],props:[{children:_},s],stateAttributesMapping:at})}),st=X.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o={open:$().useState(`open`)};return l(`span`,e,{state:o,ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:N})}),ct=X.forwardRef(function(e,t){let n=$(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,Z.jsx)(h,{ref:t,...e}):null}),lt=X.createContext(void 0);function ut(){let e=X.useContext(lt);if(!e)throw Error(j(59));return e}function dt(e,t){e&&Object.assign(e.style,t)}var ft={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},pt={position:`fixed`},mt=X.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:h,alignItemWithTrigger:g=!0,collisionAvoidance:_=m,style:v,...y}=e,x=$(),S=Ye(),C=x.useState(`open`),w=x.useState(`mounted`),T=x.useState(`modal`),E=x.useState(`value`),D=x.useState(`openMethod`),O=x.useState(`positionerElement`),k=x.useState(`triggerElement`),A=x.useState(`isItemEqualToValue`),j=x.useState(`transitionStatus`),M=X.useRef(null),N=X.useRef(null),[F,I]=X.useState(g),L=w&&F&&D!==`touch`;!w&&F!==g&&I(g),X.useImperativeHandle(x.context.alignItemWithTriggerActiveRef,()=>L),Pe((L||T)&&C,D===`touch`,O,k);let R=Ve({anchor:n,floatingRootContext:S,positionMethod:a,mounted:w,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:h??L,collisionAvoidance:_,keepMounted:!0}),ee=L?`none`:R.side,z=L?pt:R.positionerStyles,B={open:C,side:ee,align:R.align,anchorHidden:R.anchorHidden};U(()=>{x.set(`popupSide`,R.side)},[x,R.side]);let V=x.useStateSetter(`positionerElement`),te=Re(e,B,{styles:z,transitionStatus:j,props:y,refs:[t,V],hidden:!w,inert:!C}),H=X.useRef(0),ne=W(e=>{if(x.context.valuesRef.current.length===0)return;let t=H.current;H.current=e.size;let n=P(ie);if(t!==0&&!x.state.multiple&&E!==null&&Me(x.context.valuesRef.current,E,A)===-1){let e=x.context.initialValueRef.current,t=e!=null&&Me(x.context.valuesRef.current,e,A)!==-1?e:null;x.context.setValue(t,n),t===null&&(x.set(`selectedIndex`,null),x.context.selectedItemTextRef.current=null)}if(t!==0&&x.state.multiple&&Array.isArray(E)){let e=E.filter(e=>Me(x.context.valuesRef.current,e,A)!==-1);e.length!==E.length&&(x.context.setValue(e,n),e.length===0&&(x.set(`selectedIndex`,null),x.context.selectedItemTextRef.current=null))}if(C&&L){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};dt(O,e),dt(x.context.popupRef.current,e)}}),re=X.useMemo(()=>({...R,side:ee,alignItemWithTriggerActive:L,setControlledAlignItemWithTrigger:I,scrollUpArrowRef:M,scrollDownArrowRef:N}),[R,ee,L,I]);return(0,Z.jsx)(b,{elementsRef:x.context.listRef,labelsRef:x.context.labelsRef,onMapChange:ne,children:(0,Z.jsxs)(lt.Provider,{value:re,children:[w&&T&&(0,Z.jsx)(de,{inert:J(!C),cutout:k}),te]})})}),ht=`base-ui-disable-scrollbar`,gt={className:ht,getElement(e){return(0,Z.jsx)(`style`,{nonce:e,href:ht,precedence:`base-ui:low`,children:`.${ht}{scrollbar-width:none}.${ht}::-webkit-scrollbar{display:none}`})}},_t=X.createContext(void 0),vt={disableStyleElements:!1};function yt(){return X.useContext(_t)??vt}var bt=`--transform-origin`,xt={...M,...G},St=X.forwardRef(function(e,t){let{render:n,className:i,style:a,finalFocus:o,...s}=e,c=$(),u=c.useState(`multiple`),d=c.useState(`readOnly`),f=c.useState(`highlightItemOnHover`),p=Ye(),{side:m,align:h,alignItemWithTriggerActive:g,isPositioned:_,setControlledAlignItemWithTrigger:v}=ut(),y=ne(!0)!=null,b=te(),{nonce:x,disableStyleElements:C}=yt(),w=c.useState(`id`),T=c.useState(`open`),D=c.useState(`openMethod`),O=c.useState(`mounted`),k=c.useState(`popupProps`),A=c.useState(`transitionStatus`),j=c.useState(`triggerElement`),M=c.useState(`positionerElement`),N=c.useState(`listElement`),F=X.useRef(!1),z=X.useRef(!1),B=X.useRef({}),V=E(),H=W(e=>{if(!M||!c.context.popupRef.current||!z.current)return;let t=M.style.top===`0px`,n=M.style.bottom===`0px`;if(F.current||!g||!t&&!n){c.context.handleScrollArrowVisibility(e);return}let r=Tt(M),i=Et(M.getBoundingClientRect().height,`y`,r),a=R(M),o=I(M),s=o.getComputedStyle(M),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=Ct(o.getComputedStyle(c.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=wt(e),h=null,_=e=>{M.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=Ze(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(F.current=!0),c.context.handleScrollArrowVisibility(e);return}f-y>1?h=t?1/0:0:n&&p<m&&(h=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),h!=null){let t=Ze(h,0,wt(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(F.current=!0),c.context.handleScrollArrowVisibility(e)});X.useImperativeHandle(c.context.scrollHandlerRef,()=>H,[H]),S({open:T,ref:c.context.popupRef,onComplete(){T&&c.context.onOpenChangeComplete(!0)}});let ie={open:T,transitionStatus:A,side:m,align:h};U(()=>{M&&c.context.popupRef.current&&!Object.keys(B.current).length&&(B.current={top:M.style.top||`0`,left:M.style.left||`0`,right:M.style.right,height:M.style.height,bottom:M.style.bottom,minHeight:M.style.minHeight,maxHeight:M.style.maxHeight,marginTop:M.style.marginTop,marginBottom:M.style.marginBottom})},[c,M]),U(()=>{T||g||(z.current=!1,F.current=!1,dt(M,B.current))},[T,g,M]),U(()=>{let e=c.context.popupRef.current;if(!T||!j||!M||!e||g&&!_||c.state.transitionStatus===`ending`)return;if(z.current=!0,e.style.removeProperty(bt),!g){V.request(()=>c.context.handleScrollArrowVisibility(N||e));return}let t=kt(e);try{let t=c.context.selectedItemTextRef.current;t?.isConnected||(t=!c.select(`hasSelectedValue`)&&c.context.firstItemTextRef.current?.isConnected?c.context.firstItemTextRef.current:null);let n=c.context.valueRef.current,r=I(M),i=r.getComputedStyle(M),a=r.getComputedStyle(e),o=R(j),s=Tt(j),l=Dt(j.getBoundingClientRect(),s),u=Dt(M.getBoundingClientRect(),s),d=l.height,p=N||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),g=parseFloat(i.marginTop)||10,_=parseFloat(i.marginBottom)||10,y=parseFloat(i.minHeight)||100,x=Ct(a),S=o.documentElement.clientHeight-g-_,C=o.documentElement.clientWidth,w=S-l.bottom+d,T,E=b===`rtl`?l.right-u.width:l.left,D=0;if(t&&n){let e=Dt(n.getBoundingClientRect(),s);T=Dt(t.getBoundingClientRect(),s),E=u.left+(b===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-u.top+T.height/2-r}let O=w+D+_+h,k=Math.min(S,O),A=S-g-_,P=O-k,L=C-5;M.style.left=`${Ze(E,5,L-u.width)}px`,M.style.height=`${k}px`,M.style.maxHeight=`none`,M.style.marginTop=`${g}px`,M.style.marginBottom=`${_}px`,e.style.height=`100%`;let z=wt(p),V=P>=z-1;V&&(k=Math.min(S,u.height)-(P-z));let te=l.top<20||l.bottom>S-20||Math.ceil(k)+1<Math.min(m,y),H=(r.visualViewport?.scale??1)!==1&&ee;if(te||H){dt(M,B.current),v(!1);return}let U=Math.max(y,k);if(V){let e=Math.max(0,S-O);M.style.top=u.height>=A?`0`:`${e}px`,M.style.height=`${k}px`,p.scrollTop=wt(p)}else M.style.bottom=`0`,p.scrollTop=P;if(T){let t=u.top,n=u.height,r=T.top+T.height/2,i=Ze(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(bt,`50% ${i}%`)}(U===S||k>=x)&&(F.current=!0),c.context.handleScrollArrowVisibility(p),f&&c.state.selectedIndex===null&&c.state.activeIndex===null&&c.context.listRef.current[0]!=null&&c.set(`activeIndex`,0)}finally{t()}},[c,T,M,j,g,v,V,N,f,b,_]),X.useEffect(()=>{if(!g||!M||!T)return;let e=I(M);function t(e){c.context.setOpen(!1,P(r,e))}return re(e,`resize`,t)},[c,g,M,T]);let ae={...N?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":u||void 0,"aria-readonly":d||void 0,id:`${w}-list`},onKeyDown(e){y&&L.has(e.key)&&e.stopPropagation()},onScroll(e){N||H(e.currentTarget)},...g&&{style:N?{height:`100%`}:ft},className:!N&&g?gt.className:void 0},oe=l(`div`,e,{ref:[t,c.context.popupRef],state:ie,stateAttributesMapping:xt,props:[k,ae,Be(A),s]});return(0,Z.jsxs)(X.Fragment,{children:[!C&&gt.getElement(x),(0,Z.jsx)(ye,{context:p,modal:!1,disabled:!O,openInteractionType:D,returnFocus:o,restoreFocus:!0,children:oe})]})});function Ct(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function wt(e){return Qe(e.scrollHeight,e.clientHeight)}function Tt(e){return ze.getScale(e)}function Et(e,t,n){return e/n[t]}function Dt(e,t){return ae({x:Et(e.x,`x`,t),y:Et(e.y,`y`,t),width:Et(e.width,`x`,t),height:Et(e.height,`y`,t)})}var Ot=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function kt(e){let{style:t}=e,n={};for(let[e,r]of Ot)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Ot){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var At=X.createContext(void 0);function jt(){let e=X.useContext(At);if(!e)throw Error(j(57));return e}var Mt=X.memo(X.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...u}=e,d=X.useRef(null),f=H({guess:!0,label:o,textRef:d}),p=$(),{props:m,multiple:h,disabled:g,readOnly:_,isItemEqualToValue:v}=p.useState(`itemRoot`),y=g||s,b=p.useState(`isActive`,f.index),x=p.useState(`open`),S=p.useState(`isSelected`,a),C=p.useState(`isSelectedByFocus`,f.index),w=f.index,T=X.useRef(null);U(()=>{let e=p.context.valuesRef.current;return e[w]=a,()=>{delete e[w]}},[w,a,p]),U(()=>{let e=p.state.value,t=p.state.selectedIndex,n=t,r;h&&Array.isArray(e)?(n=xe(w,a,p.context.valuesRef.current,e,v,t),r=n===w,w===t&&!r&&(p.context.selectedItemTextRef.current=null)):(r=e!==void 0&&Te(a,e,v),r&&(n=w)),p.set(`selectedIndex`,n),r&&d.current&&(p.context.selectedItemTextRef.current=d.current)},[w,h,v,p,a]);let E=X.useRef(`mouse`),k=X.useRef(!1),{getButtonProps:A,buttonRef:j}=se({disabled:y,focusableWhenDisabled:!0,native:c,composite:!0}),M={disabled:y,selected:S,highlighted:b};function N(e){if(g||_)return;let t=p.state.value;if(h){let n=Array.isArray(t)?t:[],r=S?De(n,a,v):[...n,a];p.context.setValue(r,P(D,e))}else p.context.setValue(a,P(D,e)),p.context.setOpen(!1,P(D,e))}function F(){p.context.selectionRef.current.dragY=0}let I={role:`option`,"aria-selected":S,tabIndex:x&&b?0:-1,onKeyDown(e){p.set(`activeIndex`,w),e.key===` `&&p.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&O(e.nativeEvent)&&(n!==void 0||b),i=t&&!r&&!k.current;k.current=!1,y||i||N(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=p.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,k.current=!0,F()},onMouseUp(){if(F(),y||E.current===`touch`||k.current)return;let e=!p.context.selectionRef.current.allowSelectedMouseUp&&S,t=!p.context.selectionRef.current.allowUnselectedMouseUp&&!S;e||t||(k.current=!0,T.current?.click(),k.current=!1)}},L=l(`div`,e,{ref:[j,t,f.ref,T],state:M,props:[m,I,u,A]}),R=X.useMemo(()=>({selected:S,index:w,textRef:d,selectedByFocus:C}),[S,w,d,C]);return(0,Z.jsx)(At.Provider,{value:R,children:L})})),Nt=X.memo(X.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=X.useRef(null),{transitionStatus:u,setMounted:d}=K(o),f=l(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:u},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:G});return S({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||d(!1)}}),f})),Pt=X.forwardRef(function(e,t){let{selected:n}=jt();return e.keepMounted||n?(0,Z.jsx)(Nt,{...e,selected:n,ref:t}):null}),Ft=X.memo(X.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=jt(),a=$(),{render:o,className:s,style:c,...u}=e,d=X.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]);return l(`div`,e,{ref:[d,t,r],props:u})})),It=`relative flex h-9 w-full min-w-0 items-center gap-2 rounded-control border border-rule bg-page pr-9 pl-3 text-left text-sm text-text outline-none transition-colors focus-visible:border-accent data-popup-open:border-accent disabled:cursor-not-allowed disabled:opacity-60`,Lt=`pointer-events-none size-4 text-muted`,Rt=`max-h-[min(var(--available-height),20rem)] min-w-(--anchor-width) overflow-y-auto rounded-card border border-rule bg-surface p-1 text-text shadow-float outline-none transition-[opacity,transform] duration-150 data-ending-style:-translate-y-1 data-ending-style:opacity-0 data-starting-style:-translate-y-1 data-starting-style:opacity-0`,zt=`relative flex cursor-default items-center rounded-[6px] py-1.5 pr-8 pl-2.5 text-sm outline-none select-none data-disabled:opacity-50 data-highlighted:bg-accent-soft`,Bt=`pointer-events-none absolute right-2.5 size-4 text-accent`;function Vt(e){return(0,Z.jsx)(et,{"data-slot":`select`,...e})}function Ht({className:e,children:t,...n}){return(0,Z.jsxs)(it,{"data-slot":`select-trigger`,className:q(It,e),...n,children:[t,(0,Z.jsx)(st,{className:`absolute right-3 flex`,children:(0,Z.jsx)(oe,{name:`chevron`,className:Lt})})]})}function Ut({className:e,...t}){return(0,Z.jsx)(ot,{"data-slot":`select-value`,className:q(`truncate`,e),...t})}function Wt({className:e,...t}){return(0,Z.jsx)(ct,{children:(0,Z.jsx)(mt,{alignItemWithTrigger:!1,sideOffset:6,className:`z-40`,children:(0,Z.jsx)(St,{"data-slot":`select-content`,className:q(Rt,e),...t})})})}function Gt({className:e,children:t,...n}){return(0,Z.jsxs)(Mt,{"data-slot":`select-item`,className:q(zt,e),...n,children:[(0,Z.jsx)(Ft,{className:`truncate`,children:t}),(0,Z.jsx)(Pt,{className:Bt,children:(0,Z.jsx)(oe,{name:`check`,className:`size-4`})})]})}export{Vt as a,Ht as c,Nt as d,Ke as f,Rt as i,Ut as l,He as m,zt as n,Wt as o,Q as p,Bt as r,Gt as s,Lt as t,It as u};
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{$n as r,Ar as i,Bn as a,Dn as o,Dr as s,Dt as c,Er as l,Fn as u,G as d,H as f,Ir as p,L as m,M as h,Mr as g,Nn as _,Nr as v,Or as y,Pn as b,Qt as x,S,T as C,Tn as w,V as T,W as E,Wn as D,Xt as O,Y as k,a as A,ar as j,cn as M,dn as N,er as P,f as F,gr as I,ht as L,ir as R,kn as ee,kr as z,kt as B,l as V,mt as te,nr as H,or as U,pt as ne,q as re,qn as ie,qt as ae,r as oe,rr as se,sr as W,tn as ce,un as le,vn as G,w as K,x as ue}from"./button-C9SQW3kI.js";import{t as q}from"./cn-DC80MJV0.js";import{_ as J,a as de,c as fe,d as pe,g as Y,l as me,m as he,o as ge,s as _e,u as ve,v as ye}from"./fields-CEep8IFT.js";import{S as be,_ as xe,a as Se,b as Ce,c as we,d as Te,f as Ee,g as De,h as Oe,l as ke,m as Ae,n as je,p as Me,s as Ne,t as Pe,u as Fe,x as Ie,y as Le}from"./useAnchoredPopupScrollLock-dc_kP4Go.js";import{at as Re,ct as ze,ot as Be,st as Ve}from"./index-zmRH87D4.js";var X=e(t(),1);function He(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=W(s),p=e.useState(`open`),m=k(),h=X.useRef(``),g=X.useRef(d??i??-1),_=X.useRef(null),v=W(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!c(n)||n?.matches(`:disabled`)?!1:o==null||!B(y,e,o)}function l(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let v=n.current;if(h.current.length>0&&e.key===` `&&(x(e),f?.(!0)),h.current.length>0&&h.current[0]!==` `&&l(v,h.current)===-1&&e.key!==` `&&f?.(!1),v==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(x(e),f?.(!0));let b=h.current===``;b&&(g.current=d??i??-1),v.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(u,()=>{h.current=``,g.current=_.current,f?.(!1)});let S=((b?d??i??-1:g.current)??0)+1,C=l(v,h.current,S);C===-1?e.key!==` `&&(h.current=``,f?.(!1)):(a?.(C,e),_.current=C)}),b=W(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);w(r,n)||w(i,n)||(m.clear(),h.current=``,g.current=_.current,f?.(!1))});U(()=>{(p||d===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,f?.(!1)))},[p,d,m,f]);let S=X.useMemo(()=>({onKeyDown:v,onBlur:b}),[v,b]);return X.useMemo(()=>l?{reference:S,floating:S}:{},[l,S])}function Ue(e){let[t,n]=X.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var Z=n(),We=5;function Q(e,t){let n=Ge(t);return e.clientX>=n.left-We&&e.clientX<=n.right+We&&e.clientY>=n.top-We&&e.clientY<=n.bottom+We}function Ge(e){let t=e.getBoundingClientRect(),n=I(e);if(o)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=parseFloat(i.width)||0,l=parseFloat(i.height)||0,u=Math.max(t.width,a,c),d=Math.max(t.height,s,l),f=u-t.width,p=d-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-p/2,bottom:t.bottom+p/2}}function Ke(e,t){return e??t}var qe=X.createContext(void 0),Je=X.createContext(void 0);function $(){let e=X.useContext(qe);if(e===void 0)throw Error(j(60));return e}function Ye(){let e=X.useContext(Je);if(e===void 0)throw Error(j(61));return e}var Xe={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Fe(t,r)!==``},hasNullItemLabel:(e,t)=>t?Se(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>Te(t,e,n)):Te(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function Ze(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Qe(e,t){return Math.max(0,e-t)}function $e(e,t){if(t<=0)return 0;let n=Ze(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function et(e){let{id:t,value:n,defaultValue:r=null,onValueChange:o,open:c,defaultOpen:l=!1,onOpenChange:u,name:m,form:h,autoComplete:b,disabled:x=!1,readOnly:S=!1,required:w=!1,modal:E=!0,actionsRef:D,inputRef:O,onOpenChangeComplete:k,items:j,multiple:M=!1,itemToStringLabel:N,itemToStringValue:I,isItemEqualToValue:L=Ee,highlightItemOnHover:R=!0,children:ee}=e,{clearErrors:B}=ve(),{setDirty:te,setTouched:H,setFocused:ne,validityData:re,setFilled:ae,name:oe,disabled:se,validation:ce,validationMode:le}=he(),G=fe({id:t}),K=se||x,q=oe??m,[J,de]=p({controlled:n,default:M?r??y:r,name:`Select`,state:`value`}),[Y,me]=p({controlled:c,default:l,name:`Select`,state:`open`}),ge=X.useRef([]),ye=X.useRef([]),xe=X.useRef(null),Se=X.useRef(null),we=X.useRef(0),Te=X.useRef(null),De=X.useRef([]),Me=X.useRef(!1),Ne=X.useRef(null),Pe=X.useRef(null),Re=X.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ze=X.useRef(!1),Be=X.useRef(J),{openMethod:Ve,triggerProps:We}=je(Y),Q=v(()=>new A({id:G,labelId:void 0,modal:E,multiple:M,disabled:K,readOnly:S,required:w,highlightItemOnHover:R,itemToStringLabel:N,itemToStringValue:I,isItemEqualToValue:L,value:J,open:Y,mounted:Y,transitionStatus:void 0,items:j,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:z,triggerProps:z,itemRoot:{props:z,multiple:M,disabled:K,readOnly:S,isItemEqualToValue:L},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:i,setOpen:i,handleScrollArrowVisibility:i,onOpenChangeComplete:i,listRef:ge,popupRef:xe,scrollHandlerRef:Se,scrollArrowsMountedCountRef:we,valueRef:Te,valuesRef:De,labelsRef:ye,typingRef:Me,selectionRef:Re,firstItemTextRef:Ne,selectedItemTextRef:Pe,alignItemWithTriggerActiveRef:ze,initialValueRef:Be},Xe)).current,[Ge,Ke]=X.useState(!1),{mounted:$,transitionStatus:Ye,forceUnmount:Ze}=ue({open:Y,ref:xe,preventUnmountOnClose:Ge,setPreventUnmountOnClose:Ke,onUnmount(){Q.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),k?.(!1)}}),et=Q.useState(`activeIndex`),tt=Q.useState(`selectedIndex`),nt=Q.useState(`triggerElement`),rt=Q.useState(`positionerElement`),it=Ue(Ve),at=Ve??it,ot=X.useMemo(()=>M?``:Fe(J,I),[M,J,I]),st=X.useMemo(()=>M&&Array.isArray(J)?J.map(e=>Fe(e,I)):Fe(J,I),[M,J,I]),ct=d(nt),lt=W(()=>st);pe(ct,G,J,lt,!K,m);let ut=M?Array.isArray(J)&&J.length>0:J!=null&&ot!==``;U(()=>{ae(ut)},[ut,ae]),U(function(){let e=Ae(De.current,J,L,M);e===null&&(Pe.current=null),Y||Q.set(`selectedIndex`,e)},[M,Y,J,L,Q]),_e(J,()=>{B(q),te(Oe(J,re.initialValue,L)),ce.change(J)});let dt=W((e,t)=>{let n=t,r=F(n);u?.(e,n),t.isCanceled||(e||Ke(r()),me(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(H(!0),ne(!1),le===`onBlur`&&ce.commit(J)))});X.useImperativeHandle(D,()=>({unmount:Ze,close:()=>{Q.state.open&&dt(!1,P(a))}}),[Ze,dt,Q]);let ft=W((e,t)=>{o?.(e,t),t.isCanceled||de(e)}),pt=W(e=>{let t=Qe(e.scrollHeight,e.clientHeight),n=$e(e.scrollTop,t),r=n>0,i=n<t;Q.set(`scrollUpArrowVisible`,r),Q.set(`scrollDownArrowVisible`,i)}),mt=Ie({open:Y,onOpenChange:dt,elements:{reference:nt,floating:rt}}),ht=be(mt,{enabled:!K,event:`mousedown`}),gt=C(mt),_t=Ce(mt,{enabled:!K,listRef:ge,activeIndex:et,selectedIndex:tt,disabledIndices:y,onNavigate(e){(e!==null||Y)&&Q.set(`activeIndex`,e)},focusItemOnHover:R}),vt=He(mt,{enabled:!K&&(Y||!S&&!M),listRef:ye,activeIndex:et,selectedIndex:tt,disabledIndices:e=>_(ge.current[e]),onMatch(e){Y?Q.set(`activeIndex`,e):ft(De.current[e],P(ie))},onTyping(e){Me.current=e}}),yt=X.useMemo(()=>s(vt.reference,_t.reference,gt.reference,ht.reference,We),[ht.reference,vt.reference,_t.reference,gt.reference,We]),bt=X.useMemo(()=>s(V,vt.floating,_t.floating,gt.floating),[vt.floating,_t.floating,gt.floating]),xt=_t.item??z,St=X.useMemo(()=>({props:xt,multiple:M,disabled:K,readOnly:S,isItemEqualToValue:L}),[xt,M,K,S,L]);Q.useContextCallback(`setValue`,ft),Q.useContextCallback(`setOpen`,dt),Q.useContextCallback(`handleScrollArrowVisibility`,pt),Q.useContextCallback(`onOpenChangeComplete`,k),Le(()=>{Q.update({popupProps:bt,triggerProps:yt,itemRoot:St})}),Q.useSyncedValues({id:G,modal:E,multiple:M,disabled:K,readOnly:S,required:w,highlightItemOnHover:R,value:J,open:Y,mounted:$,transitionStatus:Ye,popupProps:bt,triggerProps:yt,itemRoot:St,items:j,itemToStringLabel:N,itemToStringValue:I,isItemEqualToValue:L,openMethod:at});let Ct=g(O,ce.inputRef),wt=M?void 0:q,Tt=X.useMemo(()=>!M||!Array.isArray(J)||!q?null:J.map(e=>{let t=Fe(e,I);return(0,Z.jsx)(`input`,{type:`hidden`,form:h,name:q,value:t,disabled:K},t)}),[M,J,h,q,I,K]);return(0,Z.jsxs)(qe.Provider,{value:Q,children:[(0,Z.jsx)(Je.Provider,{value:mt,children:ee}),(0,Z.jsx)(`input`,{...ce.getValidationProps(K,{onFocus(){Q.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||K||S)return;let t=e.currentTarget.value,n=P(ie,e.nativeEvent);function r(){if(M)return;let e=t.toLowerCase(),r=De.current.findIndex(t=>Fe(t,I).toLowerCase()===e||ke(t,N).toLowerCase()===e);r===-1&&(r=De.current.findIndex((t,n)=>{let r=ye.current[n];return r!=null&&r.toLowerCase()===e}));let i=De.current[r];i!=null&&ft(i,n)}Q.set(`forceMount`,!0),queueMicrotask(r)}}),id:G&&wt==null?`${G}-hidden-input`:void 0,form:h,name:wt,autoComplete:b,value:ot,disabled:K,required:w&&!(M&&ut),readOnly:S,ref:Ct,style:q?f:T,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tt]})}var tt=`data-popup-side`,nt=400,rt={...le,...Y,popupSide:e=>e?{[tt]:e}:null,value:()=>null},it=X.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:c,...f}=e,{setTouched:p,validationMode:m,validation:h,state:g,disabled:_}=he(),{labelId:v}=me(),y=$(),b=y.useState(`readOnly`),x=y.useState(`required`),S=y.useState(`disabled`),C=_||S||a,T=y.useState(`open`),E=y.useState(`mounted`),D=y.useState(`value`),O=y.useState(`triggerProps`),A=y.useState(`positionerElement`),j=y.useState(`listElement`),M=y.useState(`popupSide`),N=y.useState(`id`),F=y.useState(`labelId`),I=y.useState(`hasSelectedValue`),L=E&&A?M:null,ee=i??N,z=Ke(v,F);fe({id:i});let B=d(A),V=X.useRef(null),te=ge(C,V),{getButtonProps:H,buttonRef:U}=se({disabled:C,native:o}),ne=y.useStateSetter(`triggerElement`),re=k(),ae=k(),oe=k();X.useEffect(()=>{if(T)return oe.start(nt,()=>{y.context.selectionRef.current.allowUnselectedMouseUp=!0,y.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{oe.clear()};y.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},ae.clear()},[T,y,ae,oe]);let W=s(O,{id:ee,role:`combobox`,"aria-expanded":T,"aria-haspopup":`listbox`,"aria-controls":T?j?.id??ce(A)?.id:void 0,"aria-labelledby":z,"aria-readonly":b||void 0,"aria-required":x||void 0,tabIndex:C?-1:0,onFocus(e){te(!0),T&&y.context.alignItemWithTriggerActiveRef.current&&y.context.setOpen(!1,P(ie,e.nativeEvent)),re.start(0,()=>{y.set(`forceMount`,!0)})},onBlur(e){w(A,e.relatedTarget)||(p(!0),te(!1),m===`onBlur`&&h.commit(D))},onMouseDown(e){if(T)return;let t=R(e.currentTarget);function n(e){if(!V.current)return;let t=e.target;w(V.current,t)||w(B.current,t)||Q(e,V.current)||y.context.setOpen(!1,P(u,e))}ae.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},f,H),le=h.getValidationProps(C,W);le.role=`combobox`;let G={...g,open:T,disabled:C,value:D,readOnly:b,popupSide:L,placeholder:!I};return l(`button`,e,{ref:[t,V,U,ne],state:G,stateAttributesMapping:rt,props:le})}),at={value:()=>null},ot=X.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=$(),u=c.useState(`value`),d=c.useState(`items`),f=c.useState(`itemToStringLabel`),p=c.useState(`hasSelectedValue`),m=!p&&a!=null&&i==null,h=c.useState(`hasNullItemLabel`,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(m&&!h?a:Array.isArray(u)?Ne(u,d,f):we(u,d,f)),l(`span`,e,{state:g,ref:[t,c.context.valueRef],props:[{children:_},s],stateAttributesMapping:at})}),st=X.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o={open:$().useState(`open`)};return l(`span`,e,{state:o,ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:N})}),ct=X.forwardRef(function(e,t){let n=$(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,Z.jsx)(h,{ref:t,...e}):null}),lt=X.createContext(void 0);function ut(){let e=X.useContext(lt);if(!e)throw Error(j(59));return e}function dt(e,t){e&&Object.assign(e.style,t)}var ft={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},pt={position:`fixed`},mt=X.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:h,alignItemWithTrigger:g=!0,collisionAvoidance:_=m,style:v,...y}=e,x=$(),S=Ye(),C=x.useState(`open`),w=x.useState(`mounted`),T=x.useState(`modal`),E=x.useState(`value`),D=x.useState(`openMethod`),O=x.useState(`positionerElement`),k=x.useState(`triggerElement`),A=x.useState(`isItemEqualToValue`),j=x.useState(`transitionStatus`),M=X.useRef(null),N=X.useRef(null),[F,I]=X.useState(g),L=w&&F&&D!==`touch`;!w&&F!==g&&I(g),X.useImperativeHandle(x.context.alignItemWithTriggerActiveRef,()=>L),Pe((L||T)&&C,D===`touch`,O,k);let R=Ve({anchor:n,floatingRootContext:S,positionMethod:a,mounted:w,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:h??L,collisionAvoidance:_,keepMounted:!0}),ee=L?`none`:R.side,z=L?pt:R.positionerStyles,B={open:C,side:ee,align:R.align,anchorHidden:R.anchorHidden};U(()=>{x.set(`popupSide`,R.side)},[x,R.side]);let V=x.useStateSetter(`positionerElement`),te=Re(e,B,{styles:z,transitionStatus:j,props:y,refs:[t,V],hidden:!w,inert:!C}),H=X.useRef(0),ne=W(e=>{if(x.context.valuesRef.current.length===0)return;let t=H.current;H.current=e.size;let n=P(ie);if(t!==0&&!x.state.multiple&&E!==null&&Me(x.context.valuesRef.current,E,A)===-1){let e=x.context.initialValueRef.current,t=e!=null&&Me(x.context.valuesRef.current,e,A)!==-1?e:null;x.context.setValue(t,n),t===null&&(x.set(`selectedIndex`,null),x.context.selectedItemTextRef.current=null)}if(t!==0&&x.state.multiple&&Array.isArray(E)){let e=E.filter(e=>Me(x.context.valuesRef.current,e,A)!==-1);e.length!==E.length&&(x.context.setValue(e,n),e.length===0&&(x.set(`selectedIndex`,null),x.context.selectedItemTextRef.current=null))}if(C&&L){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};dt(O,e),dt(x.context.popupRef.current,e)}}),re=X.useMemo(()=>({...R,side:ee,alignItemWithTriggerActive:L,setControlledAlignItemWithTrigger:I,scrollUpArrowRef:M,scrollDownArrowRef:N}),[R,ee,L,I]);return(0,Z.jsx)(b,{elementsRef:x.context.listRef,labelsRef:x.context.labelsRef,onMapChange:ne,children:(0,Z.jsxs)(lt.Provider,{value:re,children:[w&&T&&(0,Z.jsx)(de,{inert:J(!C),cutout:k}),te]})})}),ht=`base-ui-disable-scrollbar`,gt={className:ht,getElement(e){return(0,Z.jsx)(`style`,{nonce:e,href:ht,precedence:`base-ui:low`,children:`.${ht}{scrollbar-width:none}.${ht}::-webkit-scrollbar{display:none}`})}},_t=X.createContext(void 0),vt={disableStyleElements:!1};function yt(){return X.useContext(_t)??vt}var bt=`--transform-origin`,xt={...M,...G},St=X.forwardRef(function(e,t){let{render:n,className:i,style:a,finalFocus:o,...s}=e,c=$(),u=c.useState(`multiple`),d=c.useState(`readOnly`),f=c.useState(`highlightItemOnHover`),p=Ye(),{side:m,align:h,alignItemWithTriggerActive:g,isPositioned:_,setControlledAlignItemWithTrigger:v}=ut(),y=ne(!0)!=null,b=te(),{nonce:x,disableStyleElements:C}=yt(),w=c.useState(`id`),T=c.useState(`open`),D=c.useState(`openMethod`),O=c.useState(`mounted`),k=c.useState(`popupProps`),A=c.useState(`transitionStatus`),j=c.useState(`triggerElement`),M=c.useState(`positionerElement`),N=c.useState(`listElement`),F=X.useRef(!1),z=X.useRef(!1),B=X.useRef({}),V=E(),H=W(e=>{if(!M||!c.context.popupRef.current||!z.current)return;let t=M.style.top===`0px`,n=M.style.bottom===`0px`;if(F.current||!g||!t&&!n){c.context.handleScrollArrowVisibility(e);return}let r=Tt(M),i=Et(M.getBoundingClientRect().height,`y`,r),a=R(M),o=I(M),s=o.getComputedStyle(M),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=Ct(o.getComputedStyle(c.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=wt(e),h=null,_=e=>{M.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=Ze(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(F.current=!0),c.context.handleScrollArrowVisibility(e);return}f-y>1?h=t?1/0:0:n&&p<m&&(h=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),h!=null){let t=Ze(h,0,wt(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(F.current=!0),c.context.handleScrollArrowVisibility(e)});X.useImperativeHandle(c.context.scrollHandlerRef,()=>H,[H]),S({open:T,ref:c.context.popupRef,onComplete(){T&&c.context.onOpenChangeComplete(!0)}});let ie={open:T,transitionStatus:A,side:m,align:h};U(()=>{M&&c.context.popupRef.current&&!Object.keys(B.current).length&&(B.current={top:M.style.top||`0`,left:M.style.left||`0`,right:M.style.right,height:M.style.height,bottom:M.style.bottom,minHeight:M.style.minHeight,maxHeight:M.style.maxHeight,marginTop:M.style.marginTop,marginBottom:M.style.marginBottom})},[c,M]),U(()=>{T||g||(z.current=!1,F.current=!1,dt(M,B.current))},[T,g,M]),U(()=>{let e=c.context.popupRef.current;if(!T||!j||!M||!e||g&&!_||c.state.transitionStatus===`ending`)return;if(z.current=!0,e.style.removeProperty(bt),!g){V.request(()=>c.context.handleScrollArrowVisibility(N||e));return}let t=kt(e);try{let t=c.context.selectedItemTextRef.current;t?.isConnected||(t=!c.select(`hasSelectedValue`)&&c.context.firstItemTextRef.current?.isConnected?c.context.firstItemTextRef.current:null);let n=c.context.valueRef.current,r=I(M),i=r.getComputedStyle(M),a=r.getComputedStyle(e),o=R(j),s=Tt(j),l=Dt(j.getBoundingClientRect(),s),u=Dt(M.getBoundingClientRect(),s),d=l.height,p=N||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),g=parseFloat(i.marginTop)||10,_=parseFloat(i.marginBottom)||10,y=parseFloat(i.minHeight)||100,x=Ct(a),S=o.documentElement.clientHeight-g-_,C=o.documentElement.clientWidth,w=S-l.bottom+d,T,E=b===`rtl`?l.right-u.width:l.left,D=0;if(t&&n){let e=Dt(n.getBoundingClientRect(),s);T=Dt(t.getBoundingClientRect(),s),E=u.left+(b===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-u.top+T.height/2-r}let O=w+D+_+h,k=Math.min(S,O),A=S-g-_,P=O-k,L=C-5;M.style.left=`${Ze(E,5,L-u.width)}px`,M.style.height=`${k}px`,M.style.maxHeight=`none`,M.style.marginTop=`${g}px`,M.style.marginBottom=`${_}px`,e.style.height=`100%`;let z=wt(p),V=P>=z-1;V&&(k=Math.min(S,u.height)-(P-z));let te=l.top<20||l.bottom>S-20||Math.ceil(k)+1<Math.min(m,y),H=(r.visualViewport?.scale??1)!==1&&ee;if(te||H){dt(M,B.current),v(!1);return}let U=Math.max(y,k);if(V){let e=Math.max(0,S-O);M.style.top=u.height>=A?`0`:`${e}px`,M.style.height=`${k}px`,p.scrollTop=wt(p)}else M.style.bottom=`0`,p.scrollTop=P;if(T){let t=u.top,n=u.height,r=T.top+T.height/2,i=Ze(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(bt,`50% ${i}%`)}(U===S||k>=x)&&(F.current=!0),c.context.handleScrollArrowVisibility(p),f&&c.state.selectedIndex===null&&c.state.activeIndex===null&&c.context.listRef.current[0]!=null&&c.set(`activeIndex`,0)}finally{t()}},[c,T,M,j,g,v,V,N,f,b,_]),X.useEffect(()=>{if(!g||!M||!T)return;let e=I(M);function t(e){c.context.setOpen(!1,P(r,e))}return re(e,`resize`,t)},[c,g,M,T]);let ae={...N?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":u||void 0,"aria-readonly":d||void 0,id:`${w}-list`},onKeyDown(e){y&&L.has(e.key)&&e.stopPropagation()},onScroll(e){N||H(e.currentTarget)},...g&&{style:N?{height:`100%`}:ft},className:!N&&g?gt.className:void 0},oe=l(`div`,e,{ref:[t,c.context.popupRef],state:ie,stateAttributesMapping:xt,props:[k,ae,Be(A),s]});return(0,Z.jsxs)(X.Fragment,{children:[!C&&gt.getElement(x),(0,Z.jsx)(ye,{context:p,modal:!1,disabled:!O,openInteractionType:D,returnFocus:o,restoreFocus:!0,children:oe})]})});function Ct(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function wt(e){return Qe(e.scrollHeight,e.clientHeight)}function Tt(e){return ze.getScale(e)}function Et(e,t,n){return e/n[t]}function Dt(e,t){return ae({x:Et(e.x,`x`,t),y:Et(e.y,`y`,t),width:Et(e.width,`x`,t),height:Et(e.height,`y`,t)})}var Ot=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function kt(e){let{style:t}=e,n={};for(let[e,r]of Ot)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Ot){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var At=X.createContext(void 0);function jt(){let e=X.useContext(At);if(!e)throw Error(j(57));return e}var Mt=X.memo(X.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...u}=e,d=X.useRef(null),f=H({guess:!0,label:o,textRef:d}),p=$(),{props:m,multiple:h,disabled:g,readOnly:_,isItemEqualToValue:v}=p.useState(`itemRoot`),y=g||s,b=p.useState(`isActive`,f.index),x=p.useState(`open`),S=p.useState(`isSelected`,a),C=p.useState(`isSelectedByFocus`,f.index),w=f.index,T=X.useRef(null);U(()=>{let e=p.context.valuesRef.current;return e[w]=a,()=>{delete e[w]}},[w,a,p]),U(()=>{let e=p.state.value,t=p.state.selectedIndex,n=t,r;h&&Array.isArray(e)?(n=xe(w,a,p.context.valuesRef.current,e,v,t),r=n===w,w===t&&!r&&(p.context.selectedItemTextRef.current=null)):(r=e!==void 0&&Te(a,e,v),r&&(n=w)),p.set(`selectedIndex`,n),r&&d.current&&(p.context.selectedItemTextRef.current=d.current)},[w,h,v,p,a]);let E=X.useRef(`mouse`),k=X.useRef(!1),{getButtonProps:A,buttonRef:j}=se({disabled:y,focusableWhenDisabled:!0,native:c,composite:!0}),M={disabled:y,selected:S,highlighted:b};function N(e){if(g||_)return;let t=p.state.value;if(h){let n=Array.isArray(t)?t:[],r=S?De(n,a,v):[...n,a];p.context.setValue(r,P(D,e))}else p.context.setValue(a,P(D,e)),p.context.setOpen(!1,P(D,e))}function F(){p.context.selectionRef.current.dragY=0}let I={role:`option`,"aria-selected":S,tabIndex:x&&b?0:-1,onKeyDown(e){p.set(`activeIndex`,w),e.key===` `&&p.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&O(e.nativeEvent)&&(n!==void 0||b),i=t&&!r&&!k.current;k.current=!1,y||i||N(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=p.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,k.current=!0,F()},onMouseUp(){if(F(),y||E.current===`touch`||k.current)return;let e=!p.context.selectionRef.current.allowSelectedMouseUp&&S,t=!p.context.selectionRef.current.allowUnselectedMouseUp&&!S;e||t||(k.current=!0,T.current?.click(),k.current=!1)}},L=l(`div`,e,{ref:[j,t,f.ref,T],state:M,props:[m,I,u,A]}),R=X.useMemo(()=>({selected:S,index:w,textRef:d,selectedByFocus:C}),[S,w,d,C]);return(0,Z.jsx)(At.Provider,{value:R,children:L})})),Nt=X.memo(X.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=X.useRef(null),{transitionStatus:u,setMounted:d}=K(o),f=l(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:u},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:G});return S({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||d(!1)}}),f})),Pt=X.forwardRef(function(e,t){let{selected:n}=jt();return e.keepMounted||n?(0,Z.jsx)(Nt,{...e,selected:n,ref:t}):null}),Ft=X.memo(X.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=jt(),a=$(),{render:o,className:s,style:c,...u}=e,d=X.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]);return l(`div`,e,{ref:[d,t,r],props:u})})),It=`relative flex h-9 w-full min-w-0 items-center gap-2 rounded-control border border-rule bg-page pr-9 pl-3 text-left text-sm text-text outline-none transition-colors focus-visible:border-accent data-popup-open:border-accent disabled:cursor-not-allowed disabled:opacity-60`,Lt=`pointer-events-none size-4 text-muted`,Rt=`max-h-[min(var(--available-height),20rem)] min-w-(--anchor-width) overflow-y-auto rounded-card border border-rule bg-surface p-1 text-text shadow-float outline-none transition-[opacity,transform] duration-150 data-ending-style:-translate-y-1 data-ending-style:opacity-0 data-starting-style:-translate-y-1 data-starting-style:opacity-0`,zt=`relative flex cursor-default items-center rounded-[6px] py-1.5 pr-8 pl-2.5 text-sm outline-none select-none data-disabled:opacity-50 data-highlighted:bg-accent-soft`,Bt=`pointer-events-none absolute right-2.5 size-4 text-accent`;function Vt(e){return(0,Z.jsx)(et,{"data-slot":`select`,...e})}function Ht({className:e,children:t,...n}){return(0,Z.jsxs)(it,{"data-slot":`select-trigger`,className:q(It,e),...n,children:[t,(0,Z.jsx)(st,{className:`absolute right-3 flex`,children:(0,Z.jsx)(oe,{name:`chevron`,className:Lt})})]})}function Ut({className:e,...t}){return(0,Z.jsx)(ot,{"data-slot":`select-value`,className:q(`truncate`,e),...t})}function Wt({className:e,...t}){return(0,Z.jsx)(ct,{children:(0,Z.jsx)(mt,{alignItemWithTrigger:!1,sideOffset:6,className:`z-40`,children:(0,Z.jsx)(St,{"data-slot":`select-content`,className:q(Rt,e),...t})})})}function Gt({className:e,children:t,...n}){return(0,Z.jsxs)(Mt,{"data-slot":`select-item`,className:q(zt,e),...n,children:[(0,Z.jsx)(Ft,{className:`truncate`,children:t}),(0,Z.jsx)(Pt,{className:Bt,children:(0,Z.jsx)(oe,{name:`check`,className:`size-4`})})]})}export{Vt as a,Ht as c,Nt as d,Ke as f,Rt as i,Ut as l,He as m,zt as n,Wt as o,Q as p,Bt as r,Gt as s,Lt as t,It as u};
@@ -1 +1 @@
1
- import{t as e}from"./companion-view-C_N237bf.js";import{a as t,n,t as r}from"./jsx-runtime-MZURdZre.js";import{Lr as i,ct as a,et as o,it as s,nt as c,ot as l,r as u,rt as d}from"./button-amJ3g5oD.js";import{t as f}from"./cn-BQPKiwI4.js";import{n as p,r as m,t as h}from"./panel-C4bf_h2W.js";import{i as g}from"./steps-CKUno4lh.js";import{d as _,z as v}from"./studio-queries-BflKt9va.js";import{t as y}from"./markdown-view-jMiaBTSO.js";import{c as b}from"./index-Qx7reRPD.js";var x=t(n(),1),S=r(),C=`flex w-full min-w-0 items-center gap-2.5 rounded-control border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-surface-soft aria-[current=true]:bg-accent-soft`;function w(e){return e<1024?`${e} B`:`${(e/1024).toFixed(+(e<10240))} KB`}function T({companion:e,agent:t,name:n}){let[r,a]=(0,x.useState)(void 0),o=i({..._(e,t,n,r),placeholderData:v});if(!o.data)return(0,S.jsx)(p,{title:`Files`,children:o.isError?(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,role:`alert`,children:o.error instanceof Error?o.error.message:`The skill could not be read.`}):(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Listing files…`})});let{files:s,truncated:c,open:l}=o.data;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(p,{title:`Files`,aside:c?`first ${s.length}`:s.length,children:(0,S.jsx)(`ul`,{className:`m-0 -mx-2 grid list-none gap-0.5 p-0`,children:s.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:C,"aria-current":l?.path===e.path?`true`:void 0,"data-skill-file":e.path,onClick:()=>a(e.path),children:[(0,S.jsx)(u,{name:`doc`,className:`flex-none text-muted`}),(0,S.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.path}),(0,S.jsx)(`span`,{className:`ml-auto flex-none font-mono text-2xs text-muted`,children:w(e.size)})]})},e.path))})}),l?(0,S.jsxs)(`section`,{className:f(`grid gap-2.5 px-5 py-4`,o.isPlaceholderData&&`opacity-60`),"aria-label":`File ${l.path}`,children:[(0,S.jsx)(`code`,{className:`truncate font-mono text-xs text-muted`,children:l.path}),l.nodes?(0,S.jsx)(`div`,{className:`prose-panel`,children:(0,S.jsx)(y,{nodes:l.nodes})}):(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:l.note})]}):null]})}var E=[{id:`claude`,label:`Claude`,dir:`.claude/skills`,invoke:e=>`/${e}`},{id:`opencode`,label:`OpenCode`,dir:`.opencode/skills`,invoke:e=>`@${e}`},{id:`agents`,label:`Agents`,dir:`.agents/skills`,invoke:e=>`$${e}`}],D=new Set([`mate-grilling`,`mate-domain-modeling`]);function O(){let e=new Map;for(let t of g({}).paths[0]?.steps??[]){t.skill&&!e.has(t.skill)&&e.set(t.skill,t.label);for(let n of t.alternatives??[])e.has(n.name)||e.set(n.name,t.label)}return e}function k(e,t){let n=[...t.keys()],r=e.filter(e=>t.has(e)).toSorted((e,t)=>n.indexOf(e)-n.indexOf(t)),i=e.filter(e=>D.has(e)),a=e.filter(e=>e.startsWith(`mate-`)&&!t.has(e)&&!D.has(e)),o=e.filter(e=>!e.startsWith(`mate-`)&&!t.has(e));return[{title:`Delivery Path`,hint:`In the order a change meets them`,names:r},{title:`Other Mate skills`,hint:`Run when you need them`,names:a},{title:`Used by other skills`,hint:`Loaded for you, not started on their own`,names:i},{title:`Other skills`,hint:`Installed besides Mate`,names:o}].filter(e=>e.names.length>0)}function A({skills:e,companion:t}){let n=e??{claude:[],opencode:[],agents:[]},[r,i]=(0,x.useState)(`claude`),[u,g]=(0,x.useState)(null),_=O(),v=E.find(e=>e.id===r);return(0,S.jsxs)(`section`,{className:f(s,`grid content-start gap-3 pb-10`),"aria-label":`Agent skills`,"data-skills-root":!0,children:[(0,S.jsx)(l,{label:`Agent`,value:r,onChange:e=>{i(e),g(null)},options:E.map(e=>({value:e.id,label:e.label,count:n[e.id].length}))}),E.map(e=>{let t=e.id===r,i=n[e.id];return(0,S.jsx)(`div`,{id:`skills-panel-${e.id}`,className:t?`grid gap-3`:`hidden`,"aria-hidden":!t,"data-skill-panel":e.id,"data-active":t,children:i.length===0?(0,S.jsxs)(c,{children:[e.label,` has no skills in this companion.`]}):k(i,_).map(e=>(0,S.jsx)(d,{title:e.title,count:e.names.length,hint:e.hint,children:(0,S.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.names.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:f(a,`grid grid-cols-[minmax(0,1fr)_auto] py-1.5`),"aria-current":t&&u===e?`true`:void 0,"data-skill":e,onClick:()=>g(e),children:[(0,S.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e}),_.has(e)?(0,S.jsx)(`span`,{className:`text-xs text-muted`,children:_.get(e)}):null]})},e))})},e.title))},e.id)}),(0,S.jsx)(m,{items:k(n[r],_).flatMap(e=>e.names),current:u,onSelect:g,wide:t!==void 0,title:u?`Skill ${u}`:`Skill`,children:u?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(h,{mono:!0,title:u,kicker:_.has(u)?(0,S.jsxs)(`span`,{children:[`Delivery Path · `,_.get(u)]}):(0,S.jsx)(`span`,{children:v.label})}),(0,S.jsx)(p,{title:`Start`,children:D.has(u)?(0,S.jsx)(`p`,{className:`m-0 text-sm`,children:`Used by other skills: they load it when they need it, so it has no start command.`}):(0,S.jsx)(o,{text:v.invoke(u),label:`start command`})}),(0,S.jsx)(p,{title:`Installed for`,children:(0,S.jsx)(`ul`,{className:`m-0 grid list-none gap-1.5 p-0`,children:E.filter(e=>n[e.id].includes(u)).map(e=>(0,S.jsxs)(`li`,{className:`flex items-center gap-3 text-sm`,children:[(0,S.jsx)(`span`,{className:`w-20 text-muted`,children:e.label}),(0,S.jsxs)(`code`,{className:`truncate font-mono text-xs`,children:[e.dir,`/`,u,`/`]})]},e.id))})}),t?(0,S.jsx)(T,{companion:t,agent:r,name:u},`${r}/${u}`):null]}):null})]})}var j=function(){let t=b.useSearch();return(0,S.jsx)(e,{view:`skills`,search:t,children:e=>(0,S.jsx)(A,{skills:e.skillInventory,companion:t.companion})})};export{j as component};
1
+ import{t as e}from"./companion-view-C1F0_jbt.js";import{a as t,n,t as r}from"./jsx-runtime-MZURdZre.js";import{Lr as i,ct as a,et as o,it as s,nt as c,ot as l,r as u,rt as d}from"./button-C9SQW3kI.js";import{t as f}from"./cn-DC80MJV0.js";import{n as p,r as m,t as h}from"./panel-COgk0vP5.js";import{i as g}from"./steps-tVDWn7j6.js";import{d as _,z as v}from"./studio-queries-CkUSByy7.js";import{t as y}from"./markdown-view-dku7MGPn.js";import{c as b}from"./index-zmRH87D4.js";var x=t(n(),1),S=r(),C=`flex w-full min-w-0 items-center gap-2.5 rounded-control border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-surface-soft aria-[current=true]:bg-accent-soft`;function w(e){return e<1024?`${e} B`:`${(e/1024).toFixed(+(e<10240))} KB`}function T({companion:e,agent:t,name:n}){let[r,a]=(0,x.useState)(void 0),o=i({..._(e,t,n,r),placeholderData:v});if(!o.data)return(0,S.jsx)(p,{title:`Files`,children:o.isError?(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,role:`alert`,children:o.error instanceof Error?o.error.message:`The skill could not be read.`}):(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Listing files…`})});let{files:s,truncated:c,open:l}=o.data;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(p,{title:`Files`,aside:c?`first ${s.length}`:s.length,children:(0,S.jsx)(`ul`,{className:`m-0 -mx-2 grid list-none gap-0.5 p-0`,children:s.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:C,"aria-current":l?.path===e.path?`true`:void 0,"data-skill-file":e.path,onClick:()=>a(e.path),children:[(0,S.jsx)(u,{name:`doc`,className:`flex-none text-muted`}),(0,S.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.path}),(0,S.jsx)(`span`,{className:`ml-auto flex-none font-mono text-2xs text-muted`,children:w(e.size)})]})},e.path))})}),l?(0,S.jsxs)(`section`,{className:f(`grid gap-2.5 px-5 py-4`,o.isPlaceholderData&&`opacity-60`),"aria-label":`File ${l.path}`,children:[(0,S.jsx)(`code`,{className:`truncate font-mono text-xs text-muted`,children:l.path}),l.nodes?(0,S.jsx)(`div`,{className:`prose-panel`,children:(0,S.jsx)(y,{nodes:l.nodes})}):(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:l.note})]}):null]})}var E=[{id:`claude`,label:`Claude`,dir:`.claude/skills`,invoke:e=>`/${e}`},{id:`opencode`,label:`OpenCode`,dir:`.opencode/skills`,invoke:e=>`@${e}`},{id:`agents`,label:`Agents`,dir:`.agents/skills`,invoke:e=>`$${e}`}],D=new Set([`mate-grilling`,`mate-domain-modeling`]);function O(){let e=new Map;for(let t of g({}).paths[0]?.steps??[]){t.skill&&!e.has(t.skill)&&e.set(t.skill,t.label);for(let n of t.alternatives??[])e.has(n.name)||e.set(n.name,t.label)}return e}function k(e,t){let n=[...t.keys()],r=e.filter(e=>t.has(e)).toSorted((e,t)=>n.indexOf(e)-n.indexOf(t)),i=e.filter(e=>D.has(e)),a=e.filter(e=>e.startsWith(`mate-`)&&!t.has(e)&&!D.has(e)),o=e.filter(e=>!e.startsWith(`mate-`)&&!t.has(e));return[{title:`Delivery Path`,hint:`In the order a change meets them`,names:r},{title:`Other Mate skills`,hint:`Run when you need them`,names:a},{title:`Used by other skills`,hint:`Loaded for you, not started on their own`,names:i},{title:`Other skills`,hint:`Installed besides Mate`,names:o}].filter(e=>e.names.length>0)}function A({skills:e,companion:t}){let n=e??{claude:[],opencode:[],agents:[]},[r,i]=(0,x.useState)(`claude`),[u,g]=(0,x.useState)(null),_=O(),v=E.find(e=>e.id===r);return(0,S.jsxs)(`section`,{className:f(s,`grid content-start gap-3 pb-10`),"aria-label":`Agent skills`,"data-skills-root":!0,children:[(0,S.jsx)(l,{label:`Agent`,value:r,onChange:e=>{i(e),g(null)},options:E.map(e=>({value:e.id,label:e.label,count:n[e.id].length}))}),E.map(e=>{let t=e.id===r,i=n[e.id];return(0,S.jsx)(`div`,{id:`skills-panel-${e.id}`,className:t?`grid gap-3`:`hidden`,"aria-hidden":!t,"data-skill-panel":e.id,"data-active":t,children:i.length===0?(0,S.jsxs)(c,{children:[e.label,` has no skills in this companion.`]}):k(i,_).map(e=>(0,S.jsx)(d,{title:e.title,count:e.names.length,hint:e.hint,children:(0,S.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.names.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:f(a,`grid grid-cols-[minmax(0,1fr)_auto] py-1.5`),"aria-current":t&&u===e?`true`:void 0,"data-skill":e,onClick:()=>g(e),children:[(0,S.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e}),_.has(e)?(0,S.jsx)(`span`,{className:`text-xs text-muted`,children:_.get(e)}):null]})},e))})},e.title))},e.id)}),(0,S.jsx)(m,{items:k(n[r],_).flatMap(e=>e.names),current:u,onSelect:g,wide:t!==void 0,title:u?`Skill ${u}`:`Skill`,children:u?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(h,{mono:!0,title:u,kicker:_.has(u)?(0,S.jsxs)(`span`,{children:[`Delivery Path · `,_.get(u)]}):(0,S.jsx)(`span`,{children:v.label})}),(0,S.jsx)(p,{title:`Start`,children:D.has(u)?(0,S.jsx)(`p`,{className:`m-0 text-sm`,children:`Used by other skills: they load it when they need it, so it has no start command.`}):(0,S.jsx)(o,{text:v.invoke(u),label:`start command`})}),(0,S.jsx)(p,{title:`Installed for`,children:(0,S.jsx)(`ul`,{className:`m-0 grid list-none gap-1.5 p-0`,children:E.filter(e=>n[e.id].includes(u)).map(e=>(0,S.jsxs)(`li`,{className:`flex items-center gap-3 text-sm`,children:[(0,S.jsx)(`span`,{className:`w-20 text-muted`,children:e.label}),(0,S.jsxs)(`code`,{className:`truncate font-mono text-xs`,children:[e.dir,`/`,u,`/`]})]},e.id))})}),t?(0,S.jsx)(T,{companion:t,agent:r,name:u},`${r}/${u}`):null]}):null})]})}var j=function(){let t=b.useSearch();return(0,S.jsx)(e,{view:`skills`,search:t,children:e=>(0,S.jsx)(A,{skills:e.skillInventory,companion:t.companion})})};export{j as component};
@@ -1 +1 @@
1
- import"./studio-0ueISxwP.js";import{t as e}from"./companion-view-C_N237bf.js";import{n as t,r as n}from"./specs-view-CdE2rlli.js";import{s as r}from"./index-Qx7reRPD.js";import{t as i}from"./jsx-runtime-MZURdZre.js";function a(e){return(e.actions??[]).flatMap(({id:e,runAgents:t,copyAgents:r})=>{let i=n(e);return i?[{action:i,runAgents:t,copyAgents:r}]:[]})}var o=i(),s=function(){let n=r.useSearch(),i=r.useNavigate();return(0,o.jsx)(e,{view:`specs`,search:n,children:e=>(0,o.jsx)(t,{payload:{specs:e.specs??[],warnings:e.warnings},actions:a(e),companion:n.companion,filter:{q:n.q,repo:n.repo,area:n.area},onFilterChange:e=>void i({search:t=>({...t,q:e.q||void 0,repo:e.repo,area:e.area}),replace:!0})})})};export{s as component};
1
+ import"./studio-ndtFcS2Y.js";import{t as e}from"./companion-view-C1F0_jbt.js";import{n as t,r as n}from"./specs-view-znqFPx9p.js";import{s as r}from"./index-zmRH87D4.js";import{t as i}from"./jsx-runtime-MZURdZre.js";function a(e){return(e.actions??[]).flatMap(({id:e,runAgents:t,copyAgents:r})=>{let i=n(e);return i?[{action:i,runAgents:t,copyAgents:r}]:[]})}var o=i(),s=function(){let n=r.useSearch(),i=r.useNavigate();return(0,o.jsx)(e,{view:`specs`,search:n,children:e=>(0,o.jsx)(t,{payload:{specs:e.specs??[],warnings:e.warnings},actions:a(e),companion:n.companion,filter:{q:n.q,repo:n.repo,area:n.area},onFilterChange:e=>void i({search:t=>({...t,q:e.q||void 0,repo:e.repo,area:e.area}),replace:!0})})})};export{s as component};
@@ -1 +1 @@
1
- import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{Lr as r,ct as i,it as a,lt as o,nt as s,r as c,rt as l}from"./button-amJ3g5oD.js";import{it as u,m as d}from"./studio-queries-BflKt9va.js";import{t as f}from"./cn-BQPKiwI4.js";import"./studio-0ueISxwP.js";import{t as p}from"./fields-BAiGkJ5N.js";import{a as m,c as h,l as g,o as _,s as v}from"./select-BHYYWPhK.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./combobox-CJ7aGFid.js";import{t as T}from"./markdown-view-jMiaBTSO.js";import{n as ee,r as E,t as te}from"./panel-C4bf_h2W.js";import{t as D}from"./warnings-CqOOGlPD.js";var O=[`binds`,`in`,`mentions`,`co-change`],k=`Repository root`,A=e=>`spec:${e}`,j=(e,t)=>`openspec/changes/archive/${e}/${t}`,M=e=>`openspec/specs/${e}/spec.md`,ne=/^[a-z0-9][a-z0-9-]{0,63}$/,re=[{id:`show-me`,skill:`mate-show-me`,label:`Show me`,subject:`spec`,prompts:{claude:e=>`/mate-show-me ${e}`,opencode:e=>`Use the mate-show-me skill on spec ${e}.`}}];function N(e){return re.find(t=>t.id===e)??null}var P=e(t(),1),F=`unassigned`,I=e=>e??`(none)`;function L(e){return e.flatMap(e=>e.scopes.length===0?[{repository:null,area:F,spec:e}]:e.scopes.map(t=>({repository:t.repository??null,area:t.area??F,spec:e})))}function R(e,t){return e===t?0:e===null?1:t===null?-1:e.localeCompare(t)}var z=e=>new Set(e.map(e=>e.spec.capability)).size;function B(e,t){let n=L(e),r=Map.groupBy(n,e=>I(e.repository)),i=[...r.entries()].map(([e,t])=>({value:e,repository:t[0].repository,count:z(t)})).toSorted((e,t)=>R(e.repository,t.repository)),a=t!==void 0&&r.get(t)||n;return{repositories:i,areas:[...Map.groupBy(a,e=>`${I(e.repository)}\n${e.area}`).values()].map(e=>{let{repository:t,area:n}=e[0];return{repo:I(t),repository:t,area:n,count:z(e)}}).toSorted((e,t)=>R(e.repository,t.repository)||e.area.localeCompare(t.area))}}function V({repositories:e,areas:t},n){let r=n.q?.trim(),i=e.some(e=>e.value===n.repo)?n.repo:void 0,a=i!==void 0&&t.some(e=>e.area===n.area)?n.area:void 0;return{...r?{q:r}:{},...i===void 0?{}:{repo:i},...a===void 0?{}:{area:a}}}function H(e,t){if(t.repo!==void 0&&I(e.repository)!==t.repo||t.area!==void 0&&e.area!==t.area)return!1;if(!t.q)return!0;let n=t.q.toLowerCase();return e.spec.capability.toLowerCase().includes(n)||e.area.toLowerCase().includes(n)}function U(e,t={}){let n=L(e).filter(e=>H(e,t));return[...Map.groupBy(n,e=>I(e.repository)).values()].map(e=>({repository:e[0].repository,areas:[...Map.groupBy(e,e=>e.area)].map(([e,t])=>({area:e,specs:[...new Set(t.map(e=>e.spec))]})).toSorted((e,t)=>e.area.localeCompare(t.area))})).toSorted((e,t)=>R(e.repository,t.repository))}var W=n(),G=[];function K(e){return e.valid===!1?(0,W.jsx)(o,{marker:`issue`,children:`${e.issueCount??0} issues`}):e.valid===!0?(0,W.jsx)(o,{marker:`done`,children:`valid`}):(0,W.jsx)(o,{marker:`idle`,children:`unvalidated`})}var q=`.`,J=e=>e===q?k:e,Y=e=>e??`No repository`,ie=({repository:e,area:t})=>[e,t===void 0?void 0:J(t)].filter(Boolean).join(` · `),ae=200;function X(e){return e===void 0?`requirements unknown`:`${e} ${e===1?`requirement`:`requirements`}`}var oe={};function se({payload:e,actions:t=G,companion:n,filter:r=oe,onFilterChange:i}){let[a,o]=(0,P.useState)(r);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(D,{warnings:e.warnings}),(0,W.jsx)(pe,{specs:e.specs,actions:t,companion:n,filter:i?r:a,onFilterChange:i??o})]})}var Z={key:``,label:`All Areas`},ce=(e,t)=>e.key===t.key,le=e=>e.label;function ue({specs:e,options:{repositories:t,areas:n},filter:r,search:i,onSearch:a,onChange:o}){let s=r.repo!==void 0,c=[{value:``,label:`All repositories`},...t.map(e=>({value:e.value,label:`${Y(e.repository)} (${e.count})`}))],l=[Z,...n.map(e=>{let t=s?J(e.area):`${Y(e.repository)} · ${J(e.area)}`;return{key:`${e.repo}\n${e.area}`,label:`${t} (${e.count})`,option:e}})],u=l.find(e=>e.option?.repo===r.repo&&e.option?.area===r.area)??Z;return(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`search`,"aria-label":`Filter specs`,children:[(0,W.jsx)(p,{type:`search`,className:`w-64 max-sm:w-full`,placeholder:`Search capability or Area`,"aria-label":`Search specs`,value:i,onChange:e=>a(e.currentTarget.value)}),(0,W.jsxs)(m,{items:c,value:r.repo??``,onValueChange:t=>{let n=t||void 0,i=B(e,n).areas.some(e=>e.repo===n&&e.area===r.area);o({...r,repo:n,area:i?r.area:void 0})},children:[(0,W.jsx)(h,{className:`w-auto max-w-72`,"aria-label":`Repository`,children:(0,W.jsx)(g,{})}),(0,W.jsx)(_,{children:c.map(e=>(0,W.jsx)(v,{value:e.value,children:e.label},e.value))})]}),(0,W.jsxs)(w,{items:l,value:u,onValueChange:e=>o(e?.option?{...r,repo:e.option.repo,area:e.option.area}:{...r,area:void 0}),isItemEqualToValue:ce,itemToStringLabel:le,children:[(0,W.jsx)(b,{className:`w-80 max-sm:w-full`,"aria-label":`Area`,placeholder:`All Areas`}),(0,W.jsxs)(x,{children:[(0,W.jsx)(C,{children:`No Areas match`}),(0,W.jsx)(S,{children:e=>(0,W.jsx)(y,{value:e,children:e.label},e.key)})]})]})]})}var Q=`inline-flex h-7 items-center gap-1.5 rounded-[6px] border border-rule bg-surface px-2.5 text-xs text-text hover:border-accent hover:bg-accent-soft`;function de({capability:e,actions:t}){return!ne.test(e)||t.length===0?null:(0,W.jsx)(`span`,{className:`spec-actions flex flex-wrap items-center gap-1.5`,children:t.map(({action:t,runAgents:n,copyAgents:r})=>(0,W.jsxs)(P.Fragment,{children:[n.length>0?(0,W.jsxs)(`button`,{type:`button`,className:f(Q,`spec-action`),"data-studio-action":t.id,"data-studio-subject":e,"data-studio-agents":n.join(` `),children:[(0,W.jsx)(c,{name:`play`,className:`size-3.5`}),t.label]}):null,(0,W.jsxs)(`button`,{type:`button`,className:f(Q,`spec-copy`),"aria-label":`Copy prompt`,"data-studio-copy-prompt":t.id,"data-prompt-claude":r.includes(`claude`)?t.prompts.claude(e):void 0,"data-prompt-opencode":r.includes(`opencode`)?t.prompts.opencode(e):void 0,children:[(0,W.jsx)(c,{name:`copy`,className:`size-3.5`}),`Copy prompt`]})]},t.id))})}function fe({specs:e,open:t,onOpen:n}){return(0,W.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,className:f(i,`grid grid-cols-[minmax(0,1fr)_auto_120px] py-1.5 max-sm:grid-cols-[minmax(0,1fr)_auto]`),"aria-current":t===e.capability?`true`:void 0,"data-spec":e.capability,onClick:()=>n(e.capability),children:[(0,W.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.capability}),e.valid===!0?(0,W.jsx)(`span`,{}):K(e),(0,W.jsx)(`span`,{className:`text-right text-xs text-muted tabular-nums max-sm:hidden`,children:X(e.requirementCount)})]})},e.capability))})}function pe({specs:e,actions:t,companion:n,filter:r,onFilterChange:i}){let[o,c]=(0,P.useState)(r.q??``),[u,d]=(0,P.useState)(r.q);r.q!==u&&(d(r.q),(r.q??``)!==o.trim()&&c(r.q??``));let p=(0,P.useRef)(void 0);(0,P.useEffect)(()=>()=>clearTimeout(p.current),[]);let m=B(e,r.repo),h=V(m,{...r,q:o}),g=e=>{clearTimeout(p.current),i(e)},_=e=>{c(e),clearTimeout(p.current),p.current=setTimeout(()=>i({...h,q:e.trim()}),ae)},v=()=>{c(``),g({})},y=U(e,h),[b,x]=(0,P.useState)(null),S=[...new Set(y.flatMap(e=>e.areas.flatMap(e=>e.specs.map(e=>e.capability))))],C=e.find(e=>e.capability===b)??null;return(0,W.jsxs)(`section`,{className:f(a,`grid content-start gap-3 pb-10`),"aria-label":`Specs by repository and Area`,children:[e.length===0?(0,W.jsx)(s,{children:`No specs in this companion.`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ue,{specs:e,options:m,filter:h,search:o,onSearch:_,onChange:e=>g({...e,q:o.trim()})}),y.length===0?(0,W.jsxs)(s,{className:`flex flex-wrap items-center gap-3`,children:[`No spec matches the search and filters.`,(0,W.jsx)(`button`,{type:`button`,className:Q,onClick:v,children:`Clear filters`})]}):y.map(e=>(0,W.jsxs)(`section`,{className:`grid content-start gap-3`,"aria-label":`Repository ${Y(e.repository)}`,children:[(0,W.jsx)(`h2`,{className:`m-0 mt-2 font-mono text-sm font-semibold text-muted`,children:Y(e.repository)}),e.areas.map(({area:e,specs:t})=>(0,W.jsx)(l,{level:3,title:e===q?J(e):(0,W.jsx)(`span`,{className:`font-mono`,children:e}),label:`Area ${e}`,count:t.length,children:(0,W.jsx)(fe,{specs:t,open:b,onOpen:x})},e))]},e.repository??``))]}),(0,W.jsx)(E,{items:S,current:C?.capability??null,onSelect:x,wide:!0,title:C?`Spec ${C.capability}`:`Spec`,children:C?(0,W.jsx)($,{spec:C,actions:t,companion:n}):null})]})}function $({spec:e,actions:t=G,companion:n,withStatus:i=!0,children:a}){let o=M(e.capability),s=r({...d(n??``,{path:o}),enabled:!!n}),l=s.data?.open?.markdown;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(te,{mono:!0,title:e.capability,kicker:(0,W.jsxs)(W.Fragment,{children:[i?K(e):null,(0,W.jsx)(`span`,{className:`ml-auto`,children:e.scopes.map(ie).join(`, `)})]}),children:(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(de,{capability:e.capability,actions:t}),(0,W.jsxs)(u,{className:`inline-flex items-center gap-1.5 text-sm`,to:`/vault`,search:e=>({companion:e.companion,studioMode:e.studioMode,path:o}),children:[(0,W.jsx)(c,{name:`external`,className:`size-3.5`}),` Open in Vault`]})]})}),a,(0,W.jsx)(ee,{title:`Spec`,aside:e.requirementCount===void 0?void 0:X(e.requirementCount),children:l?(0,W.jsx)(`div`,{className:`prose-panel`,children:(0,W.jsx)(T,{nodes:l})}):(0,W.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:s.isError?`The spec file could not be read.`:s.isPending&&n?`Loading…`:`The spec file could not be read.`})})]})}export{k as a,O as i,se as n,j as o,N as r,A as s,$ as t};
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{Lr as r,ct as i,it as a,lt as o,nt as s,r as c,rt as l}from"./button-C9SQW3kI.js";import{it as u,m as d}from"./studio-queries-CkUSByy7.js";import{t as f}from"./cn-DC80MJV0.js";import"./studio-ndtFcS2Y.js";import{t as p}from"./fields-CEep8IFT.js";import{a as m,c as h,l as g,o as _,s as v}from"./select-CYFCbHUd.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./combobox-D7mKYCBb.js";import{t as T}from"./markdown-view-dku7MGPn.js";import{n as ee,r as E,t as te}from"./panel-COgk0vP5.js";import{t as D}from"./warnings-Cnw99ugO.js";var O=[`binds`,`in`,`mentions`,`co-change`],k=`Repository root`,A=e=>`spec:${e}`,j=(e,t)=>`openspec/changes/archive/${e}/${t}`,M=e=>`openspec/specs/${e}/spec.md`,ne=/^[a-z0-9][a-z0-9-]{0,63}$/,re=[{id:`show-me`,skill:`mate-show-me`,label:`Show me`,subject:`spec`,prompts:{claude:e=>`/mate-show-me ${e}`,opencode:e=>`Use the mate-show-me skill on spec ${e}.`}}];function N(e){return re.find(t=>t.id===e)??null}var P=e(t(),1),F=`unassigned`,I=e=>e??`(none)`;function L(e){return e.flatMap(e=>e.scopes.length===0?[{repository:null,area:F,spec:e}]:e.scopes.map(t=>({repository:t.repository??null,area:t.area??F,spec:e})))}function R(e,t){return e===t?0:e===null?1:t===null?-1:e.localeCompare(t)}var z=e=>new Set(e.map(e=>e.spec.capability)).size;function B(e,t){let n=L(e),r=Map.groupBy(n,e=>I(e.repository)),i=[...r.entries()].map(([e,t])=>({value:e,repository:t[0].repository,count:z(t)})).toSorted((e,t)=>R(e.repository,t.repository)),a=t!==void 0&&r.get(t)||n;return{repositories:i,areas:[...Map.groupBy(a,e=>`${I(e.repository)}\n${e.area}`).values()].map(e=>{let{repository:t,area:n}=e[0];return{repo:I(t),repository:t,area:n,count:z(e)}}).toSorted((e,t)=>R(e.repository,t.repository)||e.area.localeCompare(t.area))}}function V({repositories:e,areas:t},n){let r=n.q?.trim(),i=e.some(e=>e.value===n.repo)?n.repo:void 0,a=i!==void 0&&t.some(e=>e.area===n.area)?n.area:void 0;return{...r?{q:r}:{},...i===void 0?{}:{repo:i},...a===void 0?{}:{area:a}}}function H(e,t){if(t.repo!==void 0&&I(e.repository)!==t.repo||t.area!==void 0&&e.area!==t.area)return!1;if(!t.q)return!0;let n=t.q.toLowerCase();return e.spec.capability.toLowerCase().includes(n)||e.area.toLowerCase().includes(n)}function U(e,t={}){let n=L(e).filter(e=>H(e,t));return[...Map.groupBy(n,e=>I(e.repository)).values()].map(e=>({repository:e[0].repository,areas:[...Map.groupBy(e,e=>e.area)].map(([e,t])=>({area:e,specs:[...new Set(t.map(e=>e.spec))]})).toSorted((e,t)=>e.area.localeCompare(t.area))})).toSorted((e,t)=>R(e.repository,t.repository))}var W=n(),G=[];function K(e){return e.valid===!1?(0,W.jsx)(o,{marker:`issue`,children:`${e.issueCount??0} issues`}):e.valid===!0?(0,W.jsx)(o,{marker:`done`,children:`valid`}):(0,W.jsx)(o,{marker:`idle`,children:`unvalidated`})}var q=`.`,J=e=>e===q?k:e,Y=e=>e??`No repository`,ie=({repository:e,area:t})=>[e,t===void 0?void 0:J(t)].filter(Boolean).join(` · `),ae=200;function X(e){return e===void 0?`requirements unknown`:`${e} ${e===1?`requirement`:`requirements`}`}var oe={};function se({payload:e,actions:t=G,companion:n,filter:r=oe,onFilterChange:i}){let[a,o]=(0,P.useState)(r);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(D,{warnings:e.warnings}),(0,W.jsx)(pe,{specs:e.specs,actions:t,companion:n,filter:i?r:a,onFilterChange:i??o})]})}var Z={key:``,label:`All Areas`},ce=(e,t)=>e.key===t.key,le=e=>e.label;function ue({specs:e,options:{repositories:t,areas:n},filter:r,search:i,onSearch:a,onChange:o}){let s=r.repo!==void 0,c=[{value:``,label:`All repositories`},...t.map(e=>({value:e.value,label:`${Y(e.repository)} (${e.count})`}))],l=[Z,...n.map(e=>{let t=s?J(e.area):`${Y(e.repository)} · ${J(e.area)}`;return{key:`${e.repo}\n${e.area}`,label:`${t} (${e.count})`,option:e}})],u=l.find(e=>e.option?.repo===r.repo&&e.option?.area===r.area)??Z;return(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`search`,"aria-label":`Filter specs`,children:[(0,W.jsx)(p,{type:`search`,className:`w-64 max-sm:w-full`,placeholder:`Search capability or Area`,"aria-label":`Search specs`,value:i,onChange:e=>a(e.currentTarget.value)}),(0,W.jsxs)(m,{items:c,value:r.repo??``,onValueChange:t=>{let n=t||void 0,i=B(e,n).areas.some(e=>e.repo===n&&e.area===r.area);o({...r,repo:n,area:i?r.area:void 0})},children:[(0,W.jsx)(h,{className:`w-auto max-w-72`,"aria-label":`Repository`,children:(0,W.jsx)(g,{})}),(0,W.jsx)(_,{children:c.map(e=>(0,W.jsx)(v,{value:e.value,children:e.label},e.value))})]}),(0,W.jsxs)(w,{items:l,value:u,onValueChange:e=>o(e?.option?{...r,repo:e.option.repo,area:e.option.area}:{...r,area:void 0}),isItemEqualToValue:ce,itemToStringLabel:le,children:[(0,W.jsx)(b,{className:`w-80 max-sm:w-full`,"aria-label":`Area`,placeholder:`All Areas`}),(0,W.jsxs)(x,{children:[(0,W.jsx)(C,{children:`No Areas match`}),(0,W.jsx)(S,{children:e=>(0,W.jsx)(y,{value:e,children:e.label},e.key)})]})]})]})}var Q=`inline-flex h-7 items-center gap-1.5 rounded-[6px] border border-rule bg-surface px-2.5 text-xs text-text hover:border-accent hover:bg-accent-soft`;function de({capability:e,actions:t}){return!ne.test(e)||t.length===0?null:(0,W.jsx)(`span`,{className:`spec-actions flex flex-wrap items-center gap-1.5`,children:t.map(({action:t,runAgents:n,copyAgents:r})=>(0,W.jsxs)(P.Fragment,{children:[n.length>0?(0,W.jsxs)(`button`,{type:`button`,className:f(Q,`spec-action`),"data-studio-action":t.id,"data-studio-subject":e,"data-studio-agents":n.join(` `),children:[(0,W.jsx)(c,{name:`play`,className:`size-3.5`}),t.label]}):null,(0,W.jsxs)(`button`,{type:`button`,className:f(Q,`spec-copy`),"aria-label":`Copy prompt`,"data-studio-copy-prompt":t.id,"data-prompt-claude":r.includes(`claude`)?t.prompts.claude(e):void 0,"data-prompt-opencode":r.includes(`opencode`)?t.prompts.opencode(e):void 0,children:[(0,W.jsx)(c,{name:`copy`,className:`size-3.5`}),`Copy prompt`]})]},t.id))})}function fe({specs:e,open:t,onOpen:n}){return(0,W.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,className:f(i,`grid grid-cols-[minmax(0,1fr)_auto_120px] py-1.5 max-sm:grid-cols-[minmax(0,1fr)_auto]`),"aria-current":t===e.capability?`true`:void 0,"data-spec":e.capability,onClick:()=>n(e.capability),children:[(0,W.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.capability}),e.valid===!0?(0,W.jsx)(`span`,{}):K(e),(0,W.jsx)(`span`,{className:`text-right text-xs text-muted tabular-nums max-sm:hidden`,children:X(e.requirementCount)})]})},e.capability))})}function pe({specs:e,actions:t,companion:n,filter:r,onFilterChange:i}){let[o,c]=(0,P.useState)(r.q??``),[u,d]=(0,P.useState)(r.q);r.q!==u&&(d(r.q),(r.q??``)!==o.trim()&&c(r.q??``));let p=(0,P.useRef)(void 0);(0,P.useEffect)(()=>()=>clearTimeout(p.current),[]);let m=B(e,r.repo),h=V(m,{...r,q:o}),g=e=>{clearTimeout(p.current),i(e)},_=e=>{c(e),clearTimeout(p.current),p.current=setTimeout(()=>i({...h,q:e.trim()}),ae)},v=()=>{c(``),g({})},y=U(e,h),[b,x]=(0,P.useState)(null),S=[...new Set(y.flatMap(e=>e.areas.flatMap(e=>e.specs.map(e=>e.capability))))],C=e.find(e=>e.capability===b)??null;return(0,W.jsxs)(`section`,{className:f(a,`grid content-start gap-3 pb-10`),"aria-label":`Specs by repository and Area`,children:[e.length===0?(0,W.jsx)(s,{children:`No specs in this companion.`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ue,{specs:e,options:m,filter:h,search:o,onSearch:_,onChange:e=>g({...e,q:o.trim()})}),y.length===0?(0,W.jsxs)(s,{className:`flex flex-wrap items-center gap-3`,children:[`No spec matches the search and filters.`,(0,W.jsx)(`button`,{type:`button`,className:Q,onClick:v,children:`Clear filters`})]}):y.map(e=>(0,W.jsxs)(`section`,{className:`grid content-start gap-3`,"aria-label":`Repository ${Y(e.repository)}`,children:[(0,W.jsx)(`h2`,{className:`m-0 mt-2 font-mono text-sm font-semibold text-muted`,children:Y(e.repository)}),e.areas.map(({area:e,specs:t})=>(0,W.jsx)(l,{level:3,title:e===q?J(e):(0,W.jsx)(`span`,{className:`font-mono`,children:e}),label:`Area ${e}`,count:t.length,children:(0,W.jsx)(fe,{specs:t,open:b,onOpen:x})},e))]},e.repository??``))]}),(0,W.jsx)(E,{items:S,current:C?.capability??null,onSelect:x,wide:!0,title:C?`Spec ${C.capability}`:`Spec`,children:C?(0,W.jsx)($,{spec:C,actions:t,companion:n}):null})]})}function $({spec:e,actions:t=G,companion:n,withStatus:i=!0,children:a}){let o=M(e.capability),s=r({...d(n??``,{path:o}),enabled:!!n}),l=s.data?.open?.markdown;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(te,{mono:!0,title:e.capability,kicker:(0,W.jsxs)(W.Fragment,{children:[i?K(e):null,(0,W.jsx)(`span`,{className:`ml-auto`,children:e.scopes.map(ie).join(`, `)})]}),children:(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(de,{capability:e.capability,actions:t}),(0,W.jsxs)(u,{className:`inline-flex items-center gap-1.5 text-sm`,to:`/vault`,search:e=>({companion:e.companion,studioMode:e.studioMode,path:o}),children:[(0,W.jsx)(c,{name:`external`,className:`size-3.5`}),` Open in Vault`]})]})}),a,(0,W.jsx)(ee,{title:`Spec`,aside:e.requirementCount===void 0?void 0:X(e.requirementCount),children:l?(0,W.jsx)(`div`,{className:`prose-panel`,children:(0,W.jsx)(T,{nodes:l})}):(0,W.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:s.isError?`The spec file could not be read.`:s.isPending&&n?`Loading…`:`The spec file could not be read.`})})]})}export{k as a,O as i,se as n,j as o,N as r,A as s,$ as t};
@@ -1 +1 @@
1
- import{S as e,c as t,d as n,f as r,l as i,o as a,p as o,s,u as c,y as l}from"./studio-0ueISxwP.js";var u=o();function d(e){return e===`review`?`reviews`:`reviews-${e}`}function f(e){return e.kind===`human`?d(e.group):e.id}var p=[`mate-clarify-intent`,`mate-interview-me`,`mate-grill-me`],m={"mate-clarify-intent":`Default. Reads what the request already states and routes to an interview, grilling, or skip, then runs that one mode.`,"mate-interview-me":`Explicit mode: guided, one-question-at-a-time clarification when intent, constraints, or scope still need confirmation.`,"mate-grill-me":`Explicit mode: round-based stress test of a mostly known direction to surface hidden assumptions and risks.`},h={"clarify-intent":{what:`Settles who the change is for, why it is needed, how success is measured, and what binds it, before any artifact exists.`,why:`Intent gaps are cheapest to close before exploration turns them into documents.`},explore:{what:`Resolves repository evidence, unknowns, and options, with scope taken from the companion context map, and suggests slicing a large feature.`,why:`It separates uncertainty from the proposal's committed scope.`},propose:{what:`Chooses the schema from the minimal eligibility test, checks slicing when explore agreed none, and writes the change's planning artifacts in one prompt.`,why:`One prompt writes every artifact; each one is then reviewed on its own.`},apply:{what:`Records the delivery branch, avoiding protected branches, then implements the reviewed tasks.`,why:`The recorded branch is what submit and publication later wait on.`},"inspect-outcome":{what:`Shows what the applied change did as a rendered diagram and diff in a Mate report.`,why:`Seeing the result tells the reviewer whether cleanup is warranted.`},"refine-code":{what:`Looks for smaller, clearer code once tests pass, preserving behavior.`,why:`Cleanup lands before submit, so shipped code and recorded specs agree.`},submit:{what:`Records the delivery, validates the change, and pushes its Delivery Group's change folders for publication; allowed before the branch merges.`,why:`The finished change is safe on the remote and publishable from any machine once merged.`},publish:{what:`Archives submitted Delivery Groups whose delivery branches are merged, from any machine, and commits and pushes them, chosen by the developer.`,why:`Published canonical specs then describe the default branch; unmerged changes wait.`}};function g(e,t,n){return{what:(t?.schemaName===n?t.artifacts.find(t=>t.id===e)?.description:void 0)??`A person reviews the ${e} artifact.`,why:`Reviews stay with people: Mate never marks them approved.`}}function _(e){return{what:`Runs ${e.steps.map(e=>e.skill).join(`, then `)}.`,why:`The companion declares this stage in ${r}.`}}function v(t,n){if(t.kind===`human`)return null;if(t.id===`clarify-intent`)return`/${t.skill} about ${e}`;let r=t.id===`propose`&&n!==`mate-full`?` (use schema: ${n})`:``;return`/${t.skill}${r} for ${l}`}function y(t){return t&&t.replace(` ${l}`,``).replace(` ${e}`,``)}function b(t){return p.filter(t).map(t=>({name:t,description:m[t],prompt:`/${t} about ${e}`,copyPrompt:`/${t} about`}))}var x=new Set([`mate-explore-change`,`mate-propose-change`,`mate-apply-change`]);function S(e,t){return e.id===`submit`?t.submitArtifact===n:e.steps.some(e=>x.has(e.skill))}function C(e,t){if(e.kind===`human`)return[`human-review`];let n=e.optional?[`optional`,`skill`]:[`skill`];return S(e,t)&&n.push(`openspec`),n}var w={"mate-full":{tagline:`full planning`,description:`Full planning path: proposal, specs, design, and tasks.`},"mate-minimal":{tagline:`minimal planning`,description:`Short path: specs and tasks only, for one-Area, low-risk changes with clear intent.`}};function T(e){let n=t(e);return Object.hasOwn(w,n)?w[n]:{tagline:`custom schema`,description:`Planning path of the ${e} schema.`}}var E={plan:`Plan`,review:`Review`,build:`Build`,ship:`Ship`},D=new Set([`submit`,`publish`]);function O(e){let t=e.findLastIndex(e=>e.kind===`human`),n=t===-1?e.findIndex(e=>e.id===`apply`):t+1;return e.map((e,t)=>e.kind===`human`?`review`:D.has(e.id)?`ship`:n!==-1&&t>=n?`build`:`plan`)}function k(e){return e.kind===`human`?`human:${e.group}`:e.optional?`optional`:null}function A(e){let t=[];for(let n of e){let e=k(n),r=t.at(-1);e&&r?.key===e?r.steps.push(n):t.push({group:n.kind===`human`?`human`:e?`optional`:null,key:e,steps:[n]})}return t.map(e=>e.group===`human`||e.group===`optional`&&e.steps.length>1?{kind:`group`,group:e.group,steps:e.steps}:{kind:`stage`,step:e.steps[0]})}function j(e,t,n){let r=n.skills?new Set(n.skills):null,a=e=>!r||r.has(e),o=n.workflow??u,s=i(t,o),c=O(s.stages),l=s.stages.map((t,r)=>{let i=t.kind===`human`?g(t.artifact,n.topology,e):t.steps.some(e=>e.own)&&t.id in h?h[t.id]:_(t),s=v(t,e),l={...t,what:i.what,why:i.why,badges:C(t,o),prompt:s,copyPrompt:y(s),phase:c[r]};if(t.id===`clarify-intent`&&t.skill===p[0]&&(l.alternatives=b(a)),t.kind===`skill`){let e=[t.skill,...t.steps.map(e=>e.skill)].find(e=>!a(e));e&&(l.missingSkill=e)}return t.id===`apply`&&(l.sessionBreakBefore=!0),l});return{schema:e,label:e,...T(e),steps:l,map:A(l),reviewsKnown:s.reviewsKnown,stepsKnown:n.workflow!==null}}function M(e,t){return t?.schemaName===e?t.artifacts.map(e=>e.id):c(e)?a[e]:void 0}function N(e={}){let n=e.topology&&{...e.topology,schemaName:t(e.topology.schemaName)},r={...e,topology:n},i=n?.schemaName;return{paths:(i&&!c(i)?[i]:s).map(e=>j(e,M(e,n),r))}}export{N as i,f as n,d as r,E as t};
1
+ import{S as e,c as t,d as n,f as r,l as i,o as a,p as o,s,u as c,y as l}from"./studio-ndtFcS2Y.js";var u=o();function d(e){return e===`review`?`reviews`:`reviews-${e}`}function f(e){return e.kind===`human`?d(e.group):e.id}var p=[`mate-clarify-intent`,`mate-interview-me`,`mate-grill-me`],m={"mate-clarify-intent":`Default. Reads what the request already states and routes to an interview, grilling, or skip, then runs that one mode.`,"mate-interview-me":`Explicit mode: guided, one-question-at-a-time clarification when intent, constraints, or scope still need confirmation.`,"mate-grill-me":`Explicit mode: round-based stress test of a mostly known direction to surface hidden assumptions and risks.`},h={"clarify-intent":{what:`Settles who the change is for, why it is needed, how success is measured, and what binds it, before any artifact exists.`,why:`Intent gaps are cheapest to close before exploration turns them into documents.`},explore:{what:`Resolves repository evidence, unknowns, and options, with scope taken from the companion context map, and suggests slicing a large feature.`,why:`It separates uncertainty from the proposal's committed scope.`},propose:{what:`Chooses the schema from the minimal eligibility test, checks slicing when explore agreed none, and writes the change's planning artifacts in one prompt.`,why:`One prompt writes every artifact; each one is then reviewed on its own.`},apply:{what:`Records the delivery branch, avoiding protected branches, then implements the reviewed tasks.`,why:`The recorded branch is what submit and publication later wait on.`},"inspect-outcome":{what:`Shows what the applied change did as a rendered diagram and diff in a Mate report.`,why:`Seeing the result tells the reviewer whether cleanup is warranted.`},"refine-code":{what:`Looks for smaller, clearer code once tests pass, preserving behavior.`,why:`Cleanup lands before submit, so shipped code and recorded specs agree.`},submit:{what:`Records the delivery, validates the change, and pushes its Delivery Group's change folders for publication; allowed before the branch merges.`,why:`The finished change is safe on the remote and publishable from any machine once merged.`},publish:{what:`Archives submitted Delivery Groups whose delivery branches are merged, from any machine, and commits and pushes them, chosen by the developer.`,why:`Published canonical specs then describe the default branch; unmerged changes wait.`}};function g(e,t,n){return{what:(t?.schemaName===n?t.artifacts.find(t=>t.id===e)?.description:void 0)??`A person reviews the ${e} artifact.`,why:`Reviews stay with people: Mate never marks them approved.`}}function _(e){return{what:`Runs ${e.steps.map(e=>e.skill).join(`, then `)}.`,why:`The companion declares this stage in ${r}.`}}function v(t,n){if(t.kind===`human`)return null;if(t.id===`clarify-intent`)return`/${t.skill} about ${e}`;let r=t.id===`propose`&&n!==`mate-full`?` (use schema: ${n})`:``;return`/${t.skill}${r} for ${l}`}function y(t){return t&&t.replace(` ${l}`,``).replace(` ${e}`,``)}function b(t){return p.filter(t).map(t=>({name:t,description:m[t],prompt:`/${t} about ${e}`,copyPrompt:`/${t} about`}))}var x=new Set([`mate-explore-change`,`mate-propose-change`,`mate-apply-change`]);function S(e,t){return e.id===`submit`?t.submitArtifact===n:e.steps.some(e=>x.has(e.skill))}function C(e,t){if(e.kind===`human`)return[`human-review`];let n=e.optional?[`optional`,`skill`]:[`skill`];return S(e,t)&&n.push(`openspec`),n}var w={"mate-full":{tagline:`full planning`,description:`Full planning path: proposal, specs, design, and tasks.`},"mate-minimal":{tagline:`minimal planning`,description:`Short path: specs and tasks only, for one-Area, low-risk changes with clear intent.`}};function T(e){let n=t(e);return Object.hasOwn(w,n)?w[n]:{tagline:`custom schema`,description:`Planning path of the ${e} schema.`}}var E={plan:`Plan`,review:`Review`,build:`Build`,ship:`Ship`},D=new Set([`submit`,`publish`]);function O(e){let t=e.findLastIndex(e=>e.kind===`human`),n=t===-1?e.findIndex(e=>e.id===`apply`):t+1;return e.map((e,t)=>e.kind===`human`?`review`:D.has(e.id)?`ship`:n!==-1&&t>=n?`build`:`plan`)}function k(e){return e.kind===`human`?`human:${e.group}`:e.optional?`optional`:null}function A(e){let t=[];for(let n of e){let e=k(n),r=t.at(-1);e&&r?.key===e?r.steps.push(n):t.push({group:n.kind===`human`?`human`:e?`optional`:null,key:e,steps:[n]})}return t.map(e=>e.group===`human`||e.group===`optional`&&e.steps.length>1?{kind:`group`,group:e.group,steps:e.steps}:{kind:`stage`,step:e.steps[0]})}function j(e,t,n){let r=n.skills?new Set(n.skills):null,a=e=>!r||r.has(e),o=n.workflow??u,s=i(t,o),c=O(s.stages),l=s.stages.map((t,r)=>{let i=t.kind===`human`?g(t.artifact,n.topology,e):t.steps.some(e=>e.own)&&t.id in h?h[t.id]:_(t),s=v(t,e),l={...t,what:i.what,why:i.why,badges:C(t,o),prompt:s,copyPrompt:y(s),phase:c[r]};if(t.id===`clarify-intent`&&t.skill===p[0]&&(l.alternatives=b(a)),t.kind===`skill`){let e=[t.skill,...t.steps.map(e=>e.skill)].find(e=>!a(e));e&&(l.missingSkill=e)}return t.id===`apply`&&(l.sessionBreakBefore=!0),l});return{schema:e,label:e,...T(e),steps:l,map:A(l),reviewsKnown:s.reviewsKnown,stepsKnown:n.workflow!==null}}function M(e,t){return t?.schemaName===e?t.artifacts.map(e=>e.id):c(e)?a[e]:void 0}function N(e={}){let n=e.topology&&{...e.topology,schemaName:t(e.topology.schemaName)},r={...e,topology:n},i=n?.schemaName;return{paths:(i&&!c(i)?[i]:s).map(e=>j(e,M(e,n),r))}}export{N as i,f as n,d as r,E as t};
@@ -1 +1 @@
1
- import{i as e,kr as t}from"./button-amJ3g5oD.js";function n(n,r,i=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new e({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:n,floatingId:r,syncOnly:!0,nested:i,onOpenChange:void 0}),floatingId:r,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:t,inactiveTriggerProps:t,popupProps:t}}var r=e=>e.triggerIdProp??e.activeTriggerId,i=e=>e.openProp??e.open,a=e=>(e.popupElement?.id??e.floatingId)||void 0;function o(e,t){return t!==void 0&&i(e)&&r(e)===t}function s(e,t){return o(e,t)?!0:t!==void 0&&i(e)&&r(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var c={open:i,mounted:e=>e.mounted,transitionStatus:e=>i(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:r,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:a,isTriggerActive:(e,t)=>t!==void 0&&r(e)===t,isOpenedByTrigger:(e,t)=>o(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&r(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>s(e,t)?a(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{c as n,n as t};
1
+ import{i as e,kr as t}from"./button-C9SQW3kI.js";function n(n,r,i=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new e({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:n,floatingId:r,syncOnly:!0,nested:i,onOpenChange:void 0}),floatingId:r,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:t,inactiveTriggerProps:t,popupProps:t}}var r=e=>e.triggerIdProp??e.activeTriggerId,i=e=>e.openProp??e.open,a=e=>(e.popupElement?.id??e.floatingId)||void 0;function o(e,t){return t!==void 0&&i(e)&&r(e)===t}function s(e,t){return o(e,t)?!0:t!==void 0&&i(e)&&r(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var c={open:i,mounted:e=>e.mounted,transitionStatus:e=>i(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:r,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:a,isTriggerActive:(e,t)=>t!==void 0&&r(e)===t,isOpenedByTrigger:(e,t)=>o(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&r(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>s(e,t)?a(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{c as n,n as t};