conductor-oss 0.61.21 → 0.61.23

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 (360) hide show
  1. package/node_modules/@conductor-oss/core/package.json +1 -1
  2. package/package.json +6 -6
  3. package/web/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +46 -0
  4. package/web/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +219 -0
  5. package/web/.next/standalone/node_modules/@img/{sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 → sharp-libvips-linux-x64/lib/libvips-cpp.so.8.18.3} +0 -0
  6. package/web/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +2 -2
  7. package/web/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/versions.json +20 -20
  8. package/web/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +46 -0
  9. package/web/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +219 -0
  10. package/web/.next/standalone/node_modules/@img/{sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 → sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.18.3} +0 -0
  11. package/web/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +2 -2
  12. package/web/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +20 -20
  13. package/web/.next/standalone/node_modules/@img/sharp-linux-x64/index.cjs +1 -0
  14. package/web/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64-0.35.0.node +0 -0
  15. package/web/.next/standalone/node_modules/@img/sharp-linux-x64/package.json +6 -5
  16. package/web/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/index.cjs +1 -0
  17. package/web/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64-0.35.0.node +0 -0
  18. package/web/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +6 -5
  19. package/web/.next/standalone/node_modules/@next/env/package.json +8 -9
  20. package/web/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
  21. package/web/.next/standalone/node_modules/next/dist/build/webpack-config.js +3 -3
  22. package/web/.next/standalone/node_modules/next/dist/client/dev/debug-channel.js +102 -2
  23. package/web/.next/standalone/node_modules/next/dist/compiled/http-proxy/index.js +5 -5
  24. package/web/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js +11 -10
  25. package/web/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +12 -11
  26. package/web/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +14 -13
  27. package/web/.next/standalone/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js +11 -10
  28. package/web/.next/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js +2 -2
  29. package/web/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +9 -9
  30. package/web/.next/standalone/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js +9 -9
  31. package/web/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
  32. package/web/.next/standalone/node_modules/next/dist/server/app-render/action-handler.js +147 -42
  33. package/web/.next/standalone/node_modules/next/dist/server/app-render/manifests-singleton.js +52 -4
  34. package/web/.next/standalone/node_modules/next/dist/server/config-schema.js +1 -1
  35. package/web/.next/standalone/node_modules/next/dist/server/config-shared.js +0 -2
  36. package/web/.next/standalone/node_modules/next/dist/server/config.js +1 -1
  37. package/web/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
  38. package/web/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  39. package/web/.next/standalone/node_modules/next/dist/server/image-optimizer.js +8 -27
  40. package/web/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  41. package/web/.next/standalone/node_modules/next/dist/server/lib/encode-cache-tag.js +45 -0
  42. package/web/.next/standalone/node_modules/next/dist/server/lib/implicit-tags.js +6 -3
  43. package/web/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/index.js +90 -53
  44. package/web/.next/standalone/node_modules/next/dist/server/lib/patch-fetch.js +20 -3
  45. package/web/.next/standalone/node_modules/next/dist/server/lib/router-utils/proxy-request.js +4 -0
  46. package/web/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
  47. package/web/.next/standalone/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  48. package/web/.next/standalone/node_modules/next/dist/shared/lib/router/router.js +8 -1
  49. package/web/.next/standalone/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +2 -1
  50. package/web/.next/standalone/node_modules/next/dist/shared/lib/server-reference-info.js +12 -0
  51. package/web/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  52. package/web/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
  53. package/web/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
  54. package/web/.next/standalone/node_modules/next/package.json +10 -252
  55. package/web/.next/standalone/node_modules/postcss/lib/container.js +81 -34
  56. package/web/.next/standalone/node_modules/postcss/lib/fromJSON.js +76 -23
  57. package/web/.next/standalone/node_modules/postcss/lib/input.js +13 -4
  58. package/web/.next/standalone/node_modules/postcss/lib/lazy-result.js +55 -13
  59. package/web/.next/standalone/node_modules/postcss/lib/node.js +105 -60
  60. package/web/.next/standalone/node_modules/postcss/lib/previous-map.js +11 -2
  61. package/web/.next/standalone/node_modules/postcss/lib/processor.js +1 -1
  62. package/web/.next/standalone/node_modules/postcss/lib/stringifier.js +90 -25
  63. package/web/.next/standalone/node_modules/postcss/package.json +1 -1
  64. package/web/.next/standalone/node_modules/sharp/{lib/channel.js → dist/channel.cjs} +1 -1
  65. package/web/.next/standalone/node_modules/sharp/{lib/colour.js → dist/colour.cjs} +1 -1
  66. package/web/.next/standalone/node_modules/sharp/{lib/composite.js → dist/composite.cjs} +2 -1
  67. package/web/.next/standalone/node_modules/sharp/{lib/constructor.js → dist/constructor.cjs} +41 -29
  68. package/web/.next/standalone/node_modules/sharp/dist/index.cjs +25 -0
  69. package/web/.next/standalone/node_modules/sharp/{lib/input.js → dist/input.cjs} +19 -14
  70. package/web/.next/standalone/node_modules/sharp/{lib/libvips.js → dist/libvips.cjs} +35 -30
  71. package/web/.next/standalone/node_modules/sharp/{lib/operation.js → dist/operation.cjs} +6 -35
  72. package/web/.next/standalone/node_modules/sharp/{lib/output.js → dist/output.cjs} +142 -14
  73. package/web/.next/standalone/node_modules/sharp/{lib/resize.js → dist/resize.cjs} +19 -1
  74. package/web/.next/standalone/node_modules/sharp/dist/sharp.cjs +164 -0
  75. package/web/.next/standalone/node_modules/sharp/{lib/utility.js → dist/utility.cjs} +11 -7
  76. package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/classes/range.js +24 -4
  77. package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/classes/semver.js +19 -2
  78. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/clean.js +8 -0
  79. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/compare-build.js +9 -0
  80. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/compare-loose.js +5 -0
  81. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/diff.js +60 -0
  82. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/inc.js +21 -0
  83. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/major.js +5 -0
  84. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/minor.js +5 -0
  85. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/patch.js +5 -0
  86. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/prerelease.js +8 -0
  87. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/rcompare.js +5 -0
  88. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/rsort.js +5 -0
  89. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/sort.js +5 -0
  90. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/truncate.js +48 -0
  91. package/web/.next/standalone/node_modules/sharp/node_modules/semver/functions/valid.js +8 -0
  92. package/web/.next/standalone/node_modules/sharp/node_modules/semver/index.js +93 -0
  93. package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/internal/re.js +1 -1
  94. package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/package.json +4 -4
  95. package/web/.next/standalone/node_modules/sharp/node_modules/semver/preload.js +4 -0
  96. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/gtr.js +6 -0
  97. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/intersects.js +9 -0
  98. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/ltr.js +6 -0
  99. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/max-satisfying.js +27 -0
  100. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/min-satisfying.js +26 -0
  101. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/min-version.js +63 -0
  102. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/outside.js +82 -0
  103. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/simplify.js +49 -0
  104. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/subset.js +249 -0
  105. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/to-comparators.js +10 -0
  106. package/web/.next/standalone/node_modules/sharp/node_modules/semver/ranges/valid.js +13 -0
  107. package/web/.next/standalone/node_modules/sharp/package.json +60 -49
  108. package/web/.next/standalone/package.json +3 -2
  109. package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
  110. package/web/.next/standalone/packages/web/.next/app-path-routes-manifest.json +9 -9
  111. package/web/.next/standalone/packages/web/.next/build-manifest.json +4 -4
  112. package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
  113. package/web/.next/standalone/packages/web/.next/react-loadable-manifest.json +8 -8
  114. package/web/.next/standalone/packages/web/.next/required-server-files.json +6 -1
  115. package/web/.next/standalone/packages/web/.next/server/app/__clerk/[[...path]]/route.js.nft.json +1 -1
  116. package/web/.next/standalone/packages/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  117. package/web/.next/standalone/packages/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  118. package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +1 -1
  119. package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
  120. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  121. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  122. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  123. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  124. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  125. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  126. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js +1 -1
  127. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  128. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  129. package/web/.next/standalone/packages/web/.next/server/app/api/access/route.js.nft.json +1 -1
  130. package/web/.next/standalone/packages/web/.next/server/app/api/agents/route.js.nft.json +1 -1
  131. package/web/.next/standalone/packages/web/.next/server/app/api/app-update/route.js.nft.json +1 -1
  132. package/web/.next/standalone/packages/web/.next/server/app/api/attachments/route.js.nft.json +1 -1
  133. package/web/.next/standalone/packages/web/.next/server/app/api/auth/profile/route.js.nft.json +1 -1
  134. package/web/.next/standalone/packages/web/.next/server/app/api/boards/comments/route.js.nft.json +1 -1
  135. package/web/.next/standalone/packages/web/.next/server/app/api/boards/route.js.nft.json +1 -1
  136. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/bridges/[bridgeId]/route.js.nft.json +1 -1
  137. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/bridges/route.js.nft.json +1 -1
  138. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/[deviceId]/app-update/route.js.nft.json +1 -1
  139. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/[deviceId]/repair/route.js.nft.json +1 -1
  140. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/[deviceId]/route.js.nft.json +1 -1
  141. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/[deviceId]/service-restart/route.js.nft.json +1 -1
  142. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/claims/complete/route.js.nft.json +1 -1
  143. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/code/route.js.nft.json +1 -1
  144. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/route.js.nft.json +1 -1
  145. package/web/.next/standalone/packages/web/.next/server/app/api/bridges/route.js.nft.json +1 -1
  146. package/web/.next/standalone/packages/web/.next/server/app/api/config/route.js.nft.json +1 -1
  147. package/web/.next/standalone/packages/web/.next/server/app/api/context-files/open/route.js.nft.json +1 -1
  148. package/web/.next/standalone/packages/web/.next/server/app/api/context-files/route.js.nft.json +1 -1
  149. package/web/.next/standalone/packages/web/.next/server/app/api/events/route.js.nft.json +1 -1
  150. package/web/.next/standalone/packages/web/.next/server/app/api/executor/health/route.js.nft.json +1 -1
  151. package/web/.next/standalone/packages/web/.next/server/app/api/filesystem/directory/route.js.nft.json +1 -1
  152. package/web/.next/standalone/packages/web/.next/server/app/api/filesystem/pick-directory/route.js.nft.json +1 -1
  153. package/web/.next/standalone/packages/web/.next/server/app/api/github/projects/route.js.nft.json +1 -1
  154. package/web/.next/standalone/packages/web/.next/server/app/api/github/projects/sync/route.js.nft.json +1 -1
  155. package/web/.next/standalone/packages/web/.next/server/app/api/github/repos/route.js.nft.json +1 -1
  156. package/web/.next/standalone/packages/web/.next/server/app/api/github/webhook/route.js.nft.json +1 -1
  157. package/web/.next/standalone/packages/web/.next/server/app/api/health/boards/route.js.nft.json +1 -1
  158. package/web/.next/standalone/packages/web/.next/server/app/api/health/sessions/route.js.nft.json +1 -1
  159. package/web/.next/standalone/packages/web/.next/server/app/api/notifications/route.js.nft.json +1 -1
  160. package/web/.next/standalone/packages/web/.next/server/app/api/preferences/route.js.nft.json +1 -1
  161. package/web/.next/standalone/packages/web/.next/server/app/api/project-notes/backlinks/route.js.nft.json +1 -1
  162. package/web/.next/standalone/packages/web/.next/server/app/api/project-notes/daily/route.js.nft.json +1 -1
  163. package/web/.next/standalone/packages/web/.next/server/app/api/project-notes/file/route.js.nft.json +1 -1
  164. package/web/.next/standalone/packages/web/.next/server/app/api/project-notes/graph/route.js.nft.json +1 -1
  165. package/web/.next/standalone/packages/web/.next/server/app/api/project-notes/open/route.js.nft.json +1 -1
  166. package/web/.next/standalone/packages/web/.next/server/app/api/project-notes/route.js.nft.json +1 -1
  167. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/approve/route.js.nft.json +1 -1
  168. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/bindings/route.js.nft.json +1 -1
  169. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/feed/route.js.nft.json +1 -1
  170. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/feed/stream/route.js.nft.json +1 -1
  171. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/integration/route.js.nft.json +1 -1
  172. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/interrupt/route.js.nft.json +1 -1
  173. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/preferences/route.js.nft.json +1 -1
  174. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/reject/route.js.nft.json +1 -1
  175. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/route.js.nft.json +1 -1
  176. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/send/route.js.nft.json +1 -1
  177. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/tasks/[task]/handoff/route.js.nft.json +1 -1
  178. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/tasks/[task]/route.js.nft.json +1 -1
  179. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatcher/tasks/route.js.nft.json +1 -1
  180. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/dispatchers/route.js.nft.json +1 -1
  181. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/open/route.js.nft.json +1 -1
  182. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  183. package/web/.next/standalone/packages/web/.next/server/app/api/projects/[id]/setup/route.js.nft.json +1 -1
  184. package/web/.next/standalone/packages/web/.next/server/app/api/projects/route.js.nft.json +1 -1
  185. package/web/.next/standalone/packages/web/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
  186. package/web/.next/standalone/packages/web/.next/server/app/api/repositories/route.js.nft.json +1 -1
  187. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/actions/route.js.nft.json +1 -1
  188. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/archive/route.js.nft.json +1 -1
  189. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/checks/route.js.nft.json +1 -1
  190. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/diff/route.js.nft.json +1 -1
  191. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/files/route.js.nft.json +1 -1
  192. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/keys/route.js.nft.json +1 -1
  193. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/kill/route.js.nft.json +1 -1
  194. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/route.js.nft.json +1 -1
  195. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/stream/route.js.nft.json +1 -1
  196. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/dom/route.js.nft.json +1 -1
  197. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/route.js.nft.json +1 -1
  198. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/screenshot/route.js.nft.json +1 -1
  199. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -1
  200. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  201. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/send/route.js.nft.json +1 -1
  202. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/relay/route.js.nft.json +1 -1
  203. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/snapshot/route.js.nft.json +1 -1
  204. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/token/route.js.nft.json +1 -1
  205. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/ttyd/route.js.nft.json +1 -1
  206. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/ttyd/token/route.js.nft.json +1 -1
  207. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/ttyd/ws/route.js.nft.json +1 -1
  208. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/route.js.nft.json +1 -1
  209. package/web/.next/standalone/packages/web/.next/server/app/api/skills/activate/route.js.nft.json +1 -1
  210. package/web/.next/standalone/packages/web/.next/server/app/api/skills/catalog/route.js.nft.json +1 -1
  211. package/web/.next/standalone/packages/web/.next/server/app/api/skills/deactivate/route.js.nft.json +1 -1
  212. package/web/.next/standalone/packages/web/.next/server/app/api/skills/install/route.js.nft.json +1 -1
  213. package/web/.next/standalone/packages/web/.next/server/app/api/skills/installed/route.js.nft.json +1 -1
  214. package/web/.next/standalone/packages/web/.next/server/app/api/skills/session-active/route.js.nft.json +1 -1
  215. package/web/.next/standalone/packages/web/.next/server/app/api/skills/uninstall/route.js.nft.json +1 -1
  216. package/web/.next/standalone/packages/web/.next/server/app/api/spawn/route.js.nft.json +1 -1
  217. package/web/.next/standalone/packages/web/.next/server/app/api/workspaces/branches/route.js.nft.json +1 -1
  218. package/web/.next/standalone/packages/web/.next/server/app/api/workspaces/route.js.nft.json +1 -1
  219. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js +1 -1
  220. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js.nft.json +1 -1
  221. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page_client-reference-manifest.js +1 -1
  222. package/web/.next/standalone/packages/web/.next/server/app/bridge/install.ps1/route.js.nft.json +1 -1
  223. package/web/.next/standalone/packages/web/.next/server/app/bridge/install.sh/route.js.nft.json +1 -1
  224. package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page.js +1 -1
  225. package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page.js.nft.json +1 -1
  226. package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page_client-reference-manifest.js +1 -1
  227. package/web/.next/standalone/packages/web/.next/server/app/icon.svg/route.js.nft.json +1 -1
  228. package/web/.next/standalone/packages/web/.next/server/app/page.js +1 -1
  229. package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
  230. package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
  231. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js +2 -2
  232. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  233. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  234. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js +1 -1
  235. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js.nft.json +1 -1
  236. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page_client-reference-manifest.js +1 -1
  237. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js +1 -1
  238. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
  239. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
  240. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js +1 -1
  241. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js.nft.json +1 -1
  242. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page_client-reference-manifest.js +1 -1
  243. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js +1 -1
  244. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js.nft.json +1 -1
  245. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page_client-reference-manifest.js +1 -1
  246. package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page.js +1 -1
  247. package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page.js.nft.json +1 -1
  248. package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page_client-reference-manifest.js +1 -1
  249. package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js +1 -1
  250. package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
  251. package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
  252. package/web/.next/standalone/packages/web/.next/server/app-paths-manifest.json +9 -9
  253. package/web/.next/standalone/packages/web/.next/server/chunks/2074.js +1 -0
  254. package/web/.next/standalone/packages/web/.next/server/chunks/2512.js +3 -3
  255. package/web/.next/standalone/packages/web/.next/server/chunks/3303.js +1 -1
  256. package/web/.next/standalone/packages/web/.next/server/chunks/3698.js +5 -3
  257. package/web/.next/standalone/packages/web/.next/server/chunks/3786.js +2 -2
  258. package/web/.next/standalone/packages/web/.next/server/chunks/6108.js +1 -0
  259. package/web/.next/standalone/packages/web/.next/server/chunks/6472.js +1 -1
  260. package/web/.next/standalone/packages/web/.next/server/chunks/724.js +1 -1
  261. package/web/.next/standalone/packages/web/.next/server/chunks/7481.js +1 -1
  262. package/web/.next/standalone/packages/web/.next/server/chunks/7776.js +1 -1
  263. package/web/.next/standalone/packages/web/.next/server/chunks/8688.js +1 -0
  264. package/web/.next/standalone/packages/web/.next/server/chunks/9455.js +1 -1
  265. package/web/.next/standalone/packages/web/.next/server/chunks/9787.js +3 -3
  266. package/web/.next/standalone/packages/web/.next/server/middleware-build-manifest.js +1 -1
  267. package/web/.next/standalone/packages/web/.next/server/middleware-react-loadable-manifest.js +1 -1
  268. package/web/.next/standalone/packages/web/.next/server/middleware.js +4 -4
  269. package/web/.next/standalone/packages/web/.next/server/next-font-manifest.js +1 -1
  270. package/web/.next/standalone/packages/web/.next/server/next-font-manifest.json +1 -1
  271. package/web/.next/standalone/packages/web/.next/server/pages/500.html +1 -1
  272. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
  273. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +1 -1
  274. package/web/.next/standalone/packages/web/.next/static/chunks/17319.f853545792589ec2.js +1 -0
  275. package/web/.next/standalone/packages/web/.next/static/chunks/{34443.c71c524d5fcc197f.js → 34443.fa5f443480cf2b8a.js} +1 -1
  276. package/web/.next/standalone/packages/web/.next/static/chunks/39816.fd2a8af735afdbe1.js +1 -0
  277. package/web/.next/standalone/packages/web/.next/static/chunks/41696.3e691c667c1e7b81.js +1 -0
  278. package/web/.next/standalone/packages/web/.next/static/chunks/41998.bfd148a33a5b285a.js +1 -0
  279. package/web/.next/standalone/packages/web/.next/static/chunks/{61968-84de5fd1d154571d.js → 61968-1d55f423ea1ad7fb.js} +1 -1
  280. package/web/.next/standalone/packages/web/.next/static/chunks/76892-86e55e6d0e7ca057.js +1 -0
  281. package/web/.next/{static/chunks/79593-c8c8ed0f8829c660.js → standalone/packages/web/.next/static/chunks/79593-2f58ba44bc178231.js} +2 -2
  282. package/web/.next/standalone/packages/web/.next/static/chunks/81132.92c626a062747078.js +3 -0
  283. package/web/.next/standalone/packages/web/.next/static/chunks/9016-c4fa23038e6de72b.js +1 -0
  284. package/web/.next/standalone/packages/web/.next/static/chunks/app/{layout-1d6034a5d57a2849.js → layout-dc8ca6126999c95c.js} +1 -1
  285. package/web/.next/standalone/packages/web/.next/static/chunks/app/page-f3925343b6c5eaa9.js +1 -0
  286. package/web/.next/standalone/packages/web/.next/static/chunks/app/sessions/[id]/page-b1d7e1d41fba2817.js +1 -0
  287. package/web/.next/{static/chunks/main-e776ff7a08a61c77.js → standalone/packages/web/.next/static/chunks/main-0a70c45f3b60fdcf.js} +1 -1
  288. package/web/.next/standalone/packages/web/.next/static/chunks/webpack-0562fb102dd7e557.js +1 -0
  289. package/web/.next/standalone/packages/web/.next/static/css/dfd1cecfd68c43ff.css +1 -0
  290. package/web/.next/standalone/packages/web/package.json +2 -1
  291. package/web/.next/standalone/packages/web/server.js +1 -1
  292. package/web/.next/static/chunks/17319.f853545792589ec2.js +1 -0
  293. package/web/.next/static/chunks/{34443.c71c524d5fcc197f.js → 34443.fa5f443480cf2b8a.js} +1 -1
  294. package/web/.next/static/chunks/39816.fd2a8af735afdbe1.js +1 -0
  295. package/web/.next/static/chunks/41696.3e691c667c1e7b81.js +1 -0
  296. package/web/.next/static/chunks/41998.bfd148a33a5b285a.js +1 -0
  297. package/web/.next/static/chunks/{61968-84de5fd1d154571d.js → 61968-1d55f423ea1ad7fb.js} +1 -1
  298. package/web/.next/static/chunks/76892-86e55e6d0e7ca057.js +1 -0
  299. package/web/.next/{standalone/packages/web/.next/static/chunks/79593-c8c8ed0f8829c660.js → static/chunks/79593-2f58ba44bc178231.js} +2 -2
  300. package/web/.next/static/chunks/81132.92c626a062747078.js +3 -0
  301. package/web/.next/static/chunks/9016-c4fa23038e6de72b.js +1 -0
  302. package/web/.next/static/chunks/app/{layout-1d6034a5d57a2849.js → layout-dc8ca6126999c95c.js} +1 -1
  303. package/web/.next/static/chunks/app/page-f3925343b6c5eaa9.js +1 -0
  304. package/web/.next/static/chunks/app/sessions/[id]/page-b1d7e1d41fba2817.js +1 -0
  305. package/web/.next/{standalone/packages/web/.next/static/chunks/main-e776ff7a08a61c77.js → static/chunks/main-0a70c45f3b60fdcf.js} +1 -1
  306. package/web/.next/static/chunks/webpack-0562fb102dd7e557.js +1 -0
  307. package/web/.next/static/css/dfd1cecfd68c43ff.css +1 -0
  308. package/web/.next/standalone/node_modules/@img/sharp-linux-x64/LICENSE +0 -191
  309. package/web/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  310. package/web/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/LICENSE +0 -191
  311. package/web/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  312. package/web/.next/standalone/node_modules/sharp/lib/index.js +0 -16
  313. package/web/.next/standalone/node_modules/sharp/lib/sharp.js +0 -121
  314. package/web/.next/standalone/packages/web/.next/server/chunks/1364.js +0 -1
  315. package/web/.next/standalone/packages/web/.next/server/chunks/4013.js +0 -1
  316. package/web/.next/standalone/packages/web/.next/server/chunks/9398.js +0 -1
  317. package/web/.next/standalone/packages/web/.next/static/chunks/28386-0121205400994756.js +0 -1
  318. package/web/.next/standalone/packages/web/.next/static/chunks/39816.a3835fb513390d7c.js +0 -1
  319. package/web/.next/standalone/packages/web/.next/static/chunks/41696.08fe09203aaf1a18.js +0 -1
  320. package/web/.next/standalone/packages/web/.next/static/chunks/41998.4a8b2f9f7d29a4dc.js +0 -1
  321. package/web/.next/standalone/packages/web/.next/static/chunks/81132.bfc52d50d21324b2.js +0 -3
  322. package/web/.next/standalone/packages/web/.next/static/chunks/84322.a03fd8fc2bb2e8d7.js +0 -1
  323. package/web/.next/standalone/packages/web/.next/static/chunks/9016-2b7d7b8b143a8323.js +0 -1
  324. package/web/.next/standalone/packages/web/.next/static/chunks/app/page-0ba7acf47a6b3ac6.js +0 -1
  325. package/web/.next/standalone/packages/web/.next/static/chunks/app/sessions/[id]/page-aeb1ccc1a89248d5.js +0 -1
  326. package/web/.next/standalone/packages/web/.next/static/chunks/webpack-c447583f01d6313b.js +0 -1
  327. package/web/.next/standalone/packages/web/.next/static/css/895fa8ff3c08143e.css +0 -1
  328. package/web/.next/static/chunks/28386-0121205400994756.js +0 -1
  329. package/web/.next/static/chunks/39816.a3835fb513390d7c.js +0 -1
  330. package/web/.next/static/chunks/41696.08fe09203aaf1a18.js +0 -1
  331. package/web/.next/static/chunks/41998.4a8b2f9f7d29a4dc.js +0 -1
  332. package/web/.next/static/chunks/81132.bfc52d50d21324b2.js +0 -3
  333. package/web/.next/static/chunks/84322.a03fd8fc2bb2e8d7.js +0 -1
  334. package/web/.next/static/chunks/9016-2b7d7b8b143a8323.js +0 -1
  335. package/web/.next/static/chunks/app/page-0ba7acf47a6b3ac6.js +0 -1
  336. package/web/.next/static/chunks/app/sessions/[id]/page-aeb1ccc1a89248d5.js +0 -1
  337. package/web/.next/static/chunks/webpack-c447583f01d6313b.js +0 -1
  338. package/web/.next/static/css/895fa8ff3c08143e.css +0 -1
  339. /package/web/.next/standalone/node_modules/sharp/{lib/is.js → dist/is.cjs} +0 -0
  340. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/classes/comparator.js +0 -0
  341. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/cmp.js +0 -0
  342. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/coerce.js +0 -0
  343. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/compare.js +0 -0
  344. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/eq.js +0 -0
  345. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/gt.js +0 -0
  346. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/gte.js +0 -0
  347. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/lt.js +0 -0
  348. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/lte.js +0 -0
  349. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/neq.js +0 -0
  350. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/parse.js +0 -0
  351. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/functions/satisfies.js +0 -0
  352. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/internal/constants.js +0 -0
  353. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/internal/debug.js +0 -0
  354. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/internal/identifiers.js +0 -0
  355. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/internal/lrucache.js +0 -0
  356. /package/web/.next/standalone/node_modules/{semver → sharp/node_modules/semver}/internal/parse-options.js +0 -0
  357. /package/web/.next/standalone/packages/web/.next/static/{bUZhqJ_eDpMX4oqHwonGR → p-tYD_lKtKhjhiZkKCbLL}/_buildManifest.js +0 -0
  358. /package/web/.next/standalone/packages/web/.next/static/{bUZhqJ_eDpMX4oqHwonGR → p-tYD_lKtKhjhiZkKCbLL}/_ssgManifest.js +0 -0
  359. /package/web/.next/static/{bUZhqJ_eDpMX4oqHwonGR → p-tYD_lKtKhjhiZkKCbLL}/_buildManifest.js +0 -0
  360. /package/web/.next/static/{bUZhqJ_eDpMX4oqHwonGR → p-tYD_lKtKhjhiZkKCbLL}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[41998,88742],{28017:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]])},41998:(e,t,r)=>{r.r(t),r.d(t,{NewWorkspaceDialog:()=>ed,SettingsDialog:()=>ep});var a=r(54568),s=r(71708),l=r(76196),n=r(7620),o=r(52353),i=r(20487),d=r(39789);let c=(0,d.A)("circle-user",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);var x=r(58212),p=r(38724),v=r(19755),m=r(83328),u=r(15255),h=r(43508),b=r(46277),g=r(28017),k=r(77024),f=r(13932),j=r(1173),N=r(38874),y=r(76839),w=r(37812),C=r(88742),S=r(61201);let A=(0,d.A)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),H=(0,d.A)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var R=r(5739),E=r(33866),P=r(72410),U=r(31404),$=r(85626),M=r(53989);r(51164);var D=r(20217);let B=(0,d.A)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);function L(e){switch(e){case"clerk":return"Clerk";case"cloudflare-access":return"Cloudflare Access";case"trusted-header":return"Verified Header";case"local":return"Local";default:return"Unknown"}}function F(e){return e?e.split("-").map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" "):"No access"}function _({label:e,value:t,href:r}){return(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:e}),r?(0,a.jsx)("a",{href:r,target:"_blank",rel:"noreferrer",className:"mt-2 block break-all text-[14px] text-[var(--vk-orange)] hover:underline",children:t}):(0,a.jsx)("p",{className:"mt-2 break-all text-[14px] text-[var(--vk-text-normal)]",children:t})]})}function T({profile:e}){let t=(e?.displayName??e?.email??"User").split(/[\s@._-]+/g).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("").slice(0,2);return e?.avatarUrl?(0,a.jsx)("img",{src:e.avatarUrl,alt:e.displayName??e.email??"Profile avatar",className:"h-20 w-20 rounded-full border border-[var(--vk-border)] object-cover shadow-[0_10px_30px_rgba(0,0,0,0.28)]"}):(0,a.jsx)("div",{className:"flex h-20 w-20 items-center justify-center rounded-full border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_14%,transparent)] text-[26px] font-semibold text-[var(--vk-accent)]",children:t||"U"})}function O({profile:e,loading:t,error:r,onRefresh:l}){if(t)return(0,a.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 animate-spin"}),"Loading profile details..."]});if(r&&!e)return(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Profile Unavailable"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor could not load the active user profile for this session."})]}),(0,a.jsxs)("button",{type:"button",onClick:l,className:"inline-flex h-9 items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"}),"Retry"]})]});let n=e?.displayName??"Unknown user",o=e?.email??"Not available",i=e?.githubUsername?`@${e.githubUsername}`:"Not linked";return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] px-5 py-5",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(T,{profile:e}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h4",{className:"truncate text-[24px] leading-[26px] text-[var(--vk-text-strong)]",children:n}),(0,a.jsx)("p",{className:"mt-1 truncate text-[14px] text-[var(--vk-text-muted)]",children:o}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px]",children:[(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:F(e?.role??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:L(e?.provider??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:e?"local"===e.provider?"Local admin session":e.authenticated?"Authenticated":"Anonymous":"Unknown"})]})]})]}),(0,a.jsxs)("button",{type:"button",onClick:l,className:"inline-flex h-9 items-center gap-2 self-start rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"}),"Refresh"]})]})}),(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsx)(_,{label:"Display Name",value:n}),(0,a.jsx)(_,{label:"Email",value:o}),(0,a.jsx)(_,{label:"GitHub Username",value:i,href:e?.githubProfileUrl??null}),(0,a.jsx)(_,{label:"Username",value:e?.username??"Not available"}),(0,a.jsx)(_,{label:"Auth Provider",value:L(e?.provider??null)}),(0,a.jsx)(_,{label:"Access Role",value:F(e?.role??null)})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Session Actions"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Review how this browser session is authenticated and sign out when Conductor owns the session lifecycle."})]}),e?.canLogout&&"clerk"===e.logoutMode?(0,a.jsx)(D.ct,{redirectUrl:"/sign-in",children:(0,a.jsxs)("button",{type:"button",className:"inline-flex h-9 items-center gap-2 rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(B,{className:"h-3.5 w-3.5"}),"Log Out"]})}):(0,a.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-3 py-3 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:e?.provider==="local"?"This is a local recovery session on the current machine, so there is nothing to sign out of.":`This session is managed by ${L(e?.provider??null)}. Sign out from that provider if you need to end access.`}),e?.githubProfileUrl&&(0,a.jsxs)("a",{href:e.githubProfileUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 text-[13px] text-[var(--vk-orange)] hover:underline",children:[(0,a.jsx)(s.uj0,{size:14}),"Open GitHub Profile"]})]})]})}var q=r(88272);let I="claude-code";function z(e){let t=(0,E.h7)(e);return t?.label?t.label:e.split(/[-_\s]+/g).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" ")}function G(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function W(e){let t=e.trim();return t?t.split(/[\\/]+/).filter(Boolean).at(-1)??null:null}function Z(e){let t=e.trim();if(!t)return null;let r=t.match(/^git@[^:]+:([^/]+)\/([^/\s]+?)(?:\.git)?$/i);if(r)return r[2]??null;try{let e=new URL(t).pathname.split("/").filter(Boolean).at(-1);return e?e.replace(/\.git$/i,""):null}catch{return null}}function V(e,t,r){let a=t?.trim();if(a)return a;let s=Z(e);if(s)return s;let l=r?.trim();return l||"workspace"}function Y(e){if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:`Updated ${new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(t))}`}let J=[{id:"profile",label:"Profile",icon:c,implemented:!0},{id:"general",label:"General",icon:x.A,implemented:!0},{id:"repositories",label:"Repositories",icon:p.A,implemented:!0},{id:"organization",label:"Organization Settings",icon:v.A,implemented:!0},{id:"projects",label:"Projects",icon:m.A,implemented:!1},{id:"agents",label:"Agents",icon:u.A,implemented:!0},{id:"mcp",label:"MCP Servers",icon:h.A,implemented:!1},{id:"preferences",label:"Preferences",icon:b.A,implemented:!1}],X=[{id:"preferences",label:"Preferences",icon:b.A,implemented:!0},{id:"repositories",label:"Repository",icon:p.A,implemented:!0}],K=[{id:"obsidian",label:"Obsidian"},{id:"vscode",label:"VS Code"},{id:"notion",label:"Notion"},{id:"typora",label:"Typora"},{id:"logseq",label:"Logseq"},{id:"custom",label:"Custom"}],Q=[{id:"abstract-sound-1",label:"Abstract Sound 1"},{id:"abstract-sound-2",label:"Abstract Sound 2"},{id:"abstract-sound-3",label:"Abstract Sound 3"},{id:"abstract-sound-4",label:"Abstract Sound 4"},{id:"cow-mooing",label:"Cow Mooing"},{id:"phone-vibration",label:"Phone Vibration"},{id:"rooster",label:"Rooster"}];function ee(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function et(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean).join("\n"):"string"!=typeof e?"":e.split(/[\n,]+/g).map(e=>e.trim()).filter(Boolean).join("\n")}function er(e,t){let r=ee(e),a=ee(r.trustedHeaders),s=ee(r.roles),l=ee(t),n=r.defaultRole,o=l.role;return{requireAuth:!0===r.requireAuth||!0===a.enabled,defaultRole:"viewer"===n||"admin"===n||"operator"===n?n:"operator",trustedHeaders:{enabled:!0===a.enabled,provider:"cloudflare-access",emailHeader:"string"==typeof a.emailHeader&&a.emailHeader.trim().length>0?a.emailHeader.trim():"Cf-Access-Authenticated-User-Email",jwtHeader:"string"==typeof a.jwtHeader&&a.jwtHeader.trim().length>0?a.jwtHeader.trim():"Cf-Access-Jwt-Assertion",teamDomain:"string"==typeof a.teamDomain&&a.teamDomain.trim().length>0?a.teamDomain.trim():"",audience:"string"==typeof a.audience&&a.audience.trim().length>0?a.audience.trim():""},roles:{viewers:et(s.viewers),operators:et(s.operators),admins:et(s.admins),viewerDomains:et(s.viewerDomains),operatorDomains:et(s.operatorDomains),adminDomains:et(s.adminDomains)},current:{authenticated:!0===l.authenticated,role:"viewer"===o||"operator"===o||"admin"===o?o:null,email:"string"==typeof l.email&&l.email.trim().length>0?l.email.trim():null,provider:"string"==typeof l.provider&&l.provider.trim().length>0?l.provider.trim():null}}}function ea(e,t){let r=(0,l.yM)(e);if(!r||r.accessOptions.length<=1)return null;let a=(0,l.Tk)(e,t);return a?r.accessOptions.find(e=>e.id===a)?.label??null:null}let es="block h-4 w-4 shrink-0";function el(e){return JSON.stringify(e)}let en={obsidian:{kind:"icon",icon:o.mWn,className:`${es} text-[#8b5cf6]`},vscode:{kind:"icon",icon:i.$$9,className:`${es} text-[#22a3f5]`},notion:{kind:"icon",icon:o.i4$,className:`${es} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${es} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${es} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:x.A,className:`${es} text-[var(--vk-text-muted)]`}};function eo({editorId:e}){let t=en[e];if(!t)return(0,a.jsx)(g.A,{className:`${es} text-[var(--vk-text-muted)]`});if("image"===t.kind)return(0,a.jsx)("img",{src:t.imageSrc,alt:"",className:t.className});let r=t.icon;return(0,a.jsx)(r,{className:t.className})}function ei({agent:e,modelAccess:t,runtimeModelCatalogs:r,selection:s,onChange:n,compact:o=!1}){if(!(0,l.Zz)(e))return null;let i=(0,l.yM)(e),d=(0,q.Ik)(e,t,r),c=(0,q.xb)(s)??s.catalogModel,x=(0,q.iL)(e,t,r,c),p=ea(e,t);return i?(0,a.jsxs)("div",{className:o?"grid gap-3 md:grid-cols-3":"space-y-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Model"}),(0,a.jsxs)("select",{value:s.catalogModel,disabled:0===d.length,onChange:a=>{let l=a.target.value,o=(0,q.iL)(e,t,r,l);n({...s,catalogModel:l,reasoningEffort:o.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,q.YS)(e,t,r,l)})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===d.length&&(0,a.jsx)("option",{value:"",children:"No runtime models detected"}),d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,a.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[p?`Filtered for ${p}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),x.length>0&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Reasoning Effort"}),(0,a.jsx)("select",{value:s.reasoningEffort,onChange:e=>{n({...s,reasoningEffort:e.target.value})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:x.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Choose how much deliberate reasoning the CLI should use before it acts."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Custom Model Override"}),(0,a.jsx)("input",{value:s.customModel,onChange:a=>{let l=a.target.value,o=l.trim()||s.catalogModel,i=(0,q.iL)(e,t,r,o);n({...s,customModel:l,reasoningEffort:i.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,q.YS)(e,t,r,o)})},placeholder:(0,q.ZA)(e,r),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Optional. Use this to force an exact model id from the installed CLI when you want to override the detected list."})]})]}):null}function ed({open:e,onClose:t,onCreate:r,creating:o,error:i,defaultAgent:d,agentOptions:c,modelAccess:x,runtimeModelCatalogs:p,bridgeId:v}){let[m,u]=(0,n.useState)("git"),[h,b]=(0,n.useState)("source"),[g,C]=(0,n.useState)(""),[S,A]=(0,n.useState)(!1),[H,P]=(0,n.useState)(""),[$,M]=(0,n.useState)(""),[D,B]=(0,n.useState)(""),[L,F]=(0,n.useState)("main"),[_,T]=(0,n.useState)(d),[O,J]=(0,n.useState)((0,q.Z3)()),[X,K]=(0,n.useState)(!0),[Q,ee]=(0,n.useState)(!0),[et,er]=(0,n.useState)([]),[ea,es]=(0,n.useState)(!1),[el,en]=(0,n.useState)(!1),[eo,ex]=(0,n.useState)(null),[ep,ev]=(0,n.useState)(""),[em,eu]=(0,n.useState)(""),[eh,eb]=(0,n.useState)(!1),[eg,ek]=(0,n.useState)("local"),[ef,ej]=(0,n.useState)([]),[eN,ey]=(0,n.useState)(!1),[ew,eC]=(0,n.useState)(null);(0,n.useEffect)(()=>{e&&(u("git"),b("source"),C(""),A(!1),P(""),M(""),B(""),F("main"),ee(!0),K(!0),T(d),J((0,q.Z3)()),er([]),en(!1),ex(null),ev(""),eu(""),ej([]),eC(null),ey(!1),eb(!1),ek("local"))},[d,e]),(0,n.useEffect)(()=>{e&&J(e=>{let t=(0,q.c0)(_,x,p,(0,q.xb)(e)??null,(0,q.aB)(e)??null);return e.catalogModel===t.catalogModel&&e.customModel===t.customModel&&e.reasoningEffort===t.reasoningEffort?e:t})},[_,x,e,p]),(0,n.useEffect)(()=>{if(!e)return;let t="git"===m?H.trim().length>0:$.trim().length>0;"source"===h||t||b("source")},[H,$,m,e,h]);let eS=(0,n.useMemo)(()=>{let e;return 0===(e=ep.trim().toLowerCase()).length?et:et.filter(t=>t.fullName.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||(t.ownerLogin??"").toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e)||t.defaultBranch.toLowerCase().includes(e))},[ep,et]),eA=(0,n.useMemo)(()=>{let e=et.find(e=>e.httpsUrl===em);return e||(H.trim()?et.find(e=>e.httpsUrl===H.trim())??null:null)},[H,et,em]),eH=(0,n.useMemo)(()=>(function(e){let t=e.trim();if(!t)return null;let r=t.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/\s?#]+?)(?:\.git)?\/?$/i);if(r)return`https://github.com/${r[1]}/${r[2]}.git`;let a=t.match(/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/i);return a?`https://github.com/${a[1]}/${a[2]}.git`:null})(ep),[ep]),eR=(0,n.useMemo)(()=>{let e;return(e=ep.trim())&&/^(https?:\/\/|git@)/i.test(e)?e:null},[ep]),eE=(0,n.useMemo)(()=>Y(eA?.updatedAt),[eA]),eP=(0,n.useMemo)(()=>{let e=eH??eR;return!!e&&e.toLowerCase()!==H.trim().toLowerCase()},[H,eH,eR]),eU="git"===m?H.trim().length>0:$.trim().length>0,e$=(0,n.useMemo)(()=>{let e=G(g);return e||("git"===m?G(V(H,eA?.name)):G(W($)??"workspace"))},[H,$,m,g,eA?.name]),eM=(0,n.useMemo)(()=>V(H,eA?.name,e$),[e$,H,eA?.name]),eD=(0,n.useMemo)(()=>{if(0===D.trim().length)return"";let e=D.trim().replace(/[\\/]+$/,""),t=eM.trim().replace(/^[\\/]+/,"");if(!e)return t;if(!t)return e;let r=e.includes("\\")&&!e.includes("/")?"\\":"/";return`${e}${r}${t}`},[eM,D]),eB=(0,n.useMemo)(()=>"git"===m?eA?.fullName??H.trim():W($)??$.trim(),[H,$,m,eA]),eL=(0,n.useMemo)(()=>"git"===m?eA?.description?.trim()||H.trim():$.trim(),[H,$,m,eA]),eF=(0,n.useMemo)(()=>{let e=[...new Set(c)];0===e.length&&e.push(d||I);let t=new Map(E.BO.map((e,t)=>[e,t]));return e.sort((e,r)=>{let a=t.get((0,R.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,R.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:z(e).localeCompare(z(r))})},[c,d]);(0,n.useEffect)(()=>{eF.includes(_)||T(eF[0]??I)},[_,eF]);let e_=async(e=!1)=>{es(!0),ex(null);try{let t=await fetch((0,U.S)(`/api/github/repos${e?"?refresh=true":""}`,v)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load GitHub repositories (${t.status})`);er(Array.isArray(r?.repos)?r.repos:[])}catch(e){er([]),ex(e instanceof Error?e.message:"Failed to load GitHub repositories")}finally{en(!0),es(!1)}};(0,n.useEffect)(()=>{!e||"git"!==m||ea||el||e_()},[el,ea,m,e]);let eT=async e=>{let t=e?.gitUrl??("git"===m?H.trim():""),r=e?.path??("local"===m?$.trim():"");if(0===t.length&&0===r.length)return void eC("git"===m?"Choose or paste a repository first.":"Select a local repository path first.");ey(!0),eC(null);try{let e=new URLSearchParams;t.length>0&&e.set("gitUrl",t),r.length>0&&e.set("path",r);let a=await fetch((0,U.S)(`/api/workspaces/branches?${e.toString()}`,v)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load branches (${a.status})`);let l=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];ej(l);let n="string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():l[0]??null;n&&(0===L.trim().length||!l.includes(L))&&F(n)}catch(e){ej([]),eC(e instanceof Error?e.message:"Failed to load branches")}finally{ey(!1)}},eO=async e=>{eu(e);let t=et.find(t=>t.httpsUrl===e);t&&(P(t.httpsUrl),ev(t.fullName),F(t.defaultBranch||"main"),S||C(G(t.name)||g),await eT({gitUrl:t.httpsUrl}),b("details"))},eq=async()=>{let e=eH??eR;if(!e)return;let t=et.find(t=>t.httpsUrl.toLowerCase()===e.toLowerCase())??null;if(t)return void await eO(t.httpsUrl);if(eu(""),P(e),F("main"),ej([]),eC(null),!S){let t=Z(e);t&&C(G(t))}await eT({gitUrl:e}),b("details")},eI=e=>{ek(e),eb(!0)},ez=e=>{u(e),b("source"),ej([]),eC(null)};if(!e)return null;let eG=eU&&L.trim().length>0;async function eW(e){if(e.preventDefault(),"review"!==h||!eG||o)return;let t="git"===m?{mode:m,projectId:e$||void 0,agent:_,agentModel:(0,q.xb)(O)??"",agentReasoningEffort:(0,q.aB)(O)??"",defaultBranch:L.trim(),useWorktree:X,gitUrl:H.trim(),path:eD||void 0}:{mode:m,projectId:e$||void 0,agent:_,agentModel:(0,q.xb)(O)??"",agentReasoningEffort:(0,q.aB)(O)??"",defaultBranch:L.trim(),useWorktree:X,path:$.trim(),initializeGit:Q};await r(t)}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[80] flex items-end justify-center overflow-y-auto bg-black/65 px-0 py-0 sm:items-center sm:px-3 sm:py-3",onClick:()=>{o||eh||t()},role:"presentation",children:(0,a.jsxs)("form",{onSubmit:eW,onClick:e=>e.stopPropagation(),className:"flex h-dvh w-full max-w-none flex-col overflow-hidden rounded-none border-x-0 border-b-0 border-t border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-auto sm:max-h-[calc(100dvh-3rem)] sm:max-w-[860px] sm:rounded-[10px] sm:border",children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 backdrop-blur",children:[(0,a.jsx)("div",{className:"mb-3 flex justify-center sm:hidden",children:(0,a.jsx)("span",{className:"h-1 w-10 rounded-full bg-[color:color-mix(in_srgb,var(--vk-text-muted)_36%,transparent)]"})}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h2",{className:"text-[18px] leading-[22px] text-[var(--vk-text-strong)]",children:"Add Workspace"}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"source"===h?"Step 1 of 3":"details"===h?"Step 2 of 3":"Step 3 of 3"})]}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:"source"===h?"Start with the repository or folder you want Conductor to manage.":"details"===h?"Confirm the project defaults Conductor should use when this workspace is created.":"Review the project and destination details before Conductor adds it."}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[{id:"source",label:"git"===m?"Repository":"Folder"},{id:"details",label:"Project"},{id:"review",label:"Review"}].map(e=>{let t=h===e.id,r="source"===e.id?"source"!==h&&eU:"details"===e.id&&"review"===h;return(0,a.jsxs)("div",{className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[11px] ${t?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)] text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] ${r?"border-[var(--vk-orange)] bg-[var(--vk-orange)] text-black":t?"border-[var(--vk-orange)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)]"}`,children:r?(0,a.jsx)(k.A,{className:"h-3 w-3"}):"source"===e.id?"1":"details"===e.id?"2":"3"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsx)("button",{type:"button",onClick:t,disabled:o,"aria-label":"Close dialog",className:"inline-flex h-8 w-8 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:(0,a.jsx)(f.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5 sm:py-5",children:"source"===h?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ez("git"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"git"===m?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.uj0,{className:"h-[18px] w-[18px]"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"GitHub repository"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Search repos you already have access to, or paste a GitHub URL directly."})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>ez("local"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"local"===m?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(j.A,{className:"h-5 w-5"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Local folder"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Point Conductor at a repository already on this machine."})]})]}),"git"===m?(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.SYR,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose repository"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Select a repo first. Branch, workspace name, and runtime defaults come next."})]}),(0,a.jsx)("button",{type:"button",onClick:()=>{en(!1),e_(!0)},disabled:ea,className:"inline-flex h-9 items-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:ea?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.A,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.uj0,{className:"pointer-events-none absolute left-3 top-1/2 h-[16px] w-[16px] -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:ep,onChange:e=>ev(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eP&&(e.preventDefault(),eq())},placeholder:"Search GitHub repos or paste a repository URL",className:"h-11 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent pl-10 pr-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),eP?(0,a.jsxs)("button",{type:"button",onClick:()=>{eq()},className:"inline-flex w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2.5 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(s.SYR,{className:"h-4 w-4 text-[var(--vk-text-strong)]"}),(0,a.jsxs)("span",{className:"truncate",children:["Use ",eH?"this GitHub repository":"pasted repository URL"]})]}):null,ea&&0===et.length?(0,a.jsx)("div",{className:"rounded-[8px] border border-[var(--vk-border)] px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading accessible GitHub repositories..."}):null,eo?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-red)]/40 bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] text-[var(--vk-red)]",children:[(0,a.jsx)("p",{children:eo}),(0,a.jsx)("button",{type:"button",onClick:()=>{en(!1),e_(!0)},className:"mt-2 inline-flex items-center rounded-[6px] border border-[var(--vk-border)] px-2 py-1 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Retry"})]}):null,!eo&&eS.length>0?(0,a.jsx)("div",{className:"max-h-[min(42dvh,340px)] space-y-2 overflow-y-auto pr-1",children:eS.map(e=>{let t=Y(e.updatedAt),r=eA?.httpsUrl===e.httpsUrl;return(0,a.jsxs)("button",{type:"button",onClick:()=>{eO(e.httpsUrl)},className:`flex w-full items-start gap-3 rounded-[8px] border px-3 py-3 text-left transition ${r?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_10%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"mt-0.5 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.SYR,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:e.fullName}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[e.private?(0,a.jsx)(s.XAi,{className:"h-3 w-3"}):(0,a.jsx)(s.uj0,{className:"h-3 w-3"}),e.private?"Private":"Public"]}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(s.C3c,{className:"h-3 w-3"}),e.defaultBranch]})]}),e.description?(0,a.jsx)("span",{className:"mt-1 block line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:e.description}):null,(0,a.jsxs)("span",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[e.ownerLogin?(0,a.jsx)("span",{children:e.ownerLogin}):null,t?(0,a.jsx)("span",{children:t}):null,e.permission?(0,a.jsx)("span",{children:e.permission.toLowerCase()}):null]})]}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--vk-text-strong)]",children:r?(0,a.jsx)(k.A,{className:"h-4 w-4"}):null})]},e.httpsUrl)})}):null,ea||eo||0!==eS.length?null:(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:ep.trim().length>0?"No matching repositories. Try another search or paste a repository URL.":"No accessible GitHub repositories were found for this machine yet."})]}):(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(j.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose folder"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Pick the repository folder already on disk. You can adjust branch and runtime defaults next."})]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>eI("local"),className:"inline-flex h-11 w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(j.A,{className:"h-4 w-4"}),$.trim().length>0?"Choose another folder":"Choose folder"]}),$.trim().length>0?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:[(0,a.jsx)("p",{className:"text-[12px] font-medium text-[var(--vk-text-strong)]",children:"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:$})]}):(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"The folder picker stays separate so you do not lose your place in this setup flow on mobile."})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]}):"details"===h?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"git"===m?"Selected repository":"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:eB}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eL}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:"git"===m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[eA?.private?(0,a.jsx)(s.XAi,{className:"h-3 w-3"}):(0,a.jsx)(s.uj0,{className:"h-3 w-3"}),eA?eA.private?"Private":"Public":"Manual URL"]}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(s.C3c,{className:"h-3 w-3"}),L||"main"]}),eA?.ownerLogin?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:eA.ownerLogin}):null,eE?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:eE}):null]}):(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"Local repository"})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>b("source"),className:"inline-flex h-9 items-center justify-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Change"})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Workspace Name (optional)"}),(0,a.jsx)("input",{value:g,onChange:e=>{C(e.target.value),A(!0)},placeholder:"auto-derived from the selected repository or folder",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:L,onChange:e=>F(e.target.value),placeholder:"Uses the repository default branch",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{eT()},disabled:eN,className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",title:"Detect branches",children:eN?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"})})]}),ef.length>0?(0,a.jsx)("select",{value:L,onChange:e=>F(e.target.value),className:"mt-2 h-9 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:ef.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}):null,ew?(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:ew}):null]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:["Agent: ",z(_)]}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:X?"Worktree isolation on":"Runs on selected branch"}),"local"===m?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:Q?"Auto-init git if needed":"Do not init git"}):null]}),(0,l.Zz)(_)?(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-end sm:justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Agent defaults"}),(0,a.jsx)("p",{className:"mt-0.5 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Choose the model and reasoning this workspace should inherit when sessions launch."})]})}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(ei,{compact:!0,agent:_,modelAccess:x,runtimeModelCatalogs:p,selection:O,onChange:J})})]}):null,(0,a.jsxs)("details",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-3 py-3 text-[13px] text-[var(--vk-text-normal)] marker:hidden",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,a.jsx)(w.A,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),"Runtime and repository options"]})}),(0,a.jsxs)("div",{className:"space-y-3 border-t border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Agent"}),(0,a.jsx)("select",{value:_,onChange:e=>T(e.target.value),className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:eF.map(e=>(0,a.jsx)("option",{value:e,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:z(e)},e))})]}),(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:X,onChange:e=>K(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Recommended. Turn this off only if sessions should run directly on the selected branch."})]})]})}),"local"===m?(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:Q,onChange:e=>ee(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Initialize git if this folder is not already a repository",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Leave this on unless you know the folder should stay non-git."})]})]})}):(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Clone into parent folder"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:D,readOnly:!0,onClick:()=>eI("clone"),placeholder:"Leave empty to use Conductor's default repo location",className:"h-10 w-full cursor-pointer rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eI("clone"),className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,a.jsx)(j.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:eD?`Conductor will create ${eD}.`:"Conductor will create the cloned repository inside the selected parent folder."})]})]})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Review project"}),(0,a.jsxs)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:["Conductor will add ",(0,a.jsx)("span",{className:"font-medium text-[var(--vk-text-normal)]",children:e$||"workspace"})," ","and sync the board plus support files for this project."]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Project"}),(0,a.jsx)("p",{className:"mt-2 text-[15px] font-medium text-[var(--vk-text-strong)]",children:e$||"workspace"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:g.trim().length>0?"Uses the custom workspace name you entered.":"Auto-derived from the selected repository or folder."})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Source"}),(0,a.jsx)("p",{className:"mt-2 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:eB}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eL})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Destination"}),(0,a.jsx)("p",{className:"mt-2 break-all text-[15px] font-medium text-[var(--vk-text-strong)]",children:"git"===m?eD||"Conductor default repo location":$}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"git"===m?eD?`The repository will be cloned into ${eD}.`:"Conductor will choose the default clone location for this repository.":"Conductor will link the selected folder directly."})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Runtime Defaults"}),(0,a.jsxs)("div",{className:"mt-2 space-y-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsxs)("p",{children:["Branch: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:L.trim()||"main"})]}),(0,a.jsxs)("p",{children:["Agent: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:z(_)})]}),(0,a.jsxs)("p",{children:["Isolation: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:X?"Worktree enabled":"Runs on selected branch"})]}),(0,q.xb)(O)?(0,a.jsxs)("p",{children:["Model: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,q.xb)(O)})]}):null,(0,q.aB)(O)?(0,a.jsxs)("p",{children:["Reasoning: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,q.aB)(O)})]}):null,"local"===m?(0,a.jsxs)("p",{children:["Git init: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:Q?"Enabled if needed":"Disabled"})]}):null]})]})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]})}),(0,a.jsx)("footer",{className:"border-t border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] backdrop-blur",children:"source"===h?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:t,disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{"local"!==m||eU?eU&&!o&&b("details"):eI("local")},disabled:"git"===m&&!eU||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"local"!==m||eU?"Continue":"Choose folder"})]}):"details"===h?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>b("source"),disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"button",onClick:()=>{eU&&0!==L.trim().length&&!o&&b("review")},disabled:!eG||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Review"})]}):(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>b("details"),disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"submit",disabled:!eG||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Adding..."]}):"Add Workspace"})]})})]})}),(0,a.jsx)(ec,{open:eh,bridgeId:v,initialPath:"clone"===eg?D:$,title:"local"===eg?"Select Local Repository":"Select Clone Parent Folder",description:"local"===eg?"Choose the local repository folder.":"Choose the parent folder where Conductor should create the cloned repository.",onClose:()=>eb(!1),onSelect:e=>{if(eb(!1),e){if("clone"===eg)return void B(e);if(M(e),!S){let t=W(e);t&&C(G(t))}eT({path:e}),b("details")}}})]})}function ec({open:e,bridgeId:t,initialPath:r,title:s,description:l,onClose:o,onSelect:i}){let[d,c]=(0,n.useState)(""),[x,p]=(0,n.useState)(r??""),[v,m]=(0,n.useState)([]),[u,h]=(0,n.useState)(""),[b,g]=(0,n.useState)(!1),[k,f]=(0,n.useState)(null),[y,w]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!e)return;h(""),p(r??"");let a=r&&r.trim().length>0?r.trim():void 0,s=a?`?path=${encodeURIComponent(a)}`:"";g(!0),f(null),fetch((0,U.S)(`/api/filesystem/directory${s}`,t)).then(async e=>{let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load directory (${e.status})`);c("string"==typeof t?.currentPath?t.currentPath:""),m(Array.isArray(t?.entries)?t.entries:[])}).catch(e=>{f(e instanceof Error?e.message:"Failed to load directory"),m([])}).finally(()=>{g(!1)})},[r,e]);let S=(0,n.useMemo)(()=>{if(0===u.trim().length)return v;let e=u.trim().toLowerCase();return v.filter(t=>t.name.toLowerCase().includes(e))},[v,u]),A=async e=>{g(!0),f(null);try{let r=e&&e.trim().length>0?`?path=${encodeURIComponent(e.trim())}`:"",a=await fetch((0,U.S)(`/api/filesystem/directory${r}`,t)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load directory (${a.status})`);let l="string"==typeof s?.currentPath?s.currentPath:"";c(l),m(Array.isArray(s?.entries)?s.entries:[]),p(l)}catch(e){f(e instanceof Error?e.message:"Failed to load directory"),m([])}finally{g(!1)}},H=async()=>{w(!0);try{let e=await fetch((0,U.S)("/api/filesystem/pick-directory",t),{method:"POST"}),r=await e.json().catch(()=>null);if(!r||r.cancelled||!r.path)return;p(r.path),A(r.path)}catch{}finally{w(!1)}};return e?(0,a.jsx)("div",{className:"fixed inset-0 z-[95] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{o(),i(null)},role:"presentation",children:(0,a.jsxs)("div",{className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("h3",{className:"text-[16px] text-[var(--vk-text-strong)]",children:s}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:l})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("input",{value:x,onChange:e=>p(e.target.value),placeholder:"/path/to/repository",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{A(x)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{A()},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Home"}),(0,a.jsx)("button",{type:"button",onClick:()=>{if(!d)return;let e=d.replace(/\\/g,"/");if(/^[A-Za-z]:\/?$/.test(d)||"/"===e)return;let t=e.split("/").filter(Boolean),r=d.match(/^([A-Za-z]):[/\\]/);A(r?t.length>1?`${r[1]}:/${t.slice(1,-1).join("/")}`:`${r[1]}:/`:t.length>1?`/${t.slice(0,-1).join("/")}`:"/")},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Up"}),(0,a.jsxs)("button",{type:"button",disabled:y,onClick:()=>{H()},className:"inline-flex h-8 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:[y?(0,a.jsx)(N.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(j.A,{className:"h-3 w-3"}),y?"Opening...":"Browse"]}),(0,a.jsx)("div",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:d||"Home"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(C.A,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:u,onChange:e=>h(e.target.value),placeholder:"Filter folders",className:"h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent pl-7 pr-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-[4px] border border-[var(--vk-border)]",children:b?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading..."}):k?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:k}):0===S.length?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"No folders found."}):(0,a.jsx)("div",{className:"p-1",children:S.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{e.isDirectory&&A(e.path)},className:`mb-1 flex w-full items-center gap-2 rounded-[4px] px-2 py-2 text-left text-[12px] ${e.isDirectory?"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]":"cursor-default text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)(j.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.name}),e.isGitRepo&&(0,a.jsx)("span",{className:"ml-auto rounded-[999px] border border-[var(--vk-border)] px-1.5 py-0.5 text-[10px]",children:"git"})]},e.path))})})]}),(0,a.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{o(),i(null)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{let e=x.trim().length>0?x.trim():d;o(),i(e||null)},className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:"Use this folder"})]})]})}):null}function ex({value:e,idleLabel:t="Copy",copiedLabel:r="Copied"}){let[s,l]=(0,n.useState)(!1);async function o(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1400)}return(0,a.jsxs)("button",{type:"button",onClick:()=>void o(),className:"inline-flex h-8 items-center gap-1.5 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[s?(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"}):(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:s?r:t})]})}function ep({open:e,mode:t,creating:r,error:s,current:o,projectCount:i,agentOptions:d,agentStates:c,runtimeModelCatalogs:x,onRepositoriesChanged:p,onOnboardingComplete:v,onOpenAgentSetup:m,onClose:u,onSave:h,bridgeId:b}){var g,w;let C,[S,D]=(0,n.useState)("preferences"),[B,L]=(0,n.useState)(o.codingAgent),[F,_]=(0,n.useState)(o.ide),[T,G]=(0,n.useState)(o.markdownEditor),[W,Z]=(0,n.useState)(o.markdownEditorPath??""),[V,Y]=(0,n.useState)(()=>o.filesystemBrowseRoots.join("\n")),[ee,et]=(0,n.useState)(!0===o.allowHomeBrowse),[es,en]=(0,n.useState)(o.modelAccess),[ed,ev]=(0,n.useState)(o.notifications.soundEnabled),[em,eu]=(0,n.useState)(o.notifications.soundFile),[eh,eb]=(0,n.useState)([]),[eg,ek]=(0,n.useState)(!1),[ef,ej]=(0,n.useState)(!1),[eN,ey]=(0,n.useState)(null),[ew,eC]=(0,n.useState)(""),[eS,eA]=(0,n.useState)(null),[eH,eR]=(0,n.useState)((0,q.Z3)()),[eE,eP]=(0,n.useState)([]),[eU,e$]=(0,n.useState)(!1),[eM,eD]=(0,n.useState)(null),[eB,eL]=(0,n.useState)(!1),[eF,e_]=(0,n.useState)(!1),[eT,eO]=(0,n.useState)(!1),[eq,eI]=(0,n.useState)(()=>er(null)),[ez,eG]=(0,n.useState)(!1),[eW,eZ]=(0,n.useState)(!1),[eV,eY]=(0,n.useState)(null),[eJ,eX]=(0,n.useState)(null),[eK,eQ]=(0,n.useState)(!1),[e0,e1]=(0,n.useState)(null),e2=r||ef||eW;function e3(e){return{...e,agentPermissions:"skip"===e.agentPermissions?"skip":"default",devServerScript:e.devServerScript??"",devServerCwd:e.devServerCwd??"",devServerUrl:e.devServerUrl??"",devServerPort:e.devServerPort??"",devServerHost:e.devServerHost??"",devServerPath:e.devServerPath??"",devServerHttps:!0===e.devServerHttps,pathHealth:{exists:e.pathHealth.exists,isGitRepository:e.pathHealth.isGitRepository,suggestedPath:e.pathHealth.suggestedPath}}}function e4(e){return e.split(/\n+/g).map(e=>e.trim()).filter(Boolean)}async function e5(e){ek(!0),ey(null);try{let t=await fetch((0,U.S)("/api/repositories",b)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load repositories (${t.status})`);let a=Array.isArray(r?.repositories)?r.repositories:[];eb(a);let s=a[0]?.id??"",l=e&&a.some(t=>t.id===e)?e:ew&&a.some(e=>e.id===ew)?ew:s;eC(l)}catch(e){eb([]),eC(""),eA(null),eR((0,q.Z3)()),ey(e instanceof Error?e.message:"Failed to load repositories")}finally{ek(!1)}}async function e9(e,t){let r=(e??eS?.path??"").trim();if(0===r.length){eD("Select a repository path first."),eP([]);return}e$(!0),eD(null);try{let e=new URLSearchParams({path:r}),a=await fetch((0,U.S)(`/api/workspaces/branches?${e.toString()}`,b)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to detect branches (${a.status})`);let l=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];eP(l);let n=t?.trim()||("string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():l[0]??"");if(!n)return;eA(e=>!e||e.defaultBranch.trim().length>0&&l.includes(e.defaultBranch)?e:{...e,defaultBranch:n})}catch(e){eP([]),eD(e instanceof Error?e.message:"Failed to detect branches")}finally{e$(!1)}}async function e8(){if(!eS||ef||0===eS.repo.trim().length||0===eS.path.trim().length)return!1;ej(!0),ey(null);try{let e=await fetch((0,U.S)("/api/repositories",b),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:eS.id,displayName:eS.displayName,repo:eS.repo,path:eS.path,agent:eS.agent,agentPermissions:eS.agentPermissions,agentModel:(0,q.xb)(eH)??"",agentReasoningEffort:(0,q.aB)(eH)??"",defaultWorkingDirectory:eS.defaultWorkingDirectory,defaultBranch:eS.defaultBranch,devServerScript:eS.devServerScript,devServerCwd:eS.devServerCwd,devServerUrl:eS.devServerUrl,devServerPort:eS.devServerPort,devServerHost:eS.devServerHost,devServerPath:eS.devServerPath,devServerHttps:eS.devServerHttps,setupScript:eS.setupScript,runSetupInParallel:eS.runSetupInParallel,cleanupScript:eS.cleanupScript,archiveScript:eS.archiveScript,copyFiles:eS.copyFiles})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save repository settings (${e.status})`);let r=t?.repository;if(!r)throw Error("Repository saved but response is missing repository data");return eb(e=>e.map(e=>e.id===r.id?r:e)),eA(e3(r)),eC(r.id),eD(null),await e9(r.path,r.defaultBranch),p&&await p(),!0}catch(e){return ey(e instanceof Error?e.message:"Failed to save repository settings"),!1}finally{ej(!1)}}async function e6(){eG(!0),eY(null);try{let e=await fetch("/api/access"),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load organization settings (${e.status})`);eI(er(t?.access,t?.current))}catch(e){eI(er(null)),eY(e instanceof Error?e.message:"Failed to load organization settings")}finally{eG(!1)}}async function e7(){eQ(!0),e1(null);try{let e=await fetch("/api/auth/profile",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok){let r=t&&"object"==typeof t&&"error"in t&&"string"==typeof t.error?t.error:`Failed to load profile (${e.status})`;throw Error(r)}eX(t)}catch(e){eX(null),e1(e instanceof Error?e.message:"Failed to load profile")}finally{eQ(!1)}}async function te(){if(eW)return!1;eZ(!0),eY(null);try{let e=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:eq.requireAuth||eq.trustedHeaders.enabled,defaultRole:eq.defaultRole,trustedHeaders:{enabled:eq.trustedHeaders.enabled,provider:"cloudflare-access",emailHeader:eq.trustedHeaders.emailHeader,jwtHeader:eq.trustedHeaders.jwtHeader,teamDomain:eq.trustedHeaders.teamDomain,audience:eq.trustedHeaders.audience},roles:{viewers:e4(eq.roles.viewers),operators:e4(eq.roles.operators),admins:e4(eq.roles.admins),viewerDomains:e4(eq.roles.viewerDomains),operatorDomains:e4(eq.roles.operatorDomains),adminDomains:e4(eq.roles.adminDomains)}})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save organization settings (${e.status})`);return eI(er(t?.access,t?.current)),!0}catch(e){return eY(e instanceof Error?e.message:"Failed to save organization settings"),!1}finally{eZ(!1)}}(0,n.useEffect)(()=>{e&&(D("onboarding"===t?"preferences":"general"),L(o.codingAgent),_(o.ide),G(o.markdownEditor),Z(o.markdownEditorPath??""),Y(o.filesystemBrowseRoots.join("\n")),et(!0===o.allowHomeBrowse),en(o.modelAccess),ev(o.notifications.soundEnabled),eu(o.notifications.soundFile),eP([]),eD(null),ey(null),eR((0,q.Z3)()),eY(null),eX(null),e1(null))},[t,e]),(0,n.useEffect)(()=>{e&&("settings"===t||"repositories"===S)&&e5()},[S,t,e]),(0,n.useEffect)(()=>{e&&"onboarding"!==t&&e6()},[t,e]),(0,n.useEffect)(()=>{e&&"onboarding"!==t&&"profile"===S&&e7()},[S,t,e]),(0,n.useEffect)(()=>{if(!e)return;if(!ew){eA(null),eR((0,q.Z3)());return}let t=eh.find(e=>e.id===ew);if(!t)return;let r=(0,E.a6)(t.agent,B||I);eA(e3({...t,agent:r})),eR((0,q.c0)(r,es,x,t.agentModel,t.agentReasoningEffort)),eP([]),eD(null),t.path.trim().length>0&&e9(t.path,t.defaultBranch)},[B,es,e,eh,x,ew]);let tt="onboarding"===t&&i>0,tr=(0,n.useMemo)(()=>"onboarding"===t?tt?X:X.filter(e=>"preferences"===e.id):J.filter(e=>e.implemented),[t,tt]),ta=tr.find(e=>e.id===S)??tr[0]??J[0],ts="onboarding"===t,tl="preferences"===ta.id,tn="profile"===ta.id,to="general"===ta.id,ti="agents"===ta.id,td=tl||to||ti,tc="repositories"===ta.id,tx="organization"===ta.id,tp=tr.findIndex(e=>e.id===ta.id)+1,tv=tr.some(e=>"repositories"===e.id),tm="admin"===eq.current.role,tu=(0,n.useMemo)(()=>{let e=new Set((0,E.Ge)(d));B.trim().length>0&&(0,E.iQ)(B)&&e.add(B),0===e.size&&e.add(I);let t=new Map(E.BO.map((e,t)=>[e,t]));return[...e].sort((e,r)=>{let a=t.get((0,R.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,R.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:z(e).localeCompare(z(r))})},[d,B]);(0,n.useEffect)(()=>{0!==tu.length&&(B&&tu.includes(B)||L((0,E.a6)(B,tu[0]??I)))},[B,tu]);let th=c[(0,R.q)(B)]??null;if(!e)return null;let tb=B.trim().length>0&&F.trim().length>0&&T.trim().length>0,tg=!!eS&&eS.displayName.trim().length>0&&eS.repo.trim().length>0&&eS.path.trim().length>0&&eS.defaultBranch.trim().length>0,tk=tm&&!ez&&(!eq.trustedHeaders.enabled||eq.trustedHeaders.teamDomain.trim().length>0&&eq.trustedHeaders.audience.trim().length>0),tf=tc?eN:tx?eV:tn?e0:s,tj=eS?(g={...eS,agentModel:(0,q.xb)(eH)??"",agentReasoningEffort:(0,q.aB)(eH)??""},w={ide:F,markdownEditor:T},C=["npx --yes --registry=https://registry.npmjs.org conductor-oss@latest setup","--yes",`--path ${el(g.path)}`,`--project-id ${el(g.id)}`,`--display-name ${el(g.displayName)}`,`--agent ${el(g.agent||"claude-code")}`,`--ide ${el(w.ide)}`,`--markdown-editor ${el(w.markdownEditor)}`],g.repo.trim().length>0&&C.push(`--repo ${el(g.repo.trim())}`),g.defaultBranch.trim().length>0&&C.push(`--default-branch ${el(g.defaultBranch.trim())}`),g.agentModel.trim().length>0&&C.push(`--model ${el(g.agentModel.trim())}`),g.agentReasoningEffort.trim().length>0&&C.push(`--reasoning-effort ${el(g.agentReasoningEffort.trim())}`),g.defaultWorkingDirectory.trim().length>0&&C.push(`--default-working-directory ${el(g.defaultWorkingDirectory.trim())}`),C.join(" ")):"";async function tN(e,t){let a,s;if(!tb||r)return!1;let l=await h((a=ed?em??Q[0]?.id??"abstract-sound-4":null,s=V.split(/\n+/g).map(e=>e.trim()).filter(Boolean),{onboardingAcknowledged:!!e||o.onboardingAcknowledged,codingAgent:B.trim(),ide:F.trim(),markdownEditor:T.trim(),markdownEditorPath:(W??"").trim(),filesystemBrowseRoots:s,allowHomeBrowse:ee,modelAccess:es,notifications:{soundEnabled:ed,soundFile:a}}),t);return l&&t?.openAgentSetup!==!1&&th&&!th.ready&&m(B),l}async function ty(){if(!eg){if(!tv){if(!await tN(!0,{closeDialog:!0}))return;v?.({needsProject:0===i});return}await tN(!1,{closeDialog:!1})&&D("repositories")}}async function tw(){(!tc||await e8())&&await tN(!0,{closeDialog:!0})&&v?.({needsProject:!1})}async function tC(){await tN(!0,{closeDialog:!0,openAgentSetup:!1})&&v?.({needsProject:!1})}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[90] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-6",onClick:()=>{e2||"onboarding"===t||eB||eF||eT||u()},role:"presentation",children:(0,a.jsxs)("div",{className:"flex h-[100dvh] w-full flex-col overflow-hidden border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-[min(90vh,820px)] sm:max-h-[calc(100dvh-3rem)] sm:max-w-[1180px] sm:rounded-[6px] sm:border sm:flex-row",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("aside",{className:"flex w-full shrink-0 flex-col border-b border-[var(--vk-border)] bg-[rgba(28,28,28,0.8)] sm:w-[224px] sm:border-b-0 sm:border-r",children:[(0,a.jsx)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:(0,a.jsx)("h2",{className:"text-[22px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:ts?"Setup":"Settings"})}),(0,a.jsx)("nav",{className:"-mx-0.5 flex gap-1 overflow-x-auto px-2 py-2 sm:mx-0 sm:block sm:space-y-1 sm:overflow-auto sm:px-2",children:tr.map(e=>{let t=e.icon,r=ta.id===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>D(e.id),disabled:e2,className:`flex min-h-[44px] shrink-0 items-center gap-3 rounded-[3px] px-3 py-2 text-left text-[14px] leading-[21px] transition-colors sm:min-h-0 sm:w-full ${r?"bg-[color:color-mix(in_srgb,var(--vk-accent)_12%,transparent)] text-[var(--vk-accent)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"} disabled:opacity-50`,children:[(0,a.jsx)(t,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-[20px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:ts?tl?"Choose your preferences":"Review repository defaults":ta.label}),ts&&(0,a.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",tp," of ",tr.length]})]}),(0,a.jsx)("button",{type:"button",onClick:u,disabled:e2||"onboarding"===t,"aria-label":"Close settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-40",children:(0,a.jsx)(f.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-3 pb-8 sm:px-6 sm:py-4 sm:pb-8",children:td?(0,a.jsxs)("div",{className:"space-y-5",children:[ts&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_10%,transparent)] px-4 py-3",children:(0,a.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"Conductor is already running locally. Finish setup here in the dashboard, then you can start using terminals and boards immediately."})}),(tl||ti)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Coding Agent"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select the default coding agent, review its setup state, and confirm which models Conductor can offer for it."}),(0,a.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:tu.map(e=>{let t=B===e,r=c[(0,R.q)(e)]??null,s=ea(e,es),n=(0,q.Ik)(e,es,x),o=n.slice(0,3),i=n.length-o.length,d=(0,M.f)(r),p=(0,M.y)(s);return(0,a.jsxs)("div",{className:`flex min-h-full flex-col gap-3 rounded-[4px] border px-3 py-3 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,a.jsx)(P.N,{seed:{label:e},className:"mt-0.5 h-5 w-5 border-none bg-transparent"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[13px] font-medium text-[var(--vk-text-normal)]",children:z(e)}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:d}),p?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:p}):null]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:r?.description??(0,E.h7)(e)?.description??"Agent metadata not available."}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[o.map(t=>(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:t.label},`${e}-${t.id}`)),i>0?(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:["+",i," more"]}):null,0===o.length?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:(0,l.Zz)(e)?"Models appear after setup":"Uses the agent default model"}):null]}),!r?.installed&&r?.installHint?(0,a.jsxs)("p",{className:"mt-2 text-[11px] text-[var(--vk-text-muted)]",children:["Install hint: ",(0,a.jsx)("code",{className:"rounded bg-[var(--vk-bg-main)] px-1.5 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:r.installHint})]}):null]})]}),(0,a.jsxs)("div",{className:"mt-auto flex shrink-0 items-center gap-2 self-start",children:[r?.ready?null:(0,a.jsx)("button",{type:"button",onClick:()=>{L(e),m(e)},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-panel)]",children:r?.installed?"Authenticate":"Install"}),(0,a.jsx)("button",{type:"button",onClick:()=>L(e),className:`inline-flex h-8 items-center rounded-[4px] border px-3 text-[12px] ${t?"border-[var(--vk-orange)] bg-[var(--vk-orange)]/12 text-[var(--vk-orange)]":"border-[var(--vk-border)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-panel)]"}`,children:t?"Selected":"Use this agent"}),t&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]},e)})})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Model Access"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Tell Conductor which account mode each agent is using so the model dropdown only shows options that make sense for that login path."})]}),(0,a.jsx)("div",{className:"grid gap-3",children:tu.filter(e=>{let t=(0,l.yM)(e);return(0,l.Zz)(e)&&(t?.accessOptions.length??0)>1}).map(e=>{let t=(0,l.yM)(e);if(!t)return null;let r=(0,l.Tk)(e,es)??t.defaultAccess;return(0,a.jsxs)("label",{className:"block rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsx)("span",{className:"mb-1 block text-[13px] font-medium text-[var(--vk-text-normal)]",children:t.label}),(0,a.jsx)("select",{value:r,onChange:t=>{var r;let a;return r=t.target.value,void((a=(0,l.yM)(e))&&en(e=>({...e,[a.accessKey]:r})))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:t.accessOptions.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.jsx)("p",{className:"mt-1.5 text-[11px] text-[var(--vk-text-muted)]",children:t.accessOptions.find(e=>e.id===r)?.description})]},e)})})]})]}),(tl||to)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Markdown Editor"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Used as your second-brain markdown source when feeding context into tasks."}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:K.map(e=>{let t=T===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>G(e.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(eo,{editorId:e.id}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)})}),"notion"!==T&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Notes Root"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:W??"",readOnly:!0,onClick:()=>e_(!0),placeholder:"Select your Obsidian vault, Logseq graph, or notes folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>e_(!0),disabled:e2,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Browse folders",children:(0,a.jsx)(j.A,{className:"h-4 w-4"})}),(W??"").trim().length>0&&(0,a.jsx)("button",{type:"button",onClick:()=>Z(""),disabled:e2,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:"Clear"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Context attachments are discovered from this folder first. Leave it blank to fall back to the current workspace."})]})}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Extra Filesystem Roots"}),(0,a.jsx)("textarea",{value:V,onChange:e=>Y(e.target.value),placeholder:"One absolute path per line\n/Applications\n/Users/Shared\n/mnt/projects",rows:5,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eO(!0),disabled:e2,className:"inline-flex h-9 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:[(0,a.jsx)(j.A,{className:"h-4 w-4"}),"Add folder"]}),(0,a.jsx)("button",{type:"button",onClick:()=>Y(""),disabled:e2||0===V.trim().length,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:"Clear list"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor exposes the current workspace, configured project roots, and any extra roots listed here by default. Add another root only when the operator folder picker should expose that explicit location on this machine."})]})}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:ee,onChange:e=>et(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent"}),(0,a.jsxs)("span",{className:"block",children:[(0,a.jsx)("span",{className:"block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Allow full home-directory browse"}),(0,a.jsx)("span",{className:"mt-1 block text-[12px] text-[var(--vk-text-muted)]",children:"Off by default. Enable this only when operator or admin sessions need to browse the full local home directory. Viewer sessions never get this access."}),(0,a.jsxs)("span",{className:"mt-1 block text-[11px] text-[var(--vk-text-dim)]",children:["Saved as ",(0,a.jsx)("code",{children:"preferences.allowHomeBrowse"})," in ",(0,a.jsx)("code",{children:"conductor.yaml"}),"."]})]})]})})]}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Notification Sound"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Pick a sound for notifications, or disable sound."}),(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[Q.map(e=>{let t=ed&&em===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>{ev(!0),eu(e.id),(0,$.$E)(e.id)},className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)}),(0,a.jsxs)("button",{type:"button",onClick:()=>ev(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!ed?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(H,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:"No sound"}),!ed&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]})]}):tn?(0,a.jsx)(O,{profile:eJ,loading:eK,error:e0,onRefresh:()=>{e7()}}):tc?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[24px] leading-[24px] text-[var(--vk-text-strong)]",children:ts?"Repository Defaults":"Repository Configuration"}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:ts?"Review the repository Conductor will use for this workspace. You can edit advanced scripts later from Settings.":"Configure scripts and defaults used whenever this repository is selected for workspaces."})]}),("settings"===t||eh.length>1)&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Select Repository"}),(0,a.jsxs)("select",{value:ew,onChange:e=>eC(e.target.value),disabled:eg||0===eh.length||e2,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===eh.length&&(0,a.jsx)("option",{value:"",children:"No repositories configured"}),eh.map(e=>(0,a.jsx)("option",{value:e.id,children:e.displayName},e.id))]})]}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository to view and edit its configuration."}),eg&&(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),ts&&1===eh.length&&eS&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Detected Repository"}),(0,a.jsxs)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.52)] px-3 py-3 text-[13px] text-[var(--vk-text-normal)]",children:[eS.displayName,(0,a.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:eS.path})]})]}),eS&&(0,a.jsxs)(a.Fragment,{children:["settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Repo-Preseed Bootstrap"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Use this when you already know the target repository and want one command to prefill it. The default first-run path is still `npx --yes --registry=https://registry.npmjs.org conductor-oss@latest`, which opens the dashboard and lets the user choose preferences before adding a project."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Workspace: ",eS.workspaceMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",eS.runtimeMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",eS.scmMode]})]}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.72)] p-3",children:(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[12px] leading-5 text-[var(--vk-text-normal)]",children:tj})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This command uses your selected agent, editor, and notes app. Best on macOS with Homebrew. GitHub sign-in still opens a browser so the user can approve access."}),(0,a.jsx)(ex,{value:tj,idleLabel:"Copy Setup Command"})]})]}),(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"General Settings"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure basic repository information."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Display Name"}),(0,a.jsx)("input",{value:eS.displayName,onChange:e=>eA(t=>t?{...t,displayName:e.target.value}:t),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"A friendly name for this repository."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Slug"}),(0,a.jsx)("input",{value:eS.repo,onChange:e=>eA(t=>t?{...t,repo:e.target.value}:t),placeholder:"e.g., your-org/your-repo",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used for PR tracking, GitHub links, and onboarding defaults."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Agent"}),(0,a.jsx)("select",{value:eS.agent,onChange:e=>{let t=e.target.value;eA(e=>e?{...e,agent:t}:e),eR((0,q.c0)(t,es,x,null))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:tu.map(e=>(0,a.jsx)("option",{value:e,children:z(e)},e))}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used by the one-line bootstrap and as the project default when tasks dispatch."})]}),(0,l.Zz)(eS.agent)&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsx)(ei,{agent:eS.agent,modelAccess:es,runtimeModelCatalogs:x,selection:eH,onChange:eR})}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Agent Permission Default"}),(0,a.jsxs)("select",{value:eS.agentPermissions,onChange:e=>eA(t=>t?{...t,agentPermissions:"skip"===e.target.value?"skip":"default"}:t),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:[(0,a.jsx)("option",{value:"default",children:"Agent default (approval prompts when supported)"}),(0,a.jsx)("option",{value:"skip",children:"Automatic mode (bypasses agent approval prompts)"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Applies to new sessions for this repository. Automatic mode grants the selected agent broad local execution authority and should only be used in trusted workspaces."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Path"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:eS.path,readOnly:!0,onClick:()=>eL(!0),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eL(!0),disabled:e2,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:(0,a.jsx)(j.A,{className:"h-4 w-4"})})]}),!eS.pathHealth.exists&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),eS.pathHealth.exists&&!eS.pathHealth.isGitRepository&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path exists but is not a git repository."}),eS.pathHealth.suggestedPath&&(0,a.jsx)("button",{type:"button",onClick:()=>{let e=eS.pathHealth.suggestedPath??"";e&&(eA(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),e9(e))},className:"mt-1 inline-flex h-7 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[11px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Use detected git repo path"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Working Directory"}),(0,a.jsx)("input",{value:eS.defaultWorkingDirectory,onChange:e=>eA(t=>t?{...t,defaultWorkingDirectory:e.target.value}:t),placeholder:"e.g., packages/frontend",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Subdirectory relative to the repository root where the coding agent starts."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Target Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:eS.defaultBranch,onChange:e=>eA(t=>t?{...t,defaultBranch:e.target.value}:t),placeholder:"Select a branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{e9()},disabled:eU,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Detect branches",children:eU?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"})})]}),eE.length>0&&(0,a.jsx)("select",{value:eS.defaultBranch,onChange:e=>eA(t=>t?{...t,defaultBranch:e.target.value}:t),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:eE.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),eM&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:eM})]})]}),"settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Scripts & Configuration"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure dev server, setup, cleanup, archive, and file-copy behavior for this repository."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server Script"}),(0,a.jsx)("textarea",{rows:3,value:eS.devServerScript,onChange:e=>eA(t=>t?{...t,devServerScript:e.target.value}:t),placeholder:"npm run dev",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Optional. Leave this blank if you run the local app yourself and only want Conductor to auto-connect the preview."})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server CWD"}),(0,a.jsx)("input",{value:eS.devServerCwd,onChange:e=>eA(t=>t?{...t,devServerCwd:e.target.value}:t),placeholder:"e.g., apps/web",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs the dev server from this subdirectory when set."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview URL Override"}),(0,a.jsx)("input",{value:eS.devServerUrl,onChange:e=>eA(t=>t?{...t,devServerUrl:e.target.value}:t),placeholder:"e.g., https://preview.example.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"If set, preview connects here first instead of inferring from logs."})]})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-4",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Port"}),(0,a.jsx)("input",{value:eS.devServerPort,onChange:e=>eA(t=>t?{...t,devServerPort:e.target.value}:t),inputMode:"numeric",placeholder:"3000",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Host"}),(0,a.jsx)("input",{value:eS.devServerHost,onChange:e=>eA(t=>t?{...t,devServerHost:e.target.value}:t),placeholder:"127.0.0.1",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Path"}),(0,a.jsx)("input",{value:eS.devServerPath,onChange:e=>eA(t=>t?{...t,devServerPath:e.target.value}:t),placeholder:"/",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:eS.devServerHttps,onChange:e=>eA(t=>t?{...t,devServerHttps:e.target.checked}:t),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Use HTTPS"})]})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Setup Script"}),(0,a.jsx)("textarea",{rows:4,value:eS.setupScript,onChange:e=>eA(t=>t?{...t,setupScript:e.target.value}:t),placeholder:"npm install",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs in the worktree after creation and before/with coding-agent startup."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:eS.runSetupInParallel,onChange:e=>eA(t=>t?{...t,runSetupInParallel:e.target.checked}:t),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Run setup script in parallel with coding agent"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cleanup Script"}),(0,a.jsx)("textarea",{rows:4,value:eS.cleanupScript,onChange:e=>eA(t=>t?{...t,cleanupScript:e.target.value}:t),placeholder:"Runs when the workspace is archived and changes exist",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Archive Script"}),(0,a.jsx)("textarea",{rows:4,value:eS.archiveScript,onChange:e=>eA(t=>t?{...t,archiveScript:e.target.value}:t),placeholder:"Runs when the workspace/session is archived",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Copy Files"}),(0,a.jsx)("input",{value:eS.copyFiles,onChange:e=>eA(t=>t?{...t,copyFiles:e.target.value}:t),placeholder:".env, config/*.json",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Comma-separated relative file paths or glob patterns copied from the repo to each worktree."})]})]})]})]}):tx?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_8%,transparent)] px-4 py-3",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Access Control"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"The dashboard stays bound to localhost by default. If you need access beyond the local machine, put a verified identity layer like Cloudflare Access or Clerk in front of it, then map authenticated users into viewer, operator, or admin roles here."})]}),ez?(0,a.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 animate-spin"}),"Loading organization access settings..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Current Identity"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:eq.current.email??"Anonymous local session"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Effective Role"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:eq.current.role??"No access"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Auth Provider"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:eq.current.provider??"Local only"})]})]}),!tm&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-4 py-3",children:(0,a.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"You can review organization security here, but only an admin session can save changes. Use a local admin session or an admin identity from your edge auth provider to modify access rules."})}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Baseline Access Rules"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Require authentication for remote dashboard requests and decide what authenticated users get by default before explicit role bindings are applied. Localhost on this machine stays in a local admin recovery mode so setup and break-glass access keep working."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:eq.requireAuth,onChange:e=>eI(t=>({...t,requireAuth:e.target.checked})),disabled:!tm||eW||eq.trustedHeaders.enabled,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Require authentication for remote dashboard requests"})]}),(0,a.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Unauthenticated public dashboard access is not supported. Use a verified identity provider such as Cloudflare Access or Clerk before exposing the dashboard beyond localhost."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Role"}),(0,a.jsxs)("select",{value:eq.defaultRole,onChange:e=>eI(t=>({...t,defaultRole:e.target.value})),disabled:!tm||eW,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[(0,a.jsx)("option",{value:"viewer",children:"Viewer"}),(0,a.jsx)("option",{value:"operator",children:"Operator"}),(0,a.jsx)("option",{value:"admin",children:"Admin"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"This applies after identity verification when no explicit email or domain binding matches. Cloudflare Access enterprise mode forces full authentication automatically."})]})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Verified Edge Auth"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Recommended for secure public phone access and free team collaboration. Conductor verifies the Cloudflare Access JWT instead of trusting a raw email header."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:eq.trustedHeaders.enabled,onChange:e=>eI(t=>({...t,requireAuth:!!e.target.checked||t.requireAuth,trustedHeaders:{...t.trustedHeaders,enabled:e.target.checked}})),disabled:!tm||eW,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Enable verified Cloudflare Access authentication"})]}),(0,a.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Provider"}),(0,a.jsx)("div",{className:"flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)]",children:"Cloudflare Access (verified JWT)"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Identity Email Header"}),(0,a.jsx)("input",{value:eq.trustedHeaders.emailHeader,onChange:e=>eI(t=>({...t,trustedHeaders:{...t.trustedHeaders,emailHeader:e.target.value}})),disabled:!tm||eW,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"JWT Assertion Header"}),(0,a.jsx)("input",{value:eq.trustedHeaders.jwtHeader,onChange:e=>eI(t=>({...t,trustedHeaders:{...t.trustedHeaders,jwtHeader:e.target.value}})),disabled:!tm||eW,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Team Domain"}),(0,a.jsx)("input",{value:eq.trustedHeaders.teamDomain,onChange:e=>eI(t=>({...t,trustedHeaders:{...t.trustedHeaders,teamDomain:e.target.value}})),disabled:!tm||eW,placeholder:"your-team.cloudflareaccess.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block lg:col-span-2",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Access Audience"}),(0,a.jsx)("input",{value:eq.trustedHeaders.audience,onChange:e=>eI(t=>({...t,trustedHeaders:{...t.trustedHeaders,audience:e.target.value}})),disabled:!tm||eW,placeholder:"Copy the AUD value from your Cloudflare Access application",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]})]}),(0,a.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Verified public dashboard access requires a Cloudflare Access application that injects a signed JWT and identity email header. Conductor will not trust a public request path when that verification layer is missing."})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Role Bindings"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Map verified team identities into least-privilege roles. `viewer` can inspect work, `operator` can control agents, and `admin` can change global settings."})]}),(0,a.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:[{label:"Viewer Emails",key:"viewers",placeholder:"alice@example.com"},{label:"Operator Emails",key:"operators",placeholder:"builder@example.com"},{label:"Admin Emails",key:"admins",placeholder:"owner@example.com"},{label:"Viewer Domains",key:"viewerDomains",placeholder:"guests.example.com"},{label:"Operator Domains",key:"operatorDomains",placeholder:"eng.example.com"},{label:"Admin Domains",key:"adminDomains",placeholder:"admins.example.com"}].map(({label:e,key:t,placeholder:r})=>(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:e}),(0,a.jsx)("textarea",{rows:4,value:eq.roles[t],onChange:e=>eI(r=>({...r,roles:{...r.roles,[t]:e.target.value}})),disabled:!tm||eW,placeholder:r,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"One entry per line."})]},t))})]})]})]}):(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h4",{className:"text-[16px] font-medium text-[var(--vk-text-strong)]",children:ta.label}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:"This section is queued for implementation. General, Agents, and repository settings are available now."}),(0,a.jsx)("button",{type:"button",onClick:()=>D("general"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open General"})]})}),(0,a.jsxs)("footer",{className:"flex flex-col gap-3 border-t border-[var(--vk-border)] px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-2",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[tf&&(0,a.jsx)("p",{className:"truncate rounded-[4px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-2 py-1 text-[12px] text-[var(--vk-red)]",children:tf}),!tf&&td&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:ts?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!tf&&tc&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:ts?"These defaults will be used the first time workspaces and tasks are created for this repo.":"Repository settings are saved to your conductor config and used for future workspaces."}),!tf&&tx&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Organization access settings are written into `conductor.yaml`. Use admin role bindings for full control, operator bindings for day-to-day agent usage, and viewer bindings for read-only access."}),!tf&&tn&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Profile details reflect the current dashboard identity. GitHub avatar and logout controls appear when this session is authenticated through Clerk."})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[!ts&&(0,a.jsx)("button",{type:"button",onClick:u,disabled:e2,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Close"}),ts&&tc&&(0,a.jsx)("button",{type:"button",onClick:()=>D("preferences"),disabled:e2,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),td&&!ts&&(0,a.jsx)("button",{type:"button",onClick:()=>{tN(o.onboardingAcknowledged,{closeDialog:!0})},disabled:!tb||r,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save"}),tc&&!ts&&(0,a.jsx)("button",{type:"button",onClick:()=>{e8()},disabled:!tg||ef||eg,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:ef?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Repository"}),tx&&!ts&&(0,a.jsx)("button",{type:"button",onClick:()=>{te()},disabled:!tk||eW,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:eW?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Access"}),ts&&(0,a.jsx)("button",{type:"button",onClick:()=>{tC()},disabled:!tb||e2,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Skip for now"}),ts&&(0,a.jsx)("button",{type:"button",onClick:()=>{tl?ty():tw()},disabled:tl?!tb||r||eg:!tg||e2,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:e2||tl&&eg?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),tl&&eg?"Loading...":"Saving..."]}):tl&&tv?"Continue":"Finish Setup"})]})]})]})]})}),(0,a.jsx)(ec,{open:eB,bridgeId:b,initialPath:eS?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>eL(!1),onSelect:e=>{eL(!1),e&&(eA(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),e9(e))}}),(0,a.jsx)(ec,{open:eF,bridgeId:b,initialPath:W??"",title:"Select Notes Root",description:"Choose the local Obsidian vault, Logseq graph, or markdown notes folder used for context attachments.",onClose:()=>e_(!1),onSelect:e=>{e_(!1),null!==e&&Z(e)}}),(0,a.jsx)(ec,{open:eT,bridgeId:b,title:"Add Filesystem Root",description:"Choose an extra folder root that should stay visible in the filesystem browser on this machine.",onClose:()=>eO(!1),onSelect:e=>{eO(!1),null!==e&&Y(t=>{let r=t.split(/\n+/g).map(e=>e.trim()).filter(Boolean);return r.includes(e)?r.join("\n"):[...r,e].join("\n")})}})]})}},88742:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])}}]);
@@ -1,3 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[81132],{81132:(e,t,r)=>{r.r(t),r.d(t,{ProjectNotesWorkspace:()=>ey});var a=r(54568),n=r(55096),s=r(7620),l=r(38874),o=r(28017),i=r(13932),c=r(1173),d=r(60616),x=r(31404),p=r(76050);function h(e){let t={name:"",path:"",isDirectory:!0,children:[]};for(let r of e){let e=r.displayPath.replace(/^\/+/,"").split("/").filter(Boolean);if(0===e.length)continue;let a=t,n="";for(let t=0;t<e.length;t+=1){let s=e[t];n=n?`${n}/${s}`:s;let l=t===e.length-1,o=a.children.find(e=>e.name===s&&e.isDirectory!==l);o||(o={name:s,path:l?r.path:n,isDirectory:!l,file:l?r:void 0,children:[]},a.children.push(o)),a=o}}let r=e=>{for(let t of(e.sort((e,t)=>e.isDirectory!==t.isDirectory?e.isDirectory?-1:1:e.name.localeCompare(t.name,void 0,{sensitivity:"base"})),e))t.children.length>0&&r(t.children)};return r(t.children),t.children}function u(e,t){let r=t.trim().toLowerCase();if(!r)return e;let a=e=>{let t=`${e.name} ${e.file?.displayPath??""}`.toLowerCase(),n=e.children.map(e=>a(e)).filter(e=>!!e);return t.includes(r)||n.length>0?{...e,children:n}:null};return e.map(e=>a(e)).filter(e=>!!e)}function m(e,t){let r=t.find(t=>t.path===e);if(r)return r.path;let a=t.find(t=>t.name===e||t.name===`${e}.md`);if(a)return a.path;let n=t.find(t=>t.displayPath===e);if(n)return n.path;let s=e.toLowerCase(),l=t.find(e=>e.name.toLowerCase()===s||e.name.toLowerCase()===`${s}.md`);if(l)return l.path;let o=t.find(e=>e.displayPath.toLowerCase().endsWith(`/${s}.md`)||e.displayPath.toLowerCase()===`${s}.md`);return o?o.path:null}var v=r(37812),b=r(58564),g=r(57770),f=r(99250),k=r(88742);function j({nodes:e,expandedFolders:t,selectedPath:r,onToggleFolder:n,onSelectFile:s,depth:l=0}){return(0,a.jsx)(a.Fragment,{children:e.map(e=>{let o=10+14*l;if(e.isDirectory){let i=t.has(e.path);return(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>n(e.path),className:"flex w-full items-center gap-1.5 py-1.5 text-left text-[12px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]",style:{paddingLeft:o},children:[i?(0,a.jsx)(v.A,{className:"h-3.5 w-3.5 shrink-0"}):(0,a.jsx)(b.A,{className:"h-3.5 w-3.5 shrink-0"}),i?(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-accent)]"}):(0,a.jsx)(g.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-accent)]"}),(0,a.jsx)("span",{className:"truncate",children:e.name})]}),i?(0,a.jsx)(j,{nodes:e.children,expandedFolders:t,selectedPath:r,onToggleFolder:n,onSelectFile:s,depth:l+1}):null]},`${e.path}-${e.name}`)}let i=r===e.path;return(0,a.jsxs)("button",{type:"button",onClick:()=>s(e.path),className:`flex w-full items-center gap-1.5 py-1.5 pr-2 text-left text-[12px] ${i?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"}`,style:{paddingLeft:o+18},children:[(0,a.jsx)(f.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"truncate",children:e.name})]},e.path)})})}function w({noteFiles:e,selectedPath:t,expandedFolders:r,onToggleFolder:n,onSelectFile:l,search:o,onSearchChange:i,editorLabel:c,tags:d,onTagClick:x,className:p}){let[m,g]=(0,s.useState)(!0),f=(0,s.useMemo)(()=>u(h(0===o.trim().length?e:e.filter(e=>`${e.displayPath} ${e.name} ${e.source??""}`.toLowerCase().includes(o.trim().toLowerCase()))),o),[e,o]),y=(0,s.useMemo)(()=>d?Object.entries(d).sort((e,t)=>t[1].length-e[1].length):[],[d]),N=(0,s.useMemo)(()=>new Set(r),[r]);return(0,a.jsxs)("aside",{className:`flex min-h-0 max-h-[min(42dvh,360px)] flex-col border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)]/35 xl:max-h-none xl:border-b-0 xl:border-r ${p??""}`.trim(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-3 py-2 text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{children:[e.length," note",1===e.length?"":"s"]}),(0,a.jsx)("span",{children:o.trim().length>0?"Filtered":c||"notes"})]}),(0,a.jsx)("div",{className:"border-b border-[var(--vk-border)] px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-2.5 py-1.5",children:[(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:o,onChange:e=>i(e.target.value),placeholder:"Search notes…",className:"min-w-0 flex-1 bg-transparent text-[12px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"})]})}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto overscroll-contain [-webkit-overflow-scrolling:touch] py-2",children:(0,a.jsx)(j,{nodes:f,expandedFolders:N,selectedPath:t,onToggleFolder:n,onSelectFile:l})}),y.length>0&&(0,a.jsxs)("div",{className:"border-t border-[var(--vk-border)]",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>g(!m),className:"flex w-full items-center gap-1.5 px-3 py-2 text-left text-[11px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]",children:[m?(0,a.jsx)(v.A,{className:"h-3 w-3 shrink-0"}):(0,a.jsx)(b.A,{className:"h-3 w-3 shrink-0"}),"Tags (",y.length,")"]}),m&&(0,a.jsx)("div",{className:"max-h-[160px] overflow-auto px-3 pb-2",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:y.map(([e,t])=>(0,a.jsxs)("button",{type:"button",onClick:()=>x?.(e),className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsxs)("span",{className:"text-[#f6c56f]",children:["#",e]}),(0,a.jsx)("span",{className:"text-[10px] opacity-60",children:t.length})]},e))})})]})]})}var y=r(96869),N=r(31550),C=r(27103),S=r(76839),A=r(96709),$=r(24774),L=r(37418),M=r(34307);let E="inline-flex min-h-[34px] items-center gap-1.5 rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",F="flex min-h-[36px] cursor-default items-center gap-2 rounded-[6px] px-3 text-[12px] text-[var(--vk-text-normal)] outline-none hover:bg-[var(--vk-bg-hover)] focus:bg-[var(--vk-bg-hover)] data-[disabled]:pointer-events-none data-[disabled]:opacity-45";function P({compact:e,viewMode:t,onViewModeChange:r}){return(0,a.jsx)("div",{className:"inline-flex rounded-[6px] border border-[var(--vk-border)] p-0.5 text-[12px]",children:(e?["edit","preview"]:["split","edit","preview"]).map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>r(e),className:`rounded-[4px] px-3 py-1.5 ${t===e?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"split"===e?"Split":"edit"===e?"Edit":"Preview"},e))})}function R({viewMode:e,onViewModeChange:t,onSave:r,onRefresh:n,onOpenExternally:s,onDailyNote:o,onToggleGraph:i,graphOpen:x,saving:p,dirty:h,indexLoading:u,opening:m,selectedFile:v,fileTruncated:b,editorName:g="editor",canSave:f=!0,compact:k=!1,onOpenFiles:j,onOpenShare:w}){let O=!v||!h||p||b;return(0,a.jsx)("div",{className:"border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)]/50 px-3 py-2 sm:px-4",children:k?(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:j,className:E,children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5"}),"Files"]}),(0,a.jsx)(P,{compact:k,viewMode:e,onViewModeChange:t}),(0,a.jsxs)("button",{type:"button",onClick:i,className:`inline-flex min-h-[34px] items-center gap-1.5 rounded-[6px] border px-3 text-[12px] hover:bg-[var(--vk-bg-hover)] ${x?"border-[var(--vk-accent)] bg-[rgba(139,92,246,0.12)] text-[var(--vk-accent)]":"border-[var(--vk-border)] text-[var(--vk-text-normal)]"}`,children:[(0,a.jsx)(N.A,{className:"h-3.5 w-3.5"}),"Graph"]}),(0,a.jsxs)(y.bL,{children:[(0,a.jsx)(y.l9,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",className:E,children:[(0,a.jsx)(C.A,{className:"h-3.5 w-3.5"}),"More"]})}),(0,a.jsx)(y.ZL,{children:(0,a.jsxs)(y.UC,{align:"end",sideOffset:8,className:"z-[120] min-w-[190px] rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-1 shadow-[0_20px_48px_rgba(0,0,0,0.35)]",children:[(0,a.jsxs)(y.q7,{onSelect:n,className:F,disabled:u,children:[u?(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),"Refresh"]}),f?(0,a.jsxs)(y.q7,{onSelect:r,className:F,disabled:O,children:[p?(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(A.A,{className:"h-3.5 w-3.5"}),"Save"]}):null,(0,a.jsxs)(y.q7,{onSelect:s,className:F,disabled:!v||m,children:[m?(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)($.A,{className:"h-3.5 w-3.5"}),"Open in ",g]}),(0,a.jsxs)(y.q7,{onSelect:o,className:F,children:[(0,a.jsx)(L.A,{className:"h-3.5 w-3.5"}),"Today"]}),(0,a.jsxs)(y.q7,{onSelect:w,className:F,children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5"}),"Share note"]})]})})]}),h?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[12px] text-[#f6c56f]",children:[(0,a.jsx)(M.A,{className:"h-3.5 w-3.5"}),"Unsaved"]}):null]}):(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(P,{compact:k,viewMode:e,onViewModeChange:t}),(0,a.jsxs)("button",{type:"button",onClick:n,disabled:u,className:E,children:[u?(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),"Refresh"]}),f?(0,a.jsxs)("button",{type:"button",onClick:r,disabled:O,className:E,children:[p?(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(A.A,{className:"h-3.5 w-3.5"}),"Save"]}):null,(0,a.jsxs)("button",{type:"button",onClick:s,disabled:!v||m,className:E,children:[m?(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)($.A,{className:"h-3.5 w-3.5"}),"Open in ",g]}),(0,a.jsxs)("button",{type:"button",onClick:o,className:E,children:[(0,a.jsx)(L.A,{className:"h-3.5 w-3.5"}),"Today"]}),(0,a.jsxs)("button",{type:"button",onClick:i,className:`inline-flex min-h-[34px] items-center gap-1.5 rounded-[6px] border px-3 text-[12px] hover:bg-[var(--vk-bg-hover)] ${x?"border-[var(--vk-accent)] bg-[rgba(139,92,246,0.12)] text-[var(--vk-accent)]":"border-[var(--vk-border)] text-[var(--vk-text-normal)]"}`,children:[(0,a.jsx)(N.A,{className:"h-3.5 w-3.5"}),"Graph"]}),h?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[12px] text-[#f6c56f]",children:[(0,a.jsx)(M.A,{className:"h-3.5 w-3.5"}),"Unsaved"]}):null]})})}var O=r(35144),T=r(80714),_=r(75910),D=r(29684),I=r(74975),z=r(42136);let U=T.NZ.mark({class:"cm-wikilink",attributes:{style:"background-color: rgba(139, 92, 246, 0.15); border-radius: 3px; padding: 1px 3px; cursor: pointer; color: #cdb4ff;"}}),B=T.NZ.mark({class:"cm-tag",attributes:{style:"background-color: rgba(248, 147, 30, 0.12); border-radius: 3px; padding: 1px 3px; color: #f6c56f;"}});function Z(e){let t=new O.vB,r=e.doc.toString().split("\n"),a=0,n=[];for(let e=0;e<r.length;e++){let t,s=r[e],l=/\[\[([^\]]+)\]\]/g;for(;null!==(t=l.exec(s));){let e=a+t.index,r=e+t[0].length;n.push({from:e,to:r,deco:U})}let o=/(^|[\s(])(#[a-zA-Z][\w/-]*)/g;for(;null!==(t=o.exec(s));){let e=t[2];if(""===t[1]&&0===t.index&&s.substring(t.index+1).startsWith(" "))continue;let r=a+t.index+t[1].length,l=r+e.length;n.push({from:r,to:l,deco:B})}a+=s.length+1}for(let{from:e,to:r,deco:a}of(n.sort((e,t)=>e.from-t.from),n))t.add(e,r,a);return t.finish()}let W=T.Z9.fromClass(class{constructor(e){this.decorations=Z(e.state)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=Z(e.state))}},{decorations:e=>e.decorations}),q=T.Lz.theme({"&":{height:"100%",fontSize:"13px"},".cm-content":{fontFamily:"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace",padding:"16px 0",caretColor:"var(--vk-accent)",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"var(--vk-accent)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(139, 92, 246, 0.25) !important"},".cm-gutters":{backgroundColor:"transparent",color:"var(--vk-text-muted)",border:"none",paddingRight:"8px"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"var(--vk-text-normal)"},".cm-activeLine":{backgroundColor:"rgba(255,255,255,0.03)"},".cm-line":{padding:"0 16px"},".cm-placeholder":{color:"var(--vk-text-muted)",fontStyle:"italic",padding:"0 16px"}});function Y({value:e,onChange:t,readOnly:r=!1,placeholder:n="Select a note to start editing",onWikilinkClick:l,onSave:o,onQuickSwitch:i}){let c=(0,s.useRef)(null),d=(0,s.useRef)(null),x=(0,s.useRef)(t),p=(0,s.useRef)(o),h=(0,s.useRef)(i),u=(0,s.useRef)(l),m=(0,s.useRef)(new O.xx);x.current=t,p.current=o,h.current=i,u.current=l;let v=(0,s.useCallback)(()=>(p.current?.(),!0),[]),b=(0,s.useCallback)(()=>(h.current?.(),!0),[]);return(0,s.useEffect)(()=>{if(!c.current)return;let t="u">typeof navigator&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent)?"Meta":"Control",a=O.$t.create({doc:e,extensions:[q,(0,T.$K)(),(0,T.Wu)(),(0,T.N$)(),(0,I.b6)(),(0,T.VH)(),O.$t.allowMultipleSelections.of(!0),m.current.of(O.$t.readOnly.of(r)),(0,z.SG)(),(0,T.dz)(),(0,_.markdown)({base:_.markdownLanguage,codeLanguages:D.e}),W,T.Lz.updateListener.of(e=>{e.docChanged&&x.current(e.state.doc.toString())}),T.Lz.domEventHandlers({click(e,t){let r,a=t.posAtCoords(e);if(null==a)return!1;let n=t.state.doc.lineAt(a),s=n.text,l=a-n.from,o=/\[\[([^\]]+)\]\]/g;for(;null!==(r=o.exec(s));){let e=r.index,t=e+r[0].length;if(l>=e&&l<=t)return u.current?.(r[1].trim()),!0}return!1}}),T.w4.of([...I.pw,...I.cL,{key:`${t}-s`,run:()=>v(),preventDefault:!0},{key:`${t}-k`,run:()=>b(),preventDefault:!0}]),T.Lz.lineWrapping,n?(0,T.qf)(n):[]]}),s=new T.Lz({state:a,parent:c.current});return d.current=s,()=>{s.destroy(),d.current=null}},[]),(0,s.useEffect)(()=>{let t=d.current;if(!t)return;let r=t.state.doc.toString();r!==e&&t.dispatch({changes:{from:0,to:r.length,insert:e}})},[e]),(0,s.useEffect)(()=>{let e=d.current;e&&e.dispatch({effects:m.current.reconfigure(O.$t.readOnly.of(r))})},[r]),(0,a.jsx)("div",{ref:c,className:"h-full min-h-0 w-full bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)]"})}var G=r(8281),J=r(1426);function V(e,t,r){let n,s=[],l=/(\[\[([^\]]+)\]\])|(#([a-zA-Z][\w/-]*))/g,o=0,i=0;for(;null!==(n=l.exec(e));){if(n.index>o&&s.push(e.slice(o,n.index)),n[1]){let e=n[2].trim(),l=!(r?m(e,r):null);s.push((0,a.jsx)("span",{onClick:r=>{r.preventDefault(),r.stopPropagation(),t?.(e)},style:{backgroundColor:l?"rgba(255, 143, 122, 0.12)":"rgba(139, 92, 246, 0.15)",borderRadius:"3px",padding:"1px 5px",cursor:"pointer",color:l?"var(--vk-red, #ff8f7a)":"#cdb4ff",fontSize:"0.9em"},children:e},`wl-${i++}`))}else if(n[3]){let t=n[3],r=n.index>0?e[n.index-1]:"\n";if((0===n.index||"\n"===r)&&" "===e[n.index+t.length])s.push(t);else{let e=n[4];s.push((0,a.jsxs)("span",{onClick:e=>{e.preventDefault(),e.stopPropagation()},style:{backgroundColor:"rgba(248, 147, 30, 0.12)",borderRadius:"3px",padding:"1px 5px",cursor:"pointer",color:"#f6c56f",fontSize:"0.85em"},children:["#",e]},`tag-${i++}`))}}o=n.index+n[0].length}return o<e.length&&s.push(e.slice(o)),s.length>0?s:[e]}function X({content:e,onWikilinkClick:t,noteFiles:r}){let n=(0,s.useMemo)(()=>e.trim()?e:"",[e]);return e.trim()?(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto bg-[var(--vk-bg-panel)]/25 px-4 py-4",children:(0,a.jsx)("article",{className:"prose prose-invert max-w-none text-[14px] leading-7 text-[var(--vk-text-normal)] prose-headings:text-[var(--vk-text-strong)] prose-strong:text-[var(--vk-text-strong)] prose-code:text-[var(--vk-accent)] prose-pre:bg-[var(--vk-bg-main)] prose-blockquote:border-l-[var(--vk-accent)] prose-blockquote:text-[var(--vk-text-muted)]",children:(0,a.jsx)(G.o,{remarkPlugins:[J.A],components:{p:({children:e,...n})=>(0,a.jsx)("p",{...n,children:H(e,t,r)}),li:({children:e,...n})=>(0,a.jsx)("li",{...n,children:H(e,t,r)})},children:n})})}):(0,a.jsx)("div",{className:"flex h-full min-h-[240px] items-center justify-center text-center text-[13px] text-[var(--vk-text-muted)]",children:"Markdown preview will appear here once the note has content."})}function H(e,t,r){if("string"==typeof e){let n=V(e,t,r);return 1===n.length?n[0]:(0,a.jsx)(a.Fragment,{children:n})}return Array.isArray(e)?e.map((e,n)=>{if("string"==typeof e){let s=V(e,t,r);return 1===s.length?(0,a.jsx)("span",{children:s[0]},n):(0,a.jsx)("span",{children:s},n)}return e}):e}function K({projectId:e,bridgeId:t,notePath:r,onNavigate:n}){let[l,o]=(0,s.useState)([]),[i,c]=(0,s.useState)(!1),[d,p]=(0,s.useState)(null),[h,u]=(0,s.useState)(!0),m=(0,s.useCallback)(async()=>{if(!r)return void o([]);c(!0),p(null);try{let a=new URLSearchParams({projectId:e,path:r}),n=await fetch((0,x.S)(`/api/project-notes/backlinks?${a.toString()}`,t),{cache:"no-store"}),s=await n.json().catch(()=>null);if(!n.ok)throw Error(s&&"error"in s?s.error??"Failed to load backlinks":`Failed to load backlinks (${n.status})`);o(s?.backlinks??[])}catch(e){p(e instanceof Error?e.message:"Failed to load backlinks"),o([])}finally{c(!1)}},[t,r,e]);return((0,s.useEffect)(()=>{m()},[m]),r&&(0!==l.length||i))?(0,a.jsxs)("div",{className:"border-t border-[var(--vk-border)] bg-[var(--vk-bg-panel)]/20",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>u(!h),className:"flex w-full items-center gap-2 px-4 py-2 text-left text-[12px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]",children:[h?(0,a.jsx)(v.A,{className:"h-3.5 w-3.5 shrink-0"}):(0,a.jsx)(b.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,a.jsx)("span",{className:"font-medium",children:"Linked References"}),(0,a.jsx)("span",{className:"rounded-full bg-[var(--vk-bg-main)] px-2 py-0.5 text-[11px]",children:l.length}),i&&(0,a.jsx)("span",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"loading…"})]}),h&&(0,a.jsxs)("div",{className:"max-h-[240px] overflow-auto px-4 pb-3",children:[d&&(0,a.jsx)("p",{className:"py-2 text-[12px] text-[var(--vk-red)]",children:d}),l.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>n(e.path),className:"flex w-full items-start gap-2 rounded-[4px] px-2 py-2 text-left hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(f.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-[12px] text-[var(--vk-text-normal)]",children:e.name||e.displayPath}),e.context&&(0,a.jsx)("p",{className:"mt-0.5 line-clamp-2 text-[11px] leading-4 text-[var(--vk-text-muted)]",children:e.context})]})]},e.path))]})]}):null}function Q({open:e,onOpenChange:t,files:r,onSelect:l,recentPaths:o=[]}){let[i,c]=(0,s.useState)(""),[d,x]=(0,s.useState)(0),p=(0,s.useRef)(null),h=(0,s.useRef)(null);(0,s.useEffect)(()=>{e&&(c(""),x(0),requestAnimationFrame(()=>{p.current?.focus()}))},[e]);let u=(0,s.useMemo)(()=>{if(0===i.trim().length){let e=o.map(e=>r.find(t=>t.path===e)).filter(e=>null!=e);return e.length>0?e:r}let e=r.map(e=>e.displayPath);return(function(e,t){let r=e.toLowerCase(),a=[];for(let e of t){let t=e.toLowerCase(),n=0,s=0;if(t.includes(r))n=100-t.indexOf(r);else{for(let e=0;e<t.length&&s<r.length;e++)t[e]===r[s]&&(n+=1,s+=1);if(s<r.length)continue}a.push({item:e,score:n})}return a.sort((e,t)=>t.score-e.score),a})(i.trim(),e).map(e=>r.find(t=>t.displayPath===e.item)).filter(e=>null!=e).slice(0,20)},[i,r,o]);(0,s.useEffect)(()=>{x(0)},[i]);let m=(0,s.useCallback)(e=>{l(e),t(!1)},[l,t]),v=(0,s.useCallback)(e=>{"ArrowDown"===e.key?(e.preventDefault(),x(e=>Math.min(e+1,u.length-1))):"ArrowUp"===e.key?(e.preventDefault(),x(e=>Math.max(e-1,0))):"Enter"===e.key&&(e.preventDefault(),u[d]&&m(u[d].path))},[u,d,m]);return(0,s.useEffect)(()=>{let e=h.current?.querySelector(`[data-index="${d}"]`);e?.scrollIntoView({block:"nearest"})},[d]),(0,a.jsx)(n.bL,{open:e,onOpenChange:t,children:(0,a.jsxs)(n.ZL,{children:[(0,a.jsx)(n.hJ,{className:"fixed inset-0 z-50 bg-black/50"}),(0,a.jsxs)(n.UC,{className:"fixed left-1/2 top-[20%] z-50 w-full max-w-lg -translate-x-1/2 rounded-[12px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_20px_48px_rgba(0,0,0,0.3)]",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)(k.A,{className:"h-4 w-4 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{ref:p,value:i,onChange:e=>c(e.target.value),onKeyDown:v,placeholder:"Search notes by name…",className:"min-w-0 flex-1 bg-transparent text-[14px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"}),(0,a.jsx)("kbd",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-1.5 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"Esc"})]}),(0,a.jsx)("div",{ref:h,className:"max-h-[320px] overflow-auto py-1",children:0===u.length?(0,a.jsx)("div",{className:"px-4 py-6 text-center text-[13px] text-[var(--vk-text-muted)]",children:"No notes found"}):u.map((e,t)=>(0,a.jsxs)("button",{type:"button","data-index":t,onClick:()=>m(e.path),onMouseEnter:()=>x(t),className:`flex w-full items-center gap-2.5 px-4 py-2 text-left text-[13px] ${t===d?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(f.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"truncate",children:e.displayPath})]},e.path))}),(0,a.jsxs)("div",{className:"flex items-center gap-4 border-t border-[var(--vk-border)] px-4 py-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)("span",{children:"↑↓ Navigate"}),(0,a.jsx)("span",{children:"↵ Open"}),(0,a.jsx)("span",{children:"Esc Close"})]})]})]})})}var ee=r(39514),et=r(57505),er=r(59410),ea=r(80031),en=r(2636),es=r(31489),el=r(21207),eo=r(58212),ei=r(3368),ec=r(62633),ed=r(52904),ex=r(16975);let ep=["#8b5cf6","#14b8a6","#f59e0b","#ef4444","#22c55e","#ec4899","#3b82f6","#f97316"];function eh(e,t){return new Set(Array.from(e).filter(e=>t.has(e)))}function eu(e,t,r){if(!e.nodesById.has(t))return new Set;let a=Math.max(0,Math.floor(r)),n=new Set([t]),s=[{id:t,depth:0}];for(;s.length>0;){let t=s.shift();if(t&&!(t.depth>=a))for(let r of Array.from(e.adjacency.get(t.id)??[]))n.has(r)||(n.add(r),s.push({id:r,depth:t.depth+1}))}return n}function em(e,t){let r=t.search.trim().toLowerCase(),a=new Set(e.nodes.map(e=>e.id));if(t.activeGroupId){let r=new Set(e.nodes.filter(e=>e.folder===t.activeGroupId).map(e=>e.id));a=eh(a,r)}if(r.length>0){let t=e.nodes.filter(e=>[e.name,e.displayPath,e.folder,...e.tags].join(" ").toLowerCase().includes(r)).map(e=>e.id),n=new Set;for(let r of t)for(let t of Array.from(eu(e,r,1)))n.add(t);a=eh(a,n)}if(t.localRootId){let r=eu(e,t.localRootId,t.localDepth);a=eh(a,r)}let n=e.edges.filter(e=>a.has(e.source)&&a.has(e.target));return t.showOrphans||(a=new Set(Array.from(a).filter(r=>!!t.localRootId&&r===t.localRootId||e.nodesById.get(r)?.isOrphan===!1)),n=n.filter(e=>a.has(e.source)&&a.has(e.target))),{nodes:e.nodes.filter(e=>a.has(e.id)).sort((e,t)=>t.degree-e.degree||e.displayPath.localeCompare(t.displayPath)),edges:n}}let ev="h-1.5 w-full cursor-pointer accent-[var(--vk-accent)]";function eb(e,t,r){return Math.min(r,Math.max(t,e))}function eg(e,t,r){if(0===e.length||t<=0||r<=0)return{x:0,y:0,k:1};let a=1/0,n=-1/0,s=1/0,l=-1/0;for(let t of e)a=Math.min(a,t.x),n=Math.max(n,t.x),s=Math.min(s,t.y),l=Math.max(l,t.y);let o=.12*Math.min(t,r),i=eb(Math.min((t-o)/Math.max(n-a,120),(r-o)/Math.max(l-s,120)),.32,2.4);return{x:-((a+n)/2*i),y:-((s+l)/2*i),k:i}}function ef(e,t){return eb(t+1.1*e.degree,5,24)}function ek({projectId:e,bridgeId:t,onNavigate:r,noteFiles:n,selectedPath:l=null}){let o=(0,s.useRef)(null),i=(0,s.useRef)(!1),c=(0,s.useRef)(null),[d,p]=(0,s.useState)([]),[h,u]=(0,s.useState)([]),[m,v]=(0,s.useState)(!1),[b,g]=(0,s.useState)(null),[f,j]=(0,s.useState)(null),[w,y]=(0,s.useState)(l),[C,S]=(0,s.useState)(!0),[A,$]=(0,s.useState)(""),[L,M]=(0,s.useState)(null),[E,F]=(0,s.useState)(!1),[P,R]=(0,s.useState)(1),[O,T]=(0,s.useState)(!0),[_,D]=(0,s.useState)(!0),[I,z]=(0,s.useState)(!1),[U,B]=(0,s.useState)(7),[Z,W]=(0,s.useState)(1.15),[q,Y]=(0,s.useState)(120),[G,J]=(0,s.useState)(220),[V,X]=(0,s.useState)(.09),[H,K]=(0,s.useState)({x:0,y:0,k:1}),[Q,eh]=(0,s.useState)({width:0,height:0}),ej=(0,s.useCallback)(async()=>{v(!0),g(null);try{let r=new URLSearchParams({projectId:e}),a=await fetch((0,x.S)(`/api/project-notes/graph?${r.toString()}`,t),{cache:"no-store"}),n=await a.json().catch(()=>null);if(!a.ok)throw Error(n&&"error"in n?n.error??"Failed to load graph":`Failed to load graph (${a.status})`);p(n.nodes??[]),u(n.edges??[])}catch(e){g(e instanceof Error?e.message:"Failed to load graph"),p([]),u([])}finally{v(!1)}},[t,e]);(0,s.useEffect)(()=>{ej()},[ej]),(0,s.useEffect)(()=>{l&&y(l)},[l]),(0,s.useEffect)(()=>{let e=o.current;if(!e)return;let t=()=>{eh({width:e.clientWidth,height:e.clientHeight})};t();let r="u"<typeof ResizeObserver?null:new ResizeObserver(t);return r?.observe(e),()=>r?.disconnect()},[]),(0,s.useEffect)(()=>{if(i.current||Q.width<=0)return;let e=Q.width<960;S(!e),T(!e),i.current=!0},[Q.width]);let ew=(0,s.useMemo)(()=>(function(e,t,r){let a=new Map(r.map(e=>[e.path,e])),n=new Map,s=new Map,l=new Map,o=[],i=new Set;for(let t of e){let e=a.get(t.id),r=e?.displayPath??t.name,o=r.replace(/^\/+/,"").split("/").find(e=>e.trim().length>0)??"root",i={id:t.id,name:t.name,displayPath:r,source:e?.source??null,folder:o,tags:t.tags??[],degree:0,isOrphan:!0};n.set(i.id,i),s.set(i.id,new Set),l.set(o,(l.get(o)??0)+1)}for(let e of t){if(!n.has(e.source)||!n.has(e.target))continue;let t=`${e.source}->${e.target}`;i.has(t)||(i.add(t),o.push({id:t,source:e.source,target:e.target}),s.get(e.source)?.add(e.target),s.get(e.target)?.add(e.source))}return{nodes:Array.from(n.values()).map(e=>{let t=s.get(e.id)?.size??0,r={...e,degree:t,isOrphan:0===t};return n.set(e.id,r),r}),edges:o,nodesById:n,adjacency:s,groups:Array.from(l.entries()).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t],r)=>({id:e,label:"root"===e?"Root":e.split(/[-_]/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),count:t,color:ep[r%ep.length]}))}})(d,h,n),[n,h,d]),ey=(0,s.useMemo)(()=>new Map(ew.groups.map(e=>[e.id,e.color])),[ew.groups]),eN=(0,s.useMemo)(()=>em(ew,{search:A,showOrphans:_,activeGroupId:L,localRootId:null,localDepth:P}),[L,ew,P,A,_]),eC=(0,s.useMemo)(()=>E?w&&eN.nodes.some(e=>e.id===w)?w:l&&eN.nodes.some(e=>e.id===l)?l:eN.nodes[0]?.id??null:null,[w,E,eN.nodes,l]),eS=(0,s.useMemo)(()=>E&&eC?em(ew,{search:A,showOrphans:_,activeGroupId:L,localRootId:eC,localDepth:P}):eN,[L,eC,ew,P,E,eN,A,_]);(0,s.useEffect)(()=>{if(!(w&&eS.nodes.some(e=>e.id===w))){if(l&&eS.nodes.some(e=>e.id===l))return void y(l);y(eS.nodes[0]?.id??null)}},[w,l,eS.nodes]);let eA=f??w??eC,e$=(0,s.useMemo)(()=>eA?eu(ew,eA,1):null,[eA,ew]),eL=(0,s.useMemo)(()=>{let e=new Map(ew.groups.map((e,t)=>[e.id,t])),t=Math.max(ew.groups.length,1),r=eS.nodes.map((r,a)=>{let n=(e.get(r.folder)??0)/t*Math.PI*2+a%9*.37,s=180+a%11*16;return{...r,x:Math.cos(n)*s,y:Math.sin(n)*s}}),a=eS.edges.map(e=>({id:e.id,source:e.source,target:e.target})),n=(0,ee.A)(r).force("link",(0,et.A)(a).id(e=>e.id).distance(q).strength(.32)).force("charge",(0,er.A)().strength(-G)).force("center-x",(0,ea.A)(0).strength(V)).force("center-y",(0,en.A)(0).strength(V)).force("collide",(0,es.A)(e=>ef(e,U)+8)).stop();for(let e=0;e<220;e+=1)n.tick();let s=a.map(e=>{let t="object"==typeof e.source?e.source:r.find(t=>t.id===e.source),a="object"==typeof e.target?e.target:r.find(t=>t.id===e.target);return t&&a?{id:e.id,source:t.id,target:a.id}:null}).filter(e=>null!==e);return{nodes:r,edges:s}},[V,ew.groups,q,U,G,eS.edges,eS.nodes]);(0,s.useEffect)(()=>{K(eg(eL.nodes,Q.width,Q.height))},[eL.nodes,Q.height,Q.width]);let eM=(0,s.useMemo)(()=>new Set(eS.nodes.filter(e=>{let t;return!!(t=A.trim().toLowerCase())&&[e.name,e.displayPath,e.folder,...e.tags].join(" ").toLowerCase().includes(t)}).map(e=>e.id)),[A,eS.nodes]),eE=eL.nodes.find(e=>e.id===w)??null,eF=eL.nodes.length,eP=eL.edges.length,eR=Q.width>0&&Q.width<960,eO=eR?1.32:.9,eT=(0,s.useCallback)((e,t,r)=>{K(a=>{let n=eb(e,.28,3.4),s=o.current;if(!s)return{...a,k:n};let l=s.getBoundingClientRect(),i=null==t?l.width/2:t-l.left,c=null==r?l.height/2:r-l.top,d=l.width/2,x=l.height/2,p=(i-d-a.x)/a.k,h=(c-x-a.y)/a.k;return{x:i-d-p*n,y:c-x-h*n,k:n}})},[]),e_=(0,s.useCallback)(e=>{e.preventDefault(),eT(e.deltaY>0?.9*H.k:1.1*H.k,e.clientX,e.clientY)},[H.k,eT]),eD=(0,s.useCallback)(e=>{(0===e.button||"touch"===e.pointerType)&&(c.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,originX:H.x,originY:H.y},e.currentTarget.setPointerCapture(e.pointerId))},[H.x,H.y]),eI=(0,s.useCallback)(e=>{let t=c.current;t&&t.pointerId===e.pointerId&&K(r=>({...r,x:t.originX+(e.clientX-t.startX),y:t.originY+(e.clientY-t.startY)}))},[]),ez=(0,s.useCallback)(e=>{let t=c.current;t&&t.pointerId===e.pointerId&&(c.current=null,e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]);return m?(0,a.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(el.A,{className:"h-4 w-4 animate-pulse text-[var(--vk-accent)]"}),"Loading graph…"]}):b?(0,a.jsx)("div",{className:"flex h-full items-center justify-center px-4 text-center text-[13px] text-[var(--vk-red)]",children:b}):(0,a.jsxs)("div",{className:"flex h-full min-h-[min(560px,70dvh)] flex-col overflow-hidden bg-[var(--vk-bg-main)] xl:min-h-0",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Obsidian-style graph"}),(0,a.jsxs)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:[eF," visible notes, ",eP," visible links"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>S(e=>!e),className:"inline-flex min-h-[32px] items-center gap-1.5 rounded-[6px] border border-[var(--vk-border)] px-2.5 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(eo.A,{className:"h-3.5 w-3.5"}),"Settings"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>void ej(),className:"inline-flex min-h-[32px] items-center gap-1.5 rounded-[6px] border border-[var(--vk-border)] px-2.5 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(N.A,{className:"h-3.5 w-3.5"}),"Refresh"]})]})]}),(0,a.jsxs)("div",{className:"grid min-h-0 flex-1 gap-3 overflow-hidden p-3 xl:grid-cols-[320px_minmax(0,1fr)]",children:[C?(0,a.jsxs)("aside",{className:"rounded-[14px] border border-[color:rgba(148,163,184,0.16)] bg-[linear-gradient(180deg,rgba(15,23,42,0.88),rgba(2,6,23,0.96))] shadow-[0_26px_80px_rgba(2,6,23,0.45)] backdrop-blur-sm min-h-0 overflow-auto px-4 py-4",children:[(0,a.jsxs)("section",{children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:"Search files"}),(0,a.jsxs)("label",{className:"mt-2 flex items-center gap-2 rounded-[10px] border border-[color:rgba(148,163,184,0.16)] bg-black/20 px-3 py-2",children:[(0,a.jsx)(k.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:A,onChange:e=>$(e.target.value),placeholder:"Search files, folders, or tags",className:"min-w-0 flex-1 bg-transparent text-[13px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"})]})]}),(0,a.jsxs)("section",{className:"mt-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:"Groups"}),L?(0,a.jsx)("button",{type:"button",onClick:()=>M(null),className:"text-[11px] text-[var(--vk-accent)] hover:underline",children:"Clear"}):null]}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:ew.groups.map(e=>{let t=L===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>M(t?null:e.id),className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[11px] ${t?"border-[var(--vk-accent)] bg-[rgba(139,92,246,0.16)] text-[var(--vk-text-strong)]":"border-[color:rgba(148,163,184,0.16)] bg-black/20 text-[var(--vk-text-muted)] hover:bg-[rgba(255,255,255,0.04)]"}`,children:[(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:e.color}}),(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("span",{className:"opacity-70",children:e.count})]},e.id)})})]}),(0,a.jsxs)("section",{className:"mt-5 space-y-3",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:"Local graph"}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-[10px] border border-[color:rgba(148,163,184,0.16)] bg-black/20 px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("span",{children:"Focus on the active note neighborhood"}),(0,a.jsx)("input",{checked:E,onChange:e=>F(e.target.checked),type:"checkbox",className:"h-4 w-4 accent-[var(--vk-accent)]"})]}),(0,a.jsxs)("label",{className:"block text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"Depth"}),(0,a.jsx)("span",{children:P})]}),(0,a.jsx)("input",{type:"range",min:1,max:4,step:1,value:P,onChange:e=>R(Number(e.target.value)),className:`${ev} mt-2`})]}),(0,a.jsx)("p",{className:"rounded-[10px] border border-[color:rgba(148,163,184,0.12)] bg-black/10 px-3 py-2 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:eC?`Rooting around ${ew.nodesById.get(eC)?.displayPath??eC}.`:"Pick a note to use local graph depth controls."})]}),(0,a.jsxs)("section",{className:"mt-5 space-y-3",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:"Display"}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-[10px] border border-[color:rgba(148,163,184,0.16)] bg-black/20 px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("span",{children:"Labels"}),(0,a.jsx)("input",{checked:O,onChange:e=>T(e.target.checked),type:"checkbox",className:"h-4 w-4 accent-[var(--vk-accent)]"})]}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-[10px] border border-[color:rgba(148,163,184,0.16)] bg-black/20 px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("span",{children:"Arrows"}),(0,a.jsx)("input",{checked:I,onChange:e=>z(e.target.checked),type:"checkbox",className:"h-4 w-4 accent-[var(--vk-accent)]"})]}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-[10px] border border-[color:rgba(148,163,184,0.16)] bg-black/20 px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("span",{children:"Show orphans"}),(0,a.jsx)("input",{checked:_,onChange:e=>D(e.target.checked),type:"checkbox",className:"h-4 w-4 accent-[var(--vk-accent)]"})]}),(0,a.jsxs)("label",{className:"block text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"Node size"}),(0,a.jsx)("span",{children:U.toFixed(0)})]}),(0,a.jsx)("input",{type:"range",min:5,max:14,step:1,value:U,onChange:e=>B(Number(e.target.value)),className:`${ev} mt-2`})]}),(0,a.jsxs)("label",{className:"block text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"Link thickness"}),(0,a.jsx)("span",{children:Z.toFixed(1)})]}),(0,a.jsx)("input",{type:"range",min:.6,max:3,step:.1,value:Z,onChange:e=>W(Number(e.target.value)),className:`${ev} mt-2`})]})]}),(0,a.jsxs)("section",{className:"mt-5 space-y-3",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:"Forces"}),(0,a.jsxs)("label",{className:"block text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"Link distance"}),(0,a.jsx)("span",{children:q.toFixed(0)})]}),(0,a.jsx)("input",{type:"range",min:70,max:220,step:5,value:q,onChange:e=>Y(Number(e.target.value)),className:`${ev} mt-2`})]}),(0,a.jsxs)("label",{className:"block text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"Repel force"}),(0,a.jsx)("span",{children:G.toFixed(0)})]}),(0,a.jsx)("input",{type:"range",min:120,max:460,step:10,value:G,onChange:e=>J(Number(e.target.value)),className:`${ev} mt-2`})]}),(0,a.jsxs)("label",{className:"block text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"Center force"}),(0,a.jsx)("span",{children:V.toFixed(2)})]}),(0,a.jsx)("input",{type:"range",min:.02,max:.2,step:.01,value:V,onChange:e=>X(Number(e.target.value)),className:`${ev} mt-2`})]})]}),eE?(0,a.jsxs)("section",{className:"mt-5",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:"Selected note"}),(0,a.jsxs)("div",{className:"mt-2 rounded-[12px] border border-[color:rgba(148,163,184,0.16)] bg-black/25 p-3",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:eE.name}),(0,a.jsx)("p",{className:"mt-1 break-all text-[11px] text-[var(--vk-text-muted)]",children:eE.displayPath}),(0,a.jsxs)("p",{className:"mt-2 text-[11px] text-[var(--vk-text-muted)]",children:[eE.degree," connections",eE.tags.length>0?` \xb7 #${eE.tags.join(" #")}`:""]}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>r(eE.id),className:"inline-flex min-h-[32px] items-center gap-1.5 rounded-[8px] border border-[var(--vk-accent)] bg-[rgba(139,92,246,0.16)] px-3 text-[12px] text-[var(--vk-text-strong)] hover:bg-[rgba(139,92,246,0.22)]",children:[(0,a.jsx)(ei.A,{className:"h-3.5 w-3.5"}),"Open note"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{y(eE.id),F(!0)},className:"inline-flex min-h-[32px] items-center gap-1.5 rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(ec.A,{className:"h-3.5 w-3.5"}),"Use as local root"]})]})]})]}):null]}):null,(0,a.jsxs)("div",{className:"relative min-h-[420px] min-w-0 overflow-hidden rounded-[16px] border border-[color:rgba(148,163,184,0.14)] bg-[radial-gradient(circle_at_top,rgba(30,41,59,0.96),rgba(2,6,23,0.98))] shadow-[0_30px_90px_rgba(2,6,23,0.52)]",children:[(0,a.jsxs)("div",{className:"absolute left-3 top-3 z-10 flex flex-wrap gap-2",children:[(0,a.jsxs)("span",{className:"rounded-full border border-[color:rgba(148,163,184,0.16)] bg-black/30 px-2.5 py-1 text-[11px] text-[var(--vk-text-muted)]",children:[ew.nodes.length," total notes"]}),E?(0,a.jsxs)("span",{className:"rounded-full border border-[color:rgba(139,92,246,0.24)] bg-[rgba(139,92,246,0.16)] px-2.5 py-1 text-[11px] text-[var(--vk-text-strong)]",children:["Local graph depth ",P]}):null,A?(0,a.jsxs)("span",{className:"rounded-full border border-[color:rgba(56,189,248,0.24)] bg-[rgba(56,189,248,0.16)] px-2.5 py-1 text-[11px] text-[var(--vk-text-strong)]",children:["Search: ",A]}):null]}),(0,a.jsxs)("div",{className:"absolute right-3 top-3 z-10 flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",title:"Zoom out","aria-label":"Zoom out",onClick:()=>eT(.88*H.k),className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[color:rgba(148,163,184,0.16)] bg-black/35 text-[var(--vk-text-normal)] hover:bg-black/55",children:(0,a.jsx)(ed.A,{className:"h-4 w-4"})}),(0,a.jsx)("button",{type:"button",title:"Zoom in","aria-label":"Zoom in",onClick:()=>eT(1.12*H.k),className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[color:rgba(148,163,184,0.16)] bg-black/35 text-[var(--vk-text-normal)] hover:bg-black/55",children:(0,a.jsx)(ex.A,{className:"h-4 w-4"})}),(0,a.jsx)("button",{type:"button",title:"Fit graph","aria-label":"Fit graph",onClick:()=>K(eg(eL.nodes,Q.width,Q.height)),className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[color:rgba(148,163,184,0.16)] bg-black/35 text-[var(--vk-text-normal)] hover:bg-black/55",children:(0,a.jsx)(ec.A,{className:"h-4 w-4"})})]}),eR?null:(0,a.jsx)("div",{className:"absolute bottom-3 left-3 z-10 rounded-[10px] border border-[color:rgba(148,163,184,0.14)] bg-black/35 px-3 py-2 text-[11px] leading-5 text-[var(--vk-text-muted)] backdrop-blur-sm",children:"Hover to highlight neighbors, drag the canvas to pan, double-click a node to open its note."}),(0,a.jsx)("div",{ref:o,className:"h-full w-full touch-none",children:0===eF?(0,a.jsx)("div",{className:"flex h-full items-center justify-center px-6 text-center text-[13px] text-[var(--vk-text-muted)]",children:"No notes match the current graph filters. Clear the search or group filter to widen the graph."}):(0,a.jsxs)("svg",{width:"100%",height:"100%",viewBox:`0 0 ${Math.max(Q.width,900)} ${Math.max(Q.height,620)}`,onPointerMove:eI,onPointerUp:ez,onPointerCancel:ez,onWheel:e_,className:"h-full w-full",children:[(0,a.jsxs)("defs",{children:[(0,a.jsx)("marker",{id:"notes-graph-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:(0,a.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"rgba(148,163,184,0.55)"})}),(0,a.jsxs)("filter",{id:"notes-graph-node-glow",x:"-120%",y:"-120%",width:"340%",height:"340%",children:[(0,a.jsx)("feGaussianBlur",{stdDeviation:"3.4",result:"blur"}),(0,a.jsxs)("feMerge",{children:[(0,a.jsx)("feMergeNode",{in:"blur"}),(0,a.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,a.jsx)("rect",{x:0,y:0,width:"100%",height:"100%",fill:"transparent",onPointerDown:eD,onPointerUp:ez,onPointerCancel:ez}),(0,a.jsxs)("g",{transform:`translate(${Math.max(Q.width,900)/2+H.x}, ${Math.max(Q.height,620)/2+H.y}) scale(${H.k})`,children:[eL.edges.map(e=>{let t=eL.nodes.find(t=>t.id===e.source),r=eL.nodes.find(t=>t.id===e.target);if(!t||!r)return null;let n=!e$||e$.has(e.source)&&e$.has(e.target);return(0,a.jsx)("line",{x1:t.x,y1:t.y,x2:r.x,y2:r.y,stroke:"rgba(148,163,184,0.72)",strokeOpacity:n?.58:.12,strokeWidth:Z,markerEnd:I?"url(#notes-graph-arrow)":void 0},e.id)}),eL.nodes.map(e=>{let t=ef(e,U),n=ey.get(e.folder)??"#8b5cf6",s=!e$||e$.has(e.id),l=0===eM.size||eM.has(e.id),o=w===e.id,i=O&&(o||f===e.id||H.k>=eO);return(0,a.jsxs)("g",{transform:`translate(${e.x}, ${e.y})`,onClick:()=>y(e.id),onDoubleClick:()=>r(e.id),onMouseEnter:()=>j(e.id),onMouseLeave:()=>j(null),style:{cursor:"pointer"},children:[(0,a.jsx)("circle",{r:t+2,fill:n,opacity:s?.18:.05,filter:"url(#notes-graph-node-glow)"}),(0,a.jsx)("circle",{r:t,fill:n,opacity:s?l?.92:.66:.16,stroke:o?"rgba(248,250,252,0.95)":"rgba(15,23,42,0.9)",strokeWidth:o?2.4:1.1}),i?(0,a.jsx)("text",{x:t+6,y:4,fontSize:11,fill:"rgba(226,232,240,0.94)",style:{pointerEvents:"none",userSelect:"none"},children:e.displayPath}):null]},e.id)})]})]})})]})]})]})}let ej="fixed inset-0 z-[130] bg-black/60 backdrop-blur-[2px]",ew="fixed inset-x-0 bottom-0 top-[10%] z-[131] flex flex-col overflow-hidden rounded-t-[20px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_-24px_80px_rgba(0,0,0,0.42)]";function ey({projectId:e,bridgeId:t=null,sessions:r,selectedSessionId:v=null}){let[b,g]=(0,s.useState)(null),[f,k]=(0,s.useState)(!0),[j,y]=(0,s.useState)(null),[N,C]=(0,s.useState)(0),[S,A]=(0,s.useState)(null),[$,L]=(0,s.useState)([]),[M,E]=(0,s.useState)(""),[F,P]=(0,s.useState)("split"),[O,T]=(0,s.useState)(!1),[_,D]=(0,s.useState)(!1),[I,z]=(0,s.useState)(null),[U,B]=(0,s.useState)(!1),[Z,W]=(0,s.useState)(!1),[q,G]=(0,s.useState)(!1),[J,V]=(0,s.useState)(""),[H,ee]=(0,s.useState)(""),[et,er]=(0,s.useState)(null),[ea,en]=(0,s.useState)(!1),[es,el]=(0,s.useState)(!1),[eo,ei]=(0,s.useState)(null),[ec,ed]=(0,s.useState)(null),[ex,ep]=(0,s.useState)(null),[eh,eu]=(0,s.useState)(!1),[em,ev]=(0,s.useState)(null),[eb,eg]=(0,s.useState)(!1),[ef,eN]=(0,s.useState)(""),[eC,eS]=(0,s.useState)(!1),[eA,e$]=(0,s.useState)(""),[eL,eM]=(0,s.useState)(null),[eE,eF]=(0,s.useState)(null),[eP,eR]=(0,s.useState)(!1),[eO,eT]=(0,s.useState)(!1),[e_,eD]=(0,s.useState)(v??""),eI=(0,s.useRef)(0),ez=(0,s.useRef)([]),eU=b?.files??[],eB=b?.tags??{},eZ=(0,s.useMemo)(()=>eU.find(e=>e.path===S)??null,[eU,S]),eW=J!==H,eq=ea||b?.writable===!1,eY=b?.writable!==!1,eG=(0,s.useMemo)(()=>r.filter(e=>!(0,p.Zu)(e)),[r]),eJ=(0,s.useMemo)(()=>{let e=eU;if(I&&eB[I]){let t=new Set(eB[I]);e=e.filter(e=>t.has(e.path))}if(M.trim().length>0){let t=M.trim().toLowerCase();e=e.filter(e=>`${e.displayPath} ${e.name} ${e.source??""}`.toLowerCase().includes(t))}return u(h(e),M)},[eU,M,I,eB]);(0,s.useEffect)(()=>{v&&eD(v)},[v]),(0,s.useEffect)(()=>{0===eG.length?eD(""):e_&&eG.some(e=>e.id===e_)||eD(v&&eG.some(e=>e.id===v)?v:eG[0]?.id??"")},[v,eG,e_]),(0,s.useEffect)(()=>{if("function"!=typeof window.matchMedia)return;let e=window.matchMedia("(max-width: 1279px)"),t=()=>B(e.matches);return(t(),"function"==typeof e.addEventListener)?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e.addListener?.(t),()=>e.removeListener?.(t))},[]),(0,s.useEffect)(()=>{U&&"split"===F&&P("edit"),U||(W(!1),G(!1))},[U,F]),(0,s.useEffect)(()=>{U&&eE&&G(!1)},[U,eE]);let eV=(0,s.useCallback)(()=>{C(e=>e+1)},[]);(0,s.useEffect)(()=>{let r=!1;return k(!0),y(null),(async()=>{try{let a=await fetch((0,x.S)(`/api/project-notes?projectId=${encodeURIComponent(e)}`,t),{cache:"no-store"}),n=await a.json().catch(()=>null);if(!a.ok)throw Error(n&&"error"in n?n.error??"Failed to load notes":`Failed to load notes (${a.status})`);if(r)return;g(n??null)}catch(e){if(r)return;g(null),y(e instanceof Error?e.message:"Failed to load notes workspace")}finally{r||k(!1)}})(),()=>{r=!0}},[t,e,N]),(0,s.useEffect)(()=>{0===eU.length?A(null):S&&eU.some(e=>e.path===S)||A(eU[0]?.path??null)},[eU,S]),(0,s.useEffect)(()=>{if(0!==M.trim().length){let e,t;L((e=[],t=r=>{r.isDirectory&&(e.push(r.path),r.children.forEach(t))},eJ.forEach(t),e))}},[eJ,M]),(0,s.useEffect)(()=>{if(!S){V(""),ee(""),er(null),en(!1),ei(null);return}let r=!1;eI.current+=1;let a=eI.current;return el(!0),ei(null),ed(null),ep(null),(async()=>{try{let n=new URLSearchParams({projectId:e,path:S}),s=await fetch((0,x.S)(`/api/project-notes/file?${n.toString()}`,t),{cache:"no-store"}),l=await s.json().catch(()=>null);if(!s.ok)throw Error(l&&"error"in l?l.error??"Failed to load note":`Failed to load note (${s.status})`);if(r||eI.current!==a)return;V(l.content??""),ee(l.content??""),er(l.modifiedAt??null),en(!0===l.truncated)}catch(e){if(r||eI.current!==a)return;V(""),ee(""),er(null),en(!1),ei(e instanceof Error?e.message:"Failed to load note")}finally{r||eI.current!==a||el(!1)}})(),()=>{r=!0}},[t,e,N,S]);let eX=(0,s.useCallback)(async()=>{if(!eZ)return null;if(ea)return ed("This note was truncated for safety. Open it externally to edit the full file."),null;eu(!0),ed(null),ep(null);try{let r=await fetch((0,x.S)("/api/project-notes/file",t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e,path:eZ.path,content:J,expectedModifiedAt:et})}),a=await r.json().catch(()=>null);if(!r.ok)throw Error(a&&"error"in a?a.error??"Failed to save note":`Failed to save note (${r.status})`);return ee(J),er(a.modifiedAt??null),ep(a.created?"Note created.":"Note saved."),eV(),a}catch(e){return ed(e instanceof Error?e.message:"Failed to save note"),null}finally{eu(!1)}},[t,J,et,ea,e,eV,eZ]),eH=(0,s.useCallback)(async()=>{if(eZ&&(!eW||await eX())){eg(!0),ev(null);try{let r=await fetch((0,x.S)("/api/project-notes/open",t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e,path:eZ.path})}),a=await r.json().catch(()=>null);if(!r.ok)throw Error(a?.error??`Failed to open note (${r.status})`)}catch(e){ev(e instanceof Error?e.message:"Failed to open note")}finally{eg(!1)}}},[t,eW,e,eX,eZ]),eK=(0,s.useCallback)(async()=>{let r,a=(r=ef.trim().replace(/\\/g,"/").replace(/^\/+/,""))?/\.(md|markdown|mdx|txt)$/i.test(r)?r:`${r}.md`:"";if(a&&!eC){eS(!0),ed(null),ep(null);try{let r,n=await fetch((0,x.S)("/api/project-notes/file",t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e,path:a,content:(r=(a.split("/").pop()??"Note").replace(/\.(md|markdown|mdx|txt)$/i,"").replace(/[-_]+/g," ").trim())?`# ${r.charAt(0).toUpperCase()}${r.slice(1)}
2
-
3
- `:""})}),s=await n.json().catch(()=>null);if(!n.ok)throw Error(s&&"error"in s?s.error??"Failed to create note":`Failed to create note (${n.status})`);eN(""),A(s.path),U&&(W(!1),T(!1),P("edit")),ep("Note created."),eV()}catch(e){ed(e instanceof Error?e.message:"Failed to create note")}finally{eS(!1)}}},[t,U,eC,ef,e,eV]),eQ=(0,s.useCallback)(async()=>{try{let r=await fetch((0,x.S)("/api/project-notes/daily",t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})}),a=await r.json().catch(()=>null);if(!r.ok||a&&"error"in a)throw Error(a?.error??`Failed to create daily note (${r.status})`);a?.path&&(A(a.path),U&&(W(!1),T(!1),P("edit")),L(e=>e.includes("daily")?e:[...e,"daily"]),eV())}catch(e){ed(e instanceof Error?e.message:"Failed to create daily note")}},[t,U,e,eV]),e0=(0,s.useCallback)(async()=>{if((eZ||0!==eA.trim().length)&&!eP&&(!eW||await eX())){eR(!0),eM(null),eF(null);try{let r=await fetch((0,x.S)(`/api/projects/${encodeURIComponent(e)}/dispatcher/send`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:eA.trim(),attachments:eZ?[eZ.path]:[]})}),a=await r.json().catch(()=>null);if(!r.ok)throw Error(a?.error??`Failed to send note to dispatcher (${r.status})`);eF(eZ?"Sent note to dispatcher.":"Sent message to dispatcher."),e$("")}catch(e){eM(e instanceof Error?e.message:"Failed to send note to dispatcher")}finally{eR(!1)}}},[t,eA,eW,e,eX,eZ,eP]),e1=(0,s.useCallback)(async()=>{if((eZ||0!==eA.trim().length)&&e_&&!eO&&(!eW||await eX())){eT(!0),eM(null),eF(null);try{let e=await fetch((0,x.S)(`/api/sessions/${encodeURIComponent(e_)}/send`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:eA.trim(),attachments:eZ?[eZ.path]:[]})}),r=await e.json().catch(()=>null);if(!e.ok)throw Error(r?.error??`Failed to send note to session (${e.status})`);let a=eG.find(e=>e.id===e_);eF(a?`Sent note to ${a.branch||a.id.slice(0,8)}.`:"Sent note to session."),e$("")}catch(e){eM(e instanceof Error?e.message:"Failed to send note to session")}finally{eT(!1)}}},[t,eA,eW,eX,eZ,eO,eG,e_]),e2=(0,s.useCallback)(e=>{L(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),e3=(0,s.useCallback)(e=>{if(e===S){U&&W(!1);return}(!eW||window.confirm("Discard unsaved note changes and switch notes?"))&&(A(e),U&&(W(!1),T(!1),P("edit")),ez.current=[e,...ez.current.filter(t=>t!==e)].slice(0,20))},[U,eW,S]),e5=(0,s.useCallback)(e=>{let t=m(e,eU);t?e3(t):eN((e.includes("/"),`${e}.md`))},[eU,e3]),e4=(0,s.useCallback)(e=>{z(t=>t===e?null:e)},[]);(0,s.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),D(!0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let e6=(0,s.useCallback)(e=>{D(!1),e3(e)},[e3]),e8=ec||em||eL||j||eo,e9=ex||eE,e7=b?.notesRoot?b.notesRoot:b?.editor?.trim().toLowerCase()==="notion"?"Notion":"Project markdown files",te=U&&"split"===F?"edit":F;return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto overscroll-contain touch-pan-y [-webkit-overflow-scrolling:touch] bg-[var(--vk-bg-main)]",children:[(0,a.jsx)(R,{viewMode:te,onViewModeChange:P,onSave:()=>void eX(),onRefresh:eV,onOpenExternally:()=>void eH(),onDailyNote:()=>void eQ(),onToggleGraph:()=>T(e=>!e),graphOpen:O,saving:eh,dirty:eW,indexLoading:f,opening:eb,selectedFile:eZ,fileTruncated:ea,editorName:b?.editor,canSave:eY,compact:U,onOpenFiles:()=>W(!0),onOpenShare:()=>G(!0)}),(0,a.jsxs)("div",{className:"border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)]/70 px-3 py-2 sm:px-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("p",{className:"truncate text-[14px] text-[var(--vk-text-strong)]",children:[e," \xb7 ",b?.editor||"markdown"]}),(0,a.jsxs)("p",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:[e7,I?` \xb7 Filtered by #${I}`:""]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("input",{value:ef,onChange:e=>eN(e.target.value),placeholder:"New note path, e.g. architecture/overview.md",className:"min-h-[34px] min-w-0 rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 text-[12px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)] sm:min-w-[260px]",onKeyDown:e=>{"Enter"===e.key&&eK()}}),(0,a.jsxs)("button",{type:"button",onClick:()=>void eK(),disabled:eC||0===ef.trim().length||!eY,className:"inline-flex min-h-[34px] items-center gap-1.5 rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:[eC?(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"}),"New note"]})]})]}),e8?(0,a.jsx)("div",{className:"mt-2 rounded-[8px] border border-[rgba(255,143,122,0.28)] bg-[rgba(255,143,122,0.08)] px-3 py-2 text-[12px] text-[var(--vk-red)]",children:e8}):null,e9?(0,a.jsx)("div",{className:"mt-2 rounded-[8px] border border-[rgba(24,197,143,0.28)] bg-[rgba(24,197,143,0.08)] px-3 py-2 text-[12px] text-[var(--vk-green)]",children:e9}):null,eW?(0,a.jsx)("div",{className:"mt-2 flex items-center gap-1.5 text-[12px] text-[#f6c56f]",children:"● Unsaved changes"}):null,ea?(0,a.jsx)("div",{className:"mt-1 flex items-center gap-1.5 text-[12px] text-[#f6c56f]",children:"This note is too large to edit safely. The preview is read-only."}):null]}),eY?f&&!b?(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 items-center justify-center gap-2 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(l.A,{className:"h-4 w-4 animate-spin"}),"Loading notes workspace…"]}):0===eU.length?(0,a.jsx)("div",{className:"flex min-h-0 flex-1 items-center justify-center px-4",children:(0,a.jsxs)("div",{className:"w-full max-w-xl rounded-[12px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-6 py-8 text-center shadow-[0_20px_48px_rgba(0,0,0,0.18)]",children:[(0,a.jsx)("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)]",children:(0,a.jsx)(o.A,{className:"h-5 w-5"})}),(0,a.jsx)("h2",{className:"mt-4 text-[18px] font-medium text-[var(--vk-text-strong)]",children:"No markdown notes found yet"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] leading-6 text-[var(--vk-text-muted)]",children:"Point Conductor at your notes root in Preferences, or create a new note above."})]})}):O?(0,a.jsx)(ek,{projectId:e,bridgeId:t,noteFiles:eU,selectedPath:S,onNavigate:e3}):(0,a.jsxs)("div",{className:U?"min-h-0 flex-1":"flex min-h-0 flex-1 flex-col xl:grid xl:grid-cols-[280px_minmax(0,1fr)] xl:overflow-hidden",children:[U?null:(0,a.jsx)(w,{noteFiles:eU,selectedPath:S,expandedFolders:$,onToggleFolder:e2,onSelectFile:e3,search:M,onSearchChange:E,editorLabel:b?.editor,tags:eB,onTagClick:e4}),(0,a.jsxs)("div",{className:U?"flex min-h-0 flex-1 flex-col overflow-hidden":"flex min-h-[min(560px,70dvh)] flex-1 flex-col overflow-hidden xl:min-h-0",children:[(0,a.jsx)("div",{className:"border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)]/45 px-3 py-2",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2 xl:flex-row xl:items-start xl:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-[14px] text-[var(--vk-text-strong)]",children:eZ?.displayPath||"Select a note"}),eZ?(0,a.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:[eZ.source||"notes",eZ.modifiedAt?` \xb7 ${new Date(eZ.modifiedAt).toLocaleString()}`:"",eZ.sizeBytes?` \xb7 ${(eZ.sizeBytes/1024).toFixed(1)} KB`:""]}):null]}),U?null:(0,a.jsxs)("div",{className:"grid gap-2 xl:min-w-[420px]",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("input",{value:eA,onChange:e=>e$(e.target.value),placeholder:"Optional message to send with this note",className:"min-h-[34px] min-w-0 flex-1 rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 text-[12px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"}),(0,a.jsxs)("select",{value:e_,onChange:e=>eD(e.target.value),className:"min-h-[34px] rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 text-[12px] text-[var(--vk-text-normal)] outline-none",disabled:0===eG.length,children:[0===eG.length?(0,a.jsx)("option",{value:"",children:"No active sessions"}):null,eG.map(e=>(0,a.jsxs)("option",{value:e.id,children:[(e.branch||e.id.slice(0,8)).trim()," \xb7 ",e.status]},e.id))]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>void e0(),disabled:eP||!eZ&&0===eA.trim().length,className:"inline-flex min-h-[34px] items-center gap-1.5 rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:[eP?(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):"✦","Send to dispatcher"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>void e1(),disabled:eO||!e_||!eZ&&0===eA.trim().length,className:"inline-flex min-h-[34px] items-center gap-1.5 rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:[eO?(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):"→","Send to session"]})]})]})]})}),(0,a.jsxs)("div",{className:`grid min-h-0 flex-1 ${"split"===te?"xl:grid-cols-2":"grid-cols-1"}`,children:["preview"!==te?(0,a.jsx)("div",{className:`min-h-[320px] overflow-hidden xl:min-h-0 ${"split"===te?"border-b border-[var(--vk-border)] xl:border-b-0 xl:border-r":""}`,children:es?(0,a.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(l.A,{className:"h-4 w-4 animate-spin"}),"Loading note…"]}):(0,a.jsx)(Y,{value:J,onChange:V,readOnly:eq,placeholder:"Select a note to start editing",onWikilinkClick:e5,onSave:()=>void eX(),onQuickSwitch:()=>D(!0)})}):null,"edit"!==te?(0,a.jsx)("div",{className:"min-h-[280px] overflow-auto bg-[var(--vk-bg-panel)]/25 px-4 py-4 xl:min-h-0",children:(0,a.jsx)(X,{content:J,onWikilinkClick:e5,noteFiles:eU})}):null]}),(0,a.jsx)(K,{projectId:e,bridgeId:t,notePath:S,onNavigate:e3})]})]}):(0,a.jsx)("div",{className:"flex min-h-0 flex-1 items-center justify-center px-4",children:(0,a.jsxs)("div",{className:"w-full max-w-xl rounded-[12px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-6 py-8 text-center shadow-[0_20px_48px_rgba(0,0,0,0.18)]",children:[(0,a.jsx)("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)]",children:(0,a.jsx)(o.A,{className:"h-5 w-5"})}),(0,a.jsx)("h2",{className:"mt-4 text-[18px] font-medium text-[var(--vk-text-strong)]",children:"Local notes are not available for this editor"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] leading-6 text-[var(--vk-text-muted)]",children:"Choose Obsidian, Logseq, VS Code, or another filesystem-backed markdown editor in Preferences to browse and edit local note files inside Conductor."})]})}),(0,a.jsx)(n.bL,{open:Z,onOpenChange:W,children:(0,a.jsxs)(n.ZL,{children:[(0,a.jsx)(n.hJ,{className:ej}),(0,a.jsxs)(n.UC,{className:ew,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(n.hE,{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Browse notes"}),(0,a.jsx)(n.VY,{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Jump between files without crowding the editor on mobile."})]}),(0,a.jsx)(n.bm,{asChild:!0,children:(0,a.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-[var(--vk-border)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:(0,a.jsx)(i.A,{className:"h-4 w-4"})})})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:(0,a.jsx)(w,{noteFiles:eU,selectedPath:S,expandedFolders:$,onToggleFolder:e2,onSelectFile:e3,search:M,onSearchChange:E,editorLabel:b?.editor,tags:eB,onTagClick:e4,className:"h-full max-h-none border-b-0 xl:border-r-0"})})]})]})}),(0,a.jsx)(n.bL,{open:q,onOpenChange:G,children:(0,a.jsxs)(n.ZL,{children:[(0,a.jsx)(n.hJ,{className:ej}),(0,a.jsxs)(n.UC,{className:ew,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(n.hE,{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Share note"}),(0,a.jsx)(n.VY,{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Send the current note to the dispatcher or an active session."})]}),(0,a.jsx)(n.bm,{asChild:!0,children:(0,a.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-[var(--vk-border)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:(0,a.jsx)(i.A,{className:"h-4 w-4"})})})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-auto px-4 py-4",children:[(0,a.jsxs)("div",{className:"rounded-[12px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]/35 px-3 py-3",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:eZ?.displayPath||"No note selected"}),eZ?(0,a.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[eZ.source||"notes",eZ.modifiedAt?` \xb7 ${new Date(eZ.modifiedAt).toLocaleString()}`:""]}):null]}),(0,a.jsxs)("label",{className:"grid gap-2 text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)("span",{children:"Optional message"}),(0,a.jsx)("input",{value:eA,onChange:e=>e$(e.target.value),placeholder:"Optional message to send with this note",className:"min-h-[40px] rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 text-[13px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"})]}),(0,a.jsxs)("label",{className:"grid gap-2 text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)("span",{children:"Target session"}),(0,a.jsxs)("select",{value:e_,onChange:e=>eD(e.target.value),className:"min-h-[40px] rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 text-[13px] text-[var(--vk-text-normal)] outline-none",disabled:0===eG.length,children:[0===eG.length?(0,a.jsx)("option",{value:"",children:"No active sessions"}):null,eG.map(e=>(0,a.jsxs)("option",{value:e.id,children:[(e.branch||e.id.slice(0,8)).trim()," \xb7 ",e.status]},e.id))]})]}),(0,a.jsxs)("div",{className:"mt-auto flex flex-col gap-2 pb-[env(safe-area-inset-bottom)]",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>void e0(),disabled:eP||!eZ&&0===eA.trim().length,className:"inline-flex min-h-[42px] items-center justify-center gap-2 rounded-[10px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:[eP?(0,a.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(c.A,{className:"h-4 w-4"}),"Send to dispatcher"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>void e1(),disabled:eO||!e_||!eZ&&0===eA.trim().length,className:"inline-flex min-h-[42px] items-center justify-center gap-2 rounded-[10px] border border-[var(--vk-accent)] bg-[rgba(139,92,246,0.14)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[rgba(139,92,246,0.2)] disabled:opacity-60",children:[eO?(0,a.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Send to session"]})]})]})]})]})}),(0,a.jsx)(Q,{open:_,onOpenChange:D,files:eU.map(e=>({path:e.path,name:e.name,displayPath:e.displayPath})),onSelect:e6,recentPaths:ez.current})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[84322],{67073:(e,c,a)=>{a.d(c,{a:()=>s});var r=a(5974);let s=(0,r.createServerReference)("0080357c2ce75985e9a0eb0f648d540a91aae8d9a0",r.callServer,void 0,r.findSourceMapURL,"createOrReadKeylessAction")},84322:(e,c,a)=>{a.r(c),a.d(c,{createOrReadKeylessAction:()=>r.a,deleteKeylessAction:()=>d,syncKeylessConfigAction:()=>l});var r=a(67073),s=a(5974);let d=(0,s.createServerReference)("00e4fd3057a82f26e457e3c1eef7717a8302f6157d",s.callServer,void 0,s.findSourceMapURL,"deleteKeylessAction"),l=(0,s.createServerReference)("40eb020835e660c21bf16a5c5ed94814a618a5d03b",s.callServer,void 0,s.findSourceMapURL,"syncKeylessConfigAction")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9016],{7378:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},9016:(e,t,r)=>{r.r(t),r.d(t,{WorkspaceSidebarPanel:()=>w});var a=r(54568),n=r(7620),s=r(97509),l=r(7378),i=r(13932),o=r(46916),c=r(77522),d=r(88742);let x=(0,r(39789).A)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);var u=r(72410),m=r(10926),p=r(64323);let v=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function h(e){let t=e.metadata.worktree?.trim()??"";return t&&t.replace(/\\/g,"/").replace(/\/+$/,"").includes("/worktrees/")?"worktree":"local"}function b(e){let t=e.branch?.trim(),r=e.model?.trim(),a=e.metadata.agent?.trim()??"";if(t&&r)return`${t} \xb7 ${(0,p.M)(a,r)}`;if(t)return t;if(r)return(0,p.M)(a,r);let n=e.summary?.trim()||e.metadata.summary?.trim();return n||(e.status?.trim()?e.status.replace(/[_-]+/g," "):(0,m.kV)(e.id).slice(0,8))}function f(){let[e,t]=(0,n.useState)(0);return(0,n.useEffect)(()=>{let e=window.setInterval(()=>{t(e=>(e+1)%v.length)},80);return()=>window.clearInterval(e)},[]),(0,a.jsx)("span",{"aria-hidden":"true",className:"inline-block select-none font-mono text-[18px] leading-none text-[var(--vk-text-strong)]",children:v[e]})}function k({running:e}){return e?(0,a.jsx)("span",{className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center",children:(0,a.jsx)(f,{})}):null}function g({additions:e,deletions:t,isSelected:r}){return(0,a.jsx)("span",{className:(0,o.cn)("inline-flex shrink-0 items-center rounded-[10px] px-3 py-1.5 font-mono text-[12px] leading-none tabular-nums",r?"bg-[rgba(255,255,255,0.1)]":"bg-[rgba(255,255,255,0.06)]"),children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-3",children:[(0,a.jsxs)("span",{className:"text-[#18c58f]",children:["+",e]}),(0,a.jsxs)("span",{className:"text-[#f26d6d]",children:["−",t]})]})})}function j(e,t,r){e.stopPropagation(),e.preventDefault(),r(t,{tab:"diff"})}function N({sessions:e,selectedId:t,onSelect:r,onArchive:s,onCreateWorkspace:l,showHeader:i=!0}){let[m,p]=(0,n.useState)(""),[v,f]=(0,n.useState)(null),[y,w]=(0,n.useState)(null),C=(0,n.useMemo)(()=>{let t=e.filter(e=>"archived"!==e.status);if(!m.trim())return t;let r=m.toLowerCase();return t.filter(e=>{let t=e.summary??"",a=e.branch??"",n=e.metadata.agent??"",s=h(e),l=b(e);return e.id.toLowerCase().includes(r)||e.projectId.toLowerCase().includes(r)||t.toLowerCase().includes(r)||a.toLowerCase().includes(r)||n.toLowerCase().includes(r)||s.toLowerCase().includes(r)||l.toLowerCase().includes(r)})},[m,e]),$=async(e,t)=>{if(e.stopPropagation(),e.preventDefault(),s&&v!==t){f(t);try{await s(t)}catch(e){console.error("Failed to archive session",e),w(t),window.setTimeout(()=>w(null),3e3)}finally{f(e=>e===t?null:e)}}},A=(0,n.useMemo)(()=>[...C].sort((e,t)=>new Date(t.lastActivityAt).getTime()-new Date(e.lastActivityAt).getTime()),[C]);return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[i&&(0,a.jsxs)("div",{className:"flex h-[33px] items-center gap-1 px-2",children:[(0,a.jsx)("p",{className:"text-[16px] text-[var(--vk-text-normal)]",children:"Workspaces"}),l&&(0,a.jsx)("button",{type:"button",onClick:l,className:"ml-auto inline-flex h-5 w-5 items-center justify-center rounded-[3px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-hover)] lg:hidden","aria-label":"New workspace",children:(0,a.jsx)("span",{className:"text-[14px]",children:"+"})})]}),(0,a.jsx)("div",{className:(0,o.cn)("flex h-[38px] items-center px-2 pb-1.5",!i&&"pt-1.5"),children:(0,a.jsxs)("label",{className:"flex h-[38px] flex-1 items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 sm:h-[30px]",children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:m,onChange:e=>p(e.target.value),placeholder:"Search...",className:"ml-1.5 w-full bg-transparent text-[14px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"})]})}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:0===A.length?(0,a.jsx)("p",{className:"px-2 py-2 text-[14px] text-[var(--vk-text-muted)]",children:"No sessions"}):(0,a.jsx)("div",{className:"space-y-2",children:A.map(e=>{let n=(0,c.n)(e),l=function(e){for(let t of[e.metadata.lastStderr,e.metadata.summary,e.summary]){if(!t)continue;let e=t.match(/(\d+)\s+insertions?\(\+\),\s+(\d+)\s+deletions?\(-\)/i);if(!e)continue;let r=Number.parseInt(e[1]??"0",10),a=Number.parseInt(e[2]??"0",10);if(Number.isFinite(r)&&Number.isFinite(a))return{additions:r,deletions:a}}return null}(e),i=function(e,t){let r=`${e.summary??""} ${e.metadata.summary??""}`.toLowerCase();if("killed"===e.status||r.includes("interrupted"))return{label:"Interrupted",className:"text-[var(--vk-orange)]"};switch(t){case"merge":return{label:"Ready",className:"text-[var(--vk-green)]"};case"respond":return{label:"Needs input",className:"text-[var(--vk-red)]"};case"review":return{label:"Review",className:"text-[var(--vk-orange)]"};case"working":return{label:"Running",className:"text-[#4e87f3]"};case"done":return{label:"Done",className:"text-[var(--vk-text-muted)]"};default:return{label:"Queued",className:"text-[var(--vk-text-muted)]"}}}(e,n),d=e.metadata.agent?.trim()||null,m=e.id===t,p="waiting_input"!==e.activity&&"blocked"!==e.activity&&("spawning"===e.status||"working"===e.status),f=v===e.id,N=y===e.id;return(0,a.jsxs)("div",{onClick:()=>r(e.id),onKeyDown:t=>{var a;return a=e.id,void(("Enter"===t.key||" "===t.key)&&(t.preventDefault(),r(a)))},role:"button",tabIndex:0,className:(0,o.cn)("group flex w-full items-start gap-3 rounded-[8px] border px-3 py-3 text-left transition-colors","[content-visibility:auto] [contain-intrinsic-size:92px]",m?"border-[color:color-mix(in_srgb,var(--vk-accent)_30%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-accent)_10%,var(--vk-bg-hover))]":"border-[var(--vk-border)] bg-[rgba(255,255,255,0.02)] hover:bg-[var(--vk-bg-hover)]"),children:[(0,a.jsx)(k,{running:p}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-start gap-2",children:[(0,a.jsxs)("span",{className:"min-w-0 flex flex-1 items-center gap-2",children:[d?(0,a.jsx)("span",{className:"inline-flex h-5 w-5 shrink-0 items-center justify-center",title:d,"aria-label":`${d} agent`,children:(0,a.jsx)(u.N,{seed:{label:d},className:"h-4 w-4"})}):null,(0,a.jsx)("span",{className:"min-w-0 truncate text-[14px] font-medium text-[var(--vk-text-strong)]",children:h(e)})]}),l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"hidden shrink-0 sm:block",children:(0,a.jsx)("button",{type:"button",onClick:t=>j(t,e.id,r),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&j(t,e.id,r)},className:"rounded-[10px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--vk-orange)]","aria-label":`Open diff for session ${e.id}`,title:"Open diff tab",children:(0,a.jsx)(g,{additions:l.additions,deletions:l.deletions,isSelected:m})})}),(0,a.jsx)("span",{className:"shrink-0 rounded-[8px] bg-[rgba(255,255,255,0.06)] px-2.5 py-1 text-[11px] font-medium sm:hidden",children:(0,a.jsx)("span",{className:i.className,children:i.label})})]}):(0,a.jsx)("span",{className:"shrink-0 rounded-[8px] bg-[rgba(255,255,255,0.06)] px-2.5 py-1 text-[11px] font-medium",children:(0,a.jsx)("span",{className:i.className,children:i.label})})]}),(0,a.jsx)("span",{className:"mt-1 block truncate text-[12px] text-[var(--vk-text-muted)]",children:b(e)})]}),s?(0,a.jsx)("button",{type:"button",onClick:t=>void $(t,e.id),disabled:f,className:(0,o.cn)("mt-0.5 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[6px] border border-[var(--vk-border)] text-[var(--vk-text-muted)] transition sm:h-7 sm:w-7","opacity-70 group-hover:opacity-100 focus-visible:opacity-100","hover:border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-normal)]",f&&"cursor-wait opacity-100"),"aria-label":`Archive session ${e.id}`,title:N?"Archive failed":"Archive session",children:(0,a.jsx)(x,{className:(0,o.cn)("h-3.5 w-3.5",N&&"text-red-400")})}):null]},e.id)})})})]})}var y=r(76081);let w=(0,n.memo)(function({projects:e,selectedProjectId:t,onSelectProject:r,onUnlinkProject:d,sessions:x,selectedSessionId:u,onSelectSession:m,onArchiveSession:p,onCreateWorkspace:v}){let[h,b]=(0,n.useState)(null),[f,k]=(0,n.useState)(null),[g,j]=(0,n.useState)(null),w=(0,n.useMemo)(()=>{let e=new Map;for(let t of x){if("archived"===t.status)continue;let r=e.get(t.projectId)??{total:0,active:0};r.total+=1,"done"!==(0,c.n)(t)&&(r.active+=1),e.set(t.projectId,r)}return e},[x]),C=(0,n.useMemo)(()=>e.find(e=>e.id===f)??null,[f,e]);async function $(){if(d&&f){b(f),j(null);try{await d(f),k(null)}catch(e){j(e instanceof Error?e.message:"Failed to unlink project.")}finally{b(null)}}}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex h-full min-h-0 w-full flex-col bg-[var(--vk-bg-panel)]",children:[(0,a.jsxs)("section",{className:"border-b border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsx)("div",{className:"flex justify-center text-center",children:(0,a.jsx)("p",{className:"font-brand-header text-[22px] font-bold leading-none uppercase tracking-[0.32em] text-[var(--vk-text-strong)]",children:"Conductor"})}),(0,a.jsxs)("button",{type:"button",onClick:v,className:"mt-3 inline-flex h-11 w-full items-center justify-center gap-1 rounded-[6px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] sm:h-8","aria-label":"Add workspace",children:[(0,a.jsx)(l.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:"Add Workspace"})]})]}),(0,a.jsxs)("section",{className:"border-b border-[var(--vk-border)] pb-2 pt-1.5",children:[(0,a.jsx)("div",{className:"flex h-[28px] items-center px-3",children:(0,a.jsx)("p",{className:"text-[11px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Projects"})}),(0,a.jsxs)("div",{className:"max-h-[260px] overflow-y-auto px-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>r(null),className:(0,o.cn)("mb-1.5 flex w-full items-center gap-3 rounded-[6px] px-3 py-2.5 text-left text-[14px] leading-[21px]",null===t?"bg-[var(--vk-bg-hover)] text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"),children:[(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"truncate",children:"All projects"}),(0,a.jsx)("span",{className:"ml-auto text-[11px] text-[var(--vk-text-muted)]",children:e.length})]}),e.map(e=>{let n,s=t===e.id,l=w.get(e.id)??{total:0,active:0},c=h===e.id,x=(n=[],e.agentModel?.trim()&&n.push(`Model: ${e.agentModel.trim()}`),e.agentReasoningEffort?.trim()&&n.push(`Reasoning: ${e.agentReasoningEffort.trim()}`),n.length>0?n.join(" \xb7 "):null);return(0,a.jsxs)("div",{className:(0,o.cn)("group relative mb-1.5 flex items-center rounded-[6px]",s?"bg-[var(--vk-bg-hover)]":"hover:bg-[var(--vk-bg-hover)]"),children:[(0,a.jsxs)("button",{type:"button",onClick:()=>r(e.id),className:(0,o.cn)("flex min-w-0 flex-1 items-center gap-3 px-3 py-2.5 text-left text-[14px] leading-[21px]",s?"text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)]"),children:[(0,a.jsx)("span",{className:"mt-1 h-2.5 w-2.5 shrink-0 rounded-full bg-[#3c83f6]"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate",children:e.id}),e.description?(0,a.jsx)("span",{className:"block truncate text-[11px] text-[var(--vk-text-muted)]",children:e.description}):null,x?(0,a.jsx)("span",{className:"block truncate text-[11px] text-[var(--vk-text-muted)]",children:x}):null]}),(0,a.jsxs)("span",{className:"shrink-0 text-right",children:[(0,a.jsxs)("span",{className:"block text-[11px] text-[var(--vk-text-normal)]",children:[l.active," active"]}),(0,a.jsxs)("span",{className:"block text-[10px] text-[var(--vk-text-muted)]",children:[l.total," total"]})]})]}),d&&(0,a.jsx)("button",{type:"button",disabled:c,onClick:t=>{t.stopPropagation(),j(null),k(e.id)},className:"mr-2 inline-flex shrink-0 items-center justify-center rounded-[4px] p-1 text-[var(--vk-text-muted)] hover:bg-[var(--vk-red)]/10 hover:text-[var(--vk-red)] disabled:opacity-50","aria-label":`Unlink ${e.id}`,title:"Unlink project",children:(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"})})]},e.id)})]})]}),(0,a.jsx)("section",{className:"flex min-h-0 flex-1 flex-col pt-1.5",children:(0,a.jsx)(N,{sessions:x,selectedId:u,onSelect:m,onArchive:p,onCreateWorkspace:v,showHeader:!1})})]}),C&&"u">typeof document?(0,s.createPortal)((0,a.jsx)("div",{className:"fixed inset-0 z-[80] flex items-center justify-center bg-black/60 px-4",onClick:()=>{h||(k(null),j(null))},children:(0,a.jsxs)("div",{className:"surface-card w-full max-w-md rounded-[var(--radius-lg)] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_28px_90px_rgba(0,0,0,0.55)]",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"unlink-project-title",children:[(0,a.jsxs)("div",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("h2",{id:"unlink-project-title",className:"text-[17px] font-medium text-[var(--vk-text-strong)]",children:"Unlink Project"}),(0,a.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Remove ",(0,a.jsx)("span",{className:"font-medium text-[var(--vk-text-normal)]",children:C.id})," from this workspace configuration."]})]}),(0,a.jsxs)("div",{className:"space-y-3 px-4 py-4",children:[(0,a.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"This only removes the project from Conductor. Repository files on disk are not deleted."}),g?(0,a.jsx)("div",{className:"rounded-[var(--radius-md)] border border-[var(--vk-red)]/35 bg-[color:color-mix(in_srgb,var(--vk-red)_12%,transparent)] px-3 py-2 text-[12px] text-[var(--vk-red)]",children:g}):null]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)(y.$,{type:"button",variant:"ghost",onClick:()=>{k(null),j(null)},disabled:null!==h,children:"Cancel"}),(0,a.jsx)(y.$,{type:"button",variant:"danger",onClick:()=>void $(),disabled:null!==h,children:h===C.id?"Unlinking...":"Unlink Project"})]})]})}),document.body):null]})})},64323:(e,t,r)=>{r.d(t,{M:()=>n});var a=r(5739);function n(e,t){let r=t.trim(),n=(0,a.q)(e);if(!r)return r;if("claude-code"===n){let e=r.toLowerCase();if("opus"===e)return"Claude Opus";if("sonnet"===e)return"Claude Sonnet";if("haiku"===e)return"Claude Haiku";let t=e.match(/^claude-(sonnet|opus|haiku)-(\d+)-(\d+)(?:-\d{8})?$/);if(t){let e=t[1];return`Claude ${e[0]?.toUpperCase()+e.slice(1)} ${t[2]}.${t[3]}`}}return r.split(/[-_]+/g).filter(Boolean).map(e=>"gpt"===e.toLowerCase()?"GPT":/^\d+(?:\.\d+)?$/.test(e)?e:e[0]?.toUpperCase()+e.slice(1)).join("-")}r(76196)}}]);