@codeyam/codeyam-cli 0.1.13 → 0.1.15

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 (95) hide show
  1. package/analyzer-template/.build-info.json +6 -6
  2. package/analyzer-template/log.txt +3 -3
  3. package/codeyam-cli/src/commands/editor.js +62 -27
  4. package/codeyam-cli/src/commands/editor.js.map +1 -1
  5. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +440 -1
  6. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
  7. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +58 -4
  8. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -1
  9. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +76 -0
  10. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
  11. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +139 -1
  12. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -1
  13. package/codeyam-cli/src/utils/backgroundServer.js +1 -1
  14. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  15. package/codeyam-cli/src/utils/editorAudit.js +107 -6
  16. package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
  17. package/codeyam-cli/src/utils/editorEntityHelpers.js +18 -3
  18. package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -1
  19. package/codeyam-cli/src/utils/editorScenarios.js +10 -1
  20. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
  21. package/codeyam-cli/src/utils/scenariosManifest.js +30 -0
  22. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -1
  23. package/codeyam-cli/src/webserver/backgroundServer.js +42 -57
  24. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  25. package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CzTDWkF2.js → CopyButton-CLe80MMu.js} +1 -1
  26. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-BFbq6iFk.js → EntityItem-Crt_KN_U.js} +1 -1
  27. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-B6OMi58N.js → EntityTypeIcon-CD7lGABo.js} +1 -1
  28. package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-DuYodzo1.js → InlineSpinner-CgTNOhnu.js} +1 -1
  29. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CXo9EeCl.js → InteractivePreview-CKeQT5Ty.js} +2 -2
  30. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-DYCNb2It.js → LibraryFunctionPreview-D3s1MFkb.js} +1 -1
  31. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CZgY3sxX.js → LogViewer-CM5zg40N.js} +1 -1
  32. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-CnYYwRDw.js → ReportIssueModal-C2PLkej3.js} +1 -1
  33. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CDoF7ZpU.js → SafeScreenshot-DanvyBPb.js} +1 -1
  34. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DrnfvaLL.js → ScenarioViewer-DUMfcNVK.js} +1 -1
  35. package/codeyam-cli/src/webserver/build/client/assets/{Spinner-Df3UCi8k.js → Spinner-D0LgAaSa.js} +1 -1
  36. package/codeyam-cli/src/webserver/build/client/assets/{ViewportInspectBar-DRKR9T0U.js → ViewportInspectBar-BA_Ry-rs.js} +1 -1
  37. package/codeyam-cli/src/webserver/build/client/assets/{_index-ClR-g3tY.js → _index-BAWd-Xjf.js} +1 -1
  38. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-DTH6ydEA.js → activity.(_tab)-BOARiB-g.js} +1 -1
  39. package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-74hnHF59.js → addon-web-links-CHx25PAe.js} +1 -1
  40. package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-B8CYhCO9.js → agent-transcripts-Bg3e7q4S.js} +1 -1
  41. package/codeyam-cli/src/webserver/build/client/assets/{book-open-CLaoh4ac.js → book-open-CL-lMgHh.js} +1 -1
  42. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BZ2DZxbW.js → chevron-down-GmAjGS9-.js} +1 -1
  43. package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-BBXArFPl.js → chunk-JZWAC4HX-BAdwhyCx.js} +11 -11
  44. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-CT4unAk-.js → circle-check-DFcQkN5j.js} +1 -1
  45. package/codeyam-cli/src/webserver/build/client/assets/{copy-zK0B6Nu-.js → copy-C6iF61Xs.js} +1 -1
  46. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-DJB0YQJL.js → createLucideIcon-4ImjHTVC.js} +1 -1
  47. package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-CkXFP_i-.js → dev.empty-C8y4mmyv.js} +1 -1
  48. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-Gbk_i5Js.js +1 -0
  49. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-B7xQ9Sjy.js +58 -0
  50. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-CxmrE6AF.js +41 -0
  51. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-BqAN7hyG.js → entity._sha._-Blfy9UlN.js} +1 -1
  52. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.dev-BOi8kpwd.js → entity._sha.scenarios._scenarioId.dev-CUobbQdQ.js} +1 -1
  53. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-Dg1NhIms.js → entity._sha.scenarios._scenarioId.fullscreen-C6eeL24i.js} +1 -1
  54. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-CJX6kkkV.js → entity._sha_.create-scenario-DQM8E7L4.js} +1 -1
  55. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BhVjZhKg.js → entity._sha_.edit._scenarioId-CAoXLsQr.js} +1 -1
  56. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-_gzKltPN.js → entry.client-SuW9syRS.js} +1 -1
  57. package/codeyam-cli/src/webserver/build/client/assets/{files-CV_17tZS.js → files-D-xGrg29.js} +1 -1
  58. package/codeyam-cli/src/webserver/build/client/assets/{git-D-YXmMbR.js → git-Bq_fbXP5.js} +1 -1
  59. package/codeyam-cli/src/webserver/build/client/assets/globals-fAqOD9ex.css +1 -0
  60. package/codeyam-cli/src/webserver/build/client/assets/{index-CCrgCshv.js → index-Bp1l4hSv.js} +1 -1
  61. package/codeyam-cli/src/webserver/build/client/assets/{index-BsX0F-9C.js → index-CWV9XZiG.js} +1 -1
  62. package/codeyam-cli/src/webserver/build/client/assets/{index-Blo6EK8G.js → index-DE3jI_dv.js} +1 -1
  63. package/codeyam-cli/src/webserver/build/client/assets/{labs-Byazq8Pv.js → labs-B_IX45ih.js} +1 -1
  64. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-DVQ0oHR7.js → loader-circle-De-7qQ2u.js} +1 -1
  65. package/codeyam-cli/src/webserver/build/client/assets/manifest-5d53342d.js +1 -0
  66. package/codeyam-cli/src/webserver/build/client/assets/{memory-b-VmA2Vj.js → memory-Cx2xEx7s.js} +1 -1
  67. package/codeyam-cli/src/webserver/build/client/assets/{pause-DGcndCAa.js → pause-CFxEKL1u.js} +1 -1
  68. package/codeyam-cli/src/webserver/build/client/assets/root-DB3O9_9j.js +67 -0
  69. package/codeyam-cli/src/webserver/build/client/assets/{search-C0Uw0bcK.js → search-BdBb5aqc.js} +1 -1
  70. package/codeyam-cli/src/webserver/build/client/assets/{settings-OoNgHIfW.js → settings-DdE-Untf.js} +1 -1
  71. package/codeyam-cli/src/webserver/build/client/assets/{simulations-Bcemfu8a.js → simulations-DSCdE99u.js} +1 -1
  72. package/codeyam-cli/src/webserver/build/client/assets/{terminal-BgMmG7R9.js → terminal-CrplD4b1.js} +1 -1
  73. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-Cs87hJYK.js → triangle-alert-DqJ0j69l.js} +1 -1
  74. package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-BR3Rs7JY.js → useCustomSizes-DhXHbEjP.js} +1 -1
  75. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BxxP_XF9.js → useLastLogLine-BNd5hYuW.js} +1 -1
  76. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-BermyNU5.js → useReportContext-Cy5Qg_UR.js} +1 -1
  77. package/codeyam-cli/src/webserver/build/client/assets/{useToast-a_QN_W9_.js → useToast-5HR2j9ZE.js} +1 -1
  78. package/codeyam-cli/src/webserver/build/server/assets/{analysisRunner-lv2ooewK.js → analysisRunner-DcJSnBCE.js} +1 -1
  79. package/codeyam-cli/src/webserver/build/server/assets/{index-Im3Smyei.js → index-CEaDhUiv.js} +1 -1
  80. package/codeyam-cli/src/webserver/build/server/assets/{init-BjuAFKGM.js → init-DA7guOrE.js} +1 -1
  81. package/codeyam-cli/src/webserver/build/server/assets/server-build-juyiY2m6.js +551 -0
  82. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  83. package/codeyam-cli/src/webserver/build-info.json +5 -5
  84. package/codeyam-cli/src/webserver/terminalServer.js +1 -1
  85. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
  86. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +1 -1
  87. package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +1 -1
  88. package/package.json +1 -1
  89. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-DPw7NZHc.js +0 -1
  90. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-CjC3_6JI.js +0 -58
  91. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-DBa7T2FK.js +0 -41
  92. package/codeyam-cli/src/webserver/build/client/assets/globals-DRvOjyO3.css +0 -1
  93. package/codeyam-cli/src/webserver/build/client/assets/manifest-75b1b319.js +0 -1
  94. package/codeyam-cli/src/webserver/build/client/assets/root-F-k2uYj5.js +0 -67
  95. package/codeyam-cli/src/webserver/build/server/assets/server-build-CNjF0B9B.js +0 -551
@@ -1 +1 @@
1
- import{aG as Z,aH as _,aw as $,ax as rr,aE as tr,ay as or,aA as ir,aB as pr,aD as mr,aC as ar,aF as sr,az as er}from"./assets/server-build-CNjF0B9B.js";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"fetch-retry";import"better-sqlite3";import"pg";import"fs";import"path";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"typescript";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"url";import"util";import"dotenv";import"events";import"uuid";import"http";import"net";import"ws";import"node-pty";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";export{Z as allowedActionOrigins,_ as assets,$ as assetsBuildDirectory,rr as basename,tr as entry,or as future,ir as isSpaMode,pr as prerender,mr as publicPath,ar as routeDiscovery,sr as routes,er as ssr};
1
+ import{aG as Z,aH as _,aw as $,ax as rr,aE as tr,ay as or,aA as ir,aB as pr,aD as mr,aC as ar,aF as sr,az as er}from"./assets/server-build-juyiY2m6.js";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"fetch-retry";import"better-sqlite3";import"pg";import"fs";import"path";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"typescript";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"url";import"util";import"dotenv";import"events";import"uuid";import"http";import"net";import"ws";import"node-pty";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";export{Z as allowedActionOrigins,_ as assets,$ as assetsBuildDirectory,rr as basename,tr as entry,or as future,ir as isSpaMode,pr as prerender,mr as publicPath,ar as routeDiscovery,sr as routes,er as ssr};
@@ -1,7 +1,7 @@
1
1
  {
2
- "buildTimestamp": "2026-03-17T22:42:51.370Z",
3
- "buildTime": 1773787371370,
4
- "buildNumber": 1110,
5
- "semanticVersion": "0.1.1110",
6
- "version": "0.1.1110 (2026-03-17T22:42)"
2
+ "buildTimestamp": "2026-03-18T20:56:38.598Z",
3
+ "buildTime": 1773867398598,
4
+ "buildNumber": 1123,
5
+ "semanticVersion": "0.1.1123",
6
+ "version": "0.1.1123 (2026-03-18T20:56)"
7
7
  }
