@codeyam/codeyam-cli 0.1.8 → 0.1.10

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 (343) hide show
  1. package/analyzer-template/.build-info.json +8 -8
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +4 -4
  4. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
  5. package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +13 -7
  6. package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
  7. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
  8. package/analyzer-template/packages/aws/package.json +1 -1
  9. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +76 -0
  10. package/analyzer-template/packages/database/src/lib/loadEntities.ts +0 -6
  11. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +0 -65
  12. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +7 -0
  13. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -1
  14. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +76 -0
  15. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
  16. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
  17. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +0 -6
  18. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
  19. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  20. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +0 -25
  21. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  22. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  23. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  24. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
  25. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
  26. package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
  27. package/analyzer-template/packages/ui-components/package.json +1 -1
  28. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  29. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  30. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
  31. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
  32. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
  33. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
  34. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
  35. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
  36. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
  37. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
  38. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +45 -0
  39. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
  40. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
  41. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
  42. package/codeyam-cli/src/commands/default.js +3 -46
  43. package/codeyam-cli/src/commands/default.js.map +1 -1
  44. package/codeyam-cli/src/commands/editor.js +1793 -257
  45. package/codeyam-cli/src/commands/editor.js.map +1 -1
  46. package/codeyam-cli/src/commands/init.js +67 -34
  47. package/codeyam-cli/src/commands/init.js.map +1 -1
  48. package/codeyam-cli/src/data/techStacks.js +77 -0
  49. package/codeyam-cli/src/data/techStacks.js.map +1 -0
  50. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
  51. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
  52. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js +46 -0
  53. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js.map +1 -0
  54. package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
  55. package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
  56. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +137 -0
  57. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
  58. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +742 -1
  59. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
  60. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
  61. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
  62. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +181 -3
  63. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -1
  64. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +121 -0
  65. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
  66. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
  67. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
  68. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +249 -2
  69. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -1
  70. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +520 -0
  71. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
  72. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +118 -1
  73. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -1
  74. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +209 -3
  75. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -1
  76. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +153 -0
  77. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
  78. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
  79. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
  80. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
  81. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
  82. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +985 -2
  83. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
  84. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +213 -0
  85. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
  86. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1742 -0
  87. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
  88. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
  89. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
  90. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +129 -0
  91. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
  92. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +227 -0
  93. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
  94. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +454 -0
  95. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
  96. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +25 -5
  97. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  98. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
  99. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
  100. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
  101. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
  102. package/codeyam-cli/src/utils/analyzer.js +9 -0
  103. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  104. package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
  105. package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
  106. package/codeyam-cli/src/utils/backgroundServer.js +94 -18
  107. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  108. package/codeyam-cli/src/utils/database.js +37 -2
  109. package/codeyam-cli/src/utils/database.js.map +1 -1
  110. package/codeyam-cli/src/utils/devServerState.js +71 -0
  111. package/codeyam-cli/src/utils/devServerState.js.map +1 -0
  112. package/codeyam-cli/src/utils/editorApi.js +79 -0
  113. package/codeyam-cli/src/utils/editorApi.js.map +1 -0
  114. package/codeyam-cli/src/utils/editorAudit.js +135 -7
  115. package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
  116. package/codeyam-cli/src/utils/editorCapture.js +102 -0
  117. package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
  118. package/codeyam-cli/src/utils/editorDevServer.js +100 -1
  119. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -1
  120. package/codeyam-cli/src/utils/editorEntityChangeStatus.js +44 -0
  121. package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
  122. package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
  123. package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
  124. package/codeyam-cli/src/utils/editorJournal.js +92 -4
  125. package/codeyam-cli/src/utils/editorJournal.js.map +1 -1
  126. package/codeyam-cli/src/utils/editorLoaderHelpers.js +113 -0
  127. package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
  128. package/codeyam-cli/src/utils/editorMockState.js +1 -1
  129. package/codeyam-cli/src/utils/editorPreloadHelpers.js +72 -1
  130. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -1
  131. package/codeyam-cli/src/utils/editorPreview.js +72 -1
  132. package/codeyam-cli/src/utils/editorPreview.js.map +1 -1
  133. package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
  134. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
  135. package/codeyam-cli/src/utils/editorScenarios.js +331 -0
  136. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
  137. package/codeyam-cli/src/utils/editorSeedAdapter.js +173 -0
  138. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
  139. package/codeyam-cli/src/utils/entityChangeStatus.js +349 -0
  140. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
  141. package/codeyam-cli/src/utils/entityChangeStatus.server.js +158 -0
  142. package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
  143. package/codeyam-cli/src/utils/install-skills.js +1 -1
  144. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  145. package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
  146. package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
  147. package/codeyam-cli/src/utils/progress.js +2 -2
  148. package/codeyam-cli/src/utils/progress.js.map +1 -1
  149. package/codeyam-cli/src/utils/scenarioCoverage.js +75 -0
  150. package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
  151. package/codeyam-cli/src/utils/scenariosManifest.js +241 -0
  152. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
  153. package/codeyam-cli/src/utils/serverState.js +30 -0
  154. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  155. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +46 -16
  156. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  157. package/codeyam-cli/src/utils/simulationGateMiddleware.js +8 -1
  158. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
  159. package/codeyam-cli/src/utils/slugUtils.js +25 -0
  160. package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
  161. package/codeyam-cli/src/utils/syncMocksMiddleware.js +2 -2
  162. package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
  163. package/codeyam-cli/src/utils/webappDetection.js +21 -0
  164. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  165. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +40 -0
  166. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
  167. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +567 -0
  168. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
  169. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +146 -0
  170. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
  171. package/codeyam-cli/src/webserver/app/lib/clientErrors.js +65 -0
  172. package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
  173. package/codeyam-cli/src/webserver/app/lib/git.js +397 -0
  174. package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
  175. package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-DmJveP3T.js → CopyButton-BPXZwM4t.js} +1 -1
  176. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-C76mRRiF.js → EntityItem-BcgbViKV.js} +3 -3
  177. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CobE682z.js → EntityTypeIcon-CQIG2qda.js} +9 -9
  178. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-djPLI-WV.js → ReportIssueModal-BzHcG7SE.js} +3 -3
  179. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-B76aig_2.js → ScenarioViewer-TSD3C211.js} +3 -3
  180. package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-oAf2Kqsf.js +1 -0
  181. package/codeyam-cli/src/webserver/build/client/assets/{_index-C96V0n15.js → _index-DLxKhri3.js} +3 -3
  182. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BpKzcsJz.js → activity.(_tab)-BcY3q6nt.js} +6 -6
  183. package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
  184. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
  185. package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
  186. package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-D9hemwl6.js → agent-transcripts-Bni3iiUj.js} +5 -5
  187. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
  188. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
  189. package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
  190. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
  191. package/codeyam-cli/src/webserver/build/client/assets/{book-open-D_nMCFmP.js → book-open-BYOypzCa.js} +2 -2
  192. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BH2h1Ea2.js → chevron-down-C_Pmso5S.js} +2 -2
  193. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-DyIKORY6.js → circle-check-BVMi9VA5.js} +2 -2
  194. package/codeyam-cli/src/webserver/build/client/assets/{copy-NDbZjXao.js → copy-n2FB0_Sw.js} +3 -3
  195. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CC6AbExI.js +41 -0
  196. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Ii3inc0_.js +1 -0
  197. package/codeyam-cli/src/webserver/build/client/assets/editor-COWCNVyV.js +10 -0
  198. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-CNB06EIa.js +41 -0
  199. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CrjR3zZW.js → entity._sha._-DwCV5__E.js} +3 -3
  200. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-CXSi2aeZ.js +6 -0
  201. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-CHMiAog3.js +6 -0
  202. package/codeyam-cli/src/webserver/build/client/assets/{files-DO4CZ16O.js → files-BZrlFE1F.js} +1 -1
  203. package/codeyam-cli/src/webserver/build/client/assets/git-DdZcvjGh.js +1 -0
  204. package/codeyam-cli/src/webserver/build/client/assets/globals-phvmGvat.css +1 -0
  205. package/codeyam-cli/src/webserver/build/client/assets/index-yHOVb4rc.js +15 -0
  206. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BAXYRVEO.js → loader-circle-DaAZ_H2w.js} +2 -2
  207. package/codeyam-cli/src/webserver/build/client/assets/manifest-6134dc40.js +1 -0
  208. package/codeyam-cli/src/webserver/build/client/assets/memory-9gnxSZlb.js +101 -0
  209. package/codeyam-cli/src/webserver/build/client/assets/{pause-DTAcYxBt.js → pause-f5-1lKBt.js} +3 -3
  210. package/codeyam-cli/src/webserver/build/client/assets/root-BWAyuj0r.js +67 -0
  211. package/codeyam-cli/src/webserver/build/client/assets/{search-fKo7v0Zo.js → search-Di64LWVb.js} +2 -2
  212. package/codeyam-cli/src/webserver/build/client/assets/{settings-DfuTtcJP.js → settings-0OrEMU6J.js} +1 -1
  213. package/codeyam-cli/src/webserver/build/client/assets/{simulations-B3aOzpCZ.js → simulations-DWT-CvLy.js} +1 -1
  214. package/codeyam-cli/src/webserver/build/client/assets/{terminal-BG4heKCG.js → terminal-Br7MOqts.js} +3 -3
  215. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DtSmdtM4.js → triangle-alert-BLdiCuG-.js} +2 -2
  216. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-C-_hOl_g.js +1 -0
  217. package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
  218. package/codeyam-cli/src/webserver/build/server/assets/index-ChX0hPcu.js +1 -0
  219. package/codeyam-cli/src/webserver/build/server/assets/init-kSNsMjj8.js +10 -0
  220. package/codeyam-cli/src/webserver/build/server/assets/server-build-Bm2xIhmh.js +439 -0
  221. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  222. package/codeyam-cli/src/webserver/build-info.json +5 -5
  223. package/codeyam-cli/src/webserver/editorProxy.js +487 -50
  224. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
  225. package/codeyam-cli/src/webserver/idleDetector.js +73 -0
  226. package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
  227. package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
  228. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +242 -3
  229. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +94 -4
  230. package/codeyam-cli/src/webserver/server.js +90 -16
  231. package/codeyam-cli/src/webserver/server.js.map +1 -1
  232. package/codeyam-cli/src/webserver/terminalServer.js +71 -34
  233. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
  234. package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
  235. package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
  236. package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
  237. package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
  238. package/codeyam-cli/templates/chrome-extension-react/package.json +27 -0
  239. package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
  240. package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
  241. package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
  242. package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
  243. package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
  244. package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
  245. package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
  246. package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
  247. package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
  248. package/codeyam-cli/templates/codeyam-editor-claude.md +84 -5
  249. package/codeyam-cli/templates/editor-step-hook.py +98 -8
  250. package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
  251. package/codeyam-cli/templates/expo-react-native/README.md +41 -0
  252. package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
  253. package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
  254. package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
  255. package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
  256. package/codeyam-cli/templates/expo-react-native/app.json +18 -0
  257. package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
  258. package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
  259. package/codeyam-cli/templates/expo-react-native/global.css +3 -0
  260. package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
  261. package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
  262. package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
  263. package/codeyam-cli/templates/expo-react-native/package.json +38 -0
  264. package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
  265. package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
  266. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
  267. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
  268. package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +126 -0
  269. package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
  270. package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
  271. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
  272. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +9 -4
  273. package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
  274. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +21 -0
  275. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +5 -1
  276. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +4 -1
  277. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +92 -0
  278. package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
  279. package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
  280. package/codeyam-cli/templates/{nextjs-prisma-sqlite/PRISMA_SETUP.md → nextjs-prisma-supabase/SUPABASE_SETUP.md} +37 -17
  281. package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
  282. package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
  283. package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
  284. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
  285. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
  286. package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
  287. package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
  288. package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
  289. package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
  290. package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
  291. package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +37 -0
  292. package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
  293. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
  294. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
  295. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
  296. package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
  297. package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +2 -2
  298. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +97 -17
  299. package/codeyam-cli/templates/skills/codeyam-memory/SKILL.md +10 -10
  300. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
  301. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
  302. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
  303. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
  304. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
  305. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
  306. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
  307. package/package.json +14 -9
  308. package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
  309. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  310. package/packages/analyze/src/lib/ProjectAnalyzer.js +10 -4
  311. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  312. package/packages/analyze/src/lib/asts/index.js +4 -2
  313. package/packages/analyze/src/lib/asts/index.js.map +1 -1
  314. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
  315. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
  316. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +76 -0
  317. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
  318. package/packages/database/src/lib/loadEntities.js +0 -6
  319. package/packages/database/src/lib/loadEntities.js.map +1 -1
  320. package/packages/database/src/lib/updateCommitMetadata.js +0 -25
  321. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  322. package/packages/types/src/enums/ProjectFramework.js +2 -0
  323. package/packages/types/src/enums/ProjectFramework.js.map +1 -1
  324. package/codeyam-cli/src/webserver/build/client/assets/Terminal-Dnj5CY9R.js +0 -41
  325. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-CUXOrorO.js +0 -1
  326. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CMT1jU2q.js +0 -21
  327. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BiM6z3Do.js +0 -1
  328. package/codeyam-cli/src/webserver/build/client/assets/editor-D1DAKXtT.js +0 -8
  329. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-DkzqFzFj.js +0 -6
  330. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C28BiQzt.js +0 -6
  331. package/codeyam-cli/src/webserver/build/client/assets/git-CFCTYk9I.js +0 -15
  332. package/codeyam-cli/src/webserver/build/client/assets/globals-B17TBSS6.css +0 -1
  333. package/codeyam-cli/src/webserver/build/client/assets/manifest-a632de18.js +0 -1
  334. package/codeyam-cli/src/webserver/build/client/assets/memory-Dg0mvYrI.js +0 -96
  335. package/codeyam-cli/src/webserver/build/client/assets/root-DUKqhFlb.js +0 -67
  336. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-ByhSyh0W.js +0 -1
  337. package/codeyam-cli/src/webserver/build/server/assets/index-HfLydfDq.js +0 -1
  338. package/codeyam-cli/src/webserver/build/server/assets/server-build-CUu_F-oo.js +0 -366
  339. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.sh +0 -108
  340. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.sh +0 -69
  341. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.sh +0 -12
  342. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter.jq +0 -45
  343. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.sh +0 -139
