viba-cli 0.38.0 → 0.39.0

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 (196) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/fallback-build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/_global-error.html +2 -2
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/_not-found.html +2 -2
  14. package/.next/server/app/_not-found.rsc +3 -3
  15. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  16. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  18. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/.next/server/app/api/custom-scripts/route.js.nft.json +1 -1
  22. package/.next/server/app/api/git/action/route.js +1 -1
  23. package/.next/server/app/api/git/action/route.js.nft.json +1 -1
  24. package/.next/server/app/api/git/branches/route.js.nft.json +1 -1
  25. package/.next/server/app/api/git/diff/route.js.nft.json +1 -1
  26. package/.next/server/app/api/git/log/route.js.nft.json +1 -1
  27. package/.next/server/app/api/git/status/route.js.nft.json +1 -1
  28. package/.next/server/app/api/repos/clone/route.js +1 -1
  29. package/.next/server/app/api/repos/clone/route.js.nft.json +1 -1
  30. package/.next/server/app/api/repos/route.js.nft.json +1 -1
  31. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  32. package/.next/server/app/credentials/page/server-reference-manifest.json +7 -7
  33. package/.next/server/app/credentials/page.js.nft.json +1 -1
  34. package/.next/server/app/credentials/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/credentials.html +2 -2
  36. package/.next/server/app/credentials.rsc +5 -5
  37. package/.next/server/app/credentials.segments/_full.segment.rsc +5 -5
  38. package/.next/server/app/credentials.segments/_head.segment.rsc +1 -1
  39. package/.next/server/app/credentials.segments/_index.segment.rsc +3 -3
  40. package/.next/server/app/credentials.segments/_tree.segment.rsc +2 -2
  41. package/.next/server/app/credentials.segments/credentials/__PAGE__.segment.rsc +2 -2
  42. package/.next/server/app/credentials.segments/credentials.segment.rsc +1 -1
  43. package/.next/server/app/git/changes/page.js.nft.json +1 -1
  44. package/.next/server/app/git/changes/page_client-reference-manifest.js +1 -1
  45. package/.next/server/app/git/changes.html +2 -2
  46. package/.next/server/app/git/changes.rsc +8 -8
  47. package/.next/server/app/git/changes.segments/_full.segment.rsc +8 -8
  48. package/.next/server/app/git/changes.segments/_head.segment.rsc +1 -1
  49. package/.next/server/app/git/changes.segments/_index.segment.rsc +3 -3
  50. package/.next/server/app/git/changes.segments/_tree.segment.rsc +2 -2
  51. package/.next/server/app/git/changes.segments/git/changes/__PAGE__.segment.rsc +2 -2
  52. package/.next/server/app/git/changes.segments/git/changes.segment.rsc +1 -1
  53. package/.next/server/app/git/changes.segments/git.segment.rsc +3 -3
  54. package/.next/server/app/git/custom-scripts/page.js.nft.json +1 -1
  55. package/.next/server/app/git/custom-scripts/page_client-reference-manifest.js +1 -1
  56. package/.next/server/app/git/custom-scripts.html +2 -2
  57. package/.next/server/app/git/custom-scripts.rsc +7 -7
  58. package/.next/server/app/git/custom-scripts.segments/_full.segment.rsc +7 -7
  59. package/.next/server/app/git/custom-scripts.segments/_head.segment.rsc +1 -1
  60. package/.next/server/app/git/custom-scripts.segments/_index.segment.rsc +3 -3
  61. package/.next/server/app/git/custom-scripts.segments/_tree.segment.rsc +2 -2
  62. package/.next/server/app/git/custom-scripts.segments/git/custom-scripts/__PAGE__.segment.rsc +2 -2
  63. package/.next/server/app/git/custom-scripts.segments/git/custom-scripts.segment.rsc +1 -1
  64. package/.next/server/app/git/custom-scripts.segments/git.segment.rsc +3 -3
  65. package/.next/server/app/git/history/page.js.nft.json +1 -1
  66. package/.next/server/app/git/history/page_client-reference-manifest.js +1 -1
  67. package/.next/server/app/git/history.html +2 -2
  68. package/.next/server/app/git/history.rsc +8 -8
  69. package/.next/server/app/git/history.segments/_full.segment.rsc +8 -8
  70. package/.next/server/app/git/history.segments/_head.segment.rsc +1 -1
  71. package/.next/server/app/git/history.segments/_index.segment.rsc +3 -3
  72. package/.next/server/app/git/history.segments/_tree.segment.rsc +2 -2
  73. package/.next/server/app/git/history.segments/git/history/__PAGE__.segment.rsc +2 -2
  74. package/.next/server/app/git/history.segments/git/history.segment.rsc +1 -1
  75. package/.next/server/app/git/history.segments/git.segment.rsc +3 -3
  76. package/.next/server/app/git/page.js.nft.json +1 -1
  77. package/.next/server/app/git/page_client-reference-manifest.js +1 -1
  78. package/.next/server/app/git/stashes/page.js.nft.json +1 -1
  79. package/.next/server/app/git/stashes/page_client-reference-manifest.js +1 -1
  80. package/.next/server/app/git/stashes.html +2 -2
  81. package/.next/server/app/git/stashes.rsc +7 -7
  82. package/.next/server/app/git/stashes.segments/_full.segment.rsc +7 -7
  83. package/.next/server/app/git/stashes.segments/_head.segment.rsc +1 -1
  84. package/.next/server/app/git/stashes.segments/_index.segment.rsc +3 -3
  85. package/.next/server/app/git/stashes.segments/_tree.segment.rsc +2 -2
  86. package/.next/server/app/git/stashes.segments/git/stashes/__PAGE__.segment.rsc +2 -2
  87. package/.next/server/app/git/stashes.segments/git/stashes.segment.rsc +1 -1
  88. package/.next/server/app/git/stashes.segments/git.segment.rsc +3 -3
  89. package/.next/server/app/git.html +2 -2
  90. package/.next/server/app/git.rsc +8 -8
  91. package/.next/server/app/git.segments/_full.segment.rsc +8 -8
  92. package/.next/server/app/git.segments/_head.segment.rsc +1 -1
  93. package/.next/server/app/git.segments/_index.segment.rsc +3 -3
  94. package/.next/server/app/git.segments/_tree.segment.rsc +2 -2
  95. package/.next/server/app/git.segments/git/__PAGE__.segment.rsc +2 -2
  96. package/.next/server/app/git.segments/git.segment.rsc +3 -3
  97. package/.next/server/app/index.html +2 -2
  98. package/.next/server/app/index.rsc +5 -5
  99. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  100. package/.next/server/app/index.segments/_full.segment.rsc +5 -5
  101. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  102. package/.next/server/app/index.segments/_index.segment.rsc +3 -3
  103. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  104. package/.next/server/app/new/page/server-reference-manifest.json +29 -29
  105. package/.next/server/app/new/page.js.nft.json +1 -1
  106. package/.next/server/app/new/page_client-reference-manifest.js +1 -1
  107. package/.next/server/app/page/server-reference-manifest.json +29 -29
  108. package/.next/server/app/page.js.nft.json +1 -1
  109. package/.next/server/app/page_client-reference-manifest.js +1 -1
  110. package/.next/server/app/session/[sessionId]/page/server-reference-manifest.json +19 -19
  111. package/.next/server/app/session/[sessionId]/page.js.nft.json +1 -1
  112. package/.next/server/app/session/[sessionId]/page_client-reference-manifest.js +1 -1
  113. package/.next/server/chunks/[root-of-the-server]__01a6baa7._.js +1 -1
  114. package/.next/server/chunks/[root-of-the-server]__01a6baa7._.js.map +1 -1
  115. package/.next/server/chunks/{[root-of-the-server]__82d53572._.js → [root-of-the-server]__187f37c1._.js} +1 -1
  116. package/.next/server/chunks/{[root-of-the-server]__5349b858._.js → [root-of-the-server]__8de57231._.js} +1 -1
  117. package/.next/server/chunks/[root-of-the-server]__b17e6c62._.js +1 -1
  118. package/.next/server/chunks/[root-of-the-server]__b17e6c62._.js.map +1 -1
  119. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0002606b.js +1 -1
  120. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0002606b.js.map +1 -1
  121. package/.next/server/chunks/ssr/[root-of-the-server]__05b3451a._.js +1 -1
  122. package/.next/server/chunks/ssr/[root-of-the-server]__05b3451a._.js.map +1 -1
  123. package/.next/server/chunks/ssr/[root-of-the-server]__05e6fb4c._.js +1 -1
  124. package/.next/server/chunks/ssr/[root-of-the-server]__2798aa4d._.js +1 -1
  125. package/.next/server/chunks/ssr/[root-of-the-server]__2798aa4d._.js.map +1 -1
  126. package/.next/server/chunks/ssr/[root-of-the-server]__46af1502._.js +1 -1
  127. package/.next/server/chunks/ssr/[root-of-the-server]__46af1502._.js.map +1 -1
  128. package/.next/server/chunks/ssr/[root-of-the-server]__79a7a15d._.js +1 -1
  129. package/.next/server/chunks/ssr/[root-of-the-server]__79a7a15d._.js.map +1 -1
  130. package/.next/server/chunks/ssr/{_787bdec7._.js → _439918bb._.js} +2 -2
  131. package/.next/server/chunks/ssr/{_787bdec7._.js.map → _439918bb._.js.map} +1 -1
  132. package/.next/server/chunks/ssr/_476e86d1._.js +1 -1
  133. package/.next/server/chunks/ssr/{_e17414c3._.js → _4a66db4a._.js} +2 -2
  134. package/.next/server/chunks/ssr/{_e17414c3._.js.map → _4a66db4a._.js.map} +1 -1
  135. package/.next/server/chunks/ssr/_4d07d45e._.js +1 -1
  136. package/.next/server/chunks/ssr/_4d07d45e._.js.map +1 -1
  137. package/.next/server/chunks/ssr/{_2a7fa4b0._.js → _5147763c._.js} +2 -2
  138. package/.next/server/chunks/ssr/{_2a7fa4b0._.js.map → _5147763c._.js.map} +1 -1
  139. package/.next/server/chunks/ssr/_57f63a65._.js +1 -1
  140. package/.next/server/chunks/ssr/_57f63a65._.js.map +1 -1
  141. package/.next/server/chunks/ssr/_707e5fab._.js +1 -1
  142. package/.next/server/chunks/ssr/{_be721a9c._.js → _8d41d1fd._.js} +2 -2
  143. package/.next/server/chunks/ssr/{_be721a9c._.js.map → _8d41d1fd._.js.map} +1 -1
  144. package/.next/server/chunks/ssr/_9493de08._.js +1 -1
  145. package/.next/server/chunks/ssr/{_523ff032._.js → _9a7bd3c8._.js} +2 -2
  146. package/.next/server/chunks/ssr/{_523ff032._.js.map → _9a7bd3c8._.js.map} +1 -1
  147. package/.next/server/chunks/ssr/src_app_credentials_page_tsx_63d8d34a._.js +1 -1
  148. package/.next/server/chunks/ssr/src_app_credentials_page_tsx_63d8d34a._.js.map +1 -1
  149. package/.next/server/chunks/ssr/src_app_git_changes_page_tsx_f6dc28dc._.js +2 -2
  150. package/.next/server/chunks/ssr/src_app_git_changes_page_tsx_f6dc28dc._.js.map +1 -1
  151. package/.next/server/chunks/ssr/src_app_providers_tsx_2ae5be81._.js +1 -1
  152. package/.next/server/chunks/ssr/src_app_providers_tsx_2ae5be81._.js.map +1 -1
  153. package/.next/server/chunks/ssr/src_app_session_[sessionId]_SessionPageClient_tsx_dab490d7._.js +1 -1
  154. package/.next/server/chunks/ssr/src_app_session_[sessionId]_SessionPageClient_tsx_dab490d7._.js.map +1 -1
  155. package/.next/server/chunks/ssr/src_components_GitRepoSelector_tsx_05c81afa._.js +1 -1
  156. package/.next/server/chunks/ssr/src_components_GitRepoSelector_tsx_05c81afa._.js.map +1 -1
  157. package/.next/server/chunks/ssr/src_components_git_029e6e6f._.js +3 -0
  158. package/.next/server/chunks/ssr/src_components_git_029e6e6f._.js.map +1 -0
  159. package/.next/server/chunks/ssr/src_components_git_history-view_tsx_fd62126a._.js +4 -4
  160. package/.next/server/chunks/ssr/src_components_git_history-view_tsx_fd62126a._.js.map +1 -1
  161. package/.next/server/chunks/ssr/src_db5b513b._.js +3 -0
  162. package/.next/server/chunks/ssr/src_db5b513b._.js.map +1 -0
  163. package/.next/server/pages/404.html +2 -2
  164. package/.next/server/pages/500.html +2 -2
  165. package/.next/server/server-reference-manifest.js +1 -1
  166. package/.next/server/server-reference-manifest.json +48 -48
  167. package/.next/static/chunks/{4d93976ea0e8b685.js → 0ce2e7006253186a.js} +3 -3
  168. package/.next/static/chunks/{9f82d45ee88d5dc1.js → 0f9834bd2f6f4c6e.js} +2 -2
  169. package/.next/static/chunks/1958a10518af04a4.js +1 -0
  170. package/.next/static/chunks/3205a3bbc11c3146.css +1 -0
  171. package/.next/static/chunks/{ff0443d5f56a7060.js → 369aa92811a706db.js} +3 -3
  172. package/.next/static/chunks/4aab1f3ea2ed1aef.js +1 -0
  173. package/.next/static/chunks/5e0dada5236f9065.js +8 -0
  174. package/.next/static/chunks/{58e245f27f38e5ff.js → 73c13373731456db.js} +1 -1
  175. package/.next/static/chunks/977137e155012c13.js +1 -0
  176. package/.next/static/chunks/b18cc1247b979318.js +1 -0
  177. package/.next/static/chunks/b926978a88c43bac.js +3 -0
  178. package/.next/static/chunks/{bcc203fd591a3e1b.js → d09578ecf3b80b9d.js} +1 -1
  179. package/.next/static/chunks/d85a06040ea88b62.js +1 -0
  180. package/.next/static/chunks/{a29874cab09f6b0f.js → f7914ab5db08b8dd.js} +2 -2
  181. package/.next/static/chunks/{46c9f58659e11b7d.js → fa9e48c3aa7e4365.js} +1 -1
  182. package/package.json +1 -1
  183. package/.next/server/chunks/ssr/src_hooks_use-workspace-title_ts_9edd343b._.js +0 -3
  184. package/.next/server/chunks/ssr/src_hooks_use-workspace-title_ts_9edd343b._.js.map +0 -1
  185. package/.next/static/chunks/0eca2eff234acf1b.js +0 -1
  186. package/.next/static/chunks/47ad182e478611c4.css +0 -1
  187. package/.next/static/chunks/4b818f2593bc4300.js +0 -1
  188. package/.next/static/chunks/78859d33c5671d29.js +0 -8
  189. package/.next/static/chunks/94fb2462104985a8.js +0 -3
  190. package/.next/static/chunks/e152c322e888ccea.js +0 -1
  191. package/.next/static/chunks/fff7986d66d302cf.js +0 -1
  192. /package/.next/server/chunks/{[root-of-the-server]__82d53572._.js.map → [root-of-the-server]__187f37c1._.js.map} +0 -0
  193. /package/.next/server/chunks/{[root-of-the-server]__5349b858._.js.map → [root-of-the-server]__8de57231._.js.map} +0 -0
  194. /package/.next/static/{mx8z_YoNSm8FluLvondrw → gMV0bFe8zKqVaStUpkI04}/_buildManifest.js +0 -0
  195. /package/.next/static/{mx8z_YoNSm8FluLvondrw → gMV0bFe8zKqVaStUpkI04}/_clientMiddlewareManifest.json +0 -0
  196. /package/.next/static/{mx8z_YoNSm8FluLvondrw → gMV0bFe8zKqVaStUpkI04}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../node_modules/next/src/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.ts","../../../../node_modules/next/src/server/route-modules/app-page/vendored/ssr/react-dom.ts","../../../../node_modules/next/src/client/components/router-reducer/router-reducer-types.ts","../../../../node_modules/next/src/shared/lib/is-thenable.ts","../../../../node_modules/next/src/client/components/use-action-queue.ts","../../../../node_modules/next/src/client/app-call-server.ts","../../../../node_modules/next/src/client/app-find-source-map-url.ts","../../../../node_modules/next/src/shared/lib/utils/warn-once.ts","../../../../node_modules/next/src/shared/lib/deployment-id.ts","../../../../node_modules/next/src/client/use-merged-ref.ts","../../../../src/app/actions/data%3Ae1ff37%20%3Ctext/javascript%3E","../../../../src/app/actions/data%3Ac31e21%20%3Ctext/javascript%3E","../../../../node_modules/lucide-react/src/icons/key-round.ts"],"sourcesContent":["module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.ReactServerDOMTurbopackClient\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.ReactDOM\n","import type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../shared/lib/app-router-types'\nimport type { NavigationSeed } from '../segment-cache/navigation'\nimport type { FetchServerResponseResult } from './fetch-server-response'\n\nexport const ACTION_REFRESH = 'refresh'\nexport const ACTION_NAVIGATE = 'navigate'\nexport const ACTION_RESTORE = 'restore'\nexport const ACTION_SERVER_PATCH = 'server-patch'\nexport const ACTION_HMR_REFRESH = 'hmr-refresh'\nexport const ACTION_SERVER_ACTION = 'server-action'\n\nexport type RouterChangeByServerResponse = ({\n navigatedAt,\n previousTree,\n serverResponse,\n}: {\n navigatedAt: number\n previousTree: FlightRouterState\n serverResponse: FetchServerResponseResult\n}) => void\n\nexport interface Mutable {\n mpaNavigation?: boolean\n patchedTree?: FlightRouterState\n renderedSearch?: string\n canonicalUrl?: string\n scrollableSegments?: FlightSegmentPath[]\n pendingPush?: boolean\n cache?: CacheNode\n hashFragment?: string\n shouldScroll?: boolean\n preserveCustomHistoryState?: boolean\n onlyHashChange?: boolean\n collectedDebugInfo?: Array<unknown>\n}\n\nexport interface ServerActionMutable extends Mutable {\n inFlightServerAction?: Promise<any> | null\n}\n\n/**\n * Refresh triggers a refresh of the full page data.\n * - fetches the Flight data and fills rsc at the root of the cache.\n * - The router state is updated at the root.\n */\nexport interface RefreshAction {\n type: typeof ACTION_REFRESH\n}\n\nexport interface HmrRefreshAction {\n type: typeof ACTION_HMR_REFRESH\n}\n\nexport type ServerActionDispatcher = (\n args: Omit<\n ServerActionAction,\n 'type' | 'mutable' | 'navigate' | 'changeByServerResponse' | 'cache'\n >\n) => void\n\nexport interface ServerActionAction {\n type: typeof ACTION_SERVER_ACTION\n actionId: string\n actionArgs: any[]\n resolve: (value: any) => void\n reject: (reason?: any) => void\n didRevalidate?: boolean\n}\n\n/**\n * Navigate triggers a navigation to the provided url. It supports two types: `push` and `replace`.\n *\n * `navigateType`:\n * - `push` - pushes a new history entry in the browser history\n * - `replace` - replaces the current history entry in the browser history\n *\n * Navigate has multiple cache heuristics:\n * - page was prefetched\n * - Apply router state tree from prefetch\n * - Apply Flight data from prefetch to the cache\n * - If Flight data is a string, it's a redirect and the state is updated to trigger a redirect\n * - Check if hard navigation is needed\n * - Hard navigation happens when a dynamic parameter below the common layout changed\n * - When hard navigation is needed the cache is invalidated below the flightSegmentPath\n * - The missing cache nodes of the page will be fetched in layout-router and trigger the SERVER_PATCH action\n * - If hard navigation is not needed\n * - The cache is reused\n * - If any cache nodes are missing they'll be fetched in layout-router and trigger the SERVER_PATCH action\n * - page was not prefetched\n * - The navigate was called from `next/router` (`router.push()` / `router.replace()`) / `next/link` without prefetched data available (e.g. the prefetch didn't come back from the server before clicking the link)\n * - Flight data is fetched in the reducer (suspends the reducer)\n * - Router state tree is created based on Flight data\n * - Cache is filled based on the Flight data\n *\n * Above steps explain 3 cases:\n * - `soft` - Reuses the existing cache and fetches missing nodes in layout-router.\n * - `hard` - Creates a new cache where cache nodes are removed below the common layout and fetches missing nodes in layout-router.\n * - `optimistic` (explicit no prefetch) - Creates a new cache and kicks off the data fetch in the reducer. The data fetch is awaited in the layout-router.\n */\nexport interface NavigateAction {\n type: typeof ACTION_NAVIGATE\n url: URL\n isExternalUrl: boolean\n locationSearch: Location['search']\n navigateType: 'push' | 'replace'\n shouldScroll: boolean\n}\n\n/**\n * Restore applies the provided router state.\n * - Used for `popstate` (back/forward navigation) where a known router state has to be applied.\n * - Also used when syncing the router state with `pushState`/`replaceState` calls.\n * - Router state is applied as-is from the history state, if available.\n * - If the history state does not contain the router state, the existing router state is used.\n * - If any cache node is missing it will be fetched in layout-router during rendering and the server-patch case.\n * - If existing cache nodes match these are used.\n */\nexport interface RestoreAction {\n type: typeof ACTION_RESTORE\n url: URL\n historyState: AppHistoryState | undefined\n}\n\nexport type AppHistoryState = {\n tree: FlightRouterState\n renderedSearch: string\n}\n\n/**\n * Server-patch applies the provided Flight data to the cache and router tree.\n */\nexport interface ServerPatchAction {\n type: typeof ACTION_SERVER_PATCH\n previousTree: FlightRouterState\n url: URL\n nextUrl: string | null\n seed: NavigationSeed | null\n mpa: boolean\n}\n\n/**\n * PrefetchKind defines the type of prefetching that should be done.\n * - `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully.\n * - `full` - prefetch the page data fully.\n */\n\nexport enum PrefetchKind {\n AUTO = 'auto',\n FULL = 'full',\n}\n\n/**\n * Prefetch adds the provided FlightData to the prefetch cache\n * - Creates the router state tree based on the patch in FlightData\n * - Adds the FlightData to the prefetch cache\n * - In ACTION_NAVIGATE the prefetch cache is checked and the router state tree and FlightData are applied.\n */\n\nexport interface PushRef {\n /**\n * If the app-router should push a new history entry in app-router's useEffect()\n */\n pendingPush: boolean\n /**\n * Multi-page navigation through location.href.\n */\n mpaNavigation: boolean\n /**\n * Skip applying the router state to the browser history state.\n */\n preserveCustomHistoryState: boolean\n}\n\nexport type FocusAndScrollRef = {\n /**\n * If focus and scroll should be set in the layout-router's useEffect()\n */\n apply: boolean\n /**\n * The hash fragment that should be scrolled to.\n */\n hashFragment: string | null\n /**\n * The paths of the segments that should be focused.\n */\n segmentPaths: FlightSegmentPath[]\n /**\n * If only the URLs hash fragment changed\n */\n onlyHashChange: boolean\n}\n\n/**\n * Handles keeping the state of app-router.\n */\nexport type AppRouterState = {\n /**\n * The router state, this is written into the history state in app-router using replaceState/pushState.\n * - Has to be serializable as it is written into the history state.\n * - Holds which segments and parallel routes are shown on the screen.\n */\n tree: FlightRouterState\n /**\n * The cache holds React nodes for every segment that is shown on screen as well as previously shown segments.\n * It also holds in-progress data requests.\n */\n cache: CacheNode\n /**\n * Decides if the update should create a new history entry and if the navigation has to trigger a browser navigation.\n */\n pushRef: PushRef\n /**\n * Decides if the update should apply scroll and focus management.\n */\n focusAndScrollRef: FocusAndScrollRef\n /**\n * The canonical url that is pushed/replaced.\n * - This is the url you see in the browser.\n */\n canonicalUrl: string\n renderedSearch: string\n /**\n * The underlying \"url\" representing the UI state, which is used for intercepting routes.\n */\n nextUrl: string | null\n\n /**\n * The previous next-url that was used previous to a dynamic navigation.\n */\n previousNextUrl: string | null\n\n debugInfo: Array<unknown> | null\n}\n\nexport type ReadonlyReducerState = Readonly<AppRouterState>\nexport type ReducerState =\n | (Promise<AppRouterState> & { _debugInfo?: Array<unknown> })\n | AppRouterState\nexport type ReducerActions = Readonly<\n | RefreshAction\n | NavigateAction\n | RestoreAction\n | ServerPatchAction\n | HmrRefreshAction\n | ServerActionAction\n>\n","/**\n * Check to see if a value is Thenable.\n *\n * @param promise the maybe-thenable value\n * @returns true if the value is thenable\n */\nexport function isThenable<T = unknown>(\n promise: Promise<T> | T\n): promise is Promise<T> {\n return (\n promise !== null &&\n typeof promise === 'object' &&\n 'then' in promise &&\n typeof promise.then === 'function'\n )\n}\n","import type { Dispatch } from 'react'\nimport React, { use, useMemo } from 'react'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport type { AppRouterActionQueue } from './app-router-instance'\nimport type {\n AppRouterState,\n ReducerActions,\n ReducerState,\n} from './router-reducer/router-reducer-types'\n\n// The app router state lives outside of React, so we can import the dispatch\n// method directly wherever we need it, rather than passing it around via props\n// or context.\nlet dispatch: Dispatch<ReducerActions> | null = null\n\nexport function dispatchAppRouterAction(action: ReducerActions) {\n if (dispatch === null) {\n throw new Error(\n 'Internal Next.js error: Router action dispatched before initialization.'\n )\n }\n dispatch(action)\n}\n\nconst __DEV__ = process.env.NODE_ENV !== 'production'\nconst promisesWithDebugInfo: WeakMap<\n Promise<AppRouterState>,\n Promise<AppRouterState> & { _debugInfo?: Array<unknown> }\n> = __DEV__ ? new WeakMap() : (null as any)\n\nexport function useActionQueue(\n actionQueue: AppRouterActionQueue\n): AppRouterState {\n const [state, setState] = React.useState<ReducerState>(actionQueue.state)\n\n // Because of a known issue that requires to decode Flight streams inside the\n // render phase, we have to be a bit clever and assign the dispatch method to\n // a module-level variable upon initialization. The useState hook in this\n // module only exists to synchronize state that lives outside of React.\n // Ideally, what we'd do instead is pass the state as a prop to root.render;\n // this is conceptually how we're modeling the app router state, despite the\n // weird implementation details.\n if (process.env.NODE_ENV !== 'production') {\n const { useAppDevRenderingIndicator } =\n require('../../next-devtools/userspace/use-app-dev-rendering-indicator') as typeof import('../../next-devtools/userspace/use-app-dev-rendering-indicator')\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const appDevRenderingIndicator = useAppDevRenderingIndicator()\n\n dispatch = (action: ReducerActions) => {\n appDevRenderingIndicator(() => {\n actionQueue.dispatch(action, setState)\n })\n }\n } else {\n dispatch = (action: ReducerActions) =>\n actionQueue.dispatch(action, setState)\n }\n\n // When navigating to a non-prefetched route, then App Router state will be\n // blocked until the server responds. We need to transfer the `_debugInfo`\n // from the underlying Flight response onto the top-level promise that is\n // passed to React (via `use`) so that the latency is accurately represented\n // in the React DevTools.\n const stateWithDebugInfo = useMemo(() => {\n if (!__DEV__) {\n return state\n }\n\n if (isThenable(state)) {\n // useMemo can't be used to cache a Promise since the memoized value is thrown\n // away when we suspend. So we use a WeakMap to cache the Promise with debug info.\n let promiseWithDebugInfo = promisesWithDebugInfo.get(state)\n if (promiseWithDebugInfo === undefined) {\n const debugInfo: Array<unknown> = []\n promiseWithDebugInfo = Promise.resolve(state).then((asyncState) => {\n if (asyncState.debugInfo !== null) {\n debugInfo.push(...asyncState.debugInfo)\n }\n return asyncState\n }) as Promise<AppRouterState> & { _debugInfo?: Array<unknown> }\n promiseWithDebugInfo._debugInfo = debugInfo\n\n promisesWithDebugInfo.set(state, promiseWithDebugInfo)\n }\n\n return promiseWithDebugInfo\n }\n return state\n }, [state])\n\n return isThenable(stateWithDebugInfo)\n ? use(stateWithDebugInfo)\n : stateWithDebugInfo\n}\n","import { startTransition } from 'react'\nimport { ACTION_SERVER_ACTION } from './components/router-reducer/router-reducer-types'\nimport { dispatchAppRouterAction } from './components/use-action-queue'\n\nexport async function callServer(actionId: string, actionArgs: any[]) {\n return new Promise((resolve, reject) => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_SERVER_ACTION,\n actionId,\n actionArgs,\n resolve,\n reject,\n })\n })\n })\n}\n","const basePath = process.env.__NEXT_ROUTER_BASEPATH || ''\nconst pathname = `${basePath}/__nextjs_source-map`\n\nexport const findSourceMapURL =\n process.env.NODE_ENV === 'development'\n ? function findSourceMapURL(filename: string): string | null {\n if (filename === '') {\n return null\n }\n\n if (\n filename.startsWith(document.location.origin) &&\n filename.includes('/_next/static')\n ) {\n // This is a request for a client chunk. This can only happen when\n // using Turbopack. In this case, since we control how those source\n // maps are generated, we can safely assume that the sourceMappingURL\n // is relative to the filename, with an added `.map` extension. The\n // browser can just request this file, and it gets served through the\n // normal dev server, without the need to route this through\n // the `/__nextjs_source-map` dev middleware.\n return `${filename}.map`\n }\n\n const url = new URL(pathname, document.location.origin)\n url.searchParams.set('filename', filename)\n\n return url.href\n }\n : undefined\n","let warnOnce = (_: string) => {}\nif (process.env.NODE_ENV !== 'production') {\n const warnings = new Set<string>()\n warnOnce = (msg: string) => {\n if (!warnings.has(msg)) {\n console.warn(msg)\n }\n warnings.add(msg)\n }\n}\n\nexport { warnOnce }\n","// This could also be a variable instead of a function, but some unit tests want to change the ID at\n// runtime. Even though that would never happen in a real deployment.\nexport function getDeploymentId(): string | undefined {\n return process.env.NEXT_DEPLOYMENT_ID\n}\n\nexport function getDeploymentIdQueryOrEmptyString(): string {\n let deploymentId = getDeploymentId()\n if (deploymentId) {\n return `?dpl=${deploymentId}`\n }\n return ''\n}\n","import { useCallback, useRef, type Ref } from 'react'\n\n// This is a compatibility hook to support React 18 and 19 refs.\n// In 19, a cleanup function from refs may be returned.\n// In 18, returning a cleanup function creates a warning.\n// Since we take userspace refs, we don't know ahead of time if a cleanup function will be returned.\n// This implements cleanup functions with the old behavior in 18.\n// We know refs are always called alternating with `null` and then `T`.\n// So a call with `null` means we need to call the previous cleanup functions.\nexport function useMergedRef<TElement>(\n refA: Ref<TElement>,\n refB: Ref<TElement>\n): Ref<TElement> {\n const cleanupA = useRef<(() => void) | null>(null)\n const cleanupB = useRef<(() => void) | null>(null)\n\n // NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.\n // (this happens often if the user doesn't pass a ref to Link/Form/Image)\n // But this can cause us to leak a cleanup-ref into user code (previously via `<Link legacyBehavior>`),\n // and the user might pass that ref into ref-merging library that doesn't support cleanup refs\n // (because it hasn't been updated for React 19)\n // which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.\n // So in practice, it's safer to be defensive and always wrap the ref, even on React 19.\n return useCallback(\n (current: TElement | null): void => {\n if (current === null) {\n const cleanupFnA = cleanupA.current\n if (cleanupFnA) {\n cleanupA.current = null\n cleanupFnA()\n }\n const cleanupFnB = cleanupB.current\n if (cleanupFnB) {\n cleanupB.current = null\n cleanupFnB()\n }\n } else {\n if (refA) {\n cleanupA.current = applyRef(refA, current)\n }\n if (refB) {\n cleanupB.current = applyRef(refB, current)\n }\n }\n },\n [refA, refB]\n )\n}\n\nfunction applyRef<TElement>(\n refA: NonNullable<Ref<TElement>>,\n current: TElement\n) {\n if (typeof refA === 'function') {\n const cleanup = refA(current)\n if (typeof cleanup === 'function') {\n return cleanup\n } else {\n return () => refA(null)\n }\n } else {\n refA.current = current\n return () => {\n refA.current = null\n }\n }\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"006b7a10f839b3ad9a8e3cb7090a78f9691c43c62f\":\"listAgentApiCredentials\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_3=/*#__PURE__*/createServerReference(\"006b7a10f839b3ad9a8e3cb7090a78f9691c43c62f\",callServer,void 0,findSourceMapURL,\"listAgentApiCredentials\");export{$$RSC_SERVER_ACTION_3 as listAgentApiCredentials};","/* __next_internal_action_entry_do_not_use__ [{\"008c06297149d94056cb210d81ed9e5e14c82c759a\":\"listCredentials\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"008c06297149d94056cb210d81ed9e5e14c82c759a\",callServer,void 0,findSourceMapURL,\"listCredentials\");export{$$RSC_SERVER_ACTION_0 as listCredentials};","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z',\n key: '1s6t7t',\n },\n ],\n ['circle', { cx: '16.5', cy: '7.5', r: '.5', fill: 'currentColor', key: 'w0ekpg' }],\n];\n\n/**\n * @component @name KeyRound\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMi41ODYgMTcuNDE0QTIgMiAwIDAgMCAyIDE4LjgyOFYyMWExIDEgMCAwIDAgMSAxaDNhMSAxIDAgMCAwIDEtMXYtMWExIDEgMCAwIDEgMS0xaDFhMSAxIDAgMCAwIDEtMXYtMWExIDEgMCAwIDEgMS0xaC4xNzJhMiAyIDAgMCAwIDEuNDE0LS41ODZsLjgxNC0uODE0YTYuNSA2LjUgMCAxIDAtNC00eiIgLz4KICA8Y2lyY2xlIGN4PSIxNi41IiBjeT0iNy41IiByPSIuNSIgZmlsbD0iY3VycmVudENvbG9yIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/key-round\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst KeyRound = createLucideIcon('key-round', __iconNode);\n\nexport default KeyRound;\n"],"names":["module","exports","require","vendored","ReactServerDOMTurbopackClient","ReactDOM","ACTION_HMR_REFRESH","ACTION_NAVIGATE","ACTION_REFRESH","ACTION_RESTORE","ACTION_SERVER_ACTION","ACTION_SERVER_PATCH","PrefetchKind","isThenable","promise","then","dispatchAppRouterAction","useActionQueue","dispatch","action","Error","__DEV__","process","env","NODE_ENV","promisesWithDebugInfo","WeakMap","actionQueue","state","setState","React","useState","useAppDevRenderingIndicator","appDevRenderingIndicator","stateWithDebugInfo","useMemo","promiseWithDebugInfo","get","undefined","debugInfo","Promise","resolve","asyncState","push","_debugInfo","set","use","callServer","actionId","actionArgs","reject","startTransition","type","findSourceMapURL","basePath","__NEXT_ROUTER_BASEPATH","pathname","filename","startsWith","document","location","origin","includes","url","URL","searchParams","href","warnOnce","_","warnings","Set","msg","has","console","warn","add","getDeploymentId","getDeploymentIdQueryOrEmptyString","NEXT_DEPLOYMENT_ID","deploymentId","useMergedRef","refA","refB","cleanupA","useRef","cleanupB","useCallback","current","cleanupFnA","cleanupFnB","applyRef","cleanup"],"mappings":"6CAAAA,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRC,QAAQ,CAAC,YAAY,CAAEC,6BAA6B,+BCFtDJ,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRC,QAAQ,CAAC,YAAY,CAAEE,QAAQ,oFCoJrBO,KA1ICN,OA0IDM,WA1ImB,CAAA,kBAAlBN,GAHAC,eAAe,CAAA,kBAAfA,GADAC,cAAc,CAAA,kBAAdA,GAEAC,cAAc,CAAA,kBAAdA,GAGAC,oBAAoB,CAAA,kBAApBA,GAFAC,mBAAmB,CAAA,kBAAnBA,GA2IDC,YAAY,CAAA,kBAAZA,uEA9IL,IAAMJ,EAAiB,UACjBD,EAAkB,WAClBE,EAAiB,UACjBE,EAAsB,eACtBL,EAAqB,cACrBI,EAAuB,gBAyI7B,IAAKE,eAAAA,WAAAA,GAAAA,OAA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AAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACH,GAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAET,CACA,CAAC,QAAA,CAAA,AAAU,CAAA,AAAE,EAAA,CAAA,AAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,AAAR,CAAQ,CAAA,CAAA,AAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,AAAG,CAAA,CAAA,CAAA,CAAA,CAAA,AAAM,CAAA,CAAA,CAAA,CAAA,CAAA,AAAM,cAAA,CAAA,AAAgB,CAAA,CAAA,CAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CACpF","ignoreList":[0,1,2,3,4,5,6,7,8,9,12]}