@@ -279,7 +279,7 @@ function writeEditorModeContext(ctx) {
279
279
  ' - **Remix:** `app/routes/isolated-components.ComponentName.tsx` → `/isolated-components/ComponentName`',
280
280
  ' - **Next.js:** `app/isolated-components/ComponentName/page.tsx` → `/isolated-components/ComponentName`',
281
281
  '- The route defines a `scenarios` object mapping scenario names to props, reads `?s=ScenarioName` from the URL, and renders the component',
282
- '- Wrap the component in a centered container: `<div style="display:flex;justify-content:center;align-items:center;min-height:100vh;padding:20px"><div style="width:100%;max-width:...">` — set max-width to match the component\'s real container (e.g. card in 3-col grid → 24rem)',
282
+ '- Wrap the component in a centered container: `<div style="display:flex;justify-content:center;align-items:center;min-height:100vh"><div style="width:100%;max-width:...">` — set max-width to match the component\'s real container (e.g. card in 3-col grid → 24rem)',
283
283
  '- **Create multiple scenarios per component** (like tests): default/happy path, edge cases (empty data, long text, max items), different visual states (loading, error, disabled)',
284
284
  '- Register each scenario: `codeyam editor register \'{"name":"ComponentName - Scenario","componentName":"ComponentName","componentPath":"path/to/file.tsx","url":"/isolated-components/ComponentName?s=Scenario","mockData":{"routes":{"/api/...":{"body":[...]}}}}\'`',
285
285
  '- The url is a PATH, not a full URL — the proxy appends it and intercepts API calls the component makes',
@@ -1 +1 @@
1
- {"version":3,"file":"terminalServer.js","sourceRoot":"","sources":["../../../../src/webserver/terminalServer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEhD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAmB1D,wEAAwE;AACxE,wFAAwF;AACxF,iFAAiF;AACjF,qFAAqF;AACrF,0EAA0E;AAC1E,MAAM,QAAQ,GAAyB,OACrC,UACD,EAAC,yBAAyB,QAAzB,yBAAyB,GAAK,IAAI,GAAG,EAAmB,EAAC,CAAC;AAE5D,+DAA+D;AAC/D,mEAAmE;AACnE,yEAAyE;AACzE,MAAM,YAAY,GAA6B,OAC7C,UACD,EAAC,qBAAqB,QAArB,qBAAqB,GAAK,IAAI,GAAG,EAAuB,EAAC,CAAC;AAE5D,MAAM,gBAAgB,GAAG,KAAM,CAAC;AAChC,MAAM,eAAe,GAAG,KAAM,CAAC;AAC/B,MAAM,iBAAiB,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM;AAE1C,2DAA2D;AAC3D,IAAI,YAAY,GACb,UAAkB,CAAC,qBAAqB,IAAI,IAAI,CAAC;AAEpD,0DAA0D;AAC1D,kEAAkE;AAClE,+DAA+D;AAC/D,MAAM,oBAAoB,GAAG;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E,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,eAAe;QACjB,CAAC;QACD,IAAI,CAAC;YACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACP,iBAAiB;QACnB,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,KAAK,EAAE,CAAC;IAEjB,yBAAyB;IACzB,KAAK,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,YAAY,EAAE,CAAC;QACxC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAClC,IAAI,CAAC;YACH,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QAC7B,CAAC;QAAC,MAAM,CAAC;YACP,eAAe;QACjB,CAAC;IACH,CAAC;IACD,YAAY,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC"}
@@ -18,7 +18,7 @@
18
18
  "@prisma/adapter-better-sqlite3": "^7.4.1",
19
19
  "@prisma/client": "^7.4.1",
20
20
  "better-sqlite3": "^12.6.2",
21
- "next": "^15.3.3",
21
+ "next": "^16.1.7",
22
22
  "prisma": "^7.4.1",
23
23
  "react": "^19.1.0",
24
24
  "react-dom": "^19.1.0"
@@ -16,7 +16,7 @@
16
16
  "@prisma/adapter-pg": "^7.4.1",
17
17
  "@prisma/client": "^7.4.1",
18
18
  "@supabase/supabase-js": "^2.49.4",
19
- "next": "^15.3.3",
19
+ "next": "^16.1.7",
20
20
  "pg": "^8.16.0",
21
21
  "prisma": "^7.4.1",
22
22
  "react": "^19.1.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeyam/codeyam-cli",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Local development CLI for CodeYam analysis",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- import{w as t}from"./chunk-JZWAC4HX-BBXArFPl.js";const n=t(function(){return null});export{n as default};
@@ -1,58 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Blo6EK8G.js","assets/jsx-runtime-D_zvdyIk.js","assets/chunk-JZWAC4HX-BBXArFPl.js"])))=>i.map(i=>d[i]);
2
- var ys=Object.defineProperty;var vs=(t,s,n)=>s in t?ys(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var St=(t,s,n)=>vs(t,typeof s!="symbol"?s+"":s,n);import{r,w as Ns,u as ws,b as Ss,a as ks,c as Cs,O as Ps}from"./chunk-JZWAC4HX-BBXArFPl.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as Es,C as Ms}from"./useCustomSizes-BR3Rs7JY.js";import{g as Is,s as Ts,r as Ke,b as Qe,c as $s,l as As,d as Rs,e as Ls,f as _s,a as Ds,T as Fs,D as Bs}from"./editorPreview-DBa7T2FK.js";import{C as ue}from"./CopyButton-CzTDWkF2.js";import{_ as et}from"./preload-helper-ckwbz45p.js";import{c as Os}from"./cy-logo-cli-DcX-ZS3p.js";import{u as zs,S as kt}from"./Spinner-Df3UCi8k.js";import"./copy-zK0B6Nu-.js";import"./createLucideIcon-DJB0YQJL.js";import"./useLastLogLine-BxxP_XF9.js";function ke(t){var l;if(!t.startsWith("app/")&&!t.startsWith("("))return"/";const n=t.replace(/^app\//,"").split("/"),a=n.pop(),c=((l=a.match(/\.(tsx?|jsx?|js)$/))==null?void 0:l[0])||"",i=a.slice(0,-c.length);let o;return i==="page"||i==="index"?o=n:o=[...n,i],o=o.filter(m=>!m.startsWith("(")),o.length===0?"/":"/"+o.join("/")}function Ce(t){return t==="/"?"Home":t.replace(/^\//,"").split("/").map(n=>n.startsWith("[")?n:n.charAt(0).toUpperCase()+n.slice(1)).join(" / ")}function Le(t){if(!t||t==="/")return"Home";const s=t.split("?")[0].replace(/^\//,"");if(!s)return"Home";const n=s.split("/")[0].replace(/\.[^.]+$/,"");return n.charAt(0).toUpperCase()+n.slice(1)}function Bt(t){return t?t.includes("/isolated-components"):!1}function Ws(t,s){return!s||Object.keys(s).length===0?t:t.filter(n=>s[n.name])}const Re=[{name:"Desktop",width:1440,height:900},{name:"Laptop",width:1024,height:768},{name:"Tablet",width:768,height:1024},{name:"Mobile",width:375,height:667}];function Us(t){if(!t)return Re;const s=Object.entries(t).map(([a,c])=>({name:a,width:c.width,height:c.height})),n=new Set(s.map(a=>a.name));return[...s,...Re.filter(a=>!n.has(a.name))]}function Hs({featureName:t,editorStep:s,editorStepLabel:n,onContinue:a}){const c=r.useCallback(i=>{i.key==="Enter"&&(i.preventDefault(),a())},[a]);return r.useEffect(()=>(window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)),[c]),e.jsx("div",{className:"flex items-center justify-center h-full bg-[#1e1e1e] text-[#d4d4d4]",children:e.jsxs("div",{className:"max-w-md w-full mx-4 p-6 bg-[#252526] border border-[#3d3d3d] rounded-lg",children:[e.jsx("h2",{className:"text-lg font-semibold mb-3 text-white",children:"Resume Previous Session?"}),e.jsx("p",{className:"text-sm text-[#999] mb-4",children:"An editor session is still in progress:"}),e.jsxs("div",{className:"bg-[#1e1e1e] rounded p-3 mb-5 text-sm",children:[t&&e.jsxs("div",{className:"mb-1",children:[e.jsx("span",{className:"text-[#999]",children:"Feature:"})," ",e.jsx("span",{className:"text-white",children:t})]}),s!=null&&n&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[#999]",children:"Step:"})," ",e.jsxs("span",{className:"text-white",children:[s," (",n,")"]})]})]}),e.jsx("button",{onClick:a,className:"w-full px-4 py-2 text-sm rounded transition-colors cursor-pointer bg-[#005c75] text-white font-medium hover:bg-[#004d63] ring-2 ring-white/50",children:"Continue Session"})]})})}function tt(t){const[s,n]=r.useState(null),[a,c]=r.useState(!1),i=r.useCallback(()=>{t&&(c(!0),fetch(`/api/editor-test-results?testFile=${encodeURIComponent(t)}`).then(o=>o.json()).then(o=>{n(o),c(!1)}).catch(()=>{n({testFilePath:t,status:"error",testCases:[],errorMessage:"Failed to fetch test results"}),c(!1)}))},[t]);return r.useEffect(()=>{t&&i()},[t,i]),{results:s,isRunning:a,runTests:i}}function _e({scenarioId:t,updatedAt:s,alt:n,className:a="",imgClassName:c=""}){const[i,o]=r.useState(!1),l=`/api/editor-scenario-image/${t}.png${s?`?v=${encodeURIComponent(s)}`:""}`;return r.useEffect(()=>{o(!1)},[t]),i?e.jsx("div",{className:`flex items-center justify-center ${a}`,children:e.jsx("span",{className:"text-[8px] text-gray-500",children:"No img"})}):e.jsx("div",{className:a,children:e.jsx("img",{src:l,alt:n,className:c,loading:"lazy",onError:()=>o(!0)})})}function we({scenarioId:t,updatedAt:s,hasScreenshot:n,imgSrc:a,name:c,isActive:i,onSelect:o}){const l=t&&n,m=!t&&a;return e.jsxs("button",{onClick:o,className:"flex flex-col items-center gap-1 cursor-pointer group",title:c,children:[e.jsx("div",{className:`w-32 h-32 rounded overflow-hidden border-2 transition-all bg-[#1a1a1a] ${i?"border-[#005c75] ring-1 ring-[#005c75]":"border-transparent hover:border-[#4d4d4d]"}`,children:l?e.jsx(_e,{scenarioId:t,updatedAt:s,alt:c,className:"w-full h-full",imgClassName:"w-full h-full object-contain"}):m?e.jsx("img",{src:a,alt:c,className:"w-full h-full object-contain",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-[#1a1a1a] flex items-center justify-center",children:e.jsx("span",{className:"text-[8px] text-gray-600",children:"No img"})})}),e.jsx("span",{className:`text-[10px] leading-tight text-center truncate w-32 ${i?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:c})]})}function Ze({testFile:t,entityName:s}){const{results:n,isRunning:a,runTests:c}=tt(t);if(a&&!n)return e.jsxs("div",{className:"px-2 pt-1 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-gray-400",children:"Running tests..."})]});if(!n)return null;if(n.status==="error")return e.jsx("div",{className:"px-2 pt-1",children:e.jsx("span",{className:"text-[10px] text-red-400",children:n.errorMessage})});const i=s?n.testCases.filter(m=>m.fullName.startsWith(s)):n.testCases,o=i.length>0?i:n.testCases;if(o.length===0)return null;const l=s?`${s} > `:"";return e.jsxs("div",{className:"px-2 pt-1 space-y-0.5",children:[o.map(m=>{var j;const N=l&&m.fullName.startsWith(l)?m.fullName.slice(l.length):m.fullName;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[m.status==="passed"?e.jsx("span",{className:"text-green-400 text-[10px]",children:"✓"}):m.status==="failed"?e.jsx("span",{className:"text-red-400 text-[10px]",children:"✗"}):e.jsx("span",{className:"text-gray-500 text-[10px]",children:"—"}),e.jsx("span",{className:`text-[10px] ${m.status==="passed"?"text-green-400":m.status==="failed"?"text-red-400":"text-gray-500"}`,children:N})]}),m.status==="failed"&&((j=m.failureMessages)==null?void 0:j.map((S,g)=>e.jsx("div",{className:"pl-4 text-[9px] text-red-300/70 truncate max-w-full",title:S,children:S.split(`
3
- `)[0]},g)))]},m.fullName)}),e.jsx("button",{onClick:c,disabled:a,className:"mt-1 text-[10px] text-[#00a0c4] hover:text-[#00c4ee] transition-colors cursor-pointer disabled:opacity-50 bg-transparent border-none p-0",children:a?"Running...":"Re-run"})]})}function oe({filePath:t}){return t?e.jsxs("div",{className:"flex items-center gap-1 px-2 mt-0.5",children:[e.jsxs("a",{href:`/api/editor-file?path=${encodeURIComponent(t)}`,target:"_blank",rel:"noopener noreferrer",title:"Open file",className:"flex items-center gap-1 text-gray-500 hover:text-gray-300 transition-colors min-w-0",children:[e.jsx("span",{className:"text-[9px] truncate",children:t}),e.jsx("svg",{className:"shrink-0",width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsx(ue,{content:t,icon:!0,iconSize:10,className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors"})]}):null}function Js({scenarios:t,projectRoot:s,activeScenarioId:n,onScenarioSelect:a,zoomComponent:c,focusedEntity:i,onZoomChange:o,analyzedEntities:l=[],glossaryFunctions:m=[],activeAnalyzedScenarioId:N,onAnalyzedScenarioSelect:j,entityImports:S,pageFilePaths:g={}}){const{pageGroups:I,componentGroups:h}=r.useMemo(()=>{var f;const p=new Map,x=new Map;for(const w of t)if(w.componentName){const k=x.get(w.componentName)||[];k.push(w),x.set(w.componentName,k)}else if(Bt(w.url)){const k=(f=w.url)==null?void 0:f.match(/[?&]c=([^&]+)/),$=k?decodeURIComponent(k[1]):"Isolated",B=x.get($)||[];B.push(w),x.set($,B)}else{const k=w.pageFilePath?Ce(ke(w.pageFilePath)):Le(w.url),$=p.get(k)||[];$.push(w),p.set(k,$)}const y=new Map([...x.entries()].sort(([w],[k])=>w.localeCompare(k)));return{pageGroups:p,componentGroups:y}},[t]),R=r.useMemo(()=>{const p=new Set((l||[]).filter(y=>y.entityType==="visual").map(y=>y.name)),x=new Map;for(const[y,f]of h)p.has(y)||x.set(y,f);return x},[h,l]),{visualEntities:_,libraryEntities:T}=r.useMemo(()=>{const p=l.filter(y=>y.entityType==="visual").sort((y,f)=>y.name.localeCompare(f.name)),x=l.filter(y=>y.entityType==="library"||y.entityType==="functionCall").sort((y,f)=>y.name.localeCompare(f.name));return{visualEntities:p,libraryEntities:x}},[l]),F=r.useMemo(()=>{const p=new Set(T.map(x=>x.name));return m.filter(x=>!p.has(x.name)).sort((x,y)=>x.name.localeCompare(y.name))},[m,T]),D=l.some(p=>p.isAnalyzing),v=r.useRef(null),M=r.useRef(0),z=r.useCallback(()=>{v.current&&(M.current=v.current.scrollTop)},[]);if(r.useEffect(()=>{v.current&&M.current>0&&(v.current.scrollTop=M.current)}),t.length===0&&l.length===0&&F.length===0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 px-8",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"No scenarios yet"}),e.jsx("p",{className:"text-xs",children:"Scenarios will appear here as Claude creates them alongside your code. Each scenario represents a different state of your app's data."})]})});if(c&&i){const p=i.name,x=i.filePath,y=i.sha,f=t.filter(C=>C.componentName===p||C.componentPath===x||!C.componentName&&(C.pageFilePath===x||y&&C.entitySha===y)),w=new Set((S==null?void 0:S[p])||[]),k=w.size>0,$=k?_.filter(C=>w.has(C.name)):[],B=k?T.filter(C=>w.has(C.name)):[];return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-1",children:[e.jsxs("button",{onClick:()=>o(void 0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-gray-400 hover:text-white transition-colors cursor-pointer",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M7.5 9L4.5 6L7.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"All scenarios"]}),e.jsx("div",{className:"px-3 py-1.5",children:e.jsx("span",{className:"text-xs font-semibold text-white uppercase tracking-wider",children:i.displayName})}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2",children:f.length===0?e.jsx("div",{className:"px-3 py-2 text-xs text-gray-500",children:"No scenarios for this component"}):f.map(C=>e.jsx(we,{scenarioId:C.id,updatedAt:C.updatedAt,hasScreenshot:!!C.screenshotPath,name:C.name,isActive:C.id===n,onSelect:()=>a(C)},C.id))}),$.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),$.map(C=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"flex items-center gap-2 px-2 py-1",children:e.jsx("button",{onClick:()=>o(C.name),className:"text-[11px] font-medium text-gray-400 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:C.name})}),e.jsx(oe,{filePath:C.filePath,projectRoot:s}),(C.scenarios.length>0||C.pendingScenarios.length>0)&&e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:C.scenarios.map(q=>e.jsx(we,{imgSrc:q.screenshotPath?`/api/screenshot/${q.screenshotPath}`:null,name:q.name,isActive:q.id===N,onSelect:()=>j==null?void 0:j({analysisId:C.analysisId,scenarioId:q.id,scenarioName:q.name,entitySha:C.sha,entityName:C.name})},q.id))})]},C.sha))]}),B.length>0&&e.jsxs("div",{className:"pt-2 mt-1",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),B.map(C=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:C.name})}),e.jsx(oe,{filePath:C.filePath,projectRoot:s}),C.testFile&&e.jsx(Ze,{testFile:C.testFile,entityName:C.name})]},C.sha))]})]})})}return e.jsx("div",{ref:v,onScroll:z,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-3",children:[I.size>0&&e.jsxs("div",{children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Application"})}),[...I.entries()].sort(([p],[x])=>p==="Home"?-1:x==="Home"?1:p.localeCompare(x)).map(([p,x])=>{var y,f;return e.jsxs("div",{className:"px-2 pt-1",children:[e.jsx("div",{className:"py-0.5",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:p})}),(((y=x[0])==null?void 0:y.pageFilePath)||g[p])&&e.jsx(oe,{filePath:((f=x[0])==null?void 0:f.pageFilePath)||g[p],projectRoot:s}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:x.map(w=>e.jsx(we,{scenarioId:w.id,updatedAt:w.updatedAt,hasScreenshot:!!w.screenshotPath,name:w.name,isActive:w.id===n&&!N,onSelect:()=>a(w)},w.id))})]},p)})]}),R.size>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),[...R.entries()].map(([p,x])=>{var y;return e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"flex items-center justify-between px-2 py-1",children:e.jsx("button",{onClick:()=>o(p),className:"text-[11px] font-medium text-gray-400 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:p})}),((y=x[0])==null?void 0:y.componentPath)&&e.jsx(oe,{filePath:x[0].componentPath,projectRoot:s}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:x.map(f=>e.jsx(we,{scenarioId:f.id,updatedAt:f.updatedAt,hasScreenshot:!!f.screenshotPath,name:f.name,isActive:f.id===n&&!N,onSelect:()=>a(f)},f.id))})]},p)})]}),_.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsxs("div",{className:"px-2 py-1",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),D&&t.length===0&&l.every(p=>p.scenarioCount===0)&&e.jsx("span",{className:"ml-2 text-[10px] text-gray-500",children:"— Entities are being analyzed..."})]}),_.map(p=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[e.jsx("button",{onClick:()=>o(p.name),className:"text-[11px] font-medium text-gray-400 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:p.name}),p.isAnalyzing&&p.scenarioCount===0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),e.jsx(oe,{filePath:p.filePath,projectRoot:s}),(p.scenarios.length>0||p.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:[p.scenarios.map(x=>e.jsx(we,{imgSrc:x.screenshotPath?`/api/screenshot/${x.screenshotPath}`:null,name:x.name,isActive:x.id===N,onSelect:()=>j==null?void 0:j({analysisId:p.analysisId,scenarioId:x.id,scenarioName:x.name,entitySha:p.sha,entityName:p.name})},x.id)),p.pendingScenarios.map(x=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:x,children:x},x))]})]},p.sha))]}),(T.length>0||F.length>0)&&e.jsxs("div",{className:`pt-2 mt-1 ${_.length>0?"":"border-t border-[#3d3d3d]"}`,children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),T.map(p=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"px-2 py-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:p.name}),p.isAnalyzing&&p.scenarioCount===0&&e.jsxs("span",{className:"ml-2 inline-flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),e.jsx(oe,{filePath:p.filePath,projectRoot:s}),p.testFile?e.jsx(Ze,{testFile:p.testFile,entityName:p.name}):e.jsx("div",{className:"px-2 pt-1",children:e.jsx("span",{className:"text-[10px] text-gray-500",children:"No test file"})})]},p.sha)),F.map(p=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:p.name})}),e.jsx(oe,{filePath:p.filePath,projectRoot:s}),e.jsx(Ze,{testFile:p.testFile,entityName:p.name})]},p.name))]})]})})}function Gs(t,s,n=new Date){const a={"1d":1,"3d":3,"7d":7,"30d":30}[s],c=new Date(n);c.setDate(c.getDate()-a);const i=c.toISOString().split("T")[0],o=t.filter(S=>S.date>=i),l=new Set(o.map(S=>S.commitSha).filter(Boolean)),m=new Map;for(const S of o)if(S.scenarioScreenshots)for(const g of S.scenarioScreenshots){m.has(g.name)||m.set(g.name,[]);const I=m.get(g.name);I.some(h=>h.path===g.path)||I.push({path:g.path,time:S.time})}for(const S of m.values())S.sort((g,I)=>g.time.localeCompare(I.time));const N=[],j=new Map;for(const[S,g]of m){const I=S.indexOf(" - ");if(I!==-1){const h=S.slice(0,I);j.has(h)||j.set(h,[]),j.get(h).push({name:S,screenshots:g})}else N.push({name:S,screenshots:g})}return{commitCount:l.size,entryCount:o.length,appScenarios:N,componentGroups:j,totalScenarios:m.size}}function Vs(t){const s=new Map;for(const n of[...t].reverse()){const a=s.get(n.date)||[];a.push(n),s.set(n.date,a)}return s}function qs(t){const s=new Map;for(const n of t){let a;if("componentName"in n&&n.componentName)a=n.componentName;else if("componentName"in n&&n.componentName===null)a="App";else{const i=n.name.indexOf(" - ");a=i!==-1?n.name.slice(0,i):"App"}const c=s.get(a)||[];c.push(n),s.set(a,c)}return[...s.entries()].sort(([n],[a])=>n==="App"?-1:a==="App"?1:n.localeCompare(a))}const Ct=120;function Ot({text:t,theme:s}){const[n,a]=r.useState(!1),c=t.length>Ct,i=c&&!n?t.slice(0,Ct)+"…":t,o=s==="light";return e.jsxs("div",{className:`px-4 py-2 ${o?"border-b border-gray-200 bg-gray-50":"border-b border-[#3d3d3d] bg-[#252525]"}`,children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-wider text-gray-500",children:"User Prompt"}),e.jsxs("p",{className:`text-[11px] mt-0.5 mb-0 leading-relaxed ${o?"text-gray-600":"text-gray-400"}`,children:[i,c&&e.jsx("button",{onClick:()=>a(!n),className:`ml-1 text-[11px] font-medium bg-transparent border-none p-0 cursor-pointer ${o?"text-blue-500 hover:text-blue-700":"text-[#00a0c4] hover:text-[#00c0e8]"}`,children:n?"Show less":"Read more…"})]})]})}function Pt({status:t}){const s={new:{label:"New",bg:"bg-green-900/40",text:"text-green-400",border:"border-green-700/50"},edited:{label:"Edited",bg:"bg-blue-900/40",text:"text-blue-400",border:"border-blue-700/50"},impacted:{label:"Impacted",bg:"bg-amber-900/40",text:"text-amber-400",border:"border-amber-700/50"}}[t.status];return e.jsx("span",{className:`${s.bg} ${s.text} ${s.border} border text-[8px] font-bold px-1 py-0 rounded-full uppercase tracking-wider`,children:s.label})}function Ys({testFile:t,entityName:s}){const{results:n,isRunning:a,runTests:c}=tt(t);if(a&&!n)return e.jsxs("div",{className:"pt-1 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#00a0c4] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-gray-500",children:"Running tests..."})]});if(!n)return null;if(n.status==="error")return e.jsx("div",{className:"pt-1",children:e.jsx("span",{className:"text-[10px] text-red-400",children:n.errorMessage})});const i=s?n.testCases.filter(m=>m.fullName.startsWith(s)):n.testCases,o=i.length>0?i:n.testCases;if(o.length===0)return null;const l=s?`${s} > `:"";return e.jsxs("div",{className:"pt-1 space-y-0.5",children:[o.map(m=>{var j;const N=l&&m.fullName.startsWith(l)?m.fullName.slice(l.length):m.fullName;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[m.status==="passed"?e.jsx("span",{className:"text-green-400 text-[10px]",children:"✓"}):m.status==="failed"?e.jsx("span",{className:"text-red-400 text-[10px]",children:"✗"}):e.jsx("span",{className:"text-gray-500 text-[10px]",children:"—"}),e.jsx("span",{className:`text-[10px] ${m.status==="passed"?"text-green-400":m.status==="failed"?"text-red-400":"text-gray-500"}`,children:N})]}),m.status==="failed"&&((j=m.failureMessages)==null?void 0:j.map((S,g)=>e.jsx("div",{className:"pl-4 text-[9px] text-red-400/70 truncate max-w-full",title:S,children:S.split(`
4
- `)[0]},g)))]},m.fullName)}),e.jsx("button",{onClick:c,disabled:a,className:"mt-1 text-[10px] text-[#00a0c4] hover:text-[#38bdf8] transition-colors cursor-pointer disabled:opacity-50 bg-transparent border-none p-0",children:a?"Running...":"Re-run"})]})}const Xs={added:"text-green-400",untracked:"text-green-400",modified:"text-blue-400",renamed:"text-purple-400"};function Ks({files:t}){return e.jsxs("div",{className:"border-t border-[#3d3d3d] pt-2 mt-1",children:[e.jsxs("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:["Modified Files (",t.length,")"]}),e.jsx("div",{className:"mt-1 space-y-0.5 max-h-[150px] overflow-auto",children:t.map(s=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[9px] font-bold uppercase w-[14px] text-center ${Xs[s.status]||"text-gray-500"}`,children:s.status==="added"||s.status==="untracked"?"A":s.status==="modified"?"M":s.status==="renamed"?"R":"?"}),e.jsx("span",{className:"text-[10px] text-gray-400 truncate font-mono",children:s.path})]},s.path))})]})}const Qs={feature:{label:"Feature",color:"bg-[#005c75]"},fix:{label:"Fix",color:"bg-amber-700"},refactor:{label:"Refactor",color:"bg-purple-700"},scaffold:{label:"Scaffold",color:"bg-green-700"},data:{label:"Data",color:"bg-blue-700"},milestone:{label:"Milestone",color:"bg-yellow-600"}};function Zs(t){try{return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function en(t){try{return new Date(t+"T00:00:00").toLocaleDateString([],{weekday:"long",month:"long",day:"numeric"})}catch{return t}}const tn=[{value:"1d",label:"1 Day"},{value:"3d",label:"3 Days"},{value:"7d",label:"1 Week"},{value:"30d",label:"1 Month"}];function sn({entries:t,onScreenshotClick:s}){const[n,a]=r.useState(!1),[c,i]=r.useState("7d"),o=r.useMemo(()=>Gs(t,c),[t,c]);return e.jsxs("div",{className:"bg-[#2d2d2d] rounded-lg overflow-hidden",children:[e.jsxs("button",{onClick:()=>a(!n),className:"w-full flex items-center justify-between px-3 py-2.5 cursor-pointer bg-transparent border-none text-left hover:bg-[#333] transition-colors",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Timeframe Summary"}),e.jsx("span",{className:`text-gray-500 text-[10px] transition-transform ${n?"rotate-180":""}`,children:"▼"})]}),n&&e.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"flex gap-1 pt-2.5",children:tn.map(l=>e.jsx("button",{onClick:()=>i(l.value),className:`px-2.5 py-1 text-[10px] font-medium rounded transition-colors cursor-pointer border ${c===l.value?"bg-[#005c75] text-white border-[#005c75]":"bg-transparent text-gray-400 border-[#4d4d4d] hover:text-white hover:border-[#005c75]"}`,children:l.label},l.value))}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-400",children:[e.jsxs("span",{children:[e.jsx("span",{className:"text-white font-medium",children:o.commitCount})," ",o.commitCount===1?"commit":"commits"]}),e.jsx("span",{className:"text-[#3d3d3d]",children:"|"}),e.jsxs("span",{children:[e.jsx("span",{className:"text-white font-medium",children:o.totalScenarios})," ",o.totalScenarios===1?"scenario changed":"scenarios changed"]}),e.jsx("span",{className:"text-[#3d3d3d]",children:"|"}),e.jsxs("span",{children:[e.jsx("span",{className:"text-white font-medium",children:o.entryCount})," ",o.entryCount===1?"entry":"entries"]})]}),o.totalScenarios===0?e.jsx("p",{className:"text-[11px] text-gray-500 italic m-0",children:"No scenario changes in this period."}):e.jsxs("div",{className:"space-y-3",children:[o.appScenarios.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Application"}),o.appScenarios.map(l=>e.jsx(Et,{scenario:l,onScreenshotClick:s},l.name))]}),o.componentGroups.size>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),[...o.componentGroups.entries()].sort(([l],[m])=>l.localeCompare(m)).map(([l,m])=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[10px] font-medium text-gray-400",children:l}),m.map(N=>e.jsx(Et,{scenario:N,onScreenshotClick:s},N.name))]},l))]})]})]})]})}function Et({scenario:t,onScreenshotClick:s}){const n=t.name.indexOf(" - "),a=n!==-1?t.name.slice(n+3):t.name;return e.jsxs("div",{className:"pl-2",children:[e.jsx("span",{className:"text-[10px] text-gray-500 block mb-1",children:a}),e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto",children:t.screenshots.map((c,i)=>e.jsxs("div",{className:"flex items-center shrink-0",children:[i>0&&e.jsx("span",{className:"text-[8px] text-gray-600 mx-0.5",children:"→"}),e.jsx("button",{type:"button",className:"w-16 h-16 rounded overflow-hidden border border-[#3d3d3d] hover:border-[#00a0c4] bg-[#1e1e1e] shrink-0 flex items-center justify-center cursor-pointer transition-colors",title:`${t.name} (${new Date(c.time).toLocaleDateString()})`,onClick:()=>s==null?void 0:s({screenshotUrl:`/api/editor-journal-image/${c.path.replace("screenshots/","")}`,commitSha:null,commitMessage:null,scenarioName:t.name}),children:e.jsx("img",{src:`/api/editor-journal-image/${c.path.replace("screenshots/","")}`,alt:t.name,className:"max-w-full max-h-full object-contain",loading:"lazy"})})]},c.path))})]})}function nn({isActive:t,onScreenshotClick:s,glossaryFunctions:n=[]}){const[a,c]=r.useState([]),[i,o]=r.useState(!0),[l,m]=r.useState(new Set),N=r.useCallback(g=>{m(I=>{const h=new Set(I);return h.has(g)?h.delete(g):h.add(g),h})},[]),j=r.useCallback(async()=>{try{const g=await fetch("/api/editor-journal");if(g.ok){const I=await g.json();c(I.entries||[])}}catch{}finally{o(!1)}},[]);if(r.useEffect(()=>{j()},[j]),r.useEffect(()=>{t&&j()},[t,j]),r.useEffect(()=>{if(!t)return;const g=setInterval(()=>void j(),5e3);return()=>clearInterval(g)},[t,j]),i)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("span",{className:"text-gray-500 text-sm",children:"Loading journal..."})});if(a.length===0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 px-8",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"No journal entries yet"}),e.jsx("p",{className:"text-xs",children:"Journal entries will appear as you build. Claude records features, screenshots, and commits as the project evolves."})]})});const S=Vs(a);return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-4",children:[e.jsx(sn,{entries:a,onScreenshotClick:s}),[...S.entries()].map(([g,I])=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1.5 sticky top-0 bg-[#1e1e1e] z-10",children:e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:en(g)})}),e.jsx("div",{className:"space-y-2",children:I.map((h,R)=>{const _=Qs[h.type]||{label:h.type,color:"bg-gray-600"},T=`${h.time}-${R}`,F=l.has(T);return e.jsxs("div",{className:"bg-[#2d2d2d] rounded-lg overflow-hidden",children:[e.jsxs("div",{className:`p-3 space-y-2 ${F?"":"max-h-[300px] overflow-y-auto"}`,children:[e.jsx("div",{className:"flex items-start gap-2 cursor-pointer",onClick:()=>N(T),children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white truncate",children:h.title}),e.jsx("span",{className:`${_.color} text-white text-[9px] font-bold px-1.5 py-0.5 rounded uppercase tracking-wider shrink-0`,children:_.label})]}),e.jsx("span",{className:"text-[10px] text-gray-500",children:Zs(h.time)}),h.featureName&&e.jsx("span",{className:"text-[10px] text-gray-500 italic truncate",title:h.featureName,children:h.featureName})]})}),h.userPrompt&&e.jsx(Ot,{text:h.userPrompt,theme:"dark"}),e.jsx("p",{className:"text-xs text-gray-400 leading-relaxed",children:h.description}),h.screenshot&&e.jsx("button",{type:"button",className:"rounded overflow-hidden border border-[#3d3d3d] hover:border-[#00a0c4] bg-[#1e1e1e] flex items-center justify-center p-1 cursor-pointer transition-colors w-full",onClick:()=>s==null?void 0:s({screenshotUrl:`/api/editor-journal-image/${h.screenshot.replace("screenshots/","")}`,commitSha:h.commitSha,commitMessage:h.commitMessage,scenarioName:h.title}),children:e.jsx("img",{src:`/api/editor-journal-image/${h.screenshot.replace("screenshots/","")}`,alt:h.title,className:"max-w-full max-h-full object-contain",loading:"lazy"})}),h.scenarioScreenshots&&h.scenarioScreenshots.length>0&&(()=>{const D=qs(h.scenarioScreenshots),v=h.entityChangeStatus,M=D.filter(([f])=>f==="App").flatMap(([,f])=>f),z=D.filter(([f])=>f!=="App"),p=new Map;for(const f of M){const w=f,k=w.pageFilePath?Ce(ke(w.pageFilePath)):Le(w.url??null),$=p.get(k)||[];$.push(f),p.set(k,$)}const x=[...p.entries()],y=f=>e.jsx("button",{type:"button",className:"w-[4.5rem] h-[4.5rem] rounded overflow-hidden border border-[#3d3d3d] hover:border-[#00a0c4] bg-[#1e1e1e] shrink-0 flex items-center justify-center cursor-pointer transition-colors",onClick:()=>s==null?void 0:s({screenshotUrl:`/api/editor-journal-image/${f.path.replace("screenshots/","")}`,commitSha:h.commitSha,commitMessage:h.commitMessage,scenarioName:f.name}),children:e.jsx("img",{src:`/api/editor-journal-image/${f.path.replace("screenshots/","")}`,alt:f.name,title:f.name,className:"max-w-full max-h-full object-contain",loading:"lazy"})},f.path);return e.jsxs("div",{className:"space-y-2",children:[x.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Application"}),x.map(([f,w])=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-medium text-gray-400",children:f}),(v==null?void 0:v[f])&&e.jsx(Pt,{status:v[f]})]}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:w.map(y)})]},f))]}),z.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),z.map(([f,w])=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-medium text-gray-400",children:f}),(v==null?void 0:v[f])&&e.jsx(Pt,{status:v[f]})]}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:w.map(y)})]},f))]})]})})(),n.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"}),e.jsx("div",{className:"space-y-2",children:n.map(D=>e.jsxs("div",{children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-200",children:D.name}),e.jsx("span",{className:"text-[9px] text-gray-500 truncate block",children:D.filePath}),D.testFile?e.jsx(Ys,{testFile:D.testFile,entityName:D.name}):e.jsx("div",{className:"pt-1",children:e.jsx("span",{className:"text-[10px] text-gray-500",children:"No test file"})})]},D.name))})]}),h.commitSha&&e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[e.jsx("span",{className:"font-mono text-[#00a0c4] bg-[#00a0c4]/10 px-1.5 py-0.5 rounded",children:h.commitSha.slice(0,7)}),e.jsx("span",{className:"text-gray-500 truncate",children:h.commitMessage})]}),F&&h.modifiedFiles&&h.modifiedFiles.length>0&&e.jsx(Ks,{files:h.modifiedFiles})]}),e.jsxs("button",{onClick:()=>N(T),className:"w-full py-1.5 text-[10px] text-gray-500 hover:text-gray-300 border-t border-[#3d3d3d] transition-colors cursor-pointer",children:["——— ",F?"Collapse":"Expand"," ———"]})]},T)})})]},g))]})})}function an({prompt:t,height:s=300,onClose:n}){const a=r.useRef(null),c=r.useRef(null),i=r.useRef(null),o=r.useRef(!1),l=r.useRef(t);return r.useEffect(()=>{const m=a.current;if(!m)return;let N=!1,j=null;async function S(){const[g,I]=await Promise.all([et(()=>import("./xterm-BqvuqXEL.js"),[]),et(()=>import("./addon-fit-YJmn1quW.js"),[])]);if(N)return;{let p=document.getElementById("xterm-css");p||(p=document.createElement("style"),p.id="xterm-css",document.head.appendChild(p)),p.textContent=`
5
- .xterm { cursor: text; position: relative; user-select: none; -ms-user-select: none; -webkit-user-select: none; }
6
- .xterm.focus, .xterm:focus { outline: none; }
7
- .xterm .xterm-helpers { position: absolute; top: 0; z-index: 5; }
8
- .xterm .xterm-helper-textarea { padding: 0; border: 0; margin: 0; position: absolute; opacity: 0; left: -9999em; top: 0; width: 0; height: 0; z-index: -5; white-space: nowrap; overflow: hidden; resize: none; caret-color: transparent !important; clip-path: inset(100%) !important; }
9
- .xterm .composition-view { background: #000; color: #FFF; display: none; position: absolute; white-space: nowrap; z-index: 1; }
10
- .xterm .composition-view.active { display: block; }
11
- .xterm .xterm-viewport { background-color: #000; overflow-y: scroll; cursor: default; position: absolute; right: 0; left: 0; top: 0; bottom: 0; }
12
- .xterm .xterm-screen { position: relative; }
13
- .xterm .xterm-screen canvas { position: absolute; left: 0; top: 0; }
14
- .xterm .xterm-scroll-area { visibility: hidden; }
15
- .xterm-char-measure-element { display: inline-block; visibility: hidden; position: absolute; top: 0; left: -9999em; line-height: normal; }
16
- .xterm.enable-mouse-events { cursor: default; }
17
- .xterm.xterm-cursor-pointer, .xterm .xterm-cursor-pointer { cursor: pointer; }
18
- .xterm.column-select.focus { cursor: crosshair; }
19
- .xterm .xterm-accessibility:not(.debug), .xterm .xterm-message { position: absolute; left: 0; top: 0; bottom: 0; right: 0; z-index: 10; color: transparent; pointer-events: none; }
20
- .xterm .xterm-accessibility-tree:not(.debug) *::selection { color: transparent; }
21
- .xterm .xterm-accessibility-tree { user-select: text; white-space: pre; }
22
- .xterm .live-region { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
23
- .xterm-dim { opacity: 1 !important; }
24
- .xterm-underline-1 { text-decoration: underline; }
25
- .xterm-underline-2 { text-decoration: double underline; }
26
- .xterm-underline-3 { text-decoration: wavy underline; }
27
- .xterm-underline-4 { text-decoration: dotted underline; }
28
- .xterm-underline-5 { text-decoration: dashed underline; }
29
- .xterm-overline { text-decoration: overline; }
30
- .xterm-strikethrough { text-decoration: line-through; }
31
- .xterm-screen .xterm-decoration-container .xterm-decoration { z-index: 6; position: absolute; }
32
- .xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer { z-index: 7; }
33
- .xterm-decoration-overview-ruler { z-index: 8; position: absolute; top: 0; right: 0; pointer-events: none; }
34
- .xterm-decoration-top { z-index: 2; position: relative; }
35
- `}const h=new g.Terminal({theme:{background:"#1a1a1a",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"},fontSize:12,fontFamily:"'IBM Plex Mono', 'Menlo', 'Monaco', monospace",cursorBlink:!0,scrollback:5e3,allowProposedApi:!0}),R=new I.FitAddon;h.loadAddon(R),h.open(m),requestAnimationFrame(()=>{try{R.fit()}catch{}}),i.current=h;let _=null;try{const p=await fetch("/api/editor-scenario-prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:l.current})});p.ok&&(_=(await p.json()).promptFile)}catch{}if(N)return;const T=window.location.protocol==="https:"?"wss:":"ws:",F=window.location.host,D=new URLSearchParams;D.set("entityName","inline-claude");const v=`${T}//${F}/ws/terminal?${D.toString()}`,M=new WebSocket(v);c.current=M,M.onopen=()=>{M.send(JSON.stringify({type:"resize",cols:h.cols,rows:h.rows}))};let z=!1;M.onmessage=p=>{try{const x=JSON.parse(p.data);if(x.type==="session-id"&&!z){z=!0,setTimeout(()=>{const y=_?`claude "Read the file at '${_.replace(/'/g,"'\\''")}' for your instructions."`:"claude";M.send(JSON.stringify({type:"input",data:y+"\r"}))},300);return}if(x.type==="output"&&x.data){h.write(x.data);return}}catch{h.write(p.data)}},M.onclose=()=>{o.current||h.write(`\r
36
- \x1B[90m--- Session ended ---\x1B[0m\r
37
- `)},M.onerror=()=>{h.write(`\r
38
- \x1B[31mConnection error\x1B[0m\r
39
- `)},h.onData(p=>{M.readyState===WebSocket.OPEN&&M.send(JSON.stringify({type:"input",data:p}))}),j=new ResizeObserver(()=>{try{R.fit(),M.readyState===WebSocket.OPEN&&M.send(JSON.stringify({type:"resize",cols:h.cols,rows:h.rows}))}catch{}}),j.observe(m)}return S(),()=>{var g,I;N=!0,o.current=!0,j==null||j.disconnect(),((g=c.current)==null?void 0:g.readyState)===WebSocket.OPEN&&c.current.close(),(I=i.current)==null||I.dispose()}},[]),e.jsxs("div",{className:"border-t border-[#2d2d2d]",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-[#1e1e1e]",children:[e.jsx("span",{className:"text-[10px] font-medium text-[#00a0c4]",children:"Claude"}),n&&e.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-300 text-[10px] bg-transparent border-none cursor-pointer",children:"Close"})]}),e.jsx("div",{ref:a,style:{height:s,background:"#1a1a1a",padding:"4px 0",position:"relative",overflow:"hidden"}})]})}const Mt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-gray-500 shrink-0",children:e.jsx("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function rn(t,s){if(t.length<=s)return t;const n=s-2;return[t[0],"ellipsis",...t.slice(t.length-n)]}function It({items:t,onNavigate:s}){if(t.length===0)return null;const n=rn(t,4);return e.jsx("nav",{className:"flex items-center gap-1 text-xs min-w-0",children:n.map((a,c)=>{if(a==="ellipsis")return e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Mt,{}),e.jsx("span",{className:"text-gray-500",children:"..."})]},"ellipsis");const i=c===n.length-1;return e.jsxs("span",{className:"flex items-center gap-1 min-w-0",children:[c>0&&e.jsx(Mt,{}),i?e.jsx("span",{className:"text-white font-medium truncate",children:a.name}):e.jsx("button",{onClick:()=>s(a.componentName,a.entitySha),className:"text-gray-400 hover:text-white transition-colors cursor-pointer bg-transparent border-none p-0 truncate",children:a.name})]},a.componentName||"app")})})}function on(t,s,n,a){var m;const c=a.length>0?a.map(N=>`- "${N.name}" (ID: ${N.id})${N.url?` — URL: ${N.url}`:""}`).join(`
40
- `):"(no scenarios yet)",i=s.endsWith("/page.tsx")||s.endsWith("/page.js"),o=((m=a.find(N=>N.url))==null?void 0:m.url)||"/",l=[`You are helping edit scenarios for the "${t}" entity in a CodeYam project.`,"","## Entity",`- **Name:** ${t}`,`- **File:** ${s}`,`- **Type:** ${i?"Page (application scenario with seed data)":"Component (component scenario with mock props)"}`,"","## Existing Scenarios",c,""];return i?l.push("## How Seed Data Works","","Application scenarios use `seed` data to populate the database before the page is captured.","The seed is a JSON object where each key is a Prisma model name in camelCase singular (matching the Prisma client accessor name) and the value is an array of records.","","### Seed Key Naming Convention","The key must be the camelCase singular form of the Prisma model name:",'- `model User` → key `"user"`','- `model BlogPost` → key `"blogPost"`','- `model Feedback` → key `"feedback"`',"",'**WARNING:** Do NOT use plural forms like "users", "blogPosts", or "feedbacks" — the seed adapter will silently fail to match them.',"","To understand the data models, read the Prisma schema at `prisma/schema.prisma`.","To see examples of existing seed data, look at `.codeyam/editor-scenarios/*.seed.json` files.","",`Also read the source file at \`${s}\` to understand what data the page queries and renders.`,"","## Registering a Scenario","","For small seed data, pass it inline:","```",`codeyam editor register '{"name":"Scenario Name","type":"application","url":"${o}","dimensions":["Laptop"],"seed":{"user":[...],"feedback":[...]}}'`,"```","","For large seed data, write it to a temp file and use @file syntax:","```","# Write JSON to a temp file","cat > .codeyam/tmp/scenario.json << 'SCENARIO_EOF'",`{"name":"Scenario Name","type":"application","url":"${o}","dimensions":["Laptop"],"seed":{"user":[...],"feedback":[...]}}`,"SCENARIO_EOF","codeyam editor register @.codeyam/tmp/scenario.json","```"):l.push("## Registering a Scenario","",`Read the source file at \`${s}\` to understand what props the component expects.`,"","```",`codeyam editor register '{"name":"Scenario Name","type":"component","componentName":"${t}","componentPath":"${s}","dimensions":["Laptop"],"mockData":{"propName":"value"}}'`,"```"),l.push("","## Deleting a Scenario","","To delete a scenario, use its ID from the list above:","```","codeyam editor delete <scenarioId>","```","","## Validating Seed Data","","Before registering, you can validate seed data structure and check that keys match Prisma models:","```",`codeyam editor validate-seed '{"user":[...]}'`,"```"),l.push("","## Important","- DO NOT take any action until the user tells you what they want","- Start by briefly listing the existing scenarios",'- Then ask: "Would you like to modify an existing scenario or add a new one?"',"- Wait for the user's answer before proceeding",'- Keep scenario names descriptive: "Empty State", "With Comments", "Admin View", etc.',`- Each scenario should capture a distinct, meaningful state of the ${i?"page":"component"}`),l.join(`
41
- `)}function zt(t){var c,i;const s=new Map,n=new Map;for(const o of t)if(o.componentName){const l=n.get(o.componentName)||[];l.push(o),n.set(o.componentName,l)}else if(Bt(o.url)){const l=(c=o.url)==null?void 0:c.match(/[?&]c=([^&]+)/),m=l?decodeURIComponent(l[1]):"Isolated",N=n.get(m)||[];N.push(o),n.set(m,N)}else{const l=o.displayName||((i=o.pageFilePath)!=null&&i.startsWith("app/")?Ce(ke(o.pageFilePath)):Le(o.url)),m=s.get(l)||[];m.push(o),s.set(l,m)}const a=new Map([...n.entries()].sort(([o],[l])=>o.localeCompare(l)));return{pageGroups:s,componentGroups:a}}function ln(t,s){var a,c;const n=new Map;for(const[i,o]of t){const l=(a=o.find(m=>m.entitySha))==null?void 0:a.entitySha;l&&n.set(i,l)}for(const[i,o]of s){const l=(c=o.find(m=>m.entitySha))==null?void 0:c.entitySha;l&&n.set(i,l)}return n}function cn(t,s,n,a){if(s.has(t))return!0;const c=n.find(i=>i.sha===t);return c?a.has(c.name):!1}function dn(t,s,n,a){const c=[];for(const[i,o]of t){const l=n.get(i);l?a(l)||c.push({name:i,scenarios:o,reason:"incomplete"}):c.push({name:i,scenarios:o,reason:"missing"})}for(const[i,o]of s){const l=n.get(i);l?a(l)||c.push({name:i,scenarios:o,reason:"incomplete"}):c.push({name:i,scenarios:o,reason:"missing"})}return c}function mn(t,s,n){if(!t)return null;const a=s.find(i=>i.sha===t);if(!a)return null;const c=n.find(i=>i.entitySha===t);return{sha:t,name:a.name,filePath:a.filePath,entityType:a.entityType,displayName:(c==null?void 0:c.displayName)||a.name}}function Wt(t,s){var c;const n=s.some(i=>!i.componentName),a=s.map(i=>`'${i.id}'`).join(", ");if(n){const i=((c=s.find(l=>l.url))==null?void 0:c.url)||null,o=s.map(l=>`.codeyam/editor-scenarios/${l.id}.json`).join(", ");return[`### Page: "${t}" (${s.length} scenario(s))`,...i?["",`Scenario URL: \`${i}\``]:[],"",...i?["Step A: Find the source file that renders this page. In Next.js App Router, URLs map to page.tsx files:"," - `/` → `app/page.tsx`"," - `/about` → `app/about/page.tsx`"," - `/c/my-slug` → `app/c/[slug]/page.tsx` (dynamic segment)","",`Based on the URL \`${i}\`, find the corresponding page.tsx file. Confirm it exists with \`cat <filepath> | head -5\`.`]:["Step A: Find the source file that renders this page by running:",' find src app -name "App.tsx" -o -name "App.jsx" -o -name "page.tsx" -o -name "page.jsx" -o -name "index.tsx" 2>/dev/null',"","Pick the file that is the main app entry point or the page component for this route. Confirm it exists with `cat <filepath> | head -5`."],"","Step B: Set page_file_path on all scenarios for this page (replace PAGE_FILE_PATH with the path from Step A):",` sqlite3 .codeyam/db.sqlite3 "UPDATE editor_scenarios SET page_file_path = 'PAGE_FILE_PATH' WHERE id IN (${a});"`,"","Step C: Get the entity SHA (after running analyze-imports in the shared step above):",` sqlite3 .codeyam/db.sqlite3 "SELECT sha FROM entities WHERE file_path = 'PAGE_FILE_PATH' ORDER BY created_at DESC LIMIT 1;"`,"","If no rows appear, the path was wrong — go back to Step A.","","Step D: Set entity_sha and display_name on all scenarios (replace ENTITY_SHA with the SHA from Step C):",` sqlite3 .codeyam/db.sqlite3 "UPDATE editor_scenarios SET entity_sha = 'ENTITY_SHA', display_name = '${t}' WHERE id IN (${a});"`,"","Step E: Add pageFilePath to the scenario JSON files so this fix persists across clones.",`For each file (${o}), read it and add \`"pageFilePath": "PAGE_FILE_PATH"\` to the \`_metadata\` object (after the \`"type"\` field). Then commit the updated JSON files.`].join(`
42
- `)}else return[`### Component: "${t}" (${s.length} scenario(s))`,"","Step A: Get the entity SHA (after running analyze-imports in the shared step above):",` sqlite3 .codeyam/db.sqlite3 "SELECT sha FROM entities WHERE name = '${t}' ORDER BY created_at DESC LIMIT 1;"`,"","If no rows appear, check that .codeyam/glossary.json contains an entry for this component.","","Step B: Set entity_sha and display_name on all scenarios (replace ENTITY_SHA with the SHA from Step A):",` sqlite3 .codeyam/db.sqlite3 "UPDATE editor_scenarios SET entity_sha = 'ENTITY_SHA', display_name = '${t}' WHERE id IN (${a});"`].join(`
43
- `)}function Tt({name:t,scenarios:s,reason:n="missing"}){var i,o;const a=((i=s[0])==null?void 0:i.componentPath)||((o=s[0])==null?void 0:o.pageFilePath)||null,c=n==="incomplete"?[`The "${t}" entity exists but has not been fully analyzed — its components and functions cannot be displayed.`,"","Follow these steps:","",`Step 1: Check if "${t}" is in the glossary:`,` cat .codeyam/glossary.json | grep "${t}"`,"","If not found, add an entry to .codeyam/glossary.json:",` { "name": "${t}", "filePath": "${a||"FILL_IN_PATH"}", "description": "...", "returnType": "JSX.Element" }`,"","Step 2: Run: codeyam editor analyze-imports","","Step 3: Reload the editor page and verify components/functions appear."].join(`
44
- `):[`The "${t}" ${s.some(l=>!l.componentName)?"page":"component"} is missing entity data in the CodeYam database. Its scenarios are hidden until this is fixed.`,"","IMPORTANT: Do NOT re-register scenarios — that would overwrite their screenshots. Instead, update the database and scenario JSON files directly.","","Follow these steps EXACTLY:","","Step 1: Run: codeyam editor analyze-imports","","Step 2: Fix this entity:","",Wt(t,s),"","Step 3: Reload the editor page in the browser and verify the scenarios appear."].join(`
45
- `);return e.jsx(ue,{content:c,label:"Copy Fix Prompt",copiedLabel:"Copied!",className:"text-[9px] text-amber-400 hover:text-amber-300 bg-transparent border border-amber-400/30 rounded px-1.5 py-0.5 cursor-pointer transition-colors ml-2"})}function xn({brokenEntities:t}){if(t.length===0)return null;const s=t.reduce((i,o)=>i+o.scenarios.length,0),n=t.filter(i=>i.reason==="incomplete"),a=t.filter(i=>i.reason==="missing"),c=[`${t.length} entities are missing data in the CodeYam database. ${s} total scenario(s) are hidden until this is fixed.`,"","IMPORTANT: Do NOT re-register scenarios — that would overwrite their screenshots. Instead, update the database and scenario JSON files directly.","","Follow these steps EXACTLY:","",...n.length>0?["## Step 1: Add missing entries to the glossary","","Read `.codeyam/glossary.json` and check if these entities have entries. For each one that is missing, add an entry:","",...n.map(i=>{var l,m;const o=((l=i.scenarios[0])==null?void 0:l.componentPath)||((m=i.scenarios[0])==null?void 0:m.pageFilePath)||"FILL_IN_PATH";return`- "${i.name}" (filePath: "${o}")`}),"",'Each glossary entry needs: name, filePath, description, returnType (use "JSX.Element" for components/pages).',""]:["## Step 1: No glossary changes needed",""],"## Step 2: Run import analysis"," codeyam editor analyze-imports","",...a.length>0?["## Step 3: Fix missing entity associations","",...a.map(i=>Wt(i.name,i.scenarios)),""]:[],`## Step ${a.length>0?"4":"3"}: Reload the editor page in the browser and verify all scenarios appear. Then commit the updated scenario JSON files so the fix persists across clones.`].join(`
46
- `);return e.jsxs("div",{className:"mb-3 p-2 rounded border border-amber-400/30 bg-amber-400/5",children:[e.jsxs("p",{className:"text-[10px] text-amber-400/80 m-0 leading-relaxed",children:[t.length," ",t.length===1?"entity is":"entities are"," missing data (",s," hidden scenario",s!==1?"s":"","). Copy this prompt into Claude to fix them all at once."]}),e.jsx("div",{className:"mt-1.5",children:e.jsx(ue,{content:c,label:"Copy Fix All Prompt",copiedLabel:"Copied!",className:"text-[9px] text-amber-400 hover:text-amber-300 bg-transparent border border-amber-400/30 rounded px-1.5 py-0.5 cursor-pointer transition-colors"})})]})}function pn({scenarios:t,entityName:s,entityFilePath:n,entityType:a,onSwitchToBuild:c,onScenarioSelect:i}){const[o,l]=r.useState(!1),[m,N]=r.useState(null),[j,S]=r.useState(""),[g,I]=r.useState(!1),[h,R]=r.useState(null),[_,T]=r.useState(!1),F=r.useCallback(async v=>{if(!(!j.trim()||g)){I(!0);try{(await fetch("/api/editor-rename-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioId:v,name:j.trim()})})).ok&&N(null)}catch{}finally{I(!1)}}},[j,g]),D=r.useCallback(async v=>{if(confirm(`Delete scenario "${v.name}"?`)){R(v.id);try{const M=v.screenshotPaths?Object.values(v.screenshotPaths):v.screenshotPath?[v.screenshotPath]:[];await fetch("/api/delete-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioId:v.id,screenshotPaths:M})})}catch{}finally{R(null)}}},[]);return o?e.jsxs("div",{className:"border border-[#3d3d3d] rounded-lg overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-[#1e1e1e]",children:[e.jsx("span",{className:"text-xs font-medium text-gray-400",children:"Edit Scenarios"}),e.jsx("button",{onClick:()=>{l(!1),N(null)},className:"text-gray-500 hover:text-gray-300 text-xs bg-transparent border-none cursor-pointer",children:"Close"})]}),e.jsx("div",{className:"divide-y divide-[#2d2d2d]",children:t.map(v=>e.jsxs("div",{className:"px-3 py-2 flex items-center gap-2 hover:bg-[#252525] cursor-pointer transition-colors",style:{opacity:h===v.id?.4:1},onClick:()=>{m!==v.id&&i(v)},children:[v.screenshotPath?e.jsx(_e,{scenarioId:v.id,updatedAt:v.updatedAt,alt:"",className:"rounded w-[40px] h-[40px] shrink-0 overflow-hidden",imgClassName:"w-full h-full object-cover"}):e.jsx("div",{className:"rounded bg-[#1e1e1e]",style:{width:40,height:40,flexShrink:0}}),m===v.id?e.jsxs("form",{className:"flex-1 flex items-center gap-1.5 min-w-0",onSubmit:M=>{M.preventDefault(),F(v.id)},children:[e.jsx("input",{type:"text",value:j,onChange:M=>S(M.target.value),className:"flex-1 px-2 py-1 text-xs bg-[#1e1e1e] text-white border border-[#3d3d3d] rounded outline-none focus:border-[#005c75] min-w-0",autoFocus:!0,disabled:g}),e.jsx("button",{type:"submit",disabled:g||!j.trim(),className:"px-2 py-1 text-[10px] bg-[#005c75] text-white rounded hover:bg-[#004d63] disabled:opacity-40 cursor-pointer border-none",children:g?"...":"Save"}),e.jsx("button",{type:"button",onClick:()=>N(null),className:"px-2 py-1 text-[10px] text-gray-400 hover:text-white cursor-pointer bg-transparent border-none",children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"flex-1 text-xs text-gray-300 truncate min-w-0",children:v.name}),e.jsx("button",{onClick:M=>{M.stopPropagation(),N(v.id),S(v.name)},className:"text-[10px] text-gray-500 hover:text-gray-300 cursor-pointer bg-transparent border-none px-1",title:"Rename",children:"Rename"}),e.jsx("button",{onClick:M=>{M.stopPropagation(),D(v)},disabled:h===v.id,className:"text-[10px] text-red-400/60 hover:text-red-400 cursor-pointer bg-transparent border-none px-1",title:"Delete",children:"Delete"})]})]},v.id))}),_?e.jsx(an,{prompt:on(s,n,a,t),height:500,onClose:()=>T(!1)}):e.jsx("div",{className:"px-3 py-2.5 bg-[#1e1e1e] border-t border-[#2d2d2d] flex justify-center",children:e.jsx("button",{onClick:()=>T(!0),className:"px-5 py-2 text-xs font-medium text-white cursor-pointer bg-[#005c75] hover:bg-[#004d63] border-none rounded-md transition-colors",children:"Modify with Claude"})})]}):e.jsx("div",{className:"flex justify-center",children:e.jsx("button",{onClick:()=>l(!0),className:"px-5 py-2 text-xs font-medium text-gray-300 hover:text-white transition-colors cursor-pointer bg-[#2a2a2a] hover:bg-[#333] border border-[#4a4a4a] hover:border-[#666] rounded-md",children:"Edit Scenarios"})})}function pe({scenarioId:t,updatedAt:s,hasScreenshot:n,imgSrc:a,name:c,isActive:i,onSelect:o}){const l=t&&n,m=!t&&a;return e.jsxs("button",{onClick:o,className:"flex flex-col items-center gap-1 cursor-pointer group w-full",title:c,children:[e.jsx("div",{className:`w-full aspect-square rounded overflow-hidden border-2 transition-all bg-[#1a1a1a] ${i?"border-[#005c75] ring-1 ring-[#005c75]":"border-transparent hover:border-[#4d4d4d]"}`,children:l?e.jsx(_e,{scenarioId:t,updatedAt:s,alt:c,className:"w-full h-full",imgClassName:"w-full h-full object-contain"}):m?e.jsx("img",{src:a,alt:c,className:"w-full h-full object-contain",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-[#1a1a1a] flex items-center justify-center",children:e.jsx("span",{className:"text-[8px] text-gray-600",children:"No img"})})}),e.jsx("span",{className:`text-[10px] leading-tight text-center truncate w-full ${i?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:c})]})}function Se({filePath:t}){return t?e.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[e.jsxs("a",{href:`/api/editor-file?path=${encodeURIComponent(t)}`,target:"_blank",rel:"noopener noreferrer",title:"Open file",className:"flex items-center gap-1 text-gray-500 hover:text-gray-300 transition-colors min-w-0",children:[e.jsx("span",{className:"text-[9px] truncate",children:t}),e.jsx("svg",{className:"shrink-0",width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsx(ue,{content:t,icon:!0,iconSize:10,className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors"})]}):null}function un({hasProject:t,scenarios:s,analyzedEntities:n,allEntities:a=[],glossaryFunctions:c=[],glossaryEntries:i=[],projectRoot:o,activeScenarioId:l,onScenarioSelect:m,onAnalyzedScenarioSelect:N,onSwitchToBuild:j,zoomComponent:S,focusedEntity:g,onZoomChange:I,entityImports:h,pageFilePaths:R={},projectTitle:_,projectDescription:T,migrationMode:F="none",migrationState:D,onStartMigration:v,breadcrumbItems:M=[]}){var se;const{pageGroups:z,componentGroups:p}=r.useMemo(()=>zt(s),[s]),x=r.useMemo(()=>ln(z,p),[z,p]),y=r.useMemo(()=>new Set(n.map(P=>P.sha)),[n]),f=r.useMemo(()=>new Set(Object.keys(h||{})),[h]),w=r.useCallback(P=>cn(P,y,a,f),[y,a,f]),k=r.useMemo(()=>dn(z,p,x,w),[z,p,x,w]),$=r.useMemo(()=>n.filter(P=>P.entityType==="visual").sort((P,L)=>P.name.localeCompare(L.name)),[n]),B=r.useMemo(()=>{const P=new Map;for(const L of c)P.set(L.name,L);return P},[c]),C=r.useRef(null),q=r.useRef(0),he=r.useCallback(()=>{C.current&&(q.current=C.current.scrollTop)},[]);r.useEffect(()=>{C.current&&q.current>0&&(C.current.scrollTop=q.current)});const fe=(g==null?void 0:g.sha)??"overview";if(!t)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Ready to build something?"}),e.jsx("button",{onClick:j,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Start Building"})]})});if(F==="candidate")return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-5 px-8 text-center max-w-[420px]",children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Migrate Your Project"}),e.jsx("p",{className:"text-sm text-gray-400 m-0 font-['IBM_Plex_Sans'] leading-relaxed",children:"It looks like you have an existing project. Claude can survey your codebase and systematically migrate it — deconstructing pages into clean components, extracting functions with tests, and creating scenarios. One page per session."}),e.jsx("button",{onClick:v,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Get Started"}),e.jsx("button",{onClick:j,className:"text-xs text-gray-500 hover:text-gray-300 bg-transparent border-none p-0 cursor-pointer underline",children:"Skip — build a new feature instead"})]})});if(F==="active"&&D){const P=D.pages||[],L=P.filter(A=>A.status==="complete").length,J=P.length,G=J>0?Math.round(L/J*100):0;return e.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-4",children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0 mb-3",children:"Project Migration"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"flex items-center gap-2 mb-1",children:e.jsxs("span",{className:"text-xs text-gray-400 font-['IBM_Plex_Sans']",children:[L,"/",J," pages (",G,"%)"]})}),e.jsx("div",{className:"w-full h-1.5 bg-[#2d2d2d] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#005c75] rounded-full transition-all",style:{width:`${G}%`}})})]}),e.jsx("div",{className:"space-y-1.5",children:P.map((A,Q)=>{const ne=A.status==="complete"?"✓":A.status==="in-progress"?"→":"○",V=A.status==="complete"?"text-green-400":A.status==="in-progress"?"text-cyan-400":"text-gray-600";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-xs ${V} w-3 text-center`,children:ne}),e.jsx("span",{className:`text-xs font-['IBM_Plex_Sans'] ${A.status==="in-progress"?"text-white font-medium":A.status==="complete"?"text-gray-400":"text-gray-600"}`,children:A.name}),e.jsx("span",{className:"text-[10px] text-gray-600",children:A.route}),A.status==="complete"&&e.jsxs("span",{className:"text-[10px] text-gray-600",children:[(A.extractedComponents||[]).length,"c"," ",(A.extractedFunctions||[]).length,"f"," ",A.scenarioCount||0,"s"]})]},Q)})}),(D.sharedComponents||[]).length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-xs font-medium text-gray-400 font-['IBM_Plex_Sans'] mb-1.5",children:"Shared Components"}),(D.sharedComponents||[]).map((A,Q)=>e.jsxs("div",{className:"text-[10px] text-gray-500 mb-0.5",children:[A.name," ",e.jsxs("span",{className:"text-gray-600",children:["— used in: ",(A.usedInPages||[]).join(", ")]})]},Q))]}),e.jsx("div",{className:"mt-4",children:e.jsx("button",{onClick:j,className:"px-4 py-2 bg-[#005c75] text-white text-xs font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Continue in Chat"})})]})}if(!(s.length>0||$.length>0))return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 px-8 text-center",children:[_?e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:_}),T&&e.jsx("p",{className:"text-sm text-gray-400 m-0 font-['IBM_Plex_Sans'] leading-relaxed",children:T})]}):e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Your project is ready"}),e.jsx("p",{className:"text-sm text-gray-400 m-0 font-['IBM_Plex_Sans'] leading-relaxed",children:"Describe what you want to build in the Chat and your pages and components will appear here."}),e.jsx("button",{onClick:j,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Start Building"})]})});if(g){const P=g.filePath,L=g.name,J=n.some(u=>u.sha===g.sha||u.filePath===P),G=!!((se=h==null?void 0:h[L])!=null&&se.length);if(!J&&!G){s.some(O=>O.componentName===L&&O.entitySha===g.sha);const u=s.filter(O=>O.entitySha===g.sha),W=[`The "${g.displayName}" entity (${P}) exists in the database but has not been fully analyzed. Its components and functions cannot be shown until it has import metadata.`,"","Follow these steps:","",`Step 1: Add "${L}" to the glossary if it's not already there:`,` Check: cat .codeyam/glossary.json | grep "${L}"`,"",` If not found, add an entry with name "${L}" and filePath "${P}" to .codeyam/glossary.json`,"","Step 2: Run import analysis:"," codeyam editor analyze-imports","","Step 3: Reload the editor page and verify components/functions appear."].join(`
47
- `);return e.jsx("div",{ref:C,onScroll:he,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsx(It,{items:M,onNavigate:I}),e.jsx("h2",{className:"text-sm font-semibold text-white m-0 font-['IBM_Plex_Sans'] uppercase tracking-wider",children:g.displayName}),P&&e.jsx(Se,{filePath:P,projectRoot:o}),e.jsxs("div",{className:"py-2",children:[e.jsx("p",{className:"text-[11px] text-amber-400/80 m-0 leading-relaxed",children:"This entity has not been fully analyzed. Its components and functions cannot be displayed. Please copy and paste this prompt into Claude to fix the data."}),e.jsx("div",{className:"mt-2",children:e.jsx(ue,{content:W,label:"Copy Fix Prompt",copiedLabel:"Copied!",className:"text-[10px] text-amber-400 hover:text-amber-300 bg-transparent border border-amber-400/30 rounded px-2 py-1 cursor-pointer transition-colors"})})]}),u.length>0&&e.jsx("div",{className:"grid grid-cols-3 gap-2",children:u.map(O=>e.jsx(pe,{scenarioId:O.id,updatedAt:O.updatedAt,hasScreenshot:!!O.screenshotPath,name:O.name,isActive:O.id===l,onSelect:()=>m(O)},O.id))})]})},fe)}const A=g.sha,Q=s.filter(u=>!u.componentName&&(u.pageFilePath===P||A&&u.entitySha===A)),ne=s.filter(u=>u.componentName===L||u.componentPath===P),V=$.find(u=>u.filePath===P||u.name===L),ae=B.get(L)||c.find(u=>u.filePath===P),te=[...Q,...ne],le=new Set((h==null?void 0:h[L])||[]),re=G?[...p.entries()].filter(([u])=>le.has(u)):[],Pe=G?$.filter(u=>le.has(u.name)&&!re.some(([W])=>W===u.name)):[],Ee=G?i.filter(u=>le.has(u.name)&&u.returnType!=="JSX.Element"&&u.returnType!=="React.ReactNode").map(u=>({name:u.name,filePath:u.filePath,description:u.description||"",testFile:u.testFile,feature:u.feature})):[],Me=re.length>0||Pe.length>0,ge=Ee.length>0,Z=Me||ge;return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsx(It,{items:M,onNavigate:I}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold text-white m-0 font-['IBM_Plex_Sans'] uppercase tracking-wider",children:g.displayName}),g.filePath&&e.jsx(Se,{filePath:g.filePath,projectRoot:o})]}),te.length>0&&e.jsx("div",{className:"grid grid-cols-3 gap-2",children:te.map(u=>e.jsx(pe,{scenarioId:u.id,updatedAt:u.updatedAt,hasScreenshot:!!u.screenshotPath,name:u.name,isActive:u.id===l,onSelect:()=>m(u)},u.id))}),V&&(V.scenarios.length>0||V.pendingScenarios.length>0)&&e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[V.scenarios.map(u=>e.jsx(pe,{imgSrc:u.screenshotPath?`/api/screenshot/${u.screenshotPath}`:null,name:u.name,isActive:!1,onSelect:()=>N({analysisId:V.analysisId,scenarioId:u.id,scenarioName:u.name,entitySha:V.sha,entityName:V.name})},u.id)),V.pendingScenarios.map(u=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:u,children:u},u))]}),ae&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] text-gray-500",children:"Tests:"}),e.jsx(Se,{filePath:ae.testFile,projectRoot:o})]}),te.length===0&&!V&&!ae&&e.jsx("div",{className:"text-xs text-gray-500",children:"No scenarios for this entity"}),te.length>0&&e.jsx(pn,{scenarios:te,entityName:g.displayName,entityFilePath:g.filePath,entityType:g.entityType,onSwitchToBuild:j,onScenarioSelect:m}),Z&&e.jsxs("div",{className:"pt-3 mt-2 border-t border-[#3d3d3d] space-y-3",children:[Me&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),re.map(([u,W])=>e.jsx("div",{className:"mt-3",children:x.has(u)?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>I(u,x.get(u)),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:u})}),W.length>0&&e.jsx("div",{className:"grid grid-cols-3 gap-2 pt-1",children:W.map(O=>e.jsx(pe,{scenarioId:O.id,updatedAt:O.updatedAt,hasScreenshot:!!O.screenshotPath,name:O.name,isActive:O.id===l,onSelect:()=>m(O)},O.id))})]}):e.jsxs("div",{className:"py-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-500",children:u}),e.jsx("p",{className:"text-[10px] text-amber-400/80 m-0 mt-1.5 leading-relaxed",children:"There is data missing that is required to show the scenarios for this component. Please copy and paste this prompt into Claude to ask Claude to fix the data."}),e.jsx("div",{className:"mt-1.5",children:e.jsx(Tt,{name:u,scenarios:W})})]})},u)),Pe.map(u=>e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>I(u.name,u.sha),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:u.name})}),(u.scenarios.length>0||u.pendingScenarios.length>0)&&e.jsxs("div",{className:"grid grid-cols-3 gap-2 pt-1",children:[u.scenarios.map(W=>e.jsx(pe,{imgSrc:W.screenshotPath?`/api/screenshot/${W.screenshotPath}`:null,name:W.name,isActive:!1,onSelect:()=>N({analysisId:u.analysisId,scenarioId:W.id,scenarioName:W.name,entitySha:u.sha,entityName:u.name})},W.id)),u.pendingScenarios.map(W=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:W,children:W},W))]})]},u.sha))]}),ge&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"}),Ee.map(u=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>I(u.name,x.get(u.name)),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:u.name})}),e.jsx(Se,{filePath:u.filePath,projectRoot:o}),u.testFile&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx("span",{className:"text-[9px] text-gray-600",children:"test:"}),e.jsx("span",{className:"text-[9px] text-gray-500 truncate",children:u.testFile})]})]},u.name))]})]})]})})}return e.jsx("div",{ref:C,onScroll:he,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-4 space-y-4",children:[_&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-white m-0 font-['IBM_Plex_Sans']",children:_}),T&&e.jsx("p",{className:"text-xs text-gray-400 m-0 mt-1 font-['IBM_Plex_Sans'] leading-relaxed",children:T})]}),k.length>1&&e.jsx(xn,{brokenEntities:k}),z.size>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Application"}),e.jsx("button",{onClick:j,className:"px-2.5 py-1 text-[10px] font-medium text-gray-400 bg-[#2a2a2a] border border-[#4d4d4d] rounded hover:bg-[#333] hover:text-white hover:border-[#005c75] transition-colors cursor-pointer",children:"+ New Page"})]}),e.jsxs("p",{className:"text-[11px] text-gray-500 m-0 mt-1.5 font-['IBM_Plex_Sans'] leading-relaxed",children:["Select a page scenario below and switch to"," ",e.jsx("button",{onClick:j,className:"text-[#00a0c4] hover:text-[#00c4eb] bg-transparent border-none p-0 cursor-pointer underline font-inherit text-inherit",children:"Build"})," ","to change or enhance an existing page or"," ",e.jsx("button",{onClick:j,className:"text-[#00a0c4] hover:text-[#00c4eb] bg-transparent border-none p-0 cursor-pointer underline font-inherit text-inherit",children:"create a new page"})]}),[...z.entries()].sort(([P],[L])=>P==="Home"?-1:L==="Home"?1:P.localeCompare(L)).map(([P,L])=>{var J,G;return e.jsx("div",{className:"mt-2",children:x.has(P)&&w(x.get(P))?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>I(P,x.get(P)),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:P})}),(((J=L[0])==null?void 0:J.pageFilePath)||R[P])&&e.jsx(Se,{filePath:((G=L[0])==null?void 0:G.pageFilePath)||R[P],projectRoot:o}),e.jsx("div",{className:"grid grid-cols-3 gap-2 pt-1",children:L.map(A=>e.jsx(pe,{scenarioId:A.id,updatedAt:A.updatedAt,hasScreenshot:!!A.screenshotPath,name:A.name,isActive:A.id===l,onSelect:()=>m(A)},A.id))})]}):e.jsxs("div",{className:"py-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-500",children:P}),e.jsx("p",{className:"text-[10px] text-amber-400/80 m-0 mt-1.5 leading-relaxed",children:"There is data missing that is required to show the scenarios for this page. Please copy and paste this prompt into Claude to ask Claude to fix the data."}),e.jsx("div",{className:"mt-1.5",children:e.jsx(Tt,{name:P,scenarios:L,reason:x.has(P)?"incomplete":"missing"})})]})},P)})]})]})},fe)}const $t={new:0,edited:1,impacted:2};function At({status:t,onClick:s}){const n={new:{label:"New",bg:"bg-green-100",text:"text-green-700",border:"border-green-200"},edited:{label:"Edited",bg:"bg-blue-100",text:"text-blue-700",border:"border-blue-200"},impacted:{label:"Impacted",bg:"bg-amber-100",text:"text-amber-700",border:"border-amber-200"}}[t.status],a=s&&(t.status==="edited"||t.status==="impacted");return e.jsx("button",{onClick:a?s:void 0,className:`${n.bg} ${n.text} ${n.border} border text-[9px] font-bold px-1.5 py-0.5 rounded-full uppercase tracking-wider shrink-0 ${a?"cursor-pointer hover:opacity-80 transition-opacity":"cursor-default"}`,children:n.label})}function Rt({filePath:t}){const[s,n]=r.useState(null),[a,c]=r.useState(!0),[i,o]=r.useState(null);return r.useEffect(()=>{et(()=>import("./index-Blo6EK8G.js"),__vite__mapDeps([0,1,2])).then(l=>{o(()=>l.default)})},[]),r.useEffect(()=>{c(!0),fetch(`/api/editor-file-diff?path=${encodeURIComponent(t)}`).then(l=>l.json()).then(l=>{n({oldContent:l.oldContent,newContent:l.newContent})}).catch(()=>{n(null)}).finally(()=>c(!1))},[t]),a?e.jsx("div",{className:"p-2 text-[10px] text-gray-400",children:"Loading diff..."}):!s||!i?e.jsx("div",{className:"p-2 text-[10px] text-gray-400",children:"Could not load diff"}):e.jsx("div",{className:"mt-2 border border-gray-200 rounded-lg overflow-hidden max-h-[300px] overflow-auto text-xs",children:e.jsx(i,{oldValue:s.oldContent,newValue:s.newContent,splitView:!1,useDarkTheme:!1,showDiffOnly:!0,styles:{contentText:{fontSize:"11px",lineHeight:"1.4"},line:{padding:"1px 8px",fontSize:"11px"}}})})}function Lt({impactedBy:t,changedEntities:s}){return e.jsx("div",{className:"mt-2 bg-amber-50 border border-amber-200 rounded-lg p-2.5",children:t&&t.length>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] font-semibold text-amber-700 uppercase tracking-wider",children:"Re-captured because these dependencies changed"}),e.jsx("ul",{className:"mt-1.5 space-y-1",children:t.map(n=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[9px] font-bold px-1 py-0 rounded-full uppercase tracking-wider border ${n.changeType==="new"?"bg-green-100 text-green-700 border-green-200":"bg-blue-100 text-blue-700 border-blue-200"}`,children:n.changeType==="new"?"New":"Edited"}),e.jsx("span",{className:"text-[11px] font-medium text-amber-800",children:n.name}),e.jsx("span",{className:"text-[9px] text-amber-500 truncate",children:n.filePath})]},n.filePath))})]}):s&&s.length>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] font-semibold text-amber-700 uppercase tracking-wider",children:"Unchanged — these entities were modified in this session"}),e.jsx("ul",{className:"mt-1.5 space-y-1",children:s.map(n=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[9px] font-bold px-1 py-0 rounded-full uppercase tracking-wider border ${n.status==="new"?"bg-green-100 text-green-700 border-green-200":"bg-blue-100 text-blue-700 border-blue-200"}`,children:n.status==="new"?"New":"Edited"}),e.jsx("span",{className:"text-[11px] font-medium text-amber-800",children:n.name})]},n.name))})]}):e.jsx("span",{className:"text-[10px] text-amber-600",children:"This component was re-captured because a dependency changed"})})}function _t({scenarioId:t,name:s,isActive:n,onSelect:a,updatedAt:c}){const i=r.useRef(null);return r.useEffect(()=>{n&&i.current&&i.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[n]),e.jsxs("button",{ref:i,onClick:a,className:"flex flex-col items-center gap-1.5 cursor-pointer group",title:s,children:[e.jsx("div",{className:`w-32 h-32 rounded-lg overflow-hidden border-2 transition-all ${n?"border-[#0ea5e9] ring-2 ring-[#0ea5e9]/40 shadow-lg shadow-[#0ea5e9]/20":"border-gray-200 hover:border-gray-400 shadow-sm"}`,children:e.jsx(_e,{scenarioId:t,updatedAt:c,alt:s,className:"w-full h-full bg-white",imgClassName:"w-full h-full object-contain bg-white"})}),e.jsx("span",{className:`text-[11px] leading-tight text-center truncate w-32 font-medium ${n?"text-gray-900":"text-gray-600 group-hover:text-gray-900"}`,children:s})]})}function hn({filePath:t}){return t?e.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[e.jsxs("a",{href:`/api/editor-file?path=${encodeURIComponent(t)}`,target:"_blank",rel:"noopener noreferrer",title:"Open file",className:"flex items-center gap-1 text-gray-400 hover:text-gray-600 transition-colors min-w-0",children:[e.jsx("span",{className:"text-[9px] truncate",children:t}),e.jsx("svg",{className:"shrink-0",width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsx(ue,{content:t,icon:!0,iconSize:10,className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors"})]}):null}function fn({testFile:t,entityName:s}){const{results:n,isRunning:a,runTests:c}=tt(t);if(a&&!n)return e.jsxs("div",{className:"pt-1 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#0ea5e9] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-gray-400",children:"Running tests..."})]});if(!n)return null;if(n.status==="error")return e.jsx("div",{className:"pt-1",children:e.jsx("span",{className:"text-[10px] text-red-500",children:n.errorMessage})});const i=s?n.testCases.filter(m=>m.fullName.startsWith(s)):n.testCases,o=i.length>0?i:n.testCases;if(o.length===0)return null;const l=s?`${s} > `:"";return e.jsxs("div",{className:"pt-1 space-y-0.5",children:[o.map(m=>{var j;const N=l&&m.fullName.startsWith(l)?m.fullName.slice(l.length):m.fullName;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[m.status==="passed"?e.jsx("span",{className:"text-green-600 text-[10px]",children:"✓"}):m.status==="failed"?e.jsx("span",{className:"text-red-500 text-[10px]",children:"✗"}):e.jsx("span",{className:"text-gray-400 text-[10px]",children:"—"}),e.jsx("span",{className:`text-[10px] ${m.status==="passed"?"text-green-600":m.status==="failed"?"text-red-500":"text-gray-400"}`,children:N})]}),m.status==="failed"&&((j=m.failureMessages)==null?void 0:j.map((S,g)=>e.jsx("div",{className:"pl-4 text-[9px] text-red-400 truncate max-w-full",title:S,children:S.split(`
48
- `)[0]},g)))]},m.fullName)}),e.jsx("button",{onClick:c,disabled:a,className:"mt-1 text-[10px] text-[#0ea5e9] hover:text-[#38bdf8] transition-colors cursor-pointer disabled:opacity-50 bg-transparent border-none p-0",children:a?"Running...":"Re-run"})]})}function Dt(t){const s=t.indexOf(" - ");return s!==-1?t.slice(s+3):t}function Ft(t,s){return!s||Object.keys(s).length===0?t:[...t].sort(([n],[a])=>{var l,m;const c=((l=s[n])==null?void 0:l.status)||"impacted",i=((m=s[a])==null?void 0:m.status)||"impacted",o=($t[c]??2)-($t[i]??2);return o!==0?o:n.localeCompare(a)})}function gn({scenarios:t,allScenarios:s=[],glossaryFunctions:n=[],projectRoot:a,activeScenarioId:c,onScenarioSelect:i,onClose:o,entityChangeStatus:l={},modifiedFiles:m=[],featureName:N,userPrompt:j}){const S=r.useMemo(()=>{if(s.length===0||Object.keys(l).length===0)return t;const x=new Set(t.map(f=>f.id)),y=s.filter(f=>{var k,$;if(x.has(f.id))return!1;const w=f.componentName||f.displayName||((k=f.pageFilePath)!=null&&k.startsWith("app/")?Ce(ke(f.pageFilePath)):Le(f.url));return(($=l[w])==null?void 0:$.status)==="impacted"});return y.length===0?t:[...t,...y]},[t,s,l]),g=r.useMemo(()=>Object.entries(l).filter(([,x])=>x.status==="new"||x.status==="edited").map(([x,y])=>({name:x,status:y.status})),[l]),[I,h]=r.useState(null),R=r.useCallback(x=>{h(y=>y===x?null:x)},[]),{pageGroups:_,componentGroups:T}=r.useMemo(()=>zt(S),[S]),F=r.useMemo(()=>Ft([..._.entries()],l),[_,l]),D=r.useMemo(()=>Ft([...T.entries()],l),[T,l]),v=F,M=D,z=r.useMemo(()=>Ws(n,l),[n,l]),p=r.useMemo(()=>{const x=[];for(const[,y]of v)x.push(...y);for(const[,y]of M)x.push(...y);return x},[v,M]);return r.useEffect(()=>{if(p.length===0)return;const x=y=>{var $;if(y.key!=="ArrowLeft"&&y.key!=="ArrowRight")return;const f=($=y.target)==null?void 0:$.tagName;if(f==="INPUT"||f==="TEXTAREA"||f==="SELECT")return;y.preventDefault();const w=p.findIndex(B=>B.id===c);let k;y.key==="ArrowLeft"?k=w<=0?p.length-1:w-1:k=w>=p.length-1?0:w+1,i(p[k])};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[p,c,i]),S.length===0&&n.length===0?e.jsxs("div",{className:"h-full bg-white flex items-center justify-center relative",children:[e.jsx("button",{onClick:o,className:"absolute top-2 right-3 text-gray-400 hover:text-gray-700 text-lg leading-none cursor-pointer bg-transparent border-none",title:"Close results",children:"×"}),e.jsx("span",{className:"text-sm text-gray-400",children:"No scenarios registered yet"})]}):e.jsxs("div",{className:"h-full bg-white flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-gray-200 shrink-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Working Session Results"}),N&&e.jsx("div",{className:"text-[11px] text-gray-400 truncate",title:N,children:N})]}),e.jsx("button",{onClick:o,className:"text-gray-400 hover:text-gray-700 text-lg leading-none cursor-pointer bg-transparent border-none shrink-0",title:"Close results",children:"×"})]}),j&&e.jsx(Ot,{text:j,theme:"light"}),e.jsx("div",{className:"flex-1 overflow-auto p-4",children:e.jsxs("div",{className:"space-y-5",children:[v.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Application"})}),e.jsx("div",{className:"space-y-3 pl-1",children:v.map(([x,y])=>{var $;const f=l[x],w=I===x,k=($=y[0])==null?void 0:$.componentPath;return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-600",children:x}),f&&e.jsx(At,{status:f,onClick:()=>R(x)})]}),w&&(f==null?void 0:f.status)==="edited"&&k&&e.jsx(Rt,{filePath:k}),w&&(f==null?void 0:f.status)==="impacted"&&e.jsx(Lt,{impactedBy:f.impactedBy,changedEntities:g}),e.jsx("div",{className:"flex flex-wrap gap-3",children:y.map(B=>e.jsx(_t,{scenarioId:B.id,name:Dt(B.name),isActive:B.id===c,onSelect:()=>i(B),updatedAt:B.updatedAt},B.id))})]},x)})})]}),M.length>0&&e.jsxs("div",{className:v.length>0?"pt-3 border-t border-gray-200":"",children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),e.jsx("div",{className:"space-y-3 pl-1",children:M.map(([x,y])=>{var $;const f=l[x],w=I===x,k=($=y[0])==null?void 0:$.componentPath;return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-600",children:x}),f&&e.jsx(At,{status:f,onClick:()=>R(x)})]}),w&&(f==null?void 0:f.status)==="edited"&&k&&e.jsx(Rt,{filePath:k}),w&&(f==null?void 0:f.status)==="impacted"&&e.jsx(Lt,{impactedBy:f.impactedBy,changedEntities:g}),e.jsx("div",{className:"flex flex-wrap gap-3",children:y.map(B=>e.jsx(_t,{scenarioId:B.id,name:Dt(B.name),isActive:B.id===c,onSelect:()=>i(B),updatedAt:B.updatedAt},B.id))})]},x)})})]}),z.length>0&&e.jsxs("div",{className:v.length>0||M.length>0?"pt-3 border-t border-gray-200":"",children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),e.jsx("div",{className:"space-y-2 pl-1",children:z.map(x=>e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-700",children:x.name})}),e.jsx(hn,{filePath:x.filePath,projectRoot:a}),x.testFile?e.jsx(fn,{testFile:x.testFile,entityName:x.name}):e.jsx("div",{className:"pt-1",children:e.jsx("span",{className:"text-[10px] text-gray-400",children:"No test file"})})]},x.name))})]}),m.length>0&&e.jsxs("div",{className:v.length>0||M.length>0||z.length>0?"pt-3 border-t border-gray-200":"",children:[e.jsx("div",{className:"mb-2",children:e.jsxs("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:["Modified Files (",m.length,")"]})}),e.jsx("div",{className:"space-y-0.5 pl-1 max-h-[200px] overflow-auto",children:m.map(x=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[9px] font-bold uppercase w-[14px] text-center ${x.status==="added"||x.status==="untracked"?"text-green-600":x.status==="modified"?"text-blue-600":x.status==="renamed"?"text-purple-600":"text-gray-400"}`,children:x.status==="added"||x.status==="untracked"?"A":x.status==="modified"?"M":x.status==="renamed"?"R":"?"}),e.jsx("span",{className:"text-[10px] text-gray-500 truncate font-mono",children:x.path})]},x.path))})]})]})})]})}const bn=[{key:"app",label:"App"},{key:"build",label:"Build"},{key:"data",label:"Structure"},{key:"journal",label:"Journal"}];function jn({activeTab:t,onTabChange:s,buildIdle:n}){return e.jsxs("div",{className:"bg-[#3d3d3d] h-10 flex items-center px-3 gap-3 shrink-0 z-20 border-b border-[#2d2d2d]",children:[e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("img",{src:Os,alt:"CodeYam",className:"h-5 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-xs whitespace-nowrap",children:"Codeyam Editor"})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:e.jsx("div",{className:"flex items-center gap-0.5 bg-[#4a3232] rounded-lg p-0.5",children:bn.map(a=>e.jsxs("button",{onClick:()=>s(a.key),className:`px-2.5 py-1 text-xs font-medium rounded-md transition-colors cursor-pointer ${t===a.key?"bg-[#7a4444] text-white":"text-gray-300 hover:text-white"}`,children:[a.label,a.key==="build"&&n&&t!=="build"&&e.jsx("span",{className:"ml-1 inline-block w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse"})]},a.key))})})]})}function yn({onMouseDown:t,onDoubleClick:s,isDragging:n}){return e.jsxs("div",{className:"shrink-0 relative flex items-center justify-center cursor-col-resize group",style:{width:12},onMouseDown:t,onDoubleClick:s,children:[e.jsx("div",{className:"absolute inset-y-0 left-1/2 -translate-x-1/2",style:{width:n?3:1,backgroundColor:n?"#3b82f6":"#3d3d3d",transition:"width 100ms, background-color 100ms"}}),!n&&e.jsx("div",{className:"absolute inset-0 bg-blue-500/0 group-hover:bg-blue-500/20 transition-colors pointer-events-none"}),e.jsxs("div",{className:"relative z-10 flex flex-col gap-[3px] opacity-0 group-hover:opacity-100 transition-opacity",style:n?{opacity:1}:void 0,children:[e.jsx("div",{className:"w-2 h-px bg-gray-400"}),e.jsx("div",{className:"w-2 h-px bg-gray-400"}),e.jsx("div",{className:"w-2 h-px bg-gray-400"})]})]})}const vn=300,Ae=150;function Nn(t){const[s,n]=r.useState(null),[a,c]=r.useState(!1),i=r.useRef(0);r.useEffect(()=>{t.current&&n(Math.round(t.current.offsetWidth*.5))},[t]);const o=r.useCallback(()=>{var h;return((h=t.current)==null?void 0:h.offsetWidth)??(typeof window<"u"?window.innerWidth:1024)},[t]),l=r.useCallback(h=>{h.preventDefault(),c(!0)},[]),m=r.useCallback(()=>{n(Math.round(o()*.5))},[o]),N=r.useCallback(()=>{n(Math.round(o()*.5))},[o]),j=r.useCallback(()=>{n(Math.round(o()*.5))},[o]);r.useEffect(()=>{if(!a)return;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const h=_=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(()=>{var p;const T=(p=t.current)==null?void 0:p.getBoundingClientRect(),F=(T==null?void 0:T.left)??0,v=((T==null?void 0:T.width)??window.innerWidth)-Ae,M=_.clientX-F,z=Math.min(Math.max(M,vn),v);n(z)})},R=_=>{var M;cancelAnimationFrame(i.current),c(!1);const T=(M=t.current)==null?void 0:M.getBoundingClientRect(),F=(T==null?void 0:T.left)??0,D=(T==null?void 0:T.width)??window.innerWidth,v=_.clientX-F;v<Ae?n(0):D-v<Ae&&n(D)};return document.addEventListener("mousemove",h),document.addEventListener("mouseup",R),()=>{cancelAnimationFrame(i.current),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",R),document.body.style.cursor="",document.body.style.userSelect=""}},[a,t]),r.useEffect(()=>{const h=()=>{n(R=>{if(R===null||R===0)return R;const _=o();return R>=_?_:Math.min(R,_-Ae)})};if(!(typeof window>"u"))return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[o]);const S=o(),g=s===0,I=s!==null&&s>=S;return{editorWidth:s,isDragging:a,isEditorCollapsed:g,isPreviewCollapsed:I,handleMouseDown:l,handleDoubleClick:m,expandEditor:N,expandPreview:j}}function wn({preview:t,onDismiss:s,onLoadCommit:n}){return e.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-[700px] w-full",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-lg font-semibold text-[#333] m-0 font-['IBM_Plex_Sans']",children:"Journal Screenshot"}),e.jsx("p",{className:"text-sm text-[#888] mt-1 m-0 font-['IBM_Plex_Sans']",children:"This is a snapshot from a previous version — not a live preview"})]}),e.jsx("div",{className:"rounded-lg overflow-hidden border-2 border-[#ccc] shadow-md max-w-full w-fit",children:e.jsx("img",{src:t.screenshotUrl,alt:t.scenarioName,className:"max-w-full h-auto block"})}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-[#666]",children:[t.commitSha&&e.jsx("span",{className:"font-mono text-xs text-[#00a0c4] bg-[#00a0c4]/15 px-2 py-0.5 rounded",children:t.commitSha.slice(0,7)}),e.jsxs("span",{className:"truncate",children:[t.scenarioName,t.commitMessage&&` — ${t.commitMessage}`]})]}),e.jsx("div",{className:"flex items-center gap-3",children:t.commitSha&&n&&e.jsx(Sn,{commitSha:t.commitSha,onLoadCommit:n})})]})}function Sn({commitSha:t,onLoadCommit:s}){const[n,a]=r.useState(!1),[c,i]=r.useState(null);return e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{a(!0),i(null),s(t).then(o=>{o.success||i(o.error||"Failed to load commit")}).catch(o=>{i(o instanceof Error?o.message:"Network error")}).finally(()=>a(!1))},disabled:n,className:"bg-[#005c75] hover:bg-[#004d63] disabled:opacity-50 text-white text-sm font-medium px-4 py-1.5 rounded transition-colors cursor-pointer",children:n?"Reverting...":"Revert to this code and load this version"}),c&&e.jsx("div",{className:"bg-red-50 border border-red-200 rounded px-4 py-2 text-sm text-red-600 w-full text-center",children:c})]})}function kn({analysisId:t,scenarioId:s,scenarioName:n,entityName:a,projectSlug:c,onStateChange:i}){const{interactiveServerUrl:o,isStarting:l,isLoading:m}=zs({analysisId:t,scenarioId:s,scenarioName:n,entityName:a,projectSlug:c,enabled:!0});return r.useEffect(()=>{i(o,l||m)},[o,l,m,i]),null}function Cn({onSaveToCurrent:t,onSaveAsNew:s,onDismiss:n,isSaving:a}){return e.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-emerald-900/60 border-b border-emerald-700/50 text-emerald-200 text-xs",children:[e.jsx("span",{className:"font-medium",children:"Data modified."}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:t,disabled:a,className:"px-2.5 py-0.5 bg-emerald-600 hover:bg-emerald-500 disabled:opacity-50 text-white text-xs font-medium rounded transition-colors cursor-pointer disabled:cursor-not-allowed",children:a?"Saving...":"Save to Scenario"}),e.jsx("button",{onClick:s,disabled:a,className:"px-2.5 py-0.5 bg-emerald-800 hover:bg-emerald-700 disabled:opacity-50 text-emerald-200 text-xs font-medium rounded transition-colors cursor-pointer disabled:cursor-not-allowed",children:"Save as New"}),e.jsx("button",{onClick:n,disabled:a,className:"text-emerald-400 hover:text-emerald-200 disabled:opacity-50 transition-colors cursor-pointer disabled:cursor-not-allowed",title:"Dismiss",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})}function Pn(t,s){return s.status==="error"?{url:null,proxyUrl:null,isStarting:!1,error:s.errorMessage||"Dev server crashed",canStartServer:t.canStartServer,autoStartAttempted:t.autoStartAttempted,shouldAutoStart:!1}:s.url?{url:s.url,proxyUrl:s.proxyUrl||null,isStarting:!1,error:null,canStartServer:!0,autoStartAttempted:t.autoStartAttempted,shouldAutoStart:!1}:s.status==="starting"?{...t,isStarting:!0,error:null,canStartServer:!0,shouldAutoStart:!1}:s.status==="stopped"?t.url?{...t,url:null,isStarting:!1,shouldAutoStart:!1}:t.autoStartAttempted?{...t,isStarting:!1,shouldAutoStart:!1}:{...t,autoStartAttempted:!0,shouldAutoStart:!0}:{...t,shouldAutoStart:!1}}function En(t){const[s,n]=r.useState({url:null,proxyUrl:null,isStarting:!1,error:null,canStartServer:!0,autoStartAttempted:!1}),a=r.useRef(s);a.current=s,r.useEffect(()=>{let o=!1,l=null;const m=async()=>{try{const N=await fetch("/api/editor-dev-server");if(o)return;const j=await N.json(),S=Pn(a.current,j),{shouldAutoStart:g,...I}=S;if(n(I),g&&!(t!=null&&t.skipAutoStart))try{const h=await fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start"})});if(o)return;h.ok?n(R=>({...R,isStarting:!0})):n(R=>({...R,canStartServer:!1}))}catch{}}catch{}};return m(),l=setInterval(()=>void m(),2e3),()=>{o=!0,l&&clearInterval(l)}},[s.url]);const c=r.useCallback(()=>{n(o=>({...o,error:null,isStarting:!0})),fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"restart"})}).catch(()=>{})},[]),i=r.useCallback(()=>{n(o=>({...o,error:null,isStarting:!0})),fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start"})}).catch(()=>{})},[]);return{devServerUrl:s.url,proxyUrl:s.proxyUrl,isStarting:s.isStarting,error:s.error,canStartServer:s.canStartServer,retryServer:c,startServer:i}}function Mn(t){const s=r.useRef(null),n=r.useRef(null);r.useEffect(()=>{if(typeof document>"u")return;n.current||(n.current=document.createElement("canvas"),n.current.width=64,n.current.height=64);const a=document.querySelector('link[rel="icon"]');if(!a)return;if(s.current||(s.current=a.href),!t){a.href=s.current;return}const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const i=n.current,o=i.getContext("2d");o.clearRect(0,0,64,64);const l=56,m=(64-l)/2;o.drawImage(c,m,m,l,l);const N=12,j=64-N-1,S=N+1;o.beginPath(),o.arc(j,S,N+3,0,2*Math.PI),o.fillStyle="#ffffff",o.fill(),o.beginPath(),o.arc(j,S,N,0,2*Math.PI),o.fillStyle="#ef4444",o.fill(),a.href=i.toDataURL("image/png")},c.src=s.current},[t]),r.useEffect(()=>()=>{if(typeof document>"u")return;const a=document.querySelector('link[rel="icon"]');a&&s.current&&(a.href=s.current)},[])}function Un({currentUrl:t,nextUrl:s,formMethod:n,defaultShouldRevalidate:a}){return n||t.pathname===s.pathname?a:t.pathname.startsWith("/editor")&&s.pathname.startsWith("/editor")?!1:a}const Hn=()=>[{title:"Editor - CodeYam"},{name:"description",content:"CodeYam Code + Data Editor"}];class In extends r.Component{constructor(){super(...arguments);St(this,"state",{error:null,errorInfo:null})}static getDerivedStateFromError(n){return{error:n,errorInfo:null}}componentDidCatch(n,a){console.error("[EditorErrorBoundary] Error:",n.message),console.error("[EditorErrorBoundary] Component stack:",a.componentStack),console.error("[EditorErrorBoundary] Loader snapshot:",JSON.stringify(this.props.loaderSnapshot,null,2)),this.setState({errorInfo:a})}render(){var n;return this.state.error?e.jsx("div",{className:"fixed inset-0 bg-[#1e1e1e] flex items-center justify-center p-8",children:e.jsxs("div",{className:"max-w-[600px] w-full space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-red-400 font-['IBM_Plex_Sans'] m-0",children:"Something went wrong"}),e.jsx("pre",{className:"text-xs text-gray-300 bg-[#2d2d2d] p-3 rounded overflow-auto max-h-[120px]",children:this.state.error.message}),((n=this.state.errorInfo)==null?void 0:n.componentStack)&&e.jsxs("details",{className:"text-xs text-gray-500",children:[e.jsx("summary",{className:"cursor-pointer hover:text-gray-300 transition-colors",children:"Component stack"}),e.jsx("pre",{className:"mt-2 bg-[#2d2d2d] p-3 rounded overflow-auto max-h-[200px] text-yellow-300",children:this.state.errorInfo.componentStack})]}),e.jsx("p",{className:"text-xs text-gray-500 m-0",children:"Full diagnostics are in the browser console."}),e.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-[#005c75] text-white text-sm rounded hover:bg-[#004d63] transition-colors cursor-pointer",children:"Reload"})]})}):this.props.children}}const Jn=Ns(function(){const{projectSlug:s,projectRoot:n,hasProject:a,scenarios:c,allScenarios:i,analyzedEntities:o,allEntities:l,glossaryFunctions:m,glossaryEntries:N,entityImports:j,pageFilePaths:S,entityChangeStatus:g,modifiedFiles:I,featureName:h,userPrompt:R,projectTitle:_,projectDescription:T,defaultScreenSize:F,screenSizes:D,editorStep:v,editorStepLabel:M,claudeSessionId:z,focusedEntitySha:p,newerEntitySha:x,focusedEntity:y,migrationMode:f,migrationState:w}=ws(),[k,$]=Ss(),B=ks(),C=r.useRef(null),q=r.useRef(null),he=r.useRef(null),fe=r.useRef(null),[De,se]=r.useState(p);r.useEffect(()=>{se(p)},[p]);const P=r.useMemo(()=>mn(De,l,i),[De,l,i]),L=(P==null?void 0:P.displayName)??void 0,J=k.get("scenario")||void 0,[G,A]=r.useState(()=>L?[L]:[]),Q=r.useRef(null),ne=r.useRef([]),V=r.useRef(null);r.useEffect(()=>{var H;const d=J||((H=Is(i))==null?void 0:H.id);if(!Ts(d,Q.current))return;const b=i.find(K=>K.id===d);if(!b)return;Q.current=d;const E=Ke(b,ne.current,V.current);E&&ce(E);const U=Qe(b.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:U,scenarioId:b.id,scenarioName:b.name,scenarioType:b.type})}).catch(()=>{})},[J,i]),r.useEffect(()=>{const d=new BroadcastChannel("codeyam-editor");return d.onmessage=b=>{var E;if(((E=b.data)==null?void 0:E.type)==="switch-scenario"&&b.data.scenarioId){const U=b.data.scenarioId,H=i.find(xe=>xe.id===U);if(!H)return;Q.current=U;const K=new URLSearchParams(k);K.set("scenario",U),K.delete("zoom"),$(K),W(null),Ie(null),ie(null),be(!0);const Ne=Qe(H.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:Ne,scenarioId:U,scenarioType:H.type})}).then(()=>{Z(!1),$e(xe=>xe+1)}).catch(()=>{be(!1)})}},()=>d.close()},[k,$,i]),r.useEffect(()=>{if(k.get("ref")!=="link"||!J)return;const d=new BroadcastChannel("codeyam-editor");d.postMessage({type:"switch-scenario",scenarioId:J}),d.close(),window.close()},[]);const{devServerUrl:ae,proxyUrl:te,isStarting:le,error:re,canStartServer:Pe,retryServer:Ee,startServer:Me}=En({skipAutoStart:f==="candidate"||f==="active"}),[ge,Z]=r.useState(!1),[u,W]=r.useState(null),[O,Ie]=r.useState(null),[Fe,st]=r.useState(!1),[Be,ie]=r.useState(null),Ut=r.useCallback(async d=>{const E=await(await fetch("/api/editor-load-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commitSha:d})})).json();return E.success&&(ie(null),Z(!1)),E},[]),Ht=r.useCallback((d,b)=>{Ie(E=>(d&&d!==E&&Z(!1),d)),!b&&d&&Z(!0),st(b)},[]),nt=r.useCallback(d=>{ie(null),W(E=>(E&&E.analysisId===d.analysisId||(Ie(null),$e(H=>H+1)),d)),st(!0),Z(!1);const b=new URLSearchParams(k);b.delete("scenario"),b.delete("zoom"),$(b)},[k,$]),[Y,ce]=r.useState(F?{name:F.name,width:F.width,height:F.height}:{name:"Desktop",width:1440,height:900}),[at,rt]=r.useState(!1),it=F?{name:F.name,width:F.width,height:F.height}:null;V.current=it;const ot=Cs(),X=r.useMemo(()=>{const d=ot.pathname.split("/").filter(Boolean),b=d[d.length-1];return b==="build"||b==="journal"?b:b==="structure"?"data":"app"},[ot.pathname]),ee=r.useCallback(d=>{se(null),A([]);const b=d==="app"?"":`/${d==="data"?"structure":d}`,E=k.get("scenario"),U=E?`?scenario=${E}`:"";B(`/editor${b}${U}`)},[B,k]),Jt=r.useCallback(()=>{ee("build"),de(!0)},[ee]),Gt=r.useCallback(()=>{ee("build"),de(!0),setTimeout(()=>{var d;(d=C.current)==null||d.sendInput("codeyam editor migrate")},300)},[ee]),[Vt,de]=r.useState(X==="build"),qt=!!(h&&v),[Te,Yt]=r.useState(qt?"pending":"no-session");r.useEffect(()=>{Te==="pending"&&(ee("build"),de(!0))},[Te,ee]);const Xt=r.useCallback(()=>{Yt("continue")},[]),[Oe,ze]=r.useState(!1),[Kt,lt]=r.useState(!1),Qt=r.useCallback(d=>{ze(d),d&&lt(!1)},[]);Mn(Oe);const{editorWidth:ct,isDragging:dt,isEditorCollapsed:We,isPreviewCollapsed:Ue,handleMouseDown:Zt,handleDoubleClick:es,expandEditor:ts,expandPreview:ss}=Nn(fe),[He,mt]=r.useState(!1),ns=r.useCallback(()=>{mt(!0),ee("build"),de(!0)},[ee]),xt=r.useCallback(()=>{mt(!1)},[]),as=r.useCallback(d=>{ce(d),fetch("/api/editor-project-info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultScreenSize:d,skipBroadcast:!0})})},[]),[pt,ut]=r.useState($s);r.useEffect(()=>{const d=As();ut(d),d.systemNotification&&typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},[]);const rs=r.useCallback(d=>{ut(d),Rs(d)},[]);r.useEffect(()=>{if(X==="build"){ze(!1);const d=setTimeout(()=>{var b,E;(b=C.current)==null||b.scrollToBottom(),(E=C.current)==null||E.focus()},50);return()=>clearTimeout(d)}},[X]),r.useEffect(()=>{function d(){!document.hidden&&X==="build"&&ze(!1)}return document.addEventListener("visibilitychange",d),()=>document.removeEventListener("visibilitychange",d)},[X]);const[Je,is]=r.useState(null);r.useEffect(()=>{const d=he.current;if(!d)return;const b=new ResizeObserver(E=>{const U=E[0];U&&is({width:U.contentRect.width,height:U.contentRect.height})});return b.observe(d),()=>b.disconnect()},[]);const me=r.useMemo(()=>Je?Ls(Je,Y):1,[Je,Y]),[Ge,$e]=r.useState(0),[ht,Ve]=r.useState(null),[ft,be]=r.useState(!1),[os,je]=r.useState(!1),[ls,gt]=r.useState(!1),cs=r.useCallback(()=>{je(!0)},[]);r.useEffect(()=>{const d=b=>{var E;((E=b.data)==null?void 0:E.type)==="codeyam-localstorage-changed"&&je(!0)};return window.addEventListener("message",d),()=>window.removeEventListener("message",d)},[]);const bt=r.useCallback(async d=>{gt(!0);try{let b;const E=q.current;E!=null&&E.contentWindow&&(b=await new Promise(K=>{const Ne=setTimeout(()=>K(void 0),2e3),xe=Nt=>{var wt;((wt=Nt.data)==null?void 0:wt.type)==="codeyam-localstorage-state"&&(clearTimeout(Ne),window.removeEventListener("message",xe),K(Nt.data.data))};window.addEventListener("message",xe),E.contentWindow.postMessage({type:"codeyam-get-localstorage"},"*")}));const H=await(await fetch("/api/editor-save-seed-state",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:d,localStorage:b})})).json();H.success?je(!1):console.error("[editor] Save seed state failed:",H.error)}catch(b){console.error("[editor] Save seed state error:",b)}finally{gt(!1)}},[]),ds=r.useCallback((d,b)=>{if(Ve(d||null),b){const E=new URLSearchParams(k);E.set("scenario",b),Q.current=b,$(E);const U=i.find(H=>H.id===b);if(U){const H=Ke(U,ne.current,V.current);H&&ce(H)}}ie(null),Z(!1),$e(E=>E+1)},[k,$,i]),{customSizes:qe,addCustomSize:ms,removeCustomSize:xs}=Es(s),Ye=r.useMemo(()=>Us(D),[D]),Xe=r.useMemo(()=>[...Ye,...qe],[Ye,qe]);ne.current=Xe;const jt=r.useMemo(()=>{const d=new Map;for(const b of l){d.set(b.name,b.sha);const E=Ce(ke(b.filePath));E!==b.name&&d.set(E,b.sha)}return d},[l]),ps=r.useMemo(()=>{const d=[{name:"App"}];for(const b of G)d.push({name:b,componentName:b,entitySha:jt.get(b)});return d},[G,jt]),yt=r.useCallback((d,b)=>{if(!d){A([]),se(null);const K=k.get("scenario"),Ne=K?`?scenario=${K}`:"";B(`/editor${Ne}`);return}if(!b){console.error(`[editor] No entity SHA for "${d}" — entity missing from database`);return}const E=G.indexOf(d);E>=0?A(G.slice(0,E+1)):A([...G,d]);const U=i.find(K=>K.entitySha===b);se(b);const H=U?`?scenario=${U.id}`:"";B(`/editor/entity/${b}${H}`)},[B,i,G,k]),ye=r.useCallback(d=>{W(null),Ie(null),ie(null),Ve(null);const b=Ke(d,Xe,it);b&&ce(b),Q.current=d.id;const E=new URLSearchParams(k);E.set("scenario",d.id),$(E),be(!0),je(!1);const U=Qe(d.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:U,scenarioId:d.id,scenarioType:d.type,skipBroadcast:!0})}).then(()=>{Z(!1),$e(H=>H+1)}).catch(()=>{be(!1)})},[k,$,Xe]),us=r.useCallback(d=>{if(!d.commitSha){const b=i.find(E=>E.name===d.scenarioName);if(b){ye(b);return}}ie(d)},[i,ye]),hs=d=>{const b={name:d.name,width:d.width,height:d.height};ce(b),fetch("/api/editor-project-info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultScreenSize:b,skipBroadcast:!0})})},fs=(d,b,E)=>{ms(d,b,E)},gs=d=>{ce(d),fetch("/api/editor-project-info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultScreenSize:d,skipBroadcast:!0})})},bs=()=>{u||Z(!0),be(!1)},ve=r.useMemo(()=>_s({activeAnalyzedScenario:!!u,analyzedPreviewUrl:O,activeScenarioId:J||null,scenarios:i,proxyUrl:te,devServerUrl:ae,zoomComponent:L||null}),[te,ae,L,J,i,u,O]),vt=r.useMemo(()=>{const d=Ds(ve,ht);if(!d)return null;const b=d.includes("?")?"&":"?";return`${d}${b}__cb=${Ge}`},[ve,ht,Ge]),js=r.useMemo(()=>({projectSlug:s,hasProject:a,scenarioCount:c==null?void 0:c.length,allScenarioCount:i==null?void 0:i.length,analyzedEntityCount:o==null?void 0:o.length,glossaryFunctionCount:m==null?void 0:m.length,entityChangeStatusKeys:g?Object.keys(g):[],featureName:h}),[s,a,c,i,o,m,g,h]);return e.jsxs(e.Fragment,{children:[e.jsx(In,{loaderSnapshot:js,children:e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[u&&e.jsx(kn,{analysisId:u.analysisId,scenarioId:u.scenarioId,scenarioName:u.scenarioName,entityName:u.entityName,projectSlug:s,onStateChange:Ht},u.analysisId),e.jsxs("div",{ref:fe,className:"flex-1 flex min-h-0",children:[We&&e.jsx("div",{className:"shrink-0 flex items-center justify-center cursor-pointer hover:bg-[#3d3d3d] transition-colors",style:{width:8,backgroundColor:"#2d2d2d"},onClick:ts,title:"Expand editor",children:e.jsx("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",stroke:"#888",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M1 1l4 4-4 4"})})}),e.jsxs("aside",{className:"bg-[#1e1e1e] shrink-0 flex flex-col overflow-hidden",style:{...We?{display:"none"}:ct!==null?{width:`${ct}px`}:{width:"50%"}},children:[x&&P&&e.jsxs("div",{className:"px-3 py-2 text-xs flex items-center justify-between",style:{background:"#2a1f00",borderBottom:"1px solid #3d2e00",color:"#f0c040"},children:[e.jsxs("span",{children:["Viewing an older version of"," ",e.jsx("strong",{children:P.name}),". A newer version exists."]}),e.jsx("a",{href:`/editor/entity/${x}`,className:"px-2 py-0.5 rounded text-xs",style:{background:"#3d2e00",color:"#f0c040",textDecoration:"none"},children:"View latest"})]}),e.jsx(jn,{activeTab:X,onTabChange:d=>{ee(d),d==="build"&&de(!0),fetch("/api/telemetry-page-view",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({route:`/editor/${d}`})}).catch(()=>{})},buildIdle:Oe}),e.jsxs("div",{className:"flex-1 overflow-hidden relative",children:[Oe&&X!=="build"&&!Kt&&e.jsxs("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 z-50 animate-[slideDown_0.3s_ease-out]",children:[e.jsx("style",{children:`
49
- @keyframes slideDown {
50
- from { transform: translate(-50%, -100%); opacity: 0; }
51
- to { transform: translate(-50%, 0); opacity: 1; }
52
- }
53
- `}),e.jsxs("div",{className:"flex items-center gap-1 bg-amber-50 border-2 border-amber-300 rounded-lg shadow-lg",children:[e.jsxs("button",{onClick:()=>{ee("build"),de(!0)},className:"flex items-center gap-2 px-4 py-2 cursor-pointer hover:bg-amber-100 transition-colors rounded-l-md",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-amber-400 animate-pulse"}),e.jsx("span",{className:"text-sm font-medium text-amber-900",children:"Claude is waiting for you"}),e.jsx("span",{className:"text-xs text-amber-600 ml-1",children:"Go to Build"})]}),e.jsx("button",{onClick:d=>{d.stopPropagation(),lt(!0)},className:"px-2 py-2 cursor-pointer hover:bg-amber-100 transition-colors rounded-r-md text-amber-400 hover:text-amber-600","aria-label":"Dismiss",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M3 3l8 8M11 3l-8 8"})})})]})]}),Vt&&e.jsxs("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:X==="build"?"visible":"hidden"},children:[e.jsx("div",{className:He?"flex-1 min-h-0":"flex-1",style:He?{flex:"1 1 50%"}:void 0,children:Te==="pending"?e.jsx(Hs,{featureName:h,editorStep:v,editorStepLabel:M,onContinue:Xt}):e.jsx(Fs,{ref:C,entityName:"Editor",projectSlug:s,entityFilePath:null,scenarioName:null,onRefreshPreview:ds,onShowResults:ns,onHideResults:xt,onSetViewport:as,onDataMutationForwarded:cs,editorMode:!0,onIdleChange:Qt,notificationSettings:pt,buildTabActive:X==="build",claudeStartMode:Te==="continue"?"resume":"fresh",claudeSessionId:z})}),He&&e.jsx("div",{style:{flex:"1 1 50%"},className:"min-h-0 border-t-2 border-gray-300",children:e.jsx(gn,{scenarios:c,allScenarios:i,glossaryFunctions:m,projectRoot:n,activeScenarioId:J,onScenarioSelect:ye,onClose:xt,entityChangeStatus:g,modifiedFiles:I,featureName:h,userPrompt:R})})]}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:X==="app"?"visible":"hidden"},children:e.jsx(un,{hasProject:a,scenarios:i,analyzedEntities:o,allEntities:l,glossaryFunctions:m,glossaryEntries:N,projectRoot:n,activeScenarioId:J,onScenarioSelect:ye,onAnalyzedScenarioSelect:nt,onSwitchToBuild:Jt,zoomComponent:L,focusedEntity:P,onZoomChange:yt,entityImports:j,pageFilePaths:S,projectTitle:_,projectDescription:T,breadcrumbItems:ps,migrationMode:f,migrationState:w,onStartMigration:Gt})}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:X==="data"?"visible":"hidden"},children:e.jsx(Js,{scenarios:i,projectRoot:n,activeScenarioId:J,onScenarioSelect:ye,zoomComponent:L,focusedEntity:P,onZoomChange:yt,analyzedEntities:[],glossaryFunctions:m,activeAnalyzedScenarioId:u==null?void 0:u.scenarioId,onAnalyzedScenarioSelect:nt,entityImports:j,pageFilePaths:S})}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:X==="journal"?"visible":"hidden"},children:e.jsx(nn,{isActive:X==="journal",onScreenshotClick:us,glossaryFunctions:m})})]}),e.jsx(Bs,{serverUrl:ae,isStarting:le,projectSlug:s,devServerError:re,onStartServer:Pe?Me:void 0,notificationSettings:pt,onChangeNotificationSettings:rs})]}),!We&&!Ue&&e.jsx(yn,{onMouseDown:Zt,onDoubleClick:es,isDragging:dt}),Ue&&e.jsx("div",{className:"shrink-0 flex items-center justify-center cursor-pointer hover:bg-[#3d3d3d] transition-colors",style:{width:8,backgroundColor:"#2d2d2d"},onClick:ss,title:"Expand preview",children:e.jsx("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",stroke:"#888",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M5 1l-4 4 4 4"})})}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:{...Ue?{display:"none"}:void 0,...dt?{pointerEvents:"none"}:void 0},children:[e.jsxs("div",{className:"bg-[#2d2d2d] border-b border-[#3d3d3d] shrink-0 z-10 h-10 flex items-center px-4 relative",children:[e.jsx("div",{className:"flex items-center gap-1 shrink-0 z-10"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center gap-1 pointer-events-none",children:e.jsxs("div",{className:"flex items-center gap-1 pointer-events-auto",children:[Re.map(d=>e.jsxs("button",{onClick:()=>hs(d),className:`p-1.5 rounded transition-colors cursor-pointer ${Y.name===d.name?"text-white bg-[#555]":"text-gray-500 hover:text-gray-300"}`,title:`${d.name} (${d.width}×${d.height})`,children:[d.name==="Desktop"&&e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),e.jsx("path",{d:"M8 21h8M12 17v4"})]}),d.name==="Laptop"&&e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8H4V6z"}),e.jsx("path",{d:"M2 18h20"})]}),d.name==="Tablet"&&e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2"}),e.jsx("path",{d:"M12 18h.01"})]}),d.name==="Mobile"&&e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"7",y:"2",width:"10",height:"20",rx:"2"}),e.jsx("path",{d:"M12 18h.01"})]})]},d.name)),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>rt(d=>!d),className:`flex items-center gap-1.5 px-2 py-1 rounded transition-colors cursor-pointer ${at||!Re.some(d=>d.name===Y.name)?"text-white bg-[#555]":"text-gray-400 hover:text-gray-200 hover:bg-[#444]"}`,title:"Custom dimensions",children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})}),e.jsxs("span",{className:"text-xs font-mono",children:[Y.width," ×"," ",Y.height??900]})]}),at&&e.jsx(Ms,{currentWidth:Y.width,currentHeight:Y.height??900,devicePresets:Ye,customSizes:qe,onApply:gs,onSave:fs,onRemove:xs,onClose:()=>rt(!1)})]}),e.jsx("button",{onClick:()=>{const d=vt||ve;d&&window.open(d,"_blank")},className:"p-1.5 rounded text-gray-500 hover:text-gray-300 transition-colors cursor-pointer",title:"Open preview in new window",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})})]})})]}),os&&e.jsx(Cn,{onSaveToCurrent:()=>void bt("overwrite"),onSaveAsNew:()=>void bt("new"),onDismiss:()=>je(!1),isSaving:ls}),e.jsx("div",{ref:he,className:"flex-1 flex items-center justify-center overflow-hidden p-8",style:Be?{backgroundColor:"#f5f0e8",backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 19px, #e8e0d0 19px, #e8e0d0 20px), repeating-linear-gradient(90deg, transparent, transparent 19px, #e8e0d0 19px, #e8e0d0 20px)"}:{backgroundImage:`
54
- linear-gradient(45deg, #333 25%, transparent 25%),
55
- linear-gradient(-45deg, #333 25%, transparent 25%),
56
- linear-gradient(45deg, transparent 75%, #333 75%),
57
- linear-gradient(-45deg, transparent 75%, #333 75%)
58
- `,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#2d2d2d"},children:Be?e.jsx(wn,{preview:Be,onDismiss:()=>ie(null),onLoadCommit:Ut}):ve?e.jsx("div",{style:{width:`${Y.width*me}px`,height:`${(Y.height??900)*me}px`},children:e.jsxs("div",{className:"relative bg-white origin-top-left",style:{width:`${Y.width}px`,height:`${Y.height??900}px`,transform:me<1?`scale(${me})`:void 0},children:[!ge&&!ft&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-[#2a2a2a] rounded-lg p-8 w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(kt,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-gray-200 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Loading Preview"}),e.jsx("p",{className:"text-sm text-gray-400 leading-5 m-0 font-['IBM_Plex_Sans']",children:"Waiting for the app to render"})]})]})}),ft&&e.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center",style:{backgroundColor:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(1px)",transition:"opacity 200ms ease-out"},children:e.jsxs("div",{className:"flex flex-col items-center gap-3 animate-pulse",children:[e.jsx("svg",{className:"w-6 h-6 text-white/80 animate-spin",viewBox:"0 0 24 24",fill:"none",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"50 100"})}),e.jsx("span",{className:"text-white/70 text-xs font-['IBM_Plex_Sans']",children:"Switching scenario"})]})}),e.jsx("iframe",{ref:q,src:vt||ve,className:"w-full h-full border-none",title:"Editor preview",onLoad:bs,style:{opacity:ge?1:0}},Ge)]})}):e.jsx("div",{className:"bg-[#2a2a2a] rounded-lg flex flex-col items-center justify-center",style:{width:`${Y.width*me}px`,height:`${(Y.height??900)*me}px`},children:re?e.jsxs("div",{className:"flex flex-col gap-4 text-center px-8 max-w-[600px]",children:[e.jsx("h2",{className:"text-xl font-medium text-red-400 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Dev Server Failed"}),e.jsx("pre",{className:"text-xs text-left bg-[#1e1e1e] text-gray-300 p-4 rounded overflow-auto max-h-[300px] w-full font-mono whitespace-pre-wrap",children:re}),e.jsx("button",{onClick:Ee,className:"mx-auto px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded hover:bg-[#004d63] transition-colors cursor-pointer",children:"Retry"})]}):le||Fe?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-4",children:e.jsx(kt,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-gray-200 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:Fe?"Starting Interactive Mode":"Starting Dev Server"}),e.jsx("p",{className:"text-sm text-gray-400 leading-5 m-0 font-['IBM_Plex_Sans']",children:Fe?"Loading component preview...":"Your dev server is starting up..."})]})]}):e.jsxs("div",{className:"flex flex-col gap-3 text-center px-8",children:[e.jsx("h2",{className:"text-xl font-medium text-gray-200 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Live Preview"}),e.jsx("p",{className:"text-sm text-gray-500 leading-5 m-0 font-['IBM_Plex_Sans']",children:"Describe what you want to build in the Build tab"})]})})})]})]})]})}),e.jsx(Ps,{})]})});export{Jn as default,Hn as meta,Un as shouldRevalidate};