@@ -1,10 +1,10 @@
1
- import{c as k}from"./createLucideIcon-CMT1jU2q.js";import{d as E,r as u,j as e,L as N}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as T}from"./useToast-9FIWuYfK.js";import{f as D,g as F}from"./fileTableUtils-cPo8LiG3.js";import{T as P}from"./TruncatedFilePath-C8OKAR5x.js";import{S as C}from"./SafeScreenshot-BED4B6sP.js";import{L as B}from"./LibraryFunctionPreview-DLeucoVX.js";import{T as I}from"./triangle-alert-DtSmdtM4.js";import{E as v}from"./EntityTypeIcon-CobE682z.js";import{E as L}from"./EntityTypeBadge-g3saevPb.js";/**
2
- * @license lucide-react v0.556.0 - ISC
1
+ import{c as k}from"./createLucideIcon-CC6AbExI.js";import{d as E,r as u,j as e,L as N}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as T}from"./useToast-9FIWuYfK.js";import{f as D,g as F}from"./fileTableUtils-cPo8LiG3.js";import{T as P}from"./TruncatedFilePath-C8OKAR5x.js";import{S as C}from"./SafeScreenshot-BED4B6sP.js";import{L as B}from"./LibraryFunctionPreview-DLeucoVX.js";import{T as I}from"./triangle-alert-BLdiCuG-.js";import{E as v}from"./EntityTypeIcon-CQIG2qda.js";import{E as L}from"./EntityTypeBadge-g3saevPb.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
6
  */const M=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],J=k("chevrons-down-up",M);/**
7
- * @license lucide-react v0.556.0 - ISC
7
+ * @license lucide-react v0.577.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
@@ -1,40 +1,40 @@
1
- import{j as e}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{c}from"./createLucideIcon-CMT1jU2q.js";/**
2
- * @license lucide-react v0.556.0 - ISC
1
+ import{j as e}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{c}from"./createLucideIcon-CC6AbExI.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
6
  */const h=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],g=c("box",h);/**
7
- * @license lucide-react v0.556.0 - ISC
7
+ * @license lucide-react v0.577.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
11
  */const f=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],p=c("chart-column",f);/**
12
- * @license lucide-react v0.556.0 - ISC
12
+ * @license lucide-react v0.577.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
16
  */const b=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],y=c("code-xml",b);/**
17
- * @license lucide-react v0.556.0 - ISC
17
+ * @license lucide-react v0.577.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
21
  */const x=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],i=c("code",x);/**
22
- * @license lucide-react v0.556.0 - ISC
22
+ * @license lucide-react v0.577.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
26
  */const C=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],s=c("file-text",C);/**
27
- * @license lucide-react v0.556.0 - ISC
27
+ * @license lucide-react v0.577.0 - ISC
28
28
  *
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
31
  */const k=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],u=c("image",k);/**
32
- * @license lucide-react v0.556.0 - ISC
32
+ * @license lucide-react v0.577.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
35
35
  * See the LICENSE file in the root directory of this source tree.
36
36
  */const m=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],z=c("list",m);/**
37
- * @license lucide-react v0.556.0 - ISC
37
+ * @license lucide-react v0.577.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
@@ -1,10 +1,10 @@
1
- import{r as t,d as T,j as e}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{c as S}from"./createLucideIcon-CMT1jU2q.js";import{C as F}from"./circle-check-DyIKORY6.js";import{T as k}from"./triangle-alert-DtSmdtM4.js";import{C as E,a as A}from"./copy-NDbZjXao.js";/**
2
- * @license lucide-react v0.556.0 - ISC
1
+ import{r as t,d as T,j as e}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{c as S}from"./createLucideIcon-CC6AbExI.js";import{C as F}from"./circle-check-BVMi9VA5.js";import{T as k}from"./triangle-alert-BLdiCuG-.js";import{C as E,a as A}from"./copy-n2FB0_Sw.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
6
  */const W=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],B=S("bug",W);/**
7
- * @license lucide-react v0.556.0 - ISC
7
+ * @license lucide-react v0.577.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
@@ -1,10 +1,10 @@
1
- import{r as i,j as e,d as ge,L as ie}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{I as be}from"./InteractivePreview-DYFW3lDD.js";import{u as je,V as we,S as Ne}from"./useCustomSizes-ByhSyh0W.js";import{L as J}from"./LogViewer-ceAyBX-H.js";import{S as ve}from"./SafeScreenshot-BED4B6sP.js";import{u as ke}from"./useLastLogLine-C14nCb1q.js";import{u as Ce}from"./Spinner-Bb5uFQ5V.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{R as Ie}from"./ReportIssueModal-djPLI-WV.js";import{C as Ee,a as Le}from"./copy-NDbZjXao.js";import{g as Pe}from"./scenarioStatus-B_8jpV3e.js";function $e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:N,onSaveCustomSize:w,onRemoveCustomSize:d,className:k=""}){const[h,x]=i.useState(!1),[g,b]=i.useState(String(n)),[m,j]=i.useState(String(o)),[C,u]=i.useState(!1),[l,R]=i.useState(!1),P=i.useRef(null);i.useEffect(()=>{C||b(String(n))},[n,C]),i.useEffect(()=>{l||j(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{P.current&&!P.current.contains(f.target)&&x(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const $=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=$==="Custom",S=r=>{N(r.width,r.height),x(!1)},W=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(c,o)},U=r=>{const f=r.target.value;j(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(n,c)},A=()=>{u(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&b(String(n))},K=()=>{R(!1);const r=parseInt(m,10);(isNaN(r)||r<=0)&&j(String(o))},D=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:P,children:[e.jsxs("button",{onClick:()=>x(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:$}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>S(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>S(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),d&&e.jsx("button",{onClick:f=>{f.stopPropagation(),$===r.name&&s.length>0&&N(s[0].width,s[0].height),d(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:g,onChange:W,onFocus:()=>u(!0),onBlur:A,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:m,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),O&&e.jsx("button",{onClick:w,className:"px-3 py-1.5 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors",children:"Save Custom Size"})]})}function de({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function _e({scenario:s,analysis:t,entity:n}){var w,d,k;const o=((w=s.metadata)==null?void 0:w.executionResult)||null,v=((k=(d=s.metadata)==null?void 0:d.data)==null?void 0:k.argumentsData)||[],N=h=>{var j,C,u;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const x=[],g=((j=h.sideEffects)==null?void 0:j.consoleOutput)||[];g.length>0&&(x.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{x.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const b=((C=h.sideEffects)==null?void 0:C.fileWrites)||[];b.length>0&&(x.push(`
1
+ import{r as i,j as e,d as ge,L as ie}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{I as be}from"./InteractivePreview-DYFW3lDD.js";import{V as je}from"./ViewportInspectBar-oAf2Kqsf.js";import{u as we,S as Ne}from"./useCustomSizes-C-_hOl_g.js";import{L as J}from"./LogViewer-ceAyBX-H.js";import{S as ve}from"./SafeScreenshot-BED4B6sP.js";import{u as ke}from"./useLastLogLine-C14nCb1q.js";import{u as Ce}from"./Spinner-Bb5uFQ5V.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{R as Ie}from"./ReportIssueModal-BzHcG7SE.js";import{C as Ee,a as Le}from"./copy-n2FB0_Sw.js";import{g as Pe}from"./scenarioStatus-B_8jpV3e.js";function $e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:N,onSaveCustomSize:w,onRemoveCustomSize:d,className:k=""}){const[h,x]=i.useState(!1),[g,b]=i.useState(String(n)),[m,j]=i.useState(String(o)),[C,u]=i.useState(!1),[l,R]=i.useState(!1),P=i.useRef(null);i.useEffect(()=>{C||b(String(n))},[n,C]),i.useEffect(()=>{l||j(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{P.current&&!P.current.contains(f.target)&&x(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const $=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=$==="Custom",S=r=>{N(r.width,r.height),x(!1)},W=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(c,o)},U=r=>{const f=r.target.value;j(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(n,c)},A=()=>{u(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&b(String(n))},K=()=>{R(!1);const r=parseInt(m,10);(isNaN(r)||r<=0)&&j(String(o))},D=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:P,children:[e.jsxs("button",{onClick:()=>x(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:$}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>S(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>S(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),d&&e.jsx("button",{onClick:f=>{f.stopPropagation(),$===r.name&&s.length>0&&N(s[0].width,s[0].height),d(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:g,onChange:W,onFocus:()=>u(!0),onBlur:A,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:m,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),O&&e.jsx("button",{onClick:w,className:"px-3 py-1.5 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors",children:"Save Custom Size"})]})}function de({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function _e({scenario:s,analysis:t,entity:n}){var w,d,k;const o=((w=s.metadata)==null?void 0:w.executionResult)||null,v=((k=(d=s.metadata)==null?void 0:d.data)==null?void 0:k.argumentsData)||[],N=h=>{var j,C,u;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const x=[],g=((j=h.sideEffects)==null?void 0:j.consoleOutput)||[];g.length>0&&(x.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{x.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const b=((C=h.sideEffects)==null?void 0:C.fileWrites)||[];b.length>0&&(x.push(`
2
2
  File System Operations: ${b.length} ${b.length===1?"operation":"operations"} detected`),b.forEach(l=>{x.push(` ${l.operation}: ${l.path}${l.size?` (${l.size} bytes)`:""}`)}));const m=((u=h.sideEffects)==null?void 0:u.apiCalls)||[];return m.length>0&&(x.push(`
3
3
  API Calls: ${m.length} ${m.length===1?"call":"calls"} made`),m.forEach(l=>{x.push(` ${l.method} ${l.url}${l.status?` → ${l.status}`:""}${l.duration?` (${l.duration}ms)`:""}`)})),h.error&&x.push(`
4
4
  Error: ${h.error.name||"Error"}: ${h.error.message}`),x.length===0?"No side effects detected. The function executed without console output, file operations, or API calls.":x.join(`
5
- `)};return e.jsxs("div",{className:"flex w-full h-full gap-0",children:[e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Input Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:JSON.stringify(v,null,2)})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Returned Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:o?e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:o.returnValue!==void 0?JSON.stringify(o.returnValue,null,2):"undefined"}):e.jsx("div",{className:"text-sm text-gray-500 italic",children:"No execution results yet"})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Side Effects"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-4",children:e.jsx("p",{className:"text-sm text-gray-700 leading-[22px] m-0 whitespace-pre-wrap",children:N(o)})})]})]})}const F={commandBoxBg:"#f6f9fc",commandBoxBorder:"#e1e1e1",commandBoxText:"#005c75",heading:"#000",subtext:"#646464",link:"#005c75"};function T({scenarioId:s,analysisId:t}){const[n,o]=i.useState(!1),[v,N]=i.useState(!1),[w,d]=i.useState(null),[k,h]=i.useState(!1),x=s||t;if(!x)return null;const g=`/codeyam-diagnose ${x}`,b=async()=>{N(!0);try{const{default:j}=await ye(async()=>{const{default:l}=await import("./html2canvas-pro.esm-fmIEn3Bc.js");return{default:l}},[]),u=(await j(document.body,{scale:.5})).toDataURL("image/jpeg",.8);d(u),o(!0)}catch(j){console.error("Screenshot capture failed:",j),o(!0)}finally{N(!1)}},m=()=>{o(!1),d(null)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center p-6 bg-cywhite-100 rounded-lg border-cygray-30 border",children:[e.jsx("h3",{className:"font-semibold font-['IBM_Plex_Sans']",style:{fontSize:"18px",lineHeight:"26px",color:F.heading},children:"Claude can help debug this error."}),e.jsx("p",{className:"m-0 mb-4 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"18px",color:F.subtext},children:"Simply run this command in Claude Code:"}),e.jsxs("div",{className:"flex items-center justify-between rounded mx-auto mb-3 border",style:{backgroundColor:F.commandBoxBg,borderColor:F.commandBoxBorder,maxWidth:"505px",height:"35px",paddingLeft:"13px",paddingRight:"13px",paddingTop:"6px",paddingBottom:"6px"},children:[e.jsx("code",{className:"font-mono font-['IBM_Plex_Mono'] flex-1 text-left",style:{fontSize:"12px",lineHeight:"20px",color:F.commandBoxText},children:g}),e.jsx("button",{onClick:j=>{j.stopPropagation(),navigator.clipboard.writeText(g),h(!0),setTimeout(()=>h(!1),2e3)},className:"ml-3 cursor-pointer p-0 bg-transparent border-none hover:opacity-80 transition-opacity",style:{width:"14px",height:"14px",color:k?"#22c55e":F.commandBoxText},title:k?"Copied!":"Copy command","aria-label":"Copy command to clipboard",children:k?e.jsx(Ee,{size:14}):e.jsx(Le,{size:14})})]}),e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:"#005c75"},children:["If Claude is unable to address this issue or suggests reporting it,"," ",e.jsx("button",{onClick:()=>void b(),disabled:v,className:"underline cursor-pointer bg-transparent border-none p-0 font-normal hover:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:F.link},children:v?"capturing...":"please do so here"}),"."]})]}),e.jsx(Ie,{isOpen:n,onClose:m,context:{source:s?"scenario-page":"entity-page",entitySha:void 0,scenarioId:s,analysisId:t,currentUrl:typeof window<"u"?window.location.pathname:"/"},screenshotDataUrl:w??void 0})]})}const ce=1440,H=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],E={background:"#ffdcd9",border:"#fda4a4",text:"#ef4444",link:"#991b1b"};function Oe({selectedScenario:s,analysis:t,entity:n,viewMode:o,cacheBuster:v,hasScenarios:N,isAnalyzing:w=!1,projectSlug:d,hasAnApiKey:k=!0,processIsRunning:h,queueState:x}){var Q,X,Z,ee,te,se,re,ne,oe,ae,le;const g=ge(),[b,m]=i.useState(!1),[j,C]=i.useState(!1),[u,l]=i.useState({name:"Desktop",width:ce,height:900}),[R,P]=i.useState(ce),[$,O]=i.useState(1),{customSizes:S,addCustomSize:W,removeCustomSize:U}=je(d),A=i.useMemo(()=>[...H,...S],[S]),K=(a,I)=>{P(a);const y=A.find(p=>p.width===a&&p.height===I);l({name:(y==null?void 0:y.name)||"Custom",width:a,height:I})},D=a=>{P(a.width),l({name:a.name,width:a.width,height:a.height})},r=a=>{W(a,u.width,u.height??900),C(!1),l(I=>({...I,name:a}))},f=(a,I)=>{P(a);const y=A.find(p=>p.width===a&&p.height===I);l(p=>({name:(y==null?void 0:y.name)||"Custom",width:a,height:p.height}))},c=(X=(Q=s==null?void 0:s.metadata)==null?void 0:Q.screenshotPaths)==null?void 0:X[0],M=i.useMemo(()=>s?Pe(s,t==null?void 0:t.status,h,n==null?void 0:n.sha,x):null,[s,t==null?void 0:t.status,h,n==null?void 0:n.sha,x]),L=i.useMemo(()=>{var I,y;const a=[];if((I=t==null?void 0:t.status)!=null&&I.errors&&t.status.errors.length>0)for(const p of t.status.errors)a.push({source:`${p.phase} phase`,message:p.message,stack:p.stack});if((y=t==null?void 0:t.status)!=null&&y.steps)for(const p of t.status.steps)p.error&&a.push({source:p.name,message:p.error,stack:p.errorStack});return a},[(Z=t==null?void 0:t.status)==null?void 0:Z.errors,(ee=t==null?void 0:t.status)==null?void 0:ee.steps]),_=(M==null?void 0:M.errorMessage)||null,Y=(M==null?void 0:M.errorStack)||null,{interactiveServerUrl:q,isStarting:G,isLoading:xe,showIframe:me,iframeKey:he,onIframeLoad:ue}=Ce({analysisId:t==null?void 0:t.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:d,enabled:o==="interactive"}),V=i.useMemo(()=>q||null,[q]),z=!w&&N&&s&&!((se=(te=s.metadata)==null?void 0:te.screenshotPaths)!=null&&se[0])&&((ne=(re=t==null?void 0:t.status)==null?void 0:re.scenarios)==null?void 0:ne.some(a=>a.name===s.name&&a.screenshotStartedAt&&!a.screenshotFinishedAt)),{lastLine:B}=ke(d,w||o==="interactive"||z||!1);if(!s){if(w&&n)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-12 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 mb-2",children:e.jsx("svg",{className:"animate-spin",viewBox:"0 0 50 50",children:e.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"#005c75",strokeWidth:"4",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})}),e.jsx("h2",{className:"text-2xl font-semibold text-[#005c75] leading-[30px] m-0 font-['IBM_Plex_Sans']",children:z?"Capturing screenshots...":"Analyzing..."}),e.jsx("p",{className:"text-xs text-[#8e8e8e] text-center leading-5 m-0 font-['IBM_Plex_Mono']",children:"This may take a few minutes."}),B&&e.jsx("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 max-w-xl",children:B}),d&&e.jsx("button",{onClick:()=>m(!0),className:"w-[148px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-sm text-xs font-medium cursor-pointer transition-colors hover:bg-[#004a5c] font-['IBM_Plex_Sans']",children:"View full logs"})]})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)})]});if(!N&&n&&!w){if(L.length>0){const a=L.length===1?((oe=L[0])==null?void 0:oe.message)||"An error occurred during analysis.":`${L.length} errors occurred during analysis.`;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center px-5",style:{minHeight:"75vh"},children:e.jsxs("div",{className:"w-full flex flex-col gap-4",style:{maxWidth:"600px"},children:[e.jsx("div",{className:"p-4 rounded",style:{backgroundColor:E.background,border:`2px solid ${E.border}`},role:"alert",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{size:24,className:"shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"20px",color:E.text},children:[e.jsx("span",{className:"font-semibold",children:"Analysis Error."})," ",a," ",e.jsx("button",{onClick:()=>m(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:E.link},children:"See logs"})," ","for details."]})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{analysisId:t==null?void 0:t.id})})]})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)})]})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"max-w-[600px]",children:[e.jsx("h2",{className:"text-[28px] font-semibold text-[#343434] mb-4 m-0 leading-10",children:"No simulations yet"}),e.jsx("p",{className:"text-base font-normal text-[#3e3e3e] mb-8 leading-6 m-0",children:"Analyze the code to create simulations and create test scenarios automatically."}),n.filePath&&e.jsx("button",{onClick:()=>{g.submit({entitySha:n.sha,filePath:n.filePath},{method:"post",action:"/api/analyze"})},disabled:g.state!=="idle",className:"h-[54px] w-[183px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-lg text-base font-medium cursor-pointer transition-all hover:bg-[#004a5e] disabled:bg-gray-400 disabled:cursor-not-allowed",children:g.state!=="idle"?"Analyzing...":"Analyze"})]})})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:e.jsx("p",{className:"text-base text-gray-500 m-0",children:"Select a scenario to view its screenshot"})})}const fe=o==="screenshot"&&(c||_)||o==="interactive"&&(V||G)||o==="data",pe=(w||z&&!c)&&!_&&o==="screenshot";return e.jsxs(e.Fragment,{children:[e.jsx("main",{className:"flex-1 overflow-auto flex flex-col min-w-0",style:{backgroundImage:`
5
+ `)};return e.jsxs("div",{className:"flex w-full h-full gap-0",children:[e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Input Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:JSON.stringify(v,null,2)})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Returned Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:o?e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:o.returnValue!==void 0?JSON.stringify(o.returnValue,null,2):"undefined"}):e.jsx("div",{className:"text-sm text-gray-500 italic",children:"No execution results yet"})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Side Effects"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-4",children:e.jsx("p",{className:"text-sm text-gray-700 leading-[22px] m-0 whitespace-pre-wrap",children:N(o)})})]})]})}const F={commandBoxBg:"#f6f9fc",commandBoxBorder:"#e1e1e1",commandBoxText:"#005c75",heading:"#000",subtext:"#646464",link:"#005c75"};function T({scenarioId:s,analysisId:t}){const[n,o]=i.useState(!1),[v,N]=i.useState(!1),[w,d]=i.useState(null),[k,h]=i.useState(!1),x=s||t;if(!x)return null;const g=`/codeyam-diagnose ${x}`,b=async()=>{N(!0);try{const{default:j}=await ye(async()=>{const{default:l}=await import("./html2canvas-pro.esm-fmIEn3Bc.js");return{default:l}},[]),u=(await j(document.body,{scale:.5})).toDataURL("image/jpeg",.8);d(u),o(!0)}catch(j){console.error("Screenshot capture failed:",j),o(!0)}finally{N(!1)}},m=()=>{o(!1),d(null)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center p-6 bg-cywhite-100 rounded-lg border-cygray-30 border",children:[e.jsx("h3",{className:"font-semibold font-['IBM_Plex_Sans']",style:{fontSize:"18px",lineHeight:"26px",color:F.heading},children:"Claude can help debug this error."}),e.jsx("p",{className:"m-0 mb-4 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"18px",color:F.subtext},children:"Simply run this command in Claude Code:"}),e.jsxs("div",{className:"flex items-center justify-between rounded mx-auto mb-3 border",style:{backgroundColor:F.commandBoxBg,borderColor:F.commandBoxBorder,maxWidth:"505px",height:"35px",paddingLeft:"13px",paddingRight:"13px",paddingTop:"6px",paddingBottom:"6px"},children:[e.jsx("code",{className:"font-mono font-['IBM_Plex_Mono'] flex-1 text-left",style:{fontSize:"12px",lineHeight:"20px",color:F.commandBoxText},children:g}),e.jsx("button",{onClick:j=>{j.stopPropagation(),navigator.clipboard.writeText(g),h(!0),setTimeout(()=>h(!1),2e3)},className:"ml-3 cursor-pointer p-0 bg-transparent border-none hover:opacity-80 transition-opacity",style:{width:"14px",height:"14px",color:k?"#22c55e":F.commandBoxText},title:k?"Copied!":"Copy command","aria-label":"Copy command to clipboard",children:k?e.jsx(Ee,{size:14}):e.jsx(Le,{size:14})})]}),e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:"#005c75"},children:["If Claude is unable to address this issue or suggests reporting it,"," ",e.jsx("button",{onClick:()=>void b(),disabled:v,className:"underline cursor-pointer bg-transparent border-none p-0 font-normal hover:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:F.link},children:v?"capturing...":"please do so here"}),"."]})]}),e.jsx(Ie,{isOpen:n,onClose:m,context:{source:s?"scenario-page":"entity-page",entitySha:void 0,scenarioId:s,analysisId:t,currentUrl:typeof window<"u"?window.location.pathname:"/"},screenshotDataUrl:w??void 0})]})}const ce=1440,H=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],E={background:"#ffdcd9",border:"#fda4a4",text:"#ef4444",link:"#991b1b"};function We({selectedScenario:s,analysis:t,entity:n,viewMode:o,cacheBuster:v,hasScenarios:N,isAnalyzing:w=!1,projectSlug:d,hasAnApiKey:k=!0,processIsRunning:h,queueState:x}){var Q,X,Z,ee,te,se,re,ne,oe,ae,le;const g=ge(),[b,m]=i.useState(!1),[j,C]=i.useState(!1),[u,l]=i.useState({name:"Desktop",width:ce,height:900}),[R,P]=i.useState(ce),[$,O]=i.useState(1),{customSizes:S,addCustomSize:W,removeCustomSize:U}=we(d),A=i.useMemo(()=>[...H,...S],[S]),K=(a,I)=>{P(a);const y=A.find(p=>p.width===a&&p.height===I);l({name:(y==null?void 0:y.name)||"Custom",width:a,height:I})},D=a=>{P(a.width),l({name:a.name,width:a.width,height:a.height})},r=a=>{W(a,u.width,u.height??900),C(!1),l(I=>({...I,name:a}))},f=(a,I)=>{P(a);const y=A.find(p=>p.width===a&&p.height===I);l(p=>({name:(y==null?void 0:y.name)||"Custom",width:a,height:p.height}))},c=(X=(Q=s==null?void 0:s.metadata)==null?void 0:Q.screenshotPaths)==null?void 0:X[0],M=i.useMemo(()=>s?Pe(s,t==null?void 0:t.status,h,n==null?void 0:n.sha,x):null,[s,t==null?void 0:t.status,h,n==null?void 0:n.sha,x]),L=i.useMemo(()=>{var I,y;const a=[];if((I=t==null?void 0:t.status)!=null&&I.errors&&t.status.errors.length>0)for(const p of t.status.errors)a.push({source:`${p.phase} phase`,message:p.message,stack:p.stack});if((y=t==null?void 0:t.status)!=null&&y.steps)for(const p of t.status.steps)p.error&&a.push({source:p.name,message:p.error,stack:p.errorStack});return a},[(Z=t==null?void 0:t.status)==null?void 0:Z.errors,(ee=t==null?void 0:t.status)==null?void 0:ee.steps]),_=(M==null?void 0:M.errorMessage)||null,Y=(M==null?void 0:M.errorStack)||null,{interactiveServerUrl:q,isStarting:G,isLoading:xe,showIframe:me,iframeKey:he,onIframeLoad:ue}=Ce({analysisId:t==null?void 0:t.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:d,enabled:o==="interactive"}),V=i.useMemo(()=>q||null,[q]),z=!w&&N&&s&&!((se=(te=s.metadata)==null?void 0:te.screenshotPaths)!=null&&se[0])&&((ne=(re=t==null?void 0:t.status)==null?void 0:re.scenarios)==null?void 0:ne.some(a=>a.name===s.name&&a.screenshotStartedAt&&!a.screenshotFinishedAt)),{lastLine:B}=ke(d,w||o==="interactive"||z||!1);if(!s){if(w&&n)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-12 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 mb-2",children:e.jsx("svg",{className:"animate-spin",viewBox:"0 0 50 50",children:e.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"#005c75",strokeWidth:"4",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})}),e.jsx("h2",{className:"text-2xl font-semibold text-[#005c75] leading-[30px] m-0 font-['IBM_Plex_Sans']",children:z?"Capturing screenshots...":"Analyzing..."}),e.jsx("p",{className:"text-xs text-[#8e8e8e] text-center leading-5 m-0 font-['IBM_Plex_Mono']",children:"This may take a few minutes."}),B&&e.jsx("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 max-w-xl",children:B}),d&&e.jsx("button",{onClick:()=>m(!0),className:"w-[148px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-sm text-xs font-medium cursor-pointer transition-colors hover:bg-[#004a5c] font-['IBM_Plex_Sans']",children:"View full logs"})]})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)})]});if(!N&&n&&!w){if(L.length>0){const a=L.length===1?((oe=L[0])==null?void 0:oe.message)||"An error occurred during analysis.":`${L.length} errors occurred during analysis.`;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center px-5",style:{minHeight:"75vh"},children:e.jsxs("div",{className:"w-full flex flex-col gap-4",style:{maxWidth:"600px"},children:[e.jsx("div",{className:"p-4 rounded",style:{backgroundColor:E.background,border:`2px solid ${E.border}`},role:"alert",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{size:24,className:"shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"20px",color:E.text},children:[e.jsx("span",{className:"font-semibold",children:"Analysis Error."})," ",a," ",e.jsx("button",{onClick:()=>m(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:E.link},children:"See logs"})," ","for details."]})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{analysisId:t==null?void 0:t.id})})]})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)})]})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"max-w-[600px]",children:[e.jsx("h2",{className:"text-[28px] font-semibold text-[#343434] mb-4 m-0 leading-10",children:"No simulations yet"}),e.jsx("p",{className:"text-base font-normal text-[#3e3e3e] mb-8 leading-6 m-0",children:"Analyze the code to create simulations and create test scenarios automatically."}),n.filePath&&e.jsx("button",{onClick:()=>{g.submit({entitySha:n.sha,filePath:n.filePath},{method:"post",action:"/api/analyze"})},disabled:g.state!=="idle",className:"h-[54px] w-[183px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-lg text-base font-medium cursor-pointer transition-all hover:bg-[#004a5e] disabled:bg-gray-400 disabled:cursor-not-allowed",children:g.state!=="idle"?"Analyzing...":"Analyze"})]})})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:e.jsx("p",{className:"text-base text-gray-500 m-0",children:"Select a scenario to view its screenshot"})})}const fe=o==="screenshot"&&(c||_)||o==="interactive"&&(V||G)||o==="data",pe=(w||z&&!c)&&!_&&o==="screenshot";return e.jsxs(e.Fragment,{children:[e.jsx("main",{className:"flex-1 overflow-auto flex flex-col min-w-0",style:{backgroundImage:`
6
6
  linear-gradient(45deg, #ebebeb 25%, transparent 25%),
7
7
  linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
8
8
  linear-gradient(45deg, transparent 75%, #ebebeb 75%),
9
9
  linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
10
- `,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:pe?e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center bg-linear-to-br from-blue-50 to-indigo-50",children:e.jsxs("div",{className:"max-w-2xl w-full bg-white rounded-t-2xl shadow-xl p-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-24 h-24 bg-blue-100 rounded-full mb-6",children:e.jsx("span",{className:"text-5xl animate-spin",children:"⚙️"})}),e.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4 m-0",children:z?`Capturing ${n==null?void 0:n.name}`:`Analyzing ${n==null?void 0:n.name}`}),e.jsx("p",{className:"text-base text-gray-600 leading-relaxed m-0 mb-2",children:z?`Taking screenshots for ${((ae=t==null?void 0:t.scenarios)==null?void 0:ae.length)||0} scenario${((le=t==null?void 0:t.scenarios)==null?void 0:le.length)!==1?"s":""}...`:`Generating simulations and scenarios for this ${n==null?void 0:n.entityType} entity...`}),s&&e.jsxs("p",{className:"text-sm text-blue-600 font-semibold m-0",children:["Currently processing: ",s.name]})]}),B&&e.jsx("div",{className:"bg-[#f6f9fc] border-2 border-[#e1e1e1] rounded-lg p-6 mb-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"text-xl shrink-0",children:"📝"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide mb-2 m-0",children:"Current Progress"}),e.jsx("p",{className:"text-sm text-gray-900 font-mono wrap-break-word m-0",title:B,children:B})]})]})}),d&&e.jsx("button",{onClick:()=>m(!0),className:"px-6 py-3 bg-[#005c75] text-white border-none rounded-lg text-base font-semibold cursor-pointer transition-all hover:bg-[#004a5e] hover:shadow-lg",children:"📋 View Full Logs"}),e.jsx("p",{className:"text-xs text-gray-500 mt-8 m-0",children:"Screenshots will appear here as they are captured. This may take a few minutes."})]})}):fe?e.jsxs(e.Fragment,{children:[_&&!c&&e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center p-6",children:e.jsxs("div",{className:"w-full flex flex-col gap-4",style:{maxWidth:"600px"},children:[e.jsx("div",{className:"p-4 rounded overflow-auto",style:{backgroundColor:E.background,border:`2px solid ${E.border}`,maxHeight:"50vh"},role:"alert",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 font-bold",style:{color:E.text},children:[e.jsx(de,{size:24,className:"shrink-0"}),e.jsx("div",{children:"Capture Error"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("button",{onClick:()=>m(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:E.link},children:"See logs"})," ","for details."]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"20px",color:E.text},children:_})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})}),o==="interactive"?e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[V&&e.jsxs("div",{className:"bg-gray-50 border-b border-gray-200 px-6 py-3 shrink-0 flex justify-center items-center gap-4",children:[e.jsx($e,{presets:[...H],customSizes:S,currentWidth:u.width,currentHeight:u.height??900,scale:$,onSizeChange:K,onSaveCustomSize:()=>C(!0),onRemoveCustomSize:U}),s&&n&&e.jsxs(ie,{to:`/entity/${n.sha}/scenarios/${s.id}/fullscreen?from=${encodeURIComponent(`/entity/${n.sha}/scenarios/${s.id}/interactive`)}`,className:"flex items-center gap-2 px-4 py-2 bg-[#005c75] text-white rounded hover:bg-[#004a5c] transition-colors text-sm font-medium no-underline",title:"Open in fullscreen",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M2 5V2H5M11 2H14V5M14 11V14H11M5 14H2V11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),"Fullscreen"]})]}),V&&e.jsx("div",{className:"bg-[#005c75] border-b border-[rgba(0,0,0,0.2)] flex justify-center",children:e.jsx("div",{style:{maxWidth:`${H[H.length-1].width}px`,width:"100%"},children:e.jsx(we,{currentViewportWidth:R,currentPresetName:u.name,onDevicePresetClick:D,devicePresets:A})})}),e.jsx(be,{scenarioId:s.id,scenarioName:s.name,iframeUrl:V,isStarting:G,isLoading:xe,showIframe:me,iframeKey:he,onIframeLoad:ue,onScaleChange:O,onDimensionChange:f,projectSlug:d,defaultWidth:u.width,defaultHeight:u.height})]}):o==="data"?e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(_e,{scenario:s,analysis:t,entity:n})}):e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsx("div",{className:"flex-1 p-6 flex items-center justify-center",children:e.jsx("div",{className:"transition-all duration-300",style:{maxWidth:`${R}px`},children:(c||!_)&&e.jsx(ve,{screenshotPath:c,cacheBuster:v,alt:s.name,className:"w-full rounded-lg shadow-[0_10px_25px_rgba(0,0,0,0.1)] bg-white"})})})})]}):e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 overflow-auto w-full",children:w&&!c?e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("div",{className:"bg-blue-50 border-2 border-blue-200 rounded-lg p-8",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"animate-spin text-4xl shrink-0",children:"⚙️"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-xl font-semibold text-blue-900 m-0 mb-3",children:"Capturing Screenshot"}),e.jsxs("p",{className:"text-sm text-blue-800 m-0 mb-4",children:["Analysis is in progress for"," ",e.jsx("strong",{children:s.name}),". The screenshot will appear here once capture is complete."]}),B&&e.jsxs("div",{className:"bg-white border border-blue-200 rounded p-4 mt-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-blue-800 m-0 mb-2 uppercase tracking-wide",children:"Current Progress"}),e.jsx("p",{className:"text-sm text-blue-900 m-0 font-mono wrap-break-word",children:B})]}),d&&e.jsx("button",{onClick:()=>m(!0),className:"mt-4 px-4 py-2 bg-[#005c75] text-white border-none rounded-md text-sm font-semibold cursor-pointer transition-colors hover:bg-[#004a5e]",children:"📋 View Full Logs"})]})]})})}):_?e.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center overflow-auto gap-6",children:[!k&&e.jsx("div",{className:"bg-blue-50 border-2 border-blue-300 rounded-lg p-8",children:e.jsxs("div",{className:"flex-1 flex flex-col gap-4 items-center justify-center",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("span",{className:"text-blue-600 text-2xl shrink-0",children:"🔑"}),e.jsx("h3",{className:"text-xl font-semibold text-blue-900 m-0 mb-3",children:"Improve Analysis Quality with an API Key"})]}),e.jsxs("div",{className:"bg-white border border-blue-200 rounded p-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-blue-900 m-0 mb-2 uppercase tracking-wide",children:"CodeYam requires an AI API key for reliable analysis."}),e.jsxs("ul",{className:"text-sm text-blue-800 m-0 space-y-1 pl-5 list-disc",children:[e.jsx("li",{children:"You can use API keys for a variety of models"}),e.jsx("li",{children:"Faster analysis processing"}),e.jsx("li",{children:"Better handling of complex code structures"}),e.jsx("li",{children:"Improved scenario generation quality"})]})]}),e.jsx(ie,{to:"/settings",className:"inline-block px-4 py-2 bg-blue-600 text-white border-none rounded-md text-sm font-semibold cursor-pointer transition-colors hover:bg-blue-700",children:"🔐 Configure API Keys"})]})}),e.jsx("div",{className:"bg-red-50 border-2 border-red-300 rounded-lg p-8 w-full max-w-4xl my-auto",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"text-red-500 text-4xl shrink-0",children:"⚠️"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-xl font-semibold text-red-800 m-0 mb-3",children:"Capture Failed"}),e.jsx("p",{className:"text-sm text-red-700 m-0 mb-4",children:"An error occurred while capturing this scenario. No screenshot is available."}),e.jsxs("div",{className:"bg-white border border-red-200 rounded p-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-red-800 m-0 mb-2 uppercase tracking-wide",children:"Error Message"}),e.jsx("div",{className:"max-h-[300px] overflow-auto",children:e.jsx("p",{className:"text-sm text-red-900 m-0 font-mono whitespace-pre-wrap wrap-break-word",children:_})})]}),Y&&e.jsxs("details",{className:"mt-4",children:[e.jsx("summary",{className:"text-sm text-red-700 cursor-pointer hover:text-red-900 font-semibold",children:"📋 View full stack trace"}),e.jsx("div",{className:"mt-3 bg-white border border-red-200 rounded p-4 overflow-auto",children:e.jsx("pre",{className:"text-xs text-red-900 font-mono whitespace-pre-wrap wrap-break-word m-0",children:Y})})]}),e.jsx("div",{className:"mt-4 bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})]})})]}):L.length>0?e.jsx("div",{className:"w-full h-full flex items-center justify-center overflow-auto",children:e.jsx("div",{className:"bg-red-50 border-2 border-red-300 rounded-lg p-8 w-full max-w-4xl my-auto",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"text-red-500 text-4xl shrink-0",children:"⚠️"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(AnalysisErrorDisplay,{errors:L,title:"Analysis Error",description:L.length===1?"An error occurred during analysis. Screenshot capture was not completed.":`${L.length} errors occurred during analysis. Screenshot capture was not completed.`}),e.jsx("div",{className:"mt-4 bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})]})})}):e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("span",{className:"text-6xl text-gray-300",children:"📷"}),e.jsx("p",{className:"text-lg text-gray-500 m-0",children:"No screenshot available for this scenario"}),e.jsx("p",{className:"text-sm text-gray-400 m-0",children:"Try recapturing or debugging this scenario"})]})})})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)}),j&&e.jsx(Ne,{width:u.width,height:u.height??900,onSave:r,onCancel:()=>C(!1)})]})}export{de as E,Oe as S};
10
+ `,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:pe?e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center bg-linear-to-br from-blue-50 to-indigo-50",children:e.jsxs("div",{className:"max-w-2xl w-full bg-white rounded-t-2xl shadow-xl p-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-24 h-24 bg-blue-100 rounded-full mb-6",children:e.jsx("span",{className:"text-5xl animate-spin",children:"⚙️"})}),e.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4 m-0",children:z?`Capturing ${n==null?void 0:n.name}`:`Analyzing ${n==null?void 0:n.name}`}),e.jsx("p",{className:"text-base text-gray-600 leading-relaxed m-0 mb-2",children:z?`Taking screenshots for ${((ae=t==null?void 0:t.scenarios)==null?void 0:ae.length)||0} scenario${((le=t==null?void 0:t.scenarios)==null?void 0:le.length)!==1?"s":""}...`:`Generating simulations and scenarios for this ${n==null?void 0:n.entityType} entity...`}),s&&e.jsxs("p",{className:"text-sm text-blue-600 font-semibold m-0",children:["Currently processing: ",s.name]})]}),B&&e.jsx("div",{className:"bg-[#f6f9fc] border-2 border-[#e1e1e1] rounded-lg p-6 mb-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"text-xl shrink-0",children:"📝"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide mb-2 m-0",children:"Current Progress"}),e.jsx("p",{className:"text-sm text-gray-900 font-mono wrap-break-word m-0",title:B,children:B})]})]})}),d&&e.jsx("button",{onClick:()=>m(!0),className:"px-6 py-3 bg-[#005c75] text-white border-none rounded-lg text-base font-semibold cursor-pointer transition-all hover:bg-[#004a5e] hover:shadow-lg",children:"📋 View Full Logs"}),e.jsx("p",{className:"text-xs text-gray-500 mt-8 m-0",children:"Screenshots will appear here as they are captured. This may take a few minutes."})]})}):fe?e.jsxs(e.Fragment,{children:[_&&!c&&e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center p-6",children:e.jsxs("div",{className:"w-full flex flex-col gap-4",style:{maxWidth:"600px"},children:[e.jsx("div",{className:"p-4 rounded overflow-auto",style:{backgroundColor:E.background,border:`2px solid ${E.border}`,maxHeight:"50vh"},role:"alert",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 font-bold",style:{color:E.text},children:[e.jsx(de,{size:24,className:"shrink-0"}),e.jsx("div",{children:"Capture Error"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("button",{onClick:()=>m(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:E.link},children:"See logs"})," ","for details."]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"20px",color:E.text},children:_})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})}),o==="interactive"?e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[V&&e.jsxs("div",{className:"bg-gray-50 border-b border-gray-200 px-6 py-3 shrink-0 flex justify-center items-center gap-4",children:[e.jsx($e,{presets:[...H],customSizes:S,currentWidth:u.width,currentHeight:u.height??900,scale:$,onSizeChange:K,onSaveCustomSize:()=>C(!0),onRemoveCustomSize:U}),s&&n&&e.jsxs(ie,{to:`/entity/${n.sha}/scenarios/${s.id}/fullscreen?from=${encodeURIComponent(`/entity/${n.sha}/scenarios/${s.id}/interactive`)}`,className:"flex items-center gap-2 px-4 py-2 bg-[#005c75] text-white rounded hover:bg-[#004a5c] transition-colors text-sm font-medium no-underline",title:"Open in fullscreen",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M2 5V2H5M11 2H14V5M14 11V14H11M5 14H2V11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),"Fullscreen"]})]}),V&&e.jsx("div",{className:"bg-[#005c75] border-b border-[rgba(0,0,0,0.2)] flex justify-center",children:e.jsx("div",{style:{maxWidth:`${H[H.length-1].width}px`,width:"100%"},children:e.jsx(je,{currentViewportWidth:R,currentPresetName:u.name,onDevicePresetClick:D,devicePresets:A})})}),e.jsx(be,{scenarioId:s.id,scenarioName:s.name,iframeUrl:V,isStarting:G,isLoading:xe,showIframe:me,iframeKey:he,onIframeLoad:ue,onScaleChange:O,onDimensionChange:f,projectSlug:d,defaultWidth:u.width,defaultHeight:u.height})]}):o==="data"?e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(_e,{scenario:s,analysis:t,entity:n})}):e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsx("div",{className:"flex-1 p-6 flex items-center justify-center",children:e.jsx("div",{className:"transition-all duration-300",style:{maxWidth:`${R}px`},children:(c||!_)&&e.jsx(ve,{screenshotPath:c,cacheBuster:v,alt:s.name,className:"w-full rounded-lg shadow-[0_10px_25px_rgba(0,0,0,0.1)] bg-white"})})})})]}):e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 overflow-auto w-full",children:w&&!c?e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("div",{className:"bg-blue-50 border-2 border-blue-200 rounded-lg p-8",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"animate-spin text-4xl shrink-0",children:"⚙️"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-xl font-semibold text-blue-900 m-0 mb-3",children:"Capturing Screenshot"}),e.jsxs("p",{className:"text-sm text-blue-800 m-0 mb-4",children:["Analysis is in progress for"," ",e.jsx("strong",{children:s.name}),". The screenshot will appear here once capture is complete."]}),B&&e.jsxs("div",{className:"bg-white border border-blue-200 rounded p-4 mt-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-blue-800 m-0 mb-2 uppercase tracking-wide",children:"Current Progress"}),e.jsx("p",{className:"text-sm text-blue-900 m-0 font-mono wrap-break-word",children:B})]}),d&&e.jsx("button",{onClick:()=>m(!0),className:"mt-4 px-4 py-2 bg-[#005c75] text-white border-none rounded-md text-sm font-semibold cursor-pointer transition-colors hover:bg-[#004a5e]",children:"📋 View Full Logs"})]})]})})}):_?e.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center overflow-auto gap-6",children:[!k&&e.jsx("div",{className:"bg-blue-50 border-2 border-blue-300 rounded-lg p-8",children:e.jsxs("div",{className:"flex-1 flex flex-col gap-4 items-center justify-center",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("span",{className:"text-blue-600 text-2xl shrink-0",children:"🔑"}),e.jsx("h3",{className:"text-xl font-semibold text-blue-900 m-0 mb-3",children:"Improve Analysis Quality with an API Key"})]}),e.jsxs("div",{className:"bg-white border border-blue-200 rounded p-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-blue-900 m-0 mb-2 uppercase tracking-wide",children:"CodeYam requires an AI API key for reliable analysis."}),e.jsxs("ul",{className:"text-sm text-blue-800 m-0 space-y-1 pl-5 list-disc",children:[e.jsx("li",{children:"You can use API keys for a variety of models"}),e.jsx("li",{children:"Faster analysis processing"}),e.jsx("li",{children:"Better handling of complex code structures"}),e.jsx("li",{children:"Improved scenario generation quality"})]})]}),e.jsx(ie,{to:"/settings",className:"inline-block px-4 py-2 bg-blue-600 text-white border-none rounded-md text-sm font-semibold cursor-pointer transition-colors hover:bg-blue-700",children:"🔐 Configure API Keys"})]})}),e.jsx("div",{className:"bg-red-50 border-2 border-red-300 rounded-lg p-8 w-full max-w-4xl my-auto",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"text-red-500 text-4xl shrink-0",children:"⚠️"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-xl font-semibold text-red-800 m-0 mb-3",children:"Capture Failed"}),e.jsx("p",{className:"text-sm text-red-700 m-0 mb-4",children:"An error occurred while capturing this scenario. No screenshot is available."}),e.jsxs("div",{className:"bg-white border border-red-200 rounded p-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-red-800 m-0 mb-2 uppercase tracking-wide",children:"Error Message"}),e.jsx("div",{className:"max-h-[300px] overflow-auto",children:e.jsx("p",{className:"text-sm text-red-900 m-0 font-mono whitespace-pre-wrap wrap-break-word",children:_})})]}),Y&&e.jsxs("details",{className:"mt-4",children:[e.jsx("summary",{className:"text-sm text-red-700 cursor-pointer hover:text-red-900 font-semibold",children:"📋 View full stack trace"}),e.jsx("div",{className:"mt-3 bg-white border border-red-200 rounded p-4 overflow-auto",children:e.jsx("pre",{className:"text-xs text-red-900 font-mono whitespace-pre-wrap wrap-break-word m-0",children:Y})})]}),e.jsx("div",{className:"mt-4 bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})]})})]}):L.length>0?e.jsx("div",{className:"w-full h-full flex items-center justify-center overflow-auto",children:e.jsx("div",{className:"bg-red-50 border-2 border-red-300 rounded-lg p-8 w-full max-w-4xl my-auto",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"text-red-500 text-4xl shrink-0",children:"⚠️"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(AnalysisErrorDisplay,{errors:L,title:"Analysis Error",description:L.length===1?"An error occurred during analysis. Screenshot capture was not completed.":`${L.length} errors occurred during analysis. Screenshot capture was not completed.`}),e.jsx("div",{className:"mt-4 bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})]})})}):e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("span",{className:"text-6xl text-gray-300",children:"📷"}),e.jsx("p",{className:"text-lg text-gray-500 m-0",children:"No screenshot available for this scenario"}),e.jsx("p",{className:"text-sm text-gray-400 m-0",children:"Try recapturing or debugging this scenario"})]})})})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)}),j&&e.jsx(Ne,{width:u.width,height:u.height??900,onSave:r,onCancel:()=>C(!1)})]})}export{de as E,We as S};
@@ -0,0 +1 @@
1
+ import{r as u,j as n}from"./chunk-JZWAC4HX-C4pqxYJB.js";const g=10,W=1024;function G({currentViewportWidth:m,currentPresetName:P,onDevicePresetClick:w,devicePresets:p,onHoverChange:c,hideLabel:E=!1,lightMode:d=!1}){const[l,v]=u.useState(null),x=u.useRef(null),j=u.useMemo(()=>[...p].sort((t,s)=>t.width-s.width),[p]),{fittingPresets:o,overflowPresets:i}=u.useMemo(()=>{const t=[],s=[];for(const e of j)e.width<=W?t.push(e):s.push(e);return s.sort((e,r)=>r.width-e.width),{fittingPresets:t,overflowPresets:s}},[j]),b=u.useCallback(t=>{if(!x.current)return null;const s=x.current.getBoundingClientRect(),e=t-s.left,r=s.width,h=r/2,y=(o.length>0?o[o.length-1].width:0)/2,S=h-y,X=h+y,$=i.length>0?(i.length-1)*g:0;if(i.length>0){if(e<S){if(e<=$){const a=Math.min(Math.floor(e/g),i.length-1);return i[a]}return i[i.length-1]}if(e>X){const a=r-e;if(a<=$){const f=Math.min(Math.floor(a/g),i.length-1);return i[f]}return i[i.length-1]}}const k=Math.abs(e-h);for(let a=o.length-1;a>=0;a--){const f=o[a],F=o[a-1],B=f.width/2,T=F?F.width/2:0;if(k<=B&&k>=T)return f}return o[0]||i[i.length-1]||null},[o,i]),I=u.useCallback(t=>{const s=b(t.clientX);v(s),c==null||c(s)},[b,c]),M=u.useCallback(()=>{v(null),c==null||c(null)},[c]),R=u.useCallback(t=>{const s=b(t.clientX);s&&w(s)},[b,w]),N=l||{name:P,width:m};return n.jsxs("div",{ref:x,className:"relative h-6 shrink-0 overflow-hidden cursor-pointer",onMouseMove:I,onMouseLeave:M,onClick:R,children:[l&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:n.jsx("div",{className:"h-full transition-all duration-100 bg-[#005C75]",style:{width:`${l.width}px`}})}),n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(t=>{const s=t.width===m,e=(l==null?void 0:l.name)===t.name,r=t.width/2;return n.jsxs("div",{children:[n.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`calc(50% - ${r}px)`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${s||e?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})}),n.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`calc(50% + ${r}px)`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${s||e?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})})]},t.name)})}),n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:i.map((t,s)=>{const e=s*g,r=t.width===m,h=(l==null?void 0:l.name)===t.name;return n.jsxs("div",{children:[n.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`${e}px`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${r||h?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})}),n.jsx("div",{className:"absolute top-0 bottom-0",style:{right:`${e}px`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${r||h?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})})]},t.name)})}),!E&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:n.jsxs("div",{className:`text-[10px] px-2 py-0.5 rounded shadow-sm whitespace-nowrap transition-colors ${l?"bg-[#005c75] text-white":"bg-white/90 text-[#005c75] border border-[rgba(0,92,117,0.25)]"}`,children:[N.name," - ",N.width,"px"]})})]})}export{G as V};
@@ -1,10 +1,10 @@
1
- import{r as u,j as e,L as p,w as se,u as te,d as ae,f as re}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as ne}from"./useLastLogLine-C14nCb1q.js";import{u as le}from"./useToast-9FIWuYfK.js";import{u as oe}from"./useReportContext-O-jkvSPx.js";import{L as ie}from"./LogViewer-ceAyBX-H.js";import{I as E,C as P,E as ce}from"./EntityTypeIcon-CobE682z.js";import{S as Y}from"./SafeScreenshot-BED4B6sP.js";import{g as de}from"./scenarioStatus-B_8jpV3e.js";import{c as q}from"./createLucideIcon-CMT1jU2q.js";import{C as xe}from"./circle-check-DyIKORY6.js";import{L as S}from"./loader-circle-BAXYRVEO.js";/**
2
- * @license lucide-react v0.556.0 - ISC
1
+ import{r as u,j as e,L as p,w as se,u as te,d as ae,f as re}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as ne}from"./useLastLogLine-C14nCb1q.js";import{u as le}from"./useToast-9FIWuYfK.js";import{u as oe}from"./useReportContext-O-jkvSPx.js";import{L as ie}from"./LogViewer-ceAyBX-H.js";import{I as E,C as P,E as ce}from"./EntityTypeIcon-CQIG2qda.js";import{S as Y}from"./SafeScreenshot-BED4B6sP.js";import{g as de}from"./scenarioStatus-B_8jpV3e.js";import{c as q}from"./createLucideIcon-CC6AbExI.js";import{C as xe}from"./circle-check-BVMi9VA5.js";import{L as S}from"./loader-circle-DaAZ_H2w.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
6
  */const me=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],he=q("folder-open",me);/**
7
- * @license lucide-react v0.556.0 - ISC
7
+ * @license lucide-react v0.577.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
@@ -1,20 +1,20 @@
1
- import{j as e,w as se,u as te,k as re,r as f,L as b,f as R}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{L as oe}from"./LogViewer-ceAyBX-H.js";import{u as ie}from"./useLastLogLine-C14nCb1q.js";import{u as le}from"./useReportContext-O-jkvSPx.js";import{E as q}from"./EntityTypeIcon-CobE682z.js";import{E as ee}from"./EntityTypeBadge-g3saevPb.js";import{S as Z}from"./SafeScreenshot-BED4B6sP.js";import{L as ae}from"./LoadingDots-BU_OAEMP.js";import{L as ne}from"./loader-circle-BAXYRVEO.js";import{P as ce,F as de}from"./pause-DTAcYxBt.js";import{c as X}from"./createLucideIcon-CMT1jU2q.js";/**
2
- * @license lucide-react v0.556.0 - ISC
1
+ import{j as e,w as se,u as te,k as re,r as f,L as b,f as R}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{L as oe}from"./LogViewer-ceAyBX-H.js";import{u as ie}from"./useLastLogLine-C14nCb1q.js";import{u as le}from"./useReportContext-O-jkvSPx.js";import{E as q}from"./EntityTypeIcon-CQIG2qda.js";import{E as ee}from"./EntityTypeBadge-g3saevPb.js";import{S as Z}from"./SafeScreenshot-BED4B6sP.js";import{L as ae}from"./LoadingDots-BU_OAEMP.js";import{L as ne}from"./loader-circle-DaAZ_H2w.js";import{P as ce,F as de}from"./pause-f5-1lKBt.js";import{c as X}from"./createLucideIcon-CC6AbExI.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const he=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],xe=X("ban",he);/**
7
- * @license lucide-react v0.556.0 - ISC
6
+ */const he=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],xe=X("ban",he);/**
7
+ * @license lucide-react v0.577.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
11
  */const pe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],fe=X("circle-pause",pe);/**
12
- * @license lucide-react v0.556.0 - ISC
12
+ * @license lucide-react v0.577.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
16
  */const ge=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],me=X("grip-vertical",ge);/**
17
- * @license lucide-react v0.556.0 - ISC
17
+ * @license lucide-react v0.577.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
@@ -0,0 +1 @@
1
+ function De(se,ge){for(var te=0;te<ge.length;te++){const J=ge[te];if(typeof J!="string"&&!Array.isArray(J)){for(const N in J)if(N!=="default"&&!(N in se)){const ie=Object.getOwnPropertyDescriptor(J,N);ie&&Object.defineProperty(se,N,ie.get?ie:{enumerable:!0,get:()=>J[N]})}}}return Object.freeze(Object.defineProperty(se,Symbol.toStringTag,{value:"Module"}))}var Ce={exports:{}},be;function Te(){return be||(be=1,(function(se,ge){(function(te,J){se.exports=J()})(self,(()=>(()=>{var te={903:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseRenderLayer=void 0;const d=h(274),o=h(627),r=h(237),l=h(860),p=h(374),C=h(296),i=h(345),t=h(859),f=h(399),_=h(855);class n extends t.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var s;return(s=this._charAtlas)==null?void 0:s.pages[0].canvas}constructor(s,c,g,a,x,w,m,L,b,y){super(),this._terminal=s,this._container=c,this._alpha=x,this._themeService=w,this._bufferService=m,this._optionsService=L,this._decorationService=b,this._coreBrowserService=y,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,C.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new t.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new i.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new d.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${g}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((D=>{this._refreshCharAtlas(D),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,t.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,p.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(s,c){}handleSelectionChanged(s,c,g=!1){this._selectionModel.update(this._terminal._core,s,c,g)}_setTransparency(s){if(s===this._alpha)return;const c=this._canvas;this._alpha=s,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,c),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(s){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,o.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,s,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,i.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let c=0;c<this._charAtlas.pages.length;c++)this._bitmapGenerator[c]=new v(this._charAtlas.pages[c].canvas)}}resize(s){this._deviceCellWidth=s.device.cell.width,this._deviceCellHeight=s.device.cell.height,this._deviceCharWidth=s.device.char.width,this._deviceCharHeight=s.device.char.height,this._deviceCharLeft=s.device.char.left,this._deviceCharTop=s.device.char.top,this._canvas.width=s.device.canvas.width,this._canvas.height=s.device.canvas.height,this._canvas.style.width=`${s.css.canvas.width}px`,this._canvas.style.height=`${s.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var s;(s=this._charAtlas)==null||s.clearTexture()}_fillCells(s,c,g,a){this._ctx.fillRect(s*this._deviceCellWidth,c*this._deviceCellHeight,g*this._deviceCellWidth,a*this._deviceCellHeight)}_fillMiddleLineAtCells(s,c,g=1){const a=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(s*this._deviceCellWidth,(c+1)*this._deviceCellHeight-a-this._coreBrowserService.dpr,g*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(s,c,g=1,a=0){this._ctx.fillRect(s*this._deviceCellWidth,(c+1)*this._deviceCellHeight+a-this._coreBrowserService.dpr-1,g*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(s,c,g=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const a=this._coreBrowserService.dpr;this._ctx.lineWidth=a;for(let x=0;x<g;x++){const w=(s+x)*this._deviceCellWidth,m=(s+x+.5)*this._deviceCellWidth,L=(s+x+1)*this._deviceCellWidth,b=(c+1)*this._deviceCellHeight-a-1,y=b-a,D=b+a;this._ctx.moveTo(w,b),this._ctx.bezierCurveTo(w,y,m,y,m,b),this._ctx.bezierCurveTo(m,D,L,D,L,b)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(s,c,g=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const a=this._coreBrowserService.dpr;this._ctx.lineWidth=a,this._ctx.setLineDash([2*a,a]);const x=s*this._deviceCellWidth,w=(c+1)*this._deviceCellHeight-a-1;this._ctx.moveTo(x,w);for(let m=0;m<g;m++){const L=(s+g+m)*this._deviceCellWidth;this._ctx.lineTo(L,w)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(s,c,g=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const a=this._coreBrowserService.dpr;this._ctx.lineWidth=a,this._ctx.setLineDash([4*a,3*a]);const x=s*this._deviceCellWidth,w=(s+g)*this._deviceCellWidth,m=(c+1)*this._deviceCellHeight-a-1;this._ctx.moveTo(x,m),this._ctx.lineTo(w,m),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(s,c,g){this._ctx.fillRect(s*this._deviceCellWidth,c*this._deviceCellHeight,this._coreBrowserService.dpr*g,this._deviceCellHeight)}_strokeRectAtCell(s,c,g,a){const x=this._coreBrowserService.dpr;this._ctx.lineWidth=x,this._ctx.strokeRect(s*this._deviceCellWidth+x/2,c*this._deviceCellHeight+x/2,g*this._deviceCellWidth-x,a*this._deviceCellHeight-x)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(s,c,g,a){this._alpha?this._ctx.clearRect(s*this._deviceCellWidth,c*this._deviceCellHeight,g*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(s*this._deviceCellWidth,c*this._deviceCellHeight,g*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(s,c,g){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=r.TEXT_BASELINE,this._clipRow(g);let a=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(a=(0,l.tryDrawCustomChar)(this._ctx,s.getChars(),c*this._deviceCellWidth,g*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),a||this._ctx.fillText(s.getChars(),c*this._deviceCellWidth+this._deviceCharLeft,g*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(s,c,g){var b,y,D,S;const a=s.getChars(),x=s.getCode(),w=s.getWidth();if(this._cellColorResolver.resolve(s,c,this._bufferService.buffer.ydisp+g,this._deviceCellWidth),!this._charAtlas)return;let m;if(m=a&&a.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(a,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(s.getCode()||_.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!m.size.x||!m.size.y)return;this._ctx.save(),this._clipRow(g),this._bitmapGenerator[m.texturePage]&&this._charAtlas.pages[m.texturePage].canvas!==this._bitmapGenerator[m.texturePage].canvas&&((y=(b=this._bitmapGenerator[m.texturePage])==null?void 0:b.bitmap)==null||y.close(),delete this._bitmapGenerator[m.texturePage]),this._charAtlas.pages[m.texturePage].version!==((D=this._bitmapGenerator[m.texturePage])==null?void 0:D.version)&&(this._bitmapGenerator[m.texturePage]||(this._bitmapGenerator[m.texturePage]=new v(this._charAtlas.pages[m.texturePage].canvas)),this._bitmapGenerator[m.texturePage].refresh(),this._bitmapGenerator[m.texturePage].version=this._charAtlas.pages[m.texturePage].version);let L=m.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,p.allowRescaling)(x,w,m.size.x,this._deviceCellWidth)&&(L=this._deviceCellWidth-1),this._ctx.drawImage(((S=this._bitmapGenerator[m.texturePage])==null?void 0:S.bitmap)||this._charAtlas.pages[m.texturePage].canvas,m.texturePosition.x,m.texturePosition.y,m.size.x,m.size.y,c*this._deviceCellWidth+this._deviceCharLeft-m.offset.x,g*this._deviceCellHeight+this._deviceCharTop-m.offset.y,L,m.size.y),this._ctx.restore()}_clipRow(s){this._ctx.beginPath(),this._ctx.rect(0,s*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(s,c){return`${c?"italic":""} ${s?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}e.BaseRenderLayer=n;class v{get bitmap(){return this._bitmap}constructor(s){this.canvas=s,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var s;(s=this._bitmap)==null||s.close(),this._bitmap=void 0,f.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var s;this._state===0&&((s=this._bitmap)==null||s.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((c=>{this._state===2?this.refresh():this._bitmap=c,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasRenderer=void 0;const d=h(627),o=h(56),r=h(374),l=h(345),p=h(859),C=h(873),i=h(43),t=h(630),f=h(744);class _ extends p.Disposable{constructor(v,u,s,c,g,a,x,w,m,L,b){super(),this._terminal=v,this._screenElement=u,this._bufferService=c,this._charSizeService=g,this._optionsService=a,this._coreBrowserService=m,this._themeService=b,this._observerDisposable=this.register(new p.MutableDisposable),this._onRequestRedraw=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new l.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new l.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const y=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new f.TextRenderLayer(this._terminal,this._screenElement,0,y,this._bufferService,this._optionsService,x,L,this._coreBrowserService,b),new t.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,L,this._optionsService,b),new i.LinkRenderLayer(this._terminal,this._screenElement,2,s,this._bufferService,this._optionsService,L,this._coreBrowserService,b),new C.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,w,this._coreBrowserService,L,b)];for(const D of this._renderLayers)(0,l.forwardEvent)(D.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,r.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,o.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((D,S)=>this._setCanvasDevicePixelDimensions(D,S))),this.register(this._coreBrowserService.onWindowChange((D=>{this._observerDisposable.value=(0,o.observeDevicePixelDimensions)(this._renderLayers[0].canvas,D,((S,M)=>this._setCanvasDevicePixelDimensions(S,M)))}))),this.register((0,p.toDisposable)((()=>{for(const D of this._renderLayers)D.dispose();(0,d.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(v,u){this._updateDimensions();for(const s of this._renderLayers)s.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((v=>v.handleBlur()))}handleFocus(){this._runOperation((v=>v.handleFocus()))}handleSelectionChanged(v,u,s=!1){this._runOperation((c=>c.handleSelectionChanged(v,u,s))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((v=>v.handleCursorMove()))}clear(){this._runOperation((v=>v.reset()))}_runOperation(v){for(const u of this._renderLayers)v(u)}renderRows(v,u){for(const s of this._renderLayers)s.handleGridChanged(v,u)}clearTextureAtlas(){for(const v of this._renderLayers)v.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const v=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*v),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*v),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/v),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/v),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(v,u){this.dimensions.device.canvas.height=u,this.dimensions.device.canvas.width=v;for(const s of this._renderLayers)s.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}e.CanvasRenderer=_},873:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CursorRenderLayer=void 0;const d=h(457),o=h(859),r=h(399),l=h(782),p=h(903);class C extends p.BaseRenderLayer{constructor(t,f,_,n,v,u,s,c,g,a){super(t,f,"cursor",_,!0,a,v,u,g,c),this._onRequestRedraw=n,this._coreService=s,this._cursorBlinkStateManager=this.register(new o.MutableDisposable),this._cell=new l.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(u.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(t){super.resize(t),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var t;this._clearCursor(),(t=this._cursorBlinkStateManager.value)==null||t.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var t;(t=this._cursorBlinkStateManager.value)==null||t.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var t;(t=this._cursorBlinkStateManager.value)==null||t.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new d.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var t;(t=this._cursorBlinkStateManager.value)==null||t.restartBlinkAnimation()}handleGridChanged(t,f){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(t){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const f=this._bufferService.buffer.ybase+this._bufferService.buffer.y,_=f-this._bufferService.buffer.ydisp;if(_<0||_>=this._bufferService.rows)return void this._clearCursor();const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(f).loadCell(n,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const v=this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;return u&&u!=="none"&&this._cursorRenderers[u](n,_,this._cell),this._ctx.restore(),this._state.x=n,this._state.y=_,this._state.isFocused=!1,this._state.style=v,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===n&&this._state.y===_&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](n,_,this._cell),this._ctx.restore(),this._state.x=n,this._state.y=_,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(r.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(t,f,_){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(t,f,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(t,f,_){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(t,f,_.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(_,t,f),this._ctx.restore()}_renderUnderlineCursor(t,f,_){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(t,f),this._ctx.restore()}_renderOutlineCursor(t,f,_){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(t,f,_.getWidth(),1),this._ctx.restore()}}e.CursorRenderLayer=C},574:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GridCache=void 0,e.GridCache=class{constructor(){this.cache=[]}resize(h,d){for(let o=0;o<h;o++){this.cache.length<=o&&this.cache.push([]);for(let r=this.cache[o].length;r<d;r++)this.cache[o].push(void 0);this.cache[o].length=d}this.cache.length=h}clear(){for(let h=0;h<this.cache.length;h++)for(let d=0;d<this.cache[h].length;d++)this.cache[h][d]=void 0}}},43:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkRenderLayer=void 0;const d=h(197),o=h(237),r=h(903);class l extends r.BaseRenderLayer{constructor(C,i,t,f,_,n,v,u,s){super(C,i,"link",t,!0,s,_,n,v,u),this.register(f.onShowLinkUnderline((c=>this._handleShowLinkUnderline(c)))),this.register(f.onHideLinkUnderline((c=>this._handleHideLinkUnderline(c))))}resize(C){super.resize(C),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const C=this._state.y2-this._state.y1-1;C>0&&this._clearCells(0,this._state.y1+1,this._state.cols,C),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(C){if(C.fg===o.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:C.fg&&(0,d.is256Color)(C.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[C.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,C.y1===C.y2)this._fillBottomLineAtCells(C.x1,C.y1,C.x2-C.x1);else{this._fillBottomLineAtCells(C.x1,C.y1,C.cols-C.x1);for(let i=C.y1+1;i<C.y2;i++)this._fillBottomLineAtCells(0,i,C.cols);this._fillBottomLineAtCells(0,C.y2,C.x2)}this._state=C}_handleHideLinkUnderline(C){this._clearCurrentLink()}}e.LinkRenderLayer=l},630:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRenderLayer=void 0;const d=h(903);class o extends d.BaseRenderLayer{constructor(l,p,C,i,t,f,_,n){super(l,p,"selection",C,!0,n,i,_,f,t),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(l){super.resize(l),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(l,p,C){super.handleSelectionChanged(l,p,C),this._redrawSelection(l,p,C)}_redrawSelection(l,p,C){if(!this._didStateChange(l,p,C,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!l||!p)return void this._clearState();const i=l[1]-this._bufferService.buffer.ydisp,t=p[1]-this._bufferService.buffer.ydisp,f=Math.max(i,0),_=Math.min(t,this._bufferService.rows-1);if(f>=this._bufferService.rows||_<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,C){const n=l[0],v=p[0]-n,u=_-f+1;this._fillCells(n,f,v,u)}else{const n=i===f?l[0]:0,v=f===t?p[0]:this._bufferService.cols;this._fillCells(n,f,v-n,1);const u=Math.max(_-f-1,0);if(this._fillCells(0,f+1,this._bufferService.cols,u),f!==_){const s=t===_?p[0]:this._bufferService.cols;this._fillCells(0,_,s,1)}}this._state.start=[l[0],l[1]],this._state.end=[p[0],p[1]],this._state.columnSelectMode=C,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(l,p,C,i){return!this._areCoordinatesEqual(l,this._state.start)||!this._areCoordinatesEqual(p,this._state.end)||C!==this._state.columnSelectMode||i!==this._state.ydisp}_areCoordinatesEqual(l,p){return!(!l||!p)&&l[0]===p[0]&&l[1]===p[1]}}e.SelectionRenderLayer=o},744:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextRenderLayer=void 0;const d=h(577),o=h(147),r=h(782),l=h(855),p=h(903),C=h(574);class i extends p.BaseRenderLayer{constructor(f,_,n,v,u,s,c,g,a,x){super(f,_,"text",n,v,x,u,s,g,a),this._characterJoinerService=c,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new r.CellData,this._state=new C.GridCache,this.register(s.onSpecificOptionChange("allowTransparency",(w=>this._setTransparency(w))))}resize(f){super.resize(f);const _=this._getFont(!1,!1);this._characterWidth===f.device.char.width&&this._characterFont===_||(this._characterWidth=f.device.char.width,this._characterFont=_,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(f,_,n){for(let v=f;v<=_;v++){const u=v+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.lines.get(u),c=this._characterJoinerService.getJoinedCharacters(u);for(let g=0;g<this._bufferService.cols;g++){s.loadCell(g,this._workCell);let a=this._workCell,x=!1,w=g;if(a.getWidth()!==0){if(c.length>0&&g===c[0][0]){x=!0;const m=c.shift();a=new d.JoinedCellData(this._workCell,s.translateToString(!0,m[0],m[1]),m[1]-m[0]),w=m[1]-1}!x&&this._isOverlapping(a)&&w<s.length-1&&s.getCodePoint(w+1)===l.NULL_CELL_CODE&&(a.content&=-12582913,a.content|=8388608),n(a,g,v),g=w}}}}_drawBackground(f,_){const n=this._ctx,v=this._bufferService.cols;let u=0,s=0,c=null;n.save(),this._forEachCell(f,_,((g,a,x)=>{let w=null;g.isInverse()?w=g.isFgDefault()?this._themeService.colors.foreground.css:g.isFgRGB()?`rgb(${o.AttributeData.toColorRGB(g.getFgColor()).join(",")})`:this._themeService.colors.ansi[g.getFgColor()].css:g.isBgRGB()?w=`rgb(${o.AttributeData.toColorRGB(g.getBgColor()).join(",")})`:g.isBgPalette()&&(w=this._themeService.colors.ansi[g.getBgColor()].css);let m=!1;this._decorationService.forEachDecorationAtCell(a,this._bufferService.buffer.ydisp+x,void 0,(L=>{L.options.layer!=="top"&&m||(L.backgroundColorRGB&&(w=L.backgroundColorRGB.css),m=L.options.layer==="top")})),c===null&&(u=a,s=x),x!==s?(n.fillStyle=c||"",this._fillCells(u,s,v-u,1),u=a,s=x):c!==w&&(n.fillStyle=c||"",this._fillCells(u,s,a-u,1),u=a,s=x),c=w})),c!==null&&(n.fillStyle=c,this._fillCells(u,s,v-u,1)),n.restore()}_drawForeground(f,_){this._forEachCell(f,_,((n,v,u)=>this._drawChars(n,v,u)))}handleGridChanged(f,_){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,f,this._bufferService.cols,_-f+1),this._drawBackground(f,_),this._drawForeground(f,_))}_isOverlapping(f){if(f.getWidth()!==1||f.getCode()<256)return!1;const _=f.getChars();if(this._characterOverlapCache.hasOwnProperty(_))return this._characterOverlapCache[_];this._ctx.save(),this._ctx.font=this._characterFont;const n=Math.floor(this._ctx.measureText(_).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[_]=n,n}}e.TextRenderLayer=i},274:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CellColorResolver=void 0;const d=h(855),o=h(160),r=h(374);let l,p=0,C=0,i=!1,t=!1,f=!1,_=0;e.CellColorResolver=class{constructor(n,v,u,s,c,g){this._terminal=n,this._optionService=v,this._selectionRenderModel=u,this._decorationService=s,this._coreBrowserService=c,this._themeService=g,this.result={fg:0,bg:0,ext:0}}resolve(n,v,u,s){if(this.result.bg=n.bg,this.result.fg=n.fg,this.result.ext=268435456&n.bg?n.extended.ext:0,C=0,p=0,t=!1,i=!1,f=!1,l=this._themeService.colors,_=0,n.getCode()!==d.NULL_CELL_CODE&&n.extended.underlineStyle===4){const c=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));_=v*s%(2*Math.round(c))}if(this._decorationService.forEachDecorationAtCell(v,u,"bottom",(c=>{c.backgroundColorRGB&&(C=c.backgroundColorRGB.rgba>>8&16777215,t=!0),c.foregroundColorRGB&&(p=c.foregroundColorRGB.rgba>>8&16777215,i=!0)})),f=this._selectionRenderModel.isCellSelected(this._terminal,v,u),f){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:C=(16777215&this.result.fg)<<8|255;break;default:C=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:C=(16777215&this.result.bg)<<8|255}C=o.rgba.blend(C,4294967040&(this._coreBrowserService.isFocused?l.selectionBackgroundOpaque:l.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else C=(this._coreBrowserService.isFocused?l.selectionBackgroundOpaque:l.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(t=!0,l.selectionForeground&&(p=l.selectionForeground.rgba>>8&16777215,i=!0),(0,r.treatGlyphAsBackgroundColor)(n.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)p=(this._coreBrowserService.isFocused?l.selectionBackgroundOpaque:l.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:p=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:p=(16777215&this.result.fg)<<8|255;break;default:p=this._themeService.colors.foreground.rgba}p=o.rgba.blend(p,4294967040&(this._coreBrowserService.isFocused?l.selectionBackgroundOpaque:l.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}i=!0}}this._decorationService.forEachDecorationAtCell(v,u,"top",(c=>{c.backgroundColorRGB&&(C=c.backgroundColorRGB.rgba>>8&16777215,t=!0),c.foregroundColorRGB&&(p=c.foregroundColorRGB.rgba>>8&16777215,i=!0)})),t&&(C=f?-16777216&n.bg&-134217729|C|50331648:-16777216&n.bg|C|50331648),i&&(p=-16777216&n.fg&-67108865|p|50331648),67108864&this.result.fg&&(t&&!i&&(p=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&l.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,i=!0),!t&&i&&(C=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&l.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,t=!0)),l=void 0,this.result.bg=t?C:this.result.bg,this.result.fg=i?p:this.result.fg,this.result.ext&=536870911,this.result.ext|=_<<29&3758096384}}},627:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.removeTerminalFromCache=e.acquireTextureAtlas=void 0;const d=h(509),o=h(197),r=[];e.acquireTextureAtlas=function(l,p,C,i,t,f,_,n){const v=(0,o.generateConfig)(i,t,f,_,p,C,n);for(let c=0;c<r.length;c++){const g=r[c],a=g.ownedBy.indexOf(l);if(a>=0){if((0,o.configEquals)(g.config,v))return g.atlas;g.ownedBy.length===1?(g.atlas.dispose(),r.splice(c,1)):g.ownedBy.splice(a,1);break}}for(let c=0;c<r.length;c++){const g=r[c];if((0,o.configEquals)(g.config,v))return g.ownedBy.push(l),g.atlas}const u=l._core,s={atlas:new d.TextureAtlas(document,v,u.unicodeService),config:v,ownedBy:[l]};return r.push(s),s.atlas},e.removeTerminalFromCache=function(l){for(let p=0;p<r.length;p++){const C=r[p].ownedBy.indexOf(l);if(C!==-1){r[p].ownedBy.length===1?(r[p].atlas.dispose(),r.splice(p,1)):r[p].ownedBy.splice(C,1);break}}}},197:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.is256Color=e.configEquals=e.generateConfig=void 0;const d=h(160);e.generateConfig=function(o,r,l,p,C,i,t){const f={foreground:i.foreground,background:i.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:i.ansi.slice(),contrastCache:i.contrastCache,halfContrastCache:i.halfContrastCache};return{customGlyphs:C.customGlyphs,devicePixelRatio:t,letterSpacing:C.letterSpacing,lineHeight:C.lineHeight,deviceCellWidth:o,deviceCellHeight:r,deviceCharWidth:l,deviceCharHeight:p,fontFamily:C.fontFamily,fontSize:C.fontSize,fontWeight:C.fontWeight,fontWeightBold:C.fontWeightBold,allowTransparency:C.allowTransparency,drawBoldTextInBrightColors:C.drawBoldTextInBrightColors,minimumContrastRatio:C.minimumContrastRatio,colors:f}},e.configEquals=function(o,r){for(let l=0;l<o.colors.ansi.length;l++)if(o.colors.ansi[l].rgba!==r.colors.ansi[l].rgba)return!1;return o.devicePixelRatio===r.devicePixelRatio&&o.customGlyphs===r.customGlyphs&&o.lineHeight===r.lineHeight&&o.letterSpacing===r.letterSpacing&&o.fontFamily===r.fontFamily&&o.fontSize===r.fontSize&&o.fontWeight===r.fontWeight&&o.fontWeightBold===r.fontWeightBold&&o.allowTransparency===r.allowTransparency&&o.deviceCharWidth===r.deviceCharWidth&&o.deviceCharHeight===r.deviceCharHeight&&o.drawBoldTextInBrightColors===r.drawBoldTextInBrightColors&&o.minimumContrastRatio===r.minimumContrastRatio&&o.colors.foreground.rgba===r.colors.foreground.rgba&&o.colors.background.rgba===r.colors.background.rgba},e.is256Color=function(o){return(50331648&o)==16777216||(50331648&o)==33554432}},237:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TEXT_BASELINE=e.DIM_OPACITY=e.INVERTED_DEFAULT_COLOR=void 0;const d=h(399);e.INVERTED_DEFAULT_COLOR=257,e.DIM_OPACITY=.5,e.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CursorBlinkStateManager=void 0,e.CursorBlinkStateManager=class{constructor(h,d){this._renderCallback=h,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(h=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),h)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.tryDrawCustomChar=e.powerlineDefinitions=e.boxDrawingDefinitions=e.blockElementDefinitions=void 0;const d=h(374);e.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const o={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};e.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(i,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(i,t)=>`M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1`},"╒":{1:(i,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(i,t)=>`M${.5-i},1 L${.5-i},.5 L1,.5 M${.5+i},.5 L${.5+i},1`},"╔":{1:(i,t)=>`M1,${.5-t} L${.5-i},${.5-t} L${.5-i},1 M1,${.5+t} L${.5+i},${.5+t} L${.5+i},1`},"╕":{1:(i,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(i,t)=>`M${.5+i},1 L${.5+i},.5 L0,.5 M${.5-i},.5 L${.5-i},1`},"╗":{1:(i,t)=>`M0,${.5+t} L${.5-i},${.5+t} L${.5-i},1 M0,${.5-t} L${.5+i},${.5-t} L${.5+i},1`},"╘":{1:(i,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(i,t)=>`M1,.5 L${.5-i},.5 L${.5-i},0 M${.5+i},.5 L${.5+i},0`},"╚":{1:(i,t)=>`M1,${.5-t} L${.5+i},${.5-t} L${.5+i},0 M1,${.5+t} L${.5-i},${.5+t} L${.5-i},0`},"╛":{1:(i,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(i,t)=>`M0,.5 L${.5+i},.5 L${.5+i},0 M${.5-i},.5 L${.5-i},0`},"╝":{1:(i,t)=>`M0,${.5-t} L${.5-i},${.5-t} L${.5-i},0 M0,${.5+t} L${.5+i},${.5+t} L${.5+i},0`},"╞":{1:(i,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(i,t)=>`M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1 M${.5+i},.5 L1,.5`},"╠":{1:(i,t)=>`M${.5-i},0 L${.5-i},1 M1,${.5+t} L${.5+i},${.5+t} L${.5+i},1 M1,${.5-t} L${.5+i},${.5-t} L${.5+i},0`},"╡":{1:(i,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(i,t)=>`M0,.5 L${.5-i},.5 M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1`},"╣":{1:(i,t)=>`M${.5+i},0 L${.5+i},1 M0,${.5+t} L${.5-i},${.5+t} L${.5-i},1 M0,${.5-t} L${.5-i},${.5-t} L${.5-i},0`},"╤":{1:(i,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(i,t)=>`M0,.5 L1,.5 M${.5-i},.5 L${.5-i},1 M${.5+i},.5 L${.5+i},1`},"╦":{1:(i,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-i},${.5+t} L${.5-i},1 M1,${.5+t} L${.5+i},${.5+t} L${.5+i},1`},"╧":{1:(i,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(i,t)=>`M0,.5 L1,.5 M${.5-i},.5 L${.5-i},0 M${.5+i},.5 L${.5+i},0`},"╩":{1:(i,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-i},${.5-t} L${.5-i},0 M1,${.5-t} L${.5+i},${.5-t} L${.5+i},0`},"╪":{1:(i,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(i,t)=>`M0,.5 L1,.5 M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1`},"╬":{1:(i,t)=>`M0,${.5+t} L${.5-i},${.5+t} L${.5-i},1 M1,${.5+t} L${.5+i},${.5+t} L${.5+i},1 M0,${.5-t} L${.5-i},${.5-t} L${.5-i},0 M1,${.5-t} L${.5+i},${.5-t} L${.5+i},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(i,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(i,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(i,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(i,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},e.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},e.powerlineDefinitions[""]=e.powerlineDefinitions[""],e.powerlineDefinitions[""]=e.powerlineDefinitions[""],e.tryDrawCustomChar=function(i,t,f,_,n,v,u,s){const c=e.blockElementDefinitions[t];if(c)return(function(w,m,L,b,y,D){for(let S=0;S<m.length;S++){const M=m[S],T=y/8,A=D/8;w.fillRect(L+M.x*T,b+M.y*A,M.w*T,M.h*A)}})(i,c,f,_,n,v),!0;const g=o[t];if(g)return(function(w,m,L,b,y,D){let S=r.get(m);S||(S=new Map,r.set(m,S));const M=w.fillStyle;if(typeof M!="string")throw new Error(`Unexpected fillStyle type "${M}"`);let T=S.get(M);if(!T){const A=m[0].length,H=m.length,z=w.canvas.ownerDocument.createElement("canvas");z.width=A,z.height=H;const U=(0,d.throwIfFalsy)(z.getContext("2d")),I=new ImageData(A,H);let Z,Q,Y,V;if(M.startsWith("#"))Z=parseInt(M.slice(1,3),16),Q=parseInt(M.slice(3,5),16),Y=parseInt(M.slice(5,7),16),V=M.length>7&&parseInt(M.slice(7,9),16)||1;else{if(!M.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${M}" when drawing pattern glyph`);[Z,Q,Y,V]=M.substring(5,M.length-1).split(",").map((q=>parseFloat(q)))}for(let q=0;q<H;q++)for(let K=0;K<A;K++)I.data[4*(q*A+K)]=Z,I.data[4*(q*A+K)+1]=Q,I.data[4*(q*A+K)+2]=Y,I.data[4*(q*A+K)+3]=m[q][K]*(255*V);U.putImageData(I,0,0),T=(0,d.throwIfFalsy)(w.createPattern(z,null)),S.set(M,T)}w.fillStyle=T,w.fillRect(L,b,y,D)})(i,g,f,_,n,v),!0;const a=e.boxDrawingDefinitions[t];if(a)return(function(w,m,L,b,y,D,S){w.strokeStyle=w.fillStyle;for(const[M,T]of Object.entries(m)){let A;w.beginPath(),w.lineWidth=S*Number.parseInt(M),A=typeof T=="function"?T(.15,.15/D*y):T;for(const H of A.split(" ")){const z=H[0],U=p[z];if(!U){console.error(`Could not find drawing instructions for "${z}"`);continue}const I=H.substring(1).split(",");I[0]&&I[1]&&U(w,C(I,y,D,L,b,!0,S))}w.stroke(),w.closePath()}})(i,a,f,_,n,v,s),!0;const x=e.powerlineDefinitions[t];return!!x&&((function(w,m,L,b,y,D,S,M){const T=new Path2D;T.rect(L,b,y,D),w.clip(T),w.beginPath();const A=S/12;w.lineWidth=M*A;for(const H of m.d.split(" ")){const z=H[0],U=p[z];if(!U){console.error(`Could not find drawing instructions for "${z}"`);continue}const I=H.substring(1).split(",");I[0]&&I[1]&&U(w,C(I,y,D,L,b,!1,M,(m.leftPadding??0)*(A/2),(m.rightPadding??0)*(A/2)))}m.type===1?(w.strokeStyle=w.fillStyle,w.stroke()):w.fill(),w.closePath()})(i,x,f,_,n,v,u,s),!0)};const r=new Map;function l(i,t,f=0){return Math.max(Math.min(i,t),f)}const p={C:(i,t)=>i.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(i,t)=>i.lineTo(t[0],t[1]),M:(i,t)=>i.moveTo(t[0],t[1])};function C(i,t,f,_,n,v,u,s=0,c=0){const g=i.map((a=>parseFloat(a)||parseInt(a)));if(g.length<2)throw new Error("Too few arguments for instruction");for(let a=0;a<g.length;a+=2)g[a]*=t-s*u-c*u,v&&g[a]!==0&&(g[a]=l(Math.round(g[a]+.5)-.5,t,0)),g[a]+=_+s*u;for(let a=1;a<g.length;a+=2)g[a]*=f,v&&g[a]!==0&&(g[a]=l(Math.round(g[a]+.5)-.5,f,0)),g[a]+=n;return g}},56:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.observeDevicePixelDimensions=void 0;const d=h(859);e.observeDevicePixelDimensions=function(o,r,l){let p=new r.ResizeObserver((C=>{const i=C.find((_=>_.target===o));if(!i)return;if(!("devicePixelContentBoxSize"in i))return p==null||p.disconnect(),void(p=void 0);const t=i.devicePixelContentBoxSize[0].inlineSize,f=i.devicePixelContentBoxSize[0].blockSize;t>0&&f>0&&l(t,f)}));try{p.observe(o,{box:["device-pixel-content-box"]})}catch{p.disconnect(),p=void 0}return(0,d.toDisposable)((()=>p==null?void 0:p.disconnect()))}},374:(k,e)=>{function h(o){return 57508<=o&&o<=57558}function d(o){return o>=128512&&o<=128591||o>=127744&&o<=128511||o>=128640&&o<=128767||o>=9728&&o<=9983||o>=9984&&o<=10175||o>=65024&&o<=65039||o>=129280&&o<=129535||o>=127462&&o<=127487}Object.defineProperty(e,"__esModule",{value:!0}),e.computeNextVariantOffset=e.createRenderDimensions=e.treatGlyphAsBackgroundColor=e.allowRescaling=e.isEmoji=e.isRestrictedPowerlineGlyph=e.isPowerlineGlyph=e.throwIfFalsy=void 0,e.throwIfFalsy=function(o){if(!o)throw new Error("value must not be falsy");return o},e.isPowerlineGlyph=h,e.isRestrictedPowerlineGlyph=function(o){return 57520<=o&&o<=57527},e.isEmoji=d,e.allowRescaling=function(o,r,l,p){return r===1&&l>Math.ceil(1.5*p)&&o!==void 0&&o>255&&!d(o)&&!h(o)&&!(function(C){return 57344<=C&&C<=63743})(o)},e.treatGlyphAsBackgroundColor=function(o){return h(o)||(function(r){return 9472<=r&&r<=9631})(o)},e.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},e.computeNextVariantOffset=function(o,r,l=0){return(o-(2*Math.round(r)-l))%(2*Math.round(r))}},296:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createSelectionRenderModel=void 0;class h{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(o,r,l,p=!1){if(this.selectionStart=r,this.selectionEnd=l,!r||!l||r[0]===l[0]&&r[1]===l[1])return void this.clear();const C=o.buffers.active.ydisp,i=r[1]-C,t=l[1]-C,f=Math.max(i,0),_=Math.min(t,o.rows-1);f>=o.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=p,this.viewportStartRow=i,this.viewportEndRow=t,this.viewportCappedStartRow=f,this.viewportCappedEndRow=_,this.startCol=r[0],this.endCol=l[0])}isCellSelected(o,r,l){return!!this.hasSelection&&(l-=o.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?r>=this.startCol&&l>=this.viewportCappedStartRow&&r<this.endCol&&l<=this.viewportCappedEndRow:r<this.startCol&&l>=this.viewportCappedStartRow&&r>=this.endCol&&l<=this.viewportCappedEndRow:l>this.viewportStartRow&&l<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&l===this.viewportStartRow&&r>=this.startCol&&r<this.endCol||this.viewportStartRow<this.viewportEndRow&&l===this.viewportEndRow&&r<this.endCol||this.viewportStartRow<this.viewportEndRow&&l===this.viewportStartRow&&r>=this.startCol)}}e.createSelectionRenderModel=function(){return new h}},509:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextureAtlas=void 0;const d=h(237),o=h(860),r=h(374),l=h(160),p=h(345),C=h(485),i=h(385),t=h(147),f=h(855),_={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let n;class v{get pages(){return this._pages}constructor(a,x,w){this._document=a,this._config=x,this._unicodeService=w,this._didWarmUp=!1,this._cacheMap=new C.FourKeyMap,this._cacheMapCombined=new C.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new t.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new p.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new p.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=c(a,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,r.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const a of this.pages)a.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const a=new i.IdleTaskQueue;for(let x=33;x<126;x++)a.enqueue((()=>{if(!this._cacheMap.get(x,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT)){const w=this._drawToCache(x,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT);this._cacheMap.set(x,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT,w)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const a of this._pages)a.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(v.maxAtlasPages&&this._pages.length>=Math.max(4,v.maxAtlasPages)){const x=this._pages.filter((S=>2*S.canvas.width<=(v.maxTextureSize||4096))).sort(((S,M)=>M.canvas.width!==S.canvas.width?M.canvas.width-S.canvas.width:M.percentageUsed-S.percentageUsed));let w=-1,m=0;for(let S=0;S<x.length;S++)if(x[S].canvas.width!==m)w=S,m=x[S].canvas.width;else if(S-w==3)break;const L=x.slice(w,w+4),b=L.map((S=>S.glyphs[0].texturePage)).sort(((S,M)=>S>M?1:-1)),y=this.pages.length-L.length,D=this._mergePages(L,y);D.version++;for(let S=b.length-1;S>=0;S--)this._deletePage(b[S]);this.pages.push(D),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(D.canvas)}const a=new u(this._document,this._textureSize);return this._pages.push(a),this._activePages.push(a),this._onAddTextureAtlasCanvas.fire(a.canvas),a}_mergePages(a,x){const w=2*a[0].canvas.width,m=new u(this._document,w,a);for(const[L,b]of a.entries()){const y=L*b.canvas.width%w,D=Math.floor(L/2)*b.canvas.height;m.ctx.drawImage(b.canvas,y,D);for(const M of b.glyphs)M.texturePage=x,M.sizeClipSpace.x=M.size.x/w,M.sizeClipSpace.y=M.size.y/w,M.texturePosition.x+=y,M.texturePosition.y+=D,M.texturePositionClipSpace.x=M.texturePosition.x/w,M.texturePositionClipSpace.y=M.texturePosition.y/w;this._onRemoveTextureAtlasCanvas.fire(b.canvas);const S=this._activePages.indexOf(b);S!==-1&&this._activePages.splice(S,1)}return m}_deletePage(a){this._pages.splice(a,1);for(let x=a;x<this._pages.length;x++){const w=this._pages[x];for(const m of w.glyphs)m.texturePage--;w.version++}}getRasterizedGlyphCombinedChar(a,x,w,m,L){return this._getFromCacheMap(this._cacheMapCombined,a,x,w,m,L)}getRasterizedGlyph(a,x,w,m,L){return this._getFromCacheMap(this._cacheMap,a,x,w,m,L)}_getFromCacheMap(a,x,w,m,L,b=!1){return n=a.get(x,w,m,L),n||(n=this._drawToCache(x,w,m,L,b),a.set(x,w,m,L,n)),n}_getColorFromAnsiIndex(a){if(a>=this._config.colors.ansi.length)throw new Error("No color found for idx "+a);return this._config.colors.ansi[a]}_getBackgroundColor(a,x,w,m){if(this._config.allowTransparency)return l.NULL_COLOR;let L;switch(a){case 16777216:case 33554432:L=this._getColorFromAnsiIndex(x);break;case 50331648:const b=t.AttributeData.toColorRGB(x);L=l.channels.toColor(b[0],b[1],b[2]);break;default:L=w?l.color.opaque(this._config.colors.foreground):this._config.colors.background}return L}_getForegroundColor(a,x,w,m,L,b,y,D,S,M){const T=this._getMinimumContrastColor(a,x,w,m,L,b,y,S,D,M);if(T)return T;let A;switch(L){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&S&&b<8&&(b+=8),A=this._getColorFromAnsiIndex(b);break;case 50331648:const H=t.AttributeData.toColorRGB(b);A=l.channels.toColor(H[0],H[1],H[2]);break;default:A=y?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(A=l.color.opaque(A)),D&&(A=l.color.multiplyOpacity(A,d.DIM_OPACITY)),A}_resolveBackgroundRgba(a,x,w){switch(a){case 16777216:case 33554432:return this._getColorFromAnsiIndex(x).rgba;case 50331648:return x<<8;default:return w?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(a,x,w,m){switch(a){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&m&&x<8&&(x+=8),this._getColorFromAnsiIndex(x).rgba;case 50331648:return x<<8;default:return w?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(a,x,w,m,L,b,y,D,S,M){if(this._config.minimumContrastRatio===1||M)return;const T=this._getContrastCache(S),A=T.getColor(a,m);if(A!==void 0)return A||void 0;const H=this._resolveBackgroundRgba(x,w,y),z=this._resolveForegroundRgba(L,b,y,D),U=l.rgba.ensureContrastRatio(H,z,this._config.minimumContrastRatio/(S?2:1));if(!U)return void T.setColor(a,m,null);const I=l.channels.toColor(U>>24&255,U>>16&255,U>>8&255);return T.setColor(a,m,I),I}_getContrastCache(a){return a?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(a,x,w,m,L=!1){const b=typeof a=="number"?String.fromCharCode(a):a,y=Math.min(this._config.deviceCellWidth*Math.max(b.length,2)+4,this._textureSize);this._tmpCanvas.width<y&&(this._tmpCanvas.width=y);const D=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<D&&(this._tmpCanvas.height=D),this._tmpCtx.save(),this._workAttributeData.fg=w,this._workAttributeData.bg=x,this._workAttributeData.extended.ext=m,this._workAttributeData.isInvisible())return _;const S=!!this._workAttributeData.isBold(),M=!!this._workAttributeData.isInverse(),T=!!this._workAttributeData.isDim(),A=!!this._workAttributeData.isItalic(),H=!!this._workAttributeData.isUnderline(),z=!!this._workAttributeData.isStrikethrough(),U=!!this._workAttributeData.isOverline();let I=this._workAttributeData.getFgColor(),Z=this._workAttributeData.getFgColorMode(),Q=this._workAttributeData.getBgColor(),Y=this._workAttributeData.getBgColorMode();if(M){const R=I;I=Q,Q=R;const O=Z;Z=Y,Y=O}const V=this._getBackgroundColor(Y,Q,M,T);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=V.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const q=S?this._config.fontWeightBold:this._config.fontWeight,K=A?"italic":"";this._tmpCtx.font=`${K} ${q} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const Se=b.length===1&&(0,r.isPowerlineGlyph)(b.charCodeAt(0)),pe=b.length===1&&(0,r.isRestrictedPowerlineGlyph)(b.charCodeAt(0)),he=this._getForegroundColor(x,Y,Q,w,Z,I,M,T,S,(0,r.treatGlyphAsBackgroundColor)(b.charCodeAt(0)));this._tmpCtx.fillStyle=he.css;const P=pe?0:4;let le=!1;this._config.customGlyphs!==!1&&(le=(0,o.tryDrawCustomChar)(this._tmpCtx,b,P,P,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let re,oe=!Se;if(re=typeof a=="number"?this._unicodeService.wcwidth(a):this._unicodeService.getStringCellWidth(a),H){this._tmpCtx.save();const R=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=R%2==1?.5:0;if(this._tmpCtx.lineWidth=R,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())oe=!1,this._tmpCtx.strokeStyle=`rgb(${t.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{oe=!1;let X=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&X<8&&(X+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(X).css}this._tmpCtx.beginPath();const j=P,W=Math.ceil(P+this._config.deviceCharHeight)-O-(L?2*R:0),ne=W+R,ae=W+2*R;let ee=this._workAttributeData.getUnderlineVariantOffset();for(let X=0;X<re;X++){this._tmpCtx.save();const F=j+X*this._config.deviceCellWidth,G=j+(X+1)*this._config.deviceCellWidth,fe=F+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(F,W),this._tmpCtx.lineTo(G,W),this._tmpCtx.moveTo(F,ae),this._tmpCtx.lineTo(G,ae);break;case 3:const de=R<=1?ae:Math.ceil(P+this._config.deviceCharHeight-R/2)-O,_e=R<=1?W:Math.ceil(P+this._config.deviceCharHeight+R/2)-O,xe=new Path2D;xe.rect(F,W,this._config.deviceCellWidth,ae-W),this._tmpCtx.clip(xe),this._tmpCtx.moveTo(F-this._config.deviceCellWidth/2,ne),this._tmpCtx.bezierCurveTo(F-this._config.deviceCellWidth/2,_e,F,_e,F,ne),this._tmpCtx.bezierCurveTo(F,de,fe,de,fe,ne),this._tmpCtx.bezierCurveTo(fe,_e,G,_e,G,ne),this._tmpCtx.bezierCurveTo(G,de,G+this._config.deviceCellWidth/2,de,G+this._config.deviceCellWidth/2,ne);break;case 4:const ue=ee===0?0:ee>=R?2*R-ee:R-ee;ee>=R||ue===0?(this._tmpCtx.setLineDash([Math.round(R),Math.round(R)]),this._tmpCtx.moveTo(F+ue,W),this._tmpCtx.lineTo(G,W)):(this._tmpCtx.setLineDash([Math.round(R),Math.round(R)]),this._tmpCtx.moveTo(F,W),this._tmpCtx.lineTo(F+ue,W),this._tmpCtx.moveTo(F+ue+R,W),this._tmpCtx.lineTo(G,W)),ee=(0,r.computeNextVariantOffset)(G-F,R,ee);break;case 5:const ye=.6,Re=.3,ve=G-F,we=Math.floor(ye*ve),Le=Math.floor(Re*ve),Ae=ve-we-Le;this._tmpCtx.setLineDash([we,Le,Ae]),this._tmpCtx.moveTo(F,W),this._tmpCtx.lineTo(G,W);break;default:this._tmpCtx.moveTo(F,W),this._tmpCtx.lineTo(G,W)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!le&&this._config.fontSize>=12&&!this._config.allowTransparency&&b!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const X=this._tmpCtx.measureText(b);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in X&&X.actualBoundingBoxDescent>0){this._tmpCtx.save();const F=new Path2D;F.rect(j,W-Math.ceil(R/2),this._config.deviceCellWidth*re,ae-W+Math.ceil(R/2)),this._tmpCtx.clip(F),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=V.css,this._tmpCtx.strokeText(b,P,P+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(U){const R=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=R%2==1?.5:0;this._tmpCtx.lineWidth=R,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+O),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*re,P+O),this._tmpCtx.stroke()}if(le||this._tmpCtx.fillText(b,P,P+this._config.deviceCharHeight),b==="_"&&!this._config.allowTransparency){let R=s(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),V,he,oe);if(R)for(let O=1;O<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=V.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(b,P,P+this._config.deviceCharHeight-O),R=s(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),V,he,oe),R);O++);}if(z){const R=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),O=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=R,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*re,P+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.stroke()}this._tmpCtx.restore();const ce=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let me;if(me=this._config.allowTransparency?(function(R){for(let O=0;O<R.data.length;O+=4)if(R.data[O+3]>0)return!1;return!0})(ce):s(ce,V,he,oe),me)return _;const $=this._findGlyphBoundingBox(ce,this._workBoundingBox,y,pe,le,P);let E,B;for(;;){if(this._activePages.length===0){const R=this._createNewPage();E=R,B=R.currentRow,B.height=$.size.y;break}E=this._activePages[this._activePages.length-1],B=E.currentRow;for(const R of this._activePages)$.size.y<=R.currentRow.height&&(E=R,B=R.currentRow);for(let R=this._activePages.length-1;R>=0;R--)for(const O of this._activePages[R].fixedRows)O.height<=B.height&&$.size.y<=O.height&&(E=this._activePages[R],B=O);if(B.y+$.size.y>=E.canvas.height||B.height>$.size.y+2){let R=!1;if(E.currentRow.y+E.currentRow.height+$.size.y>=E.canvas.height){let O;for(const j of this._activePages)if(j.currentRow.y+j.currentRow.height+$.size.y<j.canvas.height){O=j;break}if(O)E=O;else if(v.maxAtlasPages&&this._pages.length>=v.maxAtlasPages&&B.y+$.size.y<=E.canvas.height&&B.height>=$.size.y&&B.x+$.size.x<=E.canvas.width)R=!0;else{const j=this._createNewPage();E=j,B=j.currentRow,B.height=$.size.y,R=!0}}R||(E.currentRow.height>0&&E.fixedRows.push(E.currentRow),B={x:0,y:E.currentRow.y+E.currentRow.height,height:$.size.y},E.fixedRows.push(B),E.currentRow={x:0,y:B.y+B.height,height:0})}if(B.x+$.size.x<=E.canvas.width)break;B===E.currentRow?(B.x=0,B.y+=B.height,B.height=0):E.fixedRows.splice(E.fixedRows.indexOf(B),1)}return $.texturePage=this._pages.indexOf(E),$.texturePosition.x=B.x,$.texturePosition.y=B.y,$.texturePositionClipSpace.x=B.x/E.canvas.width,$.texturePositionClipSpace.y=B.y/E.canvas.height,$.sizeClipSpace.x/=E.canvas.width,$.sizeClipSpace.y/=E.canvas.height,B.height=Math.max(B.height,$.size.y),B.x+=$.size.x,E.ctx.putImageData(ce,$.texturePosition.x-this._workBoundingBox.left,$.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,$.size.x,$.size.y),E.addGlyph($),E.version++,$}_findGlyphBoundingBox(a,x,w,m,L,b){x.top=0;const y=m?this._config.deviceCellHeight:this._tmpCanvas.height,D=m?this._config.deviceCellWidth:w;let S=!1;for(let M=0;M<y;M++){for(let T=0;T<D;T++){const A=M*this._tmpCanvas.width*4+4*T+3;if(a.data[A]!==0){x.top=M,S=!0;break}}if(S)break}x.left=0,S=!1;for(let M=0;M<b+D;M++){for(let T=0;T<y;T++){const A=T*this._tmpCanvas.width*4+4*M+3;if(a.data[A]!==0){x.left=M,S=!0;break}}if(S)break}x.right=D,S=!1;for(let M=b+D-1;M>=b;M--){for(let T=0;T<y;T++){const A=T*this._tmpCanvas.width*4+4*M+3;if(a.data[A]!==0){x.right=M,S=!0;break}}if(S)break}x.bottom=y,S=!1;for(let M=y-1;M>=0;M--){for(let T=0;T<D;T++){const A=M*this._tmpCanvas.width*4+4*T+3;if(a.data[A]!==0){x.bottom=M,S=!0;break}}if(S)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:x.right-x.left+1,y:x.bottom-x.top+1},sizeClipSpace:{x:x.right-x.left+1,y:x.bottom-x.top+1},offset:{x:-x.left+b+(m||L?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-x.top+b+(m||L?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}e.TextureAtlas=v;class u{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(a){this._glyphs.push(a),this._usedPixels+=a.size.x*a.size.y}constructor(a,x,w){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],w)for(const m of w)this._glyphs.push(...m.glyphs),this._usedPixels+=m._usedPixels;this.canvas=c(a,x,x),this.ctx=(0,r.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function s(g,a,x,w){const m=a.rgba>>>24,L=a.rgba>>>16&255,b=a.rgba>>>8&255,y=x.rgba>>>24,D=x.rgba>>>16&255,S=x.rgba>>>8&255,M=Math.floor((Math.abs(m-y)+Math.abs(L-D)+Math.abs(b-S))/12);let T=!0;for(let A=0;A<g.data.length;A+=4)g.data[A]===m&&g.data[A+1]===L&&g.data[A+2]===b||w&&Math.abs(g.data[A]-m)+Math.abs(g.data[A+1]-L)+Math.abs(g.data[A+2]-b)<M?g.data[A+3]=0:T=!1;return T}function c(g,a,x){const w=g.createElement("canvas");return w.width=a,w.height=x,w}},577:function(k,e,h){var d=this&&this.__decorate||function(f,_,n,v){var u,s=arguments.length,c=s<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,n):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(f,_,n,v);else for(var g=f.length-1;g>=0;g--)(u=f[g])&&(c=(s<3?u(c):s>3?u(_,n,c):u(_,n))||c);return s>3&&c&&Object.defineProperty(_,n,c),c},o=this&&this.__param||function(f,_){return function(n,v){_(n,v,f)}};Object.defineProperty(e,"__esModule",{value:!0}),e.CharacterJoinerService=e.JoinedCellData=void 0;const r=h(147),l=h(855),p=h(782),C=h(97);class i extends r.AttributeData{constructor(_,n,v){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=n,this._width=v}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}e.JoinedCellData=i;let t=e.CharacterJoinerService=class Me{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(_){const n={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(n),n.id}deregister(_){for(let n=0;n<this._characterJoiners.length;n++)if(this._characterJoiners[n].id===_)return this._characterJoiners.splice(n,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const n=this._bufferService.buffer.lines.get(_);if(!n||n.length===0)return[];const v=[],u=n.translateToString(!0);let s=0,c=0,g=0,a=n.getFg(0),x=n.getBg(0);for(let w=0;w<n.getTrimmedLength();w++)if(n.loadCell(w,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==a||this._workCell.bg!==x){if(w-s>1){const m=this._getJoinedRanges(u,g,c,n,s);for(let L=0;L<m.length;L++)v.push(m[L])}s=w,g=c,a=this._workCell.fg,x=this._workCell.bg}c+=this._workCell.getChars().length||l.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-s>1){const w=this._getJoinedRanges(u,g,c,n,s);for(let m=0;m<w.length;m++)v.push(w[m])}return v}_getJoinedRanges(_,n,v,u,s){const c=_.substring(n,v);let g=[];try{g=this._characterJoiners[0].handler(c)}catch(a){console.error(a)}for(let a=1;a<this._characterJoiners.length;a++)try{const x=this._characterJoiners[a].handler(c);for(let w=0;w<x.length;w++)Me._mergeRanges(g,x[w])}catch(x){console.error(x)}return this._stringRangesToCellRanges(g,u,s),g}_stringRangesToCellRanges(_,n,v){let u=0,s=!1,c=0,g=_[u];if(g){for(let a=v;a<this._bufferService.cols;a++){const x=n.getWidth(a),w=n.getString(a).length||l.WHITESPACE_CELL_CHAR.length;if(x!==0){if(!s&&g[0]<=c&&(g[0]=a,s=!0),g[1]<=c){if(g[1]=a,g=_[++u],!g)break;g[0]<=c?(g[0]=a,s=!0):s=!1}c+=w}}g&&(g[1]=this._bufferService.cols)}}static _mergeRanges(_,n){let v=!1;for(let u=0;u<_.length;u++){const s=_[u];if(v){if(n[1]<=s[0])return _[u-1][1]=n[1],_;if(n[1]<=s[1])return _[u-1][1]=Math.max(n[1],s[1]),_.splice(u,1),_;_.splice(u,1),u--}else{if(n[1]<=s[0])return _.splice(u,0,n),_;if(n[1]<=s[1])return s[0]=Math.min(n[0],s[0]),_;n[0]<s[1]&&(s[0]=Math.min(n[0],s[0]),v=!0)}}return v?_[_.length-1][1]=n[1]:_.push(n),_}};e.CharacterJoinerService=t=d([o(0,C.IBufferService)],t)},160:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contrastRatio=e.toPaddedHex=e.rgba=e.rgb=e.css=e.color=e.channels=e.NULL_COLOR=void 0;let h=0,d=0,o=0,r=0;var l,p,C,i,t;function f(n){const v=n.toString(16);return v.length<2?"0"+v:v}function _(n,v){return n<v?(v+.05)/(n+.05):(n+.05)/(v+.05)}e.NULL_COLOR={css:"#00000000",rgba:0},(function(n){n.toCss=function(v,u,s,c){return c!==void 0?`#${f(v)}${f(u)}${f(s)}${f(c)}`:`#${f(v)}${f(u)}${f(s)}`},n.toRgba=function(v,u,s,c=255){return(v<<24|u<<16|s<<8|c)>>>0},n.toColor=function(v,u,s,c){return{css:n.toCss(v,u,s,c),rgba:n.toRgba(v,u,s,c)}}})(l||(e.channels=l={})),(function(n){function v(u,s){return r=Math.round(255*s),[h,d,o]=t.toChannels(u.rgba),{css:l.toCss(h,d,o,r),rgba:l.toRgba(h,d,o,r)}}n.blend=function(u,s){if(r=(255&s.rgba)/255,r===1)return{css:s.css,rgba:s.rgba};const c=s.rgba>>24&255,g=s.rgba>>16&255,a=s.rgba>>8&255,x=u.rgba>>24&255,w=u.rgba>>16&255,m=u.rgba>>8&255;return h=x+Math.round((c-x)*r),d=w+Math.round((g-w)*r),o=m+Math.round((a-m)*r),{css:l.toCss(h,d,o),rgba:l.toRgba(h,d,o)}},n.isOpaque=function(u){return(255&u.rgba)==255},n.ensureContrastRatio=function(u,s,c){const g=t.ensureContrastRatio(u.rgba,s.rgba,c);if(g)return l.toColor(g>>24&255,g>>16&255,g>>8&255)},n.opaque=function(u){const s=(255|u.rgba)>>>0;return[h,d,o]=t.toChannels(s),{css:l.toCss(h,d,o),rgba:s}},n.opacity=v,n.multiplyOpacity=function(u,s){return r=255&u.rgba,v(u,r*s/255)},n.toColorRGB=function(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}})(p||(e.color=p={})),(function(n){let v,u;try{const s=document.createElement("canvas");s.width=1,s.height=1;const c=s.getContext("2d",{willReadFrequently:!0});c&&(v=c,v.globalCompositeOperation="copy",u=v.createLinearGradient(0,0,1,1))}catch{}n.toColor=function(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return h=parseInt(s.slice(1,2).repeat(2),16),d=parseInt(s.slice(2,3).repeat(2),16),o=parseInt(s.slice(3,4).repeat(2),16),l.toColor(h,d,o);case 5:return h=parseInt(s.slice(1,2).repeat(2),16),d=parseInt(s.slice(2,3).repeat(2),16),o=parseInt(s.slice(3,4).repeat(2),16),r=parseInt(s.slice(4,5).repeat(2),16),l.toColor(h,d,o,r);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}const c=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return h=parseInt(c[1]),d=parseInt(c[2]),o=parseInt(c[3]),r=Math.round(255*(c[5]===void 0?1:parseFloat(c[5]))),l.toColor(h,d,o,r);if(!v||!u)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=u,v.fillStyle=s,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[h,d,o,r]=v.getImageData(0,0,1,1).data,r!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:l.toRgba(h,d,o,r),css:s}}})(C||(e.css=C={})),(function(n){function v(u,s,c){const g=u/255,a=s/255,x=c/255;return .2126*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.7152*(a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4))+.0722*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))}n.relativeLuminance=function(u){return v(u>>16&255,u>>8&255,255&u)},n.relativeLuminance2=v})(i||(e.rgb=i={})),(function(n){function v(s,c,g){const a=s>>24&255,x=s>>16&255,w=s>>8&255;let m=c>>24&255,L=c>>16&255,b=c>>8&255,y=_(i.relativeLuminance2(m,L,b),i.relativeLuminance2(a,x,w));for(;y<g&&(m>0||L>0||b>0);)m-=Math.max(0,Math.ceil(.1*m)),L-=Math.max(0,Math.ceil(.1*L)),b-=Math.max(0,Math.ceil(.1*b)),y=_(i.relativeLuminance2(m,L,b),i.relativeLuminance2(a,x,w));return(m<<24|L<<16|b<<8|255)>>>0}function u(s,c,g){const a=s>>24&255,x=s>>16&255,w=s>>8&255;let m=c>>24&255,L=c>>16&255,b=c>>8&255,y=_(i.relativeLuminance2(m,L,b),i.relativeLuminance2(a,x,w));for(;y<g&&(m<255||L<255||b<255);)m=Math.min(255,m+Math.ceil(.1*(255-m))),L=Math.min(255,L+Math.ceil(.1*(255-L))),b=Math.min(255,b+Math.ceil(.1*(255-b))),y=_(i.relativeLuminance2(m,L,b),i.relativeLuminance2(a,x,w));return(m<<24|L<<16|b<<8|255)>>>0}n.blend=function(s,c){if(r=(255&c)/255,r===1)return c;const g=c>>24&255,a=c>>16&255,x=c>>8&255,w=s>>24&255,m=s>>16&255,L=s>>8&255;return h=w+Math.round((g-w)*r),d=m+Math.round((a-m)*r),o=L+Math.round((x-L)*r),l.toRgba(h,d,o)},n.ensureContrastRatio=function(s,c,g){const a=i.relativeLuminance(s>>8),x=i.relativeLuminance(c>>8);if(_(a,x)<g){if(x<a){const L=v(s,c,g),b=_(a,i.relativeLuminance(L>>8));if(b<g){const y=u(s,c,g);return b>_(a,i.relativeLuminance(y>>8))?L:y}return L}const w=u(s,c,g),m=_(a,i.relativeLuminance(w>>8));if(m<g){const L=v(s,c,g);return m>_(a,i.relativeLuminance(L>>8))?w:L}return w}},n.reduceLuminance=v,n.increaseLuminance=u,n.toChannels=function(s){return[s>>24&255,s>>16&255,s>>8&255,255&s]}})(t||(e.rgba=t={})),e.toPaddedHex=f,e.contrastRatio=_},345:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.runAndSubscribe=e.forwardEvent=e.EventEmitter=void 0,e.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===h)return void this._listeners.splice(d,1)}}})),this._event}fire(h,d){const o=[];for(let r=0;r<this._listeners.length;r++)o.push(this._listeners[r]);for(let r=0;r<o.length;r++)o[r].call(void 0,h,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},e.forwardEvent=function(h,d){return h((o=>d.fire(o)))},e.runAndSubscribe=function(h,d){return d(void 0),h((o=>d(o)))}},859:(k,e)=>{function h(d){for(const o of d)o.dispose();d.length=0}Object.defineProperty(e,"__esModule",{value:!0}),e.getDisposeArrayDisposable=e.disposeArray=e.toDisposable=e.MutableDisposable=e.Disposable=void 0,e.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const o=this._disposables.indexOf(d);o!==-1&&this._disposables.splice(o,1)}},e.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var o;this._isDisposed||d===this._value||((o=this._value)==null||o.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},e.toDisposable=function(d){return{dispose:d}},e.disposeArray=h,e.getDisposeArrayDisposable=function(d){return{dispose:()=>h(d)}}},485:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FourKeyMap=e.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(o,r,l){this._data[o]||(this._data[o]={}),this._data[o][r]=l}get(o,r){return this._data[o]?this._data[o][r]:void 0}clear(){this._data={}}}e.TwoKeyMap=h,e.FourKeyMap=class{constructor(){this._data=new h}set(d,o,r,l,p){this._data.get(d,o)||this._data.set(d,o,new h),this._data.get(d,o).set(r,l,p)}get(d,o,r,l){var p;return(p=this._data.get(d,o))==null?void 0:p.get(r,l)}clear(){this._data.clear()}}},399:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isChromeOS=e.isLinux=e.isWindows=e.isIphone=e.isIpad=e.isMac=e.getSafariVersion=e.isSafari=e.isLegacyEdge=e.isFirefox=e.isNode=void 0,e.isNode=typeof process<"u"&&"title"in process;const h=e.isNode?"node":navigator.userAgent,d=e.isNode?"node":navigator.platform;e.isFirefox=h.includes("Firefox"),e.isLegacyEdge=h.includes("Edge"),e.isSafari=/^((?!chrome|android).)*safari/i.test(h),e.getSafariVersion=function(){if(!e.isSafari)return 0;const o=h.match(/Version\/(\d+)/);return o===null||o.length<2?0:parseInt(o[1])},e.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),e.isIpad=d==="iPad",e.isIphone=d==="iPhone",e.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),e.isLinux=d.indexOf("Linux")>=0,e.isChromeOS=/\bCrOS\b/.test(h)},385:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DebouncedIdleTask=e.IdleTaskQueue=e.PriorityTaskQueue=void 0;const d=h(399);class o{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(p){this._idleCallback=void 0;let C=0,i=0,t=p.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),i=Math.max(C,i),f=p.timeRemaining(),1.5*i>f)return t-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(t-C))}ms`),void this._start();t=f}this.clear()}}class r extends o{_requestCallback(p){return setTimeout((()=>p(this._createDeadline(16))))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const C=Date.now()+p;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}e.PriorityTaskQueue=r,e.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends o{_requestCallback(l){return requestIdleCallback(l)}_cancelCallback(l){cancelIdleCallback(l)}}:r,e.DebouncedIdleTask=class{constructor(){this._queue=new e.IdleTaskQueue}set(l){this._queue.clear(),this._queue.enqueue(l)}flush(){this._queue.flush()}}},147:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedAttrs=e.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(r){return[r>>>16&255,r>>>8&255,255&r]}static fromColorRGB(r){return(255&r[0])<<16|(255&r[1])<<8|255&r[2]}clone(){const r=new h;return r.fg=this.fg,r.bg=this.bg,r.extended=this.extended.clone(),r}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}e.AttributeData=h;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(r){this._ext=r}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(r){this._ext&=-469762049,this._ext|=r<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(r){this._ext&=-67108864,this._ext|=67108863&r}get urlId(){return this._urlId}set urlId(r){this._urlId=r}get underlineVariantOffset(){const r=(3758096384&this._ext)>>29;return r<0?4294967288^r:r}set underlineVariantOffset(r){this._ext&=536870911,this._ext|=r<<29&3758096384}constructor(r=0,l=0){this._ext=0,this._urlId=0,this._ext=r,this._urlId=l}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}e.ExtendedAttrs=d},782:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CellData=void 0;const d=h(133),o=h(855),r=h(147);class l extends r.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new r.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const i=new l;return i.setFromCharData(C),i}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[o.CHAR_DATA_ATTR_INDEX],this.bg=0;let i=!1;if(C[o.CHAR_DATA_CHAR_INDEX].length>2)i=!0;else if(C[o.CHAR_DATA_CHAR_INDEX].length===2){const t=C[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=t&&t<=56319){const f=C[o.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(t-55296)+f-56320+65536|C[o.CHAR_DATA_WIDTH_INDEX]<<22:i=!0}else i=!0}else this.content=C[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[o.CHAR_DATA_WIDTH_INDEX]<<22;i&&(this.combinedData=C[o.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[o.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}e.CellData=l},855:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WHITESPACE_CELL_CODE=e.WHITESPACE_CELL_WIDTH=e.WHITESPACE_CELL_CHAR=e.NULL_CELL_CODE=e.NULL_CELL_WIDTH=e.NULL_CELL_CHAR=e.CHAR_DATA_CODE_INDEX=e.CHAR_DATA_WIDTH_INDEX=e.CHAR_DATA_CHAR_INDEX=e.CHAR_DATA_ATTR_INDEX=e.DEFAULT_EXT=e.DEFAULT_ATTR=e.DEFAULT_COLOR=void 0,e.DEFAULT_COLOR=0,e.DEFAULT_ATTR=256|e.DEFAULT_COLOR<<9,e.DEFAULT_EXT=0,e.CHAR_DATA_ATTR_INDEX=0,e.CHAR_DATA_CHAR_INDEX=1,e.CHAR_DATA_WIDTH_INDEX=2,e.CHAR_DATA_CODE_INDEX=3,e.NULL_CELL_CHAR="",e.NULL_CELL_WIDTH=1,e.NULL_CELL_CODE=0,e.WHITESPACE_CELL_CHAR=" ",e.WHITESPACE_CELL_WIDTH=1,e.WHITESPACE_CELL_CODE=32},133:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Utf8ToUtf32=e.StringToUtf32=e.utf32ToString=e.stringFromCodePoint=void 0,e.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},e.utf32ToString=function(h,d=0,o=h.length){let r="";for(let l=d;l<o;++l){let p=h[l];p>65535?(p-=65536,r+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):r+=String.fromCharCode(p)}return r},e.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,d){const o=h.length;if(!o)return 0;let r=0,l=0;if(this._interim){const p=h.charCodeAt(l++);56320<=p&&p<=57343?d[r++]=1024*(this._interim-55296)+p-56320+65536:(d[r++]=this._interim,d[r++]=p),this._interim=0}for(let p=l;p<o;++p){const C=h.charCodeAt(p);if(55296<=C&&C<=56319){if(++p>=o)return this._interim=C,r;const i=h.charCodeAt(p);56320<=i&&i<=57343?d[r++]=1024*(C-55296)+i-56320+65536:(d[r++]=C,d[r++]=i)}else C!==65279&&(d[r++]=C)}return r}},e.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,d){const o=h.length;if(!o)return 0;let r,l,p,C,i=0,t=0,f=0;if(this.interim[0]){let v=!1,u=this.interim[0];u&=(224&u)==192?31:(240&u)==224?15:7;let s,c=0;for(;(s=63&this.interim[++c])&&c<4;)u<<=6,u|=s;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,a=g-c;for(;f<a;){if(f>=o)return 0;if(s=h[f++],(192&s)!=128){f--,v=!0;break}this.interim[c++]=s,u<<=6,u|=63&s}v||(g===2?u<128?f--:d[i++]=u:g===3?u<2048||u>=55296&&u<=57343||u===65279||(d[i++]=u):u<65536||u>1114111||(d[i++]=u)),this.interim.fill(0)}const _=o-4;let n=f;for(;n<o;){for(;!(!(n<_)||128&(r=h[n])||128&(l=h[n+1])||128&(p=h[n+2])||128&(C=h[n+3]));)d[i++]=r,d[i++]=l,d[i++]=p,d[i++]=C,n+=4;if(r=h[n++],r<128)d[i++]=r;else if((224&r)==192){if(n>=o)return this.interim[0]=r,i;if(l=h[n++],(192&l)!=128){n--;continue}if(t=(31&r)<<6|63&l,t<128){n--;continue}d[i++]=t}else if((240&r)==224){if(n>=o)return this.interim[0]=r,i;if(l=h[n++],(192&l)!=128){n--;continue}if(n>=o)return this.interim[0]=r,this.interim[1]=l,i;if(p=h[n++],(192&p)!=128){n--;continue}if(t=(15&r)<<12|(63&l)<<6|63&p,t<2048||t>=55296&&t<=57343||t===65279)continue;d[i++]=t}else if((248&r)==240){if(n>=o)return this.interim[0]=r,i;if(l=h[n++],(192&l)!=128){n--;continue}if(n>=o)return this.interim[0]=r,this.interim[1]=l,i;if(p=h[n++],(192&p)!=128){n--;continue}if(n>=o)return this.interim[0]=r,this.interim[1]=l,this.interim[2]=p,i;if(C=h[n++],(192&C)!=128){n--;continue}if(t=(7&r)<<18|(63&l)<<12|(63&p)<<6|63&C,t<65536||t>1114111)continue;d[i++]=t}}return i}}},776:function(k,e,h){var d=this&&this.__decorate||function(t,f,_,n){var v,u=arguments.length,s=u<3?f:n===null?n=Object.getOwnPropertyDescriptor(f,_):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,f,_,n);else for(var c=t.length-1;c>=0;c--)(v=t[c])&&(s=(u<3?v(s):u>3?v(f,_,s):v(f,_))||s);return u>3&&s&&Object.defineProperty(f,_,s),s},o=this&&this.__param||function(t,f){return function(_,n){f(_,n,t)}};Object.defineProperty(e,"__esModule",{value:!0}),e.traceCall=e.setTraceLogger=e.LogService=void 0;const r=h(859),l=h(97),p={trace:l.LogLevelEnum.TRACE,debug:l.LogLevelEnum.DEBUG,info:l.LogLevelEnum.INFO,warn:l.LogLevelEnum.WARN,error:l.LogLevelEnum.ERROR,off:l.LogLevelEnum.OFF};let C,i=e.LogService=class extends r.Disposable{get logLevel(){return this._logLevel}constructor(t){super(),this._optionsService=t,this._logLevel=l.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let f=0;f<t.length;f++)typeof t[f]=="function"&&(t[f]=t[f]())}_log(t,f,_){this._evalLazyOptionalParams(_),t.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,..._)}trace(t,...f){var _;this._logLevel<=l.LogLevelEnum.TRACE&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.trace.bind(this._optionsService.options.logger))??console.log,t,f)}debug(t,...f){var _;this._logLevel<=l.LogLevelEnum.DEBUG&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.debug.bind(this._optionsService.options.logger))??console.log,t,f)}info(t,...f){var _;this._logLevel<=l.LogLevelEnum.INFO&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.info.bind(this._optionsService.options.logger))??console.info,t,f)}warn(t,...f){var _;this._logLevel<=l.LogLevelEnum.WARN&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.warn.bind(this._optionsService.options.logger))??console.warn,t,f)}error(t,...f){var _;this._logLevel<=l.LogLevelEnum.ERROR&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.error.bind(this._optionsService.options.logger))??console.error,t,f)}};e.LogService=i=d([o(0,l.IOptionsService)],i),e.setTraceLogger=function(t){C=t},e.traceCall=function(t,f,_){if(typeof _.value!="function")throw new Error("not supported");const n=_.value;_.value=function(...v){if(C.logLevel!==l.LogLevelEnum.TRACE)return n.apply(this,v);C.trace(`GlyphRenderer#${n.name}(${v.map((s=>JSON.stringify(s))).join(", ")})`);const u=n.apply(this,v);return C.trace(`GlyphRenderer#${n.name} return`,u),u}}},726:(k,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createDecorator=e.getServiceDependencies=e.serviceRegistry=void 0;const h="di$target",d="di$dependencies";e.serviceRegistry=new Map,e.getServiceDependencies=function(o){return o[d]||[]},e.createDecorator=function(o){if(e.serviceRegistry.has(o))return e.serviceRegistry.get(o);const r=function(l,p,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(i,t,f){t[h]===t?t[d].push({id:i,index:f}):(t[d]=[{id:i,index:f}],t[h]=t)})(r,l,C)};return r.toString=()=>o,e.serviceRegistry.set(o,r),r}},97:(k,e,h)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IDecorationService=e.IUnicodeService=e.IOscLinkService=e.IOptionsService=e.ILogService=e.LogLevelEnum=e.IInstantiationService=e.ICharsetService=e.ICoreService=e.ICoreMouseService=e.IBufferService=void 0;const d=h(726);var o;e.IBufferService=(0,d.createDecorator)("BufferService"),e.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),e.ICoreService=(0,d.createDecorator)("CoreService"),e.ICharsetService=(0,d.createDecorator)("CharsetService"),e.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(r){r[r.TRACE=0]="TRACE",r[r.DEBUG=1]="DEBUG",r[r.INFO=2]="INFO",r[r.WARN=3]="WARN",r[r.ERROR=4]="ERROR",r[r.OFF=5]="OFF"})(o||(e.LogLevelEnum=o={})),e.ILogService=(0,d.createDecorator)("LogService"),e.IOptionsService=(0,d.createDecorator)("OptionsService"),e.IOscLinkService=(0,d.createDecorator)("OscLinkService"),e.IUnicodeService=(0,d.createDecorator)("UnicodeService"),e.IDecorationService=(0,d.createDecorator)("DecorationService")}},J={};function N(k){var e=J[k];if(e!==void 0)return e.exports;var h=J[k]={exports:{}};return te[k].call(h.exports,h,h.exports,N),h.exports}var ie={};return(()=>{var k=ie;Object.defineProperty(k,"__esModule",{value:!0}),k.CanvasAddon=void 0;const e=N(345),h=N(859),d=N(776),o=N(949);class r extends h.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new e.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new e.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var p;return(p=this._renderer)==null?void 0:p.textureAtlas}activate(p){const C=p._core;if(!p.element)return void this.register(C.onWillOpen((()=>this.activate(p))));this._terminal=p;const i=C.coreService,t=C.optionsService,f=C.screenElement,_=C.linkifier,n=C,v=n._bufferService,u=n._renderService,s=n._characterJoinerService,c=n._charSizeService,g=n._coreBrowserService,a=n._decorationService,x=n._logService,w=n._themeService;(0,d.setTraceLogger)(x),this._renderer=new o.CanvasRenderer(p,f,_,v,c,t,s,i,g,a,w),this.register((0,e.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,e.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),u.setRenderer(this._renderer),u.handleResize(v.cols,v.rows),this.register((0,h.toDisposable)((()=>{var m;u.setRenderer(this._terminal._core._createRenderer()),u.handleResize(p.cols,p.rows),(m=this._renderer)==null||m.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var p;(p=this._renderer)==null||p.clearTextureAtlas()}}k.CanvasAddon=r})(),ie})()))})(Ce)),Ce.exports}var ke=Te();const Ee=De({__proto__:null},[ke]);export{Ee as a};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
3
+ * @license MIT
4
+ *
5
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
6
+ * @license MIT
7
+ *
8
+ * Originally forked from (with the author's permission):
9
+ * Fabrice Bellard's javascript vt100 for jslinux:
10
+ * http://bellard.org/jslinux/
11
+ * Copyright (c) 2011 Fabrice Bellard
12
+ */var c=2,d=1,_=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var l;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let i=this._terminal.options.scrollback===0?0:((l=this._terminal.options.overviewRuler)==null?void 0:l.width)||14,s=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(s.getPropertyValue("height")),a=Math.max(0,parseInt(s.getPropertyValue("width"))),t=window.getComputedStyle(this._terminal.element),r={top:parseInt(t.getPropertyValue("padding-top")),bottom:parseInt(t.getPropertyValue("padding-bottom")),right:parseInt(t.getPropertyValue("padding-right")),left:parseInt(t.getPropertyValue("padding-left"))},n=r.top+r.bottom,h=r.right+r.left,m=o-n,p=a-h-i;return{cols:Math.max(c,Math.floor(p/e.css.cell.width)),rows:Math.max(d,Math.floor(m/e.css.cell.height))}}};export{_ as FitAddon};