1
+ {"version":3,"sources":["../../../../node_modules/next/src/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.ts","../../../../node_modules/next/src/server/route-modules/app-page/vendored/ssr/react-dom.ts","../../../../node_modules/next/src/client/components/router-reducer/router-reducer-types.ts","../../../../node_modules/next/src/shared/lib/is-thenable.ts","../../../../node_modules/next/src/client/components/use-action-queue.ts","../../../../node_modules/next/src/client/app-call-server.ts","../../../../node_modules/next/src/client/app-find-source-map-url.ts","../../../../node_modules/next/src/shared/lib/utils/warn-once.ts","../../../../node_modules/next/src/shared/lib/deployment-id.ts","../../../../node_modules/next/src/client/use-merged-ref.ts","../../../../src/app/actions/data%3A5bf445%20%3Ctext/javascript%3E","../../../../src/app/actions/data%3A6a6331%20%3Ctext/javascript%3E","../../../../node_modules/lucide-react/src/icons/key-round.ts"],"sourcesContent":["module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.ReactServerDOMTurbopackClient\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.ReactDOM\n","import type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../shared/lib/app-router-types'\nimport type { NavigationSeed } from '../segment-cache/navigation'\nimport type { FetchServerResponseResult } from './fetch-server-response'\n\nexport const ACTION_REFRESH = 'refresh'\nexport const ACTION_NAVIGATE = 'navigate'\nexport const ACTION_RESTORE = 'restore'\nexport const ACTION_SERVER_PATCH = 'server-patch'\nexport const ACTION_HMR_REFRESH = 'hmr-refresh'\nexport const ACTION_SERVER_ACTION = 'server-action'\n\nexport type RouterChangeByServerResponse = ({\n navigatedAt,\n previousTree,\n serverResponse,\n}: {\n navigatedAt: number\n previousTree: FlightRouterState\n serverResponse: FetchServerResponseResult\n}) => void\n\nexport interface Mutable {\n mpaNavigation?: boolean\n patchedTree?: FlightRouterState\n renderedSearch?: string\n canonicalUrl?: string\n scrollableSegments?: FlightSegmentPath[]\n pendingPush?: boolean\n cache?: CacheNode\n hashFragment?: string\n shouldScroll?: boolean\n preserveCustomHistoryState?: boolean\n onlyHashChange?: boolean\n collectedDebugInfo?: Array<unknown>\n}\n\nexport interface ServerActionMutable extends Mutable {\n inFlightServerAction?: Promise<any> | null\n}\n\n/**\n * Refresh triggers a refresh of the full page data.\n * - fetches the Flight data and fills rsc at the root of the cache.\n * - The router state is updated at the root.\n */\nexport interface RefreshAction {\n type: typeof ACTION_REFRESH\n}\n\nexport interface HmrRefreshAction {\n type: typeof ACTION_HMR_REFRESH\n}\n\nexport type ServerActionDispatcher = (\n args: Omit<\n ServerActionAction,\n 'type' | 'mutable' | 'navigate' | 'changeByServerResponse' | 'cache'\n >\n) => void\n\nexport interface ServerActionAction {\n type: typeof ACTION_SERVER_ACTION\n actionId: string\n actionArgs: any[]\n resolve: (value: any) => void\n reject: (reason?: any) => void\n didRevalidate?: boolean\n}\n\n/**\n * Navigate triggers a navigation to the provided url. It supports two types: `push` and `replace`.\n *\n * `navigateType`:\n * - `push` - pushes a new history entry in the browser history\n * - `replace` - replaces the current history entry in the browser history\n *\n * Navigate has multiple cache heuristics:\n * - page was prefetched\n * - Apply router state tree from prefetch\n * - Apply Flight data from prefetch to the cache\n * - If Flight data is a string, it's a redirect and the state is updated to trigger a redirect\n * - Check if hard navigation is needed\n * - Hard navigation happens when a dynamic parameter below the common layout changed\n * - When hard navigation is needed the cache is invalidated below the flightSegmentPath\n * - The missing cache nodes of the page will be fetched in layout-router and trigger the SERVER_PATCH action\n * - If hard navigation is not needed\n * - The cache is reused\n * - If any cache nodes are missing they'll be fetched in layout-router and trigger the SERVER_PATCH action\n * - page was not prefetched\n * - The navigate was called from `next/router` (`router.push()` / `router.replace()`) / `next/link` without prefetched data available (e.g. the prefetch didn't come back from the server before clicking the link)\n * - Flight data is fetched in the reducer (suspends the reducer)\n * - Router state tree is created based on Flight data\n * - Cache is filled based on the Flight data\n *\n * Above steps explain 3 cases:\n * - `soft` - Reuses the existing cache and fetches missing nodes in layout-router.\n * - `hard` - Creates a new cache where cache nodes are removed below the common layout and fetches missing nodes in layout-router.\n * - `optimistic` (explicit no prefetch) - Creates a new cache and kicks off the data fetch in the reducer. The data fetch is awaited in the layout-router.\n */\nexport interface NavigateAction {\n type: typeof ACTION_NAVIGATE\n url: URL\n isExternalUrl: boolean\n locationSearch: Location['search']\n navigateType: 'push' | 'replace'\n shouldScroll: boolean\n}\n\n/**\n * Restore applies the provided router state.\n * - Used for `popstate` (back/forward navigation) where a known router state has to be applied.\n * - Also used when syncing the router state with `pushState`/`replaceState` calls.\n * - Router state is applied as-is from the history state, if available.\n * - If the history state does not contain the router state, the existing router state is used.\n * - If any cache node is missing it will be fetched in layout-router during rendering and the server-patch case.\n * - If existing cache nodes match these are used.\n */\nexport interface RestoreAction {\n type: typeof ACTION_RESTORE\n url: URL\n historyState: AppHistoryState | undefined\n}\n\nexport type AppHistoryState = {\n tree: FlightRouterState\n renderedSearch: string\n}\n\n/**\n * Server-patch applies the provided Flight data to the cache and router tree.\n */\nexport interface ServerPatchAction {\n type: typeof ACTION_SERVER_PATCH\n previousTree: FlightRouterState\n url: URL\n nextUrl: string | null\n seed: NavigationSeed | null\n mpa: boolean\n}\n\n/**\n * PrefetchKind defines the type of prefetching that should be done.\n * - `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully.\n * - `full` - prefetch the page data fully.\n */\n\nexport enum PrefetchKind {\n AUTO = 'auto',\n FULL = 'full',\n}\n\n/**\n * Prefetch adds the provided FlightData to the prefetch cache\n * - Creates the router state tree based on the patch in FlightData\n * - Adds the FlightData to the prefetch cache\n * - In ACTION_NAVIGATE the prefetch cache is checked and the router state tree and FlightData are applied.\n */\n\nexport interface PushRef {\n /**\n * If the app-router should push a new history entry in app-router's useEffect()\n */\n pendingPush: boolean\n /**\n * Multi-page navigation through location.href.\n */\n mpaNavigation: boolean\n /**\n * Skip applying the router state to the browser history state.\n */\n preserveCustomHistoryState: boolean\n}\n\nexport type FocusAndScrollRef = {\n /**\n * If focus and scroll should be set in the layout-router's useEffect()\n */\n apply: boolean\n /**\n * The hash fragment that should be scrolled to.\n */\n hashFragment: string | null\n /**\n * The paths of the segments that should be focused.\n */\n segmentPaths: FlightSegmentPath[]\n /**\n * If only the URLs hash fragment changed\n */\n onlyHashChange: boolean\n}\n\n/**\n * Handles keeping the state of app-router.\n */\nexport type AppRouterState = {\n /**\n * The router state, this is written into the history state in app-router using replaceState/pushState.\n * - Has to be serializable as it is written into the history state.\n * - Holds which segments and parallel routes are shown on the screen.\n */\n tree: FlightRouterState\n /**\n * The cache holds React nodes for every segment that is shown on screen as well as previously shown segments.\n * It also holds in-progress data requests.\n */\n cache: CacheNode\n /**\n * Decides if the update should create a new history entry and if the navigation has to trigger a browser navigation.\n */\n pushRef: PushRef\n /**\n * Decides if the update should apply scroll and focus management.\n */\n focusAndScrollRef: FocusAndScrollRef\n /**\n * The canonical url that is pushed/replaced.\n * - This is the url you see in the browser.\n */\n canonicalUrl: string\n renderedSearch: string\n /**\n * The underlying \"url\" representing the UI state, which is used for intercepting routes.\n */\n nextUrl: string | null\n\n /**\n * The previous next-url that was used previous to a dynamic navigation.\n */\n previousNextUrl: string | null\n\n debugInfo: Array<unknown> | null\n}\n\nexport type ReadonlyReducerState = Readonly<AppRouterState>\nexport type ReducerState =\n | (Promise<AppRouterState> & { _debugInfo?: Array<unknown> })\n | AppRouterState\nexport type ReducerActions = Readonly<\n | RefreshAction\n | NavigateAction\n | RestoreAction\n | ServerPatchAction\n | HmrRefreshAction\n | ServerActionAction\n>\n","/**\n * Check to see if a value is Thenable.\n *\n * @param promise the maybe-thenable value\n * @returns true if the value is thenable\n */\nexport function isThenable<T = unknown>(\n promise: Promise<T> | T\n): promise is Promise<T> {\n return (\n promise !== null &&\n typeof promise === 'object' &&\n 'then' in promise &&\n typeof promise.then === 'function'\n )\n}\n","import type { Dispatch } from 'react'\nimport React, { use, useMemo } from 'react'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport type { AppRouterActionQueue } from './app-router-instance'\nimport type {\n AppRouterState,\n ReducerActions,\n ReducerState,\n} from './router-reducer/router-reducer-types'\n\n// The app router state lives outside of React, so we can import the dispatch\n// method directly wherever we need it, rather than passing it around via props\n// or context.\nlet dispatch: Dispatch<ReducerActions> | null = null\n\nexport function dispatchAppRouterAction(action: ReducerActions) {\n if (dispatch === null) {\n throw new Error(\n 'Internal Next.js error: Router action dispatched before initialization.'\n )\n }\n dispatch(action)\n}\n\nconst __DEV__ = process.env.NODE_ENV !== 'production'\nconst promisesWithDebugInfo: WeakMap<\n Promise<AppRouterState>,\n Promise<AppRouterState> & { _debugInfo?: Array<unknown> }\n> = __DEV__ ? new WeakMap() : (null as any)\n\nexport function useActionQueue(\n actionQueue: AppRouterActionQueue\n): AppRouterState {\n const [state, setState] = React.useState<ReducerState>(actionQueue.state)\n\n // Because of a known issue that requires to decode Flight streams inside the\n // render phase, we have to be a bit clever and assign the dispatch method to\n // a module-level variable upon initialization. The useState hook in this\n // module only exists to synchronize state that lives outside of React.\n // Ideally, what we'd do instead is pass the state as a prop to root.render;\n // this is conceptually how we're modeling the app router state, despite the\n // weird implementation details.\n if (process.env.NODE_ENV !== 'production') {\n const { useAppDevRenderingIndicator } =\n require('../../next-devtools/userspace/use-app-dev-rendering-indicator') as typeof import('../../next-devtools/userspace/use-app-dev-rendering-indicator')\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const appDevRenderingIndicator = useAppDevRenderingIndicator()\n\n dispatch = (action: ReducerActions) => {\n appDevRenderingIndicator(() => {\n actionQueue.dispatch(action, setState)\n })\n }\n } else {\n dispatch = (action: ReducerActions) =>\n actionQueue.dispatch(action, setState)\n }\n\n // When navigating to a non-prefetched route, then App Router state will be\n // blocked until the server responds. We need to transfer the `_debugInfo`\n // from the underlying Flight response onto the top-level promise that is\n // passed to React (via `use`) so that the latency is accurately represented\n // in the React DevTools.\n const stateWithDebugInfo = useMemo(() => {\n if (!__DEV__) {\n return state\n }\n\n if (isThenable(state)) {\n // useMemo can't be used to cache a Promise since the memoized value is thrown\n // away when we suspend. So we use a WeakMap to cache the Promise with debug info.\n let promiseWithDebugInfo = promisesWithDebugInfo.get(state)\n if (promiseWithDebugInfo === undefined) {\n const debugInfo: Array<unknown> = []\n promiseWithDebugInfo = Promise.resolve(state).then((asyncState) => {\n if (asyncState.debugInfo !== null) {\n debugInfo.push(...asyncState.debugInfo)\n }\n return asyncState\n }) as Promise<AppRouterState> & { _debugInfo?: Array<unknown> }\n promiseWithDebugInfo._debugInfo = debugInfo\n\n promisesWithDebugInfo.set(state, promiseWithDebugInfo)\n }\n\n return promiseWithDebugInfo\n }\n return state\n }, [state])\n\n return isThenable(stateWithDebugInfo)\n ? use(stateWithDebugInfo)\n : stateWithDebugInfo\n}\n","import { startTransition } from 'react'\nimport { ACTION_SERVER_ACTION } from './components/router-reducer/router-reducer-types'\nimport { dispatchAppRouterAction } from './components/use-action-queue'\n\nexport async function callServer(actionId: string, actionArgs: any[]) {\n return new Promise((resolve, reject) => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_SERVER_ACTION,\n actionId,\n actionArgs,\n resolve,\n reject,\n })\n })\n })\n}\n","const basePath = process.env.__NEXT_ROUTER_BASEPATH || ''\nconst pathname = `${basePath}/__nextjs_source-map`\n\nexport const findSourceMapURL =\n process.env.NODE_ENV === 'development'\n ? function findSourceMapURL(filename: string): string | null {\n if (filename === '') {\n return null\n }\n\n if (\n filename.startsWith(document.location.origin) &&\n filename.includes('/_next/static')\n ) {\n // This is a request for a client chunk. This can only happen when\n // using Turbopack. In this case, since we control how those source\n // maps are generated, we can safely assume that the sourceMappingURL\n // is relative to the filename, with an added `.map` extension. The\n // browser can just request this file, and it gets served through the\n // normal dev server, without the need to route this through\n // the `/__nextjs_source-map` dev middleware.\n return `${filename}.map`\n }\n\n const url = new URL(pathname, document.location.origin)\n url.searchParams.set('filename', filename)\n\n return url.href\n }\n : undefined\n","let warnOnce = (_: string) => {}\nif (process.env.NODE_ENV !== 'production') {\n const warnings = new Set<string>()\n warnOnce = (msg: string) => {\n if (!warnings.has(msg)) {\n console.warn(msg)\n }\n warnings.add(msg)\n }\n}\n\nexport { warnOnce }\n","// This could also be a variable instead of a function, but some unit tests want to change the ID at\n// runtime. Even though that would never happen in a real deployment.\nexport function getDeploymentId(): string | undefined {\n return process.env.NEXT_DEPLOYMENT_ID\n}\n\nexport function getDeploymentIdQueryOrEmptyString(): string {\n let deploymentId = getDeploymentId()\n if (deploymentId) {\n return `?dpl=${deploymentId}`\n }\n return ''\n}\n","import { useCallback, useRef, type Ref } from 'react'\n\n// This is a compatibility hook to support React 18 and 19 refs.\n// In 19, a cleanup function from refs may be returned.\n// In 18, returning a cleanup function creates a warning.\n// Since we take userspace refs, we don't know ahead of time if a cleanup function will be returned.\n// This implements cleanup functions with the old behavior in 18.\n// We know refs are always called alternating with `null` and then `T`.\n// So a call with `null` means we need to call the previous cleanup functions.\nexport function useMergedRef<TElement>(\n refA: Ref<TElement>,\n refB: Ref<TElement>\n): Ref<TElement> {\n const cleanupA = useRef<(() => void) | null>(null)\n const cleanupB = useRef<(() => void) | null>(null)\n\n // NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.\n // (this happens often if the user doesn't pass a ref to Link/Form/Image)\n // But this can cause us to leak a cleanup-ref into user code (previously via `<Link legacyBehavior>`),\n // and the user might pass that ref into ref-merging library that doesn't support cleanup refs\n // (because it hasn't been updated for React 19)\n // which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.\n // So in practice, it's safer to be defensive and always wrap the ref, even on React 19.\n return useCallback(\n (current: TElement | null): void => {\n if (current === null) {\n const cleanupFnA = cleanupA.current\n if (cleanupFnA) {\n cleanupA.current = null\n cleanupFnA()\n }\n const cleanupFnB = cleanupB.current\n if (cleanupFnB) {\n cleanupB.current = null\n cleanupFnB()\n }\n } else {\n if (refA) {\n cleanupA.current = applyRef(refA, current)\n }\n if (refB) {\n cleanupB.current = applyRef(refB, current)\n }\n }\n },\n [refA, refB]\n )\n}\n\nfunction applyRef<TElement>(\n refA: NonNullable<Ref<TElement>>,\n current: TElement\n) {\n if (typeof refA === 'function') {\n const cleanup = refA(current)\n if (typeof cleanup === 'function') {\n return cleanup\n } else {\n return () => refA(null)\n }\n } else {\n refA.current = current\n return () => {\n refA.current = null\n }\n }\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"001b884a80812d1f61dbae458988c02181906ec73c\":\"listAgentApiCredentials\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_3=/*#__PURE__*/createServerReference(\"001b884a80812d1f61dbae458988c02181906ec73c\",callServer,void 0,findSourceMapURL,\"listAgentApiCredentials\");export{$$RSC_SERVER_ACTION_3 as listAgentApiCredentials};","/* __next_internal_action_entry_do_not_use__ [{\"0024cd8264923ac29ca23ec9b72eb8f41d4e4f5b3c\":\"listCredentials\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"0024cd8264923ac29ca23ec9b72eb8f41d4e4f5b3c\",callServer,void 0,findSourceMapURL,\"listCredentials\");export{$$RSC_SERVER_ACTION_0 as listCredentials};","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z',\n key: '1s6t7t',\n },\n ],\n ['circle', { cx: '16.5', cy: '7.5', r: '.5', fill: 'currentColor', key: 'w0ekpg' }],\n];\n\n/**\n * @component @name KeyRound\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMi41ODYgMTcuNDE0QTIgMiAwIDAgMCAyIDE4LjgyOFYyMWExIDEgMCAwIDAgMSAxaDNhMSAxIDAgMCAwIDEtMXYtMWExIDEgMCAwIDEgMS0xaDFhMSAxIDAgMCAwIDEtMXYtMWExIDEgMCAwIDEgMS0xaC4xNzJhMiAyIDAgMCAwIDEuNDE0LS41ODZsLjgxNC0uODE0YTYuNSA2LjUgMCAxIDAtNC00eiIgLz4KICA8Y2lyY2xlIGN4PSIxNi41IiBjeT0iNy41IiByPSIuNSIgZmlsbD0iY3VycmVudENvbG9yIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/key-round\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst KeyRound = createLucideIcon('key-round', __iconNode);\n\nexport default KeyRound;\n"],"names":["module","exports","require","vendored","ReactServerDOMTurbopackClient","ReactDOM","ACTION_HMR_REFRESH","ACTION_NAVIGATE","ACTION_REFRESH","ACTION_RESTORE","ACTION_SERVER_ACTION","ACTION_SERVER_PATCH","PrefetchKind","isThenable","promise","then","dispatchAppRouterAction","useActionQueue","dispatch","action","Error","__DEV__","process","env","NODE_ENV","promisesWithDebugInfo","WeakMap","actionQueue","state","setState","React","useState","useAppDevRenderingIndicator","appDevRenderingIndicator","stateWithDebugInfo","useMemo","promiseWithDebugInfo","get","undefined","debugInfo","Promise","resolve","asyncState","push","_debugInfo","set","use","callServer","actionId","actionArgs","reject","startTransition","type","findSourceMapURL","basePath","__NEXT_ROUTER_BASEPATH","pathname","filename","startsWith","document","location","origin","includes","url","URL","searchParams","href","warnOnce","_","warnings","Set","msg","has","console","warn","add","getDeploymentId","getDeploymentIdQueryOrEmptyString","NEXT_DEPLOYMENT_ID","deploymentId","useMergedRef","refA","refB","cleanupA","useRef","cleanupB","useCallback","current","cleanupFnA","cleanupFnB","applyRef","cleanup"],"mappings":"6CAAAA,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRC,QAAQ,CAAC,YAAY,CAAEC,6BAA6B,+BCFtDJ,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRC,QAAQ,CAAC,YAAY,CAAEE,QAAQ,oFCoJrBO,KA1ICN,OA0IDM,WA1ImB,CAAA,kBAAlBN,GAHAC,eAAe,CAAA,kBAAfA,GADAC,cAAc,CAAA,kBAAdA,GAEAC,cAAc,CAAA,kBAAdA,GAGAC,oBAAoB,CAAA,kBAApBA,GAFAC,mBAAmB,CAAA,kBAAnBA,GA2IDC,YAAY,CAAA,kBAAZA,uEA9IL,IAAMJ,EAAiB,UACjBD,EAAkB,WAClBE,EAAiB,UACjBE,EAAsB,eACtBL,EAAqB,cACrBI,EAAuB,gBAyI7B,IAAKE,eAAAA,WAAAA,GAAAA,OAAAA,wPChJL,SAASC,EACdC,CAAuB,EAEvB,OACc,OAAZA,GACA,AAAmB,iBAAZA,GACP,SAAUA,GACc,YAAxB,OAAOA,EAAQC,IAAI,AAEvB,CAVC,OAAA,cAAA,CAAA,EAAA,aAAA,oCACeF,aAAAA,qCAAAA,2FCSAG,uBAAuB,CAAA,kBAAvBA,GAeAC,cAAc,CAAA,kBAAdA,4FA7BoB,CAAA,CAAA,IAAA,QACT,CAAA,CAAA,IAAA,GAWvBC,EAA4C,KAEzC,SAASF,EAAwBG,CAAsB,EAC5D,GAAiB,MAAM,CAAnBD,EACF,MAAM,OAAA,cAEL,CAFK,AAAIE,MACR,2EADI,oBAAA,OAAA,mBAAA,gBAAA,CAEN,GAEFF,EAASC,EACX,CAQO,SAASF,EACdU,CAAiC,EAEjC,GAAM,CAAC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AA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAET,CACA,CAAC,QAAA,CAAA,AAAU,CAAA,AAAE,EAAA,CAAA,AAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,AAAR,CAAQ,CAAA,CAAA,AAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,AAAG,CAAA,CAAA,CAAA,CAAA,CAAA,AAAM,CAAA,CAAA,CAAA,CAAA,CAAA,AAAM,cAAA,CAAA,AAAgB,CAAA,CAAA,CAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CACpF","ignoreList":[0,1,2,3,4,5,6,7,8,9,12]}
@@ -1,3 +1,3 @@
1
- module.exports=[12465,a=>{"use strict";var b=a.i(87924),c=a.i(97501),d=a.i(16093),e=a.i(5050);let f=(0,e.createServerReference)("402bb7de970222695db6ab05347896fc56c5b72801",e.callServer,void 0,e.findSourceMapURL,"removeAgentApiCredential"),g=(0,e.createServerReference)("403516664888f26869fedb1243afbe84a2848d7ebb",e.callServer,void 0,e.findSourceMapURL,"removeCredential"),h=(0,e.createServerReference)("70c6e814496d35b292b02ef9356856815db2e8ee55",e.callServer,void 0,e.findSourceMapURL,"saveAgentApiCredential"),i=(0,e.createServerReference)("40aece137a81273f4e2d4215af82b158c70dcf964b",e.callServer,void 0,e.findSourceMapURL,"saveGitHubCredential"),j=(0,e.createServerReference)("606926b19756cb65e45debacb9fbeca505cec9810d",e.callServer,void 0,e.findSourceMapURL,"saveGitLabCredential");var k=a.i(50522),l=a.i(37047),m=a.i(81560),n=a.i(71987),o=a.i(50944),p=a.i(72131);let q="https://gitlab.com",r={github:"https://www.google.com/s2/favicons?domain=github.com&sz=64",gitlab:"https://www.google.com/s2/favicons?domain=gitlab.com&sz=64"},s={codex:"Codex CLI"},t={codex:"sk-..."},u={codex:"https://proxy.example.com/v1"},v=["codex"];function w(a){return"github"===a?"GitHub":"GitLab"}function x({type:a}){return(0,b.jsx)(n.default,{src:r[a],alt:`${w(a)} icon`,width:20,height:20,className:"h-5 w-5 rounded-sm",unoptimized:!0})}function y(){let a=(0,o.useRouter)(),[e,n]=(0,p.useState)([]),[r,y]=(0,p.useState)([]),[z,A]=(0,p.useState)(!0),[B,C]=(0,p.useState)(""),[D,E]=(0,p.useState)(""),[F,G]=(0,p.useState)(q),[H,I]=(0,p.useState)({codex:""}),[J,K]=(0,p.useState)({codex:""}),[L,M]=(0,p.useState)(null),[N,O]=(0,p.useState)(null),[P,Q]=(0,p.useState)(null),[R,S]=(0,p.useState)(null),[T,U]=(0,p.useState)(null),V=(0,p.useMemo)(()=>e.filter(a=>"github"===a.type),[e]),W=(0,p.useMemo)(()=>e.filter(a=>"gitlab"===a.type),[e]),X=(0,p.useMemo)(()=>new Map(r.map(a=>[a.agent,a])),[r]),Y=async()=>{let[a,b]=await Promise.all([(0,d.listCredentials)(),(0,c.listAgentApiCredentials)()]);if(!a.success){U({tone:"error",text:a.error}),A(!1);return}if(!b.success){U({tone:"error",text:b.error}),A(!1);return}n(a.credentials),y(b.credentials),K(a=>{let c={...a};for(let a of v)c[a]=b.credentials.find(b=>b.agent===a)?.apiProxy||"";return c}),A(!1)};(0,p.useEffect)(()=>{let a=!0;return(async()=>{let[b,e]=await Promise.all([(0,d.listCredentials)(),(0,c.listAgentApiCredentials)()]);if(a){if(!b.success){U({tone:"error",text:b.error}),A(!1);return}if(!e.success){U({tone:"error",text:e.error}),A(!1);return}n(b.credentials),y(e.credentials),K(a=>{let b={...a};for(let a of v)b[a]=e.credentials.find(b=>b.agent===a)?.apiProxy||"";return b}),A(!1)}})(),()=>{a=!1}},[]);let Z=async()=>{U(null),M("github");let a=await i(B);if(!a.success){U({tone:"error",text:a.error}),M(null);return}C(""),U({tone:"success",text:"GitHub credential added."}),await Y(),M(null)},$=async()=>{U(null),M("gitlab");let a=await j(F,D);if(!a.success){U({tone:"error",text:a.error}),M(null);return}E(""),U({tone:"success",text:"GitLab credential added."}),await Y(),M(null)},_=async a=>{U(null),O(a);let b=await h(a,H[a],J[a]);if(!b.success){U({tone:"error",text:b.error}),O(null);return}I(b=>({...b,[a]:""})),K(c=>({...c,[a]:b.credential.apiProxy||""})),U({tone:"success",text:`${s[a]} credential saved.`}),await Y(),O(null)},aa=async a=>{let b=w(a.type);if(!confirm(`Delete this ${b} credential for ${"gitlab"===a.type?`${a.username} @ ${a.serverUrl}`:a.username}?`))return;U(null),Q(a.id);let c=await g(a.id);if(!c.success){U({tone:"error",text:c.error}),Q(null);return}U({tone:"success",text:`${b} credential deleted.`}),await Y(),Q(null)},ab=async a=>{if(!confirm(`Delete the saved ${s[a]} API credential?`))return;U(null),S(a);let b=await f(a);if(!b.success){U({tone:"error",text:b.error}),S(null);return}I(b=>({...b,[a]:""})),K(b=>({...b,[a]:""})),U({tone:"success",text:`${s[a]} credential deleted.`}),await Y(),S(null)},ac="overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm dark:border-slate-700/50 dark:bg-slate-800 dark:shadow-[0_12px_30px_-18px_rgba(2,6,23,0.9)]",ad="flex flex-col gap-3 border-b border-slate-200 bg-white px-6 py-5 md:flex-row md:items-center md:justify-between dark:border-slate-700/50 dark:bg-slate-800",ae="block w-full rounded-lg border border-slate-200 bg-slate-50 px-3 py-2.5 text-sm text-slate-900 placeholder-slate-400 transition-all focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-60 dark:border-slate-700 dark:bg-slate-900/50 dark:text-white dark:placeholder-slate-500 dark:focus:border-primary/50 dark:focus:bg-slate-900",af="inline-flex items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white shadow-lg shadow-blue-900/20 transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60",ag="inline-flex items-center justify-center gap-2 rounded-lg border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700",ah="inline-flex h-8 w-8 items-center justify-center rounded-lg text-slate-400 transition-all hover:bg-red-50 hover:text-red-500 dark:text-slate-400 dark:hover:bg-red-900/30 dark:hover:text-red-400";return(0,b.jsx)("main",{className:"min-h-screen bg-[#f6f6f8] px-4 py-8 md:px-8 md:py-12 dark:bg-[#0f1117]",children:(0,b.jsxs)("div",{className:"mx-auto w-full max-w-4xl space-y-8",children:[(0,b.jsxs)("div",{className:"mb-8",children:[(0,b.jsxs)("div",{className:"mb-2 flex items-center gap-4",children:[(0,b.jsx)("button",{type:"button",className:"flex h-10 w-10 items-center justify-center rounded-lg text-slate-500 transition-colors hover:bg-white hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800 dark:hover:text-white",onClick:()=>a.push("/"),"aria-label":"Back to home",children:(0,b.jsx)(k.ChevronRight,{className:"h-6 w-6 rotate-180"})}),(0,b.jsx)("h1",{className:"text-3xl font-black tracking-[-0.02em] text-slate-900 md:text-4xl dark:text-white",children:"Credential Management"})]}),(0,b.jsx)("p",{className:"ml-14 text-sm text-slate-500 md:text-base dark:text-slate-400",children:"Manage your API keys and access tokens for third-party services safely."})]}),T&&(0,b.jsx)("div",{className:`rounded-lg border px-4 py-3 text-sm ${"error"===T.tone?"border-red-200 bg-red-50 text-red-700 dark:border-red-500/40 dark:bg-red-900/30 dark:text-red-200":"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/40 dark:bg-emerald-900/30 dark:text-emerald-200"}`,children:T.text}),z?(0,b.jsx)("div",{className:`${ac} p-10`,children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,b.jsx)("span",{className:"loading loading-spinner loading-md text-primary"}),(0,b.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Loading credentials..."})]})}):(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("section",{className:ac,children:[(0,b.jsxs)("div",{className:ad,children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-bold text-slate-900 dark:text-white",children:"GitHub Credentials"}),(0,b.jsx)("p",{className:"mt-1 text-sm text-slate-500 dark:text-slate-400",children:"Access private repositories and Gists."})]}),(0,b.jsxs)("button",{className:af,onClick:()=>void Z(),disabled:"github"===L,children:["github"===L?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(l.KeyRound,{className:"h-4 w-4"}),"Add Token"]})]}),(0,b.jsxs)("div",{className:"border-b border-slate-100 bg-slate-50/40 px-6 py-4 dark:border-slate-700/50 dark:bg-slate-900/35",children:[(0,b.jsx)("label",{className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:"Personal Access Token"}),(0,b.jsx)("input",{type:"password",className:ae,placeholder:"ghp_xxx",value:B,onChange:a=>C(a.target.value),disabled:"github"===L})]}),0===V.length?(0,b.jsx)("div",{className:"px-6 py-6 text-sm text-slate-500 dark:text-slate-400",children:"No GitHub credentials saved."}):(0,b.jsx)("div",{className:"divide-y divide-slate-100 dark:divide-slate-700/50",children:V.map(a=>(0,b.jsxs)("div",{className:"group flex items-center justify-between gap-4 px-6 py-5 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-4",children:[(0,b.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-slate-100 dark:bg-slate-700/60",children:(0,b.jsx)(x,{type:"github"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:a.username}),(0,b.jsxs)("div",{className:"mt-0.5 text-xs text-slate-500 dark:text-slate-400",children:["Updated ",new Date(a.updatedAt).toLocaleString()]})]})]}),(0,b.jsx)("button",{className:`${ah} opacity-0 group-hover:opacity-100 disabled:opacity-40`,onClick:()=>void aa(a),disabled:P===a.id,title:"Delete",children:P===a.id?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(m.Trash2,{className:"h-4 w-4"})})]},a.id))})]}),(0,b.jsxs)("section",{className:ac,children:[(0,b.jsxs)("div",{className:ad,children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-bold text-slate-900 dark:text-white",children:"GitLab Credentials"}),(0,b.jsx)("p",{className:"mt-1 text-sm text-slate-500 dark:text-slate-400",children:"Connect to self-hosted or cloud GitLab instances."})]}),(0,b.jsxs)("button",{className:ag,onClick:()=>void $(),disabled:"gitlab"===L,children:["gitlab"===L?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(l.KeyRound,{className:"h-4 w-4"}),"Add Instance"]})]}),(0,b.jsxs)("div",{className:"space-y-4 border-b border-slate-100 bg-slate-50/40 px-6 py-4 dark:border-slate-700/50 dark:bg-slate-900/35",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:"Server URL"}),(0,b.jsx)("input",{type:"url",className:ae,placeholder:q,value:F,onChange:a=>G(a.target.value),disabled:"gitlab"===L})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:"Personal Access Token"}),(0,b.jsx)("input",{type:"password",className:ae,placeholder:"glpat-xxx",value:D,onChange:a=>E(a.target.value),disabled:"gitlab"===L})]})]}),0===W.length?(0,b.jsx)("div",{className:"px-6 py-6 text-sm text-slate-500 dark:text-slate-400",children:"No GitLab credentials saved."}):(0,b.jsx)("div",{className:"divide-y divide-slate-100 dark:divide-slate-700/50",children:W.map(a=>(0,b.jsxs)("div",{className:"group flex items-center justify-between gap-4 px-6 py-5 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-4",children:[(0,b.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-orange-50 dark:border dark:border-orange-500/20 dark:bg-orange-500/10",children:(0,b.jsx)(x,{type:"gitlab"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:a.username}),(0,b.jsx)("div",{className:"truncate text-xs text-slate-500 dark:text-slate-400",children:a.serverUrl}),(0,b.jsxs)("div",{className:"mt-0.5 text-xs text-slate-500 dark:text-slate-400",children:["Updated ",new Date(a.updatedAt).toLocaleString()]})]})]}),(0,b.jsx)("button",{className:`${ah} opacity-0 group-hover:opacity-100 disabled:opacity-40`,onClick:()=>void aa(a),disabled:P===a.id,title:"Delete",children:P===a.id?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(m.Trash2,{className:"h-4 w-4"})})]},a.id))})]}),v.map(a=>{let c=X.get(a),d=N===a,e=R===a;return(0,b.jsxs)("section",{className:ac,children:[(0,b.jsxs)("div",{className:ad,children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-emerald-100 p-1.5 text-emerald-600 dark:border dark:border-emerald-500/20 dark:bg-emerald-500/10 dark:text-emerald-400",children:(0,b.jsx)(l.KeyRound,{className:"h-5 w-5"})}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("h2",{className:"text-lg font-bold text-slate-900 dark:text-white",children:[s[a]," Configuration"]}),(0,b.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Configure access for LLM capabilities."})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,b.jsxs)("button",{className:ag,onClick:()=>void ab(a),disabled:d||e,children:[e?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(m.Trash2,{className:"h-4 w-4"}),"Remove"]}),(0,b.jsxs)("button",{className:af,onClick:()=>void _(a),disabled:d||e,children:[d?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(l.KeyRound,{className:"h-4 w-4"}),c?"Save Changes":"Save"]})]})]}),(0,b.jsxs)("div",{className:"space-y-6 p-6",children:[(0,b.jsxs)("div",{className:"max-w-2xl space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300",children:"API Key"}),(0,b.jsx)("input",{type:"password",className:ae,placeholder:t[a],value:H[a],onChange:b=>I(c=>({...c,[a]:b.target.value})),disabled:d||e}),(0,b.jsx)("p",{className:"mt-1 text-xs text-slate-500 dark:text-slate-400",children:"Your API key is stored locally and never shared."})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("label",{className:"mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300",children:["API Proxy ",(0,b.jsx)("span",{className:"font-normal text-slate-400 dark:text-slate-500",children:"(Optional)"})]}),(0,b.jsx)("input",{type:"url",className:ae,placeholder:u[a],value:J[a],onChange:b=>K(c=>({...c,[a]:b.target.value})),disabled:d||e}),(0,b.jsx)("p",{className:"mt-1 text-xs text-slate-500 dark:text-slate-400",children:"Override this when using a proxy or a compatible endpoint."})]})]}),(0,b.jsx)("div",{className:"rounded-lg border border-slate-200 bg-slate-50 p-3 text-xs text-slate-600 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-300",children:c?(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("div",{children:"API key configured."}),(0,b.jsxs)("div",{children:["Updated ",new Date(c.updatedAt).toLocaleString()]}),(0,b.jsxs)("div",{children:["Proxy ",c.apiProxy?c.apiProxy:"not set"]})]}):(0,b.jsx)("div",{children:"No API credential saved."})})]})]},a)}),(0,b.jsx)("div",{className:"pb-2 pt-4 text-center text-xs text-slate-400 dark:text-slate-500",children:"Credentials are encrypted at rest using your system keychain."})]})]})})}a.s(["default",()=>y],12465)}];
1
+ module.exports=[12465,a=>{"use strict";var b=a.i(87924),c=a.i(31028),d=a.i(11916),e=a.i(5050);let f=(0,e.createServerReference)("40011c9b66bdc21f5472590decf1be3cc9562cd1c5",e.callServer,void 0,e.findSourceMapURL,"removeAgentApiCredential"),g=(0,e.createServerReference)("4091a8490f9bd089a13eb2593806dc5116ab4cd96f",e.callServer,void 0,e.findSourceMapURL,"removeCredential"),h=(0,e.createServerReference)("702c26c6b9bfd4c586d26c0ecfa3f8f7b5f4fe8e0e",e.callServer,void 0,e.findSourceMapURL,"saveAgentApiCredential"),i=(0,e.createServerReference)("4051c0a28158f8a13e906979f4ce747a6742aec465",e.callServer,void 0,e.findSourceMapURL,"saveGitHubCredential"),j=(0,e.createServerReference)("60a5c56e15d312abf810cd94da5c0d1ee2319b6d57",e.callServer,void 0,e.findSourceMapURL,"saveGitLabCredential");var k=a.i(50522),l=a.i(37047),m=a.i(81560),n=a.i(71987),o=a.i(50944),p=a.i(72131);let q="https://gitlab.com",r={github:"https://www.google.com/s2/favicons?domain=github.com&sz=64",gitlab:"https://www.google.com/s2/favicons?domain=gitlab.com&sz=64"},s={codex:"Codex CLI"},t={codex:"sk-..."},u={codex:"https://proxy.example.com/v1"},v=["codex"];function w(a){return"github"===a?"GitHub":"GitLab"}function x({type:a}){return(0,b.jsx)(n.default,{src:r[a],alt:`${w(a)} icon`,width:20,height:20,className:"h-5 w-5 rounded-sm",unoptimized:!0})}function y(){let a=(0,o.useRouter)(),[e,n]=(0,p.useState)([]),[r,y]=(0,p.useState)([]),[z,A]=(0,p.useState)(!0),[B,C]=(0,p.useState)(""),[D,E]=(0,p.useState)(""),[F,G]=(0,p.useState)(q),[H,I]=(0,p.useState)({codex:""}),[J,K]=(0,p.useState)({codex:""}),[L,M]=(0,p.useState)(null),[N,O]=(0,p.useState)(null),[P,Q]=(0,p.useState)(null),[R,S]=(0,p.useState)(null),[T,U]=(0,p.useState)(null),V=(0,p.useMemo)(()=>e.filter(a=>"github"===a.type),[e]),W=(0,p.useMemo)(()=>e.filter(a=>"gitlab"===a.type),[e]),X=(0,p.useMemo)(()=>new Map(r.map(a=>[a.agent,a])),[r]),Y=async()=>{let[a,b]=await Promise.all([(0,d.listCredentials)(),(0,c.listAgentApiCredentials)()]);if(!a.success){U({tone:"error",text:a.error}),A(!1);return}if(!b.success){U({tone:"error",text:b.error}),A(!1);return}n(a.credentials),y(b.credentials),K(a=>{let c={...a};for(let a of v)c[a]=b.credentials.find(b=>b.agent===a)?.apiProxy||"";return c}),A(!1)};(0,p.useEffect)(()=>{let a=!0;return(async()=>{let[b,e]=await Promise.all([(0,d.listCredentials)(),(0,c.listAgentApiCredentials)()]);if(a){if(!b.success){U({tone:"error",text:b.error}),A(!1);return}if(!e.success){U({tone:"error",text:e.error}),A(!1);return}n(b.credentials),y(e.credentials),K(a=>{let b={...a};for(let a of v)b[a]=e.credentials.find(b=>b.agent===a)?.apiProxy||"";return b}),A(!1)}})(),()=>{a=!1}},[]);let Z=async()=>{U(null),M("github");let a=await i(B);if(!a.success){U({tone:"error",text:a.error}),M(null);return}C(""),U({tone:"success",text:"GitHub credential added."}),await Y(),M(null)},$=async()=>{U(null),M("gitlab");let a=await j(F,D);if(!a.success){U({tone:"error",text:a.error}),M(null);return}E(""),U({tone:"success",text:"GitLab credential added."}),await Y(),M(null)},_=async a=>{U(null),O(a);let b=await h(a,H[a],J[a]);if(!b.success){U({tone:"error",text:b.error}),O(null);return}I(b=>({...b,[a]:""})),K(c=>({...c,[a]:b.credential.apiProxy||""})),U({tone:"success",text:`${s[a]} credential saved.`}),await Y(),O(null)},aa=async a=>{let b=w(a.type);if(!confirm(`Delete this ${b} credential for ${"gitlab"===a.type?`${a.username} @ ${a.serverUrl}`:a.username}?`))return;U(null),Q(a.id);let c=await g(a.id);if(!c.success){U({tone:"error",text:c.error}),Q(null);return}U({tone:"success",text:`${b} credential deleted.`}),await Y(),Q(null)},ab=async a=>{if(!confirm(`Delete the saved ${s[a]} API credential?`))return;U(null),S(a);let b=await f(a);if(!b.success){U({tone:"error",text:b.error}),S(null);return}I(b=>({...b,[a]:""})),K(b=>({...b,[a]:""})),U({tone:"success",text:`${s[a]} credential deleted.`}),await Y(),S(null)},ac="overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm dark:border-slate-700/50 dark:bg-slate-800 dark:shadow-[0_12px_30px_-18px_rgba(2,6,23,0.9)]",ad="flex flex-col gap-3 border-b border-slate-200 bg-white px-6 py-5 md:flex-row md:items-center md:justify-between dark:border-slate-700/50 dark:bg-slate-800",ae="block w-full rounded-lg border border-slate-200 bg-slate-50 px-3 py-2.5 text-sm text-slate-900 placeholder-slate-400 transition-all focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-60 dark:border-slate-700 dark:bg-slate-900/50 dark:text-white dark:placeholder-slate-500 dark:focus:border-primary/50 dark:focus:bg-slate-900",af="inline-flex items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white shadow-lg shadow-blue-900/20 transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60",ag="inline-flex items-center justify-center gap-2 rounded-lg border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700",ah="inline-flex h-8 w-8 items-center justify-center rounded-lg text-slate-400 transition-all hover:bg-red-50 hover:text-red-500 dark:text-slate-400 dark:hover:bg-red-900/30 dark:hover:text-red-400";return(0,b.jsx)("main",{className:"min-h-screen bg-[#f6f6f8] px-4 py-8 md:px-8 md:py-12 dark:bg-[#0f1117]",children:(0,b.jsxs)("div",{className:"mx-auto w-full max-w-4xl space-y-8",children:[(0,b.jsxs)("div",{className:"mb-8",children:[(0,b.jsxs)("div",{className:"mb-2 flex items-center gap-4",children:[(0,b.jsx)("button",{type:"button",className:"flex h-10 w-10 items-center justify-center rounded-lg text-slate-500 transition-colors hover:bg-white hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800 dark:hover:text-white",onClick:()=>a.push("/"),"aria-label":"Back to home",children:(0,b.jsx)(k.ChevronRight,{className:"h-6 w-6 rotate-180"})}),(0,b.jsx)("h1",{className:"text-3xl font-black tracking-[-0.02em] text-slate-900 md:text-4xl dark:text-white",children:"Credential Management"})]}),(0,b.jsx)("p",{className:"ml-14 text-sm text-slate-500 md:text-base dark:text-slate-400",children:"Manage your API keys and access tokens for third-party services safely."})]}),T&&(0,b.jsx)("div",{className:`rounded-lg border px-4 py-3 text-sm ${"error"===T.tone?"border-red-200 bg-red-50 text-red-700 dark:border-red-500/40 dark:bg-red-900/30 dark:text-red-200":"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/40 dark:bg-emerald-900/30 dark:text-emerald-200"}`,children:T.text}),z?(0,b.jsx)("div",{className:`${ac} p-10`,children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,b.jsx)("span",{className:"loading loading-spinner loading-md text-primary"}),(0,b.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Loading credentials..."})]})}):(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("section",{className:ac,children:[(0,b.jsxs)("div",{className:ad,children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-bold text-slate-900 dark:text-white",children:"GitHub Credentials"}),(0,b.jsx)("p",{className:"mt-1 text-sm text-slate-500 dark:text-slate-400",children:"Access private repositories and Gists."})]}),(0,b.jsxs)("button",{className:af,onClick:()=>void Z(),disabled:"github"===L,children:["github"===L?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(l.KeyRound,{className:"h-4 w-4"}),"Add Token"]})]}),(0,b.jsxs)("div",{className:"border-b border-slate-100 bg-slate-50/40 px-6 py-4 dark:border-slate-700/50 dark:bg-slate-900/35",children:[(0,b.jsx)("label",{className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:"Personal Access Token"}),(0,b.jsx)("input",{type:"password",className:ae,placeholder:"ghp_xxx",value:B,onChange:a=>C(a.target.value),disabled:"github"===L})]}),0===V.length?(0,b.jsx)("div",{className:"px-6 py-6 text-sm text-slate-500 dark:text-slate-400",children:"No GitHub credentials saved."}):(0,b.jsx)("div",{className:"divide-y divide-slate-100 dark:divide-slate-700/50",children:V.map(a=>(0,b.jsxs)("div",{className:"group flex items-center justify-between gap-4 px-6 py-5 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-4",children:[(0,b.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-slate-100 dark:bg-slate-700/60",children:(0,b.jsx)(x,{type:"github"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:a.username}),(0,b.jsxs)("div",{className:"mt-0.5 text-xs text-slate-500 dark:text-slate-400",children:["Updated ",new Date(a.updatedAt).toLocaleString()]})]})]}),(0,b.jsx)("button",{className:`${ah} opacity-0 group-hover:opacity-100 disabled:opacity-40`,onClick:()=>void aa(a),disabled:P===a.id,title:"Delete",children:P===a.id?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(m.Trash2,{className:"h-4 w-4"})})]},a.id))})]}),(0,b.jsxs)("section",{className:ac,children:[(0,b.jsxs)("div",{className:ad,children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-bold text-slate-900 dark:text-white",children:"GitLab Credentials"}),(0,b.jsx)("p",{className:"mt-1 text-sm text-slate-500 dark:text-slate-400",children:"Connect to self-hosted or cloud GitLab instances."})]}),(0,b.jsxs)("button",{className:ag,onClick:()=>void $(),disabled:"gitlab"===L,children:["gitlab"===L?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(l.KeyRound,{className:"h-4 w-4"}),"Add Instance"]})]}),(0,b.jsxs)("div",{className:"space-y-4 border-b border-slate-100 bg-slate-50/40 px-6 py-4 dark:border-slate-700/50 dark:bg-slate-900/35",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:"Server URL"}),(0,b.jsx)("input",{type:"url",className:ae,placeholder:q,value:F,onChange:a=>G(a.target.value),disabled:"gitlab"===L})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:"Personal Access Token"}),(0,b.jsx)("input",{type:"password",className:ae,placeholder:"glpat-xxx",value:D,onChange:a=>E(a.target.value),disabled:"gitlab"===L})]})]}),0===W.length?(0,b.jsx)("div",{className:"px-6 py-6 text-sm text-slate-500 dark:text-slate-400",children:"No GitLab credentials saved."}):(0,b.jsx)("div",{className:"divide-y divide-slate-100 dark:divide-slate-700/50",children:W.map(a=>(0,b.jsxs)("div",{className:"group flex items-center justify-between gap-4 px-6 py-5 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-4",children:[(0,b.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-orange-50 dark:border dark:border-orange-500/20 dark:bg-orange-500/10",children:(0,b.jsx)(x,{type:"gitlab"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:a.username}),(0,b.jsx)("div",{className:"truncate text-xs text-slate-500 dark:text-slate-400",children:a.serverUrl}),(0,b.jsxs)("div",{className:"mt-0.5 text-xs text-slate-500 dark:text-slate-400",children:["Updated ",new Date(a.updatedAt).toLocaleString()]})]})]}),(0,b.jsx)("button",{className:`${ah} opacity-0 group-hover:opacity-100 disabled:opacity-40`,onClick:()=>void aa(a),disabled:P===a.id,title:"Delete",children:P===a.id?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(m.Trash2,{className:"h-4 w-4"})})]},a.id))})]}),v.map(a=>{let c=X.get(a),d=N===a,e=R===a;return(0,b.jsxs)("section",{className:ac,children:[(0,b.jsxs)("div",{className:ad,children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-emerald-100 p-1.5 text-emerald-600 dark:border dark:border-emerald-500/20 dark:bg-emerald-500/10 dark:text-emerald-400",children:(0,b.jsx)(l.KeyRound,{className:"h-5 w-5"})}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("h2",{className:"text-lg font-bold text-slate-900 dark:text-white",children:[s[a]," Configuration"]}),(0,b.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Configure access for LLM capabilities."})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,b.jsxs)("button",{className:ag,onClick:()=>void ab(a),disabled:d||e,children:[e?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(m.Trash2,{className:"h-4 w-4"}),"Remove"]}),(0,b.jsxs)("button",{className:af,onClick:()=>void _(a),disabled:d||e,children:[d?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)(l.KeyRound,{className:"h-4 w-4"}),c?"Save Changes":"Save"]})]})]}),(0,b.jsxs)("div",{className:"space-y-6 p-6",children:[(0,b.jsxs)("div",{className:"max-w-2xl space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300",children:"API Key"}),(0,b.jsx)("input",{type:"password",className:ae,placeholder:t[a],value:H[a],onChange:b=>I(c=>({...c,[a]:b.target.value})),disabled:d||e}),(0,b.jsx)("p",{className:"mt-1 text-xs text-slate-500 dark:text-slate-400",children:"Your API key is stored locally and never shared."})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("label",{className:"mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300",children:["API Proxy ",(0,b.jsx)("span",{className:"font-normal text-slate-400 dark:text-slate-500",children:"(Optional)"})]}),(0,b.jsx)("input",{type:"url",className:ae,placeholder:u[a],value:J[a],onChange:b=>K(c=>({...c,[a]:b.target.value})),disabled:d||e}),(0,b.jsx)("p",{className:"mt-1 text-xs text-slate-500 dark:text-slate-400",children:"Override this when using a proxy or a compatible endpoint."})]})]}),(0,b.jsx)("div",{className:"rounded-lg border border-slate-200 bg-slate-50 p-3 text-xs text-slate-600 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-300",children:c?(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("div",{children:"API key configured."}),(0,b.jsxs)("div",{children:["Updated ",new Date(c.updatedAt).toLocaleString()]}),(0,b.jsxs)("div",{children:["Proxy ",c.apiProxy?c.apiProxy:"not set"]})]}):(0,b.jsx)("div",{children:"No API credential saved."})})]})]},a)}),(0,b.jsx)("div",{className:"pb-2 pt-4 text-center text-xs text-slate-400 dark:text-slate-500",children:"Credentials are encrypted at rest using your system keychain."})]})]})})}a.s(["default",()=>y],12465)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_credentials_page_tsx_63d8d34a._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/app/credentials/page.tsx","../../../../src/app/actions/data%3Afd2637%20%3Ctext/javascript%3E","../../../../src/app/actions/data%3A5d1837%20%3Ctext/javascript%3E","../../../../src/app/actions/data%3A6a3e39%20%3Ctext/javascript%3E","../../../../src/app/actions/data%3A173f79%20%3Ctext/javascript%3E","../../../../src/app/actions/data%3Ab6eada%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport {\n listAgentApiCredentials,\n listCredentials,\n removeAgentApiCredential,\n removeCredential,\n saveAgentApiCredential,\n saveGitHubCredential,\n saveGitLabCredential,\n} from '@/app/actions/credentials';\nimport type {\n AgentApiCredential,\n AgentApiCredentialAgent,\n} from '@/lib/agent-api-credentials';\nimport type { Credential, CredentialType, GitLabCredential } from '@/lib/credentials';\nimport { ChevronRight, KeyRound, Trash2 } from 'lucide-react';\nimport Image from 'next/image';\nimport { useRouter } from 'next/navigation';\nimport { useEffect, useMemo, useState } from 'react';\n\nconst DEFAULT_GITLAB_SERVER_URL = 'https://gitlab.com';\nconst PROVIDER_ICON_URLS = {\n github: 'https://www.google.com/s2/favicons?domain=github.com&sz=64',\n gitlab: 'https://www.google.com/s2/favicons?domain=gitlab.com&sz=64',\n} as const;\nconst AGENT_API_LABELS: Record<AgentApiCredentialAgent, string> = {\n codex: 'Codex CLI',\n};\nconst AGENT_API_KEY_PLACEHOLDERS: Record<AgentApiCredentialAgent, string> = {\n codex: 'sk-...',\n};\nconst AGENT_API_PROXY_PLACEHOLDERS: Record<AgentApiCredentialAgent, string> = {\n codex: 'https://proxy.example.com/v1',\n};\nconst AGENT_API_ORDER: AgentApiCredentialAgent[] = ['codex'];\n\ntype FlashMessage = {\n tone: 'success' | 'error';\n text: string;\n} | null;\n\nfunction formatCredentialSubtitle(credential: Credential): string {\n if (credential.type === 'gitlab') {\n return `${credential.username} @ ${credential.serverUrl}`;\n }\n return credential.username;\n}\n\nfunction formatProviderLabel(type: CredentialType): string {\n return type === 'github' ? 'GitHub' : 'GitLab';\n}\n\nfunction ProviderIcon({ type }: { type: CredentialType }) {\n return (\n <Image\n src={PROVIDER_ICON_URLS[type]}\n alt={`${formatProviderLabel(type)} icon`}\n width={20}\n height={20}\n className=\"h-5 w-5 rounded-sm\"\n unoptimized\n />\n );\n}\n\nexport default function CredentialsPage() {\n const router = useRouter();\n\n const [credentials, setCredentials] = useState<Credential[]>([]);\n const [agentApiCredentials, setAgentApiCredentials] = useState<AgentApiCredential[]>([]);\n const [loading, setLoading] = useState(true);\n\n const [githubToken, setGitHubToken] = useState('');\n const [gitlabToken, setGitLabToken] = useState('');\n const [gitlabServerUrl, setGitLabServerUrl] = useState(DEFAULT_GITLAB_SERVER_URL);\n const [agentApiKeyInputs, setAgentApiKeyInputs] = useState<Record<AgentApiCredentialAgent, string>>({\n codex: '',\n });\n const [agentApiProxyInputs, setAgentApiProxyInputs] = useState<Record<AgentApiCredentialAgent, string>>({\n codex: '',\n });\n\n const [savingType, setSavingType] = useState<CredentialType | null>(null);\n const [savingAgent, setSavingAgent] = useState<AgentApiCredentialAgent | null>(null);\n const [deletingId, setDeletingId] = useState<string | null>(null);\n const [deletingAgent, setDeletingAgent] = useState<AgentApiCredentialAgent | null>(null);\n const [flashMessage, setFlashMessage] = useState<FlashMessage>(null);\n\n const githubCredentials = useMemo(\n () => credentials.filter((credential) => credential.type === 'github'),\n [credentials],\n );\n\n const gitlabCredentials = useMemo(\n () => credentials.filter((credential) => credential.type === 'gitlab') as GitLabCredential[],\n [credentials],\n );\n\n const agentApiCredentialMap = useMemo(() => {\n return new Map(agentApiCredentials.map((credential) => [credential.agent, credential]));\n }, [agentApiCredentials]);\n\n const reloadCredentials = async () => {\n const [gitResult, agentResult] = await Promise.all([\n listCredentials(),\n listAgentApiCredentials(),\n ]);\n\n if (!gitResult.success) {\n setFlashMessage({ tone: 'error', text: gitResult.error });\n setLoading(false);\n return;\n }\n\n if (!agentResult.success) {\n setFlashMessage({ tone: 'error', text: agentResult.error });\n setLoading(false);\n return;\n }\n\n setCredentials(gitResult.credentials);\n setAgentApiCredentials(agentResult.credentials);\n setAgentApiProxyInputs((previous) => {\n const next = { ...previous };\n for (const agent of AGENT_API_ORDER) {\n next[agent] = agentResult.credentials.find((credential) => credential.agent === agent)?.apiProxy || '';\n }\n return next;\n });\n setLoading(false);\n };\n\n useEffect(() => {\n let isActive = true;\n\n void (async () => {\n const [gitResult, agentResult] = await Promise.all([\n listCredentials(),\n listAgentApiCredentials(),\n ]);\n if (!isActive) return;\n\n if (!gitResult.success) {\n setFlashMessage({ tone: 'error', text: gitResult.error });\n setLoading(false);\n return;\n }\n\n if (!agentResult.success) {\n setFlashMessage({ tone: 'error', text: agentResult.error });\n setLoading(false);\n return;\n }\n\n setCredentials(gitResult.credentials);\n setAgentApiCredentials(agentResult.credentials);\n setAgentApiProxyInputs((previous) => {\n const next = { ...previous };\n for (const agent of AGENT_API_ORDER) {\n next[agent] = agentResult.credentials.find((credential) => credential.agent === agent)?.apiProxy || '';\n }\n return next;\n });\n setLoading(false);\n })();\n\n return () => {\n isActive = false;\n };\n }, []);\n\n const handleSaveGitHub = async () => {\n setFlashMessage(null);\n setSavingType('github');\n\n const result = await saveGitHubCredential(githubToken);\n if (!result.success) {\n setFlashMessage({ tone: 'error', text: result.error });\n setSavingType(null);\n return;\n }\n\n setGitHubToken('');\n setFlashMessage({ tone: 'success', text: 'GitHub credential added.' });\n await reloadCredentials();\n setSavingType(null);\n };\n\n const handleSaveGitLab = async () => {\n setFlashMessage(null);\n setSavingType('gitlab');\n\n const result = await saveGitLabCredential(gitlabServerUrl, gitlabToken);\n if (!result.success) {\n setFlashMessage({ tone: 'error', text: result.error });\n setSavingType(null);\n return;\n }\n\n setGitLabToken('');\n setFlashMessage({ tone: 'success', text: 'GitLab credential added.' });\n await reloadCredentials();\n setSavingType(null);\n };\n\n const handleSaveAgentApi = async (agent: AgentApiCredentialAgent) => {\n setFlashMessage(null);\n setSavingAgent(agent);\n\n const result = await saveAgentApiCredential(\n agent,\n agentApiKeyInputs[agent],\n agentApiProxyInputs[agent],\n );\n if (!result.success) {\n setFlashMessage({ tone: 'error', text: result.error });\n setSavingAgent(null);\n return;\n }\n\n setAgentApiKeyInputs((previous) => ({ ...previous, [agent]: '' }));\n setAgentApiProxyInputs((previous) => ({ ...previous, [agent]: result.credential.apiProxy || '' }));\n setFlashMessage({ tone: 'success', text: `${AGENT_API_LABELS[agent]} credential saved.` });\n await reloadCredentials();\n setSavingAgent(null);\n };\n\n const handleDelete = async (credential: Credential) => {\n const providerLabel = formatProviderLabel(credential.type);\n const confirmed = confirm(`Delete this ${providerLabel} credential for ${formatCredentialSubtitle(credential)}?`);\n if (!confirmed) return;\n\n setFlashMessage(null);\n setDeletingId(credential.id);\n\n const result = await removeCredential(credential.id);\n if (!result.success) {\n setFlashMessage({ tone: 'error', text: result.error });\n setDeletingId(null);\n return;\n }\n\n setFlashMessage({ tone: 'success', text: `${providerLabel} credential deleted.` });\n await reloadCredentials();\n setDeletingId(null);\n };\n\n const handleDeleteAgentApi = async (agent: AgentApiCredentialAgent) => {\n const confirmed = confirm(`Delete the saved ${AGENT_API_LABELS[agent]} API credential?`);\n if (!confirmed) return;\n\n setFlashMessage(null);\n setDeletingAgent(agent);\n\n const result = await removeAgentApiCredential(agent);\n if (!result.success) {\n setFlashMessage({ tone: 'error', text: result.error });\n setDeletingAgent(null);\n return;\n }\n\n setAgentApiKeyInputs((previous) => ({ ...previous, [agent]: '' }));\n setAgentApiProxyInputs((previous) => ({ ...previous, [agent]: '' }));\n setFlashMessage({ tone: 'success', text: `${AGENT_API_LABELS[agent]} credential deleted.` });\n await reloadCredentials();\n setDeletingAgent(null);\n };\n\n const panelClass = 'overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm dark:border-slate-700/50 dark:bg-slate-800 dark:shadow-[0_12px_30px_-18px_rgba(2,6,23,0.9)]';\n const sectionHeaderClass = 'flex flex-col gap-3 border-b border-slate-200 bg-white px-6 py-5 md:flex-row md:items-center md:justify-between dark:border-slate-700/50 dark:bg-slate-800';\n const inputClass = 'block w-full rounded-lg border border-slate-200 bg-slate-50 px-3 py-2.5 text-sm text-slate-900 placeholder-slate-400 transition-all focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-60 dark:border-slate-700 dark:bg-slate-900/50 dark:text-white dark:placeholder-slate-500 dark:focus:border-primary/50 dark:focus:bg-slate-900';\n const primaryButtonClass = 'inline-flex items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white shadow-lg shadow-blue-900/20 transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60';\n const secondaryButtonClass = 'inline-flex items-center justify-center gap-2 rounded-lg border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700';\n const rowActionButtonClass = 'inline-flex h-8 w-8 items-center justify-center rounded-lg text-slate-400 transition-all hover:bg-red-50 hover:text-red-500 dark:text-slate-400 dark:hover:bg-red-900/30 dark:hover:text-red-400';\n\n return (\n <main className=\"min-h-screen bg-[#f6f6f8] px-4 py-8 md:px-8 md:py-12 dark:bg-[#0f1117]\">\n <div className=\"mx-auto w-full max-w-4xl space-y-8\">\n <div className=\"mb-8\">\n <div className=\"mb-2 flex items-center gap-4\">\n <button\n type=\"button\"\n className=\"flex h-10 w-10 items-center justify-center rounded-lg text-slate-500 transition-colors hover:bg-white hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800 dark:hover:text-white\"\n onClick={() => router.push('/')}\n aria-label=\"Back to home\"\n >\n <ChevronRight className=\"h-6 w-6 rotate-180\" />\n </button>\n <h1 className=\"text-3xl font-black tracking-[-0.02em] text-slate-900 md:text-4xl dark:text-white\">Credential Management</h1>\n </div>\n <p className=\"ml-14 text-sm text-slate-500 md:text-base dark:text-slate-400\">\n Manage your API keys and access tokens for third-party services safely.\n </p>\n </div>\n\n {flashMessage && (\n <div\n className={`rounded-lg border px-4 py-3 text-sm ${\n flashMessage.tone === 'error'\n ? 'border-red-200 bg-red-50 text-red-700 dark:border-red-500/40 dark:bg-red-900/30 dark:text-red-200'\n : 'border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/40 dark:bg-emerald-900/30 dark:text-emerald-200'\n }`}\n >\n {flashMessage.text}\n </div>\n )}\n\n {loading ? (\n <div className={`${panelClass} p-10`}>\n <div className=\"flex flex-col items-center gap-3\">\n <span className=\"loading loading-spinner loading-md text-primary\"></span>\n <p className=\"text-sm text-slate-500 dark:text-slate-400\">Loading credentials...</p>\n </div>\n </div>\n ) : (\n <div className=\"space-y-6\">\n <section className={panelClass}>\n <div className={sectionHeaderClass}>\n <div>\n <h2 className=\"text-lg font-bold text-slate-900 dark:text-white\">GitHub Credentials</h2>\n <p className=\"mt-1 text-sm text-slate-500 dark:text-slate-400\">Access private repositories and Gists.</p>\n </div>\n <button\n className={primaryButtonClass}\n onClick={() => void handleSaveGitHub()}\n disabled={savingType === 'github'}\n >\n {savingType === 'github' ? <span className=\"loading loading-spinner loading-xs\"></span> : <KeyRound className=\"h-4 w-4\" />}\n Add Token\n </button>\n </div>\n\n <div className=\"border-b border-slate-100 bg-slate-50/40 px-6 py-4 dark:border-slate-700/50 dark:bg-slate-900/35\">\n <label className=\"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400\">\n Personal Access Token\n </label>\n <input\n type=\"password\"\n className={inputClass}\n placeholder=\"ghp_xxx\"\n value={githubToken}\n onChange={(event) => setGitHubToken(event.target.value)}\n disabled={savingType === 'github'}\n />\n </div>\n\n {githubCredentials.length === 0 ? (\n <div className=\"px-6 py-6 text-sm text-slate-500 dark:text-slate-400\">No GitHub credentials saved.</div>\n ) : (\n <div className=\"divide-y divide-slate-100 dark:divide-slate-700/50\">\n {githubCredentials.map((credential) => (\n <div\n key={credential.id}\n className=\"group flex items-center justify-between gap-4 px-6 py-5 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/50\"\n >\n <div className=\"flex min-w-0 items-center gap-4\">\n <div className=\"flex h-10 w-10 items-center justify-center rounded-lg bg-slate-100 dark:bg-slate-700/60\">\n <ProviderIcon type=\"github\" />\n </div>\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-slate-900 dark:text-white\">{credential.username}</div>\n <div className=\"mt-0.5 text-xs text-slate-500 dark:text-slate-400\">\n Updated {new Date(credential.updatedAt).toLocaleString()}\n </div>\n </div>\n </div>\n <button\n className={`${rowActionButtonClass} opacity-0 group-hover:opacity-100 disabled:opacity-40`}\n onClick={() => void handleDelete(credential)}\n disabled={deletingId === credential.id}\n title=\"Delete\"\n >\n {deletingId === credential.id ? <span className=\"loading loading-spinner loading-xs\"></span> : <Trash2 className=\"h-4 w-4\" />}\n </button>\n </div>\n ))}\n </div>\n )}\n </section>\n\n <section className={panelClass}>\n <div className={sectionHeaderClass}>\n <div>\n <h2 className=\"text-lg font-bold text-slate-900 dark:text-white\">GitLab Credentials</h2>\n <p className=\"mt-1 text-sm text-slate-500 dark:text-slate-400\">Connect to self-hosted or cloud GitLab instances.</p>\n </div>\n <button\n className={secondaryButtonClass}\n onClick={() => void handleSaveGitLab()}\n disabled={savingType === 'gitlab'}\n >\n {savingType === 'gitlab' ? <span className=\"loading loading-spinner loading-xs\"></span> : <KeyRound className=\"h-4 w-4\" />}\n Add Instance\n </button>\n </div>\n\n <div className=\"space-y-4 border-b border-slate-100 bg-slate-50/40 px-6 py-4 dark:border-slate-700/50 dark:bg-slate-900/35\">\n <div>\n <label className=\"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400\">\n Server URL\n </label>\n <input\n type=\"url\"\n className={inputClass}\n placeholder={DEFAULT_GITLAB_SERVER_URL}\n value={gitlabServerUrl}\n onChange={(event) => setGitLabServerUrl(event.target.value)}\n disabled={savingType === 'gitlab'}\n />\n </div>\n <div>\n <label className=\"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400\">\n Personal Access Token\n </label>\n <input\n type=\"password\"\n className={inputClass}\n placeholder=\"glpat-xxx\"\n value={gitlabToken}\n onChange={(event) => setGitLabToken(event.target.value)}\n disabled={savingType === 'gitlab'}\n />\n </div>\n </div>\n\n {gitlabCredentials.length === 0 ? (\n <div className=\"px-6 py-6 text-sm text-slate-500 dark:text-slate-400\">No GitLab credentials saved.</div>\n ) : (\n <div className=\"divide-y divide-slate-100 dark:divide-slate-700/50\">\n {gitlabCredentials.map((credential) => (\n <div\n key={credential.id}\n className=\"group flex items-center justify-between gap-4 px-6 py-5 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/50\"\n >\n <div className=\"flex min-w-0 items-center gap-4\">\n <div className=\"flex h-10 w-10 items-center justify-center rounded-lg bg-orange-50 dark:border dark:border-orange-500/20 dark:bg-orange-500/10\">\n <ProviderIcon type=\"gitlab\" />\n </div>\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-slate-900 dark:text-white\">{credential.username}</div>\n <div className=\"truncate text-xs text-slate-500 dark:text-slate-400\">{credential.serverUrl}</div>\n <div className=\"mt-0.5 text-xs text-slate-500 dark:text-slate-400\">\n Updated {new Date(credential.updatedAt).toLocaleString()}\n </div>\n </div>\n </div>\n <button\n className={`${rowActionButtonClass} opacity-0 group-hover:opacity-100 disabled:opacity-40`}\n onClick={() => void handleDelete(credential)}\n disabled={deletingId === credential.id}\n title=\"Delete\"\n >\n {deletingId === credential.id ? <span className=\"loading loading-spinner loading-xs\"></span> : <Trash2 className=\"h-4 w-4\" />}\n </button>\n </div>\n ))}\n </div>\n )}\n </section>\n\n {AGENT_API_ORDER.map((agent) => {\n const configuredCredential = agentApiCredentialMap.get(agent);\n const isSaving = savingAgent === agent;\n const isDeleting = deletingAgent === agent;\n\n return (\n <section key={agent} className={panelClass}>\n <div className={sectionHeaderClass}>\n <div className=\"flex items-center gap-3\">\n <div className=\"rounded-lg bg-emerald-100 p-1.5 text-emerald-600 dark:border dark:border-emerald-500/20 dark:bg-emerald-500/10 dark:text-emerald-400\">\n <KeyRound className=\"h-5 w-5\" />\n </div>\n <div>\n <h2 className=\"text-lg font-bold text-slate-900 dark:text-white\">{AGENT_API_LABELS[agent]} Configuration</h2>\n <p className=\"text-sm text-slate-500 dark:text-slate-400\">Configure access for LLM capabilities.</p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n {configuredCredential && (\n <button\n className={secondaryButtonClass}\n onClick={() => void handleDeleteAgentApi(agent)}\n disabled={isSaving || isDeleting}\n >\n {isDeleting ? <span className=\"loading loading-spinner loading-xs\"></span> : <Trash2 className=\"h-4 w-4\" />}\n Remove\n </button>\n )}\n <button\n className={primaryButtonClass}\n onClick={() => void handleSaveAgentApi(agent)}\n disabled={isSaving || isDeleting}\n >\n {isSaving ? <span className=\"loading loading-spinner loading-xs\"></span> : <KeyRound className=\"h-4 w-4\" />}\n {configuredCredential ? 'Save Changes' : 'Save'}\n </button>\n </div>\n </div>\n\n <div className=\"space-y-6 p-6\">\n <div className=\"max-w-2xl space-y-4\">\n <div>\n <label className=\"mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300\">API Key</label>\n <input\n type=\"password\"\n className={inputClass}\n placeholder={AGENT_API_KEY_PLACEHOLDERS[agent]}\n value={agentApiKeyInputs[agent]}\n onChange={(event) =>\n setAgentApiKeyInputs((previous) => ({ ...previous, [agent]: event.target.value }))\n }\n disabled={isSaving || isDeleting}\n />\n <p className=\"mt-1 text-xs text-slate-500 dark:text-slate-400\">\n Your API key is stored locally and never shared.\n </p>\n </div>\n\n <div>\n <label className=\"mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300\">\n API Proxy <span className=\"font-normal text-slate-400 dark:text-slate-500\">(Optional)</span>\n </label>\n <input\n type=\"url\"\n className={inputClass}\n placeholder={AGENT_API_PROXY_PLACEHOLDERS[agent]}\n value={agentApiProxyInputs[agent]}\n onChange={(event) =>\n setAgentApiProxyInputs((previous) => ({ ...previous, [agent]: event.target.value }))\n }\n disabled={isSaving || isDeleting}\n />\n <p className=\"mt-1 text-xs text-slate-500 dark:text-slate-400\">\n Override this when using a proxy or a compatible endpoint.\n </p>\n </div>\n </div>\n\n <div className=\"rounded-lg border border-slate-200 bg-slate-50 p-3 text-xs text-slate-600 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-300\">\n {configuredCredential ? (\n <div className=\"space-y-1\">\n <div>API key configured.</div>\n <div>Updated {new Date(configuredCredential.updatedAt).toLocaleString()}</div>\n <div>Proxy {configuredCredential.apiProxy ? configuredCredential.apiProxy : 'not set'}</div>\n </div>\n ) : (\n <div>No API credential saved.</div>\n )}\n </div>\n </div>\n </section>\n );\n })}\n\n <div className=\"pb-2 pt-4 text-center text-xs text-slate-400 dark:text-slate-500\">\n Credentials are encrypted at rest using your system keychain.\n </div>\n </div>\n )}\n </div>\n </main>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"402bb7de970222695db6ab05347896fc56c5b72801\":\"removeAgentApiCredential\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_6=/*#__PURE__*/createServerReference(\"402bb7de970222695db6ab05347896fc56c5b72801\",callServer,void 0,findSourceMapURL,\"removeAgentApiCredential\");export{$$RSC_SERVER_ACTION_6 as removeAgentApiCredential};","/* __next_internal_action_entry_do_not_use__ [{\"403516664888f26869fedb1243afbe84a2848d7ebb\":\"removeCredential\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_5=/*#__PURE__*/createServerReference(\"403516664888f26869fedb1243afbe84a2848d7ebb\",callServer,void 0,findSourceMapURL,\"removeCredential\");export{$$RSC_SERVER_ACTION_5 as removeCredential};","/* __next_internal_action_entry_do_not_use__ [{\"70c6e814496d35b292b02ef9356856815db2e8ee55\":\"saveAgentApiCredential\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_4=/*#__PURE__*/createServerReference(\"70c6e814496d35b292b02ef9356856815db2e8ee55\",callServer,void 0,findSourceMapURL,\"saveAgentApiCredential\");export{$$RSC_SERVER_ACTION_4 as saveAgentApiCredential};","/* __next_internal_action_entry_do_not_use__ [{\"40aece137a81273f4e2d4215af82b158c70dcf964b\":\"saveGitHubCredential\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_1=/*#__PURE__*/createServerReference(\"40aece137a81273f4e2d4215af82b158c70dcf964b\",callServer,void 0,findSourceMapURL,\"saveGitHubCredential\");export{$$RSC_SERVER_ACTION_1 as saveGitHubCredential};","/* __next_internal_action_entry_do_not_use__ [{\"606926b19756cb65e45debacb9fbeca505cec9810d\":\"saveGitLabCredential\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_2=/*#__PURE__*/createServerReference(\"606926b19756cb65e45debacb9fbeca505cec9810d\",callServer,void 0,findSourceMapURL,\"saveGitLabCredential\");export{$$RSC_SERVER_ACTION_2 as saveGitLabCredential};"],"names":[],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OAAA,EAAA,EAAA,CAAA,CAAA,OCF+L,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAM,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,4BCAjJ,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,oBCAnI,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,0BCA3I,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,wBCAzI,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,w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../../../../src/app/credentials/page.tsx","../../../../src/app/actions/data%3A18df35%20%3Ctext/javascript%3E","../../../../src/app/actions/data%3Aa29f01%20%3Ctext/javascript%3E","../../../../src/app/actions/data%3Aac2dca%20%3Ctext/javascript%3E","../../../../src/app/actions/data%3Ab4ac6f%20%3Ctext/javascript%3E","../../../../src/app/actions/data%3A84d306%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport {\n listAgentApiCredentials,\n listCredentials,\n removeAgentApiCredential,\n removeCredential,\n saveAgentApiCredential,\n saveGitHubCredential,\n saveGitLabCredential,\n} from '@/app/actions/credentials';\nimport type {\n AgentApiCredential,\n AgentApiCredentialAgent,\n} from '@/lib/agent-api-credentials';\nimport type { Credential, CredentialType, GitLabCredential } from '@/lib/credentials';\nimport { ChevronRight, KeyRound, Trash2 } from 'lucide-react';\nimport Image from 'next/image';\nimport { useRouter } from 'next/navigation';\nimport { useEffect, useMemo, useState } from 'react';\n\nconst DEFAULT_GITLAB_SERVER_URL = 'https://gitlab.com';\nconst PROVIDER_ICON_URLS = {\n github: 'https://www.google.com/s2/favicons?domain=github.com&sz=64',\n gitlab: 'https://www.google.com/s2/favicons?domain=gitlab.com&sz=64',\n} as const;\nconst AGENT_API_LABELS: Record<AgentApiCredentialAgent, string> = {\n codex: 'Codex CLI',\n};\nconst AGENT_API_KEY_PLACEHOLDERS: Record<AgentApiCredentialAgent, string> = {\n codex: 'sk-...',\n};\nconst AGENT_API_PROXY_PLACEHOLDERS: Record<AgentApiCredentialAgent, string> = {\n codex: 'https://proxy.example.com/v1',\n};\nconst AGENT_API_ORDER: AgentApiCredentialAgent[] = ['codex'];\n\ntype FlashMessage = {\n tone: 'success' | 'error';\n text: string;\n} | null;\n\nfunction formatCredentialSubtitle(credential: Credential): string {\n if (credential.type === 'gitlab') {\n return `${credential.username} @ ${credential.serverUrl}`;\n }\n return credential.username;\n}\n\nfunction formatProviderLabel(type: CredentialType): string {\n return type === 'github' ? 'GitHub' : 'GitLab';\n}\n\nfunction ProviderIcon({ type }: { type: CredentialType }) {\n return (\n <Image\n src={PROVIDER_ICON_URLS[type]}\n alt={`${formatProviderLabel(type)} icon`}\n width={20}\n height={20}\n className=\"h-5 w-5 rounded-sm\"\n unoptimized\n />\n );\n}\n\nexport default function CredentialsPage() {\n const router = useRouter();\n\n const [credentials, setCredentials] = useState<Credential[]>([]);\n const [agentApiCredentials, setAgentApiCredentials] = useState<AgentApiCredential[]>([]);\n const [loading, setLoading] = useState(true);\n\n const [githubToken, setGitHubToken] = useState('');\n const [gitlabToken, setGitLabToken] = useState('');\n const [gitlabServerUrl, setGitLabServerUrl] = useState(DEFAULT_GITLAB_SERVER_URL);\n const [agentApiKeyInputs, setAgentApiKeyInputs] = useState<Record<AgentApiCredentialAgent, string>>({\n codex: '',\n });\n const [agentApiProxyInputs, setAgentApiProxyInputs] = useState<Record<AgentApiCredentialAgent, string>>({\n codex: '',\n });\n\n const [savingType, setSavingType] = useState<CredentialType | null>(null);\n const [savingAgent, setSavingAgent] = useState<AgentApiCredentialAgent | null>(null);\n const [deletingId, setDeletingId] = useState<string | null>(null);\n const [deletingAgent, setDeletingAgent] = useState<AgentApiCredentialAgent | null>(null);\n const [flashMessage, setFlashMessage] = useState<FlashMessage>(null);\n\n const githubCredentials = useMemo(\n () => credentials.filter((credential) => credential.type === 'github'),\n [credentials],\n );\n\n const gitlabCredentials = useMemo(\n () => credentials.filter((credential) => credential.type === 'gitlab') as GitLabCredential[],\n [credentials],\n );\n\n const agentApiCredentialMap = useMemo(() => {\n return new Map(agentApiCredentials.map((credential) => [credential.agent, credential]));\n }, [agentApiCredentials]);\n\n const reloadCredentials = async () => {\n const [gitResult, agentResult] = await Promise.all([\n listCredentials(),\n listAgentApiCredentials(),\n ]);\n\n if (!gitResult.success) {\n setFlashMessage({ tone: 'error', text: gitResult.error });\n setLoading(false);\n return;\n }\n\n if (!agentResult.success) {\n setFlashMessage({ tone: 'error', text: agentResult.error });\n setLoading(false);\n return;\n }\n\n setCredentials(gitResult.credentials);\n setAgentApiCredentials(agentResult.credentials);\n setAgentApiProxyInputs((previous) => {\n const next = { ...previous };\n for (const agent of AGENT_API_ORDER) {\n next[agent] = agentResult.credentials.find((credential) => credential.agent === agent)?.apiProxy || '';\n }\n return next;\n });\n setLoading(false);\n };\n\n useEffect(() => {\n let isActive = true;\n\n void (async () => {\n const [gitResult, agentResult] = await Promise.all([\n listCredentials(),\n listAgentApiCredentials(),\n ]);\n if (!isActive) return;\n\n if (!gitResult.success) {\n setFlashMessage({ tone: 'error', text: gitResult.error });\n setLoading(false);\n return;\n }\n\n if (!agentResult.success) {\n setFlashMessage({ tone: 'error', text: agentResult.error });\n setLoading(false);\n return;\n }\n\n setCredentials(gitResult.credentials);\n setAgentApiCredentials(agentResult.credentials);\n setAgentApiProxyInputs((previous) => {\n const next = { ...previous };\n for (const agent of AGENT_API_ORDER) {\n next[agent] = agentResult.credentials.find((credential) => credential.agent === agent)?.apiProxy || '';\n }\n return next;\n });\n setLoading(false);\n })();\n\n return () => {\n isActive = false;\n };\n }, []);\n\n const handleSaveGitHub = async () => {\n setFlashMessage(null);\n setSavingType('github');\n\n const result = await saveGitHubCredential(githubToken);\n if (!result.success) {\n setFlashMessage({ tone: 'error', text: result.error });\n setSavingType(null);\n return;\n }\n\n setGitHubToken('');\n setFlashMessage({ tone: 'success', text: 'GitHub credential added.' });\n await reloadCredentials();\n setSavingType(null);\n };\n\n const handleSaveGitLab = async () => {\n setFlashMessage(null);\n setSavingType('gitlab');\n\n const result = await saveGitLabCredential(gitlabServerUrl, gitlabToken);\n if (!result.success) {\n setFlashMessage({ tone: 'error', text: result.error });\n setSavingType(null);\n return;\n }\n\n setGitLabToken('');\n setFlashMessage({ tone: 'success', text: 'GitLab credential added.' });\n await reloadCredentials();\n setSavingType(null);\n };\n\n const handleSaveAgentApi = async (agent: AgentApiCredentialAgent) => {\n setFlashMessage(null);\n setSavingAgent(agent);\n\n const result = await saveAgentApiCredential(\n agent,\n agentApiKeyInputs[agent],\n agentApiProxyInputs[agent],\n );\n if (!result.success) {\n setFlashMessage({ tone: 'error', text: result.error });\n setSavingAgent(null);\n return;\n }\n\n setAgentApiKeyInputs((previous) => ({ ...previous, [agent]: '' }));\n setAgentApiProxyInputs((previous) => ({ ...previous, [agent]: result.credential.apiProxy || '' }));\n setFlashMessage({ tone: 'success', text: `${AGENT_API_LABELS[agent]} credential saved.` });\n await reloadCredentials();\n setSavingAgent(null);\n };\n\n const handleDelete = async (credential: Credential) => {\n const providerLabel = formatProviderLabel(credential.type);\n const confirmed = confirm(`Delete this ${providerLabel} credential for ${formatCredentialSubtitle(credential)}?`);\n if (!confirmed) return;\n\n setFlashMessage(null);\n setDeletingId(credential.id);\n\n const result = await removeCredential(credential.id);\n if (!result.success) {\n setFlashMessage({ tone: 'error', text: result.error });\n setDeletingId(null);\n return;\n }\n\n setFlashMessage({ tone: 'success', text: `${providerLabel} credential deleted.` });\n await reloadCredentials();\n setDeletingId(null);\n };\n\n const handleDeleteAgentApi = async (agent: AgentApiCredentialAgent) => {\n const confirmed = confirm(`Delete the saved ${AGENT_API_LABELS[agent]} API credential?`);\n if (!confirmed) return;\n\n setFlashMessage(null);\n setDeletingAgent(agent);\n\n const result = await removeAgentApiCredential(agent);\n if (!result.success) {\n setFlashMessage({ tone: 'error', text: result.error });\n setDeletingAgent(null);\n return;\n }\n\n setAgentApiKeyInputs((previous) => ({ ...previous, [agent]: '' }));\n setAgentApiProxyInputs((previous) => ({ ...previous, [agent]: '' }));\n setFlashMessage({ tone: 'success', text: `${AGENT_API_LABELS[agent]} credential deleted.` });\n await reloadCredentials();\n setDeletingAgent(null);\n };\n\n const panelClass = 'overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm dark:border-slate-700/50 dark:bg-slate-800 dark:shadow-[0_12px_30px_-18px_rgba(2,6,23,0.9)]';\n const sectionHeaderClass = 'flex flex-col gap-3 border-b border-slate-200 bg-white px-6 py-5 md:flex-row md:items-center md:justify-between dark:border-slate-700/50 dark:bg-slate-800';\n const inputClass = 'block w-full rounded-lg border border-slate-200 bg-slate-50 px-3 py-2.5 text-sm text-slate-900 placeholder-slate-400 transition-all focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-60 dark:border-slate-700 dark:bg-slate-900/50 dark:text-white dark:placeholder-slate-500 dark:focus:border-primary/50 dark:focus:bg-slate-900';\n const primaryButtonClass = 'inline-flex items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white shadow-lg shadow-blue-900/20 transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60';\n const secondaryButtonClass = 'inline-flex items-center justify-center gap-2 rounded-lg border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700';\n const rowActionButtonClass = 'inline-flex h-8 w-8 items-center justify-center rounded-lg text-slate-400 transition-all hover:bg-red-50 hover:text-red-500 dark:text-slate-400 dark:hover:bg-red-900/30 dark:hover:text-red-400';\n\n return (\n <main className=\"min-h-screen bg-[#f6f6f8] px-4 py-8 md:px-8 md:py-12 dark:bg-[#0f1117]\">\n <div className=\"mx-auto w-full max-w-4xl space-y-8\">\n <div className=\"mb-8\">\n <div className=\"mb-2 flex items-center gap-4\">\n <button\n type=\"button\"\n className=\"flex h-10 w-10 items-center justify-center rounded-lg text-slate-500 transition-colors hover:bg-white hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800 dark:hover:text-white\"\n onClick={() => router.push('/')}\n aria-label=\"Back to home\"\n >\n <ChevronRight className=\"h-6 w-6 rotate-180\" />\n </button>\n <h1 className=\"text-3xl font-black tracking-[-0.02em] text-slate-900 md:text-4xl dark:text-white\">Credential Management</h1>\n </div>\n <p className=\"ml-14 text-sm text-slate-500 md:text-base dark:text-slate-400\">\n Manage your API keys and access tokens for third-party services safely.\n </p>\n </div>\n\n {flashMessage && (\n <div\n className={`rounded-lg border px-4 py-3 text-sm ${\n flashMessage.tone === 'error'\n ? 'border-red-200 bg-red-50 text-red-700 dark:border-red-500/40 dark:bg-red-900/30 dark:text-red-200'\n : 'border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/40 dark:bg-emerald-900/30 dark:text-emerald-200'\n }`}\n >\n {flashMessage.text}\n </div>\n )}\n\n {loading ? (\n <div className={`${panelClass} p-10`}>\n <div className=\"flex flex-col items-center gap-3\">\n <span className=\"loading loading-spinner loading-md text-primary\"></span>\n <p className=\"text-sm text-slate-500 dark:text-slate-400\">Loading credentials...</p>\n </div>\n </div>\n ) : (\n <div className=\"space-y-6\">\n <section className={panelClass}>\n <div className={sectionHeaderClass}>\n <div>\n <h2 className=\"text-lg font-bold text-slate-900 dark:text-white\">GitHub Credentials</h2>\n <p className=\"mt-1 text-sm text-slate-500 dark:text-slate-400\">Access private repositories and Gists.</p>\n </div>\n <button\n className={primaryButtonClass}\n onClick={() => void handleSaveGitHub()}\n disabled={savingType === 'github'}\n >\n {savingType === 'github' ? <span className=\"loading loading-spinner loading-xs\"></span> : <KeyRound className=\"h-4 w-4\" />}\n Add Token\n </button>\n </div>\n\n <div className=\"border-b border-slate-100 bg-slate-50/40 px-6 py-4 dark:border-slate-700/50 dark:bg-slate-900/35\">\n <label className=\"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400\">\n Personal Access Token\n </label>\n <input\n type=\"password\"\n className={inputClass}\n placeholder=\"ghp_xxx\"\n value={githubToken}\n onChange={(event) => setGitHubToken(event.target.value)}\n disabled={savingType === 'github'}\n />\n </div>\n\n {githubCredentials.length === 0 ? (\n <div className=\"px-6 py-6 text-sm text-slate-500 dark:text-slate-400\">No GitHub credentials saved.</div>\n ) : (\n <div className=\"divide-y divide-slate-100 dark:divide-slate-700/50\">\n {githubCredentials.map((credential) => (\n <div\n key={credential.id}\n className=\"group flex items-center justify-between gap-4 px-6 py-5 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/50\"\n >\n <div className=\"flex min-w-0 items-center gap-4\">\n <div className=\"flex h-10 w-10 items-center justify-center rounded-lg bg-slate-100 dark:bg-slate-700/60\">\n <ProviderIcon type=\"github\" />\n </div>\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-slate-900 dark:text-white\">{credential.username}</div>\n <div className=\"mt-0.5 text-xs text-slate-500 dark:text-slate-400\">\n Updated {new Date(credential.updatedAt).toLocaleString()}\n </div>\n </div>\n </div>\n <button\n className={`${rowActionButtonClass} opacity-0 group-hover:opacity-100 disabled:opacity-40`}\n onClick={() => void handleDelete(credential)}\n disabled={deletingId === credential.id}\n title=\"Delete\"\n >\n {deletingId === credential.id ? <span className=\"loading loading-spinner loading-xs\"></span> : <Trash2 className=\"h-4 w-4\" />}\n </button>\n </div>\n ))}\n </div>\n )}\n </section>\n\n <section className={panelClass}>\n <div className={sectionHeaderClass}>\n <div>\n <h2 className=\"text-lg font-bold text-slate-900 dark:text-white\">GitLab Credentials</h2>\n <p className=\"mt-1 text-sm text-slate-500 dark:text-slate-400\">Connect to self-hosted or cloud GitLab instances.</p>\n </div>\n <button\n className={secondaryButtonClass}\n onClick={() => void handleSaveGitLab()}\n disabled={savingType === 'gitlab'}\n >\n {savingType === 'gitlab' ? <span className=\"loading loading-spinner loading-xs\"></span> : <KeyRound className=\"h-4 w-4\" />}\n Add Instance\n </button>\n </div>\n\n <div className=\"space-y-4 border-b border-slate-100 bg-slate-50/40 px-6 py-4 dark:border-slate-700/50 dark:bg-slate-900/35\">\n <div>\n <label className=\"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400\">\n Server URL\n </label>\n <input\n type=\"url\"\n className={inputClass}\n placeholder={DEFAULT_GITLAB_SERVER_URL}\n value={gitlabServerUrl}\n onChange={(event) => setGitLabServerUrl(event.target.value)}\n disabled={savingType === 'gitlab'}\n />\n </div>\n <div>\n <label className=\"mb-2 block text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400\">\n Personal Access Token\n </label>\n <input\n type=\"password\"\n className={inputClass}\n placeholder=\"glpat-xxx\"\n value={gitlabToken}\n onChange={(event) => setGitLabToken(event.target.value)}\n disabled={savingType === 'gitlab'}\n />\n </div>\n </div>\n\n {gitlabCredentials.length === 0 ? (\n <div className=\"px-6 py-6 text-sm text-slate-500 dark:text-slate-400\">No GitLab credentials saved.</div>\n ) : (\n <div className=\"divide-y divide-slate-100 dark:divide-slate-700/50\">\n {gitlabCredentials.map((credential) => (\n <div\n key={credential.id}\n className=\"group flex items-center justify-between gap-4 px-6 py-5 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/50\"\n >\n <div className=\"flex min-w-0 items-center gap-4\">\n <div className=\"flex h-10 w-10 items-center justify-center rounded-lg bg-orange-50 dark:border dark:border-orange-500/20 dark:bg-orange-500/10\">\n <ProviderIcon type=\"gitlab\" />\n </div>\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-slate-900 dark:text-white\">{credential.username}</div>\n <div className=\"truncate text-xs text-slate-500 dark:text-slate-400\">{credential.serverUrl}</div>\n <div className=\"mt-0.5 text-xs text-slate-500 dark:text-slate-400\">\n Updated {new Date(credential.updatedAt).toLocaleString()}\n </div>\n </div>\n </div>\n <button\n className={`${rowActionButtonClass} opacity-0 group-hover:opacity-100 disabled:opacity-40`}\n onClick={() => void handleDelete(credential)}\n disabled={deletingId === credential.id}\n title=\"Delete\"\n >\n {deletingId === credential.id ? <span className=\"loading loading-spinner loading-xs\"></span> : <Trash2 className=\"h-4 w-4\" />}\n </button>\n </div>\n ))}\n </div>\n )}\n </section>\n\n {AGENT_API_ORDER.map((agent) => {\n const configuredCredential = agentApiCredentialMap.get(agent);\n const isSaving = savingAgent === agent;\n const isDeleting = deletingAgent === agent;\n\n return (\n <section key={agent} className={panelClass}>\n <div className={sectionHeaderClass}>\n <div className=\"flex items-center gap-3\">\n <div className=\"rounded-lg bg-emerald-100 p-1.5 text-emerald-600 dark:border dark:border-emerald-500/20 dark:bg-emerald-500/10 dark:text-emerald-400\">\n <KeyRound className=\"h-5 w-5\" />\n </div>\n <div>\n <h2 className=\"text-lg font-bold text-slate-900 dark:text-white\">{AGENT_API_LABELS[agent]} Configuration</h2>\n <p className=\"text-sm text-slate-500 dark:text-slate-400\">Configure access for LLM capabilities.</p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n {configuredCredential && (\n <button\n className={secondaryButtonClass}\n onClick={() => void handleDeleteAgentApi(agent)}\n disabled={isSaving || isDeleting}\n >\n {isDeleting ? <span className=\"loading loading-spinner loading-xs\"></span> : <Trash2 className=\"h-4 w-4\" />}\n Remove\n </button>\n )}\n <button\n className={primaryButtonClass}\n onClick={() => void handleSaveAgentApi(agent)}\n disabled={isSaving || isDeleting}\n >\n {isSaving ? <span className=\"loading loading-spinner loading-xs\"></span> : <KeyRound className=\"h-4 w-4\" />}\n {configuredCredential ? 'Save Changes' : 'Save'}\n </button>\n </div>\n </div>\n\n <div className=\"space-y-6 p-6\">\n <div className=\"max-w-2xl space-y-4\">\n <div>\n <label className=\"mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300\">API Key</label>\n <input\n type=\"password\"\n className={inputClass}\n placeholder={AGENT_API_KEY_PLACEHOLDERS[agent]}\n value={agentApiKeyInputs[agent]}\n onChange={(event) =>\n setAgentApiKeyInputs((previous) => ({ ...previous, [agent]: event.target.value }))\n }\n disabled={isSaving || isDeleting}\n />\n <p className=\"mt-1 text-xs text-slate-500 dark:text-slate-400\">\n Your API key is stored locally and never shared.\n </p>\n </div>\n\n <div>\n <label className=\"mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300\">\n API Proxy <span className=\"font-normal text-slate-400 dark:text-slate-500\">(Optional)</span>\n </label>\n <input\n type=\"url\"\n className={inputClass}\n placeholder={AGENT_API_PROXY_PLACEHOLDERS[agent]}\n value={agentApiProxyInputs[agent]}\n onChange={(event) =>\n setAgentApiProxyInputs((previous) => ({ ...previous, [agent]: event.target.value }))\n }\n disabled={isSaving || isDeleting}\n />\n <p className=\"mt-1 text-xs text-slate-500 dark:text-slate-400\">\n Override this when using a proxy or a compatible endpoint.\n </p>\n </div>\n </div>\n\n <div className=\"rounded-lg border border-slate-200 bg-slate-50 p-3 text-xs text-slate-600 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-300\">\n {configuredCredential ? (\n <div className=\"space-y-1\">\n <div>API key configured.</div>\n <div>Updated {new Date(configuredCredential.updatedAt).toLocaleString()}</div>\n <div>Proxy {configuredCredential.apiProxy ? configuredCredential.apiProxy : 'not set'}</div>\n </div>\n ) : (\n <div>No API credential saved.</div>\n )}\n </div>\n </div>\n </section>\n );\n })}\n\n <div className=\"pb-2 pt-4 text-center text-xs text-slate-400 dark:text-slate-500\">\n Credentials are encrypted at rest using your system keychain.\n </div>\n </div>\n )}\n </div>\n </main>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"40011c9b66bdc21f5472590decf1be3cc9562cd1c5\":\"removeAgentApiCredential\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_6=/*#__PURE__*/createServerReference(\"40011c9b66bdc21f5472590decf1be3cc9562cd1c5\",callServer,void 0,findSourceMapURL,\"removeAgentApiCredential\");export{$$RSC_SERVER_ACTION_6 as removeAgentApiCredential};","/* __next_internal_action_entry_do_not_use__ [{\"4091a8490f9bd089a13eb2593806dc5116ab4cd96f\":\"removeCredential\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_5=/*#__PURE__*/createServerReference(\"4091a8490f9bd089a13eb2593806dc5116ab4cd96f\",callServer,void 0,findSourceMapURL,\"removeCredential\");export{$$RSC_SERVER_ACTION_5 as removeCredential};","/* __next_internal_action_entry_do_not_use__ [{\"702c26c6b9bfd4c586d26c0ecfa3f8f7b5f4fe8e0e\":\"saveAgentApiCredential\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_4=/*#__PURE__*/createServerReference(\"702c26c6b9bfd4c586d26c0ecfa3f8f7b5f4fe8e0e\",callServer,void 0,findSourceMapURL,\"saveAgentApiCredential\");export{$$RSC_SERVER_ACTION_4 as saveAgentApiCredential};","/* __next_internal_action_entry_do_not_use__ [{\"4051c0a28158f8a13e906979f4ce747a6742aec465\":\"saveGitHubCredential\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_1=/*#__PURE__*/createServerReference(\"4051c0a28158f8a13e906979f4ce747a6742aec465\",callServer,void 0,findSourceMapURL,\"saveGitHubCredential\");export{$$RSC_SERVER_ACTION_1 as saveGitHubCredential};","/* __next_internal_action_entry_do_not_use__ [{\"60a5c56e15d312abf810cd94da5c0d1ee2319b6d57\":\"saveGitLabCredential\"},\"src/app/actions/credentials.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_2=/*#__PURE__*/createServerReference(\"60a5c56e15d312abf810cd94da5c0d1ee2319b6d57\",callServer,void 0,findSourceMapURL,\"saveGitLabCredential\");export{$$RSC_SERVER_ACTION_2 as saveGitLabCredential};"],"names":[],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OAAA,EAAA,EAAA,CAAA,CAAA,OCF+L,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAM,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB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kD,qEAMnE,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI,UAAU,oJACZ,EACC,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,sBACb,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,UAAI,wBACL,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,WAAI,WAAS,IAAI,KAAK,EAAqB,SAAS,EAAE,cAAc,MACrE,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,WAAI,SAAO,EAAqB,QAAQ,CAAG,EAAqB,QAAQ,CAAG,gBAG9E,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,UAAI,oCAhFC,EAsFlB,GAEA,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI,UAAU,4EAAmE,yEAQ9F"}
@@ -1,5 +1,5 @@
1
- module.exports=[85106,a=>{"use strict";var b=a.i(87924),c=a.i(50944),d=a.i(65975),e=a.i(72131),f=a.i(68114),g=a.i(13902),h=a.i(15060),i=a.i(44544);function j({repoPath:a,filePath:c}){let{data:j,isLoading:k}=(0,d.useGitDiff)(a,c),l=(0,e.useRef)(null),[m,n]=(0,e.useState)(()=>!0),[o,p]=(0,e.useState)(null),q=o===c,{resolvedTheme:r}=(0,g.useTheme)();if((0,e.useEffect)(()=>{try{localStorage.setItem("git-web:diff-view-split",JSON.stringify(m))}catch(a){console.error("Failed to save split view preference:",a)}},[m]),(0,e.useEffect)(()=>{if(k)return;let a=requestAnimationFrame(()=>{l.current?.scrollTo({top:0,left:0})});return()=>cancelAnimationFrame(a)},[c,k]),k)return(0,b.jsx)("div",{className:"flex items-center justify-center p-8 h-full",children:(0,b.jsx)("span",{className:"loading loading-spinner text-base-content/50"})});if(!j)return(0,b.jsx)("div",{className:"flex items-center justify-center h-full opacity-50",children:"No diff available"});if((0,f.isImageFile)(c))return(0,b.jsxs)("div",{className:"flex flex-col h-full bg-base-100",children:[(0,b.jsx)("div",{className:"flex items-center justify-between px-4 h-[57px] border-b border-base-300 shrink-0 bg-base-100",children:(0,b.jsx)("span",{className:"text-sm font-mono truncate max-w-[70%]",title:c,children:c})}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:(0,b.jsx)(i.ImageDiffView,{filePath:c,imageDiff:j.imageDiff})})]});if((0,f.isFileBinary)(c,j.left,j.right))return(0,b.jsxs)("div",{className:"flex flex-col h-full bg-base-100",children:[(0,b.jsx)("div",{className:"flex items-center justify-between px-4 h-[57px] border-b border-base-300 shrink-0 bg-base-100",children:(0,b.jsx)("span",{className:"text-sm font-mono truncate max-w-[70%]",title:c,children:c})}),(0,b.jsx)("div",{className:"flex-1 flex items-center justify-center opacity-50",children:"Binary file - diff not available"})]});let s=j.diff||"",t=s.length,u=(0,f.getChangedLineCountFromDiff)(s),v=t>102400||u>3e3;return(0,b.jsxs)("div",{className:"flex flex-col h-full bg-base-100",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 h-[57px] border-b border-base-300 shrink-0 bg-base-100",children:[(0,b.jsx)("span",{className:"text-sm font-mono truncate max-w-[70%]",title:c,children:c}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("label",{htmlFor:"split-view",className:"text-[10px] uppercase tracking-wider font-bold cursor-pointer opacity-70",children:"Split View"}),(0,b.jsx)("input",{type:"checkbox",id:"split-view",checked:m,onChange:a=>n(a.target.checked),className:"toggle toggle-sm toggle-primary"})]})]}),(0,b.jsx)("div",{ref:l,className:"flex-1 overflow-auto diff-viewer-wrapper",children:v&&!q?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-4 text-center p-4",children:[(0,b.jsx)("i",{className:"iconoir-warning-triangle text-[40px] text-warning","aria-hidden":"true"}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("h3",{className:"font-bold text-lg",children:"Large Diff Detected"}),(0,b.jsxs)("p",{className:"opacity-70",children:["This diff is large (",Math.round(t/1024),"KB, ~",u," changed lines) and may freeze your browser if rendered."]})]}),(0,b.jsx)("button",{className:"btn btn-outline",onClick:()=>p(c),children:"Show Diff Anyway"})]}):(0,b.jsx)(h.GroupedDiffViewer,{oldValue:j.left||"",newValue:j.right||"",splitView:m,useDarkTheme:"dark"===r})})]})}var k=a.i(96415);let l=[];function m(a,b){let c=a.trim(),d=b.replace(/\r\n/g,"\n");return d.trim()?`${c}
1
+ module.exports=[85106,a=>{"use strict";var b=a.i(87924),c=a.i(50944),d=a.i(65975),e=a.i(72131),f=a.i(68114),g=a.i(3688),h=a.i(96415);let i=[];function j(a,b){let c=a.trim(),d=b.replace(/\r\n/g,"\n");return d.trim()?`${c}
2
2
 
3
- ${d}`:c}function n(a){let b={name:"",path:"",children:new Map};for(let c of a){let a=c.split("/").filter(Boolean),d=b,e="";for(let b=0;b<a.length;b++){let f=a[b];e=e?`${e}/${f}`:f,d.children.has(f)||d.children.set(f,{name:f,path:e,children:new Map}),d=d.children.get(f),b===a.length-1&&(d.filePath=c)}}return b}function o(a){let b=[];return Array.from(a.children.values()).forEach(a=>{a.children.size>0&&(b.push(a.path),b.push(...o(a)))}),b}function p(a){let b=a.split("/").filter(Boolean),c=[];for(let a=1;a<b.length;a++)c.push(b.slice(0,a).join("/"));return c}function q({node:a,selectedFile:c,expandedFolders:d,onToggleFolder:e,onSelectFile:g,onActionFile:h,actionType:i,actionPending:j,depth:k=0}){let l=Array.from(a.children.values()).sort((a,b)=>{let c=a.children.size>0,d=b.children.size>0;return c&&!d?-1:!c&&d?1:a.name.localeCompare(b.name)});return(0,b.jsx)(b.Fragment,{children:l.map(a=>{if(a.children.size>0){let f=d.has(a.path);return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 text-xs rounded cursor-pointer text-slate-600 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-800/70 transition-colors",style:{paddingLeft:`${12*k+8}px`},onClick:()=>e(a.path),title:a.path,children:[(0,b.jsx)("span",{className:"text-[10px] opacity-70",children:f?"▼":"▶"}),(0,b.jsx)("i",{className:"iconoir-folder text-[14px] opacity-70","aria-hidden":"true"}),(0,b.jsx)("span",{className:"truncate flex-1",children:a.name})]}),f&&(0,b.jsx)(q,{node:a,selectedFile:c,expandedFolders:d,onToggleFolder:e,onSelectFile:g,onActionFile:h,actionType:i,actionPending:j,depth:k+1})]},a.path)}let l=a.filePath;return l?(0,b.jsxs)("div",{className:(0,f.cn)("flex items-center justify-between gap-2 px-2 py-1.5 rounded-md cursor-pointer group hover:bg-slate-100 dark:hover:bg-slate-800/70 transition-colors text-sm",c===l&&"bg-slate-100 dark:bg-slate-800/70 font-medium text-primary"),style:{paddingLeft:`${12*k+8}px`},onClick:()=>g(l),title:l,children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,b.jsx)("i",{className:"iconoir-page text-[14px] opacity-70 shrink-0","aria-hidden":"true"}),(0,b.jsx)("span",{className:"truncate flex-1 font-mono text-xs",children:a.name})]}),(0,b.jsx)("button",{className:(0,f.cn)("btn btn-ghost btn-xs btn-square opacity-0 group-hover:opacity-100 transition-opacity","stage"===i?"text-success hover:bg-success/10":"text-error hover:bg-error/10"),onClick:a=>{a.stopPropagation(),h(l)},disabled:j,children:(0,b.jsx)("i",{className:(0,f.cn)("text-[14px]","stage"===i?"iconoir-plus-circle":"iconoir-minus-circle"),"aria-hidden":"true"})})]},l):null})})}function r({repoPath:a}){let{data:c,isLoading:g,isError:h,error:i,refetch:r}=(0,d.useGitStatus)(a),{data:s}=(0,d.useGitBranches)(a),t=(0,d.useGitAction)(),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)("main"),[K,L]=(0,e.useState)(new Set),[M,N]=(0,e.useState)(new Set),[O,P]=(0,e.useState)(250),[Q,R]=(0,e.useState)(!1),S=(0,e.useRef)(null);(0,e.useEffect)(()=>{let a=a=>{if(!Q||!S.current)return;let b=S.current.startY-a.clientY;P(Math.max(150,Math.min(800,S.current.startHeight+b)))},b=()=>{R(!1),S.current=null,document.body.style.cursor="default",document.body.style.userSelect="auto"};return Q&&(window.addEventListener("mousemove",a),window.addEventListener("mouseup",b),document.body.style.cursor="ns-resize",document.body.style.userSelect="none"),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",b),document.body.style.cursor="default",document.body.style.userSelect="auto"}},[Q]);let T=c?.files??l,U=!!s&&0===s.branches.length,{staged:V,changes:W}=(0,e.useMemo)(()=>{let a=[],b=[];return T.forEach(c=>{" "!==c.index&&"?"!==c.index&&a.push(c.path),(" "!==c.working_dir||"?"===c.index)&&b.push(c.path)}),{staged:a,changes:b}},[T]),X=(0,e.useMemo)(()=>n(W),[W]),Y=(0,e.useMemo)(()=>n(V),[V]),Z=(0,e.useMemo)(()=>o(X),[X]),$=(0,e.useMemo)(()=>o(Y),[Y]),_=(0,e.useMemo)(()=>{let a=new Set;return Z.forEach(b=>{K.has(b)||a.add(b)}),y&&p(y).forEach(b=>a.add(b)),a},[Z,K,y]),aa=(0,e.useMemo)(()=>{let a=new Set;return $.forEach(b=>{M.has(b)||a.add(b)}),y&&p(y).forEach(b=>a.add(b)),a},[$,M,y]),ab=(0,e.useCallback)(a=>{L(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),ac=(0,e.useCallback)(a=>{N(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),ad=async b=>{await t.mutateAsync({repoPath:a,action:"stage",data:{files:[b]}})},ae=async b=>{await t.mutateAsync({repoPath:a,action:"unstage",data:{files:[b]}})},af=async()=>{await t.mutateAsync({repoPath:a,action:"stage",data:{files:["."]}})},ag=async()=>{await t.mutateAsync({repoPath:a,action:"unstage",data:{files:V}})},ah=async()=>{await t.mutateAsync({repoPath:a,action:"stash",data:{message:C||void 0}}),B(!1),D(""),z(null)},ai=async()=>{await t.mutateAsync({repoPath:a,action:"discard",data:{includeUntracked:!0}}),F(!1),z(null)},aj=async()=>{let b=u.trim();if(b){if(U)return void H(!0);await t.mutateAsync({repoPath:a,action:"commit",data:{message:m(b,w)}}),v(""),x(""),z(null)}},ak=async()=>{let b=u.trim(),c=I.trim();b&&c&&(await t.mutateAsync({repoPath:a,action:"commit",data:{message:m(b,w),initialBranch:c}}),v(""),x(""),z(null),H(!1))};(0,k.useEscapeDismiss)(A,()=>B(!1),()=>{t.isPending||ah()}),(0,k.useEscapeDismiss)(E,()=>F(!1),()=>{t.isPending||ai()}),(0,k.useEscapeDismiss)(G,()=>H(!1),()=>{!t.isPending&&I.trim()&&ak()});let al=a=>{(a.metaKey||a.ctrlKey)&&"Enter"===a.key&&(a.preventDefault(),V.length>0&&u.trim()&&!t.isPending&&aj())};return g?(0,b.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,b.jsx)("span",{className:"loading loading-spinner text-base-content/50"})}):h?(0,b.jsxs)("div",{className:"flex items-center justify-center h-64 flex-col gap-4",children:[(0,b.jsx)("p",{className:"text-error font-bold",children:"Error Loading Status"}),(0,b.jsx)("p",{className:"text-sm opacity-70",children:i?.message||"An unknown error occurred"}),(0,b.jsxs)("button",{onClick:()=>r(),className:"btn btn-outline btn-sm",children:[(0,b.jsx)("i",{className:"iconoir-refresh-circle text-[16px] mr-1","aria-hidden":"true"}),"Try Again"]})]}):c?(0,b.jsxs)("div",{className:"flex h-full overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex flex-1 min-w-0 flex-col gap-2 overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex min-h-[57px] shrink-0 items-center justify-between gap-2 rounded-xl border border-slate-200 bg-white px-4 py-2 dark:border-slate-800 dark:bg-slate-900",children:[(0,b.jsx)("h1",{className:"font-bold text-lg text-slate-900 dark:text-slate-100",children:"Changes"}),(0,b.jsxs)("button",{className:"flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-3 text-sm font-medium text-slate-600 transition-colors hover:bg-slate-50 hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300 dark:hover:bg-slate-800 dark:hover:text-slate-100",onClick:()=>r(),disabled:t.isPending,title:"Refresh status",children:[t.isPending?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)("i",{className:"iconoir-refresh-circle text-[16px]","aria-hidden":"true"}),"Refresh"]})]}),(0,b.jsxs)("div",{className:"flex flex-1 overflow-hidden rounded-xl border border-slate-200 bg-white dark:border-slate-800 dark:bg-slate-900",children:[(0,b.jsx)("div",{className:"w-64 border-r border-slate-200 dark:border-slate-800 flex flex-col bg-slate-50/70 dark:bg-slate-900/70",children:(0,b.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,b.jsxs)("div",{className:"p-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 mb-1",children:[(0,b.jsxs)("h3",{className:"text-xs font-bold uppercase tracking-wider opacity-70",children:["Changes (",W.length,")"]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[0===W.length&&V.length>0?(0,b.jsx)("button",{className:"btn btn-ghost btn-xs btn-square",onClick:ag,title:"Unstage All",children:(0,b.jsx)("i",{className:"iconoir-arrow-up text-[16px]","aria-hidden":"true"})}):(0,b.jsx)("button",{className:"btn btn-ghost btn-xs btn-square",onClick:af,disabled:0===W.length,title:"Stage All",children:(0,b.jsx)("i",{className:"iconoir-arrow-down text-[16px]","aria-hidden":"true"})}),(0,b.jsx)("button",{className:"btn btn-ghost btn-xs btn-square",onClick:()=>B(!0),disabled:0===W.length&&0===V.length,title:"Stash",children:(0,b.jsx)("i",{className:"iconoir-download-square text-[16px]","aria-hidden":"true"})}),(0,b.jsx)("button",{className:"btn btn-ghost btn-xs btn-square text-error hover:bg-error/10",onClick:()=>F(!0),disabled:0===W.length,title:"Discard All",children:(0,b.jsx)("i",{className:"iconoir-trash text-[16px]","aria-hidden":"true"})})]})]}),(0,b.jsxs)("div",{className:"space-y-0.5",children:[0===W.length&&(0,b.jsx)("p",{className:"px-2 py-2 text-xs opacity-50 italic",children:"No changes"}),W.length>0&&(0,b.jsx)(q,{node:X,selectedFile:y,expandedFolders:_,onToggleFolder:ab,onSelectFile:z,onActionFile:ad,actionType:"stage",actionPending:t.isPending})]})]}),(0,b.jsx)("div",{className:"h-px bg-slate-200 dark:bg-slate-800 mx-4 my-2"}),(0,b.jsxs)("div",{className:"p-2",children:[(0,b.jsx)("div",{className:"flex items-center justify-between px-2 py-2 mb-1",children:(0,b.jsxs)("h3",{className:"text-xs font-bold uppercase tracking-wider opacity-70",children:["Staged (",V.length,")"]})}),(0,b.jsxs)("div",{className:"space-y-0.5",children:[0===V.length&&(0,b.jsx)("p",{className:"px-2 py-2 text-xs opacity-50 italic",children:"No staged changes"}),V.length>0&&(0,b.jsx)(q,{node:Y,selectedFile:y,expandedFolders:aa,onToggleFolder:ac,onSelectFile:z,onActionFile:ae,actionType:"unstage",actionPending:t.isPending})]})]})]})}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col bg-white dark:bg-slate-900 overflow-hidden",children:[(0,b.jsx)("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:y?(0,b.jsx)("div",{className:"h-full flex flex-col",children:(0,b.jsx)(j,{repoPath:a,filePath:y})}):(0,b.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center opacity-50",children:[(0,b.jsx)("div",{className:"p-8 rounded-full bg-slate-100 dark:bg-slate-800/60 mb-4 text-4xl",children:(0,b.jsx)("i",{className:"iconoir-refresh-circle text-[32px]","aria-hidden":"true"})}),(0,b.jsx)("p",{className:"text-sm font-bold",children:"Select a file to view changes"})]})}),(0,b.jsx)("div",{className:"h-1.5 cursor-ns-resize flex items-center justify-center hover:bg-slate-100 dark:hover:bg-slate-800/60 transition-colors group shrink-0 border-t border-slate-200 dark:border-slate-800",onMouseDown:a=>{a.preventDefault(),R(!0),S.current={startY:a.clientY,startHeight:O}},children:(0,b.jsx)("div",{className:"w-8 h-1 rounded-full bg-base-300 group-hover:bg-base-content/20 transition-colors"})}),(0,b.jsx)("div",{className:"flex flex-col border-t border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 shrink-0",style:{height:O},children:(0,b.jsxs)("div",{className:"flex-1 p-4 overflow-y-auto",children:[(0,b.jsx)("input",{type:"text",placeholder:"Commit subject...",value:u,onChange:a=>v(a.target.value),onKeyDown:al,className:"input input-bordered w-full text-sm mb-2 font-sans"}),(0,b.jsx)("textarea",{placeholder:"Commit message body (optional)...",value:w,onChange:a=>x(a.target.value),onKeyDown:al,className:"textarea textarea-bordered w-full text-sm resize-none mb-3 font-sans flex-1",style:{minHeight:"80px",height:"calc(100% - 90px)"}}),(0,b.jsxs)("button",{className:"btn btn-primary w-full btn-sm",onClick:aj,disabled:0===V.length||!u.trim()||t.isPending,children:[t.isPending?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs mr-2"}):(0,b.jsx)("span",{className:"mr-2",children:"✅"}),"Commit Changes"]})]})})]})]})]}),A&&(0,b.jsxs)("dialog",{className:"modal modal-open",children:[(0,b.jsxs)("div",{className:"modal-box",children:[(0,b.jsx)("h3",{className:"font-bold text-lg",children:"Stash Changes"}),(0,b.jsx)("p",{className:"py-4 opacity-70",children:"Save your local modifications to a new stash entry."}),(0,b.jsx)("div",{className:"py-2",children:(0,b.jsx)("input",{type:"text",placeholder:"Stash message (optional)",value:C,onChange:a=>D(a.target.value),autoFocus:!0,onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),ah())},className:"input input-bordered w-full"})}),(0,b.jsxs)("div",{className:"modal-action",children:[(0,b.jsx)("button",{className:"btn",onClick:()=>B(!1),children:"Cancel"}),(0,b.jsxs)("button",{className:"btn btn-primary",onClick:ah,disabled:t.isPending,children:[t.isPending&&(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Stash"]})]})]}),(0,b.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,b.jsx)("button",{onClick:()=>B(!1),children:"close"})})]}),E&&(0,b.jsxs)("dialog",{className:"modal modal-open",children:[(0,b.jsxs)("div",{className:"modal-box",children:[(0,b.jsx)("h3",{className:"font-bold text-lg",children:"Discard Changes"}),(0,b.jsx)("p",{className:"py-4",children:"Are you sure you want to discard all unstaged changes and new files? This action cannot be undone."}),(0,b.jsxs)("div",{className:"modal-action",children:[(0,b.jsx)("button",{className:"btn",onClick:()=>F(!1),children:"Cancel"}),(0,b.jsxs)("button",{className:"btn btn-error",onClick:ai,disabled:t.isPending,children:[t.isPending&&(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Discard"]})]})]}),(0,b.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,b.jsx)("button",{onClick:()=>F(!1),children:"close"})})]}),G&&(0,b.jsxs)("dialog",{className:"modal modal-open",children:[(0,b.jsxs)("div",{className:"modal-box",children:[(0,b.jsx)("h3",{className:"font-bold text-lg",children:"First Commit Branch"}),(0,b.jsx)("p",{className:"py-4 opacity-70",children:"This repository has no commits yet. Choose the branch name for the first commit."}),(0,b.jsx)("div",{className:"py-2",children:(0,b.jsx)("input",{type:"text",placeholder:"Branch name",value:I,onChange:a=>J((0,f.sanitizeBranchName)(a.target.value)),autoFocus:!0,onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),ak())},className:"input input-bordered w-full"})}),(0,b.jsxs)("div",{className:"modal-action",children:[(0,b.jsx)("button",{className:"btn",onClick:()=>H(!1),children:"Cancel"}),(0,b.jsxs)("button",{className:"btn btn-primary",onClick:ak,disabled:!I.trim()||t.isPending,children:[t.isPending&&(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Commit to Branch"]})]})]}),(0,b.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,b.jsx)("button",{onClick:()=>H(!1),children:"close"})})]})]}):(0,b.jsx)("div",{className:"flex items-center justify-center h-64 opacity-70",children:"No status data available"})}var s=a.i(14539);function t(){let a=(0,c.useSearchParams)().get("path");return((0,s.useWorkspaceTitle)(a,"Changes"),a)?(0,b.jsx)(r,{repoPath:a}):(0,b.jsx)("div",{className:"p-8",children:"No repository path specified."})}function u(){return(0,b.jsx)(e.Suspense,{fallback:(0,b.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,b.jsx)("span",{className:"loading loading-spinner"})}),children:(0,b.jsx)(t,{})})}a.s(["default",()=>u],85106)}];
3
+ ${d}`:c}function k(a){let b={name:"",path:"",children:new Map};for(let c of a){let a=c.split("/").filter(Boolean),d=b,e="";for(let b=0;b<a.length;b++){let f=a[b];e=e?`${e}/${f}`:f,d.children.has(f)||d.children.set(f,{name:f,path:e,children:new Map}),d=d.children.get(f),b===a.length-1&&(d.filePath=c)}}return b}function l(a){let b=[];return Array.from(a.children.values()).forEach(a=>{a.children.size>0&&(b.push(a.path),b.push(...l(a)))}),b}function m(a){let b=a.split("/").filter(Boolean),c=[];for(let a=1;a<b.length;a++)c.push(b.slice(0,a).join("/"));return c}function n({node:a,selectedFile:c,expandedFolders:d,onToggleFolder:e,onSelectFile:g,onActionFile:h,actionType:i,actionPending:j,depth:k=0}){let l=Array.from(a.children.values()).sort((a,b)=>{let c=a.children.size>0,d=b.children.size>0;return c&&!d?-1:!c&&d?1:a.name.localeCompare(b.name)});return(0,b.jsx)(b.Fragment,{children:l.map(a=>{if(a.children.size>0){let f=d.has(a.path);return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 text-xs rounded cursor-pointer text-slate-600 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-800/70 transition-colors",style:{paddingLeft:`${12*k+8}px`},onClick:()=>e(a.path),title:a.path,children:[(0,b.jsx)("span",{className:"text-[10px] opacity-70",children:f?"▼":"▶"}),(0,b.jsx)("i",{className:"iconoir-folder text-[14px] opacity-70","aria-hidden":"true"}),(0,b.jsx)("span",{className:"truncate flex-1",children:a.name})]}),f&&(0,b.jsx)(n,{node:a,selectedFile:c,expandedFolders:d,onToggleFolder:e,onSelectFile:g,onActionFile:h,actionType:i,actionPending:j,depth:k+1})]},a.path)}let l=a.filePath;return l?(0,b.jsxs)("div",{className:(0,f.cn)("flex items-center justify-between gap-2 px-2 py-1.5 rounded-md cursor-pointer group hover:bg-slate-100 dark:hover:bg-slate-800/70 transition-colors text-sm",c===l&&"bg-slate-100 dark:bg-slate-800/70 font-medium text-primary"),style:{paddingLeft:`${12*k+8}px`},onClick:()=>g(l),title:l,children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,b.jsx)("i",{className:"iconoir-page text-[14px] opacity-70 shrink-0","aria-hidden":"true"}),(0,b.jsx)("span",{className:"truncate flex-1 font-mono text-xs",children:a.name})]}),(0,b.jsx)("button",{className:(0,f.cn)("btn btn-ghost btn-xs btn-square opacity-0 group-hover:opacity-100 transition-opacity","stage"===i?"text-success hover:bg-success/10":"text-error hover:bg-error/10"),onClick:a=>{a.stopPropagation(),h(l)},disabled:j,children:(0,b.jsx)("i",{className:(0,f.cn)("text-[14px]","stage"===i?"iconoir-plus-circle":"iconoir-minus-circle"),"aria-hidden":"true"})})]},l):null})})}function o({repoPath:a}){let{data:c,isLoading:o,isError:p,error:q,refetch:r}=(0,d.useGitStatus)(a),{data:s}=(0,d.useGitBranches)(a),t=(0,d.useGitAction)(),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)("main"),[K,L]=(0,e.useState)(new Set),[M,N]=(0,e.useState)(new Set),[O,P]=(0,e.useState)(250),[Q,R]=(0,e.useState)(!1),S=(0,e.useRef)(null);(0,e.useEffect)(()=>{let a=a=>{if(!Q||!S.current)return;let b=S.current.startY-a.clientY;P(Math.max(150,Math.min(800,S.current.startHeight+b)))},b=()=>{R(!1),S.current=null,document.body.style.cursor="default",document.body.style.userSelect="auto"};return Q&&(window.addEventListener("mousemove",a),window.addEventListener("mouseup",b),document.body.style.cursor="ns-resize",document.body.style.userSelect="none"),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",b),document.body.style.cursor="default",document.body.style.userSelect="auto"}},[Q]);let T=c?.files??i,U=!!s&&0===s.branches.length,{staged:V,changes:W}=(0,e.useMemo)(()=>{let a=[],b=[];return T.forEach(c=>{" "!==c.index&&"?"!==c.index&&a.push(c.path),(" "!==c.working_dir||"?"===c.index)&&b.push(c.path)}),{staged:a,changes:b}},[T]),X=(0,e.useMemo)(()=>k(W),[W]),Y=(0,e.useMemo)(()=>k(V),[V]),Z=(0,e.useMemo)(()=>l(X),[X]),$=(0,e.useMemo)(()=>l(Y),[Y]),_=(0,e.useMemo)(()=>{let a=new Set;return Z.forEach(b=>{K.has(b)||a.add(b)}),y&&m(y).forEach(b=>a.add(b)),a},[Z,K,y]),aa=(0,e.useMemo)(()=>{let a=new Set;return $.forEach(b=>{M.has(b)||a.add(b)}),y&&m(y).forEach(b=>a.add(b)),a},[$,M,y]),ab=(0,e.useCallback)(a=>{L(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),ac=(0,e.useCallback)(a=>{N(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),ad=async b=>{await t.mutateAsync({repoPath:a,action:"stage",data:{files:[b]}})},ae=async b=>{await t.mutateAsync({repoPath:a,action:"unstage",data:{files:[b]}})},af=async()=>{await t.mutateAsync({repoPath:a,action:"stage",data:{files:["."]}})},ag=async()=>{await t.mutateAsync({repoPath:a,action:"unstage",data:{files:V}})},ah=async()=>{await t.mutateAsync({repoPath:a,action:"stash",data:{message:C||void 0}}),B(!1),D(""),z(null)},ai=async()=>{await t.mutateAsync({repoPath:a,action:"discard",data:{includeUntracked:!0}}),F(!1),z(null)},aj=async()=>{let b=u.trim();if(b){if(U)return void H(!0);await t.mutateAsync({repoPath:a,action:"commit",data:{message:j(b,w)}}),v(""),x(""),z(null)}},ak=async()=>{let b=u.trim(),c=I.trim();b&&c&&(await t.mutateAsync({repoPath:a,action:"commit",data:{message:j(b,w),initialBranch:c}}),v(""),x(""),z(null),H(!1))};(0,h.useEscapeDismiss)(A,()=>B(!1),()=>{t.isPending||ah()}),(0,h.useEscapeDismiss)(E,()=>F(!1),()=>{t.isPending||ai()}),(0,h.useEscapeDismiss)(G,()=>H(!1),()=>{!t.isPending&&I.trim()&&ak()});let al=a=>{(a.metaKey||a.ctrlKey)&&"Enter"===a.key&&(a.preventDefault(),V.length>0&&u.trim()&&!t.isPending&&aj())};return o?(0,b.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,b.jsx)("span",{className:"loading loading-spinner text-base-content/50"})}):p?(0,b.jsxs)("div",{className:"flex items-center justify-center h-64 flex-col gap-4",children:[(0,b.jsx)("p",{className:"text-error font-bold",children:"Error Loading Status"}),(0,b.jsx)("p",{className:"text-sm opacity-70",children:q?.message||"An unknown error occurred"}),(0,b.jsxs)("button",{onClick:()=>r(),className:"btn btn-outline btn-sm",children:[(0,b.jsx)("i",{className:"iconoir-refresh-circle text-[16px] mr-1","aria-hidden":"true"}),"Try Again"]})]}):c?(0,b.jsxs)("div",{className:"flex h-full overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex flex-1 min-w-0 flex-col gap-2 overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex min-h-[57px] shrink-0 items-center justify-between gap-2 rounded-xl border border-slate-200 bg-white px-4 py-2 dark:border-slate-800 dark:bg-slate-900",children:[(0,b.jsx)("h1",{className:"font-bold text-lg text-slate-900 dark:text-slate-100",children:"Changes"}),(0,b.jsxs)("button",{className:"flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-3 text-sm font-medium text-slate-600 transition-colors hover:bg-slate-50 hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300 dark:hover:bg-slate-800 dark:hover:text-slate-100",onClick:()=>r(),disabled:t.isPending,title:"Refresh status",children:[t.isPending?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,b.jsx)("i",{className:"iconoir-refresh-circle text-[16px]","aria-hidden":"true"}),"Refresh"]})]}),(0,b.jsxs)("div",{className:"flex flex-1 overflow-hidden rounded-xl border border-slate-200 bg-white dark:border-slate-800 dark:bg-slate-900",children:[(0,b.jsx)("div",{className:"w-64 border-r border-slate-200 dark:border-slate-800 flex flex-col bg-slate-50/70 dark:bg-slate-900/70",children:(0,b.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,b.jsxs)("div",{className:"p-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 mb-1",children:[(0,b.jsxs)("h3",{className:"text-xs font-bold uppercase tracking-wider opacity-70",children:["Changes (",W.length,")"]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[0===W.length&&V.length>0?(0,b.jsx)("button",{className:"btn btn-ghost btn-xs btn-square",onClick:ag,title:"Unstage All",children:(0,b.jsx)("i",{className:"iconoir-arrow-up text-[16px]","aria-hidden":"true"})}):(0,b.jsx)("button",{className:"btn btn-ghost btn-xs btn-square",onClick:af,disabled:0===W.length,title:"Stage All",children:(0,b.jsx)("i",{className:"iconoir-arrow-down text-[16px]","aria-hidden":"true"})}),(0,b.jsx)("button",{className:"btn btn-ghost btn-xs btn-square",onClick:()=>B(!0),disabled:0===W.length&&0===V.length,title:"Stash",children:(0,b.jsx)("i",{className:"iconoir-download-square text-[16px]","aria-hidden":"true"})}),(0,b.jsx)("button",{className:"btn btn-ghost btn-xs btn-square text-error hover:bg-error/10",onClick:()=>F(!0),disabled:0===W.length,title:"Discard All",children:(0,b.jsx)("i",{className:"iconoir-trash text-[16px]","aria-hidden":"true"})})]})]}),(0,b.jsxs)("div",{className:"space-y-0.5",children:[0===W.length&&(0,b.jsx)("p",{className:"px-2 py-2 text-xs opacity-50 italic",children:"No changes"}),W.length>0&&(0,b.jsx)(n,{node:X,selectedFile:y,expandedFolders:_,onToggleFolder:ab,onSelectFile:z,onActionFile:ad,actionType:"stage",actionPending:t.isPending})]})]}),(0,b.jsx)("div",{className:"h-px bg-slate-200 dark:bg-slate-800 mx-4 my-2"}),(0,b.jsxs)("div",{className:"p-2",children:[(0,b.jsx)("div",{className:"flex items-center justify-between px-2 py-2 mb-1",children:(0,b.jsxs)("h3",{className:"text-xs font-bold uppercase tracking-wider opacity-70",children:["Staged (",V.length,")"]})}),(0,b.jsxs)("div",{className:"space-y-0.5",children:[0===V.length&&(0,b.jsx)("p",{className:"px-2 py-2 text-xs opacity-50 italic",children:"No staged changes"}),V.length>0&&(0,b.jsx)(n,{node:Y,selectedFile:y,expandedFolders:aa,onToggleFolder:ac,onSelectFile:z,onActionFile:ae,actionType:"unstage",actionPending:t.isPending})]})]})]})}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col bg-white dark:bg-slate-900 overflow-hidden",children:[(0,b.jsx)("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:y?(0,b.jsx)("div",{className:"h-full flex flex-col",children:(0,b.jsx)(g.DiffView,{repoPath:a,filePath:y})}):(0,b.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center opacity-50",children:[(0,b.jsx)("div",{className:"p-8 rounded-full bg-slate-100 dark:bg-slate-800/60 mb-4 text-4xl",children:(0,b.jsx)("i",{className:"iconoir-refresh-circle text-[32px]","aria-hidden":"true"})}),(0,b.jsx)("p",{className:"text-sm font-bold",children:"Select a file to view changes"})]})}),(0,b.jsx)("div",{className:"h-1.5 cursor-ns-resize flex items-center justify-center hover:bg-slate-100 dark:hover:bg-slate-800/60 transition-colors group shrink-0 border-t border-slate-200 dark:border-slate-800",onMouseDown:a=>{a.preventDefault(),R(!0),S.current={startY:a.clientY,startHeight:O}},children:(0,b.jsx)("div",{className:"w-8 h-1 rounded-full bg-base-300 group-hover:bg-base-content/20 transition-colors"})}),(0,b.jsx)("div",{className:"flex flex-col border-t border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 shrink-0",style:{height:O},children:(0,b.jsxs)("div",{className:"flex-1 p-4 overflow-y-auto",children:[(0,b.jsx)("input",{type:"text",placeholder:"Commit subject...",value:u,onChange:a=>v(a.target.value),onKeyDown:al,className:"input input-bordered w-full text-sm mb-2 font-sans"}),(0,b.jsx)("textarea",{placeholder:"Commit message body (optional)...",value:w,onChange:a=>x(a.target.value),onKeyDown:al,className:"textarea textarea-bordered w-full text-sm resize-none mb-3 font-sans flex-1",style:{minHeight:"80px",height:"calc(100% - 90px)"}}),(0,b.jsxs)("button",{className:"btn btn-primary w-full btn-sm",onClick:aj,disabled:0===V.length||!u.trim()||t.isPending,children:[t.isPending?(0,b.jsx)("span",{className:"loading loading-spinner loading-xs mr-2"}):(0,b.jsx)("span",{className:"mr-2",children:"✅"}),"Commit Changes"]})]})})]})]})]}),A&&(0,b.jsxs)("dialog",{className:"modal modal-open",children:[(0,b.jsxs)("div",{className:"modal-box",children:[(0,b.jsx)("h3",{className:"font-bold text-lg",children:"Stash Changes"}),(0,b.jsx)("p",{className:"py-4 opacity-70",children:"Save your local modifications to a new stash entry."}),(0,b.jsx)("div",{className:"py-2",children:(0,b.jsx)("input",{type:"text",placeholder:"Stash message (optional)",value:C,onChange:a=>D(a.target.value),autoFocus:!0,onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),ah())},className:"input input-bordered w-full"})}),(0,b.jsxs)("div",{className:"modal-action",children:[(0,b.jsx)("button",{className:"btn",onClick:()=>B(!1),children:"Cancel"}),(0,b.jsxs)("button",{className:"btn btn-primary",onClick:ah,disabled:t.isPending,children:[t.isPending&&(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Stash"]})]})]}),(0,b.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,b.jsx)("button",{onClick:()=>B(!1),children:"close"})})]}),E&&(0,b.jsxs)("dialog",{className:"modal modal-open",children:[(0,b.jsxs)("div",{className:"modal-box",children:[(0,b.jsx)("h3",{className:"font-bold text-lg",children:"Discard Changes"}),(0,b.jsx)("p",{className:"py-4",children:"Are you sure you want to discard all unstaged changes and new files? This action cannot be undone."}),(0,b.jsxs)("div",{className:"modal-action",children:[(0,b.jsx)("button",{className:"btn",onClick:()=>F(!1),children:"Cancel"}),(0,b.jsxs)("button",{className:"btn btn-error",onClick:ai,disabled:t.isPending,children:[t.isPending&&(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Discard"]})]})]}),(0,b.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,b.jsx)("button",{onClick:()=>F(!1),children:"close"})})]}),G&&(0,b.jsxs)("dialog",{className:"modal modal-open",children:[(0,b.jsxs)("div",{className:"modal-box",children:[(0,b.jsx)("h3",{className:"font-bold text-lg",children:"First Commit Branch"}),(0,b.jsx)("p",{className:"py-4 opacity-70",children:"This repository has no commits yet. Choose the branch name for the first commit."}),(0,b.jsx)("div",{className:"py-2",children:(0,b.jsx)("input",{type:"text",placeholder:"Branch name",value:I,onChange:a=>J((0,f.sanitizeBranchName)(a.target.value)),autoFocus:!0,onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),ak())},className:"input input-bordered w-full"})}),(0,b.jsxs)("div",{className:"modal-action",children:[(0,b.jsx)("button",{className:"btn",onClick:()=>H(!1),children:"Cancel"}),(0,b.jsxs)("button",{className:"btn btn-primary",onClick:ak,disabled:!I.trim()||t.isPending,children:[t.isPending&&(0,b.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Commit to Branch"]})]})]}),(0,b.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,b.jsx)("button",{onClick:()=>H(!1),children:"close"})})]})]}):(0,b.jsx)("div",{className:"flex items-center justify-center h-64 opacity-70",children:"No status data available"})}var p=a.i(14539);function q(){let a=(0,c.useSearchParams)().get("path");return((0,p.useWorkspaceTitle)(a,"Changes"),a)?(0,b.jsx)(o,{repoPath:a}):(0,b.jsx)("div",{className:"p-8",children:"No repository path specified."})}function r(){return(0,b.jsx)(e.Suspense,{fallback:(0,b.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,b.jsx)("span",{className:"loading loading-spinner"})}),children:(0,b.jsx)(q,{})})}a.s(["default",()=>r],85106)}];
4
4
 
5
5
  //# sourceMappingURL=src_app_git_changes_page_tsx_f6dc28dc._.js.map