@mrpatronz/nexusflow 2.7.0 → 2.8.1

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 (268) hide show
  1. package/README.md +16 -14
  2. package/dist/agent/ClaudeSdkAdapter.d.ts.map +1 -1
  3. package/dist/agent/ClaudeSdkAdapter.js +31 -8
  4. package/dist/agent/ClaudeSdkAdapter.js.map +1 -1
  5. package/dist/agent/ClaudeSdkAdapter.test.js +18 -6
  6. package/dist/agent/ClaudeSdkAdapter.test.js.map +1 -1
  7. package/dist/agent/CodexCliAdapter.d.ts +1 -1
  8. package/dist/agent/CodexCliAdapter.d.ts.map +1 -1
  9. package/dist/agent/CodexCliAdapter.js +5 -4
  10. package/dist/agent/CodexCliAdapter.js.map +1 -1
  11. package/dist/agent/CodexCliAdapter.test.js +16 -1
  12. package/dist/agent/CodexCliAdapter.test.js.map +1 -1
  13. package/dist/agent/CodexSdkAdapter.d.ts.map +1 -1
  14. package/dist/agent/CodexSdkAdapter.js +6 -0
  15. package/dist/agent/CodexSdkAdapter.js.map +1 -1
  16. package/dist/agent/ProviderRegistry.d.ts +5 -0
  17. package/dist/agent/ProviderRegistry.d.ts.map +1 -1
  18. package/dist/agent/ProviderRegistry.js +15 -0
  19. package/dist/agent/ProviderRegistry.js.map +1 -1
  20. package/dist/agent/ProviderRegistry.test.js +19 -0
  21. package/dist/agent/ProviderRegistry.test.js.map +1 -1
  22. package/dist/agent/adapters.d.ts.map +1 -1
  23. package/dist/agent/adapters.js +5 -0
  24. package/dist/agent/adapters.js.map +1 -1
  25. package/dist/agent/mcp-config.d.ts +16 -0
  26. package/dist/agent/mcp-config.d.ts.map +1 -0
  27. package/dist/agent/mcp-config.js +28 -0
  28. package/dist/agent/mcp-config.js.map +1 -0
  29. package/dist/agent/mcp-config.test.d.ts +2 -0
  30. package/dist/agent/mcp-config.test.d.ts.map +1 -0
  31. package/dist/agent/mcp-config.test.js +22 -0
  32. package/dist/agent/mcp-config.test.js.map +1 -0
  33. package/dist/agent/models.d.ts +10 -0
  34. package/dist/agent/models.d.ts.map +1 -0
  35. package/dist/agent/models.js +35 -0
  36. package/dist/agent/models.js.map +1 -0
  37. package/dist/agent/models.test.d.ts +2 -0
  38. package/dist/agent/models.test.d.ts.map +1 -0
  39. package/dist/agent/models.test.js +40 -0
  40. package/dist/agent/models.test.js.map +1 -0
  41. package/dist/agent/orchestrator.d.ts +65 -0
  42. package/dist/agent/orchestrator.d.ts.map +1 -0
  43. package/dist/agent/orchestrator.js +260 -0
  44. package/dist/agent/orchestrator.js.map +1 -0
  45. package/dist/agent/orchestrator.test.d.ts +2 -0
  46. package/dist/agent/orchestrator.test.d.ts.map +1 -0
  47. package/dist/agent/orchestrator.test.js +284 -0
  48. package/dist/agent/orchestrator.test.js.map +1 -0
  49. package/dist/agent/session.d.ts +1 -0
  50. package/dist/agent/session.d.ts.map +1 -1
  51. package/dist/agent/session.js +3 -2
  52. package/dist/agent/session.js.map +1 -1
  53. package/dist/agent/session.test.js +9 -0
  54. package/dist/agent/session.test.js.map +1 -1
  55. package/dist/agent/smoke-chat.test.d.ts +2 -0
  56. package/dist/agent/smoke-chat.test.d.ts.map +1 -0
  57. package/dist/agent/smoke-chat.test.js +166 -0
  58. package/dist/agent/smoke-chat.test.js.map +1 -0
  59. package/dist/commands/commands.test.js +3 -0
  60. package/dist/commands/commands.test.js.map +1 -1
  61. package/dist/commands/doctor.d.ts.map +1 -1
  62. package/dist/commands/doctor.js +2 -0
  63. package/dist/commands/doctor.js.map +1 -1
  64. package/dist/commands/init.d.ts +3 -1
  65. package/dist/commands/init.d.ts.map +1 -1
  66. package/dist/commands/init.js +9 -1
  67. package/dist/commands/init.js.map +1 -1
  68. package/dist/commands/knowledge.d.ts +9 -0
  69. package/dist/commands/knowledge.d.ts.map +1 -1
  70. package/dist/commands/knowledge.js +59 -2
  71. package/dist/commands/knowledge.js.map +1 -1
  72. package/dist/commands/knowledge.test.js +14 -1
  73. package/dist/commands/knowledge.test.js.map +1 -1
  74. package/dist/commands/mcp.d.ts +7 -1
  75. package/dist/commands/mcp.d.ts.map +1 -1
  76. package/dist/commands/mcp.js +7 -2
  77. package/dist/commands/mcp.js.map +1 -1
  78. package/dist/commands/progress.d.ts +4 -0
  79. package/dist/commands/progress.d.ts.map +1 -0
  80. package/dist/commands/progress.js +33 -0
  81. package/dist/commands/progress.js.map +1 -0
  82. package/dist/commands/refresh.d.ts +1 -0
  83. package/dist/commands/refresh.d.ts.map +1 -1
  84. package/dist/commands/refresh.js +17 -2
  85. package/dist/commands/refresh.js.map +1 -1
  86. package/dist/commands/remote.d.ts +4 -0
  87. package/dist/commands/remote.d.ts.map +1 -0
  88. package/dist/commands/remote.js +28 -0
  89. package/dist/commands/remote.js.map +1 -0
  90. package/dist/commands/status.d.ts.map +1 -1
  91. package/dist/commands/status.js +14 -1
  92. package/dist/commands/status.js.map +1 -1
  93. package/dist/commands/status.test.d.ts +2 -0
  94. package/dist/commands/status.test.d.ts.map +1 -0
  95. package/dist/commands/status.test.js +31 -0
  96. package/dist/commands/status.test.js.map +1 -0
  97. package/dist/core/analysis-cache.d.ts +13 -3
  98. package/dist/core/analysis-cache.d.ts.map +1 -1
  99. package/dist/core/analysis-cache.js +41 -31
  100. package/dist/core/analysis-cache.js.map +1 -1
  101. package/dist/core/analysis-cache.test.js +50 -8
  102. package/dist/core/analysis-cache.test.js.map +1 -1
  103. package/dist/core/doctor.d.ts.map +1 -1
  104. package/dist/core/doctor.js +61 -0
  105. package/dist/core/doctor.js.map +1 -1
  106. package/dist/core/generation-lock.d.ts +58 -0
  107. package/dist/core/generation-lock.d.ts.map +1 -0
  108. package/dist/core/generation-lock.js +233 -0
  109. package/dist/core/generation-lock.js.map +1 -0
  110. package/dist/core/generation-lock.test.d.ts +2 -0
  111. package/dist/core/generation-lock.test.d.ts.map +1 -0
  112. package/dist/core/generation-lock.test.js +134 -0
  113. package/dist/core/generation-lock.test.js.map +1 -0
  114. package/dist/core/isolate.test.js +30 -0
  115. package/dist/core/isolate.test.js.map +1 -1
  116. package/dist/core/knowledge.d.ts +20 -0
  117. package/dist/core/knowledge.d.ts.map +1 -1
  118. package/dist/core/knowledge.js +184 -36
  119. package/dist/core/knowledge.js.map +1 -1
  120. package/dist/core/knowledge.test.js +93 -15
  121. package/dist/core/knowledge.test.js.map +1 -1
  122. package/dist/core/locks.d.ts +4 -2
  123. package/dist/core/locks.d.ts.map +1 -1
  124. package/dist/core/locks.js +55 -7
  125. package/dist/core/locks.js.map +1 -1
  126. package/dist/core/locks.test.js +48 -0
  127. package/dist/core/locks.test.js.map +1 -1
  128. package/dist/core/progress.d.ts +21 -0
  129. package/dist/core/progress.d.ts.map +1 -0
  130. package/dist/core/progress.js +40 -0
  131. package/dist/core/progress.js.map +1 -0
  132. package/dist/core/progress.test.d.ts +2 -0
  133. package/dist/core/progress.test.d.ts.map +1 -0
  134. package/dist/core/progress.test.js +52 -0
  135. package/dist/core/progress.test.js.map +1 -0
  136. package/dist/core/refresh.d.ts +5 -0
  137. package/dist/core/refresh.d.ts.map +1 -1
  138. package/dist/core/refresh.js +25 -0
  139. package/dist/core/refresh.js.map +1 -1
  140. package/dist/core/refresh.test.js +20 -0
  141. package/dist/core/refresh.test.js.map +1 -1
  142. package/dist/core/status.d.ts +2 -0
  143. package/dist/core/status.d.ts.map +1 -1
  144. package/dist/core/status.js +6 -1
  145. package/dist/core/status.js.map +1 -1
  146. package/dist/core/sync.d.ts.map +1 -1
  147. package/dist/core/sync.js +22 -1
  148. package/dist/core/sync.js.map +1 -1
  149. package/dist/core/sync.test.js +27 -0
  150. package/dist/core/sync.test.js.map +1 -1
  151. package/dist/core/workspace-git.d.ts +15 -0
  152. package/dist/core/workspace-git.d.ts.map +1 -0
  153. package/dist/core/workspace-git.js +131 -0
  154. package/dist/core/workspace-git.js.map +1 -0
  155. package/dist/core/workspace-git.test.d.ts +2 -0
  156. package/dist/core/workspace-git.test.d.ts.map +1 -0
  157. package/dist/core/workspace-git.test.js +52 -0
  158. package/dist/core/workspace-git.test.js.map +1 -0
  159. package/dist/core/workspace-skills-workflow.integration.test.js +15 -0
  160. package/dist/core/workspace-skills-workflow.integration.test.js.map +1 -1
  161. package/dist/core/workspace.create.test.js +5 -2
  162. package/dist/core/workspace.create.test.js.map +1 -1
  163. package/dist/core/workspace.d.ts.map +1 -1
  164. package/dist/core/workspace.js +11 -6
  165. package/dist/core/workspace.js.map +1 -1
  166. package/dist/generators/antigravity.d.ts.map +1 -1
  167. package/dist/generators/antigravity.js +2 -1
  168. package/dist/generators/antigravity.js.map +1 -1
  169. package/dist/generators/base.d.ts.map +1 -1
  170. package/dist/generators/base.js +5 -3
  171. package/dist/generators/base.js.map +1 -1
  172. package/dist/generators/claude.d.ts.map +1 -1
  173. package/dist/generators/claude.js +4 -1
  174. package/dist/generators/claude.js.map +1 -1
  175. package/dist/generators/codex.d.ts.map +1 -1
  176. package/dist/generators/codex.js +2 -1
  177. package/dist/generators/codex.js.map +1 -1
  178. package/dist/generators/copilot.d.ts.map +1 -1
  179. package/dist/generators/copilot.js +4 -3
  180. package/dist/generators/copilot.js.map +1 -1
  181. package/dist/generators/cursor.d.ts.map +1 -1
  182. package/dist/generators/cursor.js +6 -3
  183. package/dist/generators/cursor.js.map +1 -1
  184. package/dist/generators/index.d.ts +2 -0
  185. package/dist/generators/index.d.ts.map +1 -1
  186. package/dist/generators/index.js +79 -45
  187. package/dist/generators/index.js.map +1 -1
  188. package/dist/generators/knowledge-migration.test.d.ts +2 -0
  189. package/dist/generators/knowledge-migration.test.d.ts.map +1 -0
  190. package/dist/generators/knowledge-migration.test.js +22 -0
  191. package/dist/generators/knowledge-migration.test.js.map +1 -0
  192. package/dist/generators/plan-generator.d.ts.map +1 -1
  193. package/dist/generators/plan-generator.js +18 -9
  194. package/dist/generators/plan-generator.js.map +1 -1
  195. package/dist/generators/plan-generator.test.js +4 -1
  196. package/dist/generators/plan-generator.test.js.map +1 -1
  197. package/dist/gui/assets/AgentsPage-B4fx43rd.js +3 -0
  198. package/dist/gui/assets/{CSPContext-BG7no5S_.js → CSPContext-DBUu9tE0.js} +1 -1
  199. package/dist/gui/assets/{DashboardPage-ByGTwAQa.js → DashboardPage-DH52G8IG.js} +1 -1
  200. package/dist/gui/assets/{GettingStartedPage-Xjx3M3RH.js → GettingStartedPage-BlTrQhvi.js} +1 -1
  201. package/dist/gui/assets/ProjectsPage-BPVSLPXv.js +1 -0
  202. package/dist/gui/assets/ScaffoldRepoInline-ywcpq9PX.js +1 -0
  203. package/dist/gui/assets/{SettingsPage-B9iN6hsv.js → SettingsPage-RQr8SalV.js} +1 -1
  204. package/dist/gui/assets/SkillsPage-CYoSRrwx.js +6 -0
  205. package/dist/gui/assets/StartWorkPage-DBKK4lFi.js +1 -0
  206. package/dist/gui/assets/{StrategiesPage-DDu3jwJx.js → StrategiesPage-C36TZgDX.js} +1 -1
  207. package/dist/gui/assets/WorkspacesPage-DxEONvSq.js +6 -0
  208. package/dist/gui/assets/{alert-dialog-CdqVrvZl.js → alert-dialog-CQAX2yRx.js} +1 -1
  209. package/dist/gui/assets/index-BF6pre6G.css +2 -0
  210. package/dist/gui/assets/index-C_rwnBzF.js +52 -0
  211. package/dist/gui/assets/isElementDisabled-uy_EOitH.js +1 -0
  212. package/dist/gui/assets/textarea-ByfoCb54.js +1 -0
  213. package/dist/gui/assets/{useAriaLabelledBy-DfRdwH8a.js → useAriaLabelledBy-ClesgjMe.js} +1 -1
  214. package/dist/gui/assets/useValueChanged-DeYvGnKs.js +1 -0
  215. package/dist/gui/assets/{vsc-D6UPv2ii.js → vsc-DFh0-53h.js} +1 -1
  216. package/dist/gui/index.html +5 -7
  217. package/dist/harness/claude.d.ts +3 -1
  218. package/dist/harness/claude.d.ts.map +1 -1
  219. package/dist/harness/claude.js +4 -2
  220. package/dist/harness/claude.js.map +1 -1
  221. package/dist/harness/codex.d.ts +3 -1
  222. package/dist/harness/codex.d.ts.map +1 -1
  223. package/dist/harness/codex.js +64 -12
  224. package/dist/harness/codex.js.map +1 -1
  225. package/dist/harness/contract.test.d.ts +2 -0
  226. package/dist/harness/contract.test.d.ts.map +1 -0
  227. package/dist/harness/contract.test.js +426 -0
  228. package/dist/harness/contract.test.js.map +1 -0
  229. package/dist/harness/harness.test.js +16 -1
  230. package/dist/harness/harness.test.js.map +1 -1
  231. package/dist/harness/types.d.ts +7 -1
  232. package/dist/harness/types.d.ts.map +1 -1
  233. package/dist/index.js +52 -5
  234. package/dist/index.js.map +1 -1
  235. package/dist/mcp/server.d.ts +8 -1
  236. package/dist/mcp/server.d.ts.map +1 -1
  237. package/dist/mcp/server.js +11 -6
  238. package/dist/mcp/server.js.map +1 -1
  239. package/dist/mcp/tools.d.ts +6 -2
  240. package/dist/mcp/tools.d.ts.map +1 -1
  241. package/dist/mcp/tools.js +232 -14
  242. package/dist/mcp/tools.js.map +1 -1
  243. package/dist/mcp/tools.test.js +130 -6
  244. package/dist/mcp/tools.test.js.map +1 -1
  245. package/dist/resources/materializer.d.ts.map +1 -1
  246. package/dist/resources/materializer.js +11 -3
  247. package/dist/resources/materializer.js.map +1 -1
  248. package/dist/server.d.ts.map +1 -1
  249. package/dist/server.js +37 -6
  250. package/dist/server.js.map +1 -1
  251. package/dist/server.test.js +37 -1
  252. package/dist/server.test.js.map +1 -1
  253. package/dist/types.d.ts +17 -0
  254. package/dist/types.d.ts.map +1 -1
  255. package/package.json +2 -1
  256. package/dist/gui/assets/AgentsPage-YyYRodOR.js +0 -3
  257. package/dist/gui/assets/ProjectsPage-BMdhqAGs.js +0 -1
  258. package/dist/gui/assets/ScaffoldRepoInline-gXyYSIz5.js +0 -1
  259. package/dist/gui/assets/SkillsPage-CxcsbIsQ.js +0 -6
  260. package/dist/gui/assets/StartWorkPage-DPVHcdy4.js +0 -1
  261. package/dist/gui/assets/WorkspacesPage-BWRmP0mY.js +0 -2
  262. package/dist/gui/assets/index-CZoZQkeC.css +0 -2
  263. package/dist/gui/assets/index-wy68EqfB.js +0 -50
  264. package/dist/gui/assets/isElementDisabled-D_fu2zfc.js +0 -1
  265. package/dist/gui/assets/store-D5DUHbxn.js +0 -3
  266. package/dist/gui/assets/styles-CVwNuFCx.js +0 -1
  267. package/dist/gui/assets/textarea-BNRuIXNs.js +0 -1
  268. package/dist/gui/assets/useValueChanged-CStSGSsD.js +0 -1
@@ -1 +1 @@
1
- import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,i as s,l as c,m as l,o as u,p as d,u as f,v as p}from"./button-BDDZnIHx.js";var m=p((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},t.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},t.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},t.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},t.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},t.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},t.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},t.useFormStatus=function(){return c.H.useHostTransitionStatus()},t.version=`19.2.7`})),h=p(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),_={[g.startingStyle]:``},v={[g.endingStyle]:``},y={transitionStatus(e){return e===`starting`?_:e===`ending`?v:null}},b=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=g.startingStyle]=`startingStyle`,e[e.endingStyle=g.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),x=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),S={[x.popupOpen]:``},C={[x.popupOpen]:``,[x.pressed]:``},w={[b.open]:``},T={[b.closed]:``},E={[b.anchorHidden]:``},D={open(e){return e?S:null}},O={open(e){return e?C:null}},k={open(e){return e?w:T},anchorHidden(e){return e?E:null}},A=`none`,j=`trigger-press`,M=`trigger-hover`,N=`trigger-focus`,ee=`outside-press`,P=`item-press`,F=`close-press`,te=`focus-out`,ne=`escape-key`,I=`list-navigation`,re=`cancel-open`,ie=`sibling-open`,ae=`disabled`,oe=`missing`,L=`initial`,se=`imperative-action`,R=`window-resize`,z=n(h(),1),B=o(),V=n(e(),1);function H({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=V.useRef(e!==void 0),[a,o]=V.useState(t);return[i?e:a,V.useCallback(e=>{i||o(e)},[])]}function ce(){return typeof window<`u`}function U(e){return ue(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function le(e){return((ue(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ue(e){return ce()?e instanceof Node||e instanceof W(e).Node:!1}function G(e){return ce()?e instanceof Element||e instanceof W(e).Element:!1}function K(e){return ce()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function de(e){return!ce()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function fe(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function pe(e){return/^(table|td|th)$/.test(U(e))}function me(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var he=/transform|translate|scale|rotate|perspective|filter/,ge=/paint|layout|strict|content/,_e=e=>!!e&&e!==`none`,ve;function ye(e){let t=G(e)?Ce(e):e;return _e(t.transform)||_e(t.translate)||_e(t.scale)||_e(t.rotate)||_e(t.perspective)||!xe()&&(_e(t.backdropFilter)||_e(t.filter))||he.test(t.willChange||``)||ge.test(t.contain||``)}function be(e){let t=Te(e);for(;K(t)&&!Se(t);){if(ye(t))return t;if(me(t))return null;t=Te(t)}return null}function xe(){return ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ve}function Se(e){return/^(html|body|#document)$/.test(U(e))}function Ce(e){return W(e).getComputedStyle(e)}function we(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Te(e){if(U(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||de(e)&&e.host||le(e);return de(t)?t.host:t}function Ee(e){let t=Te(e);return Se(t)?(e.ownerDocument||e).body:K(t)&&fe(t)?t:Ee(t)}function De(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ee(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=Oe(a);return t.concat(a,a.visualViewport||[],fe(r)?r:[],e&&n?De(e):[])}else return t.concat(r,De(r,[],n))}function Oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var ke={...V},Ae=ke.useInsertionEffect,je=Ae&&Ae!==ke.useLayoutEffect?Ae:e=>e();function q(e){let t=a(Me).current;return t.next=e,je(t.effect),t.trampoline}function Me(){let e={next:void 0,callback:Ne,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ne(){}var J=typeof document<`u`?V.useLayoutEffect:()=>{},Pe=V.createContext(void 0);function Fe(e=!1){let t=V.useContext(Pe);if(t===void 0&&!e)throw Error(d(16));return t}function Ie(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:V.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Le(e={}){let{disabled:n=!1,focusableWhenDisabled:r,tabIndex:i=0,native:a=!0,composite:o}=e,s=V.useRef(null),c=Fe(!0),l=o??c!==void 0,{props:d}=Ie({focusableWhenDisabled:r,disabled:n,composite:l,tabIndex:i,isNativeButton:a}),f=V.useCallback(()=>{let e=s.current;Re(e)&&l&&n&&d.disabled===void 0&&e.disabled&&(e.disabled=!1)},[n,d.disabled,l]);return J(f,[f]),{getButtonProps:V.useCallback((e={})=>{let{onClick:r,onMouseDown:i,onKeyUp:o,onKeyDown:s,onPointerDown:c,...f}=e;return u({onClick(e){if(n){e.preventDefault();return}r?.(e)},onMouseDown(e){n||i?.(e)},onKeyDown(e){if(n||(t(e),s?.(e),e.baseUIHandlerPrevented))return;let i=e.target===e.currentTarget,o=e.currentTarget,c=Re(o),u=!a&&ze(o),d=i&&(a?c:!u),f=e.key===`Enter`,p=e.key===` `,m=o.getAttribute(`role`),h=m?.startsWith(`menuitem`)||m===`option`||m===`gridcell`;if(i&&l&&p){if(e.defaultPrevented&&h)return;e.preventDefault(),u||a&&c?(o.click(),e.preventBaseUIHandler()):d&&(r?.(e),e.preventBaseUIHandler());return}d&&(!a&&(p||f)&&e.preventDefault(),!a&&f&&r?.(e))},onKeyUp(e){if(!n){if(t(e),o?.(e),e.target===e.currentTarget&&a&&l&&Re(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&e.key===` `&&r?.(e)}},onPointerDown(e){if(n){e.preventDefault();return}c?.(e)}},a?{type:`button`}:{role:`button`},d,f)},[n,d,l,a]),buttonRef:q(e=>{s.current=e,f()})}}function Re(e){return K(e)&&e.tagName===`BUTTON`}function ze(e){return!!(e?.tagName===`A`&&e?.href)}function Be(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ve,platform:He,maxTouchPoints:Ue}=Be(),We=Ve.toLowerCase(),Ge=He.toLowerCase(),Ke=/^i(os$|p)/.test(Ge)||Ge===`macintel`&&Ue>1,qe=`android`,Je=Ge===qe||We.includes(qe),Ye=!Ke&&Ge.startsWith(`mac`);Ge.startsWith(`win`),!Je&&/^(linux|chrome os)/.test(Ge);var Xe=Ye||Ke,Ze=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Ze&&We.includes(`firefox`),!Ze&&We.includes(`chrom`);var Qe=Xe,$e=/jsdom|happydom/.test(We),et=0;function tt(e,t=`mui`){let[n,r]=V.useState(e),i=e||n;return V.useEffect(()=>{n??(et+=1,r(`${t}-${et}`))},[n,t]),i}var nt=ke.useId;function rt(e,t){if(nt!==void 0){let n=nt();return e??(t?`${t}-${n}`:n)}return tt(e,t)}function it(e){return rt(e,`base-ui`)}function at(e,t,n,i){let a=!1,o=!1,s=i??r;return{reason:e,event:t??new Event(`base-ui`),cancel(){a=!0},allowPropagation(){o=!0},get isCanceled(){return a},get isPropagationAllowed(){return o},trigger:n,...s}}var ot=[];function st(e){V.useEffect(e,ot)}var ct=null;globalThis.requestAnimationFrame;var lt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},ut=class e{static create(){return new e}static request(e){return lt.request(e)}static cancel(e){return lt.cancel(e)}currentId=ct;request(e){this.cancel(),this.currentId=lt.request(()=>{this.currentId=ct,e()})}cancel=()=>{this.currentId!==ct&&(lt.cancel(this.currentId),this.currentId=ct)};disposeEffect=()=>this.cancel};function dt(){let e=a(ut.create).current;return st(e.disposeEffect),e}function ft(e,t=!1,n=!1){let[r,i]=V.useState(e&&t?`idle`:void 0),[a,o]=V.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),J(()=>{if(!e&&a&&r!==`ending`&&n){let e=ut.request(()=>{i(`ending`)});return()=>{ut.cancel(e)}}},[e,a,r,n]),J(()=>{if(!e||t)return;let n=ut.request(()=>{i(void 0)});return()=>{ut.cancel(n)}},[t,e]),J(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=ut.request(()=>{i(`idle`)});return()=>{ut.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Y(e){return e==null?e:`current`in e?e.current:e}function pt(e,t=!1,n=!0){let r=dt();return q((i,a=null)=>{r.cancel();let o=Y(e);if(o==null)return;let s=o,c=()=>{z.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=g.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function mt(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=q(i),o=pt(r,n,!1);V.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var ht=0,gt=class e{static create(){return new e}currentId=ht;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ht,t()},e)}isStarted(){return this.currentId!==ht}clear=()=>{this.currentId!==ht&&(clearTimeout(this.currentId),this.currentId=ht)};disposeEffect=()=>this.clear};function _t(){let e=a(gt.create).current;return st(e.disposeEffect),e}function vt(e){e.preventDefault(),e.stopPropagation()}function yt(e){return`nativeEvent`in e}function bt(e){return e.pointerType===``&&e.isTrusted?!0:Je&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function xt(e){return $e?!1:!Je&&e.width===0&&e.height===0||Je&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function St(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Ct(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var wt=`data-base-ui-focusable`,Tt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Et=`ArrowLeft`,Dt=`ArrowRight`,Ot=`ArrowUp`,kt=`ArrowDown`;function X(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&de(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function At(e){return`composedPath`in e?e.composedPath()[0]:e.target}function jt(e,t){if(!G(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Z(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Mt(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Nt(e){return e.matches(`html,body`)}function Pt(e){return K(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ft(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Tt}`)!=null}function It(e){return e?e.getAttribute(`role`)===`combobox`&&Pt(e):!1}function Lt(e){if(!e||$e)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Rt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Q(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function zt(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Bt(e){let t=a(Vt,e).current;return t.next=e,J(t.effect),t}function Vt(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function $(e){return e?.ownerDocument||document}var Ht={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Ut={...Ht,position:`fixed`,top:0,left:0},Wt={...Ht,position:`absolute`},Gt=V.forwardRef(function(e,t){let[n,r]=V.useState();J(()=>{Qe&&Ze&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,B.jsx)(`span`,{...e,ref:t,style:Ut,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Kt(e,t){return t<0||t>=e.length}function qt(e,t){return Yt(e.current,{disabledIndices:t})}function Jt(e,t){return Yt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Yt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Xt(e,a,r));return a}function Xt(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Qt(r)||!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Zt(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Qt(e,t=e?Ce(e):null){return!e||!e.isConnected||!t||Zt(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var $t=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function en(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return de(n)?n.host:null}function tn(e){for(let t of Array.from(e.children))if(U(t)===`summary`)return t;return null}function nn(e,t){let n=tn(t);return!!n&&(e===n||Z(n,e))}function rn(e){let t=e?U(e):``;return e!=null&&e.matches($t)&&(t!==`summary`||e.parentElement!=null&&U(e.parentElement)===`details`&&tn(e.parentElement)===e)&&(t!==`details`||tn(e)==null)&&(t!==`input`||e.type!==`hidden`)}function an(e){if(!rn(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=en(t)){let n=t!==e,r=U(t)===`slot`;if(t.hasAttribute(`inert`)||n&&U(t)===`details`&&!t.open&&!nn(e,t)||t.hasAttribute(`hidden`)||!r&&!on(t,n))return!1}return!0}function on(e,t){let n=Ce(e);return t?n.display!==`none`:Qt(e,n)}function sn(e){let t=e.tabIndex;if(t<0){let t=U(e);if(t===`details`||t===`audio`||t===`video`||K(e)&&e.isContentEditable)return 0}return t}function cn(e){if(U(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function ln(e,t){let n=cn(e);if(!n)return!0;let r=t.find(e=>{let t=cn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=cn(e);return t?.name===n.name&&t.form===n.form})===n}function un(e){if(K(e)&&U(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return K(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function dn(e,t){un(e).forEach(e=>{rn(e)&&t.push(e),dn(e,t)})}function fn(e,t,n){un(e).forEach(e=>{K(e)&&e.matches(t)&&n.push(e),fn(e,t,n)})}function pn(e){return an(e)&&sn(e)>=0}function mn(e){let t=[];return dn(e,t),t.filter(an)}function hn(e){let t=mn(e);return t.filter(e=>sn(e)>=0&&ln(e,t))}function gn(e,t){let n=hn(e),r=n.length;if(r===0)return;let i=X($(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function _n(e){return gn($(e).body,1)||e}function vn(e){return gn($(e).body,-1)||e}function yn(e,t){if(!e)return null;let n=hn($(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function bn(e){return yn(e,1)}function xn(e){return yn(e,-1)}function Sn(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function Cn(e){hn(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function wn(e){let t=[];fn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Tn(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Tn(e,t.id,n)])}function En(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Dn(e){return`data-base-ui-${e}`}var On=0;function kn(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(On);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),c;let o=requestAnimationFrame(a);return On=o,()=>{On===o&&(cancelAnimationFrame(o),On=0)}}var An={inert:new WeakMap,"aria-hidden":new WeakMap},jn=`data-base-ui-inert`,Mn={inert:new WeakSet,"aria-hidden":new WeakSet},Nn=new WeakMap,Pn=0;function Fn(e){return Mn[e]}function In(e){return e?de(e)?e.host:In(e.parentNode):null}var Ln=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=In(t);return e.contains(n)?n:null}).filter(e=>e!=null),Rn=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},zn=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{U(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Bn(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Ln(t,e),l=i?zn(t,Rn(c),new Set(c)):[],u=[],d=[];if(a){let e=An[a],n=Fn(a);s=n,o=e;let r=Ln(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);zn(t,Rn(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Nn.get(e)||0)+1;Nn.set(e,t),d.push(e),t===1&&e.setAttribute(jn,``)}),Pn+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Nn.get(e)||0)-1;Nn.set(e,t),t||e.removeAttribute(jn)}),--Pn,Pn||(An.inert=new WeakMap,An[`aria-hidden`]=new WeakMap,Mn.inert=new WeakSet,Mn[`aria-hidden`]=new WeakSet,Nn=new WeakMap)}}function Vn(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=$(e[0]).body;return Bn(e,a,n,r,{mark:i})}var Hn={style:{transition:`none`}},Un=`data-base-ui-click-trigger`,Wn={fallbackAxisSide:`none`},Gn={fallbackAxisSide:`end`},Kn={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},qn=V.createContext(null),Jn=()=>V.useContext(qn),Yn=Dn(`portal`);function Xn(e={}){let{ref:t,container:n,componentProps:i=r,elementProps:a}=e,o=rt(),c=Jn()?.portalNode,[l,u]=V.useState(null),[d,f]=V.useState(null),p=q(e=>{e!==null&&f(e)}),m=V.useRef(null);J(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}if(o==null)return;let e=(n&&(ue(n)?n:n.current))??c??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[n,c,o]);let h=s(`div`,i,{ref:[t,p],props:[{id:o,[Yn]:``},a]});return{portalNode:d,portalSubtree:l&&h?z.createPortal(h,l):null}}var Zn=V.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,renderGuards:s,...c}=e,{portalNode:l,portalSubtree:u}=Xn({container:o,ref:t,componentProps:e,elementProps:c}),d=V.useRef(null),f=V.useRef(null),p=V.useRef(null),m=V.useRef(null),[h,g]=V.useState(null),_=V.useRef(!1),v=h?.modal,y=h?.open,b=typeof s==`boolean`?s:!!h&&!h.modal&&h.open&&!!l;V.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&Sn(e)&&(e.type===`focusin`?_.current&&=(wn(l),!1):(Cn(l),_.current=!0))}return zt(Q(l,`focusin`,e,!0),Q(l,`focusout`,e,!0))},[l,v]),J(()=>{!l||y!==!0||!_.current||(wn(l),_.current=!1)},[y,l]);let x=V.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,B.jsxs)(V.Fragment,{children:[u,(0,B.jsxs)(qn.Provider,{value:x,children:[b&&l&&(0,B.jsx)(Gt,{"data-type":`outside`,ref:d,onFocus:e=>{Sn(e,l)?p.current?.focus():vn(h?h.domReference:null)?.focus()}}),b&&l&&(0,B.jsx)(`span`,{"aria-owns":l.id,style:Kn}),l&&z.createPortal(a,l),b&&l&&(0,B.jsx)(Gt,{"data-type":`outside`,ref:f,onFocus:e=>{Sn(e,l)?m.current?.focus():(_n(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,at(`focus-out`,e.nativeEvent)))}})]})]})});function Qn(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var $n=class{nodesRef={current:[]};events=Qn();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},er=V.createContext(null),tr=V.createContext(null),nr=()=>V.useContext(er)?.id||null,rr=e=>{let t=V.useContext(tr);return e??t};function ir(e){let t=rt(),n=rr(e),r=nr();return J(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function ar(e){let{children:t,id:n}=e,r=nr();return(0,B.jsx)(er.Provider,{value:V.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function or(e){let{children:t,externalTree:n}=e,r=a(()=>n??new $n).current;return(0,B.jsx)(tr.Provider,{value:r,children:t})}function sr(e,t){let n=W(At(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var cr=20,lr=[];function ur(){lr=lr.filter(e=>e.deref()?.isConnected)}function dr(e){ur(),e&&U(e)!==`body`&&(lr.push(new WeakRef(e)),lr.length>cr&&(lr=lr.slice(-20)))}function fr(){return ur(),lr[lr.length-1]?.deref()}function pr(e){return e?pn(e)?e:hn(e)[0]||e:null}function mr(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=mn(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return pn(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function hr(e){let{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=q(()=>x.current.floatingContext?.nodeId),C=a===!1,w=It(v)&&C,T=Bt(a),E=Bt(o),D=Bt(u),O=Bt(_),k=rr(m),A=Jn(),j=V.useRef(!1),M=V.useRef(!1),N=V.useRef(!1),ee=V.useRef(null),P=V.useRef(``),F=V.useRef(``),ne=V.useRef(null),I=V.useRef(null),re=i(ne,p,A?.beforeInsideRef),ie=i(I,A?.afterInsideRef),ae=_t(),oe=_t(),L=dt(),se=A!=null,R=Rt(y),z=q((e=R)=>e?hn(e):[]),H=q(()=>h?.().filter(e=>e!=null)??[]);V.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Z(R,X($(R)))&&z().length===0&&!w&&vt(e)}return Q($(R),`keydown`,e)},[r,R,c,w,z]),V.useEffect(()=>{if(r||!_)return;let e=$(R);function t(){N.current=!1}function n(e){let t=At(e),n=H(),r=Z(y,t)||Z(v,t)||Z(A?.portalNode,t)||n.some(e=>e===t||Z(e,t));N.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,oe.start(0,()=>{M.current=!1}))}function i(){F.current=`keyboard`}return zt(Q(e,`pointerdown`,n,!0),Q(e,`pointerup`,t,!0),Q(e,`pointercancel`,t,!0),Q(e,`keydown`,i,!0),t)},[r,y,v,R,_,A,oe,H]),V.useEffect(()=>{if(r||!l)return;let e=$(R);function t(){M.current=!0,oe.start(0,()=>{M.current=!1})}function n(e){let t=At(e);pn(t)&&(ee.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=At(t);c&&n==null&&i!=null&&Z(y,i)&&dr(i),queueMicrotask(()=>{let a=S(),o=g.context.triggerElements,l=H(),u=n?.hasAttribute(Dn(`focus-guard`))&&[ne.current,I.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Y(f),Y(d)].includes(n),p=!(Z(v,n)||Z(y,n)||Z(n,y)||Z(A?.portalNode,n)||l.some(e=>e===n||Z(e,n))||n!=null&&o.hasElement(n)||o.hasMatchingElement(e=>Z(e,n))||u||k&&(Tn(k.nodesRef.current,a).find(e=>Z(e.context?.elements.floating,n)||Z(e.context?.elements.domReference,n))||En(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Rt(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===v&&R&&mr(R),s&&r!==v&&!Qt(i)&&X(e)===e.body){if(K(R)&&(R.focus(),s===`popup`)){L.request(()=>{R.focus()});return}let e=z(),t=ee.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||R;K(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!c)&&n&&p&&!M.current&&(w||n!==fr())&&(j.current=!0,g.setOpen(!1,at(te,t)))})}function a(){N.current||(x.current.insideReactTree=!0,ae.start(0,()=>{x.current.insideReactTree=!1}))}let o=K(v)?v:null;if(!(!y&&!o))return zt(o&&Q(o,`focusout`,i),o&&Q(o,`pointerdown`,t),y&&Q(y,`focusin`,n),y&&Q(y,`focusout`,i),y&&A&&Q(y,`focusout`,a,!0))},[r,v,y,R,c,k,A,g,l,s,z,w,S,x,ae,oe,L,d,f,H]),V.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Dn(`portal`)}]`)||[]),t=(k?En(k.nodesRef.current,S()):[]).find(e=>It(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Vn([y,...e,ne.current,I.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...H(),t,Y(f),Y(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Vn([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,A,w,k,S,d,f,H]),J(()=>{if(!_||r||!K(R))return;let e=$(R),t=X(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Z(R,t))return;let i=null,a=()=>(i??=z(R),i[0]||R),o;o=r===!0||r===null?a():Y(r),o||=a();let s=Z(R,X(e));kn(o,{preventScroll:o===R,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=X(e);return!(t!==o&&Z(R,t))}})})},[r,_,R,z,T,D,O]),J(()=>{if(r||!R)return;let e=$(R),t=X(e),n=D.current==null;dr(t);function i(e){if(e.open||(P.current=sr(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`)if(e.nested)j.current=!1;else if(bt(e.nativeEvent)||xt(e.nativeEvent))j.current=!1;else{let e=!1;$(R).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}b.on(`openchange`,i);function a(){let e=E.current,r=typeof e==`function`?e(P.current):e;if(r===void 0||r===!1)return null;r===null&&(r=!0);let i=v?.isConnected?v:null,a=t?.isConnected&&U(t)!==`body`?t:null,o=n?a||i:i||a;return o||=fr()||null,typeof r==`boolean`?o:Y(r)||o||null}return()=>{b.off(`openchange`,i);let t=X(e),n=H(),r=Z(y,t)||n.some(e=>e===t||Z(e,t))||k&&Tn(k.nodesRef.current,S(),!1).some(e=>Z(e.context?.elements.floating,t)),o=E.current,s=a();queueMicrotask(()=>{let n=pr(s),i=typeof o!=`boolean`;o&&!j.current&&K(n)&&(!(!i&&n!==t&&t!==e.body)||r)&&n.focus({preventScroll:!0}),j.current=!1})}},[r,y,R,E,D,b,k,v,S,H]),J(()=>{if(!Ze||_||!y)return;let e=X($(y));!K(e)||!Pt(e)||Z(y,e)&&e.blur()},[_,y]),J(()=>{if(!(r||!A))return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,c,_,g,l,v]),J(()=>{if(!(r||!R))return mr(R),()=>{queueMicrotask(ur)}},[r,R]);let ce=!r&&(!c||!w)&&(se||c);return(0,B.jsxs)(V.Fragment,{children:[ce&&(0,B.jsx)(Gt,{"data-type":`inside`,ref:re,onFocus:e=>{if(c){let e=z();kn(e[e.length-1])}else A?.portalNode&&(j.current=!1,Sn(e,A.portalNode)?_n(v)?.focus():Y(f??A.beforeOutsideRef)?.focus())}}),n,ce&&(0,B.jsx)(Gt,{"data-type":`inside`,ref:ie,onFocus:e=>{c?kn(z()[0]):A?.portalNode&&(l&&(j.current=!0),Sn(e,A.portalNode)?vn(v)?.focus():Y(d??A.afterOutsideRef)?.focus())}})]})}function gr(){return!1}function _r(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function vr(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=gr,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=rr(c),m=q(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=q(()=>a),{escapeKey:v,outsidePress:y}=_r(s),b=V.useRef(!1),x=V.useRef(!1),S=V.useRef(!1),C=V.useRef(!1),w=V.useRef(``),T=V.useRef(null),E=_t(),D=_t(),O=q(()=>{D.clear(),f.current.insideReactTree=!1}),k=q(e=>{let t=f.current.floatingContext?.nodeId;return(p?Tn(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),A=q(e=>Mt(e,l.select(`floatingElement`))||Mt(e,l.select(`domReferenceElement`))),M=q(e=>{o()&&l.setOpen(!1,at(j,e.nativeEvent))}),N=q(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=at(ne,yt(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),P=q(()=>{f.current.insideReactTree=!0,D.start(0,O)}),F=q(e=>{if(!u||!n||e.button!==0)return;let t=At(e.nativeEvent);Z(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),te=q(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});V.useEffect(()=>{if(!u||!n)return;f.current.__escapeKeyBubbles=v,f.current.__outsidePressBubbles=y;let e=new gt,t=new gt;function i(){e.clear(),C.current=!0}function a(){e.start(Ze?5:0,()=>{C.current=!1})}function o(){S.current=!0,t.start(0,()=>{S.current=!1})}function s(){b.current=!1,x.current=!1}function c(){let e=w.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function D(e){let t=f.current.floatingContext?.nodeId,n=p&&Tn(p.nodesRef.current,t).some(t=>Mt(e,t.context?.elements.floating));return A(e)||n}function j(e){if(m(e)){e.type!==`click`&&!A(e)&&(t.clear(),S.current=!1),O();return}if(f.current.insideReactTree){O();return}let n=At(e),r=`[${Dn(`inert`)}]`,i=G(n)?n.getRootNode():null,a=Array.from((de(i)?i:$(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Z(e,n))))return;let s=G(n)?n:null;for(;s&&!Se(s);){let e=Te(s);if(Se(e)||!G(e))break;s=e}if(!(a.length&&G(n)&&!Nt(n)&&!Z(n,l.select(`floatingElement`))&&a.every(e=>!Z(s,e)))){if(K(n)&&!(`touches`in e)){let t=Se(n),r=Ce(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!D(e)){if(c()===`intentional`&&S.current){t.clear(),S.current=!1;return}typeof h==`function`&&!h(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,at(ee,e)),O())}}}function M(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=At(e);if(!n)return;let r=Q(n,e.type,()=>{t(e),r()})}function te(e){w.current=`touch`,F(e,P)}function ne(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?M(e):j(e)})}function I(e){if(!b.current)return;let n=x.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!D(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,O())}}}function re(e){if(c()!==`sloppy`||!T.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),r=Math.abs(t.clientY-T.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(T.current.dismissOnTouchEnd=!0),i>10&&(j(e),E.clear(),T.current=null)}function ie(e){F(e,re)}function ae(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function oe(e){F(e,ae)}let L=$(d),se=zt(r&&zt(Q(L,`keydown`,N),Q(L,`compositionstart`,i),Q(L,`compositionend`,a)),g&&zt(Q(L,`click`,ne,!0),Q(L,`pointerdown`,ne,!0),Q(L,`pointerup`,I,!0),Q(L,`pointercancel`,I,!0),Q(L,`mousedown`,ne,!0),Q(L,`mouseup`,I,!0),Q(L,`touchstart`,te,!0),Q(L,`touchmove`,ie,!0),Q(L,`touchend`,oe,!0)));return()=>{se(),e.clear(),t.clear(),s(),S.current=!1}},[f,d,r,g,h,u,n,v,y,N,O,_,k,A,p,l,E]),V.useEffect(O,[h,O]);let I=V.useMemo(()=>({onKeyDown:N,onPointerDown:M,onClick:M}),[N,M]),re=V.useMemo(()=>({onKeyDown:N,onPointerDown:te,onMouseDown:te,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,F,te]);return V.useMemo(()=>n?{reference:I,floating:re,trigger:I}:{},[n,I,re])}function yr(e){let t=V.useRef(!0);t.current&&(t.current=!1,e())}var br=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(d(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},xr=p((t=>{var n=e();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Sr=p(((e,t)=>{t.exports=xr()})),Cr=p((t=>{var n=e(),r=Sr();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),wr=p(((e,t)=>{t.exports=Cr()})),Tr=Sr(),Er=wr(),Dr=[],Or=void 0;function kr(){return Or}function Ar(e){Dr.push(e)}function jr(e){let t=(t,n)=>{let r=a(Nr).current,i;try{Or=r;for(let e of Dr)e.before(r);i=e(t,n);for(let e of Dr)e.after(r);r.didInitialize=!0}finally{Or=void 0}return i};return t.displayName=e.displayName||e.name,t}function Mr(e){return V.forwardRef(jr(e))}function Nr(){return{didInitialize:!1}}var Pr=f(19)?Lr:Rr;function Fr(e,t,n,r,i){return Pr(e,t,n,r,i)}function Ir(e,t,n,r,i){let a=V.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Tr.useSyncExternalStore)(e.subscribe,a,a)}Ar({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Tr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Lr(e,t,n,r,i){let a=kr();if(!a)return Ir(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Rr(e,t,n,r,i){return(0,Er.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var zr=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Fr(this,e,t,n,r)}},Br=class extends zr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){V.useDebugValue(e);let n=this;J(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;J(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;J(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){V.useDebugValue(e);let n=this,r=t!==void 0;J(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return V.useDebugValue(e),Fr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){V.useDebugValue(e);let n=q(t??c);this.context[e]=n}useStateSetter(e){let t=V.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Vr={open:br(e=>e.open),transitionStatus:br(e=>e.transitionStatus),domReferenceElement:br(e=>e.domReferenceElement),referenceElement:br(e=>e.positionReference??e.referenceElement),floatingElement:br(e=>e.floatingElement),floatingId:br(e=>e.floatingId)},Hr=class extends Br{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Qn(),nested:n,triggerElements:i},Vr),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Ct(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Ur(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=V.useRef(null);r===void 0&&f.current===null&&(f.current=new Hr({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),J(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};G(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var Wr={tabIndex:-1,[wt]:``};function Gr(e){return t=>t!==`touch`||e.current}function Kr(e,t,n=!1){let r=rt(),i=nr()!=null,a=V.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,i));let o=e??a.current;return Ur({popupStore:o,treatPopupAsFloatingElement:n,floatingRootContext:o.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:o.setOpen}),{store:o,internalStore:a.current}}function qr(e,t){let n=V.useRef(null),r=V.useRef(null);return V.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Jr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Yr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Xr(e,t,n,r){yr(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function Zr(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=qr(e,n),o=q(t=>{if(a(t),!t)return;let i=n.select(`open`),o=n.select(`activeTriggerId`);if(o===e){n.update({activeTriggerElement:t,...i?r:null});return}o==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return J(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Qr(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState(`open`);J(()=>{if(!r){e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,i={};e.state.triggerCount!==t&&(i.triggerCount=t);let a=e.select(`activeTriggerId`),o=null;if(a){let t=e.context.triggerElements.getById(a);t?t!==e.state.activeTriggerElement&&(i.activeTriggerElement=t):o=a}if(!o&&!a&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;i.activeTriggerId=e,i.activeTriggerElement=n}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),o&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===o&&!e.context.triggerElements.getById(o)){let t=at(A);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,e.useState(`triggerCount`),n])}function $r(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=ft(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=q(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return mt({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function ei(e,t){e.useSyncedValues(t),J(()=>()=>{e.update({activeTriggerProps:r,inactiveTriggerProps:r,popupProps:r})},[e])}function ti(e,t){J(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),J(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var ni=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}},ri=`ArrowUp`,ii=`ArrowDown`,ai=`ArrowLeft`,oi=`ArrowRight`,si=`Home`,ci=new Set([ai,oi]),li=new Set([ai,oi,si,`End`]),ui=new Set([ri,ii]),di=new Set([ri,ii,si,`End`]),fi=new Set([...ci,...ui]),pi=new Set([...fi,si,`End`]),mi=new Set([`Shift`,`Control`,`Alt`,`Meta`]);function hi(e){return K(e)&&e.tagName===`INPUT`}function gi(e){return!!(hi(e)&&e.selectionStart!=null||K(e)&&e.tagName===`TEXTAREA`)}function _i(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=vi(e,t,`left`),a=yi(e),o=yi(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=vi(e,t,`top`),r=yi(e),i=yi(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function vi(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function yi(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function bi(e){return f(19)?e:e?`true`:void 0}var xi=V.createContext(void 0);function Si(){return V.useContext(xi)?.direction??`ltr`}var Ci=V.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,B.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),wi={},Ti={},Ei=``;function Di(e){if(typeof document>`u`)return!1;let t=$(e);return W(t).innerWidth-t.documentElement.clientWidth>0}function Oi(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=$(e),n=t.documentElement,r=t.body,i=fe(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function ki(e){let t=$(e),n=t.documentElement,r=t.body,i=fe(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Ai(e){let t=$(e),n=t.documentElement,r=t.body,i=W(n),a=0,o=0,s=!1,c=ut.create();if(Ze&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,wi={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ei=n.style.scrollBehavior,Ti={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=fe(n)?n:r;if(s=Oi(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,wi),Object.assign(r.style,Ti),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Ei)}function d(){u(),c.request(l)}l();let f=Q(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ji=new class{lockCount=0;restore=null;timeoutLock=gt.create();timeoutUnlock=gt.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=$(e).documentElement,n=W(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=c;return}let r=Ke||!Di(e);this.restore=r?ki(e):Ai(e)}};function Mi(e=!0,t=null){J(()=>{if(e)return ji.acquire(t)},[e,t])}var Ni=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Pi={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Fi={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ii={disabled:!1,...Fi},Li={valid(e){return e===null?null:e?{[Ni.valid]:``}:{[Ni.invalid]:``}}},Ri={invalid:void 0,name:void 0,validityData:{state:Pi,errors:[],error:``,value:``,initialValue:null},setValidityData:c,disabled:void 0,touched:Fi.touched,setTouched:c,dirty:Fi.dirty,setDirty:c,filled:Fi.filled,setFilled:c,focused:Fi.focused,setFocused:c,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Ii,markedDirtyRef:{current:!1},registerFieldControl:c,validation:{getValidationProps:(e,t=r)=>t,inputRef:{current:null},registerInput:c,commit:async()=>{},change:c}},zi=V.createContext(Ri);function Bi(e=!0){let t=V.useContext(zi);if(t.setValidityData===c&&!e)throw Error(d(28));return t}var Vi=V.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:c,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function Hi(){return V.useContext(Vi)}var Ui=V.createContext({controlId:void 0,registerControlId:c,labelId:void 0,setLabelId:c,messageIds:[],setMessageIds:c,getDescriptionProps:e=>e});function Wi(){return V.useContext(Ui)}function Gi(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:o}=Wi(),s=it(t),l=n?i:void 0,u=a(()=>Symbol(`labelable-control`)),d=V.useRef(!1),f=V.useRef(t!=null),p=q(()=>{!d.current||o===c||(d.current=!1,o(u.current,void 0))});return J(()=>{if(o===c)return;let e;if(n){let n=r?.current;e=G(n)&&n.closest(`label`)!=null?t??null:l??s}else if(t!=null)f.current=!0,e=t;else if(f.current)e=s;else{p();return}if(e===void 0){p();return}d.current=!0,o(u.current,e)},[t,r,l,o,n,s,u,p]),V.useEffect(()=>p,[p]),i??s}function Ki(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Bi(),s=V.useRef(null);s.current||=Symbol(),J(()=>{let c=s.current;if(!(!c||!i))return o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}),()=>{o(c,void 0)}},[e,i,r,t,a,o,n])}var qi=V.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFocused:b,setFilled:x,validationMode:S,validation:C}=Bi(),{clearErrors:w}=Hi(),T=g||c,E=h??a,D={...m,disabled:T},{labelId:O}=Wi(),k=Gi({id:i});J(()=>{let e=o!=null;C.inputRef.current?.value||e&&o!==``?x(!0):e&&o===``&&x(!1)},[C.inputRef,x,o]);let j=V.useRef(null);J(()=>{d&&j.current===X($(j.current))&&b(!0)},[d,b]);let[M]=H({controlled:o,default:u,name:`FieldControl`,state:`value`}),N=o!==void 0,ee=N?M:void 0,P=q(()=>C.inputRef.current?.value);return Ki(C.inputRef,k,ee,P,!T,a),s(`input`,e,{ref:[t,j],state:D,props:[{id:k,disabled:T,name:E,ref:C.inputRef,"aria-labelledby":O,autoFocus:d,...N?{value:ee}:{defaultValue:u},onChange(e){let t=e.currentTarget.value;l?.(t,at(A,e.nativeEvent)),v(t!==y.initialValue),x(t!==``),e.nativeEvent.defaultPrevented||(w(E),C.change(t))},onFocus(){b(!0)},onBlur(e){_(!0),b(!1),S===`onBlur`&&C.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(_(!0),C.commit(e.currentTarget.value))}},p,e=>C.getValidationProps(T,e)],stateAttributesMapping:Li})}),Ji=V.forwardRef(function(e,t){return(0,B.jsx)(qi,{ref:t,...e})});function Yi({className:e,size:t=`default`,unstyled:n=!1,nativeInput:r=!1,...i}){let a=l(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,i.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,i.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`),o;if(r){let{style:e,onValueChange:n,...r}=i;o=(0,B.jsx)(`input`,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,style:typeof e==`function`?void 0:e,...r})}else o=(0,B.jsx)(Ji,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,...i});return(0,B.jsx)(`span`,{className:l(!n&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:o})}var Xi=V.createContext(void 0),Zi={disableStyleElements:!1};function Qi(){return V.useContext(Xi)??Zi}export{or as $,at as $t,Yr as A,F as An,Ft as At,Ur as B,ee as Bn,Dt as Bt,mi as C,Se as Cn,Ut as Ct,_i as D,xe as Dn,zt as Dt,gi as E,me as En,Bt as Et,$r as F,L as Fn,X as Ft,jr as G,R as Gn,vt as Gt,Br as H,N as Hn,St as Ht,ei as I,P as In,Z as It,br as J,O as Jn,mt as Jt,Mr as K,b as Kn,gt as Kt,ti as L,I as Ln,At as Lt,Jr as M,ne as Mn,It as Mt,Qr as N,te as Nn,Pt as Nt,ni as O,H as On,Q as Ot,Xr as P,se as Pn,Lt as Pt,ar as Q,h as Qn,st as Qt,Kr as R,oe as Rn,kt as Rt,li as S,K as Sn,Gt as St,di as T,pe as Tn,$ as Tt,zr as U,M as Un,bt as Ut,Hr as V,ie as Vn,Ot as Vt,Fr as W,j as Wn,xt as Wt,vr as X,g as Xn,ft as Xt,yr as Y,D as Yn,pt as Yt,hr as Z,y as Zn,dt as Zt,oi as _,De as _n,Jt as _t,Gi as a,Ye as an,Un as at,si as b,ye as bn,Kt as bt,Bi as c,Fe as cn,Gn as ct,Ci as d,Ce as dn,Tn as dt,it as en,ir as et,Si as f,be as fn,_n as ft,ai as g,we as gn,Yt as gt,fi as h,U as hn,Sn as ht,Ki as i,Ke as in,Zn as it,Gr as j,ae as jn,jt,Wr as k,re as kn,Rt as kt,Li as l,J as ln,kn as lt,ii as m,Oe as mn,xn as mt,Yi as n,$e as nn,rr as nt,Wi as o,Le as on,Hn as ot,bi as p,le as pn,bn as pt,Sr as q,k as qn,_t as qt,qi as r,Ze as rn,$n as rt,Hi as s,Pe as sn,Wn as st,Qi as t,rt as tn,nr as tt,Mi as u,q as un,Dn as ut,ri as v,Te as vn,qt as vt,ui as w,fe as wn,Wt as wt,ci as x,G as xn,Xt as xt,pi as y,W as yn,Qt as yt,Zr as z,A as zn,Et as zt};
1
+ import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,i as s,l as c,m as l,o as u,p as d,u as f,v as p}from"./button-BDDZnIHx.js";var m=p((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},t.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},t.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},t.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},t.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},t.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},t.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},t.useFormStatus=function(){return c.H.useHostTransitionStatus()},t.version=`19.2.7`})),h=p(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),_={[g.startingStyle]:``},v={[g.endingStyle]:``},y={transitionStatus(e){return e===`starting`?_:e===`ending`?v:null}},b=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=g.startingStyle]=`startingStyle`,e[e.endingStyle=g.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),x=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),S={[x.popupOpen]:``},C={[x.popupOpen]:``,[x.pressed]:``},w={[b.open]:``},T={[b.closed]:``},E={[b.anchorHidden]:``},D={open(e){return e?S:null}},O={open(e){return e?C:null}},k={open(e){return e?w:T},anchorHidden(e){return e?E:null}},A=`none`,j=`trigger-press`,M=`trigger-hover`,N=`trigger-focus`,ee=`outside-press`,P=`item-press`,F=`close-press`,te=`focus-out`,ne=`escape-key`,I=`list-navigation`,re=`cancel-open`,ie=`sibling-open`,ae=`disabled`,oe=`missing`,L=`initial`,se=`imperative-action`,R=`window-resize`,z=n(h(),1),B=o(),V=n(e(),1);function H({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=V.useRef(e!==void 0),[a,o]=V.useState(t);return[i?e:a,V.useCallback(e=>{i||o(e)},[])]}function ce(){return typeof window<`u`}function U(e){return ue(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function le(e){return((ue(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ue(e){return ce()?e instanceof Node||e instanceof W(e).Node:!1}function G(e){return ce()?e instanceof Element||e instanceof W(e).Element:!1}function K(e){return ce()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function de(e){return!ce()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function fe(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function pe(e){return/^(table|td|th)$/.test(U(e))}function me(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var he=/transform|translate|scale|rotate|perspective|filter/,ge=/paint|layout|strict|content/,_e=e=>!!e&&e!==`none`,ve;function ye(e){let t=G(e)?Ce(e):e;return _e(t.transform)||_e(t.translate)||_e(t.scale)||_e(t.rotate)||_e(t.perspective)||!xe()&&(_e(t.backdropFilter)||_e(t.filter))||he.test(t.willChange||``)||ge.test(t.contain||``)}function be(e){let t=Te(e);for(;K(t)&&!Se(t);){if(ye(t))return t;if(me(t))return null;t=Te(t)}return null}function xe(){return ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ve}function Se(e){return/^(html|body|#document)$/.test(U(e))}function Ce(e){return W(e).getComputedStyle(e)}function we(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Te(e){if(U(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||de(e)&&e.host||le(e);return de(t)?t.host:t}function Ee(e){let t=Te(e);return Se(t)?(e.ownerDocument||e).body:K(t)&&fe(t)?t:Ee(t)}function De(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ee(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=Oe(a);return t.concat(a,a.visualViewport||[],fe(r)?r:[],e&&n?De(e):[])}else return t.concat(r,De(r,[],n))}function Oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var ke={...V},Ae=ke.useInsertionEffect,je=Ae&&Ae!==ke.useLayoutEffect?Ae:e=>e();function q(e){let t=a(Me).current;return t.next=e,je(t.effect),t.trampoline}function Me(){let e={next:void 0,callback:Ne,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ne(){}var J=typeof document<`u`?V.useLayoutEffect:()=>{},Pe=V.createContext(void 0);function Fe(e=!1){let t=V.useContext(Pe);if(t===void 0&&!e)throw Error(d(16));return t}function Ie(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:V.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Le(e={}){let{disabled:n=!1,focusableWhenDisabled:r,tabIndex:i=0,native:a=!0,composite:o}=e,s=V.useRef(null),c=Fe(!0),l=o??c!==void 0,{props:d}=Ie({focusableWhenDisabled:r,disabled:n,composite:l,tabIndex:i,isNativeButton:a}),f=V.useCallback(()=>{let e=s.current;Re(e)&&l&&n&&d.disabled===void 0&&e.disabled&&(e.disabled=!1)},[n,d.disabled,l]);return J(f,[f]),{getButtonProps:V.useCallback((e={})=>{let{onClick:r,onMouseDown:i,onKeyUp:o,onKeyDown:s,onPointerDown:c,...f}=e;return u({onClick(e){if(n){e.preventDefault();return}r?.(e)},onMouseDown(e){n||i?.(e)},onKeyDown(e){if(n||(t(e),s?.(e),e.baseUIHandlerPrevented))return;let i=e.target===e.currentTarget,o=e.currentTarget,c=Re(o),u=!a&&ze(o),d=i&&(a?c:!u),f=e.key===`Enter`,p=e.key===` `,m=o.getAttribute(`role`),h=m?.startsWith(`menuitem`)||m===`option`||m===`gridcell`;if(i&&l&&p){if(e.defaultPrevented&&h)return;e.preventDefault(),u||a&&c?(o.click(),e.preventBaseUIHandler()):d&&(r?.(e),e.preventBaseUIHandler());return}d&&(!a&&(p||f)&&e.preventDefault(),!a&&f&&r?.(e))},onKeyUp(e){if(!n){if(t(e),o?.(e),e.target===e.currentTarget&&a&&l&&Re(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&e.key===` `&&r?.(e)}},onPointerDown(e){if(n){e.preventDefault();return}c?.(e)}},a?{type:`button`}:{role:`button`},d,f)},[n,d,l,a]),buttonRef:q(e=>{s.current=e,f()})}}function Re(e){return K(e)&&e.tagName===`BUTTON`}function ze(e){return!!(e?.tagName===`A`&&e?.href)}function Be(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ve,platform:He,maxTouchPoints:Ue}=Be(),We=Ve.toLowerCase(),Ge=He.toLowerCase(),Ke=/^i(os$|p)/.test(Ge)||Ge===`macintel`&&Ue>1,qe=`android`,Je=Ge===qe||We.includes(qe),Ye=!Ke&&Ge.startsWith(`mac`);Ge.startsWith(`win`),!Je&&/^(linux|chrome os)/.test(Ge);var Xe=Ye||Ke,Ze=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Ze&&We.includes(`firefox`),!Ze&&We.includes(`chrom`);var Qe=Xe,$e=/jsdom|happydom/.test(We),et=0;function tt(e,t=`mui`){let[n,r]=V.useState(e),i=e||n;return V.useEffect(()=>{n??(et+=1,r(`${t}-${et}`))},[n,t]),i}var nt=ke.useId;function rt(e,t){if(nt!==void 0){let n=nt();return e??(t?`${t}-${n}`:n)}return tt(e,t)}function it(e){return rt(e,`base-ui`)}function at(e,t,n,i){let a=!1,o=!1,s=i??r;return{reason:e,event:t??new Event(`base-ui`),cancel(){a=!0},allowPropagation(){o=!0},get isCanceled(){return a},get isPropagationAllowed(){return o},trigger:n,...s}}var ot=[];function st(e){V.useEffect(e,ot)}var ct=null;globalThis.requestAnimationFrame;var lt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},ut=class e{static create(){return new e}static request(e){return lt.request(e)}static cancel(e){return lt.cancel(e)}currentId=ct;request(e){this.cancel(),this.currentId=lt.request(()=>{this.currentId=ct,e()})}cancel=()=>{this.currentId!==ct&&(lt.cancel(this.currentId),this.currentId=ct)};disposeEffect=()=>this.cancel};function dt(){let e=a(ut.create).current;return st(e.disposeEffect),e}function ft(e,t=!1,n=!1){let[r,i]=V.useState(e&&t?`idle`:void 0),[a,o]=V.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),J(()=>{if(!e&&a&&r!==`ending`&&n){let e=ut.request(()=>{i(`ending`)});return()=>{ut.cancel(e)}}},[e,a,r,n]),J(()=>{if(!e||t)return;let n=ut.request(()=>{i(void 0)});return()=>{ut.cancel(n)}},[t,e]),J(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=ut.request(()=>{i(`idle`)});return()=>{ut.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Y(e){return e==null?e:`current`in e?e.current:e}function pt(e,t=!1,n=!0){let r=dt();return q((i,a=null)=>{r.cancel();let o=Y(e);if(o==null)return;let s=o,c=()=>{z.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=g.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function mt(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=q(i),o=pt(r,n,!1);V.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var ht=0,gt=class e{static create(){return new e}currentId=ht;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ht,t()},e)}isStarted(){return this.currentId!==ht}clear=()=>{this.currentId!==ht&&(clearTimeout(this.currentId),this.currentId=ht)};disposeEffect=()=>this.clear};function _t(){let e=a(gt.create).current;return st(e.disposeEffect),e}function vt(e){e.preventDefault(),e.stopPropagation()}function yt(e){return`nativeEvent`in e}function bt(e){return e.pointerType===``&&e.isTrusted?!0:Je&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function xt(e){return $e?!1:!Je&&e.width===0&&e.height===0||Je&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function St(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Ct(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var wt=`data-base-ui-focusable`,Tt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Et=`ArrowLeft`,Dt=`ArrowRight`,Ot=`ArrowUp`,kt=`ArrowDown`;function X(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&de(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function At(e){return`composedPath`in e?e.composedPath()[0]:e.target}function jt(e,t){if(!G(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Z(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Mt(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Nt(e){return e.matches(`html,body`)}function Pt(e){return K(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ft(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Tt}`)!=null}function It(e){return e?e.getAttribute(`role`)===`combobox`&&Pt(e):!1}function Lt(e){if(!e||$e)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Rt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Q(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function zt(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Bt(e){let t=a(Vt,e).current;return t.next=e,J(t.effect),t}function Vt(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function $(e){return e?.ownerDocument||document}var Ht={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Ut={...Ht,position:`fixed`,top:0,left:0},Wt={...Ht,position:`absolute`},Gt=V.forwardRef(function(e,t){let[n,r]=V.useState();J(()=>{Qe&&Ze&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,B.jsx)(`span`,{...e,ref:t,style:Ut,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Kt(e,t){return t<0||t>=e.length}function qt(e,t){return Yt(e.current,{disabledIndices:t})}function Jt(e,t){return Yt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Yt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Xt(e,a,r));return a}function Xt(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Qt(r)||!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Zt(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Qt(e,t=e?Ce(e):null){return!e||!e.isConnected||!t||Zt(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var $t=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function en(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return de(n)?n.host:null}function tn(e){for(let t of Array.from(e.children))if(U(t)===`summary`)return t;return null}function nn(e,t){let n=tn(t);return!!n&&(e===n||Z(n,e))}function rn(e){let t=e?U(e):``;return e!=null&&e.matches($t)&&(t!==`summary`||e.parentElement!=null&&U(e.parentElement)===`details`&&tn(e.parentElement)===e)&&(t!==`details`||tn(e)==null)&&(t!==`input`||e.type!==`hidden`)}function an(e){if(!rn(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=en(t)){let n=t!==e,r=U(t)===`slot`;if(t.hasAttribute(`inert`)||n&&U(t)===`details`&&!t.open&&!nn(e,t)||t.hasAttribute(`hidden`)||!r&&!on(t,n))return!1}return!0}function on(e,t){let n=Ce(e);return t?n.display!==`none`:Qt(e,n)}function sn(e){let t=e.tabIndex;if(t<0){let t=U(e);if(t===`details`||t===`audio`||t===`video`||K(e)&&e.isContentEditable)return 0}return t}function cn(e){if(U(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function ln(e,t){let n=cn(e);if(!n)return!0;let r=t.find(e=>{let t=cn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=cn(e);return t?.name===n.name&&t.form===n.form})===n}function un(e){if(K(e)&&U(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return K(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function dn(e,t){un(e).forEach(e=>{rn(e)&&t.push(e),dn(e,t)})}function fn(e,t,n){un(e).forEach(e=>{K(e)&&e.matches(t)&&n.push(e),fn(e,t,n)})}function pn(e){return an(e)&&sn(e)>=0}function mn(e){let t=[];return dn(e,t),t.filter(an)}function hn(e){let t=mn(e);return t.filter(e=>sn(e)>=0&&ln(e,t))}function gn(e,t){let n=hn(e),r=n.length;if(r===0)return;let i=X($(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function _n(e){return gn($(e).body,1)||e}function vn(e){return gn($(e).body,-1)||e}function yn(e,t){if(!e)return null;let n=hn($(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function bn(e){return yn(e,1)}function xn(e){return yn(e,-1)}function Sn(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function Cn(e){hn(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function wn(e){let t=[];fn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Tn(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Tn(e,t.id,n)])}function En(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Dn(e){return`data-base-ui-${e}`}var On=0;function kn(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(On);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),c;let o=requestAnimationFrame(a);return On=o,()=>{On===o&&(cancelAnimationFrame(o),On=0)}}var An={inert:new WeakMap,"aria-hidden":new WeakMap},jn=`data-base-ui-inert`,Mn={inert:new WeakSet,"aria-hidden":new WeakSet},Nn=new WeakMap,Pn=0;function Fn(e){return Mn[e]}function In(e){return e?de(e)?e.host:In(e.parentNode):null}var Ln=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=In(t);return e.contains(n)?n:null}).filter(e=>e!=null),Rn=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},zn=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{U(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Bn(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Ln(t,e),l=i?zn(t,Rn(c),new Set(c)):[],u=[],d=[];if(a){let e=An[a],n=Fn(a);s=n,o=e;let r=Ln(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);zn(t,Rn(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Nn.get(e)||0)+1;Nn.set(e,t),d.push(e),t===1&&e.setAttribute(jn,``)}),Pn+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Nn.get(e)||0)-1;Nn.set(e,t),t||e.removeAttribute(jn)}),--Pn,Pn||(An.inert=new WeakMap,An[`aria-hidden`]=new WeakMap,Mn.inert=new WeakSet,Mn[`aria-hidden`]=new WeakSet,Nn=new WeakMap)}}function Vn(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=$(e[0]).body;return Bn(e,a,n,r,{mark:i})}var Hn={style:{transition:`none`}},Un=`data-base-ui-click-trigger`,Wn={fallbackAxisSide:`none`},Gn={fallbackAxisSide:`end`},Kn={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},qn=V.createContext(null),Jn=()=>V.useContext(qn),Yn=Dn(`portal`);function Xn(e={}){let{ref:t,container:n,componentProps:i=r,elementProps:a}=e,o=rt(),c=Jn()?.portalNode,[l,u]=V.useState(null),[d,f]=V.useState(null),p=q(e=>{e!==null&&f(e)}),m=V.useRef(null);J(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}if(o==null)return;let e=(n&&(ue(n)?n:n.current))??c??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[n,c,o]);let h=s(`div`,i,{ref:[t,p],props:[{id:o,[Yn]:``},a]});return{portalNode:d,portalSubtree:l&&h?z.createPortal(h,l):null}}var Zn=V.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,renderGuards:s,...c}=e,{portalNode:l,portalSubtree:u}=Xn({container:o,ref:t,componentProps:e,elementProps:c}),d=V.useRef(null),f=V.useRef(null),p=V.useRef(null),m=V.useRef(null),[h,g]=V.useState(null),_=V.useRef(!1),v=h?.modal,y=h?.open,b=typeof s==`boolean`?s:!!h&&!h.modal&&h.open&&!!l;V.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&Sn(e)&&(e.type===`focusin`?_.current&&=(wn(l),!1):(Cn(l),_.current=!0))}return zt(Q(l,`focusin`,e,!0),Q(l,`focusout`,e,!0))},[l,v]),J(()=>{!l||y!==!0||!_.current||(wn(l),_.current=!1)},[y,l]);let x=V.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,B.jsxs)(V.Fragment,{children:[u,(0,B.jsxs)(qn.Provider,{value:x,children:[b&&l&&(0,B.jsx)(Gt,{"data-type":`outside`,ref:d,onFocus:e=>{Sn(e,l)?p.current?.focus():vn(h?h.domReference:null)?.focus()}}),b&&l&&(0,B.jsx)(`span`,{"aria-owns":l.id,style:Kn}),l&&z.createPortal(a,l),b&&l&&(0,B.jsx)(Gt,{"data-type":`outside`,ref:f,onFocus:e=>{Sn(e,l)?m.current?.focus():(_n(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,at(`focus-out`,e.nativeEvent)))}})]})]})});function Qn(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var $n=class{nodesRef={current:[]};events=Qn();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},er=V.createContext(null),tr=V.createContext(null),nr=()=>V.useContext(er)?.id||null,rr=e=>{let t=V.useContext(tr);return e??t};function ir(e){let t=rt(),n=rr(e),r=nr();return J(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function ar(e){let{children:t,id:n}=e,r=nr();return(0,B.jsx)(er.Provider,{value:V.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function or(e){let{children:t,externalTree:n}=e,r=a(()=>n??new $n).current;return(0,B.jsx)(tr.Provider,{value:r,children:t})}function sr(e,t){let n=W(At(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var cr=20,lr=[];function ur(){lr=lr.filter(e=>e.deref()?.isConnected)}function dr(e){ur(),e&&U(e)!==`body`&&(lr.push(new WeakRef(e)),lr.length>cr&&(lr=lr.slice(-20)))}function fr(){return ur(),lr[lr.length-1]?.deref()}function pr(e){return e?pn(e)?e:hn(e)[0]||e:null}function mr(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=mn(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return pn(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function hr(e){let{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=q(()=>x.current.floatingContext?.nodeId),C=a===!1,w=It(v)&&C,T=Bt(a),E=Bt(o),D=Bt(u),O=Bt(_),k=rr(m),A=Jn(),j=V.useRef(!1),M=V.useRef(!1),N=V.useRef(!1),ee=V.useRef(null),P=V.useRef(``),F=V.useRef(``),ne=V.useRef(null),I=V.useRef(null),re=i(ne,p,A?.beforeInsideRef),ie=i(I,A?.afterInsideRef),ae=_t(),oe=_t(),L=dt(),se=A!=null,R=Rt(y),z=q((e=R)=>e?hn(e):[]),H=q(()=>h?.().filter(e=>e!=null)??[]);V.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Z(R,X($(R)))&&z().length===0&&!w&&vt(e)}return Q($(R),`keydown`,e)},[r,R,c,w,z]),V.useEffect(()=>{if(r||!_)return;let e=$(R);function t(){N.current=!1}function n(e){let t=At(e),n=H(),r=Z(y,t)||Z(v,t)||Z(A?.portalNode,t)||n.some(e=>e===t||Z(e,t));N.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,oe.start(0,()=>{M.current=!1}))}function i(){F.current=`keyboard`}return zt(Q(e,`pointerdown`,n,!0),Q(e,`pointerup`,t,!0),Q(e,`pointercancel`,t,!0),Q(e,`keydown`,i,!0),t)},[r,y,v,R,_,A,oe,H]),V.useEffect(()=>{if(r||!l)return;let e=$(R);function t(){M.current=!0,oe.start(0,()=>{M.current=!1})}function n(e){let t=At(e);pn(t)&&(ee.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=At(t);c&&n==null&&i!=null&&Z(y,i)&&dr(i),queueMicrotask(()=>{let a=S(),o=g.context.triggerElements,l=H(),u=n?.hasAttribute(Dn(`focus-guard`))&&[ne.current,I.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Y(f),Y(d)].includes(n),p=!(Z(v,n)||Z(y,n)||Z(n,y)||Z(A?.portalNode,n)||l.some(e=>e===n||Z(e,n))||n!=null&&o.hasElement(n)||o.hasMatchingElement(e=>Z(e,n))||u||k&&(Tn(k.nodesRef.current,a).find(e=>Z(e.context?.elements.floating,n)||Z(e.context?.elements.domReference,n))||En(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Rt(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===v&&R&&mr(R),s&&r!==v&&!Qt(i)&&X(e)===e.body){if(K(R)&&(R.focus(),s===`popup`)){L.request(()=>{R.focus()});return}let e=z(),t=ee.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||R;K(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!c)&&n&&p&&!M.current&&(w||n!==fr())&&(j.current=!0,g.setOpen(!1,at(te,t)))})}function a(){N.current||(x.current.insideReactTree=!0,ae.start(0,()=>{x.current.insideReactTree=!1}))}let o=K(v)?v:null;if(!(!y&&!o))return zt(o&&Q(o,`focusout`,i),o&&Q(o,`pointerdown`,t),y&&Q(y,`focusin`,n),y&&Q(y,`focusout`,i),y&&A&&Q(y,`focusout`,a,!0))},[r,v,y,R,c,k,A,g,l,s,z,w,S,x,ae,oe,L,d,f,H]),V.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Dn(`portal`)}]`)||[]),t=(k?En(k.nodesRef.current,S()):[]).find(e=>It(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Vn([y,...e,ne.current,I.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...H(),t,Y(f),Y(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Vn([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,A,w,k,S,d,f,H]),J(()=>{if(!_||r||!K(R))return;let e=$(R),t=X(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Z(R,t))return;let i=null,a=()=>(i??=z(R),i[0]||R),o;o=r===!0||r===null?a():Y(r),o||=a();let s=Z(R,X(e));kn(o,{preventScroll:o===R,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=X(e);return!(t!==o&&Z(R,t))}})})},[r,_,R,z,T,D,O]),J(()=>{if(r||!R)return;let e=$(R),t=X(e),n=D.current==null;dr(t);function i(e){if(e.open||(P.current=sr(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`)if(e.nested)j.current=!1;else if(bt(e.nativeEvent)||xt(e.nativeEvent))j.current=!1;else{let e=!1;$(R).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}b.on(`openchange`,i);function a(){let e=E.current,r=typeof e==`function`?e(P.current):e;if(r===void 0||r===!1)return null;r===null&&(r=!0);let i=v?.isConnected?v:null,a=t?.isConnected&&U(t)!==`body`?t:null,o=n?a||i:i||a;return o||=fr()||null,typeof r==`boolean`?o:Y(r)||o||null}return()=>{b.off(`openchange`,i);let t=X(e),n=H(),r=Z(y,t)||n.some(e=>e===t||Z(e,t))||k&&Tn(k.nodesRef.current,S(),!1).some(e=>Z(e.context?.elements.floating,t)),o=E.current,s=a();queueMicrotask(()=>{let n=pr(s),i=typeof o!=`boolean`;o&&!j.current&&K(n)&&(!(!i&&n!==t&&t!==e.body)||r)&&n.focus({preventScroll:!0}),j.current=!1})}},[r,y,R,E,D,b,k,v,S,H]),J(()=>{if(!Ze||_||!y)return;let e=X($(y));!K(e)||!Pt(e)||Z(y,e)&&e.blur()},[_,y]),J(()=>{if(!(r||!A))return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,c,_,g,l,v]),J(()=>{if(!(r||!R))return mr(R),()=>{queueMicrotask(ur)}},[r,R]);let ce=!r&&(!c||!w)&&(se||c);return(0,B.jsxs)(V.Fragment,{children:[ce&&(0,B.jsx)(Gt,{"data-type":`inside`,ref:re,onFocus:e=>{if(c){let e=z();kn(e[e.length-1])}else A?.portalNode&&(j.current=!1,Sn(e,A.portalNode)?_n(v)?.focus():Y(f??A.beforeOutsideRef)?.focus())}}),n,ce&&(0,B.jsx)(Gt,{"data-type":`inside`,ref:ie,onFocus:e=>{c?kn(z()[0]):A?.portalNode&&(l&&(j.current=!0),Sn(e,A.portalNode)?vn(v)?.focus():Y(d??A.afterOutsideRef)?.focus())}})]})}function gr(){return!1}function _r(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function vr(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=gr,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=rr(c),m=q(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=q(()=>a),{escapeKey:v,outsidePress:y}=_r(s),b=V.useRef(!1),x=V.useRef(!1),S=V.useRef(!1),C=V.useRef(!1),w=V.useRef(``),T=V.useRef(null),E=_t(),D=_t(),O=q(()=>{D.clear(),f.current.insideReactTree=!1}),k=q(e=>{let t=f.current.floatingContext?.nodeId;return(p?Tn(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),A=q(e=>Mt(e,l.select(`floatingElement`))||Mt(e,l.select(`domReferenceElement`))),M=q(e=>{o()&&l.setOpen(!1,at(j,e.nativeEvent))}),N=q(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=at(ne,yt(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),P=q(()=>{f.current.insideReactTree=!0,D.start(0,O)}),F=q(e=>{if(!u||!n||e.button!==0)return;let t=At(e.nativeEvent);Z(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),te=q(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});V.useEffect(()=>{if(!u||!n)return;f.current.__escapeKeyBubbles=v,f.current.__outsidePressBubbles=y;let e=new gt,t=new gt;function i(){e.clear(),C.current=!0}function a(){e.start(Ze?5:0,()=>{C.current=!1})}function o(){S.current=!0,t.start(0,()=>{S.current=!1})}function s(){b.current=!1,x.current=!1}function c(){let e=w.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function D(e){let t=f.current.floatingContext?.nodeId,n=p&&Tn(p.nodesRef.current,t).some(t=>Mt(e,t.context?.elements.floating));return A(e)||n}function j(e){if(m(e)){e.type!==`click`&&!A(e)&&(t.clear(),S.current=!1),O();return}if(f.current.insideReactTree){O();return}let n=At(e),r=`[${Dn(`inert`)}]`,i=G(n)?n.getRootNode():null,a=Array.from((de(i)?i:$(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Z(e,n))))return;let s=G(n)?n:null;for(;s&&!Se(s);){let e=Te(s);if(Se(e)||!G(e))break;s=e}if(!(a.length&&G(n)&&!Nt(n)&&!Z(n,l.select(`floatingElement`))&&a.every(e=>!Z(s,e)))){if(K(n)&&!(`touches`in e)){let t=Se(n),r=Ce(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!D(e)){if(c()===`intentional`&&S.current){t.clear(),S.current=!1;return}typeof h==`function`&&!h(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,at(ee,e)),O())}}}function M(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=At(e);if(!n)return;let r=Q(n,e.type,()=>{t(e),r()})}function te(e){w.current=`touch`,F(e,P)}function ne(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?M(e):j(e)})}function I(e){if(!b.current)return;let n=x.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!D(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,O())}}}function re(e){if(c()!==`sloppy`||!T.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),r=Math.abs(t.clientY-T.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(T.current.dismissOnTouchEnd=!0),i>10&&(j(e),E.clear(),T.current=null)}function ie(e){F(e,re)}function ae(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function oe(e){F(e,ae)}let L=$(d),se=zt(r&&zt(Q(L,`keydown`,N),Q(L,`compositionstart`,i),Q(L,`compositionend`,a)),g&&zt(Q(L,`click`,ne,!0),Q(L,`pointerdown`,ne,!0),Q(L,`pointerup`,I,!0),Q(L,`pointercancel`,I,!0),Q(L,`mousedown`,ne,!0),Q(L,`mouseup`,I,!0),Q(L,`touchstart`,te,!0),Q(L,`touchmove`,ie,!0),Q(L,`touchend`,oe,!0)));return()=>{se(),e.clear(),t.clear(),s(),S.current=!1}},[f,d,r,g,h,u,n,v,y,N,O,_,k,A,p,l,E]),V.useEffect(O,[h,O]);let I=V.useMemo(()=>({onKeyDown:N,onPointerDown:M,onClick:M}),[N,M]),re=V.useMemo(()=>({onKeyDown:N,onPointerDown:te,onMouseDown:te,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,F,te]);return V.useMemo(()=>n?{reference:I,floating:re,trigger:I}:{},[n,I,re])}function yr(e){let t=V.useRef(!0);t.current&&(t.current=!1,e())}var br=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(d(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},xr=p((t=>{var n=e();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Sr=p(((e,t)=>{t.exports=xr()})),Cr=p((t=>{var n=e(),r=Sr();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),wr=p(((e,t)=>{t.exports=Cr()})),Tr=Sr(),Er=wr(),Dr=[],Or=void 0;function kr(){return Or}function Ar(e){Dr.push(e)}function jr(e){let t=(t,n)=>{let r=a(Nr).current,i;try{Or=r;for(let e of Dr)e.before(r);i=e(t,n);for(let e of Dr)e.after(r);r.didInitialize=!0}finally{Or=void 0}return i};return t.displayName=e.displayName||e.name,t}function Mr(e){return V.forwardRef(jr(e))}function Nr(){return{didInitialize:!1}}var Pr=f(19)?Lr:Rr;function Fr(e,t,n,r,i){return Pr(e,t,n,r,i)}function Ir(e,t,n,r,i){let a=V.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Tr.useSyncExternalStore)(e.subscribe,a,a)}Ar({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Tr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Lr(e,t,n,r,i){let a=kr();if(!a)return Ir(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Rr(e,t,n,r,i){return(0,Er.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var zr=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Fr(this,e,t,n,r)}},Br=class extends zr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){V.useDebugValue(e);let n=this;J(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;J(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;J(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){V.useDebugValue(e);let n=this,r=t!==void 0;J(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return V.useDebugValue(e),Fr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){V.useDebugValue(e);let n=q(t??c);this.context[e]=n}useStateSetter(e){let t=V.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Vr={open:br(e=>e.open),transitionStatus:br(e=>e.transitionStatus),domReferenceElement:br(e=>e.domReferenceElement),referenceElement:br(e=>e.positionReference??e.referenceElement),floatingElement:br(e=>e.floatingElement),floatingId:br(e=>e.floatingId)},Hr=class extends Br{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Qn(),nested:n,triggerElements:i},Vr),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Ct(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Ur(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=V.useRef(null);r===void 0&&f.current===null&&(f.current=new Hr({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),J(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};G(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var Wr={tabIndex:-1,[wt]:``};function Gr(e){return t=>t!==`touch`||e.current}function Kr(e,t,n=!1){let r=rt(),i=nr()!=null,a=V.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,i));let o=e??a.current;return Ur({popupStore:o,treatPopupAsFloatingElement:n,floatingRootContext:o.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:o.setOpen}),{store:o,internalStore:a.current}}function qr(e,t){let n=V.useRef(null),r=V.useRef(null);return V.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Jr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Yr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Xr(e,t,n,r){yr(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function Zr(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=qr(e,n),o=q(t=>{if(a(t),!t)return;let i=n.select(`open`),o=n.select(`activeTriggerId`);if(o===e){n.update({activeTriggerElement:t,...i?r:null});return}o==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return J(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Qr(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState(`open`);J(()=>{if(!r){e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,i={};e.state.triggerCount!==t&&(i.triggerCount=t);let a=e.select(`activeTriggerId`),o=null;if(a){let t=e.context.triggerElements.getById(a);t?t!==e.state.activeTriggerElement&&(i.activeTriggerElement=t):o=a}if(!o&&!a&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;i.activeTriggerId=e,i.activeTriggerElement=n}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),o&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===o&&!e.context.triggerElements.getById(o)){let t=at(A);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,e.useState(`triggerCount`),n])}function $r(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=ft(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=q(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return mt({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function ei(e,t){e.useSyncedValues(t),J(()=>()=>{e.update({activeTriggerProps:r,inactiveTriggerProps:r,popupProps:r})},[e])}function ti(e,t){J(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),J(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var ni=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}},ri=`ArrowUp`,ii=`ArrowDown`,ai=`ArrowLeft`,oi=`ArrowRight`,si=`Home`,ci=new Set([ai,oi]),li=new Set([ai,oi,si,`End`]),ui=new Set([ri,ii]),di=new Set([ri,ii,si,`End`]),fi=new Set([...ci,...ui]),pi=new Set([...fi,si,`End`]),mi=new Set([`Shift`,`Control`,`Alt`,`Meta`]);function hi(e){return K(e)&&e.tagName===`INPUT`}function gi(e){return!!(hi(e)&&e.selectionStart!=null||K(e)&&e.tagName===`TEXTAREA`)}function _i(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=vi(e,t,`left`),a=yi(e),o=yi(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=vi(e,t,`top`),r=yi(e),i=yi(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function vi(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function yi(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function bi(e){return f(19)?e:e?`true`:void 0}var xi=V.createContext(void 0);function Si(){return V.useContext(xi)?.direction??`ltr`}var Ci=V.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,B.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),wi={},Ti={},Ei=``;function Di(e){if(typeof document>`u`)return!1;let t=$(e);return W(t).innerWidth-t.documentElement.clientWidth>0}function Oi(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=$(e),n=t.documentElement,r=t.body,i=fe(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function ki(e){let t=$(e),n=t.documentElement,r=t.body,i=fe(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Ai(e){let t=$(e),n=t.documentElement,r=t.body,i=W(n),a=0,o=0,s=!1,c=ut.create();if(Ze&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,wi={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ei=n.style.scrollBehavior,Ti={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=fe(n)?n:r;if(s=Oi(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,wi),Object.assign(r.style,Ti),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Ei)}function d(){u(),c.request(l)}l();let f=Q(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ji=new class{lockCount=0;restore=null;timeoutLock=gt.create();timeoutUnlock=gt.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=$(e).documentElement,n=W(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=c;return}let r=Ke||!Di(e);this.restore=r?ki(e):Ai(e)}};function Mi(e=!0,t=null){J(()=>{if(e)return ji.acquire(t)},[e,t])}var Ni=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Pi={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Fi={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ii={disabled:!1,...Fi},Li={valid(e){return e===null?null:e?{[Ni.valid]:``}:{[Ni.invalid]:``}}},Ri={invalid:void 0,name:void 0,validityData:{state:Pi,errors:[],error:``,value:``,initialValue:null},setValidityData:c,disabled:void 0,touched:Fi.touched,setTouched:c,dirty:Fi.dirty,setDirty:c,filled:Fi.filled,setFilled:c,focused:Fi.focused,setFocused:c,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Ii,markedDirtyRef:{current:!1},registerFieldControl:c,validation:{getValidationProps:(e,t=r)=>t,inputRef:{current:null},registerInput:c,commit:async()=>{},change:c}},zi=V.createContext(Ri);function Bi(e=!0){let t=V.useContext(zi);if(t.setValidityData===c&&!e)throw Error(d(28));return t}var Vi=V.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:c,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function Hi(){return V.useContext(Vi)}var Ui=V.createContext({controlId:void 0,registerControlId:c,labelId:void 0,setLabelId:c,messageIds:[],setMessageIds:c,getDescriptionProps:e=>e});function Wi(){return V.useContext(Ui)}function Gi(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:o}=Wi(),s=it(t),l=n?i:void 0,u=a(()=>Symbol(`labelable-control`)),d=V.useRef(!1),f=V.useRef(t!=null),p=q(()=>{!d.current||o===c||(d.current=!1,o(u.current,void 0))});return J(()=>{if(o===c)return;let e;if(n){let n=r?.current;e=G(n)&&n.closest(`label`)!=null?t??null:l??s}else if(t!=null)f.current=!0,e=t;else if(f.current)e=s;else{p();return}if(e===void 0){p();return}d.current=!0,o(u.current,e)},[t,r,l,o,n,s,u,p]),V.useEffect(()=>p,[p]),i??s}function Ki(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Bi(),s=V.useRef(null);s.current||=Symbol(),J(()=>{let c=s.current;if(!(!c||!i))return o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}),()=>{o(c,void 0)}},[e,i,r,t,a,o,n])}var qi=V.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFocused:b,setFilled:x,validationMode:S,validation:C}=Bi(),{clearErrors:w}=Hi(),T=g||c,E=h??a,D={...m,disabled:T},{labelId:O}=Wi(),k=Gi({id:i});J(()=>{let e=o!=null;C.inputRef.current?.value||e&&o!==``?x(!0):e&&o===``&&x(!1)},[C.inputRef,x,o]);let j=V.useRef(null);J(()=>{d&&j.current===X($(j.current))&&b(!0)},[d,b]);let[M]=H({controlled:o,default:u,name:`FieldControl`,state:`value`}),N=o!==void 0,ee=N?M:void 0,P=q(()=>C.inputRef.current?.value);return Ki(C.inputRef,k,ee,P,!T,a),s(`input`,e,{ref:[t,j],state:D,props:[{id:k,disabled:T,name:E,ref:C.inputRef,"aria-labelledby":O,autoFocus:d,...N?{value:ee}:{defaultValue:u},onChange(e){let t=e.currentTarget.value;l?.(t,at(A,e.nativeEvent)),v(t!==y.initialValue),x(t!==``),e.nativeEvent.defaultPrevented||(w(E),C.change(t))},onFocus(){b(!0)},onBlur(e){_(!0),b(!1),S===`onBlur`&&C.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(_(!0),C.commit(e.currentTarget.value))}},p,e=>C.getValidationProps(T,e)],stateAttributesMapping:Li})}),Ji=V.forwardRef(function(e,t){return(0,B.jsx)(qi,{ref:t,...e})});function Yi({className:e,size:t=`default`,unstyled:n=!1,nativeInput:r=!1,...i}){let a=l(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,i.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,i.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`),o;if(r){let{style:e,onValueChange:n,...r}=i;o=(0,B.jsx)(`input`,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,style:typeof e==`function`?void 0:e,...r})}else o=(0,B.jsx)(Ji,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,...i});return(0,B.jsx)(`span`,{className:l(!n&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:o})}function Xi(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Zi(e,t){return Math.max(0,e-t)}function Qi(e,t){if(t<=0)return 0;let n=Xi(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}var $i=`base-ui-disable-scrollbar`,ea={className:$i,getElement(e){return(0,B.jsx)(`style`,{nonce:e,href:$i,precedence:`base-ui:low`,children:`.${$i}{scrollbar-width:none}.${$i}::-webkit-scrollbar{display:none}`})}},ta=V.createContext(void 0),na={disableStyleElements:!1};function ra(){return V.useContext(ta)??na}export{yr as $,D as $n,pt as $t,gi as A,me as An,Bt as At,ei as B,P as Bn,Z as Bt,pi as C,W as Cn,Qt as Ct,mi as D,Se as Dn,Ut as Dt,li as E,K as En,Gt as Et,Gr as F,ae as Fn,jt as Ft,Hr as G,ie as Gn,Ot as Gt,Kr as H,oe as Hn,kt as Ht,Jr as I,ne as In,It,Fr as J,j as Jn,xt as Jt,Br as K,N as Kn,St as Kt,Qr as L,te as Ln,Pt as Lt,ni as M,H as Mn,Q as Mt,Wr as N,re as Nn,Rt as Nt,ui as O,fe as On,Wt as Ot,Yr as P,F as Pn,Ft as Pt,br as Q,O as Qn,mt as Qt,Xr as R,se as Rn,Lt as Rt,ri as S,Te as Sn,qt as St,ci as T,G as Tn,Xt as Tt,Zr as U,A as Un,Et as Ut,ti as V,I as Vn,At as Vt,Ur as W,ee as Wn,Dt as Wt,Mr as X,b as Xn,gt as Xt,jr as Y,R as Yn,vt as Yt,Sr as Z,k as Zn,_t as Zt,bi as _,le as _n,bn as _t,Xi as a,rt as an,nr as at,ai as b,we as bn,Yt as bt,Ki as c,Ke as cn,Zn as ct,Hi as d,Pe as dn,Wn as dt,ft as en,g as er,vr as et,Bi as f,Fe as fn,Gn as ft,Si as g,be as gn,_n as gt,Ci as h,Ce as hn,Tn as ht,Qi as i,it as in,ir as it,_i as j,xe as jn,zt as jt,di as k,pe as kn,$ as kt,Gi as l,Ye as ln,Un as lt,Mi as m,q as mn,Dn as mt,ea as n,st as nn,h as nr,ar as nt,Yi as o,$e as on,rr as ot,Li as p,J as pn,kn as pt,zr as q,M as qn,bt as qt,Zi as r,at as rn,or as rt,qi as s,Ze as sn,$n as st,ra as t,dt as tn,y as tr,hr as tt,Wi as u,Le as un,Hn as ut,ii as v,Oe as vn,xn as vt,si as w,ye as wn,Kt as wt,oi as x,De as xn,Jt as xt,fi as y,U as yn,Sn as yt,$r as z,L as zn,X as zt};
@@ -1 +1 @@
1
- import{_ as e,b as t,g as n,m as r,t as i}from"./button-BDDZnIHx.js";import{t as a}from"./code-xml-jFAa3-TT.js";import{t as o}from"./git-branch-Cfj9D8yW.js";import{Ft as s,Gt as c,Ht as l,It as u,Lt as d,M as f,Mt as p,Ot as m,Rt as h,U as g,a as _,ct as v,i as y,jt as b,n as x,r as S,rt as C,vt as w,xt as T,yt as E}from"./index-wy68EqfB.js";import{t as D}from"./card-BKXzd_5L.js";import{a as O,i as k,n as A,r as j,t as M}from"./empty-BdlgbifD.js";var N=t(e(),1),P=n(),F=[{id:`antigravity`,name:`Google Antigravity`,shortName:`Antigravity`,cliCommand:`agy`,icon:(0,P.jsx)(w,{className:`size-4`}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`antigravity-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`agy`,isAvailable:e.antigravity??!0,unavailableReason:`CLI "agy" not found on PATH`,icon:(0,P.jsx)(b,{size:12})},{id:`antigravity-ide`,label:`Antigravity IDE Workspace`,shortLabel:`IDE`,type:`editor`,targetId:`antigravity`,isAvailable:t.find(e=>e.id===`antigravity`)?.available??!1,unavailableReason:`Antigravity IDE not installed`,icon:(0,P.jsx)(a,{size:12})}]},{id:`claude`,name:`Claude Code`,shortName:`Claude`,cliCommand:`claude`,icon:(0,P.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,P.jsx)(E,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`claude-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`claude`,isAvailable:e.claude??!1,unavailableReason:`CLI "claude" not found on PATH`,icon:(0,P.jsx)(b,{size:12})},{id:`claude-desktop`,label:`Claude Desktop App`,shortLabel:`App`,type:`app`,targetId:`claude-desktop`,isAvailable:t.find(e=>e.id===`claude-desktop`)?.available??!1,unavailableReason:`Claude Desktop not detected`,icon:(0,P.jsx)(h,{size:12})}]},{id:`codex`,name:`OpenAI Codex`,shortName:`Codex`,cliCommand:`codex`,icon:(0,P.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,P.jsx)(m,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`codex-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`codex`,isAvailable:e.codex??!1,unavailableReason:`CLI "codex" not found on PATH`,icon:(0,P.jsx)(b,{size:12})},{id:`codex-desktop`,label:`Codex Desktop App`,shortLabel:`App`,type:`app`,targetId:`codex-desktop`,isAvailable:t.find(e=>e.id===`codex-desktop`)?.available??!1,unavailableReason:`Codex Desktop not detected`,icon:(0,P.jsx)(h,{size:12})}]},{id:`copilot`,name:`GitHub Copilot`,shortName:`Copilot`,cliCommand:`copilot`,icon:(0,P.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-gradient-to-tr from-purple-600 via-indigo-500 to-blue-600 text-white shadow-2xs`,children:(0,P.jsx)(T,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`copilot-cli`,label:`Copilot CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`copilot`,isAvailable:e.copilot??!0,icon:(0,P.jsx)(b,{size:12})},{id:`copilot-vscode`,label:`VS Code with Copilot`,shortLabel:`VS Code`,type:`editor`,targetId:`vscode`,isAvailable:t.find(e=>e.id===`vscode`)?.available??!1,unavailableReason:`VS Code not detected`,icon:(0,P.jsx)(a,{size:12})}]}];function I({workspaces:e,workspaceStatuses:t,workspacesLoading:n=!1,onOpenWorkspace:a,onNewWorkspace:h,showToast:b}){let I=f(),L=C(),R=g(),[z,B]=(0,N.useState)(null),V=Object.values(t),H=V.reduce((e,t)=>e+(t.changedFiles||0),0),U=V.filter(e=>e.changedFiles>0).length,W=V.reduce((e,t)=>e+(t.runningServices||0),0),G=V.filter(e=>e.runningServices>0).length,K=e.filter(e=>(e.mode??`worktree`)===`worktree`).length,q=e.filter(e=>e.mode===`in-place`).length,J=(0,N.useMemo)(()=>{let t=new Map;return e.forEach(e=>{(e.repos||[]).forEach(e=>{let n=x(e),r=t.get(n);r?r.count+=1:t.set(n,{name:n,path:e,count:1})})}),Array.from(t.values())},[e]),Y=(0,N.useMemo)(()=>{let e={};return(I.data??[]).forEach(t=>{e[t.name]=t.detected}),e},[I.data]),X=(0,N.useMemo)(()=>L.data??[],[L.data]),Z=(0,N.useMemo)(()=>F.map(e=>{let t=e.getOptions({aiDetected:Y,launchTargets:X}),n=t.filter(e=>e.isAvailable),r=n[0]||t[0],i=n.length>0,a=`Not found`,o=`neutral`;return n.length>1?(a=`${n.map(e=>e.shortLabel).join(` & `)} Ready`,o=`success`):n.length===1&&(a=`${n[0].shortLabel} Ready`,o=`success`),{harness:e,allOptions:t,availableOptions:n,primaryOption:r,isAnyAvailable:i,statusLabel:a,statusTone:o}}),[Y,X]),Q=async(t,n)=>{if(z)return;let r=e[0];if(!r){b?.(`No active workspace available to launch harness in.`,`error`);return}let i=`${t.id}:${n.id}`;B(i);try{n.type===`cli`?(await R.mutateAsync({workspaceId:r.branchName,assistant:t.id,command:n.command}),b?.(`Launched ${t.name} (${n.label}) for ${r.branchName}`,`success`)):n.targetId&&(await v(`/api/workspace/${encodeURIComponent(r.branchName)}/launch`,{method:`POST`,body:JSON.stringify({targetId:n.targetId})}),b?.(`Opened ${r.branchName} in ${t.name} (${n.label})`,`success`))}catch(e){b?.(`Failed to launch ${t.name}: ${e instanceof Error?e.message:String(e)}`,`error`)}finally{B(null)}};return(0,P.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in space-y-5 pb-10`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between border-b border-border/70 pb-4`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`h1`,{className:`text-lg sm:text-xl font-bold tracking-tight text-foreground`,children:`Environment Overview`}),(0,P.jsx)(y,{tone:`running`,dot:!0,children:`Live Telemetry`})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Multi-repo health, background services, and AI coding activity across your workspaces.`})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:(0,P.jsxs)(i,{size:`sm`,variant:`default`,onClick:h,children:[(0,P.jsx)(s,{size:14}),` Start work`]})})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Workspaces`}),(0,P.jsx)(`span`,{className:`grid size-7 place-items-center rounded bg-primary/10 text-primary`,children:(0,P.jsx)(d,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsx)(`div`,{className:`font-mono text-2xl font-bold text-foreground`,children:e.length}),(0,P.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground`,children:[(0,P.jsxs)(`span`,{children:[K,` worktrees`]}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsxs)(`span`,{children:[q,` in-place`]})]})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Git Activity`}),(0,P.jsx)(`span`,{className:r(`grid size-7 place-items-center rounded`,H>0?`bg-amber-500/15 text-amber-600 dark:text-amber-400`:`bg-emerald-500/15 text-emerald-600 dark:text-emerald-400`),children:(0,P.jsx)(o,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:r(`font-mono text-2xl font-bold`,H>0?`text-amber-600 dark:text-amber-400`:`text-emerald-600 dark:text-emerald-400`),children:[H,` `,(0,P.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`files`})]}),(0,P.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:U>0?`${U} workspace${U===1?``:`s`} with changes`:`All workspaces clean`})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Live Services`}),(0,P.jsx)(`span`,{className:r(`grid size-7 place-items-center rounded`,W>0?`bg-emerald-500/15 text-emerald-400`:`bg-muted/60 text-muted-foreground`),children:(0,P.jsx)(u,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:r(`font-mono text-2xl font-bold`,W>0?`text-emerald-400`:`text-muted-foreground`),children:[W,` `,(0,P.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`active`})]}),(0,P.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:G>0?`In ${G} workspace${G===1?``:`s`}`:`No services running`})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`AI Harnesses`}),(0,P.jsx)(`span`,{className:`grid size-7 place-items-center rounded bg-primary/10 text-primary`,children:(0,P.jsx)(p,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:`font-mono text-2xl font-bold text-foreground`,children:[Z.filter(e=>e.isAnyAvailable).length,` / `,Z.length]}),(0,P.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 text-[11px] text-muted-foreground font-mono`,children:[(0,P.jsx)(`span`,{children:`Antigravity`}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsx)(`span`,{children:`Claude`}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsx)(`span`,{children:`Codex`})]})]})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:[(0,P.jsx)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`AI Coding Assistant Hub`}),(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`Direct CLI & Desktop launcher with dynamic environment detection`})]}),(0,P.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:Z.map(({harness:e,availableOptions:t,isAnyAvailable:n,statusTone:r})=>{let a=!!(z&&z.startsWith(`${e.id}:`));return(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[e.icon,(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`span`,{className:`text-sm font-bold text-foreground block`,children:e.name}),(0,P.jsxs)(`span`,{className:`font-mono text-[10.5px] text-muted-foreground`,children:[`CLI command: `,e.cliCommand]})]})]}),(0,P.jsx)(y,{tone:r,dot:n,children:n?`Ready`:`Not installed`})]}),(0,P.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1 border-t border-border/50`,children:n?t.map(t=>{let n=z===`${e.id}:${t.id}`;return(0,P.jsxs)(i,{size:`xs`,variant:`outline`,disabled:a,onClick:()=>void Q(e,t),className:`gap-1.5 font-medium`,title:`Launch ${e.name} (${t.label}) in active workspace`,children:[n?(0,P.jsx)(_,{className:`size-3`}):t.icon,(0,P.jsx)(`span`,{children:t.label})]},t.id)}):(0,P.jsx)(i,{size:`xs`,variant:`outline`,disabled:!0,className:`opacity-50 text-muted-foreground cursor-not-allowed`,children:`Not Installed`})})]},e.id)})})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Workspace Divergence & Health Matrix`}),(0,P.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.2 font-mono text-[10px] text-foreground`,children:e.length})]})}),n?(0,P.jsx)(D,{className:`p-8 surface-card flex items-center justify-center`,children:(0,P.jsx)(_,{className:`size-5 text-primary`})}):e.length===0?(0,P.jsx)(D,{className:`border-dashed surface-card`,children:(0,P.jsxs)(M,{children:[(0,P.jsxs)(j,{children:[(0,P.jsx)(k,{variant:`icon`,children:(0,P.jsx)(d,{})}),(0,P.jsx)(O,{children:`No active workspaces`}),(0,P.jsx)(A,{children:`Start your first multi-repo workspace to automatically branch worktrees and prepare AI contexts.`})]}),(0,P.jsxs)(i,{onClick:h,children:[(0,P.jsx)(s,{size:15}),` Start work`]})]})}):(0,P.jsxs)(D,{className:`divide-y divide-border/60 overflow-hidden surface-card`,children:[(0,P.jsxs)(`div`,{className:`hidden sm:grid grid-cols-12 gap-3 px-4 py-2 bg-muted/30 text-[10px] font-bold uppercase tracking-wider text-muted-foreground font-mono`,children:[(0,P.jsx)(`span`,{className:`col-span-4`,children:`Workspace / Branch`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`AI Harness`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`Git Status`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`Services`}),(0,P.jsx)(`span`,{className:`col-span-2 text-right`,children:`Action`})]}),e.map(e=>{let n=t[e.branchName],o=!!(n&&n.changedFiles>0),s=!!(n&&n.runningServices>0),l=(e.mode??`worktree`)===`in-place`?null:n?S(n.syncStatus):null;return(0,P.jsxs)(`div`,{onClick:()=>a(e.branchName),className:`grid grid-cols-1 sm:grid-cols-12 gap-2 sm:gap-3 px-4 py-3 items-center hover:bg-accent/40 transition-colors cursor-pointer text-xs`,children:[(0,P.jsxs)(`div`,{className:`sm:col-span-4 min-w-0 flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:r(`size-2 rounded-full shrink-0`,o?`bg-amber-400`:`bg-emerald-500`)}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono font-bold text-foreground`,title:e.branchName,children:e.branchName}),(0,P.jsx)(`span`,{className:`text-[9px] font-mono uppercase tracking-wider text-muted-foreground bg-muted px-1 rounded shrink-0`,children:e.mode===`in-place`?`In-place`:`Worktree`})]}),(0,P.jsxs)(`div`,{className:`text-[10px] text-muted-foreground font-mono truncate mt-0.5`,children:[e.repos.length,` `,e.repos.length===1?`repo`:`repos`,` • `,new Date(e.createdAt).toLocaleDateString()]})]})]}),(0,P.jsx)(`div`,{className:`sm:col-span-2 flex items-center gap-1.5 min-w-0`,children:e.assistants&&e.assistants.length>0?e.assistants.map(e=>(0,P.jsx)(`span`,{className:`inline-flex items-center`,title:`Configured AI: ${e}`,children:e===`antigravity`?(0,P.jsx)(w,{className:`size-3.5`}):e===`claude`?(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,P.jsx)(E,{className:`size-2`})}):e===`codex`?(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,P.jsx)(m,{className:`size-2`})}):(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-blue-600 text-white shadow-2xs`,children:(0,P.jsx)(T,{className:`size-2`})})},e)):(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`—`})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 font-mono text-[11px]`,children:o?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-amber-600 dark:text-amber-400 font-semibold`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500`}),n.changedFiles,` modified`,l&&l.tone!==`idle`&&(0,P.jsxs)(`span`,{className:`text-[10px] text-muted-foreground ml-0.5 font-normal`,children:[`(`,l.label,`)`]})]}):(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500`}),`Clean`]})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 font-mono text-[11px]`,children:s?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500 animate-pulse`}),n.runningServices,` active`]}):(0,P.jsx)(`span`,{className:`text-muted-foreground/70`,children:`Offline`})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 flex items-center justify-end gap-1`,onClick:e=>e.stopPropagation(),children:(0,P.jsxs)(i,{size:`xs`,variant:`ghost`,onClick:()=>a(e.branchName),className:`gap-1 text-primary hover:text-primary`,children:[(0,P.jsx)(`span`,{children:`Inspect`}),(0,P.jsx)(c,{size:12})]})})]},e.id)})]})]}),J.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:[(0,P.jsxs)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:[`Repository Worktree Allocations (`,J.length,`)`]}),(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`Underlying git repos mapped across features`})]}),(0,P.jsx)(D,{className:`divide-y divide-border/60 overflow-hidden surface-card`,children:J.map(e=>(0,P.jsxs)(`div`,{className:`flex items-center justify-between p-3 text-xs`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0 font-mono`,children:[(0,P.jsx)(`span`,{className:`grid size-6 place-items-center rounded bg-muted/60 text-muted-foreground`,children:(0,P.jsx)(l,{size:13})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`span`,{className:`font-bold text-foreground block truncate`,children:e.name}),(0,P.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate block`,children:e.path})]})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 font-mono text-[11px] text-muted-foreground`,children:(0,P.jsxs)(`span`,{className:`rounded bg-muted px-2 py-0.5 text-foreground font-semibold`,children:[e.count,` `,e.count===1?`workspace worktree`:`workspace worktrees`]})})]},e.name))})]})]})}export{I as DashboardPage};
1
+ import{_ as e,b as t,g as n,m as r,t as i}from"./button-BDDZnIHx.js";import{t as a}from"./code-xml-jFAa3-TT.js";import{t as o}from"./git-branch-Cfj9D8yW.js";import{Bt as s,Gt as c,Kt as l,M as u,St as d,U as f,Wt as p,Zt as m,a as h,ct as g,en as _,i as v,jt as y,n as b,qt as x,r as S,rt as C,wt as w,xt as T,zt as E}from"./index-C_rwnBzF.js";import{t as D}from"./card-BKXzd_5L.js";import{a as O,i as k,n as A,r as j,t as M}from"./empty-BdlgbifD.js";var N=t(e(),1),P=n(),F=[{id:`antigravity`,name:`Google Antigravity`,shortName:`Antigravity`,cliCommand:`agy`,icon:(0,P.jsx)(T,{className:`size-4`}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`antigravity-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`agy`,isAvailable:e.antigravity??!0,unavailableReason:`CLI "agy" not found on PATH`,icon:(0,P.jsx)(E,{size:12})},{id:`antigravity-ide`,label:`Antigravity IDE Workspace`,shortLabel:`IDE`,type:`editor`,targetId:`antigravity`,isAvailable:t.find(e=>e.id===`antigravity`)?.available??!1,unavailableReason:`Antigravity IDE not installed`,icon:(0,P.jsx)(a,{size:12})}]},{id:`claude`,name:`Claude Code`,shortName:`Claude`,cliCommand:`claude`,icon:(0,P.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,P.jsx)(d,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`claude-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`claude`,isAvailable:e.claude??!1,unavailableReason:`CLI "claude" not found on PATH`,icon:(0,P.jsx)(E,{size:12})},{id:`claude-desktop`,label:`Claude Desktop App`,shortLabel:`App`,type:`app`,targetId:`claude-desktop`,isAvailable:t.find(e=>e.id===`claude-desktop`)?.available??!1,unavailableReason:`Claude Desktop not detected`,icon:(0,P.jsx)(x,{size:12})}]},{id:`codex`,name:`OpenAI Codex`,shortName:`Codex`,cliCommand:`codex`,icon:(0,P.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,P.jsx)(y,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`codex-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`codex`,isAvailable:e.codex??!1,unavailableReason:`CLI "codex" not found on PATH`,icon:(0,P.jsx)(E,{size:12})},{id:`codex-desktop`,label:`Codex Desktop App`,shortLabel:`App`,type:`app`,targetId:`codex-desktop`,isAvailable:t.find(e=>e.id===`codex-desktop`)?.available??!1,unavailableReason:`Codex Desktop not detected`,icon:(0,P.jsx)(x,{size:12})}]},{id:`copilot`,name:`GitHub Copilot`,shortName:`Copilot`,cliCommand:`copilot`,icon:(0,P.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-gradient-to-tr from-purple-600 via-indigo-500 to-blue-600 text-white shadow-2xs`,children:(0,P.jsx)(w,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`copilot-cli`,label:`Copilot CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`copilot`,isAvailable:e.copilot??!0,icon:(0,P.jsx)(E,{size:12})},{id:`copilot-vscode`,label:`VS Code with Copilot`,shortLabel:`VS Code`,type:`editor`,targetId:`vscode`,isAvailable:t.find(e=>e.id===`vscode`)?.available??!1,unavailableReason:`VS Code not detected`,icon:(0,P.jsx)(a,{size:12})}]}];function I({workspaces:e,workspaceStatuses:t,workspacesLoading:n=!1,onOpenWorkspace:a,onNewWorkspace:x,showToast:E}){let I=u(),L=C(),R=f(),[z,B]=(0,N.useState)(null),V=Object.values(t),H=V.reduce((e,t)=>e+(t.changedFiles||0),0),U=V.filter(e=>e.changedFiles>0).length,W=V.reduce((e,t)=>e+(t.runningServices||0),0),G=V.filter(e=>e.runningServices>0).length,K=e.filter(e=>(e.mode??`worktree`)===`worktree`).length,q=e.filter(e=>e.mode===`in-place`).length,J=(0,N.useMemo)(()=>{let t=new Map;return e.forEach(e=>{(e.repos||[]).forEach(e=>{let n=b(e),r=t.get(n);r?r.count+=1:t.set(n,{name:n,path:e,count:1})})}),Array.from(t.values())},[e]),Y=(0,N.useMemo)(()=>{let e={};return(I.data??[]).forEach(t=>{e[t.name]=t.detected}),e},[I.data]),X=(0,N.useMemo)(()=>L.data??[],[L.data]),Z=(0,N.useMemo)(()=>F.map(e=>{let t=e.getOptions({aiDetected:Y,launchTargets:X}),n=t.filter(e=>e.isAvailable),r=n[0]||t[0],i=n.length>0,a=`Not found`,o=`neutral`;return n.length>1?(a=`${n.map(e=>e.shortLabel).join(` & `)} Ready`,o=`success`):n.length===1&&(a=`${n[0].shortLabel} Ready`,o=`success`),{harness:e,allOptions:t,availableOptions:n,primaryOption:r,isAnyAvailable:i,statusLabel:a,statusTone:o}}),[Y,X]),Q=async(t,n)=>{if(z)return;let r=e[0];if(!r){E?.(`No active workspace available to launch harness in.`,`error`);return}let i=`${t.id}:${n.id}`;B(i);try{n.type===`cli`?(await R.mutateAsync({workspaceId:r.branchName,assistant:t.id,command:n.command}),E?.(`Launched ${t.name} (${n.label}) for ${r.branchName}`,`success`)):n.targetId&&(await g(`/api/workspace/${encodeURIComponent(r.branchName)}/launch`,{method:`POST`,body:JSON.stringify({targetId:n.targetId})}),E?.(`Opened ${r.branchName} in ${t.name} (${n.label})`,`success`))}catch(e){E?.(`Failed to launch ${t.name}: ${e instanceof Error?e.message:String(e)}`,`error`)}finally{B(null)}};return(0,P.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in space-y-5 pb-10`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between border-b border-border/70 pb-4`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`h1`,{className:`text-lg sm:text-xl font-bold tracking-tight text-foreground`,children:`Environment Overview`}),(0,P.jsx)(v,{tone:`running`,dot:!0,children:`Live Telemetry`})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Multi-repo health, background services, and AI coding activity across your workspaces.`})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:(0,P.jsxs)(i,{size:`sm`,variant:`default`,onClick:x,children:[(0,P.jsx)(p,{size:14}),` Start work`]})})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Workspaces`}),(0,P.jsx)(`span`,{className:`grid size-7 place-items-center rounded bg-primary/10 text-primary`,children:(0,P.jsx)(l,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsx)(`div`,{className:`font-mono text-2xl font-bold text-foreground`,children:e.length}),(0,P.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground`,children:[(0,P.jsxs)(`span`,{children:[K,` worktrees`]}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsxs)(`span`,{children:[q,` in-place`]})]})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Git Activity`}),(0,P.jsx)(`span`,{className:r(`grid size-7 place-items-center rounded`,H>0?`bg-amber-500/15 text-amber-600 dark:text-amber-400`:`bg-emerald-500/15 text-emerald-600 dark:text-emerald-400`),children:(0,P.jsx)(o,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:r(`font-mono text-2xl font-bold`,H>0?`text-amber-600 dark:text-amber-400`:`text-emerald-600 dark:text-emerald-400`),children:[H,` `,(0,P.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`files`})]}),(0,P.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:U>0?`${U} workspace${U===1?``:`s`} with changes`:`All workspaces clean`})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Live Services`}),(0,P.jsx)(`span`,{className:r(`grid size-7 place-items-center rounded`,W>0?`bg-emerald-500/15 text-emerald-400`:`bg-muted/60 text-muted-foreground`),children:(0,P.jsx)(c,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:r(`font-mono text-2xl font-bold`,W>0?`text-emerald-400`:`text-muted-foreground`),children:[W,` `,(0,P.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`active`})]}),(0,P.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:G>0?`In ${G} workspace${G===1?``:`s`}`:`No services running`})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`AI Harnesses`}),(0,P.jsx)(`span`,{className:`grid size-7 place-items-center rounded bg-primary/10 text-primary`,children:(0,P.jsx)(s,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:`font-mono text-2xl font-bold text-foreground`,children:[Z.filter(e=>e.isAnyAvailable).length,` / `,Z.length]}),(0,P.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 text-[11px] text-muted-foreground font-mono`,children:[(0,P.jsx)(`span`,{children:`Antigravity`}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsx)(`span`,{children:`Claude`}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsx)(`span`,{children:`Codex`})]})]})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:[(0,P.jsx)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`AI Coding Assistant Hub`}),(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`Direct CLI & Desktop launcher with dynamic environment detection`})]}),(0,P.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:Z.map(({harness:e,availableOptions:t,isAnyAvailable:n,statusTone:r})=>{let a=!!(z&&z.startsWith(`${e.id}:`));return(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[e.icon,(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`span`,{className:`text-sm font-bold text-foreground block`,children:e.name}),(0,P.jsxs)(`span`,{className:`font-mono text-[10.5px] text-muted-foreground`,children:[`CLI command: `,e.cliCommand]})]})]}),(0,P.jsx)(v,{tone:r,dot:n,children:n?`Ready`:`Not installed`})]}),(0,P.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1 border-t border-border/50`,children:n?t.map(t=>{let n=z===`${e.id}:${t.id}`;return(0,P.jsxs)(i,{size:`xs`,variant:`outline`,disabled:a,onClick:()=>void Q(e,t),className:`gap-1.5 font-medium`,title:`Launch ${e.name} (${t.label}) in active workspace`,children:[n?(0,P.jsx)(h,{className:`size-3`}):t.icon,(0,P.jsx)(`span`,{children:t.label})]},t.id)}):(0,P.jsx)(i,{size:`xs`,variant:`outline`,disabled:!0,className:`opacity-50 text-muted-foreground cursor-not-allowed`,children:`Not Installed`})})]},e.id)})})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Workspace Divergence & Health Matrix`}),(0,P.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.2 font-mono text-[10px] text-foreground`,children:e.length})]})}),n?(0,P.jsx)(D,{className:`p-8 surface-card flex items-center justify-center`,children:(0,P.jsx)(h,{className:`size-5 text-primary`})}):e.length===0?(0,P.jsx)(D,{className:`border-dashed surface-card`,children:(0,P.jsxs)(M,{children:[(0,P.jsxs)(j,{children:[(0,P.jsx)(k,{variant:`icon`,children:(0,P.jsx)(l,{})}),(0,P.jsx)(O,{children:`No active workspaces`}),(0,P.jsx)(A,{children:`Start your first multi-repo workspace to automatically branch worktrees and prepare AI contexts.`})]}),(0,P.jsxs)(i,{onClick:x,children:[(0,P.jsx)(p,{size:15}),` Start work`]})]})}):(0,P.jsxs)(D,{className:`divide-y divide-border/60 overflow-hidden surface-card`,children:[(0,P.jsxs)(`div`,{className:`hidden sm:grid grid-cols-12 gap-3 px-4 py-2 bg-muted/30 text-[10px] font-bold uppercase tracking-wider text-muted-foreground font-mono`,children:[(0,P.jsx)(`span`,{className:`col-span-4`,children:`Workspace / Branch`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`AI Harness`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`Git Status`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`Services`}),(0,P.jsx)(`span`,{className:`col-span-2 text-right`,children:`Action`})]}),e.map(e=>{let n=t[e.branchName],o=!!(n&&n.changedFiles>0),s=!!(n&&n.runningServices>0),c=(e.mode??`worktree`)===`in-place`?null:n?S(n.syncStatus):null;return(0,P.jsxs)(`div`,{onClick:()=>a(e.branchName),className:`grid grid-cols-1 sm:grid-cols-12 gap-2 sm:gap-3 px-4 py-3 items-center hover:bg-accent/40 transition-colors cursor-pointer text-xs`,children:[(0,P.jsxs)(`div`,{className:`sm:col-span-4 min-w-0 flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:r(`size-2 rounded-full shrink-0`,o?`bg-amber-400`:`bg-emerald-500`)}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono font-bold text-foreground`,title:e.branchName,children:e.branchName}),(0,P.jsx)(`span`,{className:`text-[9px] font-mono uppercase tracking-wider text-muted-foreground bg-muted px-1 rounded shrink-0`,children:e.mode===`in-place`?`In-place`:`Worktree`})]}),(0,P.jsxs)(`div`,{className:`text-[10px] text-muted-foreground font-mono truncate mt-0.5`,children:[e.repos.length,` `,e.repos.length===1?`repo`:`repos`,` • `,new Date(e.createdAt).toLocaleDateString()]})]})]}),(0,P.jsx)(`div`,{className:`sm:col-span-2 flex items-center gap-1.5 min-w-0`,children:e.assistants&&e.assistants.length>0?e.assistants.map(e=>(0,P.jsx)(`span`,{className:`inline-flex items-center`,title:`Configured AI: ${e}`,children:e===`antigravity`?(0,P.jsx)(T,{className:`size-3.5`}):e===`claude`?(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,P.jsx)(d,{className:`size-2`})}):e===`codex`?(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,P.jsx)(y,{className:`size-2`})}):(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-blue-600 text-white shadow-2xs`,children:(0,P.jsx)(w,{className:`size-2`})})},e)):(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`—`})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 font-mono text-[11px]`,children:o?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-amber-600 dark:text-amber-400 font-semibold`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500`}),n.changedFiles,` modified`,c&&c.tone!==`idle`&&(0,P.jsxs)(`span`,{className:`text-[10px] text-muted-foreground ml-0.5 font-normal`,children:[`(`,c.label,`)`]})]}):(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500`}),`Clean`]})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 font-mono text-[11px]`,children:s?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500 animate-pulse`}),n.runningServices,` active`]}):(0,P.jsx)(`span`,{className:`text-muted-foreground/70`,children:`Offline`})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 flex items-center justify-end gap-1`,onClick:e=>e.stopPropagation(),children:(0,P.jsxs)(i,{size:`xs`,variant:`ghost`,onClick:()=>a(e.branchName),className:`gap-1 text-primary hover:text-primary`,children:[(0,P.jsx)(`span`,{children:`Inspect`}),(0,P.jsx)(_,{size:12})]})})]},e.id)})]})]}),J.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:[(0,P.jsxs)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:[`Repository Worktree Allocations (`,J.length,`)`]}),(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`Underlying git repos mapped across features`})]}),(0,P.jsx)(D,{className:`divide-y divide-border/60 overflow-hidden surface-card`,children:J.map(e=>(0,P.jsxs)(`div`,{className:`flex items-center justify-between p-3 text-xs`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0 font-mono`,children:[(0,P.jsx)(`span`,{className:`grid size-6 place-items-center rounded bg-muted/60 text-muted-foreground`,children:(0,P.jsx)(m,{size:13})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`span`,{className:`font-bold text-foreground block truncate`,children:e.name}),(0,P.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate block`,children:e.path})]})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 font-mono text-[11px] text-muted-foreground`,children:(0,P.jsxs)(`span`,{className:`rounded bg-muted px-2 py-0.5 text-foreground font-semibold`,children:[e.count,` `,e.count===1?`workspace worktree`:`workspace worktrees`]})})]},e.name))})]})]})}export{I as DashboardPage};
@@ -1 +1 @@
1
- import{g as e,t}from"./button-BDDZnIHx.js";import{t as n}from"./circle-plus-lmU1yNJd.js";import{Nt as r}from"./index-wy68EqfB.js";var i=e();function a({config:e,onCreateWorkspace:a,onModifySettings:o}){return(0,i.jsxs)(`div`,{className:`max-w-4xl mx-auto animate-fade-in`,children:[(0,i.jsxs)(`header`,{className:`mb-10`,children:[(0,i.jsx)(`div`,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-primary/10 text-primary border border-primary/20 text-xs font-semibold uppercase tracking-wider mb-4`,children:`Getting Started Guide`}),(0,i.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground mb-2`,children:`Welcome to NexusFlow`}),(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`NexusFlow orchestrates multi-repository developer environments. It combines isolated Git worktrees, automatic code analyzer sweeps, and background process running into a single dashboard.`})]}),(0,i.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-8 mb-10`,children:[(0,i.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm space-y-6`,children:[(0,i.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`NexusFlow Workflows`}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`1`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Configure Folders`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Specify your Development folder (where repositories live) and Workspaces folder. These are currently set to:`,(0,i.jsx)(`code`,{className:`block mt-1 text-[10px] text-primary break-all`,children:e.devDir||`Not Configured`})]})]})]}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`2`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Build Workspaces`}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Choose repositories and feature branch. NexusFlow checks out dependencies under a unified workspace directory using Git Worktrees, keeping original projects clean.`})]})]}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`3`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Align AI Context`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`NexusFlow writes files like `,(0,i.jsx)(`code`,{children:`CLAUDE.md`}),`, `,(0,i.jsx)(`code`,{children:`.cursorrules`}),`, `,(0,i.jsx)(`code`,{children:`AGENTS.md`}),` prompting the LLM to inspect project relations and list key assumptions and questions before coding.`]})]})]})]}),(0,i.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm flex flex-col justify-between`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`Current Configuration`}),(0,i.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Dev Folder:`}),(0,i.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.devDir})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Workspaces Folder:`}),(0,i.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.workspacesDir})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Preferred AI:`}),(0,i.jsx)(`span`,{className:`text-primary font-semibold uppercase`,children:e.defaultAssistant||`None`})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Scan Depth:`}),(0,i.jsxs)(`span`,{className:`text-foreground font-semibold`,children:[e.scanDepth,` levels`]})]})]})]}),(0,i.jsxs)(`div`,{className:`pt-6 border-t border-border flex flex-col gap-2`,children:[(0,i.jsxs)(t,{className:`w-full gap-2`,onClick:a,children:[(0,i.jsx)(n,{size:14}),` Create a Workspace`]}),(0,i.jsxs)(t,{variant:`outline`,className:`w-full gap-2`,onClick:o,children:[(0,i.jsx)(r,{size:14,className:`text-muted-foreground`}),` Modify Settings`]})]})]})]})]})}export{a as GettingStartedPage};
1
+ import{g as e,t}from"./button-BDDZnIHx.js";import{t as n}from"./circle-plus-lmU1yNJd.js";import{Vt as r}from"./index-C_rwnBzF.js";var i=e();function a({config:e,onCreateWorkspace:a,onModifySettings:o}){return(0,i.jsxs)(`div`,{className:`max-w-4xl mx-auto animate-fade-in`,children:[(0,i.jsxs)(`header`,{className:`mb-10`,children:[(0,i.jsx)(`div`,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-primary/10 text-primary border border-primary/20 text-xs font-semibold uppercase tracking-wider mb-4`,children:`Getting Started Guide`}),(0,i.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground mb-2`,children:`Welcome to NexusFlow`}),(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`NexusFlow orchestrates multi-repository developer environments. It combines isolated Git worktrees, automatic code analyzer sweeps, and background process running into a single dashboard.`})]}),(0,i.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-8 mb-10`,children:[(0,i.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm space-y-6`,children:[(0,i.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`NexusFlow Workflows`}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`1`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Configure Folders`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Specify your Development folder (where repositories live) and Workspaces folder. These are currently set to:`,(0,i.jsx)(`code`,{className:`block mt-1 text-[10px] text-primary break-all`,children:e.devDir||`Not Configured`})]})]})]}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`2`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Build Workspaces`}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Choose repositories and feature branch. NexusFlow checks out dependencies under a unified workspace directory using Git Worktrees, keeping original projects clean.`})]})]}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`3`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Align AI Context`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`NexusFlow writes files like `,(0,i.jsx)(`code`,{children:`CLAUDE.md`}),`, `,(0,i.jsx)(`code`,{children:`.cursorrules`}),`, `,(0,i.jsx)(`code`,{children:`AGENTS.md`}),` prompting the LLM to inspect project relations and list key assumptions and questions before coding.`]})]})]})]}),(0,i.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm flex flex-col justify-between`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`Current Configuration`}),(0,i.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Dev Folder:`}),(0,i.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.devDir})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Workspaces Folder:`}),(0,i.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.workspacesDir})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Preferred AI:`}),(0,i.jsx)(`span`,{className:`text-primary font-semibold uppercase`,children:e.defaultAssistant||`None`})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Scan Depth:`}),(0,i.jsxs)(`span`,{className:`text-foreground font-semibold`,children:[e.scanDepth,` levels`]})]})]})]}),(0,i.jsxs)(`div`,{className:`pt-6 border-t border-border flex flex-col gap-2`,children:[(0,i.jsxs)(t,{className:`w-full gap-2`,onClick:a,children:[(0,i.jsx)(n,{size:14}),` Create a Workspace`]}),(0,i.jsxs)(t,{variant:`outline`,className:`w-full gap-2`,onClick:o,children:[(0,i.jsx)(r,{size:14,className:`text-muted-foreground`}),` Modify Settings`]})]})]})]})]})}export{a as GettingStartedPage};
@@ -0,0 +1 @@
1
+ import{_ as e,b as t,g as n,t as r}from"./button-BDDZnIHx.js";import{o as i}from"./CSPContext-DBUu9tE0.js";import{n as a,t as o}from"./ScaffoldRepoInline-ywcpq9PX.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./alert-dialog-CQAX2yRx.js";import{t as h}from"./trash-2-CtR35_eF.js";import{F as g,Ft as _,G as v,Gt as ee,J as y,Kt as b,Wt as x,a as S,c as C,d as w,f as T,l as E,o as D,s as O,st as k,tt as A,u as j,z as M}from"./index-C_rwnBzF.js";import{t as N}from"./badge-CAohJGj6.js";import{a as P,i as F,n as I,r as L,t as te}from"./empty-BdlgbifD.js";var R=t(e(),1),z=n(),B={editingId:null,name:``,description:``,repoPaths:[]};function V(){let e=_(),t=v(),n=y(),V=k(),H=g(),U=A(),W=M(),[G,K]=(0,R.useState)(null),[q,J]=(0,R.useState)(null),[Y,X]=(0,R.useState)(null),Z=(0,R.useMemo)(()=>{let e={};for(let t of V.data??[])t.projectId&&(e[t.projectId]=(e[t.projectId]??0)+1);return e},[V.data]),Q=()=>{J(null),K(B)},ne=e=>{J(null),K({editingId:e.id,name:e.name,description:e.description??``,repoPaths:e.repos.map(e=>e.path)})},re=e=>{K(t=>t&&{...t,repoPaths:t.repoPaths.includes(e.path)?t.repoPaths.filter(t=>t!==e.path):[...t.repoPaths,e.path]})},ie=async()=>{if(G){J(null);try{G.editingId?await U.mutateAsync({id:G.editingId,name:G.name,description:G.description||null,repos:G.repoPaths}):await H.mutateAsync({name:G.name,description:G.description||void 0,repos:G.repoPaths}),K(null)}catch(e){J(e instanceof Error?e.message:String(e))}}},ae=async()=>{if(Y)try{await W.mutateAsync(Y.id)}finally{X(null)}},oe=!!(G&&G.name.trim()&&G.repoPaths.length>0),$=H.isPending||U.isPending;return(0,z.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,z.jsxs)(`header`,{className:`mb-6 flex items-center justify-between gap-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Projects`}),(0,z.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Named groups of repositories you start work from. Registered once, reused for every feature.`})]}),(0,z.jsxs)(r,{onClick:Q,children:[(0,z.jsx)(x,{}),` New project`]})]}),t.isLoading?(0,z.jsx)(`div`,{className:`flex justify-center py-20`,children:(0,z.jsx)(S,{className:`size-6`})}):(t.data??[]).length===0?(0,z.jsxs)(te,{className:`border border-border border-dashed`,children:[(0,z.jsxs)(L,{children:[(0,z.jsx)(F,{variant:`icon`,children:(0,z.jsx)(b,{})}),(0,z.jsx)(P,{children:`No projects yet`}),(0,z.jsx)(I,{children:`Register your first project to start work without re-picking repositories every time.`})]}),(0,z.jsxs)(r,{onClick:Q,children:[(0,z.jsx)(x,{}),` New project`]})]}):(0,z.jsx)(`ul`,{className:`flex flex-col gap-3`,children:(t.data??[]).map(t=>(0,z.jsx)(`li`,{className:`rounded-xl border border-border bg-card p-4 transition-colors hover:border-foreground/15`,children:(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:t.name}),(Z[t.id]??0)>0&&(0,z.jsxs)(N,{variant:`secondary`,children:[Z[t.id],` workspace`,Z[t.id]===1?``:`s`]})]}),t.description&&(0,z.jsx)(`p`,{className:`mt-0.5 truncate text-sm text-muted-foreground`,children:t.description}),(0,z.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:t.repos.map(e=>(0,z.jsxs)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:[e.path,(0,z.jsxs)(`span`,{className:`ml-2 text-muted-foreground/60`,children:[`[`,e.defaultBranch,`]`]})]},e.path))})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,z.jsxs)(r,{size:`sm`,onClick:()=>e(`/new?project=${encodeURIComponent(t.id)}`),children:[(0,z.jsx)(ee,{}),` Start work`]}),(0,z.jsx)(r,{size:`icon-sm`,variant:`ghost`,"aria-label":`Edit ${t.name}`,onClick:()=>ne(t),children:(0,z.jsx)(c,{})}),(0,z.jsx)(r,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${t.name}`,onClick:()=>X(t),children:(0,z.jsx)(h,{})})]})]})},t.id))}),(0,z.jsx)(D,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,z.jsxs)(w,{className:`max-w-lg`,children:[(0,z.jsxs)(E,{children:[(0,z.jsx)(T,{children:G?.editingId?`Edit project`:`New project`}),(0,z.jsx)(O,{children:`A project is a reusable group of source repositories. Removing one later never touches disk.`})]}),(0,z.jsxs)(j,{className:`space-y-4`,children:[(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Name`}),(0,z.jsx)(i,{value:G?.name??``,onChange:e=>K(t=>t&&{...t,name:e.target.value}),placeholder:`e.g. Hogia Billing`,autoFocus:!0})]}),(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsxs)(`span`,{className:`mb-1 block text-sm font-medium`,children:[`Description `,(0,z.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional)`})]}),(0,z.jsx)(i,{value:G?.description??``,onChange:e=>K(t=>t&&{...t,description:e.target.value}),placeholder:`What this group of repos is for`})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Repositories`}),(0,z.jsx)(a,{repos:n.data??[],selectedPaths:G?.repoPaths??[],onToggle:re,loading:n.isLoading,emptyHint:`No repositories found in your dev directory.`}),(0,z.jsx)(o,{onCreated:e=>K(t=>t&&{...t,repoPaths:[...t.repoPaths,e.path]})})]}),q&&(0,z.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:q})]}),(0,z.jsxs)(C,{children:[(0,z.jsx)(r,{variant:`outline`,onClick:()=>K(null),children:`Cancel`}),(0,z.jsxs)(r,{onClick:ie,disabled:!oe||$,children:[$?(0,z.jsx)(S,{}):null,G?.editingId?`Save changes`:`Create project`]})]})]})}),(0,z.jsx)(m,{open:Y!==null,onOpenChange:e=>!e&&X(null),children:(0,z.jsxs)(d,{children:[(0,z.jsxs)(s,{children:[(0,z.jsxs)(p,{children:[`Remove “`,Y?.name,`”?`]}),(0,z.jsx)(f,{children:`This only removes the project from the registry — repositories and workspaces on disk are not touched.`})]}),(0,z.jsxs)(l,{children:[(0,z.jsx)(u,{render:(0,z.jsx)(r,{variant:`outline`,children:`Cancel`})}),(0,z.jsxs)(r,{variant:`destructive`,onClick:ae,disabled:W.isPending,children:[W.isPending?(0,z.jsx)(S,{}):null,`Remove project`]})]})]})})]})}export{V as ProjectsPage};
@@ -0,0 +1 @@
1
+ import{_ as e,b as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,o as u,p as d,t as f}from"./button-BDDZnIHx.js";import{Cn as p,Dt as ee,Mn as te,Ot as m,Qt as h,Un as ne,c as re,d as ie,en as g,f as ae,in as oe,o as _,p as v,pn as y,rn as se,tr as b,u as ce,un as le}from"./CSPContext-DBUu9tE0.js";import{t as ue}from"./useValueChanged-DeYvGnKs.js";import{t as de}from"./useAriaLabelledBy-ClesgjMe.js";import{Ht as fe,I as x,a as S}from"./index-C_rwnBzF.js";var pe=o(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),C=t(e(),1),w=C.createContext({disabled:!1});function me(){return C.useContext(w)}var T=C.createContext(void 0);function he(e=!0){let t=C.useContext(T);if(t===void 0&&!e)throw Error(d(3));return t}function ge(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var E=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function _e(e){return C.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[E.checked]:``}:{[E.unchecked]:``}},...v}),[e.indeterminate])}var ve=C.createContext(void 0);function D(){let e=C.useContext(ve);if(e===void 0)throw Error(d(14));return e}var O=a(),ye=`data-parent`,be=C.forwardRef(function(e,t){let{checked:a,className:o,defaultChecked:l=!1,"aria-labelledby":d,disabled:f=!1,form:h,id:g,indeterminate:_=!1,inputRef:v,name:b,onCheckedChange:fe,parent:x=!1,readOnly:S=!1,render:pe,required:w=!1,uncheckedValue:T,value:E,nativeButton:D=!1,style:be,...k}=e,{clearErrors:A}=ie(),{disabled:j,name:M,setDirty:xe,setFilled:N,setFocused:P,setTouched:Se,state:Ce,validationMode:we,validityData:Te,validation:Ee}=ae(),De=me(),{labelId:Oe,controlId:ke,registerControlId:F,getDescriptionProps:Ae}=ce(),I=he(),L=I?.parent,R=L&&I.allValues,z=j||De.disabled||I?.disabled||f,B=M??b,V=E??B,je=oe(),Me=oe(),H=ke;R?H=x?Me:`${L.id}-${V}`:g&&(H=g);let U={};R&&(x?U=I.parent.getParentProps():V&&(U=I.parent.getChildProps(V)));let{checked:Ne=a,indeterminate:Pe=_,onCheckedChange:Fe,...Ie}=U,W=I?.value,Le=I?.setValue,Re=I?.defaultValue,G=C.useRef(null),K=i(()=>Symbol(`checkbox-control`)),q=C.useRef(!1),{getButtonProps:ze,buttonRef:Be}=le({disabled:z,native:D}),J=I?.validation??Ee,[Y,Ve]=te({controlled:V&&W&&!x?W.includes(V):Ne,default:V&&Re&&!x?Re.includes(V):l,name:`Checkbox`,state:`checked`}),X=R?!!Ne:Y,Z=R&&Pe||_;y(()=>{F!==c&&(q.current=!0,F(K.current,H))},[H,F,K]),C.useEffect(()=>{let e=K.current;return()=>{!q.current||F===c||(q.current=!1,F(e,void 0))}},[F,K]),re(G,je,Y,void 0,!I&&!z,b);let Q=C.useRef(null),He=r(v,Q,J.inputRef,J.registerInput),Ue=de(d,Oe,Q,!D,H??void 0);y(()=>{Q.current&&(Q.current.indeterminate=Z,Y&&N(!0))},[Y,Z,N]),ue(Y,()=>{I||(A(B),N(Y),xe(Y!==Te.initialValue),J.change(Y))});let We=u({checked:Y,disabled:z,form:h,name:x?void 0:B,id:D?void 0:H??void 0,required:w,ref:He,style:B?m:ee,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(S){e.preventDefault();return}let t=e.currentTarget.checked,n=se(ne,e.nativeEvent);if(fe?.(t,n),!n.isCanceled&&(Fe?.(t,n),!n.isCanceled&&(Ve(t),V&&W&&Le&&!x&&!R))){let e=t?[...W,V]:W.filter(e=>e!==V);Le(e,n)}},onFocus(){G.current?.focus()}},E===void 0?n:{value:(I?Y&&E:E)||``},Ae,e=>J.getValidationProps(z,e));C.useEffect(()=>{if(!L||!V)return;let e=L.disabledStatesRef.current;return e.set(V,z),()=>{e.delete(V)}},[L,z,V]);let $=C.useMemo(()=>({...Ce,checked:X,disabled:z,readOnly:S,required:w,indeterminate:Z}),[Ce,X,z,S,w,Z]),Ge=_e($),Ke=s(`span`,e,{state:$,ref:[Be,G,t,I?.registerControlRef],props:[{id:D?H??void 0:je,role:`checkbox`,"aria-checked":Z?`mixed`:X,"aria-readonly":S||void 0,"aria-required":w||void 0,"aria-labelledby":Ue,[ye]:x?``:void 0,onFocus(){z||P(!0)},onBlur(){let e=Q.current;e&&(Se(!0),P(!1),we===`onBlur`&&J.commit(I?W:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=Q.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),p(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||ge(t)?.click()})},onClick(e){if(S||z)return;e.preventDefault();let t=Q.current;t&&t.dispatchEvent(new(p(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},k,Ie,ze,Ae,e=>J.getValidationProps(z,e)],stateAttributesMapping:Ge});return(0,O.jsxs)(ve.Provider,{value:$,children:[Ke,!Y&&!I&&B&&!x&&T!==void 0&&(0,O.jsx)(`input`,{type:`hidden`,form:h,name:B,value:T,disabled:z}),(0,O.jsx)(`input`,{...We,suppressHydrationWarning:!0})]})}),k=C.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,c=D(),l=c.checked||c.indeterminate,{mounted:u,transitionStatus:d,setMounted:f}=g(l),p=C.useRef(null),ee={...c,transitionStatus:d};h({open:l,ref:p,onComplete(){l||f(!1)}});let te={..._e(c),...b,...v},m=a||u,ne=s(`span`,e,{ref:[t,p],state:ee,stateAttributesMapping:te,props:o});return m?ne:null});function A({className:e,...t}){return(0,O.jsx)(be,{className:l(`relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none`,e),"data-slot":`checkbox`,...t,children:(0,O.jsx)(k,{className:`-inset-px absolute flex items-center justify-center rounded-[.25rem] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground`,"data-slot":`checkbox-indicator`,render:(e,t)=>(0,O.jsx)(`span`,{...e,children:t.indeterminate?(0,O.jsx)(`svg`,{className:`size-3.5 sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,O.jsx)(`path`,{d:`M5.252 12h13.496`})}):(0,O.jsx)(`svg`,{className:`size-3.5 sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,O.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})})})})}function j({repos:e,selectedPaths:t,onToggle:n,loading:r,emptyHint:i,className:a}){let[o,s]=(0,C.useState)(``),c=(0,C.useMemo)(()=>{let t=o.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,o]);return(0,O.jsxs)(`div`,{className:l(`flex flex-col gap-2`,a),children:[(0,O.jsxs)(`div`,{className:`relative`,children:[(0,O.jsx)(fe,{className:`absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,O.jsx)(_,{value:o,onChange:e=>s(e.target.value),placeholder:`Filter repositories…`,className:`pl-8`,"aria-label":`Filter repositories`})]}),(0,O.jsx)(`div`,{className:`max-h-56 overflow-y-auto rounded-lg border border-border`,children:r?(0,O.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:`Scanning for repositories…`}):c.length===0?(0,O.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:i??`No repositories found.`}):(0,O.jsx)(`ul`,{className:`divide-y divide-border`,children:c.map(e=>(0,O.jsx)(`li`,{children:(0,O.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 px-3 py-2 hover:bg-accent`,children:[(0,O.jsx)(A,{checked:t.includes(e.path),onCheckedChange:()=>n(e),"aria-label":e.name}),(0,O.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,O.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,O.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.path})]}),(0,O.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:e.defaultBranch})]})},e.path))})})]})}function M({onCreated:e}){let[t,n]=(0,C.useState)(!1),[r,i]=(0,C.useState)(``),[a,o]=(0,C.useState)(null),s=x(),c=async()=>{o(null);try{let{repo:t}=await s.mutateAsync(r.trim());i(``),n(!1),e(t)}catch(e){o(e instanceof Error?e.message:String(e))}};return t?(0,O.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(_,{value:r,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===`Enter`&&r.trim()&&c(),placeholder:`new-repo-name`,className:`h-7 font-mono text-xs`,"aria-label":`New repository name`,autoFocus:!0}),(0,O.jsxs)(f,{size:`xs`,onClick:c,disabled:!r.trim()||s.isPending,children:[s.isPending?(0,O.jsx)(S,{}):null,`Create`]}),(0,O.jsx)(f,{size:`xs`,variant:`ghost`,onClick:()=>{n(!1),o(null)},children:`Cancel`})]}),a&&(0,O.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:a})]}):(0,O.jsxs)(`button`,{type:`button`,onClick:()=>n(!0),className:`mt-1.5 inline-flex cursor-pointer items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,O.jsx)(pe,{className:`size-3.5`}),` Scaffold a brand-new repository`]})}export{j as n,A as r,M as t};
@@ -1 +1 @@
1
- import{_ as e,b as t,c as n,d as r,g as i,i as a,m as o,n as s,o as c,p as l,t as u}from"./button-BDDZnIHx.js";import{$t as d,Ct as f,On as p,a as m,c as ee,en as te,i as ne,l as h,ln as re,n as g,o as ie,on as ae,s as oe,wt as se,yn as ce,zn as le}from"./CSPContext-BG7no5S_.js";import{t as ue}from"./useValueChanged-CStSGSsD.js";import{t as de}from"./useAriaLabelledBy-DfRdwH8a.js";import{At as _,D as v,E as y,O as b,Pt as x,T as S,Vt as C,a as w,k as T}from"./index-wy68EqfB.js";import{t as E}from"./badge-CAohJGj6.js";import{t as D}from"./card-BKXzd_5L.js";import{t as O}from"./label-CG5exjag.js";var k=t(e(),1),A=k.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:o,...s}=e;return a(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},s]})}),j=i(),M=s(`relative rounded-xl border px-3.5 py-3 text-card-foreground text-sm`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent dark:bg-input/32 [&_svg]:text-muted-foreground`,error:`border-destructive/32 bg-destructive/4 text-destructive-foreground [&_[data-slot=alert-description]]:text-destructive-foreground/80 [&_svg]:text-destructive`,info:`border-info/32 bg-info/4 [&_svg]:text-info`,success:`border-success/32 bg-success/4 [&_svg]:text-success`,warning:`border-warning/32 bg-warning/4 [&_svg]:text-warning`}}});function N(e){let t=e.props[`data-slot`];if(t)return t;let n=e.type;switch(n.displayName??n.name){case`AlertAction`:return`alert-action`;case`AlertTitle`:return`alert-title`;case`AlertDescription`:return`alert-description`;default:return}}function P({className:e,variant:t,children:n,...r}){let i=[],a=[],s=[];return k.Children.forEach(n,e=>{if(!(0,k.isValidElement)(e)){a.push(e);return}let t=N(e);t===`alert-action`?s.push(e):t===`alert-title`||t===`alert-description`?a.push(e):i.push(e)}),(0,j.jsx)(`div`,{className:o(M({variant:t}),e),"data-slot":`alert`,role:`alert`,...r,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i.length>0&&(0,j.jsx)(`div`,{className:`flex size-4 shrink-0 items-center justify-center [&>svg]:size-full`,children:i}),a.length>0&&(0,j.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:a}),s.length>0&&(0,j.jsx)(`div`,{className:`flex shrink-0 items-center self-center`,children:s})]})})}function F({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`font-medium`,e),"data-slot":`alert-title`,...t})}function I({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`flex flex-col gap-2.5 text-muted-foreground`,e),"data-slot":`alert-description`,...t})}function L({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`flex gap-1`,e),"data-slot":`alert-action`,...t})}F.displayName=`AlertTitle`,I.displayName=`AlertDescription`,L.displayName=`AlertAction`;function R({className:e,orientation:t=`horizontal`,...n}){return(0,j.jsx)(A,{className:o(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch`,e),"data-slot":`separator`,orientation:t,...n})}var z=k.createContext(void 0);function B(){let e=k.useContext(z);if(e===void 0)throw Error(l(63));return e}var V=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),H={...h,checked(e){return e?{[V.checked]:``}:{[V.unchecked]:``}}},U=k.forwardRef(function(e,t){let{checked:i,className:o,defaultChecked:s,"aria-labelledby":l,form:u,id:h,inputRef:g,name:_,nativeButton:v=!1,onCheckedChange:y,readOnly:b=!1,required:x=!1,disabled:S=!1,render:C,uncheckedValue:w,value:T,style:E,...D}=e,{clearErrors:O}=oe(),{state:A,setTouched:M,setDirty:N,validityData:P,setFilled:F,setFocused:I,validationMode:L,disabled:R,name:B,validation:V}=ee(),{labelId:U}=ie(),W=R||S,G=B??_,K=k.useRef(null),fe=r(K,g,V.inputRef),q=k.useRef(null),J=te(),Y=m({id:h,implicit:!1,controlRef:q}),X=v?void 0:Y,[Z,pe]=p({controlled:i,default:!!s,name:`Switch`,state:`checked`});ne(q,J,Z,void 0,!W,_),re(()=>{K.current&&F(K.current.checked)},[K,F]),ue(Z,()=>{O(G),N(Z!==P.initialValue),F(Z),V.change(Z)});let{getButtonProps:me,buttonRef:Q}=ae({disabled:W,native:v}),he=de(l,U,K,!v,X),ge={id:v?Y:J,role:`switch`,"aria-checked":Z,"aria-readonly":b||void 0,"aria-required":x||void 0,"aria-labelledby":he,onFocus(){W||I(!0)},onBlur(){let e=K.current;!e||W||(M(!0),I(!1),L===`onBlur`&&V.commit(e.checked))},onClick(e){if(b||W)return;e.preventDefault();let t=K.current;t&&t.dispatchEvent(new(ce(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},_e=c({checked:Z,disabled:W,form:u,id:X,name:G,required:x,style:G?se:f,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:fe,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(b){e.preventDefault();return}let t=e.currentTarget.checked,n=d(le,e.nativeEvent);y?.(t,n),!n.isCanceled&&pe(t)},onFocus(){q.current?.focus()}},e=>V.getValidationProps(W,e),T===void 0?n:{value:T}),$=k.useMemo(()=>({...A,checked:Z,disabled:W,readOnly:b,required:x}),[A,Z,W,b,x]),ve=a(`span`,e,{state:$,ref:[t,q,Q],props:[ge,D,me,e=>V.getValidationProps(W,e)],stateAttributesMapping:H});return(0,j.jsxs)(z.Provider,{value:$,children:[ve,!Z&&G&&w!==void 0&&(0,j.jsx)(`input`,{type:`hidden`,form:u,name:G,value:w,disabled:W}),(0,j.jsx)(`input`,{..._e,suppressHydrationWarning:!0})]})}),W=k.forwardRef(function(e,t){let{render:n,className:r,style:i,...o}=e;return a(`span`,e,{state:B(),ref:t,stateAttributesMapping:H,props:o})});function G({className:e,...t}){return(0,j.jsx)(U,{className:o(`inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 cursor-pointer items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(5)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:[--thumb-size:--spacing(4)]`,e),"data-slot":`switch`,...t,children:(0,j.jsx)(W,{className:o(`pointer-events-none block aspect-square h-full origin-left in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]`),"data-slot":`switch-thumb`})})}function K({config:e,setConfig:t,saveStatus:n,editors:r,adapters:i,saveAppConfig:a,isSettingsFormValid:o,toolsStatus:s,toolsLoading:c,updatingToolId:l,fetchToolsStatus:d,handleUpdateTool:f}){if(!e)return null;let p=r.find(t=>t.command===e.defaultEditor),m=i.find(t=>t.name===(e.storageProvider||`local`));return(0,j.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,j.jsxs)(`header`,{className:`mb-6`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Global Settings`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Configure your local directories, search parameters, and editor defaults.`})]}),n===`success`&&(0,j.jsxs)(P,{variant:`success`,className:`mb-6`,children:[(0,j.jsx)(C,{size:18}),` Settings successfully saved and updated!`]}),n===`error`&&(0,j.jsxs)(P,{variant:`error`,className:`mb-6`,children:[(0,j.jsx)(_,{size:18}),` Error: Could not save configuration details to disk.`]}),(0,j.jsx)(D,{className:`mb-6 rounded-xl p-6 shadow-sm`,children:(0,j.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:`Development Directory`}),(0,j.jsx)(g,{type:`text`,value:e.devDir,onChange:n=>t({...e,devDir:n.target.value})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where your git projects are scanned.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:`Workspaces Directory`}),(0,j.jsx)(g,{type:`text`,value:e.workspacesDir,onChange:n=>t({...e,workspacesDir:n.target.value})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where unified worktree environments are spun up.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:`Repo Search Depth`}),(0,j.jsx)(g,{type:`number`,min:1,max:5,value:e.scanDepth,onChange:n=>t({...e,scanDepth:parseInt(n.target.value,10)})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Max directory levels deep the system will traverse for git repos.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:`Default Assistant`}),(0,j.jsxs)(S,{value:e.defaultAssistant||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultAssistant:n||null}),children:[(0,j.jsx)(b,{"aria-label":`Default Assistant`,children:(0,j.jsx)(T,{children:e.defaultAssistant===`claude`?`Claude Code`:e.defaultAssistant===`antigravity`?`Antigravity`:e.defaultAssistant===`codex`?`Codex`:e.defaultAssistant===`copilot`?`GitHub Copilot`:e.defaultAssistant===`cursor`?`Cursor`:`None (Prompt me)`})}),(0,j.jsxs)(v,{alignItemWithTrigger:!1,children:[(0,j.jsx)(y,{value:``,children:`None (Prompt me)`}),(0,j.jsx)(y,{value:`claude`,children:`Claude Code`}),(0,j.jsx)(y,{value:`antigravity`,children:`Antigravity`}),(0,j.jsx)(y,{value:`codex`,children:`Codex`}),(0,j.jsx)(y,{value:`copilot`,children:`GitHub Copilot`}),(0,j.jsx)(y,{value:`cursor`,children:`Cursor`})]})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your preferred workspace context manager.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:`Preferred Editor`}),(0,j.jsxs)(S,{value:e.defaultEditor||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultEditor:n||null}),children:[(0,j.jsx)(b,{"aria-label":`Preferred Editor`,children:(0,j.jsx)(T,{children:p?`${p.name} ${p.detected?`(Detected)`:`(Not found)`}`:`No preference`})}),(0,j.jsxs)(v,{alignItemWithTrigger:!1,children:[(0,j.jsx)(y,{value:``,children:`No preference`}),r.map(e=>(0,j.jsxs)(y,{value:e.command,children:[e.name,` `,e.detected?`(Detected)`:`(Not found)`]},e.command))]})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Shown first in the “Open with…” workspace chooser.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-4 md:col-span-2`,children:[(0,j.jsx)(R,{className:`mt-1`}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Workspace Storage Settings`}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Choose where maps, plans, and knowledge files are stored.`})]}),(0,j.jsxs)(`div`,{className:`flex max-w-md flex-col gap-1.5`,children:[(0,j.jsx)(O,{htmlFor:`storageProvider`,className:`text-sm`,children:`Storage Provider`}),(0,j.jsxs)(S,{value:e.storageProvider||`local`,onValueChange:n=>{if(typeof n!=`string`)return;let r=n,a={...e,storageProvider:r},o=i.find(e=>e.name===r);o?.configFields?.length&&(a.adapterConfig||={},a.adapterConfig[r]||(a.adapterConfig[r]={}),o.configFields.forEach(e=>{a.adapterConfig[r][e.key]===void 0&&e.default!==void 0&&(a.adapterConfig[r][e.key]=e.default)})),t(a)},children:[(0,j.jsx)(b,{id:`storageProvider`,"aria-label":`Storage Provider`,children:(0,j.jsx)(T,{children:m?.displayName??`Local Workspace (Folders)`})}),(0,j.jsx)(v,{alignItemWithTrigger:!1,children:i.length>0?i.map(e=>(0,j.jsx)(y,{value:e.name,children:e.displayName},e.name)):(0,j.jsx)(y,{value:`local`,children:`Local Workspace (Folders)`})})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m?.description||`Choose where to store maps, plans, and knowledge files. Centralized vault keeps repositories 100% clean and allows Obsidian integration.`})]}),(()=>{let n=e.storageProvider||`local`,r=i.find(e=>e.name===n);return r?.configFields?.length?(0,j.jsxs)(`div`,{className:`flex max-w-md flex-col gap-4 rounded-xl border border-border bg-muted/40 p-4`,children:[(0,j.jsxs)(`h4`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:[r.displayName,` Settings`]}),r.configFields.map(r=>{let i=e.adapterConfig?.[n]?.[r.key]??r.default??``,a=i=>{let a={...e.adapterConfig||{},[n]:{...e.adapterConfig?.[n]||{},[r.key]:i}};t({...e,adapterConfig:a})};return r.type===`boolean`?(0,j.jsxs)(O,{className:`flex cursor-pointer items-start gap-3 text-sm`,children:[(0,j.jsx)(G,{checked:!!i,onCheckedChange:e=>a(e)}),(0,j.jsxs)(`span`,{className:`flex flex-col`,children:[(0,j.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r.label}),r.description&&(0,j.jsx)(`span`,{className:`mt-0.5 text-xs leading-normal text-muted-foreground`,children:r.description})]})]},r.key):(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:r.label}),(0,j.jsx)(g,{type:r.type===`number`?`number`:`text`,value:i,onChange:e=>{let t=r.type===`number`?Number(e.target.value):e.target.value;a(t)}}),r.description&&(0,j.jsx)(`span`,{className:`text-xs leading-normal text-muted-foreground`,children:r.description})]},r.key)})]}):null})()]})]})}),(0,j.jsxs)(D,{className:`mt-6 rounded-xl p-6 shadow-sm`,children:[(0,j.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:`AI Toolchain Updates`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Monitor and update the CLI packages and assistants in your workflow.`})]}),(0,j.jsxs)(u,{variant:`outline`,size:`sm`,onClick:()=>d(!0),disabled:c,children:[c?(0,j.jsx)(w,{className:`size-3`}):(0,j.jsx)(x,{size:13}),c?`Checking...`:`Check Now`]})]}),c&&s.length===0?(0,j.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground`,children:[(0,j.jsx)(w,{className:`size-6`}),(0,j.jsx)(`span`,{className:`text-xs`,children:`Fetching registry version details...`})]}):s.length===0?(0,j.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No toolchain information available.`}):(0,j.jsx)(`div`,{className:`space-y-4`,children:s.map(e=>(0,j.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl border border-border bg-muted/30 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[e.name,(0,j.jsx)(E,{variant:e.installed?`success`:`secondary`,size:`sm`,children:e.installed?`Installed`:`Not Installed`})]}),(0,j.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,j.jsxs)(`span`,{children:[`Installed version: `,(0,j.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.currentVersion})]}),e.installed&&(0,j.jsxs)(`span`,{children:[`Latest: `,(0,j.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.latestVersion})]})]}),(0,j.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.updateCmd})]}),(0,j.jsx)(`div`,{className:`flex shrink-0 items-center gap-3`,children:e.updateAvailable?(0,j.jsx)(u,{size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{className:`size-3`}),` Updating...`]}):`Update Tool`}):e.installed?(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(E,{variant:`success`,className:`gap-1.5`,children:[(0,j.jsx)(C,{size:12}),` Up to Date`]}),(0,j.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{className:`size-3`}),` Reinstalling...`]}):`Reinstall`})]}):(0,j.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{className:`size-3`}),` Installing...`]}):`Install CLI`})})]},e.id))})]}),(0,j.jsx)(`div`,{className:`mb-10 flex justify-end pt-4`,children:(0,j.jsxs)(u,{onClick:()=>a(e),disabled:!o,children:[(0,j.jsx)(C,{size:16}),` Save Configuration`]})})]})}export{K as SettingsPage};
1
+ import{_ as e,b as t,c as n,d as r,g as i,i as a,m as o,n as s,o as c,p as l,t as u}from"./button-BDDZnIHx.js";import{Cn as d,Dt as f,Mn as p,Ot as m,Un as ee,c as te,d as ne,f as re,in as ie,l as ae,o as h,p as g,pn as oe,rn as se,u as ce,un as le}from"./CSPContext-DBUu9tE0.js";import{t as ue}from"./useValueChanged-DeYvGnKs.js";import{t as de}from"./useAriaLabelledBy-ClesgjMe.js";import{D as _,E as v,O as y,Rt as b,T as x,Ut as S,Xt as C,a as w,k as T}from"./index-C_rwnBzF.js";import{t as E}from"./badge-CAohJGj6.js";import{t as D}from"./card-BKXzd_5L.js";import{t as O}from"./label-CG5exjag.js";var k=t(e(),1),A=k.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:o,...s}=e;return a(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},s]})}),j=i(),M=s(`relative rounded-xl border px-3.5 py-3 text-card-foreground text-sm`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent dark:bg-input/32 [&_svg]:text-muted-foreground`,error:`border-destructive/32 bg-destructive/4 text-destructive-foreground [&_[data-slot=alert-description]]:text-destructive-foreground/80 [&_svg]:text-destructive`,info:`border-info/32 bg-info/4 [&_svg]:text-info`,success:`border-success/32 bg-success/4 [&_svg]:text-success`,warning:`border-warning/32 bg-warning/4 [&_svg]:text-warning`}}});function N(e){let t=e.props[`data-slot`];if(t)return t;let n=e.type;switch(n.displayName??n.name){case`AlertAction`:return`alert-action`;case`AlertTitle`:return`alert-title`;case`AlertDescription`:return`alert-description`;default:return}}function P({className:e,variant:t,children:n,...r}){let i=[],a=[],s=[];return k.Children.forEach(n,e=>{if(!(0,k.isValidElement)(e)){a.push(e);return}let t=N(e);t===`alert-action`?s.push(e):t===`alert-title`||t===`alert-description`?a.push(e):i.push(e)}),(0,j.jsx)(`div`,{className:o(M({variant:t}),e),"data-slot":`alert`,role:`alert`,...r,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i.length>0&&(0,j.jsx)(`div`,{className:`flex size-4 shrink-0 items-center justify-center [&>svg]:size-full`,children:i}),a.length>0&&(0,j.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:a}),s.length>0&&(0,j.jsx)(`div`,{className:`flex shrink-0 items-center self-center`,children:s})]})})}function F({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`font-medium`,e),"data-slot":`alert-title`,...t})}function I({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`flex flex-col gap-2.5 text-muted-foreground`,e),"data-slot":`alert-description`,...t})}function L({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`flex gap-1`,e),"data-slot":`alert-action`,...t})}F.displayName=`AlertTitle`,I.displayName=`AlertDescription`,L.displayName=`AlertAction`;function R({className:e,orientation:t=`horizontal`,...n}){return(0,j.jsx)(A,{className:o(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch`,e),"data-slot":`separator`,orientation:t,...n})}var z=k.createContext(void 0);function B(){let e=k.useContext(z);if(e===void 0)throw Error(l(63));return e}var V=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),H={...g,checked(e){return e?{[V.checked]:``}:{[V.unchecked]:``}}},U=k.forwardRef(function(e,t){let{checked:i,className:o,defaultChecked:s,"aria-labelledby":l,form:u,id:h,inputRef:g,name:_,nativeButton:v=!1,onCheckedChange:y,readOnly:b=!1,required:x=!1,disabled:S=!1,render:C,uncheckedValue:w,value:T,style:E,...D}=e,{clearErrors:O}=ne(),{state:A,setTouched:M,setDirty:N,validityData:P,setFilled:F,setFocused:I,validationMode:L,disabled:R,name:B,validation:V}=re(),{labelId:U}=ce(),W=R||S,G=B??_,K=k.useRef(null),fe=r(K,g,V.inputRef),q=k.useRef(null),J=ie(),Y=ae({id:h,implicit:!1,controlRef:q}),X=v?void 0:Y,[Z,pe]=p({controlled:i,default:!!s,name:`Switch`,state:`checked`});te(q,J,Z,void 0,!W,_),oe(()=>{K.current&&F(K.current.checked)},[K,F]),ue(Z,()=>{O(G),N(Z!==P.initialValue),F(Z),V.change(Z)});let{getButtonProps:me,buttonRef:Q}=le({disabled:W,native:v}),he=de(l,U,K,!v,X),ge={id:v?Y:J,role:`switch`,"aria-checked":Z,"aria-readonly":b||void 0,"aria-required":x||void 0,"aria-labelledby":he,onFocus(){W||I(!0)},onBlur(){let e=K.current;!e||W||(M(!0),I(!1),L===`onBlur`&&V.commit(e.checked))},onClick(e){if(b||W)return;e.preventDefault();let t=K.current;t&&t.dispatchEvent(new(d(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},_e=c({checked:Z,disabled:W,form:u,id:X,name:G,required:x,style:G?m:f,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:fe,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(b){e.preventDefault();return}let t=e.currentTarget.checked,n=se(ee,e.nativeEvent);y?.(t,n),!n.isCanceled&&pe(t)},onFocus(){q.current?.focus()}},e=>V.getValidationProps(W,e),T===void 0?n:{value:T}),$=k.useMemo(()=>({...A,checked:Z,disabled:W,readOnly:b,required:x}),[A,Z,W,b,x]),ve=a(`span`,e,{state:$,ref:[t,q,Q],props:[ge,D,me,e=>V.getValidationProps(W,e)],stateAttributesMapping:H});return(0,j.jsxs)(z.Provider,{value:$,children:[ve,!Z&&G&&w!==void 0&&(0,j.jsx)(`input`,{type:`hidden`,form:u,name:G,value:w,disabled:W}),(0,j.jsx)(`input`,{..._e,suppressHydrationWarning:!0})]})}),W=k.forwardRef(function(e,t){let{render:n,className:r,style:i,...o}=e;return a(`span`,e,{state:B(),ref:t,stateAttributesMapping:H,props:o})});function G({className:e,...t}){return(0,j.jsx)(U,{className:o(`inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 cursor-pointer items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(5)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:[--thumb-size:--spacing(4)]`,e),"data-slot":`switch`,...t,children:(0,j.jsx)(W,{className:o(`pointer-events-none block aspect-square h-full origin-left in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]`),"data-slot":`switch-thumb`})})}function K({config:e,setConfig:t,saveStatus:n,editors:r,adapters:i,saveAppConfig:a,isSettingsFormValid:o,toolsStatus:s,toolsLoading:c,updatingToolId:l,fetchToolsStatus:d,handleUpdateTool:f}){if(!e)return null;let p=r.find(t=>t.command===e.defaultEditor),m=i.find(t=>t.name===(e.storageProvider||`local`));return(0,j.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,j.jsxs)(`header`,{className:`mb-6`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Global Settings`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Configure your local directories, search parameters, and editor defaults.`})]}),n===`success`&&(0,j.jsxs)(P,{variant:`success`,className:`mb-6`,children:[(0,j.jsx)(C,{size:18}),` Settings successfully saved and updated!`]}),n===`error`&&(0,j.jsxs)(P,{variant:`error`,className:`mb-6`,children:[(0,j.jsx)(b,{size:18}),` Error: Could not save configuration details to disk.`]}),(0,j.jsx)(D,{className:`mb-6 rounded-xl p-6 shadow-sm`,children:(0,j.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:`Development Directory`}),(0,j.jsx)(h,{type:`text`,value:e.devDir,onChange:n=>t({...e,devDir:n.target.value})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where your git projects are scanned.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:`Workspaces Directory`}),(0,j.jsx)(h,{type:`text`,value:e.workspacesDir,onChange:n=>t({...e,workspacesDir:n.target.value})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where unified worktree environments are spun up.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:`Repo Search Depth`}),(0,j.jsx)(h,{type:`number`,min:1,max:5,value:e.scanDepth,onChange:n=>t({...e,scanDepth:parseInt(n.target.value,10)})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Max directory levels deep the system will traverse for git repos.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:`Default Assistant`}),(0,j.jsxs)(x,{value:e.defaultAssistant||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultAssistant:n||null}),children:[(0,j.jsx)(y,{"aria-label":`Default Assistant`,children:(0,j.jsx)(T,{children:e.defaultAssistant===`claude`?`Claude Code`:e.defaultAssistant===`antigravity`?`Antigravity`:e.defaultAssistant===`codex`?`Codex`:e.defaultAssistant===`copilot`?`GitHub Copilot`:e.defaultAssistant===`cursor`?`Cursor`:`None (Prompt me)`})}),(0,j.jsxs)(_,{alignItemWithTrigger:!1,children:[(0,j.jsx)(v,{value:``,children:`None (Prompt me)`}),(0,j.jsx)(v,{value:`claude`,children:`Claude Code`}),(0,j.jsx)(v,{value:`antigravity`,children:`Antigravity`}),(0,j.jsx)(v,{value:`codex`,children:`Codex`}),(0,j.jsx)(v,{value:`copilot`,children:`GitHub Copilot`}),(0,j.jsx)(v,{value:`cursor`,children:`Cursor`})]})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your preferred workspace context manager.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:`Preferred Editor`}),(0,j.jsxs)(x,{value:e.defaultEditor||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultEditor:n||null}),children:[(0,j.jsx)(y,{"aria-label":`Preferred Editor`,children:(0,j.jsx)(T,{children:p?`${p.name} ${p.detected?`(Detected)`:`(Not found)`}`:`No preference`})}),(0,j.jsxs)(_,{alignItemWithTrigger:!1,children:[(0,j.jsx)(v,{value:``,children:`No preference`}),r.map(e=>(0,j.jsxs)(v,{value:e.command,children:[e.name,` `,e.detected?`(Detected)`:`(Not found)`]},e.command))]})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Shown first in the “Open with…” workspace chooser.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-4 md:col-span-2`,children:[(0,j.jsx)(R,{className:`mt-1`}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Workspace Storage Settings`}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Choose where maps, plans, and knowledge files are stored.`})]}),(0,j.jsxs)(`div`,{className:`flex max-w-md flex-col gap-1.5`,children:[(0,j.jsx)(O,{htmlFor:`storageProvider`,className:`text-sm`,children:`Storage Provider`}),(0,j.jsxs)(x,{value:e.storageProvider||`local`,onValueChange:n=>{if(typeof n!=`string`)return;let r=n,a={...e,storageProvider:r},o=i.find(e=>e.name===r);o?.configFields?.length&&(a.adapterConfig||={},a.adapterConfig[r]||(a.adapterConfig[r]={}),o.configFields.forEach(e=>{a.adapterConfig[r][e.key]===void 0&&e.default!==void 0&&(a.adapterConfig[r][e.key]=e.default)})),t(a)},children:[(0,j.jsx)(y,{id:`storageProvider`,"aria-label":`Storage Provider`,children:(0,j.jsx)(T,{children:m?.displayName??`Local Workspace (Folders)`})}),(0,j.jsx)(_,{alignItemWithTrigger:!1,children:i.length>0?i.map(e=>(0,j.jsx)(v,{value:e.name,children:e.displayName},e.name)):(0,j.jsx)(v,{value:`local`,children:`Local Workspace (Folders)`})})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m?.description||`Choose where to store maps, plans, and knowledge files. Centralized vault keeps repositories 100% clean and allows Obsidian integration.`})]}),(()=>{let n=e.storageProvider||`local`,r=i.find(e=>e.name===n);return r?.configFields?.length?(0,j.jsxs)(`div`,{className:`flex max-w-md flex-col gap-4 rounded-xl border border-border bg-muted/40 p-4`,children:[(0,j.jsxs)(`h4`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:[r.displayName,` Settings`]}),r.configFields.map(r=>{let i=e.adapterConfig?.[n]?.[r.key]??r.default??``,a=i=>{let a={...e.adapterConfig||{},[n]:{...e.adapterConfig?.[n]||{},[r.key]:i}};t({...e,adapterConfig:a})};return r.type===`boolean`?(0,j.jsxs)(O,{className:`flex cursor-pointer items-start gap-3 text-sm`,children:[(0,j.jsx)(G,{checked:!!i,onCheckedChange:e=>a(e)}),(0,j.jsxs)(`span`,{className:`flex flex-col`,children:[(0,j.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r.label}),r.description&&(0,j.jsx)(`span`,{className:`mt-0.5 text-xs leading-normal text-muted-foreground`,children:r.description})]})]},r.key):(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(O,{className:`text-sm`,children:r.label}),(0,j.jsx)(h,{type:r.type===`number`?`number`:`text`,value:i,onChange:e=>{let t=r.type===`number`?Number(e.target.value):e.target.value;a(t)}}),r.description&&(0,j.jsx)(`span`,{className:`text-xs leading-normal text-muted-foreground`,children:r.description})]},r.key)})]}):null})()]})]})}),(0,j.jsxs)(D,{className:`mt-6 rounded-xl p-6 shadow-sm`,children:[(0,j.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:`AI Toolchain Updates`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Monitor and update the CLI packages and assistants in your workflow.`})]}),(0,j.jsxs)(u,{variant:`outline`,size:`sm`,onClick:()=>d(!0),disabled:c,children:[c?(0,j.jsx)(w,{className:`size-3`}):(0,j.jsx)(S,{size:13}),c?`Checking...`:`Check Now`]})]}),c&&s.length===0?(0,j.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground`,children:[(0,j.jsx)(w,{className:`size-6`}),(0,j.jsx)(`span`,{className:`text-xs`,children:`Fetching registry version details...`})]}):s.length===0?(0,j.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No toolchain information available.`}):(0,j.jsx)(`div`,{className:`space-y-4`,children:s.map(e=>(0,j.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl border border-border bg-muted/30 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[e.name,(0,j.jsx)(E,{variant:e.installed?`success`:`secondary`,size:`sm`,children:e.installed?`Installed`:`Not Installed`})]}),(0,j.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,j.jsxs)(`span`,{children:[`Installed version: `,(0,j.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.currentVersion})]}),e.installed&&(0,j.jsxs)(`span`,{children:[`Latest: `,(0,j.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.latestVersion})]})]}),(0,j.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.updateCmd})]}),(0,j.jsx)(`div`,{className:`flex shrink-0 items-center gap-3`,children:e.updateAvailable?(0,j.jsx)(u,{size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{className:`size-3`}),` Updating...`]}):`Update Tool`}):e.installed?(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(E,{variant:`success`,className:`gap-1.5`,children:[(0,j.jsx)(C,{size:12}),` Up to Date`]}),(0,j.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{className:`size-3`}),` Reinstalling...`]}):`Reinstall`})]}):(0,j.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{className:`size-3`}),` Installing...`]}):`Install CLI`})})]},e.id))})]}),(0,j.jsx)(`div`,{className:`mb-10 flex justify-end pt-4`,children:(0,j.jsxs)(u,{onClick:()=>a(e),disabled:!o,children:[(0,j.jsx)(C,{size:16}),` Save Configuration`]})})]})}export{K as SettingsPage};