@hienlh/ppm 0.23.26 → 0.23.27

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 (586) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/assets/skills/ppm/SKILL.md +1 -1
  3. package/assets/skills/ppm/references/http-api.md +1 -1
  4. package/dist/web/assets/accounts-settings-section-CZglHifc.js +1 -0
  5. package/dist/web/assets/accounts-settings-section-CZglHifc.js.br +0 -0
  6. package/dist/web/assets/accounts-settings-section-CZglHifc.js.gz +0 -0
  7. package/dist/web/assets/{agent-session-sheet-DmbSfFGz.js → agent-session-sheet-B3VLD2H6.js} +2 -2
  8. package/dist/web/assets/agent-session-sheet-B3VLD2H6.js.br +0 -0
  9. package/dist/web/assets/agent-session-sheet-B3VLD2H6.js.gz +0 -0
  10. package/dist/web/assets/{agent-session-window-content-Dk8x3ozF.js → agent-session-window-content-HEdIT_LQ.js} +1 -1
  11. package/dist/web/assets/agent-session-window-content-HEdIT_LQ.js.br +0 -0
  12. package/dist/web/assets/agent-session-window-content-HEdIT_LQ.js.gz +0 -0
  13. package/dist/web/assets/{ai-resource-editor-MKwjYcDh.js → ai-resource-editor-CFbXgGMo.js} +1 -1
  14. package/dist/web/assets/ai-resource-editor-CFbXgGMo.js.br +0 -0
  15. package/dist/web/assets/ai-resource-editor-CFbXgGMo.js.gz +0 -0
  16. package/dist/web/assets/ai-settings-section-BNiVD9D3.js +1 -0
  17. package/dist/web/assets/ai-settings-section-BNiVD9D3.js.br +0 -0
  18. package/dist/web/assets/ai-settings-section-BNiVD9D3.js.gz +0 -0
  19. package/dist/web/assets/{ai-settings-section-OZOaLw5z.js → ai-settings-section-W0kfADRB.js} +1 -1
  20. package/dist/web/assets/{android-tab-CUkjbfyi.js → android-tab-CY3aa_vU.js} +1 -1
  21. package/dist/web/assets/android-tab-CY3aa_vU.js.br +0 -0
  22. package/dist/web/assets/android-tab-CY3aa_vU.js.gz +0 -0
  23. package/dist/web/assets/{appearance-settings-section-BZsM8HpZ.js → appearance-settings-section-lbtuzecW.js} +1 -1
  24. package/dist/web/assets/appearance-settings-section-lbtuzecW.js.br +0 -0
  25. package/dist/web/assets/appearance-settings-section-lbtuzecW.js.gz +0 -0
  26. package/dist/web/assets/{apps-panel-Cs3utBlp.js → apps-panel-CF2mbvVq.js} +1 -1
  27. package/dist/web/assets/apps-panel-CF2mbvVq.js.br +0 -0
  28. package/dist/web/assets/apps-panel-CF2mbvVq.js.gz +0 -0
  29. package/dist/web/assets/branch-review-tab-CR7JnS5x.js +1 -0
  30. package/dist/web/assets/branch-review-tab-CR7JnS5x.js.br +0 -0
  31. package/dist/web/assets/branch-review-tab-CR7JnS5x.js.gz +0 -0
  32. package/dist/web/assets/chat-tab-BCELq4nK.js +1 -0
  33. package/dist/web/assets/chat-tab-BCELq4nK.js.br +0 -0
  34. package/dist/web/assets/chat-tab-BCELq4nK.js.gz +0 -0
  35. package/dist/web/assets/{chat-tab-DtSHSfMU.js → chat-tab-C4aOYSea.js} +10 -10
  36. package/dist/web/assets/chat-tab-C4aOYSea.js.br +0 -0
  37. package/dist/web/assets/chat-tab-C4aOYSea.js.gz +0 -0
  38. package/dist/web/assets/{code-editor-DjDyhff1.js → code-editor-_axJbYkP.js} +5 -5
  39. package/dist/web/assets/code-editor-_axJbYkP.js.br +0 -0
  40. package/dist/web/assets/code-editor-_axJbYkP.js.gz +0 -0
  41. package/dist/web/assets/{codex-reset-credit-button-BKgiUi8E.js → codex-reset-credit-button-DJQD6NUF.js} +1 -1
  42. package/dist/web/assets/codex-reset-credit-button-DJQD6NUF.js.br +0 -0
  43. package/dist/web/assets/codex-reset-credit-button-DJQD6NUF.js.gz +0 -0
  44. package/dist/web/assets/{conflict-editor-DgTv-8pb.js → conflict-editor-D0AYuLKI.js} +3 -3
  45. package/dist/web/assets/conflict-editor-D0AYuLKI.js.br +0 -0
  46. package/dist/web/assets/conflict-editor-D0AYuLKI.js.gz +0 -0
  47. package/dist/web/assets/connection-form-tab-C3QyUWnE.js +4 -0
  48. package/dist/web/assets/connection-form-tab-C3QyUWnE.js.br +0 -0
  49. package/dist/web/assets/connection-form-tab-C3QyUWnE.js.gz +0 -0
  50. package/dist/web/assets/{csv-preview-BTGpYs4p.js → csv-preview-CmKkcz4M.js} +1 -1
  51. package/dist/web/assets/csv-preview-CmKkcz4M.js.br +0 -0
  52. package/dist/web/assets/csv-preview-CmKkcz4M.js.gz +0 -0
  53. package/dist/web/assets/{db-explorer-store-DDePT3UI.js → db-explorer-store-DJNNIfN5.js} +1 -1
  54. package/dist/web/assets/db-explorer-store-DJNNIfN5.js.br +0 -0
  55. package/dist/web/assets/db-explorer-store-DJNNIfN5.js.gz +0 -0
  56. package/dist/web/assets/{db-sidebar-reveal-BeT8cp6P.js → db-sidebar-reveal-CGqWBYay.js} +1 -1
  57. package/dist/web/assets/db-sidebar-reveal-CGqWBYay.js.br +0 -0
  58. package/dist/web/assets/db-sidebar-reveal-CGqWBYay.js.gz +0 -0
  59. package/dist/web/assets/{db-tab-parts-BYzd4_sR.js → db-tab-parts-BXL34wrZ.js} +1 -1
  60. package/dist/web/assets/db-tab-parts-BXL34wrZ.js.br +0 -0
  61. package/dist/web/assets/db-tab-parts-BXL34wrZ.js.gz +0 -0
  62. package/dist/web/assets/{design-settings-section-B3KQBggK.js → design-settings-section-DukfVtwP.js} +2 -2
  63. package/dist/web/assets/design-settings-section-DukfVtwP.js.br +0 -0
  64. package/dist/web/assets/design-settings-section-DukfVtwP.js.gz +0 -0
  65. package/dist/web/assets/{design-tab-CPyj_nFg.js → design-tab-BoPiL2ge.js} +5 -5
  66. package/dist/web/assets/design-tab-BoPiL2ge.js.br +0 -0
  67. package/dist/web/assets/design-tab-BoPiL2ge.js.gz +0 -0
  68. package/dist/web/assets/{designs-sidebar-panel-DIGPFo2l.js → designs-sidebar-panel-BVTqPPzG.js} +1 -1
  69. package/dist/web/assets/designs-sidebar-panel-BVTqPPzG.js.br +0 -0
  70. package/dist/web/assets/designs-sidebar-panel-BVTqPPzG.js.gz +0 -0
  71. package/dist/web/assets/diff-viewer-C86mR7vD.js +4 -0
  72. package/dist/web/assets/diff-viewer-C86mR7vD.js.br +0 -0
  73. package/dist/web/assets/diff-viewer-C86mR7vD.js.gz +0 -0
  74. package/dist/web/assets/{docx-preview-CowHGqML.js → docx-preview-B9EhDCMi.js} +1 -1
  75. package/dist/web/assets/docx-preview-B9EhDCMi.js.br +0 -0
  76. package/dist/web/assets/docx-preview-B9EhDCMi.js.gz +0 -0
  77. package/dist/web/assets/{editor-dialog-xPoehDYp.js → editor-dialog-DTDsbJd6.js} +1 -1
  78. package/dist/web/assets/editor-dialog-DTDsbJd6.js.br +0 -0
  79. package/dist/web/assets/editor-dialog-DTDsbJd6.js.gz +0 -0
  80. package/dist/web/assets/{editor-language-service-DdYqCDBU.js → editor-language-service-BtrrQAS2.js} +1 -1
  81. package/dist/web/assets/editor-language-service-BtrrQAS2.js.br +0 -0
  82. package/dist/web/assets/editor-language-service-BtrrQAS2.js.gz +0 -0
  83. package/dist/web/assets/explorer-body-DLaWmxri.js +2 -0
  84. package/dist/web/assets/explorer-body-DLaWmxri.js.br +0 -0
  85. package/dist/web/assets/explorer-body-DLaWmxri.js.gz +0 -0
  86. package/dist/web/assets/{explorer-model-tGyFETP_.js → explorer-model-f5q-50DN.js} +1 -1
  87. package/dist/web/assets/explorer-model-f5q-50DN.js.br +0 -0
  88. package/dist/web/assets/explorer-model-f5q-50DN.js.gz +0 -0
  89. package/dist/web/assets/{explorer-window-content-B1c4QTVL.js → explorer-window-content-CbUIbrzL.js} +1 -1
  90. package/dist/web/assets/explorer-window-content-CbUIbrzL.js.br +0 -0
  91. package/dist/web/assets/explorer-window-content-CbUIbrzL.js.gz +0 -0
  92. package/dist/web/assets/{extension-manager-section-BgL0Uyl3.js → extension-manager-section-BpKMyLwI.js} +1 -1
  93. package/dist/web/assets/extension-manager-section-BpKMyLwI.js.br +0 -0
  94. package/dist/web/assets/extension-manager-section-BpKMyLwI.js.gz +0 -0
  95. package/dist/web/assets/{extension-webview-BWB1Yd-t.js → extension-webview-BGfyaXMI.js} +1 -1
  96. package/dist/web/assets/extension-webview-BGfyaXMI.js.br +0 -0
  97. package/dist/web/assets/extension-webview-BGfyaXMI.js.gz +0 -0
  98. package/dist/web/assets/{files-settings-section-TmoewoO2.js → files-settings-section-CQT9_rX2.js} +1 -1
  99. package/dist/web/assets/files-settings-section-CQT9_rX2.js.br +0 -0
  100. package/dist/web/assets/files-settings-section-CQT9_rX2.js.gz +0 -0
  101. package/dist/web/assets/{general-settings-section-Bu7o8uUn.js → general-settings-section-BoQGeqBi.js} +1 -1
  102. package/dist/web/assets/general-settings-section-BoQGeqBi.js.br +0 -0
  103. package/dist/web/assets/general-settings-section-BoQGeqBi.js.gz +0 -0
  104. package/dist/web/assets/{git-log-panel-RjMZIaCk.js → git-log-panel-T8Fzn8-5.js} +1 -1
  105. package/dist/web/assets/git-log-panel-T8Fzn8-5.js.br +0 -0
  106. package/dist/web/assets/git-log-panel-T8Fzn8-5.js.gz +0 -0
  107. package/dist/web/assets/git-review-tab-WzuX4Ml9.js +3 -0
  108. package/dist/web/assets/git-review-tab-WzuX4Ml9.js.br +0 -0
  109. package/dist/web/assets/git-review-tab-WzuX4Ml9.js.gz +0 -0
  110. package/dist/web/assets/{glide-data-grid-DqlTFhhf.js → glide-data-grid-BBzGDYvj.js} +8 -8
  111. package/dist/web/assets/glide-data-grid-BBzGDYvj.js.br +0 -0
  112. package/dist/web/assets/glide-data-grid-BBzGDYvj.js.gz +0 -0
  113. package/dist/web/assets/{grid-save-dialog-BmF2Gy_E.js → grid-save-dialog-HiqlnSky.js} +1 -1
  114. package/dist/web/assets/grid-save-dialog-HiqlnSky.js.br +0 -0
  115. package/dist/web/assets/grid-save-dialog-HiqlnSky.js.gz +0 -0
  116. package/dist/web/assets/group-chat-tab-URU3FCLs.js +1 -0
  117. package/dist/web/assets/group-chat-tab-URU3FCLs.js.br +0 -0
  118. package/dist/web/assets/group-chat-tab-URU3FCLs.js.gz +0 -0
  119. package/dist/web/assets/{impexp-tab-B8d4oBOB.js → impexp-tab-B0m1Q8ia.js} +1 -1
  120. package/dist/web/assets/impexp-tab-B0m1Q8ia.js.br +0 -0
  121. package/dist/web/assets/impexp-tab-B0m1Q8ia.js.gz +0 -0
  122. package/dist/web/assets/index-Cb3Z6wNy.css +1 -0
  123. package/dist/web/assets/index-Cb3Z6wNy.css.br +0 -0
  124. package/dist/web/assets/{index-2_Pz5MiI.css.gz → index-Cb3Z6wNy.css.gz} +0 -0
  125. package/dist/web/assets/{index-Cx9ZRibz.js → index-Vd9Xr54k.js} +19 -19
  126. package/dist/web/assets/index-Vd9Xr54k.js.br +0 -0
  127. package/dist/web/assets/index-Vd9Xr54k.js.gz +0 -0
  128. package/dist/web/assets/{jira-watcher-section-LGTWVN87.js → jira-watcher-section-CnSTbAF6.js} +1 -1
  129. package/dist/web/assets/keybindings-store-D_U8jECl.js +1 -0
  130. package/dist/web/assets/{keyboard-shortcuts-section-BSMgmbOR.js → keyboard-shortcuts-section-CU7JjDsU.js} +1 -1
  131. package/dist/web/assets/keyboard-shortcuts-section-CU7JjDsU.js.br +0 -0
  132. package/dist/web/assets/keyboard-shortcuts-section-CU7JjDsU.js.gz +0 -0
  133. package/dist/web/assets/{language-servers-section-DO9wnwnG.js → language-servers-section-CzUG9H69.js} +2 -2
  134. package/dist/web/assets/language-servers-section-CzUG9H69.js.br +0 -0
  135. package/dist/web/assets/language-servers-section-CzUG9H69.js.gz +0 -0
  136. package/dist/web/assets/logs-app-CDSvyY1H.js +13 -0
  137. package/dist/web/assets/logs-app-CDSvyY1H.js.br +0 -0
  138. package/dist/web/assets/logs-app-CDSvyY1H.js.gz +0 -0
  139. package/dist/web/assets/logs-tab-CQw9vrNw.js +1 -0
  140. package/dist/web/assets/{logs-window-content-Cejko0VD.js → logs-window-content-CGvPnPrr.js} +1 -1
  141. package/dist/web/assets/{lsp-client-IsC8Ol0U.js → lsp-client-CpjPUUYJ.js} +1 -1
  142. package/dist/web/assets/lsp-client-CpjPUUYJ.js.br +0 -0
  143. package/dist/web/assets/lsp-client-CpjPUUYJ.js.gz +0 -0
  144. package/dist/web/assets/{markdown-renderer-D5vxN2fO.js → markdown-renderer-3ZR2x0CC.js} +1 -1
  145. package/dist/web/assets/{markdown-renderer-BfZiHaNy.js → markdown-renderer-DZNMRg6p.js} +2 -2
  146. package/dist/web/assets/markdown-renderer-DZNMRg6p.js.br +0 -0
  147. package/dist/web/assets/markdown-renderer-DZNMRg6p.js.gz +0 -0
  148. package/dist/web/assets/{mobile-explorer-sheet-Dz3eJdBl.js → mobile-explorer-sheet-D7e-MM6m.js} +1 -1
  149. package/dist/web/assets/mobile-explorer-sheet-D7e-MM6m.js.br +0 -0
  150. package/dist/web/assets/mobile-explorer-sheet-D7e-MM6m.js.gz +0 -0
  151. package/dist/web/assets/{new-design-dialog-B8zeJoJQ.js → new-design-dialog-BthM423i.js} +1 -1
  152. package/dist/web/assets/new-design-dialog-BthM423i.js.br +0 -0
  153. package/dist/web/assets/new-design-dialog-BthM423i.js.gz +0 -0
  154. package/dist/web/assets/notification-store-GKweleCQ.js +1 -0
  155. package/dist/web/assets/{notifications-settings-section-CMZXQw72.js → notifications-settings-section-TS3gNFcc.js} +1 -1
  156. package/dist/web/assets/notifications-settings-section-TS3gNFcc.js.br +0 -0
  157. package/dist/web/assets/notifications-settings-section-TS3gNFcc.js.gz +0 -0
  158. package/dist/web/assets/{open-db-tabs-DYTZbguT.js → open-db-tabs-DBgV2hbA.js} +1 -1
  159. package/dist/web/assets/open-db-tabs-DBgV2hbA.js.br +0 -0
  160. package/dist/web/assets/open-db-tabs-DBgV2hbA.js.gz +0 -0
  161. package/dist/web/assets/{open-settings-BGtoVEAU.js → open-settings-DWbF5YsE.js} +1 -1
  162. package/dist/web/assets/{overview-panel-7_8b6pwr.js → overview-panel-C5EmTk1R.js} +1 -1
  163. package/dist/web/assets/overview-panel-C5EmTk1R.js.br +0 -0
  164. package/dist/web/assets/overview-panel-C5EmTk1R.js.gz +0 -0
  165. package/dist/web/assets/{panel-store-Dx2ziBLp.js → panel-store-H7e9XHZF.js} +1 -1
  166. package/dist/web/assets/panel-store-H7e9XHZF.js.br +0 -0
  167. package/dist/web/assets/panel-store-H7e9XHZF.js.gz +0 -0
  168. package/dist/web/assets/{patch-tab-metadata-DTbCkVvx.js → patch-tab-metadata-DqvfqUI4.js} +1 -1
  169. package/dist/web/assets/{performance-panel-COQNCyEU.js → performance-panel-Jwab-_Z2.js} +1 -1
  170. package/dist/web/assets/performance-panel-Jwab-_Z2.js.br +0 -0
  171. package/dist/web/assets/performance-panel-Jwab-_Z2.js.gz +0 -0
  172. package/dist/web/assets/{ppmbot-settings-section-CmhbbZVI.js → ppmbot-settings-section-D8jIlmp8.js} +1 -1
  173. package/dist/web/assets/ppmbot-settings-section-D8jIlmp8.js.br +0 -0
  174. package/dist/web/assets/ppmbot-settings-section-D8jIlmp8.js.gz +0 -0
  175. package/dist/web/assets/{pptx-export-COeBmnFJ.js → pptx-export-gXOWUZXL.js} +3 -3
  176. package/dist/web/assets/pptx-export-gXOWUZXL.js.br +0 -0
  177. package/dist/web/assets/pptx-export-gXOWUZXL.js.gz +0 -0
  178. package/dist/web/assets/{problems-panel-I0EYfa1S.js → problems-panel-DjCHA1r5.js} +1 -1
  179. package/dist/web/assets/problems-panel-DjCHA1r5.js.br +0 -0
  180. package/dist/web/assets/problems-panel-DjCHA1r5.js.gz +0 -0
  181. package/dist/web/assets/{process-table-or-X8Lwh.js → process-table-BxXEh4tN.js} +1 -1
  182. package/dist/web/assets/process-table-BxXEh4tN.js.br +0 -0
  183. package/dist/web/assets/process-table-BxXEh4tN.js.gz +0 -0
  184. package/dist/web/assets/{proxy-settings-section-DpJ6ok4C.js → proxy-settings-section-B8igco2L.js} +1 -1
  185. package/dist/web/assets/proxy-settings-section-B8igco2L.js.br +0 -0
  186. package/dist/web/assets/proxy-settings-section-B8igco2L.js.gz +0 -0
  187. package/dist/web/assets/{query-tab-DeNZMZHX.js → query-tab-DHU3ANHN.js} +3 -3
  188. package/dist/web/assets/query-tab-DHU3ANHN.js.br +0 -0
  189. package/dist/web/assets/query-tab-DHU3ANHN.js.gz +0 -0
  190. package/dist/web/assets/release-notes-window-content-B33RDfFY.js +1 -0
  191. package/dist/web/assets/remote-access-settings-section-CoYQTFKd.js +1 -0
  192. package/dist/web/assets/remote-access-settings-section-CoYQTFKd.js.br +0 -0
  193. package/dist/web/assets/remote-access-settings-section-CoYQTFKd.js.gz +0 -0
  194. package/dist/web/assets/{remote-desktop-clipboard-notice-CGDBpXMf.js → remote-desktop-clipboard-notice-Dwn-iV4g.js} +1 -1
  195. package/dist/web/assets/remote-desktop-clipboard-notice-Dwn-iV4g.js.br +0 -0
  196. package/dist/web/assets/remote-desktop-clipboard-notice-Dwn-iV4g.js.gz +0 -0
  197. package/dist/web/assets/{remote-desktop-mobile-sheet-6nXirdqZ.js → remote-desktop-mobile-sheet-bfKiSG0C.js} +2 -2
  198. package/dist/web/assets/remote-desktop-mobile-sheet-bfKiSG0C.js.br +0 -0
  199. package/dist/web/assets/remote-desktop-mobile-sheet-bfKiSG0C.js.gz +0 -0
  200. package/dist/web/assets/{remote-desktop-mobile-view-BTaj9Flo.js → remote-desktop-mobile-view-CV8eHh4A.js} +1 -1
  201. package/dist/web/assets/remote-desktop-mobile-view-CV8eHh4A.js.br +0 -0
  202. package/dist/web/assets/remote-desktop-mobile-view-CV8eHh4A.js.gz +0 -0
  203. package/dist/web/assets/{remote-desktop-readiness-gate--gtmfqZh.js → remote-desktop-readiness-gate-DrSYb_9z.js} +1 -1
  204. package/dist/web/assets/remote-desktop-readiness-gate-DrSYb_9z.js.br +0 -0
  205. package/dist/web/assets/remote-desktop-readiness-gate-DrSYb_9z.js.gz +0 -0
  206. package/dist/web/assets/{remote-desktop-settings-section-Bs5avYaS.js → remote-desktop-settings-section-DRO8n8t7.js} +1 -1
  207. package/dist/web/assets/remote-desktop-settings-section-DRO8n8t7.js.br +0 -0
  208. package/dist/web/assets/remote-desktop-settings-section-DRO8n8t7.js.gz +0 -0
  209. package/dist/web/assets/{remote-desktop-window-content-D4CM-28B.js → remote-desktop-window-content-CAuxeGbK.js} +1 -1
  210. package/dist/web/assets/remote-desktop-window-content-CAuxeGbK.js.br +0 -0
  211. package/dist/web/assets/remote-desktop-window-content-CAuxeGbK.js.gz +0 -0
  212. package/dist/web/assets/{rename-object-dialog-Dv4iLwnf.js → rename-object-dialog-BPuh3dAH.js} +1 -1
  213. package/dist/web/assets/rename-object-dialog-BPuh3dAH.js.br +0 -0
  214. package/dist/web/assets/rename-object-dialog-BPuh3dAH.js.gz +0 -0
  215. package/dist/web/assets/review-address-setup-CoI2BGdx.js +1 -0
  216. package/dist/web/assets/review-address-setup-CoI2BGdx.js.br +0 -0
  217. package/dist/web/assets/review-address-setup-CoI2BGdx.js.gz +0 -0
  218. package/dist/web/assets/{review-code-Bet53hHb.js → review-code-Dy8y4_17.js} +1 -1
  219. package/dist/web/assets/review-code-Dy8y4_17.js.br +0 -0
  220. package/dist/web/assets/review-code-Dy8y4_17.js.gz +0 -0
  221. package/dist/web/assets/{run-in-terminal-EVMb5TjW.js → run-in-terminal-DAdjH24K.js} +1 -1
  222. package/dist/web/assets/{run-in-terminal-button-CsYq6Xqo.js → run-in-terminal-button-Bu165IH-.js} +1 -1
  223. package/dist/web/assets/{save-as-dialog-DHkBsS-6.js → save-as-dialog-C9OpJz2x.js} +1 -1
  224. package/dist/web/assets/save-as-dialog-C9OpJz2x.js.br +0 -0
  225. package/dist/web/assets/save-as-dialog-C9OpJz2x.js.gz +0 -0
  226. package/dist/web/assets/{schedule-script-editor-CKUl2qxf.js → schedule-script-editor--roOsFbc.js} +1 -1
  227. package/dist/web/assets/schedule-script-editor--roOsFbc.js.br +0 -0
  228. package/dist/web/assets/schedule-script-editor--roOsFbc.js.gz +0 -0
  229. package/dist/web/assets/{schedules-settings-section-EoOXzqF3.js → schedules-settings-section-BTn_NSzU.js} +3 -3
  230. package/dist/web/assets/schedules-settings-section-BTn_NSzU.js.br +0 -0
  231. package/dist/web/assets/schedules-settings-section-BTn_NSzU.js.gz +0 -0
  232. package/dist/web/assets/{send-to-chat-B7oUVcgh.js → send-to-chat-BUxj21hD.js} +1 -1
  233. package/dist/web/assets/send-to-chat-BUxj21hD.js.br +0 -0
  234. package/dist/web/assets/send-to-chat-BUxj21hD.js.gz +0 -0
  235. package/dist/web/assets/{services-panel-BceuL_SU.js → services-panel-BynENSs6.js} +1 -1
  236. package/dist/web/assets/services-panel-BynENSs6.js.br +0 -0
  237. package/dist/web/assets/services-panel-BynENSs6.js.gz +0 -0
  238. package/dist/web/assets/{session-changes-bar-CjSxBYOF.js → session-changes-bar-Dz3QitdJ.js} +1 -1
  239. package/dist/web/assets/session-changes-bar-Dz3QitdJ.js.br +0 -0
  240. package/dist/web/assets/session-changes-bar-Dz3QitdJ.js.gz +0 -0
  241. package/dist/web/assets/{session-review-tab-yIQFGJbG.js → session-review-tab-fRzyogNH.js} +1 -1
  242. package/dist/web/assets/session-review-tab-fRzyogNH.js.br +0 -0
  243. package/dist/web/assets/session-review-tab-fRzyogNH.js.gz +0 -0
  244. package/dist/web/assets/{settings-body-DXNcpoqY.js → settings-body-D5pmlFft.js} +1 -1
  245. package/dist/web/assets/settings-body-D5pmlFft.js.br +0 -0
  246. package/dist/web/assets/settings-body-D5pmlFft.js.gz +0 -0
  247. package/dist/web/assets/{settings-rows-DgL7oTg8.js → settings-rows-VtjChFlm.js} +1 -1
  248. package/dist/web/assets/settings-rows-VtjChFlm.js.br +0 -0
  249. package/dist/web/assets/settings-rows-VtjChFlm.js.gz +0 -0
  250. package/dist/web/assets/{settings-section-content-DFLjO2le.js → settings-section-content-BOwSlBkZ.js} +2 -2
  251. package/dist/web/assets/settings-section-content-BOwSlBkZ.js.br +0 -0
  252. package/dist/web/assets/settings-section-content-BOwSlBkZ.js.gz +0 -0
  253. package/dist/web/assets/{settings-section-content-B1eU_yR4.js → settings-section-content-Ck39TJA7.js} +1 -1
  254. package/dist/web/assets/{settings-store-CBJCnE5L.js → settings-store-CMpVMq3Y.js} +2 -2
  255. package/dist/web/assets/settings-store-CMpVMq3Y.js.br +0 -0
  256. package/dist/web/assets/settings-store-CMpVMq3Y.js.gz +0 -0
  257. package/dist/web/assets/settings-tab-A81xb81d.js +1 -0
  258. package/dist/web/assets/settings-window-content-BCDRi6xS.js +1 -0
  259. package/dist/web/assets/{slash-command-picker-qb3fZ7RP.js → slash-command-picker-BKeEykkF.js} +1 -1
  260. package/dist/web/assets/slash-command-picker-BKeEykkF.js.br +0 -0
  261. package/dist/web/assets/slash-command-picker-BKeEykkF.js.gz +0 -0
  262. package/dist/web/assets/{sql-object-tab-B6JtYu9P.js → sql-object-tab-I5bl3DVf.js} +1 -1
  263. package/dist/web/assets/sql-object-tab-I5bl3DVf.js.br +0 -0
  264. package/dist/web/assets/sql-object-tab-I5bl3DVf.js.gz +0 -0
  265. package/dist/web/assets/{sqlite-viewer-bdNkUymy.js → sqlite-viewer-ECCCjxdn.js} +1 -1
  266. package/dist/web/assets/sqlite-viewer-ECCCjxdn.js.br +0 -0
  267. package/dist/web/assets/sqlite-viewer-ECCCjxdn.js.gz +0 -0
  268. package/dist/web/assets/{structure-save-dialog-5SfYdbAB.js → structure-save-dialog-DcQdamD3.js} +1 -1
  269. package/dist/web/assets/structure-save-dialog-DcQdamD3.js.br +0 -0
  270. package/dist/web/assets/structure-save-dialog-DcQdamD3.js.gz +0 -0
  271. package/dist/web/assets/{structure-tab-DYjjcLIU.js → structure-tab-DyQGhf9t.js} +2 -2
  272. package/dist/web/assets/structure-tab-DyQGhf9t.js.br +0 -0
  273. package/dist/web/assets/structure-tab-DyQGhf9t.js.gz +0 -0
  274. package/dist/web/assets/{system-monitor-body-DouL7ajt.js → system-monitor-body-B5AvRT5J.js} +2 -2
  275. package/dist/web/assets/system-monitor-body-B5AvRT5J.js.br +0 -0
  276. package/dist/web/assets/system-monitor-body-B5AvRT5J.js.gz +0 -0
  277. package/dist/web/assets/system-monitor-tab-CfwHKQ5k.js +1 -0
  278. package/dist/web/assets/{system-monitor-window-content-DUCaJME1.js → system-monitor-window-content-Cvx1V8Mf.js} +1 -1
  279. package/dist/web/assets/{tab-host-window-content-CQ5NiV6Y.js → tab-host-window-content-DqOUHxEL.js} +1 -1
  280. package/dist/web/assets/tab-host-window-content-DqOUHxEL.js.br +0 -0
  281. package/dist/web/assets/tab-host-window-content-DqOUHxEL.js.gz +0 -0
  282. package/dist/web/assets/{tab-store-B4v2kAEY.js → tab-store-NUmgzMPf.js} +1 -1
  283. package/dist/web/assets/table-tab-dI8rBbCS.js +2 -0
  284. package/dist/web/assets/table-tab-dI8rBbCS.js.br +0 -0
  285. package/dist/web/assets/table-tab-dI8rBbCS.js.gz +0 -0
  286. package/dist/web/assets/{telegram-bot-token-field-CqVIuWP1.js → telegram-bot-token-field-DSLtG8vw.js} +1 -1
  287. package/dist/web/assets/telegram-bot-token-field-DSLtG8vw.js.br +0 -0
  288. package/dist/web/assets/telegram-bot-token-field-DSLtG8vw.js.gz +0 -0
  289. package/dist/web/assets/{terminal-tab-DT0MN_Qn.js → terminal-tab-CDg0AHBK.js} +2 -2
  290. package/dist/web/assets/terminal-tab-CDg0AHBK.js.br +0 -0
  291. package/dist/web/assets/terminal-tab-CDg0AHBK.js.gz +0 -0
  292. package/dist/web/assets/{tool-cards-C2YGSKRm.js → tool-cards-7E0jtwP0.js} +5 -5
  293. package/dist/web/assets/tool-cards-7E0jtwP0.js.br +0 -0
  294. package/dist/web/assets/tool-cards-7E0jtwP0.js.gz +0 -0
  295. package/dist/web/assets/{tools-settings-section-DQXIdF8O.js → tools-settings-section-AChVQJyU.js} +1 -1
  296. package/dist/web/assets/tools-settings-section-AChVQJyU.js.br +0 -0
  297. package/dist/web/assets/tools-settings-section-AChVQJyU.js.gz +0 -0
  298. package/dist/web/assets/{use-db-read-BByB906L.js → use-db-read-DgNa66Yo.js} +1 -1
  299. package/dist/web/assets/use-db-read-DgNa66Yo.js.br +0 -0
  300. package/dist/web/assets/use-db-read-DgNa66Yo.js.gz +0 -0
  301. package/dist/web/assets/{use-db-tab-Dc0QSFyM.js → use-db-tab-OGLoicCd.js} +1 -1
  302. package/dist/web/assets/use-db-tab-OGLoicCd.js.br +0 -0
  303. package/dist/web/assets/use-db-tab-OGLoicCd.js.gz +0 -0
  304. package/dist/web/assets/{use-inline-blame-B9M-hADX.js → use-inline-blame-BvlcOQd9.js} +3 -3
  305. package/dist/web/assets/use-inline-blame-BvlcOQd9.js.br +0 -0
  306. package/dist/web/assets/use-inline-blame-BvlcOQd9.js.gz +0 -0
  307. package/dist/web/assets/{use-lsp-DcGiCpl9.js → use-lsp-fLNwD0BI.js} +1 -1
  308. package/dist/web/assets/use-lsp-fLNwD0BI.js.br +0 -0
  309. package/dist/web/assets/use-lsp-fLNwD0BI.js.gz +0 -0
  310. package/dist/web/assets/{use-monaco-theme-CyoMsYaI.js → use-monaco-theme-CbNQ4HnC.js} +1 -1
  311. package/dist/web/assets/{use-process-kill-DsHyrg0-.js → use-process-kill-B4Srjl2m.js} +1 -1
  312. package/dist/web/assets/use-process-kill-B4Srjl2m.js.br +0 -0
  313. package/dist/web/assets/use-process-kill-B4Srjl2m.js.gz +0 -0
  314. package/dist/web/assets/{use-sql-schema-info-BqGN5N4O.js → use-sql-schema-info-CqISFaAW.js} +1 -1
  315. package/dist/web/assets/use-sql-schema-info-CqISFaAW.js.br +0 -0
  316. package/dist/web/assets/use-sql-schema-info-CqISFaAW.js.gz +0 -0
  317. package/dist/web/assets/{use-websocket-DqomrzN8.js → use-websocket-DVJuWhlA.js} +1 -1
  318. package/dist/web/assets/{voice-settings-section-D9KsOm8A.js → voice-settings-section-C1aEYF94.js} +1 -1
  319. package/dist/web/assets/voice-settings-section-C1aEYF94.js.br +0 -0
  320. package/dist/web/assets/voice-settings-section-C1aEYF94.js.gz +0 -0
  321. package/dist/web/assets/{web-preview-tab-CUp1n2jz.js → web-preview-tab-CZJAVoVU.js} +1 -1
  322. package/dist/web/assets/web-preview-tab-CZJAVoVU.js.br +0 -0
  323. package/dist/web/assets/web-preview-tab-CZJAVoVU.js.gz +0 -0
  324. package/dist/web/assets/{window-store-UcSFgNCI.js → window-store-D6EgLSfT.js} +1 -1
  325. package/dist/web/assets/window-store-D6EgLSfT.js.br +0 -0
  326. package/dist/web/assets/window-store-D6EgLSfT.js.gz +0 -0
  327. package/dist/web/index.html +12 -12
  328. package/dist/web/index.html.br +0 -0
  329. package/dist/web/index.html.gz +0 -0
  330. package/dist/web/sw.js +1 -1
  331. package/dist/web/sw.js.br +0 -0
  332. package/dist/web/sw.js.gz +0 -0
  333. package/package.json +1 -1
  334. package/src/web/components/floating-window/use-window-meta.ts +2 -1
  335. package/src/web/components/floating-window/window-content-registry.ts +2 -0
  336. package/src/web/components/floating-window/window-store-types.ts +1 -1
  337. package/src/web/components/layout/upgrade-button.tsx +27 -46
  338. package/src/web/components/release-notes/open-release-notes.ts +22 -0
  339. package/src/web/components/release-notes/release-notes-entry.tsx +73 -0
  340. package/src/web/components/release-notes/release-notes-view.tsx +72 -0
  341. package/src/web/components/release-notes/release-notes-window-content.tsx +6 -0
  342. package/dist/web/assets/accounts-settings-section-Ctu-w8kt.js +0 -1
  343. package/dist/web/assets/accounts-settings-section-Ctu-w8kt.js.br +0 -0
  344. package/dist/web/assets/accounts-settings-section-Ctu-w8kt.js.gz +0 -0
  345. package/dist/web/assets/agent-session-sheet-DmbSfFGz.js.br +0 -0
  346. package/dist/web/assets/agent-session-sheet-DmbSfFGz.js.gz +0 -0
  347. package/dist/web/assets/agent-session-window-content-Dk8x3ozF.js.br +0 -0
  348. package/dist/web/assets/agent-session-window-content-Dk8x3ozF.js.gz +0 -0
  349. package/dist/web/assets/ai-resource-editor-MKwjYcDh.js.br +0 -0
  350. package/dist/web/assets/ai-resource-editor-MKwjYcDh.js.gz +0 -0
  351. package/dist/web/assets/ai-settings-section-CODZY71V.js +0 -1
  352. package/dist/web/assets/ai-settings-section-CODZY71V.js.br +0 -0
  353. package/dist/web/assets/ai-settings-section-CODZY71V.js.gz +0 -0
  354. package/dist/web/assets/android-tab-CUkjbfyi.js.br +0 -0
  355. package/dist/web/assets/android-tab-CUkjbfyi.js.gz +0 -0
  356. package/dist/web/assets/appearance-settings-section-BZsM8HpZ.js.br +0 -0
  357. package/dist/web/assets/appearance-settings-section-BZsM8HpZ.js.gz +0 -0
  358. package/dist/web/assets/apps-panel-Cs3utBlp.js.br +0 -0
  359. package/dist/web/assets/apps-panel-Cs3utBlp.js.gz +0 -0
  360. package/dist/web/assets/branch-review-tab-C-aPuhXZ.js +0 -1
  361. package/dist/web/assets/branch-review-tab-C-aPuhXZ.js.br +0 -0
  362. package/dist/web/assets/branch-review-tab-C-aPuhXZ.js.gz +0 -0
  363. package/dist/web/assets/chat-tab-CGQu4uLR.js +0 -1
  364. package/dist/web/assets/chat-tab-CGQu4uLR.js.br +0 -0
  365. package/dist/web/assets/chat-tab-CGQu4uLR.js.gz +0 -0
  366. package/dist/web/assets/chat-tab-DtSHSfMU.js.br +0 -0
  367. package/dist/web/assets/chat-tab-DtSHSfMU.js.gz +0 -0
  368. package/dist/web/assets/code-editor-DjDyhff1.js.br +0 -0
  369. package/dist/web/assets/code-editor-DjDyhff1.js.gz +0 -0
  370. package/dist/web/assets/codex-reset-credit-button-BKgiUi8E.js.br +0 -0
  371. package/dist/web/assets/codex-reset-credit-button-BKgiUi8E.js.gz +0 -0
  372. package/dist/web/assets/conflict-editor-DgTv-8pb.js.br +0 -0
  373. package/dist/web/assets/conflict-editor-DgTv-8pb.js.gz +0 -0
  374. package/dist/web/assets/connection-form-tab-CJ-6gH9g.js +0 -4
  375. package/dist/web/assets/connection-form-tab-CJ-6gH9g.js.br +0 -0
  376. package/dist/web/assets/connection-form-tab-CJ-6gH9g.js.gz +0 -0
  377. package/dist/web/assets/csv-preview-BTGpYs4p.js.br +0 -0
  378. package/dist/web/assets/csv-preview-BTGpYs4p.js.gz +0 -0
  379. package/dist/web/assets/db-explorer-store-DDePT3UI.js.br +0 -0
  380. package/dist/web/assets/db-explorer-store-DDePT3UI.js.gz +0 -0
  381. package/dist/web/assets/db-sidebar-reveal-BeT8cp6P.js.br +0 -0
  382. package/dist/web/assets/db-sidebar-reveal-BeT8cp6P.js.gz +0 -0
  383. package/dist/web/assets/db-tab-parts-BYzd4_sR.js.br +0 -0
  384. package/dist/web/assets/db-tab-parts-BYzd4_sR.js.gz +0 -0
  385. package/dist/web/assets/design-settings-section-B3KQBggK.js.br +0 -0
  386. package/dist/web/assets/design-settings-section-B3KQBggK.js.gz +0 -0
  387. package/dist/web/assets/design-tab-CPyj_nFg.js.br +0 -0
  388. package/dist/web/assets/design-tab-CPyj_nFg.js.gz +0 -0
  389. package/dist/web/assets/designs-sidebar-panel-DIGPFo2l.js.br +0 -0
  390. package/dist/web/assets/designs-sidebar-panel-DIGPFo2l.js.gz +0 -0
  391. package/dist/web/assets/diff-viewer-nYz43A94.js +0 -4
  392. package/dist/web/assets/diff-viewer-nYz43A94.js.br +0 -0
  393. package/dist/web/assets/diff-viewer-nYz43A94.js.gz +0 -0
  394. package/dist/web/assets/docx-preview-CowHGqML.js.br +0 -0
  395. package/dist/web/assets/docx-preview-CowHGqML.js.gz +0 -0
  396. package/dist/web/assets/editor-dialog-xPoehDYp.js.br +0 -0
  397. package/dist/web/assets/editor-dialog-xPoehDYp.js.gz +0 -0
  398. package/dist/web/assets/editor-language-service-DdYqCDBU.js.br +0 -0
  399. package/dist/web/assets/editor-language-service-DdYqCDBU.js.gz +0 -0
  400. package/dist/web/assets/explorer-body-BHh5Qpvi.js +0 -2
  401. package/dist/web/assets/explorer-body-BHh5Qpvi.js.br +0 -0
  402. package/dist/web/assets/explorer-body-BHh5Qpvi.js.gz +0 -0
  403. package/dist/web/assets/explorer-model-tGyFETP_.js.br +0 -0
  404. package/dist/web/assets/explorer-model-tGyFETP_.js.gz +0 -0
  405. package/dist/web/assets/explorer-window-content-B1c4QTVL.js.br +0 -0
  406. package/dist/web/assets/explorer-window-content-B1c4QTVL.js.gz +0 -0
  407. package/dist/web/assets/extension-manager-section-BgL0Uyl3.js.br +0 -0
  408. package/dist/web/assets/extension-manager-section-BgL0Uyl3.js.gz +0 -0
  409. package/dist/web/assets/extension-webview-BWB1Yd-t.js.br +0 -0
  410. package/dist/web/assets/extension-webview-BWB1Yd-t.js.gz +0 -0
  411. package/dist/web/assets/files-settings-section-TmoewoO2.js.br +0 -0
  412. package/dist/web/assets/files-settings-section-TmoewoO2.js.gz +0 -0
  413. package/dist/web/assets/general-settings-section-Bu7o8uUn.js.br +0 -0
  414. package/dist/web/assets/general-settings-section-Bu7o8uUn.js.gz +0 -0
  415. package/dist/web/assets/git-log-panel-RjMZIaCk.js.br +0 -0
  416. package/dist/web/assets/git-log-panel-RjMZIaCk.js.gz +0 -0
  417. package/dist/web/assets/git-review-tab-BUW5LZk4.js +0 -3
  418. package/dist/web/assets/git-review-tab-BUW5LZk4.js.br +0 -0
  419. package/dist/web/assets/git-review-tab-BUW5LZk4.js.gz +0 -0
  420. package/dist/web/assets/glide-data-grid-DqlTFhhf.js.br +0 -0
  421. package/dist/web/assets/glide-data-grid-DqlTFhhf.js.gz +0 -0
  422. package/dist/web/assets/grid-save-dialog-BmF2Gy_E.js.br +0 -0
  423. package/dist/web/assets/grid-save-dialog-BmF2Gy_E.js.gz +0 -0
  424. package/dist/web/assets/group-chat-tab-nk3n5wE0.js +0 -1
  425. package/dist/web/assets/group-chat-tab-nk3n5wE0.js.br +0 -0
  426. package/dist/web/assets/group-chat-tab-nk3n5wE0.js.gz +0 -0
  427. package/dist/web/assets/impexp-tab-B8d4oBOB.js.br +0 -0
  428. package/dist/web/assets/impexp-tab-B8d4oBOB.js.gz +0 -0
  429. package/dist/web/assets/index-2_Pz5MiI.css +0 -1
  430. package/dist/web/assets/index-2_Pz5MiI.css.br +0 -0
  431. package/dist/web/assets/index-Cx9ZRibz.js.br +0 -0
  432. package/dist/web/assets/index-Cx9ZRibz.js.gz +0 -0
  433. package/dist/web/assets/keybindings-store-B2AkKQl7.js +0 -1
  434. package/dist/web/assets/keyboard-shortcuts-section-BSMgmbOR.js.br +0 -0
  435. package/dist/web/assets/keyboard-shortcuts-section-BSMgmbOR.js.gz +0 -0
  436. package/dist/web/assets/language-servers-section-DO9wnwnG.js.br +0 -0
  437. package/dist/web/assets/language-servers-section-DO9wnwnG.js.gz +0 -0
  438. package/dist/web/assets/logs-app-xQ2UsN4G.js +0 -13
  439. package/dist/web/assets/logs-app-xQ2UsN4G.js.br +0 -0
  440. package/dist/web/assets/logs-app-xQ2UsN4G.js.gz +0 -0
  441. package/dist/web/assets/logs-tab-H3SmYGRX.js +0 -1
  442. package/dist/web/assets/lsp-client-IsC8Ol0U.js.br +0 -0
  443. package/dist/web/assets/lsp-client-IsC8Ol0U.js.gz +0 -0
  444. package/dist/web/assets/markdown-renderer-BfZiHaNy.js.br +0 -0
  445. package/dist/web/assets/markdown-renderer-BfZiHaNy.js.gz +0 -0
  446. package/dist/web/assets/mobile-explorer-sheet-Dz3eJdBl.js.br +0 -0
  447. package/dist/web/assets/mobile-explorer-sheet-Dz3eJdBl.js.gz +0 -0
  448. package/dist/web/assets/new-design-dialog-B8zeJoJQ.js.br +0 -0
  449. package/dist/web/assets/new-design-dialog-B8zeJoJQ.js.gz +0 -0
  450. package/dist/web/assets/notification-store-BkkcJE2G.js +0 -1
  451. package/dist/web/assets/notifications-settings-section-CMZXQw72.js.br +0 -0
  452. package/dist/web/assets/notifications-settings-section-CMZXQw72.js.gz +0 -0
  453. package/dist/web/assets/open-db-tabs-DYTZbguT.js.br +0 -0
  454. package/dist/web/assets/open-db-tabs-DYTZbguT.js.gz +0 -0
  455. package/dist/web/assets/overview-panel-7_8b6pwr.js.br +0 -0
  456. package/dist/web/assets/overview-panel-7_8b6pwr.js.gz +0 -0
  457. package/dist/web/assets/panel-store-Dx2ziBLp.js.br +0 -0
  458. package/dist/web/assets/panel-store-Dx2ziBLp.js.gz +0 -0
  459. package/dist/web/assets/performance-panel-COQNCyEU.js.br +0 -0
  460. package/dist/web/assets/performance-panel-COQNCyEU.js.gz +0 -0
  461. package/dist/web/assets/ppmbot-settings-section-CmhbbZVI.js.br +0 -0
  462. package/dist/web/assets/ppmbot-settings-section-CmhbbZVI.js.gz +0 -0
  463. package/dist/web/assets/pptx-export-COeBmnFJ.js.br +0 -0
  464. package/dist/web/assets/pptx-export-COeBmnFJ.js.gz +0 -0
  465. package/dist/web/assets/problems-panel-I0EYfa1S.js.br +0 -0
  466. package/dist/web/assets/problems-panel-I0EYfa1S.js.gz +0 -0
  467. package/dist/web/assets/process-table-or-X8Lwh.js.br +0 -0
  468. package/dist/web/assets/process-table-or-X8Lwh.js.gz +0 -0
  469. package/dist/web/assets/proxy-settings-section-DpJ6ok4C.js.br +0 -0
  470. package/dist/web/assets/proxy-settings-section-DpJ6ok4C.js.gz +0 -0
  471. package/dist/web/assets/query-tab-DeNZMZHX.js.br +0 -0
  472. package/dist/web/assets/query-tab-DeNZMZHX.js.gz +0 -0
  473. package/dist/web/assets/remote-access-settings-section-QRP4Yh46.js +0 -1
  474. package/dist/web/assets/remote-access-settings-section-QRP4Yh46.js.br +0 -0
  475. package/dist/web/assets/remote-access-settings-section-QRP4Yh46.js.gz +0 -0
  476. package/dist/web/assets/remote-desktop-clipboard-notice-CGDBpXMf.js.br +0 -0
  477. package/dist/web/assets/remote-desktop-clipboard-notice-CGDBpXMf.js.gz +0 -0
  478. package/dist/web/assets/remote-desktop-mobile-sheet-6nXirdqZ.js.br +0 -0
  479. package/dist/web/assets/remote-desktop-mobile-sheet-6nXirdqZ.js.gz +0 -0
  480. package/dist/web/assets/remote-desktop-mobile-view-BTaj9Flo.js.br +0 -0
  481. package/dist/web/assets/remote-desktop-mobile-view-BTaj9Flo.js.gz +0 -0
  482. package/dist/web/assets/remote-desktop-readiness-gate--gtmfqZh.js.br +0 -0
  483. package/dist/web/assets/remote-desktop-readiness-gate--gtmfqZh.js.gz +0 -0
  484. package/dist/web/assets/remote-desktop-settings-section-Bs5avYaS.js.br +0 -0
  485. package/dist/web/assets/remote-desktop-settings-section-Bs5avYaS.js.gz +0 -0
  486. package/dist/web/assets/remote-desktop-window-content-D4CM-28B.js.br +0 -0
  487. package/dist/web/assets/remote-desktop-window-content-D4CM-28B.js.gz +0 -0
  488. package/dist/web/assets/rename-object-dialog-Dv4iLwnf.js.br +0 -0
  489. package/dist/web/assets/rename-object-dialog-Dv4iLwnf.js.gz +0 -0
  490. package/dist/web/assets/review-address-setup-CU1A_NfZ.js +0 -1
  491. package/dist/web/assets/review-address-setup-CU1A_NfZ.js.br +0 -0
  492. package/dist/web/assets/review-address-setup-CU1A_NfZ.js.gz +0 -0
  493. package/dist/web/assets/review-code-Bet53hHb.js.br +0 -0
  494. package/dist/web/assets/review-code-Bet53hHb.js.gz +0 -0
  495. package/dist/web/assets/save-as-dialog-DHkBsS-6.js.br +0 -0
  496. package/dist/web/assets/save-as-dialog-DHkBsS-6.js.gz +0 -0
  497. package/dist/web/assets/schedule-script-editor-CKUl2qxf.js.br +0 -0
  498. package/dist/web/assets/schedule-script-editor-CKUl2qxf.js.gz +0 -0
  499. package/dist/web/assets/schedules-settings-section-EoOXzqF3.js.br +0 -0
  500. package/dist/web/assets/schedules-settings-section-EoOXzqF3.js.gz +0 -0
  501. package/dist/web/assets/send-to-chat-B7oUVcgh.js.br +0 -0
  502. package/dist/web/assets/send-to-chat-B7oUVcgh.js.gz +0 -0
  503. package/dist/web/assets/services-panel-BceuL_SU.js.br +0 -0
  504. package/dist/web/assets/services-panel-BceuL_SU.js.gz +0 -0
  505. package/dist/web/assets/session-changes-bar-CjSxBYOF.js.br +0 -0
  506. package/dist/web/assets/session-changes-bar-CjSxBYOF.js.gz +0 -0
  507. package/dist/web/assets/session-review-tab-yIQFGJbG.js.br +0 -0
  508. package/dist/web/assets/session-review-tab-yIQFGJbG.js.gz +0 -0
  509. package/dist/web/assets/settings-body-DXNcpoqY.js.br +0 -0
  510. package/dist/web/assets/settings-body-DXNcpoqY.js.gz +0 -0
  511. package/dist/web/assets/settings-rows-DgL7oTg8.js.br +0 -0
  512. package/dist/web/assets/settings-rows-DgL7oTg8.js.gz +0 -0
  513. package/dist/web/assets/settings-section-content-DFLjO2le.js.br +0 -0
  514. package/dist/web/assets/settings-section-content-DFLjO2le.js.gz +0 -0
  515. package/dist/web/assets/settings-store-CBJCnE5L.js.br +0 -0
  516. package/dist/web/assets/settings-store-CBJCnE5L.js.gz +0 -0
  517. package/dist/web/assets/settings-tab-CrGoLKQT.js +0 -1
  518. package/dist/web/assets/settings-window-content-5opW9Wra.js +0 -1
  519. package/dist/web/assets/slash-command-picker-qb3fZ7RP.js.br +0 -0
  520. package/dist/web/assets/slash-command-picker-qb3fZ7RP.js.gz +0 -0
  521. package/dist/web/assets/sql-object-tab-B6JtYu9P.js.br +0 -0
  522. package/dist/web/assets/sql-object-tab-B6JtYu9P.js.gz +0 -0
  523. package/dist/web/assets/sqlite-viewer-bdNkUymy.js.br +0 -0
  524. package/dist/web/assets/sqlite-viewer-bdNkUymy.js.gz +0 -0
  525. package/dist/web/assets/structure-save-dialog-5SfYdbAB.js.br +0 -0
  526. package/dist/web/assets/structure-save-dialog-5SfYdbAB.js.gz +0 -0
  527. package/dist/web/assets/structure-tab-DYjjcLIU.js.br +0 -0
  528. package/dist/web/assets/structure-tab-DYjjcLIU.js.gz +0 -0
  529. package/dist/web/assets/system-monitor-body-DouL7ajt.js.br +0 -0
  530. package/dist/web/assets/system-monitor-body-DouL7ajt.js.gz +0 -0
  531. package/dist/web/assets/system-monitor-tab-qpa36tWB.js +0 -1
  532. package/dist/web/assets/tab-host-window-content-CQ5NiV6Y.js.br +0 -0
  533. package/dist/web/assets/tab-host-window-content-CQ5NiV6Y.js.gz +0 -0
  534. package/dist/web/assets/table-tab-M850PntZ.js +0 -2
  535. package/dist/web/assets/table-tab-M850PntZ.js.br +0 -0
  536. package/dist/web/assets/table-tab-M850PntZ.js.gz +0 -0
  537. package/dist/web/assets/telegram-bot-token-field-CqVIuWP1.js.br +0 -0
  538. package/dist/web/assets/telegram-bot-token-field-CqVIuWP1.js.gz +0 -0
  539. package/dist/web/assets/terminal-tab-DT0MN_Qn.js.br +0 -0
  540. package/dist/web/assets/terminal-tab-DT0MN_Qn.js.gz +0 -0
  541. package/dist/web/assets/tool-cards-C2YGSKRm.js.br +0 -0
  542. package/dist/web/assets/tool-cards-C2YGSKRm.js.gz +0 -0
  543. package/dist/web/assets/tools-settings-section-DQXIdF8O.js.br +0 -0
  544. package/dist/web/assets/tools-settings-section-DQXIdF8O.js.gz +0 -0
  545. package/dist/web/assets/use-db-read-BByB906L.js.br +0 -0
  546. package/dist/web/assets/use-db-read-BByB906L.js.gz +0 -0
  547. package/dist/web/assets/use-db-tab-Dc0QSFyM.js.br +0 -0
  548. package/dist/web/assets/use-db-tab-Dc0QSFyM.js.gz +0 -0
  549. package/dist/web/assets/use-inline-blame-B9M-hADX.js.br +0 -0
  550. package/dist/web/assets/use-inline-blame-B9M-hADX.js.gz +0 -0
  551. package/dist/web/assets/use-lsp-DcGiCpl9.js.br +0 -0
  552. package/dist/web/assets/use-lsp-DcGiCpl9.js.gz +0 -0
  553. package/dist/web/assets/use-process-kill-DsHyrg0-.js.br +0 -0
  554. package/dist/web/assets/use-process-kill-DsHyrg0-.js.gz +0 -0
  555. package/dist/web/assets/use-sql-schema-info-BqGN5N4O.js.br +0 -0
  556. package/dist/web/assets/use-sql-schema-info-BqGN5N4O.js.gz +0 -0
  557. package/dist/web/assets/voice-settings-section-D9KsOm8A.js.br +0 -0
  558. package/dist/web/assets/voice-settings-section-D9KsOm8A.js.gz +0 -0
  559. package/dist/web/assets/web-preview-tab-CUp1n2jz.js.br +0 -0
  560. package/dist/web/assets/web-preview-tab-CUp1n2jz.js.gz +0 -0
  561. package/dist/web/assets/window-store-UcSFgNCI.js.br +0 -0
  562. package/dist/web/assets/window-store-UcSFgNCI.js.gz +0 -0
  563. /package/dist/web/assets/{__vite-browser-external-DLaiEgUM.js → __vite-browser-external-LVpeGV-g.js} +0 -0
  564. /package/dist/web/assets/{api-themes-B3-6zR6Q.js → api-themes-DUOEO3_X.js} +0 -0
  565. /package/dist/web/assets/{claude-models-yFre4eSK.js → claude-models-C9iHl8VB.js} +0 -0
  566. /package/dist/web/assets/{database-drivers-section-c2SuNQPB.js → database-drivers-section-BPXoNrWi.js} +0 -0
  567. /package/dist/web/assets/{database-drivers-section-c2SuNQPB.js.br → database-drivers-section-BPXoNrWi.js.br} +0 -0
  568. /package/dist/web/assets/{database-drivers-section-c2SuNQPB.js.gz → database-drivers-section-BPXoNrWi.js.gz} +0 -0
  569. /package/dist/web/assets/{metric-chart-canvas-Dnm9OOXU.js → metric-chart-canvas-HG8rPTMq.js} +0 -0
  570. /package/dist/web/assets/{metric-chart-canvas-Dnm9OOXU.js.br → metric-chart-canvas-HG8rPTMq.js.br} +0 -0
  571. /package/dist/web/assets/{metric-chart-canvas-Dnm9OOXU.js.gz → metric-chart-canvas-HG8rPTMq.js.gz} +0 -0
  572. /package/dist/web/assets/{notification-settings-CvplVsIo.js → notification-settings--li9wGTJ.js} +0 -0
  573. /package/dist/web/assets/{notification-settings-CvplVsIo.js.br → notification-settings--li9wGTJ.js.br} +0 -0
  574. /package/dist/web/assets/{notification-settings-CvplVsIo.js.gz → notification-settings--li9wGTJ.js.gz} +0 -0
  575. /package/dist/web/assets/{process-row-format-CM1XaqkS.js → process-row-format-CJg8VV-6.js} +0 -0
  576. /package/dist/web/assets/{query-audit-section-C-fT07Zz.js → query-audit-section-BiCUBamA.js} +0 -0
  577. /package/dist/web/assets/{query-audit-section-C-fT07Zz.js.br → query-audit-section-BiCUBamA.js.br} +0 -0
  578. /package/dist/web/assets/{query-audit-section-C-fT07Zz.js.gz → query-audit-section-BiCUBamA.js.gz} +0 -0
  579. /package/dist/web/assets/{remote-desktop-recording-D_fwMC2z.js → remote-desktop-recording-BcDx5c_k.js} +0 -0
  580. /package/dist/web/assets/{separator-CYw7bF1W.js → separator-DUdRLaL0.js} +0 -0
  581. /package/dist/web/assets/{sortable-header-CchrA_dg.js → sortable-header-Ds6nTnqB.js} +0 -0
  582. /package/dist/web/assets/{sortable-header-CchrA_dg.js.br → sortable-header-Ds6nTnqB.js.br} +0 -0
  583. /package/dist/web/assets/{sortable-header-CchrA_dg.js.gz → sortable-header-Ds6nTnqB.js.gz} +0 -0
  584. /package/dist/web/assets/{vendor-xterm-lhGdimFj.js → vendor-xterm-BxbwWHG_.js} +0 -0
  585. /package/dist/web/assets/{vendor-xterm-lhGdimFj.js.br → vendor-xterm-BxbwWHG_.js.br} +0 -0
  586. /package/dist/web/assets/{vendor-xterm-lhGdimFj.js.gz → vendor-xterm-BxbwWHG_.js.gz} +0 -0
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Ar as r,Cr as i,Jn as a,Kr as o,cr as s,tr as c,ur as l,xn as u,xt as d}from"./icons-C1wDt09O.js";import{k as f}from"./api-client-BnYFnEfK.js";import"./settings-store-CBJCnE5L.js";import"./portal-container-context-Gepuvxdg.js";import"./window-store-UcSFgNCI.js";import{t as p}from"./panel-store-Dx2ziBLp.js";import{i as m}from"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./session-list-sync-triggers-D9i1FxWd.js";import"./tab-store-B4v2kAEY.js";import{t as h}from"./format-date-SZ6qU2sD.js";import"./context-menu-DhKbkI1X.js";import"./use-is-mobile-CL2I7hLf.js";import"./settings-categories-BY9n3BRr.js";import{t as g}from"./open-settings-BGtoVEAU.js";import{t as _}from"./button-BHGVTbam.js";import"./dialog-DnE192fh.js";import"./patch-tab-metadata-DTbCkVvx.js";import"./mobile-bottom-sheet-M9pZptfh.js";import"./use-visual-viewport-B_GFo6k2.js";import{n as v,o as y,r as b,t as x,u as S}from"./adaptive-context-menu-CxHkI7dL.js";import{E as C,M as w,N as T,O as E,T as D,pi as O,w as k}from"./index-Cx9ZRibz.js";import{a as A,i as j,t as M}from"./design-responsive-dialog-DBdfargi.js";import{t as N}from"./design-system-status-label-DWOVs5tJ.js";var P=e(t(),1),F=n();function I({projectName:e,design:t,onClose:n}){let[r,i]=(0,P.useState)(t.title),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(null),l=r.trim(),d=!!l&&l!==t.title&&!a,f=async()=>{if(d){o(!0),c(null);try{await T(e,t.slug,l),D(e),n()}catch(e){c(e.message||`Could not rename the design`),o(!1)}}};return(0,F.jsx)(M,{open:!0,onClose:()=>{a||n()},title:`Rename design`,description:`The folder stays designs/${t.slug}/.`,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(_,{variant:`outline`,onClick:n,disabled:a,children:`Cancel`}),(0,F.jsxs)(_,{onClick:f,disabled:!d,children:[a&&(0,F.jsx)(u,{className:`size-4 animate-spin`}),` Rename`]})]}),children:(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f()},className:`flex flex-col gap-2`,children:[(0,F.jsx)(`input`,{autoFocus:!0,value:r,maxLength:120,onChange:e=>i(e.target.value),"aria-label":`Title`,className:`min-h-11 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-primary md:min-h-9`}),s&&(0,F.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:s})]})})}function L({projectName:e,design:t,onClose:n}){let[r,i]=(0,P.useState)(``),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(null),l=r.trim()===t.slug,d=async()=>{if(!(!l||a)){o(!0),c(null);try{await E(e,t.slug);let r=p.getState();for(let n of Object.values(r.panels))for(let i of n.tabs)i.type===`design`&&i.metadata?.designSlug===t.slug&&(i.projectId??i.metadata?.projectName)===e&&r.closeTab(i.id,n.id);D(e),n()}catch(e){c(e.message||`Could not delete the design`),o(!1)}}};return(0,F.jsx)(M,{open:!0,onClose:()=>{a||n()},title:`Delete “${t.title}”?`,description:`This deletes designs/${t.slug}/ and its version history. It cannot be undone.`,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(_,{variant:`outline`,onClick:n,disabled:a,children:`Cancel`}),(0,F.jsxs)(_,{variant:`destructive`,onClick:d,disabled:!l||a,children:[a&&(0,F.jsx)(u,{className:`size-4 animate-spin`}),` Delete`]})]}),children:(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),d()},className:`flex flex-col gap-2`,children:[(0,F.jsxs)(`label`,{className:`text-xs text-text-secondary`,children:[`Type `,(0,F.jsx)(`span`,{className:`font-mono font-semibold`,children:t.slug}),` to confirm`,(0,F.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),autoComplete:`off`,spellCheck:!1,className:`mt-1 min-h-11 w-full rounded-md border border-border bg-background px-3 font-mono text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-destructive md:min-h-9`})]}),s&&(0,F.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:s})]})})}function R({projectName:e,system:t,onNavigate:n}){let[i,o]=(0,P.useState)(null),[s,c]=(0,P.useState)(!1);(0,P.useEffect)(()=>{let n=!1;if(t.builtFrom)return j(e,t.id).then(e=>{n||o(e)}).catch(()=>{}),()=>{n=!0}},[e,t.id,t.builtFrom?.commit]);let l=async()=>{if(!s){c(!0);try{let r=await A(e,t.id);O({projectName:e,slug:r.slug,title:r.title}),n?.()}catch(e){f.error(`Could not open the showcase`,{description:e.message})}finally{c(!1)}}};return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>void l(),disabled:s,className:`flex w-full min-h-11 select-none items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-surface-elevated disabled:opacity-60 md:min-h-9`,children:[s?(0,F.jsx)(u,{className:`size-4 shrink-0 animate-spin text-text-subtle`}):t.platform===`mobile`?(0,F.jsx)(r,{className:`size-4 shrink-0 text-text-subtle`}):(0,F.jsx)(a,{className:`size-4 shrink-0 text-text-subtle`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate text-sm text-text-secondary`,children:t.label}),(0,F.jsx)(`span`,{className:`block truncate text-xs text-text-subtle`,children:N(t,i)})]})]})}function z({projectName:e,systems:t,onNavigate:n}){return t.length===0?null:(0,F.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,F.jsx)(`p`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wide text-text-subtle`,children:`Design systems`}),t.map(t=>(0,F.jsx)(R,{projectName:e,system:t,onNavigate:n},t.id))]})}var B=`flex size-11 items-center justify-center rounded-md text-text-subtle hover:bg-surface-elevated hover:text-foreground md:size-7`;function V(e){return e.designs.filter(e=>!e.showcaseFor)}function H({onNavigate:e}){let t=m(e=>e.activeProject?.name??``),[n,r]=(0,P.useState)(null),[f,p]=(0,P.useState)(null),[_,T]=(0,P.useState)(null),[E,D]=(0,P.useState)(null),A=(0,P.useCallback)(()=>{t&&w(t).then(e=>{r(e),p(null)}).catch(e=>p(e.message||`Could not load designs`))},[t]);(0,P.useEffect)(()=>{r(null),A();let e=null,n=()=>{e&&clearTimeout(e),e=setTimeout(A,500)},i=e=>{let r=e.detail,i=r.path??``,a=/^designs\/[^/]+(\/(design\.json|index\.html))?$/.test(i),o=/^designs\/systems\/[^/]+(\/.*)?$/.test(i);r?.projectName===t&&(a||o)&&n()},a=e=>{e.detail?.projectName===t&&A()};return window.addEventListener(`file:changed`,i),window.addEventListener(k,a),()=>{e&&clearTimeout(e),window.removeEventListener(`file:changed`,i),window.removeEventListener(k,a)}},[t,A]);let j=n=>{O({projectName:t,slug:n.slug,title:n.title}),e?.()};return t?(0,F.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,F.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center justify-between border-b border-border px-2`,children:[(0,F.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wide text-text-secondary`,children:`Designs`}),(0,F.jsxs)(`span`,{className:`flex items-center gap-0.5`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>{g(`design`),e?.()},"aria-label":`Design settings`,title:`Design settings`,className:B,children:(0,F.jsx)(i,{className:`size-4`})}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{C(t),e?.()},"aria-label":`New design`,title:`New design`,className:B,children:(0,F.jsx)(s,{className:`size-4`})})]})]}),(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-1`,children:[f?(0,F.jsx)(`p`,{className:`px-2 py-3 text-xs text-destructive`,children:f}):n===null?(0,F.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,F.jsx)(u,{className:`size-4 animate-spin text-primary`})}):V(n).length===0?(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-xs text-text-subtle`,children:[(0,F.jsx)(a,{className:`size-6`}),`No designs yet. Start one and describe what you want; the AI builds it beside a live preview.`,(0,F.jsx)(`button`,{type:`button`,onClick:()=>C(t),className:`min-h-11 px-3 text-sm text-primary underline`,children:`New design`})]}):V(n).map(e=>(0,F.jsxs)(x,{children:[(0,F.jsx)(S,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,onClick:()=>j(e),className:`flex w-full min-h-11 select-none items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-surface-elevated md:min-h-9`,children:[(0,F.jsx)(e.kind===`slides`?l:d,{className:`size-4 shrink-0 text-text-subtle`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate text-sm text-text-secondary`,children:e.title}),(0,F.jsx)(`span`,{className:`block truncate text-xs text-text-subtle`,children:h(e.updatedAt)})]})]})}),(0,F.jsxs)(v,{children:[(0,F.jsxs)(b,{onClick:()=>j(e),children:[(0,F.jsx)(a,{className:`size-4`}),` Open`]}),(0,F.jsxs)(b,{onClick:()=>T(e),children:[(0,F.jsx)(c,{className:`size-4`}),` Rename`]}),(0,F.jsx)(y,{}),(0,F.jsxs)(b,{variant:`destructive`,onClick:()=>D(e),children:[(0,F.jsx)(o,{className:`size-4`}),` Delete`]})]})]},e.slug)),n&&(0,F.jsx)(z,{projectName:t,systems:n.systems,onNavigate:e})]}),_&&(0,F.jsx)(I,{projectName:t,design:_,onClose:()=>T(null)}),E&&(0,F.jsx)(L,{projectName:t,design:E,onClose:()=>D(null)})]}):(0,F.jsx)(`p`,{className:`p-4 text-center text-xs text-text-subtle`,children:`Select a project to see its designs`})}export{H as DesignsSidebarPanel};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Ar as r,Cr as i,Jn as a,Kr as o,cr as s,tr as c,ur as l,xn as u,xt as d}from"./icons-C1wDt09O.js";import{k as f}from"./api-client-BnYFnEfK.js";import"./settings-store-CMpVMq3Y.js";import"./portal-container-context-Gepuvxdg.js";import"./window-store-D6EgLSfT.js";import{t as p}from"./panel-store-H7e9XHZF.js";import{i as m}from"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./session-list-sync-triggers-D9i1FxWd.js";import"./tab-store-NUmgzMPf.js";import{t as h}from"./format-date-SZ6qU2sD.js";import"./context-menu-DhKbkI1X.js";import"./use-is-mobile-CL2I7hLf.js";import"./settings-categories-BY9n3BRr.js";import{t as g}from"./open-settings-DWbF5YsE.js";import{t as _}from"./button-BHGVTbam.js";import"./dialog-DnE192fh.js";import"./patch-tab-metadata-DqvfqUI4.js";import"./mobile-bottom-sheet-M9pZptfh.js";import"./use-visual-viewport-B_GFo6k2.js";import{n as v,o as y,r as b,t as x,u as S}from"./adaptive-context-menu-CxHkI7dL.js";import{E as C,M as w,N as T,O as E,T as D,mi as O,w as k}from"./index-Vd9Xr54k.js";import{a as A,i as j,t as M}from"./design-responsive-dialog-DBdfargi.js";import{t as N}from"./design-system-status-label-DWOVs5tJ.js";var P=e(t(),1),F=n();function I({projectName:e,design:t,onClose:n}){let[r,i]=(0,P.useState)(t.title),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(null),l=r.trim(),d=!!l&&l!==t.title&&!a,f=async()=>{if(d){o(!0),c(null);try{await T(e,t.slug,l),D(e),n()}catch(e){c(e.message||`Could not rename the design`),o(!1)}}};return(0,F.jsx)(M,{open:!0,onClose:()=>{a||n()},title:`Rename design`,description:`The folder stays designs/${t.slug}/.`,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(_,{variant:`outline`,onClick:n,disabled:a,children:`Cancel`}),(0,F.jsxs)(_,{onClick:f,disabled:!d,children:[a&&(0,F.jsx)(u,{className:`size-4 animate-spin`}),` Rename`]})]}),children:(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f()},className:`flex flex-col gap-2`,children:[(0,F.jsx)(`input`,{autoFocus:!0,value:r,maxLength:120,onChange:e=>i(e.target.value),"aria-label":`Title`,className:`min-h-11 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-primary md:min-h-9`}),s&&(0,F.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:s})]})})}function L({projectName:e,design:t,onClose:n}){let[r,i]=(0,P.useState)(``),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(null),l=r.trim()===t.slug,d=async()=>{if(!(!l||a)){o(!0),c(null);try{await E(e,t.slug);let r=p.getState();for(let n of Object.values(r.panels))for(let i of n.tabs)i.type===`design`&&i.metadata?.designSlug===t.slug&&(i.projectId??i.metadata?.projectName)===e&&r.closeTab(i.id,n.id);D(e),n()}catch(e){c(e.message||`Could not delete the design`),o(!1)}}};return(0,F.jsx)(M,{open:!0,onClose:()=>{a||n()},title:`Delete “${t.title}”?`,description:`This deletes designs/${t.slug}/ and its version history. It cannot be undone.`,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(_,{variant:`outline`,onClick:n,disabled:a,children:`Cancel`}),(0,F.jsxs)(_,{variant:`destructive`,onClick:d,disabled:!l||a,children:[a&&(0,F.jsx)(u,{className:`size-4 animate-spin`}),` Delete`]})]}),children:(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),d()},className:`flex flex-col gap-2`,children:[(0,F.jsxs)(`label`,{className:`text-xs text-text-secondary`,children:[`Type `,(0,F.jsx)(`span`,{className:`font-mono font-semibold`,children:t.slug}),` to confirm`,(0,F.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),autoComplete:`off`,spellCheck:!1,className:`mt-1 min-h-11 w-full rounded-md border border-border bg-background px-3 font-mono text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-destructive md:min-h-9`})]}),s&&(0,F.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:s})]})})}function R({projectName:e,system:t,onNavigate:n}){let[i,o]=(0,P.useState)(null),[s,c]=(0,P.useState)(!1);(0,P.useEffect)(()=>{let n=!1;if(t.builtFrom)return j(e,t.id).then(e=>{n||o(e)}).catch(()=>{}),()=>{n=!0}},[e,t.id,t.builtFrom?.commit]);let l=async()=>{if(!s){c(!0);try{let r=await A(e,t.id);O({projectName:e,slug:r.slug,title:r.title}),n?.()}catch(e){f.error(`Could not open the showcase`,{description:e.message})}finally{c(!1)}}};return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>void l(),disabled:s,className:`flex w-full min-h-11 select-none items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-surface-elevated disabled:opacity-60 md:min-h-9`,children:[s?(0,F.jsx)(u,{className:`size-4 shrink-0 animate-spin text-text-subtle`}):t.platform===`mobile`?(0,F.jsx)(r,{className:`size-4 shrink-0 text-text-subtle`}):(0,F.jsx)(a,{className:`size-4 shrink-0 text-text-subtle`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate text-sm text-text-secondary`,children:t.label}),(0,F.jsx)(`span`,{className:`block truncate text-xs text-text-subtle`,children:N(t,i)})]})]})}function z({projectName:e,systems:t,onNavigate:n}){return t.length===0?null:(0,F.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,F.jsx)(`p`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wide text-text-subtle`,children:`Design systems`}),t.map(t=>(0,F.jsx)(R,{projectName:e,system:t,onNavigate:n},t.id))]})}var B=`flex size-11 items-center justify-center rounded-md text-text-subtle hover:bg-surface-elevated hover:text-foreground md:size-7`;function V(e){return e.designs.filter(e=>!e.showcaseFor)}function H({onNavigate:e}){let t=m(e=>e.activeProject?.name??``),[n,r]=(0,P.useState)(null),[f,p]=(0,P.useState)(null),[_,T]=(0,P.useState)(null),[E,D]=(0,P.useState)(null),A=(0,P.useCallback)(()=>{t&&w(t).then(e=>{r(e),p(null)}).catch(e=>p(e.message||`Could not load designs`))},[t]);(0,P.useEffect)(()=>{r(null),A();let e=null,n=()=>{e&&clearTimeout(e),e=setTimeout(A,500)},i=e=>{let r=e.detail,i=r.path??``,a=/^designs\/[^/]+(\/(design\.json|index\.html))?$/.test(i),o=/^designs\/systems\/[^/]+(\/.*)?$/.test(i);r?.projectName===t&&(a||o)&&n()},a=e=>{e.detail?.projectName===t&&A()};return window.addEventListener(`file:changed`,i),window.addEventListener(k,a),()=>{e&&clearTimeout(e),window.removeEventListener(`file:changed`,i),window.removeEventListener(k,a)}},[t,A]);let j=n=>{O({projectName:t,slug:n.slug,title:n.title}),e?.()};return t?(0,F.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,F.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center justify-between border-b border-border px-2`,children:[(0,F.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wide text-text-secondary`,children:`Designs`}),(0,F.jsxs)(`span`,{className:`flex items-center gap-0.5`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>{g(`design`),e?.()},"aria-label":`Design settings`,title:`Design settings`,className:B,children:(0,F.jsx)(i,{className:`size-4`})}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{C(t),e?.()},"aria-label":`New design`,title:`New design`,className:B,children:(0,F.jsx)(s,{className:`size-4`})})]})]}),(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-1`,children:[f?(0,F.jsx)(`p`,{className:`px-2 py-3 text-xs text-destructive`,children:f}):n===null?(0,F.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,F.jsx)(u,{className:`size-4 animate-spin text-primary`})}):V(n).length===0?(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-xs text-text-subtle`,children:[(0,F.jsx)(a,{className:`size-6`}),`No designs yet. Start one and describe what you want; the AI builds it beside a live preview.`,(0,F.jsx)(`button`,{type:`button`,onClick:()=>C(t),className:`min-h-11 px-3 text-sm text-primary underline`,children:`New design`})]}):V(n).map(e=>(0,F.jsxs)(x,{children:[(0,F.jsx)(S,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,onClick:()=>j(e),className:`flex w-full min-h-11 select-none items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-surface-elevated md:min-h-9`,children:[(0,F.jsx)(e.kind===`slides`?l:d,{className:`size-4 shrink-0 text-text-subtle`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate text-sm text-text-secondary`,children:e.title}),(0,F.jsx)(`span`,{className:`block truncate text-xs text-text-subtle`,children:h(e.updatedAt)})]})]})}),(0,F.jsxs)(v,{children:[(0,F.jsxs)(b,{onClick:()=>j(e),children:[(0,F.jsx)(a,{className:`size-4`}),` Open`]}),(0,F.jsxs)(b,{onClick:()=>T(e),children:[(0,F.jsx)(c,{className:`size-4`}),` Rename`]}),(0,F.jsx)(y,{}),(0,F.jsxs)(b,{variant:`destructive`,onClick:()=>D(e),children:[(0,F.jsx)(o,{className:`size-4`}),` Delete`]})]})]},e.slug)),n&&(0,F.jsx)(z,{projectName:t,systems:n.systems,onNavigate:e})]}),_&&(0,F.jsx)(I,{projectName:t,design:_,onClose:()=>T(null)}),E&&(0,F.jsx)(L,{projectName:t,design:E,onClose:()=>D(null)})]}):(0,F.jsx)(`p`,{className:`p-4 text-center text-xs text-text-subtle`,children:`Select a project to see its designs`})}export{H as DesignsSidebarPanel};
@@ -0,0 +1,4 @@
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Ot as r,ei as i,r as a,si as ee,xn as o,xt as te}from"./icons-C1wDt09O.js";import{a as s,o as c,r as l}from"./api-client-BnYFnEfK.js";import{t as u}from"./settings-store-CMpVMq3Y.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./git-repo-store-CESIqItW.js";import{t as d}from"./button-BHGVTbam.js";import{$ as ne,fi as re,tt as f,ui as ie,xi as ae}from"./index-Vd9Xr54k.js";import{t as oe}from"./use-monaco-theme-CbNQ4HnC.js";import{n as se,t as ce}from"./editor-font-UC3YDKcu.js";import{t as p}from"./use-inline-blame-BvlcOQd9.js";import{n as m,r as le}from"./monaco-dotenv-language-jKkZFsKj.js";import{n as h,o as g}from"./can-open-in-ppm-C_Ev8S2p.js";import{r as _}from"./image-preview-geometry-BX1a3Lfa.js";var v=e(t(),1),y=n();function b(e){return h.has(g(e))}function x(e){return/^[0-9a-f]{40}$/i.test(e)?e.slice(0,7):e}function S({mode:e,onChange:t}){return(0,y.jsxs)(`select`,{value:e,onChange:e=>t(e.target.value),title:`Show this file as an image or as text`,"aria-label":`Reopen editor with`,className:`h-11 rounded border border-border bg-transparent px-1 text-xs text-foreground outline-none md:h-6`,children:[(0,y.jsx)(`option`,{value:`preview`,children:`Image Preview`}),(0,y.jsx)(`option`,{value:`text`,children:`Text Editor`})]})}function ue({filePath:e,mode:t,original:n,modified:r,onOpenAnyway:i}){if(t===`text`||!b(e))return(0,y.jsx)(C,{onOpenAnyway:i});let a=[n,r].filter(e=>e.url!==null);if(a.length<2){let e=a[0];return e?(0,y.jsx)(w,{side:e}):(0,y.jsx)(C,{onOpenAnyway:i})}return(0,y.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col md:flex-row`,children:[(0,y.jsx)(w,{side:a[0]}),(0,y.jsx)(`div`,{className:`shrink-0 border-b border-border md:border-b-0 md:border-r`}),(0,y.jsx)(w,{side:a[1]})]})}function C({onOpenAnyway:e}){return(0,y.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 p-6 text-center`,children:[(0,y.jsx)(a,{className:`size-10 text-warning`}),(0,y.jsx)(`p`,{className:`max-w-md text-sm leading-relaxed text-text-secondary`,children:`The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding.`}),(0,y.jsx)(d,{onClick:e,className:`mt-auto h-11 w-full max-w-xs md:mt-0 md:w-auto md:px-5`,children:`Open Anyway`})]})}function w({side:e}){return(0,y.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5`,children:[(0,y.jsx)(`span`,{className:`truncate text-xs font-medium text-text-secondary`,children:e.label}),e.size!==null&&(0,y.jsx)(`span`,{className:`shrink-0 text-xs text-text-subtle`,children:_(e.size)})]}),(0,y.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto bg-surface p-4`,children:(0,y.jsx)(T,{url:e.url})})]})}function T({url:e}){let{blobUrl:t,failed:n}=E(e);return n?(0,y.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-text-subtle`,children:[(0,y.jsx)(r,{className:`size-8`}),(0,y.jsx)(`p`,{className:`text-xs`,children:`Failed to load.`})]}):t?(0,y.jsx)(`img`,{src:t,alt:``,className:`max-h-full max-w-full object-contain`}):(0,y.jsx)(o,{className:`size-5 animate-spin text-text-subtle`})}function E(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let t=!1;i(!1);let r=s();return fetch(e,{headers:r?{Authorization:`Bearer ${r}`}:{}}).then(e=>{if(!e.ok)throw Error(String(e.status));return e.blob()}).then(e=>{if(t)return;let r=URL.createObjectURL(e);a.current&&URL.revokeObjectURL(a.current),a.current=r,n(r)}).catch(()=>{t||i(!0)}),()=>{t=!0}},[e]),(0,v.useEffect)(()=>()=>{a.current&&URL.revokeObjectURL(a.current)},[]),{blobUrl:t,failed:r}}function de({onMount:e,...t}){let n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>()=>{let e=n.current;if(!e)return;let t=e.getModel();e.setModel(null),t?.original.dispose(),t?.modified.dispose()},[]),(0,y.jsx)(f,{...t,onMount:(t,r)=>{n.current=t,e?.(t,r)}})}function fe(e){return{js:`javascript`,jsx:`javascript`,ts:`typescript`,tsx:`typescript`,py:`python`,html:`html`,css:`css`,scss:`scss`,json:`json`,md:`markdown`,mdx:`markdown`,yaml:`yaml`,yml:`yaml`,sh:`shell`,bash:`shell`}[e.split(`.`).pop()?.toLowerCase()??``]??(m(e)?`dotenv`:`plaintext`)}function D({metadata:e}){let t=e?.filePath,n=e?.projectName,r=e?.ref1,a=e?.ref2,s=e?.file1,d=e?.file2,f=e?.original,m=e?.modified,h=f!=null||m!=null,g=!!(s&&d),[_,C]=(0,v.useState)(null),[w,T]=(0,v.useState)(null),[E,D]=(0,v.useState)(null),[O,k]=(0,v.useState)(`preview`),[A,j]=(0,v.useState)(!1),M=e=>{k(e),e===`preview`&&j(!1)},[N,P]=(0,v.useState)(!h),[F,I]=(0,v.useState)(null),{wordWrap:me,toggleWordWrap:L,mobileWordWrap:R,toggleMobileWordWrap:he}=u(re(e=>({wordWrap:e.wordWrap,toggleWordWrap:e.toggleWordWrap,mobileWordWrap:e.mobileWordWrap,toggleMobileWordWrap:e.toggleMobileWordWrap}))),ge=oe(),z=ie(n),B=(0,v.useRef)(null),V=(0,v.useRef)(null),[_e,ve]=(0,v.useState)(!1),[H,ye]=(0,v.useState)(null),[U,W]=(0,v.useState)(`modified`),[G,be]=(0,v.useState)();(0,v.useEffect)(()=>{let e=B.current;if(!e)return;let t=new ResizeObserver(([e])=>{e&&be(Math.floor(e.contentRect.height))});return t.observe(e),()=>t.disconnect()},[N,F]),(0,v.useEffect)(()=>ae(B.current,()=>V.current?.layout()),[N,F]),(0,v.useEffect)(()=>{if(h||!n)return;if(P(!0),I(null),D(null),T(null),C(null),s&&d){let e=new URLSearchParams({file1:s,file2:d});l.get(`${c(n)}/files/compare?${e}`).then(e=>{T(e),P(!1)}).catch(e=>{I(e instanceof Error?e.message:`Failed to compare files`),P(!1)});return}if(t){let e=z.fileScope(t);if(e===void 0)return;if(e===null){P(!1);return}let n=new URLSearchParams({file:e.path});r&&n.set(`ref`,r),a&&n.set(`ref2`,a),A&&n.set(`text`,`1`),l.get(z.fileGitUrl(`/file-full-diff?${n}`,e.repo)).then(e=>{D(e),P(!1)}).catch(e=>{I(e instanceof Error?e.message:`Failed to load diff`),P(!1)});return}let e;if(r||a){let t=new URLSearchParams;r&&t.set(`ref1`,r),a&&t.set(`ref2`,a),e=z.gitUrl(`/diff?${t}`)}else e=z.gitUrl(`/diff`);l.get(e).then(e=>{C(e.diff),P(!1)}).catch(e=>{I(e instanceof Error?e.message:`Failed to load diff`),P(!1)})},[t,n,r,a,s,d,h,z,A]),(0,v.useEffect)(()=>{j(!1),k(`preview`)},[t,r,a]);let{original:K,modified:q}=(0,v.useMemo)(()=>h?{original:f??``,modified:m??``}:g&&w?w:E||(_?pe(_):{original:``,modified:``}),[_,h,f,m,g,w,E]),xe=(0,v.useMemo)(()=>{let e=t??d??s;return e?fe(e):`plaintext`},[t,s,d]),J=u(e=>e.inlineBlame),Y=u(e=>e.toggleInlineBlame),X=typeof window<`u`&&window.innerWidth<768,Z=X?R:me,Se=X?he:L,Q=!!(n&&t&&E)&&!X;p({editor:H?.original??null,monaco:H?.monaco??null,projectName:n,filePath:Q?t:void 0,rev:r||`HEAD`,enabled:J&&Q&&U===`original`,readOnly:!0}),p({editor:H?.modified??null,monaco:H?.monaco??null,projectName:n,filePath:Q?t:void 0,rev:a,enabled:J&&Q&&U===`modified`,readOnly:!0});let $=!X;if((0,v.useEffect)(()=>{let e=V.current;if(!e)return;let t=Z?`on`:`off`;e.updateOptions({diffWordWrap:t}),e.getOriginalEditor().updateOptions({wordWrapOverride2:$?t:`off`}),e.getModifiedEditor().updateOptions({wordWrapOverride2:t})},[Z,_e,$]),!n&&!h)return(0,y.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm`,children:`No project selected.`});if(N)return(0,y.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,y.jsx)(o,{className:`size-5 animate-spin`}),(0,y.jsx)(`span`,{className:`text-sm`,children:`Loading diff...`})]});if(F)return(0,y.jsx)(`div`,{className:`flex items-center justify-center h-full text-destructive text-sm`,children:F});if(E?.binary&&!A&&t&&n){let e=z.fileScope(t),i=t=>e==null?null:z.fileGitUrl(`/file-blob?file=${encodeURIComponent(e.path)}&ref=${encodeURIComponent(t)}`,e.repo);return(0,y.jsxs)(`div`,{className:`flex flex-col h-full`,children:[b(t)&&(0,y.jsx)(`div`,{className:`flex items-center justify-end gap-0.5 px-2 py-0.5 border-b border-border shrink-0`,children:(0,y.jsx)(S,{mode:O,onChange:M})}),(0,y.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,y.jsx)(ue,{filePath:t,mode:O,original:{url:E.originalSize===null?null:i(r||`HEAD`),label:x(r||`HEAD`),size:E.originalSize},modified:{url:E.modifiedSize===null?null:a?i(a):`${c(n)}/files/raw?path=${encodeURIComponent(t)}`,label:a?x(a):`Working Tree`,size:E.modifiedSize},onOpenAnyway:()=>j(!0)})})]})}return!h&&!g&&!E&&!K&&!q?(0,y.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,y.jsx)(te,{className:`size-8`}),(0,y.jsx)(`p`,{className:`text-sm`,children:`No content changes`}),t&&(0,y.jsx)(`p`,{className:`text-xs font-mono`,children:t})]}):(0,y.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5 px-2 py-0.5 border-b border-border shrink-0`,children:[E?.binary&&t&&b(t)&&(0,y.jsx)(S,{mode:`text`,onChange:M}),Q&&(0,y.jsx)(`button`,{type:`button`,onClick:Y,title:`Inline blame (Alt+B) — who last touched the cursor's line. Click a pane to annotate that side.`,className:`flex items-center justify-center rounded hover:bg-muted active:scale-95 transition-colors p-1 ${J?`bg-muted text-foreground`:``}`,children:(0,y.jsx)(i,{className:`size-3.5`})}),(0,y.jsx)(`button`,{type:`button`,onClick:Se,title:Z?`Wrapping long lines — tap to scroll sideways instead`:`Toggle word wrap`,className:`flex items-center justify-center rounded hover:bg-muted active:scale-95 transition-colors ${X?`size-11`:`p-1`} ${Z?`bg-muted text-foreground`:``}`,children:(0,y.jsx)(ee,{className:`size-3.5`})})]}),(0,y.jsx)(`div`,{ref:B,className:`flex-1 overflow-hidden`,children:G&&G>0?(0,y.jsx)(de,{height:G,language:xe,beforeMount:e=>{ne(e),le(e)},original:K,modified:q,theme:ge,onMount:(e,t)=>{V.current=e,ve(!0);let n=e.getOriginalEditor(),r=e.getModifiedEditor();ye({monaco:t,original:n,modified:r}),n.onDidFocusEditorText(()=>W(`original`)),r.onDidFocusEditorText(()=>W(`modified`)),e.addCommand(t.KeyMod.Alt|t.KeyCode.KeyB,()=>u.getState().toggleInlineBlame())},options:{fontSize:X?11:14,fontFamily:ce,fontLigatures:se,diffWordWrap:Z?`on`:`off`,renderSideBySide:$,useInlineViewWhenSpaceIsLimited:!1,readOnly:!0,automaticLayout:!0,scrollBeyondLastLine:!1},loading:(0,y.jsx)(o,{className:`size-5 animate-spin text-muted-foreground`})}):(0,y.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,y.jsx)(o,{className:`size-5 animate-spin text-muted-foreground`})})})]})}function pe(e){let t=e.split(`
2
+ `),n=[],r=[],i=!1;for(let e of t)if(!(e.startsWith(`diff --git`)||e.startsWith(`diff --no-index`)||e.startsWith(`index `)||e.startsWith(`new file`)||e.startsWith(`deleted file`)||e.startsWith(`old mode`)||e.startsWith(`new mode`)||e.startsWith(`---`)||e.startsWith(`+++`)||e.startsWith(`Binary files`)||e.startsWith(`\\ No newline`))){if(e.startsWith(`@@`)){i=!0;continue}if(i)if(e.startsWith(`-`))n.push(e.slice(1));else if(e.startsWith(`+`))r.push(e.slice(1));else{let t=e.startsWith(` `)?e.slice(1):e;n.push(t),r.push(t)}}return{original:n.join(`
3
+ `),modified:r.join(`
4
+ `)}}export{D as DiffViewer};
@@ -1,4 +1,4 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n,_ as r,g as i,h as a,v as o}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Ot as s,xn as c}from"./icons-C1wDt09O.js";import{o as l,r as u}from"./api-client-BnYFnEfK.js";import{st as d}from"./index-Cx9ZRibz.js";import{i as f,l as p,n as m,r as h,t as g}from"./lib-DULxhi7W.js";var _={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},v=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,y=/-[a-z]/g,b=/%c(?:([-+])(\d+))?/g,x=/%x/g,S={2:!0,1:!1,0:null},C={};function w(e,t){let n=t||C,a=n.onerror,s=e instanceof i?e:new i(e),c=n.fragment?f:h,l=String(s);return p(c(l,{sourceCodeLocationInfo:!0,onParseError:n.onerror?u:null,scriptingEnabled:!1}),{file:s,space:n.space,verbose:n.verbose});function u(e){let t=e.code,i=T(t),c=n[i]??!0,u=typeof c==`number`?c:c?1:0;if(u){let n=_[i];o(n,"expected known error from `parse5`");let c=new r(d(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});s.path&&(c.file=s.path,c.name=s.path+`:`+c.name),c.fatal=S[u],c.note=d(n.description),c.url=n.url===!1?void 0:v+t,o(a,"`internalOnerror` is not passed if `onerror` is not set"),a(c)}function d(t){return t.replace(b,n).replace(x,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return D(l.charAt(e.startOffset+i))}function r(){return O(l.charCodeAt(e.startOffset))}}}}function T(e){return e.replace(y,E)}function E(e){return e.charAt(1).toUpperCase()}function D(e){return e==="`"?"` ` `":e}function O(e){return`0x`+e.toString(16).toUpperCase()}function k(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return w(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}function A(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return d(e,n)}}var j=e(t(),1),M={...m,attributes:{...m.attributes,img:[...m.attributes?.img??[],`src`,`width`,`height`]},protocols:{...m.protocols,src:[`http`,`https`,`data`],href:[`http`,`https`,`mailto`]}};function N(e){let t=e.tagName===`img`?e.properties?.src:void 0;typeof t==`string`&&/^data:/i.test(t)&&!/^data:image\//i.test(t)&&delete e.properties.src,e.children?.forEach(N)}var P=a().use(k,{fragment:!0}).use(g,M).use(()=>e=>N(e)).use(A);function F(e){return String(P.processSync(e))}var I=n();function L({filePath:e,projectName:t}){let[n,r]=(0,j.useState)(null),[i,a]=(0,j.useState)(!0),[o,d]=(0,j.useState)(null),f=(0,j.useMemo)(()=>n?F(n):``,[n]);return(0,j.useEffect)(()=>{a(!0),d(null);let n=/^(\/|[A-Za-z]:[/\\])/.test(e)?`/api/fs/docx-html?path=${encodeURIComponent(e)}`:`${l(t)}/files/docx-html?path=${encodeURIComponent(e)}`;u.get(n).then(e=>{r(e.html),a(!1)}).catch(e=>{d(e instanceof Error?e.message:`Failed to convert docx`),a(!1)})},[e,t]),(0,j.useEffect)(()=>{let n=n=>{let i=n.detail;if(i.projectName!==t||i.path!==e)return;let a=/^(\/|[A-Za-z]:[/\\])/.test(e)?`/api/fs/docx-html?path=${encodeURIComponent(e)}`:`${l(t)}/files/docx-html?path=${encodeURIComponent(e)}`;u.get(a).then(e=>r(e.html)).catch(()=>{})};return window.addEventListener(`file:changed`,n),()=>window.removeEventListener(`file:changed`,n)},[e,t]),i?(0,I.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-text-secondary`,children:[(0,I.jsx)(c,{className:`size-5 animate-spin`}),(0,I.jsx)(`span`,{className:`text-sm`,children:`Converting document...`})]}):o?(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,I.jsx)(s,{className:`size-10 text-text-subtle`}),(0,I.jsx)(`p`,{className:`text-sm`,children:`Failed to load document.`}),(0,I.jsx)(`p`,{className:`text-xs text-text-subtle`,children:o})]}):(0,I.jsx)(`div`,{className:`h-full overflow-auto bg-white dark:bg-bg`,children:(0,I.jsx)(`div`,{className:`docx-preview max-w-3xl mx-auto px-6 py-8 text-sm text-foreground leading-relaxed
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n,_ as r,g as i,h as a,v as o}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Ot as s,xn as c}from"./icons-C1wDt09O.js";import{o as l,r as u}from"./api-client-BnYFnEfK.js";import{st as d}from"./index-Vd9Xr54k.js";import{i as f,l as p,n as m,r as h,t as g}from"./lib-DULxhi7W.js";var _={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},v=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,y=/-[a-z]/g,b=/%c(?:([-+])(\d+))?/g,x=/%x/g,S={2:!0,1:!1,0:null},C={};function w(e,t){let n=t||C,a=n.onerror,s=e instanceof i?e:new i(e),c=n.fragment?f:h,l=String(s);return p(c(l,{sourceCodeLocationInfo:!0,onParseError:n.onerror?u:null,scriptingEnabled:!1}),{file:s,space:n.space,verbose:n.verbose});function u(e){let t=e.code,i=T(t),c=n[i]??!0,u=typeof c==`number`?c:c?1:0;if(u){let n=_[i];o(n,"expected known error from `parse5`");let c=new r(d(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});s.path&&(c.file=s.path,c.name=s.path+`:`+c.name),c.fatal=S[u],c.note=d(n.description),c.url=n.url===!1?void 0:v+t,o(a,"`internalOnerror` is not passed if `onerror` is not set"),a(c)}function d(t){return t.replace(b,n).replace(x,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return D(l.charAt(e.startOffset+i))}function r(){return O(l.charCodeAt(e.startOffset))}}}}function T(e){return e.replace(y,E)}function E(e){return e.charAt(1).toUpperCase()}function D(e){return e==="`"?"` ` `":e}function O(e){return`0x`+e.toString(16).toUpperCase()}function k(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return w(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}function A(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return d(e,n)}}var j=e(t(),1),M={...m,attributes:{...m.attributes,img:[...m.attributes?.img??[],`src`,`width`,`height`]},protocols:{...m.protocols,src:[`http`,`https`,`data`],href:[`http`,`https`,`mailto`]}};function N(e){let t=e.tagName===`img`?e.properties?.src:void 0;typeof t==`string`&&/^data:/i.test(t)&&!/^data:image\//i.test(t)&&delete e.properties.src,e.children?.forEach(N)}var P=a().use(k,{fragment:!0}).use(g,M).use(()=>e=>N(e)).use(A);function F(e){return String(P.processSync(e))}var I=n();function L({filePath:e,projectName:t}){let[n,r]=(0,j.useState)(null),[i,a]=(0,j.useState)(!0),[o,d]=(0,j.useState)(null),f=(0,j.useMemo)(()=>n?F(n):``,[n]);return(0,j.useEffect)(()=>{a(!0),d(null);let n=/^(\/|[A-Za-z]:[/\\])/.test(e)?`/api/fs/docx-html?path=${encodeURIComponent(e)}`:`${l(t)}/files/docx-html?path=${encodeURIComponent(e)}`;u.get(n).then(e=>{r(e.html),a(!1)}).catch(e=>{d(e instanceof Error?e.message:`Failed to convert docx`),a(!1)})},[e,t]),(0,j.useEffect)(()=>{let n=n=>{let i=n.detail;if(i.projectName!==t||i.path!==e)return;let a=/^(\/|[A-Za-z]:[/\\])/.test(e)?`/api/fs/docx-html?path=${encodeURIComponent(e)}`:`${l(t)}/files/docx-html?path=${encodeURIComponent(e)}`;u.get(a).then(e=>r(e.html)).catch(()=>{})};return window.addEventListener(`file:changed`,n),()=>window.removeEventListener(`file:changed`,n)},[e,t]),i?(0,I.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-text-secondary`,children:[(0,I.jsx)(c,{className:`size-5 animate-spin`}),(0,I.jsx)(`span`,{className:`text-sm`,children:`Converting document...`})]}):o?(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,I.jsx)(s,{className:`size-10 text-text-subtle`}),(0,I.jsx)(`p`,{className:`text-sm`,children:`Failed to load document.`}),(0,I.jsx)(`p`,{className:`text-xs text-text-subtle`,children:o})]}):(0,I.jsx)(`div`,{className:`h-full overflow-auto bg-white dark:bg-bg`,children:(0,I.jsx)(`div`,{className:`docx-preview max-w-3xl mx-auto px-6 py-8 text-sm text-foreground leading-relaxed
2
2
  [&_table]:border-collapse [&_table]:w-full [&_table]:my-3
3
3
  [&_td]:border [&_td]:border-border [&_td]:px-2 [&_td]:py-1
4
4
  [&_th]:border [&_th]:border-border [&_th]:px-2 [&_th]:py-1 [&_th]:font-semibold [&_th]:bg-muted/50
@@ -1 +1 @@
1
- import{E as e}from"./vendor-markdown-C-P1aR4p.js";import{P as t}from"./icons-C1wDt09O.js";import{n}from"./utils-D3xTlJyU.js";import{t as r}from"./button-BHGVTbam.js";import{a as i,n as a,o,r as s,t as c}from"./dialog-DnE192fh.js";import{i as l,m as u,r as d,t as f}from"./dropdown-menu-CxZR_vuV.js";import{S as p}from"./index-Cx9ZRibz.js";var m=e();function h({title:e,description:t,onClose:l,onSubmit:u,problems:d,buttons:f,children:p,wide:h}){return(0,m.jsx)(c,{open:!0,onOpenChange:e=>{e||l()},children:(0,m.jsxs)(a,{onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey||e.nativeEvent.isComposing||!u||e.target.closest(`button, textarea, [role=menuitem]`)||(e.preventDefault(),u())},className:n(`max-h-[calc(100dvh-4rem)] grid-rows-[auto_minmax(0,1fr)_auto] gap-3 p-5`,h?`sm:max-w-2xl`:`sm:max-w-lg`),children:[(0,m.jsxs)(i,{children:[(0,m.jsx)(o,{className:`text-base break-words`,children:e}),(0,m.jsx)(s,{className:`sr-only`,children:t})]}),(0,m.jsx)(`div`,{className:`-mx-1 grid content-start gap-3 overflow-y-auto px-1 py-0.5`,children:p}),(0,m.jsxs)(`div`,{className:`grid gap-2`,children:[d.length>0&&(0,m.jsx)(`ul`,{role:`alert`,className:`grid gap-0.5 text-[12.5px] text-error`,children:d.map(e=>(0,m.jsx)(`li`,{children:e},e))}),(0,m.jsx)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:f.map(e=>(0,m.jsx)(r,{type:`button`,size:`sm`,variant:e.variant??`outline`,disabled:e.disabled,onClick:e.onClick,children:e.label},e.label))})]})]})})}function g({id:e,value:r,onChange:i,options:a,disabled:o,listLabel:s,mono:c,invalid:h,autoFocus:g}){return(0,m.jsxs)(`div`,{className:`flex min-w-0`,children:[(0,m.jsx)(`input`,{id:e,value:r,onChange:e=>i(e.target.value),disabled:o,autoFocus:g,autoComplete:`off`,autoCapitalize:`off`,spellCheck:!1,"aria-invalid":h||void 0,className:n(p,`rounded-r-none`,c&&`font-mono`)}),(0,m.jsxs)(f,{children:[(0,m.jsx)(u,{asChild:!0,disabled:o||a.length===0,children:(0,m.jsx)(`button`,{type:`button`,"aria-label":s,title:s,className:`grid h-[30px] w-8 shrink-0 place-items-center rounded-r-md border border-l-0 border-border bg-surface text-text-subtle can-hover:hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-55`,children:(0,m.jsx)(t,{className:`size-3.5`})})}),(0,m.jsx)(d,{align:`end`,className:`max-h-72 overflow-y-auto`,children:a.map(e=>(0,m.jsx)(l,{onSelect:()=>i(e),className:n(c&&`font-mono text-xs`),children:e},e))})]})]})}export{g as n,h as t};
1
+ import{E as e}from"./vendor-markdown-C-P1aR4p.js";import{P as t}from"./icons-C1wDt09O.js";import{n}from"./utils-D3xTlJyU.js";import{t as r}from"./button-BHGVTbam.js";import{a as i,n as a,o,r as s,t as c}from"./dialog-DnE192fh.js";import{i as l,m as u,r as d,t as f}from"./dropdown-menu-CxZR_vuV.js";import{S as p}from"./index-Vd9Xr54k.js";var m=e();function h({title:e,description:t,onClose:l,onSubmit:u,problems:d,buttons:f,children:p,wide:h}){return(0,m.jsx)(c,{open:!0,onOpenChange:e=>{e||l()},children:(0,m.jsxs)(a,{onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey||e.nativeEvent.isComposing||!u||e.target.closest(`button, textarea, [role=menuitem]`)||(e.preventDefault(),u())},className:n(`max-h-[calc(100dvh-4rem)] grid-rows-[auto_minmax(0,1fr)_auto] gap-3 p-5`,h?`sm:max-w-2xl`:`sm:max-w-lg`),children:[(0,m.jsxs)(i,{children:[(0,m.jsx)(o,{className:`text-base break-words`,children:e}),(0,m.jsx)(s,{className:`sr-only`,children:t})]}),(0,m.jsx)(`div`,{className:`-mx-1 grid content-start gap-3 overflow-y-auto px-1 py-0.5`,children:p}),(0,m.jsxs)(`div`,{className:`grid gap-2`,children:[d.length>0&&(0,m.jsx)(`ul`,{role:`alert`,className:`grid gap-0.5 text-[12.5px] text-error`,children:d.map(e=>(0,m.jsx)(`li`,{children:e},e))}),(0,m.jsx)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:f.map(e=>(0,m.jsx)(r,{type:`button`,size:`sm`,variant:e.variant??`outline`,disabled:e.disabled,onClick:e.onClick,children:e.label},e.label))})]})]})})}function g({id:e,value:r,onChange:i,options:a,disabled:o,listLabel:s,mono:c,invalid:h,autoFocus:g}){return(0,m.jsxs)(`div`,{className:`flex min-w-0`,children:[(0,m.jsx)(`input`,{id:e,value:r,onChange:e=>i(e.target.value),disabled:o,autoFocus:g,autoComplete:`off`,autoCapitalize:`off`,spellCheck:!1,"aria-invalid":h||void 0,className:n(p,`rounded-r-none`,c&&`font-mono`)}),(0,m.jsxs)(f,{children:[(0,m.jsx)(u,{asChild:!0,disabled:o||a.length===0,children:(0,m.jsx)(`button`,{type:`button`,"aria-label":s,title:s,className:`grid h-[30px] w-8 shrink-0 place-items-center rounded-r-md border border-l-0 border-border bg-surface text-text-subtle can-hover:hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-55`,children:(0,m.jsx)(t,{className:`size-3.5`})})}),(0,m.jsx)(d,{align:`end`,className:`max-h-72 overflow-y-auto`,children:a.map(e=>(0,m.jsx)(l,{onSelect:()=>i(e),className:n(c&&`font-mono text-xs`),children:e},e))})]})]})}export{g as n,h as t};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./api-client-BnYFnEfK.js";import"./settings-store-CBJCnE5L.js";import"./window-store-UcSFgNCI.js";import"./panel-store-Dx2ziBLp.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./session-list-sync-triggers-D9i1FxWd.js";import{t as n}from"./tab-store-B4v2kAEY.js";import"./ws-auth-k7DWnL9T.js";import"./lsp-client-IsC8Ol0U.js";import{i as r,n as i,r as a,t as o,useLsp as s}from"./use-lsp-DcGiCpl9.js";var c=e(t(),1);function l(e,t,n){return t.addAction({id:`ppm.lsp.goToDefinition`,label:`Go to Definition`,keybindings:[e.KeyCode.F12],contextMenuGroupId:`navigation`,contextMenuOrder:1.1,run:async t=>{let s=t.getModel(),c=t.getPosition();if(!s||!c)return;let l=r(s);if(!l)return;let d=null;try{d=await l.connection.request(l.path,`textDocument/definition`,{textDocument:{uri:s.uri.toString()},position:i(c)})}catch{return}let f=(Array.isArray(d)?d[0]:d)??null;if(!f)return;let p=`targetUri`in f?f.targetUri:f.uri,m=`targetUri`in f?f.targetSelectionRange??f.targetRange:f.range;if(!p||!m)return;let h=o(m.start);if(p===s.uri.toString()){t.setPosition(h),t.revealPositionInCenterIfOutsideViewport(h,e.editor.ScrollType.Smooth),t.setSelection({startLineNumber:h.lineNumber,startColumn:h.column,endLineNumber:m.end.line+1,endColumn:m.end.character+1});return}let g=l.connection.statusOf(l.path);if(g?.state!==`ready`||!g.projectPath)return;let _=a(p);if(!_)return;let v=u(g.projectPath,_);v&&n.openFileTab(v,l.connection.projectName,h.lineNumber)}})}function u(e,t){let n=e.replace(/\\/g,`/`).replace(/\/+$/,``),r=t.replace(/\\/g,`/`);return r.startsWith(n+`/`)?r.slice(n.length+1):null}var d={status:null,diagnostics:[]};function f({editor:e,monaco:t,projectName:r,filePath:i,onState:a}){let{status:o,diagnostics:u,install:f}=s({editor:e,monaco:t,projectName:r,filePath:i,enabled:!0});(0,c.useEffect)(()=>{let r=l(t,e,{openFileTab:(e,t,r)=>n.getState().openTab({type:`editor`,title:e.split(`/`).pop()||e,projectId:t,metadata:{filePath:e,projectName:t,lineNumber:r},closable:!0})});return()=>r.dispose()},[t,e]);let p=(0,c.useRef)(a);return p.current=a,(0,c.useEffect)(()=>{p.current({status:o,diagnostics:u,install:f})},[o,u,f]),(0,c.useEffect)(()=>()=>p.current(d),[]),null}export{f as EditorLanguageService,f as default};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./api-client-BnYFnEfK.js";import"./settings-store-CMpVMq3Y.js";import"./window-store-D6EgLSfT.js";import"./panel-store-H7e9XHZF.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./session-list-sync-triggers-D9i1FxWd.js";import{t as n}from"./tab-store-NUmgzMPf.js";import"./ws-auth-k7DWnL9T.js";import"./lsp-client-CpjPUUYJ.js";import{i as r,n as i,r as a,t as o,useLsp as s}from"./use-lsp-fLNwD0BI.js";var c=e(t(),1);function l(e,t,n){return t.addAction({id:`ppm.lsp.goToDefinition`,label:`Go to Definition`,keybindings:[e.KeyCode.F12],contextMenuGroupId:`navigation`,contextMenuOrder:1.1,run:async t=>{let s=t.getModel(),c=t.getPosition();if(!s||!c)return;let l=r(s);if(!l)return;let d=null;try{d=await l.connection.request(l.path,`textDocument/definition`,{textDocument:{uri:s.uri.toString()},position:i(c)})}catch{return}let f=(Array.isArray(d)?d[0]:d)??null;if(!f)return;let p=`targetUri`in f?f.targetUri:f.uri,m=`targetUri`in f?f.targetSelectionRange??f.targetRange:f.range;if(!p||!m)return;let h=o(m.start);if(p===s.uri.toString()){t.setPosition(h),t.revealPositionInCenterIfOutsideViewport(h,e.editor.ScrollType.Smooth),t.setSelection({startLineNumber:h.lineNumber,startColumn:h.column,endLineNumber:m.end.line+1,endColumn:m.end.character+1});return}let g=l.connection.statusOf(l.path);if(g?.state!==`ready`||!g.projectPath)return;let _=a(p);if(!_)return;let v=u(g.projectPath,_);v&&n.openFileTab(v,l.connection.projectName,h.lineNumber)}})}function u(e,t){let n=e.replace(/\\/g,`/`).replace(/\/+$/,``),r=t.replace(/\\/g,`/`);return r.startsWith(n+`/`)?r.slice(n.length+1):null}var d={status:null,diagnostics:[]};function f({editor:e,monaco:t,projectName:r,filePath:i,onState:a}){let{status:o,diagnostics:u,install:f}=s({editor:e,monaco:t,projectName:r,filePath:i,enabled:!0});(0,c.useEffect)(()=>{let r=l(t,e,{openFileTab:(e,t,r)=>n.getState().openTab({type:`editor`,title:e.split(`/`).pop()||e,projectId:t,metadata:{filePath:e,projectName:t,lineNumber:r},closable:!0})});return()=>r.dispose()},[t,e]);let p=(0,c.useRef)(a);return p.current=a,(0,c.useEffect)(()=>{p.current({status:o,diagnostics:u,install:f})},[o,u,f]),(0,c.useEffect)(()=>()=>p.current(d),[]),null}export{f as EditorLanguageService,f as default};
@@ -0,0 +1,2 @@
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import{$t as r,A as i,Ct as a,Kr as o,L as s,Lt as c,P as l,Qr as u,Vn as d,Xt as f,Zr as p,_t as m,cr as h,et as g,fn as _,g as v,gn as y,hr as b,ht as x,ir as S,li as C,lt as ee,m as te,nr as ne,on as re,r as ie,tn as ae,u as oe,ut as se,v as ce,vt as le,xr as ue,yr as de,z as fe,zt as pe}from"./icons-C1wDt09O.js";import{t as me}from"./createLucideIcon-B2pji242.js";import{a as he,k as w}from"./api-client-BnYFnEfK.js";import{t as ge}from"./react-B9hau9ra.js";import{n as T}from"./utils-D3xTlJyU.js";import{n as _e}from"./window-store-D6EgLSfT.js";import{t as ve}from"./tab-store-NUmgzMPf.js";import{o as ye}from"./file-store-Bn0vbkCx.js";import{n as E}from"./use-is-mobile-CL2I7hLf.js";import{r as be}from"./clipboard-D3XnL7CB.js";import{n as xe}from"./file-icons-CB0RsVdl.js";import{a as Se,c as Ce,i as we,l as Te,m as Ee,r as De,s as Oe,t as ke}from"./dropdown-menu-CxZR_vuV.js";import{i as Ae,n as je,o as Me,r as D,t as Ne}from"./mobile-bottom-sheet-M9pZptfh.js";import{a as Pe,c as Fe,i as Ie,l as Le,n as Re,o as O,r as k,s as ze,t as A,u as j}from"./adaptive-context-menu-CxHkI7dL.js";import{n as M,t as Be}from"./fs-api-BVIVh_De.js";import{a as Ve,n as He,o as Ue,r as We,s as Ge,t as Ke}from"./format-file-meta-BOAh9mam.js";import{$r as qe,Gr as Je,Hr as Ye,Jr as Xe,Kr as Ze,Ur as Qe,Vr as N,Wr as $e,Zr as P,ai as et,bi as tt,ci as F,di as nt,ei as rt,ft as it,ii as at,ni as ot,oi as st,qr as I,ri as ct,si as lt,ti as L}from"./index-Vd9Xr54k.js";import{a as R,o as z,s as ut}from"./can-open-in-ppm-C_Ev8S2p.js";var dt=me(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),ft=`ppm-explorer-pins`,pt=50;function mt(){try{let e=localStorage.getItem(ft),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(e=>!!e&&typeof e.path==`string`&&typeof e.name==`string`).slice(0,pt):[]}catch{return[]}}function ht(e){try{localStorage.setItem(ft,JSON.stringify(e))}catch{}}var B=ge((e,t)=>({pins:mt(),isPinned:e=>t().pins.some(t=>t.path===e),pin:n=>{if(t().isPinned(n.path))return;let r=[...t().pins,n].slice(0,pt);ht(r),e({pins:r})},unpin:n=>{let r=t().pins.filter(e=>e.path!==n);ht(r),e({pins:r})}}));function gt(e){return R(e.name)?(ve.getState().openTab({type:ut(e.name)===`sqlite`?`sqlite`:`editor`,title:e.name,projectId:null,metadata:{filePath:e.path},closable:!0}),!0):!1}function _t(e){return _e.getState().open(`explorer`,{path:e})}async function vt(e){let t=e.filter(e=>e.type===`file`),n=e.length-t.length;n>0&&w.warning(n===1?`Folders cannot be downloaded`:`${n} folders skipped`);for(let e of t)try{tt(await M.downloadUrl(e.path),e.name)}catch(t){w.error(`Download failed: ${e.name}`,{description:t instanceof Error?t.message:void 0})}}async function yt(e,t){e.length!==0&&(await be(e.join(`
2
+ `)),w.success(e.length===1?`${t} copied`:`${e.length} ${t.toLowerCase()}s copied`))}var bt=/[<>:"|?*]/,xt=/[\u0000-\u001f]/,St=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i;function Ct(e,t){if(!e)return`Name cannot be empty`;if(e===`.`||e===`..`)return`Reserved name`;if(e.includes(`/`)||e.includes(`\\`))return`Name cannot contain path separators`;if(xt.test(e))return`Invalid character in name`;if(t===`win32`){if(bt.test(e))return`Cannot contain < > : " | ? *`;if(St.test(e))return`"${e}" is a reserved Windows name`;if(e.endsWith(`.`)||e.endsWith(` `))return`Cannot end with a dot or space`}return null}async function wt(e,t,n,r){let i=Ge(e,t,r);try{return n===`folder`?await M.mkdir(i,!1):await M.touch(i),st(e),!0}catch(e){return w.error(n===`folder`?`Could not create folder`:`Could not create file`,{description:He(e)}),!1}}async function Tt(e,t,n){try{return await M.rename(e,t),st(Ke(e,n)),!0}catch(e){return w.error(`Rename failed`,{description:He(e)}),!1}}async function Et(e,t,n){let r={removed:0,needsPermanent:[]},i=new Set;for(let a of e){i.add(Ke(a,n));try{await M.remove(a,t),r.removed++}catch(e){if(e instanceof Be&&e.code===`NO_TRASH`){r.needsPermanent.push(a);continue}w.error(`Delete failed`,{description:He(e)})}}if(st(...i),r.removed>0){let e=`${r.removed} item${r.removed===1?``:`s`}`;w.success(t?`Deleted ${e}`:`Moved ${e} to Trash`)}return r}function Dt(e,t){let n=e?Array.from({length:e.length},(t,n)=>e.item(n)).filter(e=>e!=null):[];return t(),n}var V=e(t(),1),H=n();function Ot(e){let t=(0,V.useRef)(null),n=(0,V.useRef)(null),r=typeof document<`u`&&`webkitdirectory`in document.createElement(`input`),i=t=>{let n=Dt(t.target.files,()=>{t.target.value=``});n.length!==0&&e(n.map(e=>({file:e,relativePath:e.webkitRelativePath||e.name})))};return{supportsFolderPicker:r,openFilePicker:()=>t.current?.click(),openFolderPicker:()=>n.current?.click(),inputs:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`input`,{ref:t,type:`file`,multiple:!0,hidden:!0,onChange:i,"data-testid":`explorer-upload-file-input`}),r&&(0,H.jsx)(`input`,{ref:n,webkitdirectory:``,type:`file`,multiple:!0,hidden:!0,onChange:i,"data-testid":`explorer-upload-folder-input`})]})}}function kt(e,t){let n=(0,V.useCallback)((t,n)=>Ze(t,n,e.sep,e),[e]),r=Ot(e=>void n(e,t()));return{uploadInto:n,openUploadPicker:r.openFilePicker,openUploadFolderPicker:r.openFolderPicker,supportsFolderUpload:r.supportsFolderPicker,uploadInputs:r.inputs}}function At(e,t,n,r){let i=F(e=>e.patch),a=Je(),o=$e(),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null),[d,f]=(0,V.useState)(null),p=(0,V.useRef)(t);p.current=t;let m=(0,V.useRef)(a);m.current=a;let h=(0,V.useRef)(o);h.current=o;let g=(0,V.useMemo)(()=>({get sep(){return p.current?.sep??`/`},resolve:e=>m.current.resolve(e),startBatch:()=>m.current.startBatch(),endBatch:()=>m.current.endBatch(),confirmPermanentOverwrite:e=>h.current.confirm(e)}),[]),_=()=>p.current?.path??``,v=kt(g,_),y=(0,V.useMemo)(()=>({openEntry:e=>{e.type===`directory`?n.go(e.path):gt(e)},openInNewWindow:e=>{_t(e.type===`directory`?e.path:p.current?.path??e.path)},openInTerminal:e=>{Xe(e?.type===`directory`?e.path:_())},cut:e=>at(e.map(e=>e.path),`cut`),copy:e=>at(e.map(e=>e.path),`copy`),paste:e=>void ct(e??_(),g),transferInto:async(e,t,n)=>{let r=await et(e,t,n,g);if(r.succeeded>0){let e=n===`copy`?`Copied`:`Moved`;w.success(`${e} ${r.succeeded} item${r.succeeded===1?``:`s`}`)}},uploadInto:v.uploadInto,openUploadPicker:v.openUploadPicker,openUploadFolderPicker:v.openUploadFolderPicker,supportsFolderUpload:v.supportsFolderUpload,startRename:t=>{f(null),i(e,{inlineEdit:{kind:`rename`,path:t.path,initial:t.name}})},startCreate:t=>{f(null),i(e,{inlineEdit:{kind:t,initial:``}})},cancelInline:()=>{f(null),i(e,{inlineEdit:null})},commitInline:async t=>{let n=p.current,a=n?.inlineEdit;if(!n||!a)return;let o=t.trim();if(a.kind===`rename`&&o===a.initial){i(e,{inlineEdit:null});return}let s=Ct(o,r);if(s){f(s);return}f(null),(a.kind===`rename`?await Tt(a.path,o,n.sep):await wt(n.path,o,a.kind===`new-folder`?`folder`:`file`,n.sep))&&i(e,{inlineEdit:null})},trash:e=>{Et(e.map(e=>e.path),!1,p.current?.sep??`/`).then(e=>{e.needsPermanent.length>0&&c({paths:e.needsPermanent,names:e.needsPermanent.map(e=>e.split(/[/\\]/).pop()??e)})})},confirmPermanentDelete:e=>{e.length!==0&&c({paths:e.map(e=>e.path),names:e.map(e=>e.name)})},download:e=>void vt(e),copyPath:e=>void yt(e,`Path`),copyName:e=>void yt(e,`Name`),togglePin:(e,t)=>{let n=B.getState();n.isPinned(e)?n.unpin(e):n.pin({path:e,name:t})},showProperties:e=>u(e)}),[e,i,n,g,r,v]),b=(0,V.useCallback)(()=>{let e=s;c(null),e&&Et(e.paths,!0,p.current?.sep??`/`)},[s]);return{actions:y,dialogs:{collision:a.state,pendingDelete:s,permanentOverwrite:o.state,properties:l,inlineError:d,closeDelete:()=>c(null),runPermanentDelete:b,closeProperties:()=>u(null),uploadInputs:v.uploadInputs}}}var jt=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...e,children:(0,H.jsx)(`path`,{stroke:`#64748B`,strokeWidth:`2`,d:`M7.784 5H5a2 2 0 00-2 2v10a2 2 0 002 2h14a2 2 0 002-2V9.875a2 2 0 00-2-2h-6.284a2 2 0 01-1.27-.455L9.054 5.455A2 2 0 007.783 5z`})}),Mt=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...e,children:(0,H.jsx)(`path`,{fill:`#64748B`,stroke:`#64748B`,strokeWidth:`2`,d:`M7.784 5H5a2 2 0 00-2 2v10a2 2 0 002 2h14a2 2 0 002-2V9.875a2 2 0 00-2-2h-6.284a2 2 0 01-1.27-.455L9.054 5.455A2 2 0 007.783 5z`})}),Nt=jt,Pt=Mt,Ft=(0,V.createContext)({closed:Nt,open:Pt}),It=Ft.Provider;function U({name:e,kind:t,open:n,className:i}){let a=(0,V.useContext)(Ft),o=T(`shrink-0`,i);return t===`directory`?(0,H.jsx)(n?a.open:a.closed,{className:o}):t===`symlink`?(0,H.jsx)(pe,{className:T(o,`text-text-2`)}):t===`unknown`?(0,H.jsx)(r,{className:T(o,`text-text-subtle`)}):(0,H.jsx)(xe,{name:e,className:o})}function Lt({className:e}){return(0,H.jsx)(U,{name:``,kind:`directory`,className:T(`size-4 shrink-0`,e)})}var Rt={fixed:f,removable:u,network:dt,unknown:f};function W({label:e,path:t,active:n,icon:r,onNavigate:i,onUnpin:a,run:o,uploadRun:s}){let c=ot(),l=N({targetDir:t,run:o,onFiles:s});return(0,H.jsxs)(`div`,{className:`group/place relative flex items-center`,children:[(0,H.jsxs)(`button`,{type:`button`,title:t,onClick:()=>i(t),className:T(`flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[13px]`,c?`min-h-[44px]`:`min-h-0`,`can-hover:hover:bg-surface-elevated`,n?`bg-accent-wash text-text`:`text-text-2`,l.isOver&&`ring-1 ring-dashed ring-primary bg-primary/10`),...l.handlers,children:[(0,H.jsx)(r,{className:`size-4 shrink-0 text-text-subtle`}),(0,H.jsx)(`span`,{className:`truncate`,children:e})]}),a&&(0,H.jsx)(`button`,{type:`button`,"aria-label":`Unpin ${e}`,title:`Unpin`,onClick:a,className:`absolute right-1 rounded p-1 text-text-subtle can-hover:opacity-0 can-hover:group-hover/place:opacity-100 can-hover:hover:text-text`,children:(0,H.jsx)(S,{className:`size-3.5`})})]})}function G({title:e,children:t}){return(0,H.jsxs)(`div`,{className:`pb-2`,children:[(0,H.jsx)(`p`,{className:`px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-text-subtle`,children:e}),t]})}var zt={home:`Home`,pinned:`Quick access`,known:`Folders`,drives:`Drives`};function Bt({host:e,currentPath:t,onNavigate:n,vocab:r=zt}){let i=B(e=>e.pins),a=B(e=>e.unpin),o=e=>e===t,{run:s,uploadRun:c,prompts:l}=Ye(e?.sep??`/`,e?.platform);return(0,H.jsxs)(`aside`,{"aria-label":`Places`,"data-testid":`explorer-sidebar`,className:`hidden w-44 shrink-0 overflow-y-auto border-r border-border bg-[var(--x-sidebar-bg,var(--panel-2))] px-1 py-1 sm:block`,children:[i.length>0&&(0,H.jsx)(G,{title:`Pinned`,children:i.map(e=>(0,H.jsx)(W,{label:e.name,path:e.path,icon:S,active:o(e.path),onNavigate:n,onUnpin:()=>a(e.path),run:s,uploadRun:c},e.path))}),e&&e.pinned.length>0&&(0,H.jsx)(G,{title:r.pinned,children:e.pinned.map(e=>(0,H.jsx)(W,{label:e.name,path:e.path,icon:Lt,active:o(e.path),onNavigate:n,run:s,uploadRun:c},e.path))}),e&&(0,H.jsxs)(G,{title:r.known,children:[(0,H.jsx)(W,{label:r.home,path:e.homedir,icon:Lt,active:o(e.homedir),onNavigate:n,run:s,uploadRun:c}),e.knownFolders.map(e=>(0,H.jsx)(W,{label:e.name,path:e.path,icon:Lt,active:o(e.path),onNavigate:n,run:s,uploadRun:c},e.path))]}),e&&e.drives.length>0&&(0,H.jsx)(G,{title:r.drives,children:e.drives.map(e=>(0,H.jsx)(W,{label:e.label?`${e.label} (${e.name})`:e.name,path:e.path,icon:Rt[e.kind],active:o(e.path),onNavigate:n,run:s,uploadRun:c},e.path))}),e?.warnings.map(e=>(0,H.jsxs)(`p`,{className:`flex gap-1.5 px-2 py-1 text-[11px] leading-snug text-text-subtle`,children:[(0,H.jsx)(ie,{className:`mt-0.5 size-3 shrink-0`}),(0,H.jsx)(`span`,{children:e})]},e)),l]})}var K=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function Vt(e,t,n){switch(e){case`size`:return(t.size??0)-(n.size??0);case`modified`:return new Date(t.modified).getTime()-new Date(n.modified).getTime();case`kind`:{let e=K.compare(z(t.name),z(n.name));return e===0?K.compare(t.name,n.name):e}case`name`:return K.compare(t.name,n.name)}}function Ht(e,t,n){let r=t.trim().toLowerCase(),i=r?e.filter(e=>e.name.toLowerCase().includes(r)):e,a=n.dir===`asc`?1:-1;return[...i].sort((e,t)=>{let r=e.type===`directory`;if(r!==(t.type===`directory`))return r?-1:1;let i=Vt(n.key,e,t);return(i===0?K.compare(e.name,t.name):i)*a})}function Ut(e){return e.reduce((e,t)=>e+(t.type===`file`?t.size??0:0),0)}function Wt({entries:e,selection:t,truncated:n}){let r=e.filter(e=>t.has(e.path)),i=[`${e.length}${n?`+`:``} item${e.length===1?``:`s`}`];if(r.length>0){i.push(`${r.length} selected`);let e=Ut(r);e>0&&i.push(Ue(e))}return(0,H.jsxs)(`div`,{"data-testid":`explorer-status`,className:`flex shrink-0 items-center gap-2 border-t border-border bg-panel-2 px-2 py-1 text-[11px] text-text-subtle`,children:[i.join(` · `),n&&(0,H.jsx)(`span`,{className:`ml-auto`,children:`Listing capped — narrow the filter to see the rest.`})]})}var Gt=3;function Kt({crumbs:e,onNavigate:t,className:n,sep:r}){let{run:i,prompts:a}=Ye(r);if(e.length===0)return(0,H.jsx)(`div`,{className:n});let o=e.length>Gt+2,c=o?e.slice(0,1):e,l=o?e.slice(1,e.length-Gt):[],u=o?e.slice(e.length-Gt):[];return(0,H.jsxs)(`nav`,{"aria-label":`Path`,className:T(`flex min-w-0 items-center gap-0.5 text-xs`,n),children:[c.map(n=>(0,H.jsxs)(`span`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,H.jsx)(qt,{crumb:n,last:!o&&n===e[e.length-1],onNavigate:t,run:i}),(0,H.jsx)(s,{className:`size-3 shrink-0 text-text-subtle`})]},n.path)),o&&(0,H.jsxs)(ke,{children:[(0,H.jsx)(Ee,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Show hidden path segments`,className:`rounded px-1 py-0.5 text-text-2 can-hover:hover:bg-surface-elevated`,children:(0,H.jsx)(d,{className:`size-3.5`})})}),(0,H.jsx)(De,{align:`start`,className:`max-h-72 overflow-y-auto`,children:l.map(e=>(0,H.jsx)(we,{onClick:()=>t(e.path),children:e.name},e.path))})]}),o&&(0,H.jsx)(s,{className:`size-3 shrink-0 text-text-subtle`}),u.map((e,n)=>(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-0.5`,children:[(0,H.jsx)(qt,{crumb:e,last:n===u.length-1,onNavigate:t,run:i}),n<u.length-1&&(0,H.jsx)(s,{className:`size-3 shrink-0 text-text-subtle`})]},e.path)),a]})}function qt({crumb:e,last:t,onNavigate:n,run:r}){let i=N({targetDir:e.path,run:r});return(0,H.jsx)(`button`,{type:`button`,onClick:()=>n(e.path),className:T(`max-w-[12rem] truncate rounded px-1 py-0.5 can-hover:hover:bg-surface-elevated`,t?`font-medium text-text`:`text-text-2`,i.isOver&&`ring-1 ring-dashed ring-primary bg-primary/10`),...i.handlers,children:e.name})}var q=[{key:`name`,label:`Name`},{key:`size`,label:`Size`},{key:`modified`,label:`Modified`},{key:`kind`,label:`Kind`}],Jt=[{dir:`asc`,label:`Ascending`},{dir:`desc`,label:`Descending`}];function Yt(e){return q.find(t=>t.key===e)?.label??e}function Xt(e){return Jt.find(t=>t.dir===e)?.label??e}function J(e){return T(`relative flex size-7 shrink-0 items-center justify-center rounded text-text-subtle can-hover:hover:bg-surface-elevated can-hover:hover:text-text disabled:opacity-30`,e&&`before:absolute before:-inset-2 before:content-['']`)}function Zt({coarse:e}){let t=F(e=>e.sort),n=F(e=>e.setPrefs),r=`Sort`,i=`${r}: ${Yt(t.key)}, ${Xt(t.dir)}`;return(0,H.jsxs)(ke,{children:[(0,H.jsx)(Ee,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":r,title:i,className:J(e),children:(0,H.jsx)(ce,{className:`size-4`})})}),(0,H.jsxs)(De,{align:`end`,children:[(0,H.jsx)(Se,{children:`Sort by`}),(0,H.jsx)(Oe,{value:t.key,onValueChange:e=>n({sort:{key:e,dir:t.dir}}),children:q.map(({key:e,label:t})=>(0,H.jsx)(Ce,{value:e,children:t},e))}),(0,H.jsx)(Te,{}),(0,H.jsx)(Se,{children:`Order`}),(0,H.jsx)(Oe,{value:t.dir,onValueChange:e=>n({sort:{key:t.key,dir:e}}),children:Jt.map(({dir:e,label:t})=>(0,H.jsx)(Ce,{value:e,children:t},e))})]})]})}function Y({targets:e,currentDir:t,hasClipboard:n,isPinned:r,actions:i}){let a=E(),o=e.length===1?e[0]:null,s=e.length>0&&e.every(e=>e.type===`directory`),c=e.length,l=c>1?` ${c} items`:``,u=F(e=>e.sort),d=F(e=>e.setPrefs);return c===0?(0,H.jsxs)(Re,{children:[(0,H.jsx)(k,{onClick:()=>i.startCreate(`new-file`),children:`New File`}),(0,H.jsx)(k,{onClick:()=>i.startCreate(`new-folder`),children:`New Folder`}),(0,H.jsx)(O,{}),(0,H.jsx)(k,{disabled:!n,onClick:()=>i.paste(),children:`Paste`}),(0,H.jsx)(O,{}),(0,H.jsx)(k,{onClick:()=>i.openUploadPicker(),children:`Upload Files…`}),i.supportsFolderUpload&&(0,H.jsx)(k,{onClick:()=>i.openUploadFolderPicker(),children:`Upload Folder…`}),(0,H.jsx)(O,{}),(0,H.jsx)(k,{onClick:()=>i.openInTerminal(),children:`Open in Terminal`}),(0,H.jsx)(O,{}),(0,H.jsxs)(ze,{children:[(0,H.jsx)(Le,{children:`Sort by`}),(0,H.jsxs)(Fe,{children:[(0,H.jsx)(Ie,{value:u.key,onValueChange:e=>d({sort:{key:e,dir:u.dir}}),children:q.map(({key:e,label:t})=>(0,H.jsx)(Pe,{value:e,children:t},e))}),(0,H.jsx)(O,{}),(0,H.jsx)(Ie,{value:u.dir,onValueChange:e=>d({sort:{key:u.key,dir:e}}),children:Jt.map(({dir:e,label:t})=>(0,H.jsx)(Pe,{value:e,children:t},e))})]})]}),(0,H.jsx)(O,{}),(0,H.jsx)(k,{onClick:()=>i.copyPath([t]),children:`Copy Path`})]}):(0,H.jsxs)(Re,{children:[o&&(o.type===`directory`||R(o.name))&&(0,H.jsx)(k,{onClick:()=>i.openEntry(o),children:`Open`}),s&&o&&!a&&(0,H.jsx)(k,{onClick:()=>i.openInNewWindow(o),children:`Open in New Window`}),s&&o&&(0,H.jsx)(k,{onClick:()=>i.openInTerminal(o),children:`Open in Terminal`}),(0,H.jsx)(O,{}),(0,H.jsxs)(k,{onClick:()=>i.cut(e),children:[`Cut`,l]}),(0,H.jsxs)(k,{onClick:()=>i.copy(e),children:[`Copy`,l]}),s&&o&&(0,H.jsx)(k,{disabled:!n,onClick:()=>i.paste(o.path),children:`Paste`}),(0,H.jsx)(O,{}),o&&(0,H.jsx)(k,{onClick:()=>i.startRename(o),children:`Rename`}),(0,H.jsxs)(k,{onClick:()=>i.trash(e),children:[`Move to Trash`,l]}),(0,H.jsx)(k,{variant:`destructive`,onClick:()=>i.confirmPermanentDelete(e),children:`Delete permanently`}),(0,H.jsx)(O,{}),(0,H.jsx)(k,{onClick:()=>i.copyPath(e.map(e=>e.path)),children:`Copy Path`}),(0,H.jsx)(k,{onClick:()=>i.copyName(e.map(e=>e.name)),children:`Copy Name`}),e.some(e=>e.type===`file`)&&(0,H.jsx)(k,{onClick:()=>i.download(e),children:`Download`}),s&&o&&(0,H.jsx)(k,{onClick:()=>i.togglePin(o.path,o.name),children:r(o.path)?`Unpin from Sidebar`:`Pin to Sidebar`}),o&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(O,{}),(0,H.jsx)(k,{onClick:()=>i.showProperties(o),children:`Properties`})]})]})}function Qt(e){let{entry:t,dragPaths:n,run:r,springLoad:i,origin:a=`explorer`,projectName:o,extraData:s,onDragStarted:c,onFiles:l}=e,u=rt({paths:n,origin:a,projectName:o,extraData:s,onDragStarted:c}),d=N({targetDir:t.type===`directory`?t.path:null,run:r,springLoad:t.type===`directory`?i:void 0,onFiles:l});return{props:(0,V.useMemo)(()=>({...u,...d.handlers}),[u,d.handlers]),isDropTarget:d.isOver}}function $t(e){return e.type===`directory`||R(e.name)?`open`:`sheet`}function en(e){return e.startsWith(`on`)&&e.length>2&&e[2]===e[2]?.toUpperCase()}function tn(e,t){return n=>{e?.(n),t?.(n)}}function nn(e,t){if(!e)return t;let n={...e};for(let[e,r]of Object.entries(t)){let t=n[e];if(en(e)&&typeof t==`function`&&typeof r==`function`){n[e]=tn(t,r);continue}if(e===`style`&&t&&r){n[e]={...t,...r};continue}if(e===`className`){n[e]=T(t,r);continue}r!==void 0&&(n[e]=r)}return n}function rn({entry:e,selected:t,currentDir:n,hasClipboard:r,isPinned:i,actions:a,rowHeight:o,onSelect:s,onOpen:c}){let l=Qt({entry:e,dragPaths:[e.path],run:a.transferInto,springLoad:s,onFiles:a.uploadInto});return(0,H.jsxs)(A,{children:[(0,H.jsx)(j,{asChild:!0,children:(0,H.jsx)(an,{entry:e,selected:t,rowHeight:o,onSelect:s,onOpen:c,dnd:l.props,dropActive:l.isDropTarget})}),(0,H.jsx)(Y,{targets:[e],currentDir:n,hasClipboard:r,isPinned:i,actions:a})]})}var an=(0,V.forwardRef)(function({entry:e,selected:t,rowHeight:n,onSelect:r,onOpen:i,dnd:a,dropActive:o,...s},c){let l=L(r),u=E(),{setOpen:d}=(0,V.useContext)(je),f=()=>{r(),!(!u||e.type===`directory`)&&($t(e)===`open`?i():d(!0))};return(0,H.jsxs)(`div`,{ref:c,...nn({...s,...l,...a},{role:`option`,"aria-selected":t,"data-testid":`explorer-column-row`,"data-path":e.path,title:e.name,style:{height:n},onContextMenu:e=>{r(),e.stopPropagation()},onClick:f,onDoubleClick:i,className:T(`flex w-full items-center gap-1.5 px-2 text-[13px] select-none`,`can-hover:hover:bg-surface-elevated`,t&&`bg-accent-wash text-text`,o&&`ring-1 ring-dashed ring-primary bg-primary/10`)}),children:[(0,H.jsx)(U,{name:e.name,kind:e.kind,className:`size-4 shrink-0`}),(0,H.jsx)(`span`,{className:T(`flex-1 truncate`,t?`text-text`:`text-text-2`),children:e.name}),e.type===`directory`&&(0,H.jsx)(`span`,{className:`text-text-subtle`,children:`›`})]})});function on({path:e,entries:t,loading:n,error:r,selectedPath:i,isFocused:a,currentDir:o,hasClipboard:s,isPinned:c,actions:l,rowHeight:u,onSelect:d,onOpen:f,onFocus:p,fullWidth:m}){let h=(0,V.useRef)(null);I(h);let g=m?48:u,_=nt({count:t.length,getScrollElement:()=>h.current,estimateSize:()=>g,overscan:8}),v=N({targetDir:e,run:l.transferInto,onFiles:l.uploadInto,disabled:m});return(0,H.jsx)(`div`,{className:T(`flex h-full shrink-0 flex-col`,!m&&`border-r border-border`,a&&`bg-panel-2/40`),style:m?void 0:{width:220},children:(0,H.jsxs)(`div`,{ref:h,role:`listbox`,"aria-label":e,className:T(`flex-1 overflow-y-auto outline-none`,v.isOver&&`ring-1 ring-dashed ring-primary bg-primary/10`),...v.handlers,children:[n&&t.length===0&&(0,H.jsx)(`p`,{className:`p-2 text-xs text-text-subtle`,children:`Loading…`}),r&&(0,H.jsx)(`p`,{className:`p-2 text-xs text-error`,children:r}),!n&&!r&&t.length===0&&(0,H.jsx)(`p`,{className:`p-2 text-xs text-text-subtle`,children:`Empty`}),(0,H.jsx)(`div`,{className:`relative w-full`,style:{height:_.getTotalSize()},children:_.getVirtualItems().map(e=>{let n=t[e.index],r=n.path===i;return(0,H.jsx)(`div`,{className:`absolute left-0 top-0 w-full`,style:{transform:`translateY(${e.start}px)`},children:(0,H.jsx)(rn,{entry:n,selected:r,currentDir:o,hasClipboard:s,isPinned:c,actions:l,rowHeight:g,onSelect:()=>{p(),d(n)},onOpen:()=>f(n)})},n.path)})})]})})}function sn({containerRef:e,onKeyDown:t,backgroundLongPress:n,columns:r,focusedIndex:i,setFocusedIndex:a,selectedPathFor:o,slice:s,hasClipboard:c,isPinned:l,actions:u,onSelect:d,onOpen:f}){let p=r[i];return(0,H.jsxs)(A,{children:[(0,H.jsx)(j,{asChild:!0,children:(0,H.jsxs)(`div`,{ref:e,tabIndex:0,"data-testid":`explorer-columns`,"aria-label":`Column view`,onKeyDown:t,className:`flex h-full min-h-0 w-full flex-col outline-none`,...n,children:[i>0&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>e-1),"aria-label":`Back`,className:`flex h-11 shrink-0 items-center gap-1.5 border-b border-border px-3 text-sm text-text-2 active:bg-surface-elevated`,children:[(0,H.jsx)(oe,{className:`size-4`}),` Back`]}),p&&(0,H.jsx)(`div`,{className:`min-h-0 flex-1 motion-safe:animate-in motion-safe:slide-in-from-right-4 motion-safe:duration-150`,children:(0,H.jsx)(on,{path:p.path,entries:p.entries,loading:p.loading,error:p.error,selectedPath:o(i),isFocused:!0,fullWidth:!0,rowHeight:48,currentDir:s.path,hasClipboard:c,isPinned:l,actions:u,onSelect:e=>d(i,e),onOpen:f,onFocus:()=>{}})},p.path)]})}),(0,H.jsx)(Y,{targets:[],currentDir:s.path,hasClipboard:c,isPinned:l,actions:u})]})}var cn=0,ln=[];function un(){return new Promise(e=>{let t=!1,n=()=>{cn++,e(()=>{if(t)return;t=!0,cn--;let e=ln.shift();e&&e()})};cn<24?n():ln.push(n)})}function dn({entry:e,size:t,className:n}){let[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(!1),s=(0,V.useRef)(null),c=(0,V.useRef)(null);return(0,V.useEffect)(()=>{i(null),o(!1)},[e.path]),(0,V.useEffect)(()=>{let t=s.current;if(!t||r||a)return;let n=new AbortController,l=null,u=new IntersectionObserver(t=>{t[0]?.isIntersecting&&(u.disconnect(),(async()=>{if(l=await un(),n.signal.aborted){l();return}try{let t=he(),r=await fetch(`/api/fs/raw?path=${encodeURIComponent(e.path)}`,{headers:t?{Authorization:`Bearer ${t}`}:{},signal:n.signal});if(!r.ok)throw Error(String(r.status));let a=await r.blob();if(n.signal.aborted)return;let o=URL.createObjectURL(a);c.current=o,i(o)}catch{n.signal.aborted||o(!0)}finally{l?.()}})())},{rootMargin:`200px`});return u.observe(t),()=>{n.abort(),u.disconnect(),l?.()}},[e.path,r,a]),(0,V.useEffect)(()=>()=>{c.current&&URL.revokeObjectURL(c.current)},[]),a||!r?(0,H.jsx)(`div`,{ref:s,className:T(`flex items-center justify-center`,n),style:{width:t,height:t},children:(0,H.jsx)(U,{name:e.name,kind:e.kind,className:`size-1/2`})}):(0,H.jsx)(`div`,{ref:s,className:T(`flex items-center justify-center overflow-hidden`,n),style:{width:t,height:t},children:(0,H.jsx)(`img`,{src:r,alt:``,loading:`lazy`,className:`max-h-full max-w-full rounded object-contain`,onError:()=>o(!0)})})}function fn({entry:e,onOpen:t}){return e?(0,H.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col items-center gap-3 overflow-y-auto p-4 text-center`,children:[(0,H.jsx)(`div`,{className:`flex h-24 w-24 shrink-0 items-center justify-center`,children:e.type!==`directory`&&ut(e.name)===`image`?(0,H.jsx)(dn,{entry:e,size:96}):(0,H.jsx)(U,{name:e.name,kind:e.kind,className:`size-16`})}),(0,H.jsx)(`p`,{className:`w-full truncate text-sm font-medium text-text`,title:e.name,children:e.name}),(0,H.jsxs)(`dl`,{className:`w-full space-y-1 text-left text-xs text-text-2`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,H.jsx)(`dt`,{className:`text-text-subtle`,children:`Kind`}),(0,H.jsx)(`dd`,{className:`truncate`,children:e.type===`directory`?`Folder`:z(e.name)||`File`})]}),e.type!==`directory`&&(0,H.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,H.jsx)(`dt`,{className:`text-text-subtle`,children:`Size`}),(0,H.jsx)(`dd`,{children:Ue(e.size)})]}),(0,H.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,H.jsx)(`dt`,{className:`text-text-subtle`,children:`Modified`}),(0,H.jsx)(`dd`,{className:`truncate`,children:We(e.modified)})]})]}),R(e.name)&&(0,H.jsx)(`button`,{type:`button`,onClick:()=>t(e),className:`mt-2 w-full rounded border border-border bg-panel-2 py-1.5 text-xs font-medium text-text can-hover:hover:bg-surface-elevated`,children:`Open`})]},e.path):(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-center text-xs text-text-subtle`,children:`Select a file to preview`})}function pn(e,t){switch(t.type){case`sync`:{let{paths:n,lastEntries:r,lastLoading:i,makeAbort:a}=t,o=n.length-1,s=n.map((t,n)=>{let s=e.columns[n],c=n===o;return s&&s.path===t?c?{...s,entries:r,loading:i,error:null}:s:c?{path:t,entries:r,loading:i,error:null,abort:a()}:{path:t,entries:[],loading:!0,error:null,abort:a()}}),c=[];for(let t=0;t<e.columns.length;t++){let n=e.columns[t],r=s[t];(!r||r.path!==n.path)&&c.push(n.abort)}return{columns:s,staleControllers:c}}case`loaded`:return{columns:e.columns.map(e=>e.path===t.path?{...e,entries:t.entries,loading:!1,error:null}:e),staleControllers:[]};case`error`:return{columns:e.columns.map(e=>e.path===t.path?{...e,loading:!1,error:t.message}:e),staleControllers:[]}}}function mn(e,t,n){let[r,i]=(0,V.useReducer)(pn,{columns:[],staleControllers:[]}),a=(0,V.useRef)(new Set);(0,V.useEffect)(()=>{i({type:`sync`,paths:e,lastEntries:t,lastLoading:n,makeAbort:()=>new AbortController})},[e.join(`\0`),t,n]),(0,V.useEffect)(()=>{for(let e of r.staleControllers)e.abort()},[r.staleControllers]);let o=(0,V.useRef)(r.columns);return o.current=r.columns,(0,V.useEffect)(()=>()=>{for(let e of o.current)e.abort.abort()},[]),(0,V.useEffect)(()=>{let e=r.columns.length-1;r.columns.forEach((t,n)=>{n!==e&&(!t.loading||a.current.has(t.abort)||(a.current.add(t.abort),M.browse(t.path,{signal:t.abort.signal}).then(e=>{a.current.delete(t.abort),!t.abort.signal.aborted&&i({type:`loaded`,path:t.path,entries:e.entries})}).catch(e=>{a.current.delete(t.abort),!(t.abort.signal.aborted||e instanceof DOMException&&e.name===`AbortError`)&&i({type:`error`,path:t.path,message:e instanceof Error?e.message:`Failed to read directory`})})))})},[r.columns]),{columns:r.columns}}var hn=720;function gn({slice:e,entries:t,actions:n,selection:r,hasClipboard:i,isPinned:a,nav:o,backgroundLongPress:s,rowHeight:c}){let{columns:l}=mn((0,V.useMemo)(()=>e.breadcrumbs.length>0?e.breadcrumbs.map(e=>e.path):[e.path],[e.breadcrumbs,e.path]),t,e.loading),u=E(),d=(0,V.useRef)(null);I(d);let[f,p]=(0,V.useState)(l.length-1),[m,h]=(0,V.useState)(0),g=(0,V.useRef)(l.length);(0,V.useEffect)(()=>{let e=d.current;if(!e)return;let t=()=>h(e.clientWidth);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,V.useEffect)(()=>{if(l.length===g.current)return;g.current=l.length,p(l.length-1);let e=d.current;if(!e)return;let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0;e.scrollTo({left:e.scrollWidth,behavior:t?`auto`:`smooth`})},[l.length]);let _=(0,V.useMemo)(()=>{if(!e.anchor)return null;for(let t of l){let n=t.entries.find(t=>t.path===e.anchor);if(n)return n}return null},[l,e.anchor]),v=t=>t===l.length-1?e.anchor:l[t+1]?.path??null,y=e=>{let t=l[e];if(!t)return null;let n=v(e);return t.entries.find(e=>e.path===n)??null},b=(e,t)=>{p(e),t.type===`directory`?o.go(t.path):r.selectOnly(t.path)},x=e=>n.openEntry(e),S=e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`ArrowRight`&&f<l.length-1){e.preventDefault(),e.stopPropagation(),p(f+1);return}if(e.key===`ArrowLeft`&&f>0){e.preventDefault(),e.stopPropagation(),p(f-1);return}if(e.key===`ArrowUp`||e.key===`ArrowDown`){let t=l[f];if(!t)return;e.preventDefault(),e.stopPropagation();let n=y(f),r=n?t.entries.findIndex(e=>e.path===n.path):-1,i=e.key===`ArrowDown`?1:-1,a=Math.min(t.entries.length-1,Math.max(0,r<0?0:r+i)),o=t.entries[a];o&&b(f,o);return}if(e.key===`Enter`){let t=y(f);t&&(e.preventDefault(),e.stopPropagation(),x(t))}}},C=m>=hn;return u?(0,H.jsx)(sn,{containerRef:d,onKeyDown:S,backgroundLongPress:s,columns:l,focusedIndex:f,setFocusedIndex:p,selectedPathFor:v,slice:e,hasClipboard:i,isPinned:a,actions:n,onSelect:b,onOpen:x}):(0,H.jsxs)(A,{children:[(0,H.jsx)(j,{asChild:!0,children:(0,H.jsxs)(`div`,{ref:d,tabIndex:0,"data-testid":`explorer-columns`,"aria-label":`Column view`,onKeyDown:S,className:`flex h-full min-h-0 w-full overflow-x-auto outline-none`,...s,children:[l.map((t,r)=>(0,H.jsx)(on,{path:t.path,entries:t.entries,loading:t.loading,error:t.error,selectedPath:v(r),isFocused:r===f,currentDir:e.path,hasClipboard:i,isPinned:a,actions:n,rowHeight:c,onSelect:e=>b(r,e),onOpen:x,onFocus:()=>p(r)},t.path)),C&&(0,H.jsx)(`div`,{className:`min-w-[240px] flex-1 border-l border-border bg-panel-2/30`,children:(0,H.jsx)(fn,{entry:_,onOpen:x})})]})}),(0,H.jsx)(Y,{targets:[],currentDir:e.path,hasClipboard:i,isPinned:a,actions:n})]})}function X(e,t){if(e.selection.size>0)return t.filter(t=>e.selection.has(t.path));let n=t.find(t=>t.path===e.anchor);return n?[n]:[]}function _n({slice:e,entries:t,actions:n,selection:r,nav:i}){return(0,V.useCallback)(a=>{if(!e)return;let o=a.target;if(o.tagName===`INPUT`||o.tagName===`TEXTAREA`||o.isContentEditable)return;let s=a.ctrlKey||a.metaKey,c=X(e,t);if(s)switch(a.key.toLowerCase()){case`a`:a.preventDefault(),r.selectAll();return;case`c`:a.preventDefault(),n.copy(c);return;case`x`:a.preventDefault(),n.cut(c);return;case`v`:a.preventDefault(),n.paste();return;default:return}switch(a.key){case`ArrowDown`:a.preventDefault(),r.moveTo(1,a.shiftKey);return;case`ArrowUp`:a.preventDefault(),r.moveTo(-1,a.shiftKey);return;case`Home`:a.preventDefault(),t[0]&&r.selectOnly(t[0].path);return;case`End`:a.preventDefault(),t.length>0&&r.selectOnly(t[t.length-1].path);return;case`ArrowLeft`:a.altKey&&(a.preventDefault(),i.back());return;case`ArrowRight`:a.altKey&&(a.preventDefault(),i.forward());return;case`Backspace`:a.preventDefault(),i.back();return;case`Enter`:a.preventDefault(),c.length===1&&n.openEntry(c[0]);return;case`F2`:a.preventDefault(),c.length===1&&n.startRename(c[0]);return;case`Delete`:if(a.preventDefault(),c.length===0)return;a.shiftKey?n.confirmPermanentDelete(c):n.trash(c);return;case`Escape`:r.clear();return}a.key.length===1&&!a.altKey&&(a.preventDefault(),r.typeAhead(a.key))},[e,t,n,r,i])}function vn(e,t){let n=E(),r=P(e=>e.selectMode),{setOpen:i}=(0,V.useContext)(je);return{isMobile:n,selectMode:r,handleTap:(a,o)=>n?r?(t.onRowClick(a.path,{shiftKey:!1,ctrlKey:!0,metaKey:!1}),!0):(o||t.selectOnly(a.path),$t(a)===`open`?e.openEntry(a):i(!0),!0):!1}}function Z({initial:e,error:t,onCommit:n,onCancel:r,className:i}){let[a,o]=(0,V.useState)(e),s=(0,V.useRef)(null);return(0,V.useEffect)(()=>{let t=s.current;if(!t)return;let n=()=>{t.focus();let n=e.lastIndexOf(`.`);n>0?t.setSelectionRange(0,n):t.select()};n();let r=requestAnimationFrame(()=>{document.activeElement!==t&&n()});return()=>cancelAnimationFrame(r)},[e]),(0,H.jsxs)(`div`,{className:`relative flex-1 min-w-0`,children:[(0,H.jsx)(`input`,{ref:s,value:a,"aria-label":`Name`,"aria-invalid":!!t,onChange:e=>o(e.target.value),onBlur:()=>n(a),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?n(a):e.key===`Escape`&&r()},className:T(`w-full rounded-[var(--rad-sm)] border bg-panel px-1.5 py-0.5 text-[13px] text-text outline-none`,t?`border-error`:`border-primary`,i)}),t&&(0,H.jsx)(`span`,{className:`absolute left-0 top-full z-10 mt-0.5 rounded border border-border bg-panel-2 px-1.5 py-0.5 text-[11px] text-error shadow-sm`,children:t})]})}var yn=(0,V.memo)(function(e){let{entry:t,currentDir:n,hasClipboard:r,isPinned:i,actions:a,menuTargets:o}=e,s=Qt({entry:t,dragPaths:(0,V.useMemo)(()=>o.map(e=>e.path),[o]),run:a.transferInto,onFiles:a.uploadInto});return(0,H.jsxs)(A,{children:[(0,H.jsx)(j,{asChild:!0,children:(0,H.jsx)(bn,{...e,dnd:s.props,dropActive:s.isDropTarget})}),(0,H.jsx)(Y,{targets:o,currentDir:n,hasClipboard:r,isPinned:i,actions:a})]})}),bn=(0,V.forwardRef)(function({entry:e,selected:t,focused:n,cut:r,renaming:a,tileWidth:o,actions:s,selection:c,inlineError:l,currentDir:u,hasClipboard:d,isPinned:f,menuTargets:p,dnd:m,dropActive:h,...g},_){let v=L(()=>{t||c.selectOnly(e.path)}),{isMobile:y,selectMode:b,handleTap:x}=vn(s,c),S=e.type!==`directory`&&ut(e.name)===`image`;return(0,H.jsxs)(`div`,{ref:_,...nn({...g,...v,...m},{role:`gridcell`,"aria-selected":t,"data-testid":`explorer-tile`,"data-path":e.path,title:e.name,style:o?{width:o}:void 0,onContextMenu:n=>{t||c.selectOnly(e.path),n.stopPropagation()},onClick:n=>{x(e,t)||c.onRowClick(e.path,n)},onDoubleClick:()=>s.openEntry(e),className:T(`relative flex flex-col items-center gap-1 rounded p-2 text-center select-none`,!o&&`w-full`,`can-hover:hover:bg-surface-elevated`,n&&!t&&`bg-surface-elevated`,t&&`bg-accent-wash`,r&&`opacity-40`,h&&`ring-1 ring-dashed ring-primary bg-primary/10`)}),children:[y&&b&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:T(`absolute left-1.5 top-1.5 flex size-5 items-center justify-center rounded border`,t?`border-primary bg-primary text-primary-foreground`:`border-border bg-panel`),children:t&&(0,H.jsx)(i,{className:`size-3.5`})}),(0,H.jsx)(`div`,{className:`flex h-12 w-12 shrink-0 items-center justify-center`,children:S?(0,H.jsx)(dn,{entry:e,size:48}):(0,H.jsx)(U,{name:e.name,kind:e.kind,className:`size-12`})}),a?(0,H.jsx)(Z,{initial:e.name,error:l,onCommit:e=>void s.commitInline(e),onCancel:s.cancelInline}):(0,H.jsx)(`span`,{className:T(`line-clamp-2 w-full break-words text-[12px] leading-tight`,t?`text-text`:`text-text-2`),children:e.name})]})}),xn=96,Sn=88,Cn=4,wn=16,Tn=3;function En({slice:e,entries:t,actions:n,selection:r,inlineError:i,hasClipboard:a,isPinned:o,backgroundLongPress:s}){let c=ye(e=>e.clipboard?.operation===`cut`?e.clipboard.paths:null),l=(0,V.useRef)(null);I(l);let u=E(),[d,f]=(0,V.useState)(u?Tn:1);(0,V.useEffect)(()=>{if(u){f(Tn);return}let e=l.current;if(!e)return;let t=()=>{let t=e.clientWidth-wn+Cn;f(Math.max(1,Math.floor(t/(xn+Cn))))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[u]);let p=nt({count:Math.ceil(t.length/d),getScrollElement:()=>l.current,estimateSize:()=>Sn,overscan:4}),m=e.anchor?t.findIndex(t=>t.path===e.anchor):-1,h=m>=0?Math.floor(m/d):-1;(0,V.useEffect)(()=>{h>=0&&p.scrollToIndex(h,{align:`auto`})},[h]);let g=(0,V.useMemo)(()=>X(e,t),[e,t]),_=e.inlineEdit?.kind===`new-file`||e.inlineEdit?.kind===`new-folder`,v=N({targetDir:e.path,run:n.transferInto,onFiles:n.uploadInto}),y=e=>{if(!(e.altKey||e.ctrlKey||e.metaKey))switch(e.key){case`ArrowDown`:e.preventDefault(),e.stopPropagation(),r.moveTo(d,e.shiftKey);return;case`ArrowUp`:e.preventDefault(),e.stopPropagation(),r.moveTo(-d,e.shiftKey);return;case`ArrowLeft`:e.preventDefault(),e.stopPropagation(),r.moveTo(-1,e.shiftKey);return;case`ArrowRight`:e.preventDefault(),e.stopPropagation(),r.moveTo(1,e.shiftKey);return}};return(0,H.jsxs)(A,{children:[(0,H.jsx)(j,{asChild:!0,children:(0,H.jsxs)(`div`,{ref:l,role:`grid`,tabIndex:0,"data-testid":`explorer-icons`,"aria-label":`File icons`,onKeyDown:y,onMouseDown:e=>{e.target===e.currentTarget&&r.clear()},className:T(`h-full flex-1 overflow-auto p-2 outline-none`,v.isOver&&`ring-1 ring-dashed ring-primary bg-primary/10`),...s,...v.handlers,children:[_&&(0,H.jsx)(`div`,{className:`mb-2 flex flex-col items-center gap-1 p-2`,style:u?void 0:{width:xn},children:(0,H.jsx)(Z,{initial:``,error:i,onCommit:e=>void n.commitInline(e),onCancel:n.cancelInline})}),(0,H.jsx)(`div`,{className:`relative w-full`,style:{height:p.getTotalSize()},children:p.getVirtualItems().map(s=>{let l=s.index*d,f=t.slice(l,l+d);return(0,H.jsx)(`div`,{role:`row`,className:T(`absolute left-0 top-0 w-full gap-1`,u?`grid grid-cols-3`:`flex`),style:{transform:`translateY(${s.start}px)`},children:f.map(t=>(0,H.jsx)(yn,{entry:t,currentDir:e.path,selected:e.selection.has(t.path),focused:e.anchor===t.path,cut:c?.includes(t.path)===!0,renaming:e.inlineEdit?.kind===`rename`&&e.inlineEdit.path===t.path,tileWidth:u?void 0:xn,menuTargets:e.selection.has(t.path)?g:[t],actions:n,selection:r,hasClipboard:a,isPinned:o,inlineError:i},t.path))},s.index)})}),t.length===0&&!e.loading&&!_&&(0,H.jsx)(`p`,{className:`p-3 text-xs text-text-subtle`,children:e.filter?`No entries match the filter.`:`This folder is empty.`})]})}),(0,H.jsx)(Y,{targets:[],currentDir:e.path,hasClipboard:a,isPinned:o,actions:n})]})}var Dn=(0,V.memo)(function(e){let{entry:t,currentDir:n,hasClipboard:r,isPinned:i,actions:a,menuTargets:o}=e,s=Qt({entry:t,dragPaths:(0,V.useMemo)(()=>o.map(e=>e.path),[o]),run:a.transferInto,onFiles:a.uploadInto});return(0,H.jsxs)(A,{children:[(0,H.jsx)(j,{asChild:!0,children:(0,H.jsx)(On,{...e,dnd:s.props,dropActive:s.isDropTarget})}),(0,H.jsx)(Y,{targets:o,currentDir:n,hasClipboard:r,isPinned:i,actions:a})]})}),On=(0,V.forwardRef)(function({entry:e,selected:t,focused:n,cut:r,renaming:a,height:o,actions:s,selection:c,inlineError:l,currentDir:u,hasClipboard:d,isPinned:f,menuTargets:p,dnd:m,dropActive:h,...g},_){let v=L(()=>{t||c.selectOnly(e.path)}),{isMobile:y,selectMode:b,handleTap:x}=vn(s,c);return(0,H.jsxs)(`div`,{ref:_,...nn({...g,...v,...m},{role:`row`,"aria-selected":t,"data-testid":`explorer-row`,"data-path":e.path,title:e.name,style:{height:o},onContextMenu:n=>{t||c.selectOnly(e.path),n.stopPropagation()},onClick:n=>{x(e,t)||c.onRowClick(e.path,n)},onDoubleClick:()=>s.openEntry(e),className:T(`flex w-full items-center gap-2 px-2 text-[13px] select-none`,`can-hover:hover:bg-surface-elevated`,n&&!t&&`bg-surface-elevated`,t&&`bg-accent-wash`,r&&`opacity-40`,h&&`ring-1 ring-dashed ring-primary bg-primary/10`)}),children:[y&&b&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:T(`flex size-5 shrink-0 items-center justify-center rounded border`,t?`border-primary bg-primary text-primary-foreground`:`border-border`),children:t&&(0,H.jsx)(i,{className:`size-3.5`})}),(0,H.jsx)(U,{name:e.name,kind:e.kind,className:`size-4`}),a?(0,H.jsx)(Z,{initial:e.name,error:l,onCommit:e=>void s.commitInline(e),onCancel:s.cancelInline}):(0,H.jsx)(`span`,{className:T(`flex-1 truncate`,t?`text-text`:`text-text-2`),children:e.name}),(0,H.jsx)(`span`,{className:`w-20 shrink-0 text-right tabular-nums text-text-subtle`,children:e.type===`directory`?``:Ue(e.size)}),(0,H.jsx)(`span`,{className:`hidden w-24 shrink-0 text-right text-text-subtle sm:inline`,children:Ve(e.modified)}),(0,H.jsx)(`span`,{className:`hidden w-16 shrink-0 truncate text-right text-text-subtle md:inline`,children:e.type===`directory`?`Folder`:z(e.name)||`File`})]})}),kn={name:`flex-1 text-left`,size:`w-20 text-right`,modified:`hidden w-24 text-right sm:block`,kind:`hidden w-16 text-right md:block`},An=q.map(e=>({...e,className:kn[e.key]}));function jn({slice:e,entries:t,actions:n,selection:r,inlineError:i,hasClipboard:a,isPinned:o,rowHeight:s,backgroundLongPress:c}){let u=F(e=>e.sort),d=F(e=>e.setPrefs),f=ye(e=>e.clipboard?.operation===`cut`?e.clipboard.paths:null),p=(0,V.useRef)(null);I(p);let m=it(),h=ot(),g=nt({count:t.length,getScrollElement:()=>p.current,estimateSize:()=>s,overscan:12}),_=e.anchor?t.findIndex(t=>t.path===e.anchor):-1;(0,V.useEffect)(()=>{_>=0&&g.scrollToIndex(_,{align:`auto`})},[_]);let v=(0,V.useMemo)(()=>X(e,t),[e,t]),y=e.inlineEdit?.kind===`new-file`||e.inlineEdit?.kind===`new-folder`,b=N({targetDir:e.path,run:n.transferInto,onFiles:n.uploadInto}),x=e=>d({sort:{key:e,dir:u.key===e&&u.dir===`asc`?`desc`:`asc`}});return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,H.jsx)(`div`,{role:`row`,className:T(`flex shrink-0 items-center gap-2 border-b border-border bg-[var(--x-toolbar-bg,var(--panel-2))] px-2 py-1 text-[11px] font-medium text-text-subtle`,m.id===`windows`&&`divide-x divide-border`),children:An.map(e=>(0,H.jsxs)(`button`,{type:`button`,"aria-label":`Sort by ${e.label}`,onClick:()=>x(e.key),className:T(`relative flex items-center gap-0.5 can-hover:hover:text-text`,m.id===`windows`&&e.key!==`name`&&`pl-2`,e.className,e.key!==`name`&&`justify-end`,h&&`before:absolute before:-inset-x-2 before:-inset-y-3 before:content-['']`),children:[e.label,u.key===e.key&&(u.dir===`asc`?(0,H.jsx)(fe,{className:`size-3`}):(0,H.jsx)(l,{className:`size-3`}))]},e.key))}),(0,H.jsxs)(A,{children:[(0,H.jsx)(j,{asChild:!0,children:(0,H.jsxs)(`div`,{ref:p,role:`grid`,tabIndex:0,"data-testid":`explorer-list`,"aria-label":`File list`,onMouseDown:e=>{e.target===e.currentTarget&&r.clear()},className:T(`flex-1 overflow-auto outline-none`,b.isOver&&`ring-1 ring-dashed ring-primary bg-primary/10`),...c,...b.handlers,children:[y&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2 px-2`,style:{height:s},children:[(0,H.jsx)(`span`,{className:`size-4 shrink-0`}),(0,H.jsx)(Z,{initial:``,error:i,onCommit:e=>void n.commitInline(e),onCancel:n.cancelInline})]}),(0,H.jsx)(`div`,{className:`relative w-full`,style:{height:g.getTotalSize()},children:g.getVirtualItems().map(c=>{let l=t[c.index];return(0,H.jsx)(`div`,{className:T(`absolute left-0 top-0 w-full`,m.id===`macos`&&c.index%2==1&&`bg-panel-2/40`),style:{transform:`translateY(${c.start}px)`},children:(0,H.jsx)(Dn,{entry:l,currentDir:e.path,selected:e.selection.has(l.path),focused:e.anchor===l.path,cut:f?.includes(l.path)===!0,renaming:e.inlineEdit?.kind===`rename`&&e.inlineEdit.path===l.path,height:s,menuTargets:e.selection.has(l.path)?v:[l],actions:n,selection:r,hasClipboard:a,isPinned:o,inlineError:i})},l.path)})}),t.length===0&&!e.loading&&!y&&(0,H.jsx)(`p`,{className:`p-3 text-xs text-text-subtle`,children:e.filter?`No entries match the filter.`:`This folder is empty.`})]})}),(0,H.jsx)(Y,{targets:[],currentDir:e.path,hasClipboard:a,isPinned:o,actions:n})]})]})}var Mn={list:jn,icons:En,columns:gn},Nn=Object.keys(Mn);function Pn(e){return Mn[e]??jn}var Fn={list:y,icons:_,columns:ee},In={list:`List view`,icons:`Icons view`,columns:`Column view`};function Ln({windowId:e,slice:t,nav:n,actions:r}){let i=F(e=>e.patch),a=F(e=>e.showHidden),o=F(e=>e.viewMode),s=F(e=>e.setPrefs),[c,l]=(0,V.useState)(!1),[u,d]=(0,V.useState)(t.path);(0,V.useEffect)(()=>d(t.path),[t.path]);let f=ot();return(0,H.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1 border-b border-border bg-[var(--x-toolbar-bg,var(--panel-2))] px-1.5 py-1`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":`Back`,title:`Back`,disabled:!n.canGoBack,onClick:n.back,className:J(f),children:(0,H.jsx)(oe,{className:`size-4`})}),(0,H.jsx)(`button`,{type:`button`,"aria-label":`Forward`,title:`Forward`,disabled:!n.canGoForward,onClick:n.forward,className:J(f),children:(0,H.jsx)(te,{className:`size-4`})}),(0,H.jsx)(`button`,{type:`button`,"aria-label":`Up one level`,title:`Up`,disabled:!t.parent,onClick:n.up,className:J(f),children:(0,H.jsx)(v,{className:`size-4`})}),(0,H.jsx)(`button`,{type:`button`,"aria-label":`Refresh`,title:`Refresh`,onClick:n.refresh,className:J(f),children:(0,H.jsx)(b,{className:T(`size-4`,t.loading&&`animate-spin`)})}),(0,H.jsxs)(`div`,{className:`flex min-w-[8rem] flex-1 items-center gap-1 rounded border border-border bg-panel px-1`,children:[c?(0,H.jsx)(`input`,{autoFocus:!0,"aria-label":`Path`,value:u,onChange:e=>d(e.target.value),onBlur:()=>l(!1),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?(n.go(u.trim()),l(!1)):e.key===`Escape`&&(d(t.path),l(!1))},className:`min-w-0 flex-1 bg-transparent py-1 font-mono text-xs text-text outline-none`}):(0,H.jsx)(Kt,{crumbs:t.breadcrumbs,onNavigate:n.go,sep:t.sep,className:`flex-1 overflow-hidden py-0.5`}),(0,H.jsx)(`button`,{type:`button`,"aria-label":c?`Show breadcrumb`:`Edit path`,title:c?`Show breadcrumb`:`Edit path`,onClick:()=>l(e=>!e),className:J(f),children:(0,H.jsx)(ne,{className:`size-3.5`})})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 rounded border border-border bg-panel px-1`,children:[(0,H.jsx)(ue,{className:`size-3.5 shrink-0 text-text-subtle`}),(0,H.jsx)(`input`,{"aria-label":`Filter entries`,placeholder:`Filter`,value:t.filter,onChange:t=>i(e,{filter:t.target.value}),onKeyDown:t=>{t.stopPropagation(),t.key===`Escape`&&i(e,{filter:``})},className:`w-24 min-w-0 bg-transparent py-1 text-xs text-text outline-none placeholder:text-text-subtle`}),t.filter&&(0,H.jsx)(`button`,{type:`button`,"aria-label":`Clear filter`,onClick:()=>i(e,{filter:``}),className:J(f),children:(0,H.jsx)(C,{className:`size-3.5`})})]}),Nn.length>1&&Nn.map(e=>{let t=Fn[e];return(0,H.jsx)(`button`,{type:`button`,"aria-label":In[e],title:In[e],"aria-pressed":o===e,onClick:()=>s({viewMode:e}),className:T(J(f),o===e&&`bg-accent-wash text-primary`),children:(0,H.jsx)(t,{className:`size-4`})},e)}),(0,H.jsx)(Zt,{coarse:f}),r.supportsFolderUpload?(0,H.jsxs)(ke,{children:[(0,H.jsx)(Ee,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Upload`,title:`Upload`,className:J(f),children:(0,H.jsx)(p,{className:`size-4`})})}),(0,H.jsxs)(De,{align:`end`,children:[(0,H.jsx)(we,{onClick:()=>r.openUploadPicker(),children:`Upload Files…`}),(0,H.jsx)(we,{onClick:()=>r.openUploadFolderPicker(),children:`Upload Folder…`})]})]}):(0,H.jsx)(`button`,{type:`button`,"aria-label":`Upload`,title:`Upload`,onClick:()=>r.openUploadPicker(),className:J(f),children:(0,H.jsx)(p,{className:`size-4`})}),(0,H.jsx)(`button`,{type:`button`,"aria-label":a?`Hide hidden files`:`Show hidden files`,title:a?`Hide hidden files`:`Show hidden files`,"aria-pressed":a,onClick:()=>s({showHidden:!a}),className:T(J(f),a&&`bg-accent-wash text-primary`),children:a?(0,H.jsx)(m,{className:`size-4`}):(0,H.jsx)(le,{className:`size-4`})})]})}var Rn={list:y,icons:_,columns:ee},zn={list:`List`,icons:`Icons`,columns:`Columns`};function Bn(e){return{name:e.breadcrumbs[e.breadcrumbs.length-1]?.name??e.path,path:e.path,type:`directory`,kind:`directory`,modified:``}}function Vn({open:e,onClose:t,slice:n,actions:r,entries:i}){let a=F(e=>e.viewMode),s=F(e=>e.sort),c=F(e=>e.showHidden),l=F(e=>e.setPrefs),u=X(n,i);return(0,H.jsxs)(Ne,{open:e,onClose:t,className:`p-2`,children:[(0,H.jsx)(Me,{children:`View`}),(0,H.jsx)(`div`,{className:`flex gap-1 px-2 pb-2`,children:Nn.map(e=>{let n=Rn[e];return(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":a===e,onClick:()=>{l({viewMode:e}),t()},className:T(`flex flex-1 flex-col items-center gap-1 rounded-lg py-2 text-xs active:bg-surface-elevated`,a===e?`bg-accent-wash text-primary`:`text-text-2`),children:[(0,H.jsx)(n,{className:`size-4`}),zn[e]]},e)})}),(0,H.jsx)(Ae,{}),(0,H.jsx)(Me,{children:`Sort by`}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1 px-2 pb-2`,children:q.map(({key:e,label:n})=>(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":s.key===e,onClick:()=>{l({sort:{key:e,dir:s.key===e&&s.dir===`asc`?`desc`:`asc`}}),t()},className:T(`inline-flex min-h-11 items-center justify-center rounded-full border px-3 py-1.5 text-xs active:bg-surface-elevated`,s.key===e?`border-primary bg-accent-wash text-text`:`border-border text-text-2`),children:[n,s.key===e?s.dir===`asc`?` ↑`:` ↓`:``]},e))}),(0,H.jsx)(Ae,{}),(0,H.jsxs)(D,{onClick:()=>l({showHidden:!c}),children:[c?(0,H.jsx)(m,{className:`size-4`}):(0,H.jsx)(le,{className:`size-4`}),c?`Hide hidden files`:`Show hidden files`]}),(0,H.jsx)(Ae,{}),(0,H.jsxs)(D,{variant:`destructive`,disabled:u.length===0,onClick:()=>r.confirmPermanentDelete(u),children:[(0,H.jsx)(o,{className:`size-4`}),`Delete permanently`,u.length>1?` (${u.length})`:``]}),(0,H.jsxs)(D,{onClick:()=>r.showProperties(Bn(n)),children:[(0,H.jsx)(re,{className:`size-4`}),`Properties of this folder`]})]})}function Q({icon:e,label:t,onClick:n,disabled:r,destructive:i}){return(0,H.jsxs)(`button`,{type:`button`,"aria-label":t,title:t,disabled:r,onClick:n,className:`flex min-w-[44px] flex-1 flex-col items-center gap-0.5 rounded-lg py-1.5 text-[10px] active:bg-surface-elevated disabled:opacity-30 ${i?`text-error`:`text-text-2`}`,children:[(0,H.jsx)(e,{className:`size-5`}),(0,H.jsx)(`span`,{className:`truncate`,children:t})]})}function Hn({slice:e,nav:t,actions:n,entries:r,hasClipboard:s}){let l=P(e=>e.selectMode),u=P(e=>e.setSelectMode),[f,m]=(0,V.useState)(!1),[_,v]=(0,V.useState)(!1),y=r.filter(t=>e.selection.has(t.path));return l?(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-t border-border px-1 py-1`,children:[(0,H.jsx)(Q,{icon:C,label:`Cancel`,onClick:()=>{u(!1)}}),(0,H.jsxs)(`span`,{className:`px-1 text-xs text-text-subtle`,children:[y.length,` selected`]}),(0,H.jsx)(`div`,{className:`flex-1`}),(0,H.jsx)(Q,{icon:de,label:`Cut`,disabled:y.length===0,onClick:()=>n.cut(y)}),(0,H.jsx)(Q,{icon:se,label:`Copy`,disabled:y.length===0,onClick:()=>n.copy(y)}),(0,H.jsx)(Q,{icon:o,label:`Trash`,disabled:y.length===0,destructive:!0,onClick:()=>n.trash(y)}),(0,H.jsx)(Q,{icon:x,label:`Download`,disabled:!y.some(e=>e.type===`file`),onClick:()=>n.download(y)}),y.length===1&&(0,H.jsx)(Q,{icon:re,label:`Info`,onClick:()=>n.showProperties(y[0])})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-t border-border px-1 py-1`,children:[(0,H.jsx)(Q,{icon:oe,label:`Back`,disabled:!t.canGoBack,onClick:t.back}),(0,H.jsx)(Q,{icon:h,label:`New`,onClick:()=>m(!0)}),(0,H.jsx)(Q,{icon:g,label:`Paste`,disabled:!s,onClick:()=>n.paste()}),(0,H.jsx)(Q,{icon:i,label:`Select`,onClick:()=>u(!0)}),(0,H.jsx)(Q,{icon:d,label:`More`,onClick:()=>v(!0)})]}),(0,H.jsxs)(Ne,{open:f,onClose:()=>m(!1),className:`p-2`,children:[(0,H.jsxs)(D,{onClick:()=>n.startCreate(`new-file`),children:[(0,H.jsx)(a,{className:`size-4`}),` New File`]}),(0,H.jsxs)(D,{onClick:()=>n.startCreate(`new-folder`),children:[(0,H.jsx)(c,{className:`size-4`}),` New Folder`]}),(0,H.jsxs)(D,{onClick:()=>{m(!1),n.openUploadPicker()},children:[(0,H.jsx)(p,{className:`size-4`}),` Upload Files…`]})]}),(0,H.jsx)(Vn,{open:_,onClose:()=>v(!1),slice:e,actions:n,entries:r})]})}function Un(e){return e.breadcrumbs[e.breadcrumbs.length-1]?.name??e.path}function Wn({slice:e,onClose:t}){return(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-3 py-2.5`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[15px] font-semibold text-text`,children:Un(e)}),(0,H.jsx)(`button`,{type:`button`,"aria-label":`Close file explorer`,title:`Close`,onClick:t,className:`flex size-11 shrink-0 items-center justify-center rounded-full text-text-2 active:bg-surface-elevated`,children:(0,H.jsx)(C,{className:`size-5`})})]})}var Gn=`size-4 shrink-0 text-text-subtle`,Kn={fixed:f,removable:u,network:dt,unknown:f};function qn(){return(0,H.jsx)(U,{name:``,kind:`directory`,className:Gn})}function $({label:e,path:t,active:n,icon:r,onNavigate:i}){return(0,H.jsxs)(`button`,{type:`button`,title:t,onClick:()=>i(t),className:T(`flex min-h-[44px] w-full items-center gap-2.5 rounded-lg px-3 text-left text-sm active:bg-surface-elevated`,n?`bg-accent-wash text-text`:`text-text-2`),children:[r,(0,H.jsx)(`span`,{className:`truncate`,children:e})]})}function Jn({title:e,children:t}){return(0,H.jsxs)(`div`,{className:`pb-2`,children:[(0,H.jsx)(`p`,{className:`px-3 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-wide text-text-subtle`,children:e}),t]})}function Yn({open:e,onClose:t,host:n,currentPath:r,vocab:i,onNavigate:a}){let o=B(e=>e.pins),s=e=>e===r;return(0,H.jsx)(Ne,{open:e,onClose:t,zIndex:65,className:`p-1`,children:(0,H.jsxs)(`div`,{className:`max-h-[70vh] overflow-y-auto px-1 pb-2`,children:[o.length>0&&(0,H.jsx)(Jn,{title:`Pinned`,children:o.map(e=>(0,H.jsx)($,{label:e.name,path:e.path,icon:(0,H.jsx)(S,{className:Gn}),active:s(e.path),onNavigate:a},e.path))}),n&&n.pinned.length>0&&(0,H.jsx)(Jn,{title:i.pinned,children:n.pinned.map(e=>(0,H.jsx)($,{label:e.name,path:e.path,icon:qn(),active:s(e.path),onNavigate:a},e.path))}),n&&(0,H.jsxs)(Jn,{title:i.known,children:[(0,H.jsx)($,{label:i.home,path:n.homedir,icon:qn(),active:s(n.homedir),onNavigate:a}),n.knownFolders.map(e=>(0,H.jsx)($,{label:e.name,path:e.path,icon:qn(),active:s(e.path),onNavigate:a},e.path))]}),n&&n.drives.length>0&&(0,H.jsx)(Jn,{title:i.drives,children:n.drives.map(e=>{let t=Kn[e.kind];return(0,H.jsx)($,{label:e.label?`${e.label} (${e.name})`:e.name,path:e.path,icon:(0,H.jsx)(t,{className:Gn}),active:s(e.path),onNavigate:a},e.path)})})]})})}function Xn({className:e}){return(0,H.jsx)(U,{name:``,kind:`directory`,className:e})}var Zn={fixed:f,removable:u,network:dt,unknown:f};function Qn({chip:e,active:t,onNavigate:n}){let r=e.icon;return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>n(e.path),title:e.path,className:T(`flex h-11 shrink-0 items-center gap-1.5 rounded-full border px-3 text-[13px] active:bg-surface-elevated`,t?`border-primary bg-accent-wash text-text`:`border-border text-text-2`),children:[(0,H.jsx)(r,{className:`size-4 shrink-0 text-text-subtle`}),(0,H.jsx)(`span`,{className:`max-w-[9rem] truncate`,children:e.label})]})}function $n({host:e,currentPath:t,onNavigate:n,vocab:r}){let i=B(e=>e.pins),[a,o]=(0,V.useState)(!1);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 overflow-x-auto touch-pan-x border-b border-border px-2 py-1.5`,children:[[...i.map(e=>({key:`pin:${e.path}`,label:e.name,path:e.path,icon:S})),...e?[{key:`home`,label:r.home,path:e.homedir,icon:Xn}]:[],...e?.pinned.map(e=>({key:`os:${e.path}`,label:e.name,path:e.path,icon:Xn}))??[],...e?.drives.map(e=>({key:`drive:${e.path}`,label:e.label?`${e.label} (${e.name})`:e.name,path:e.path,icon:Zn[e.kind]}))??[]].map(e=>(0,H.jsx)(Qn,{chip:e,active:e.path===t,onNavigate:n},e.key)),(0,H.jsx)(`button`,{type:`button`,"aria-label":`All places`,title:`All places`,onClick:()=>o(!0),className:`flex h-11 shrink-0 items-center gap-1 rounded-full border border-border px-3 text-[13px] text-text-2 active:bg-surface-elevated`,children:(0,H.jsx)(d,{className:`size-4`})})]}),(0,H.jsx)(Yn,{open:a,onClose:()=>o(!1),host:e,currentPath:t,vocab:r,onNavigate:e=>{o(!1),n(e)}})]})}function er(e,t,n){let r=(0,V.useRef)(null),i=F(e=>e.patch),a=(0,V.useRef)(t?.path??``);a.current=t?.path??``;let o=(0,V.useRef)(n);o.current=n;let s=(0,V.useCallback)(async t=>{r.current?.abort();let n=new AbortController;r.current=n,i(e,{loading:!0,error:null});try{let r=await M.browse(t,{showHidden:o.current,signal:n.signal});if(n.signal.aborted)return;i(e,{entries:r.entries,breadcrumbs:r.breadcrumbs,parent:r.parent,sep:r.sep,truncated:r.truncated===!0,loading:!1,error:null})}catch(t){if(n.signal.aborted||t instanceof DOMException&&t.name===`AbortError`)return;i(e,{loading:!1,entries:[],error:t instanceof Be?{message:t.message,code:t.code,hint:t.hint}:{message:t instanceof Error?t.message:`Failed to read directory`,code:`EUNKNOWN`}})}},[e,i]),c=t?.path;(0,V.useEffect)(()=>{if(c)return s(c),()=>r.current?.abort()},[c,n,s]),(0,V.useEffect)(()=>lt(e=>{e===a.current&&s(e)}),[s]);let l=(0,V.useCallback)((t,n)=>{let r=F.getState().slices[e];if(!r||t===r.path)return;let a=n?.replace?[...r.history.slice(0,r.historyIndex),t]:[...r.history.slice(0,r.historyIndex+1),t];i(e,{path:t,history:a.slice(-100),historyIndex:Math.min(a.length,100)-1,selection:new Set,anchor:null,filter:``,inlineEdit:null}),_e.getState().setPayload(e,{path:t})},[e,i]),u=(0,V.useCallback)(t=>{let n=F.getState().slices[e];if(!n)return;let r=n.historyIndex+t,a=n.history[r];a!=null&&(i(e,{path:a,historyIndex:r,selection:new Set,anchor:null,filter:``,inlineEdit:null}),_e.getState().setPayload(e,{path:a}))},[e,i]),d=(0,V.useCallback)(()=>u(-1),[u]),f=(0,V.useCallback)(()=>u(1),[u]),p=(0,V.useCallback)(()=>{let t=F.getState().slices[e];t?.parent&&l(t.parent)},[e,l]),m=(0,V.useCallback)(()=>{a.current&&s(a.current)},[s]),h=(t?.historyIndex??0)>0,g=t?t.historyIndex<t.history.length-1:!1;return(0,V.useMemo)(()=>({go:l,back:d,forward:f,up:p,refresh:m,canGoBack:h,canGoForward:g}),[l,d,f,p,m,h,g])}function tr(e,t,n){let r=t==null?-1:e.indexOf(t),i=e.indexOf(n);if(i<0)return[];if(r<0)return[n];let[a,o]=r<=i?[r,i]:[i,r];return e.slice(a,o+1)}function nr(e,t,n){switch(n.type){case`clear`:return{selection:new Set,anchor:null};case`select-all`:return{selection:new Set(t),anchor:e.anchor??t[0]??null};case`set`:return{selection:new Set(n.paths),anchor:n.anchor===void 0?n.paths[n.paths.length-1]??null:n.anchor};case`click`:if(n.ctrl){let t=new Set(e.selection);return t.has(n.path)?t.delete(n.path):t.add(n.path),{selection:t,anchor:n.path}}if(n.shift){let r=tr(t,e.anchor,n.path);return{selection:new Set(r),anchor:e.anchor??n.path}}return{selection:new Set([n.path]),anchor:n.path}}}function rr(e,t,n){if(e.length===0)return null;let r=t==null?-1:e.indexOf(t);return r<0?n>0?e[0]:e[e.length-1]:e[Math.min(e.length-1,Math.max(0,r+n))]}function ir(e,t,n){if(!t)return-1;let r=t.toLowerCase(),i=n<0?0:n+1;for(let t=0;t<e.length;t++){let n=(i+t)%e.length;if(e[n].toLowerCase().startsWith(r))return n}return-1}function ar(e,t){let n=F(e=>e.patch),r=(0,V.useRef)(t);r.current=t;let i=(0,V.useRef)({text:``,at:0}),a=(0,V.useCallback)(t=>{let i=F.getState().slices[e];i&&n(e,nr(i,r.current,t))},[e,n]),o=(0,V.useCallback)((t,n)=>{let i=F.getState().slices[e];if(!i)return;let o=rr(r.current,i.anchor,t);o!=null&&a({type:`click`,path:o,shift:n})},[e,a]),s=(0,V.useCallback)(t=>{let n=F.getState().slices[e];if(!n)return null;let o=Date.now(),s=o-i.current.at>800?t:i.current.text+t;i.current={text:s,at:o};let c=r.current,l=ir(c.map(e=>e.split(/[/\\]/).pop()??e),s,s.length===1&&n.anchor?c.indexOf(n.anchor):-1);return l<0?null:(a({type:`click`,path:c[l]}),c[l])},[e,a]),c=(0,V.useCallback)((e,t)=>a({type:`click`,path:e,shift:t.shiftKey,ctrl:t.ctrlKey||t.metaKey}),[a]),l=(0,V.useCallback)(e=>a({type:`click`,path:e}),[a]),u=(0,V.useCallback)(()=>a({type:`select-all`}),[a]),d=(0,V.useCallback)(()=>a({type:`clear`}),[a]),f=(0,V.useCallback)((e,t)=>a({type:`set`,paths:e,anchor:t}),[a]);return(0,V.useMemo)(()=>({onRowClick:c,selectOnly:l,selectAll:u,clear:d,setSelection:f,moveTo:o,typeAhead:s}),[c,l,u,d,f,o,s])}var or=28,sr=36,cr=48;function lr({windowId:e,initialPath:t,variant:n=`window`}){let r=F(e=>e.ensure);(0,V.useEffect)(()=>r(e,t),[r,e,t]);let i=F(t=>t.slices[e]),a=F(e=>e.showHidden),o=F(e=>e.viewMode),s=F(e=>e.sort),{host:c}=qe(),l=ye(e=>(e.clipboard?.paths.length??0)>0),u=B(e=>e.isPinned),d=ot(),f=it(),p=er(e,i,a),{actions:m,dialogs:h}=At(e,i,p,c?.platform),g=(0,V.useMemo)(()=>i?Ht(i.entries,i.filter,s):[],[i?.entries,i?.filter,s]),_=ar(e,(0,V.useMemo)(()=>g.map(e=>e.path),[g])),v=_n({slice:i,entries:g,actions:m,selection:_,nav:p}),y=L(),b=P(e=>e.close);if(!i)return null;let x=Pn(o),S=n===`sheet`,C=S?cr:d?sr:or;return(0,H.jsxs)(`div`,{"data-skin":f.id,style:{fontFamily:`var(--x-font)`},className:`flex h-full min-h-0 w-full flex-col bg-panel text-text`,children:[S?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Wn,{slice:i,onClose:b}),(0,H.jsx)($n,{host:c,currentPath:i.path,onNavigate:p.go,vocab:f.vocab})]}):(0,H.jsx)(Ln,{windowId:e,slice:i,nav:p,actions:m}),i.error&&(0,H.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-border bg-error/10 px-2 py-1.5 text-xs text-error`,children:[(0,H.jsx)(ie,{className:`mt-0.5 size-3.5 shrink-0`}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`p`,{className:`break-words`,children:i.error.message}),i.error.hint&&(0,H.jsx)(`p`,{className:`mt-0.5 text-text-2`,children:i.error.hint})]}),c&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>p.go(c.homedir),className:`flex shrink-0 items-center gap-1 rounded border border-border px-1.5 py-0.5 text-text-2 can-hover:hover:bg-surface-elevated`,children:[(0,H.jsx)(ae,{className:`size-3`}),` Go home`]})]}),(0,H.jsx)(It,{value:{closed:f.FolderIcon,open:f.FolderOpenIcon},children:(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[!S&&(0,H.jsx)(Bt,{host:c,currentPath:i.path,onNavigate:p.go,vocab:f.vocab}),(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,onKeyDown:v,children:(0,H.jsx)(x,{windowId:e,slice:i,entries:g,actions:m,selection:_,inlineError:h.inlineError,hasClipboard:l,isPinned:u,rowHeight:C,nav:p,backgroundLongPress:y})})]})}),S?(0,H.jsx)(Hn,{slice:i,nav:p,actions:m,entries:g,hasClipboard:l}):(0,H.jsx)(Wt,{entries:g,selection:i.selection,truncated:i.truncated}),(0,H.jsx)(Qe,{dialogs:h,platform:c?.platform,sep:i.sep})]})}export{lr as t};
@@ -1 +1 @@
1
- import{p as e}from"./db-sidebar-reveal-BeT8cp6P.js";import{n as t}from"./db-types-cHkNH-mN.js";function n(e){return e.type===`sqlite`||!!e.single_database}function r(e){return e.type===`sqlite`?null:e.default_database??null}function i(e){return n(e)?{conn:e.id,database:r(e)}:null}function a(e,t){return!!e&&!!t&&e.conn===t.conn&&e.database===t.database}function o(e){return`${e.conn}/${e.database??``}`}function s(e,t){return t.type===`sqlite`||e.database===null?void 0:e.database}function c(e,t){return e.database===null||e.database===r(t)?void 0:e.database}function l(e,t){return t===void 0?e:`${e}${e.includes(`?`)?`&`:`?`}database=${encodeURIComponent(t)}`}var u=[`database`,`db-structure`,`db-sql`,`db-query`];function d(e,t){if(!e||!u.includes(e.type))return null;let n=e.metadata?.connectionId;if(typeof n!=`number`)return null;let i=t(n);if(!i)return null;let a=e.metadata?.database;return typeof a==`string`&&a&&i.type!==`sqlite`?{conn:n,database:a}:{conn:n,database:r(i)}}function f(e,t,n){return!e||!n(e.conn)?!1:t?e.conn!==t.conn||e.database!==null&&e.database!==t.database:!0}function p(e,t,n){return f(e,t,n)?e.conn:t&&n(t.conn)?t.conn:null}function m(t,n){return e(n,{allowedDatabases:t.allowed_databases,allowedDatabasesRegex:t.allowed_databases_regex??void 0})}var h=[{field:`name`,label:`Display name`},{field:`server`,label:`Server`},{field:`user`,label:`User`},{field:`engine`,label:`Database engine`},{field:`database`,label:`Database name`}];function g(e){if(e.type!==`sqlite`)return e.default_database??``;let t=e.server??``;return t.slice(Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`))+1)}function _(e,r,i,a){let o=r.trim().toLowerCase();if(!o)return{show:!0,databases:null};let s=new Set(i),c=e=>!!e&&e.toLowerCase().includes(o),l=s.has(`name`)&&c(e.name)||s.has(`server`)&&c(e.server)||s.has(`user`)&&c(e.user)||s.has(`engine`)&&c(t[e.type]),u=n(e),d=s.has(`database`)&&u&&c(g(e)),f=s.has(`database`)&&!u&&a?a.filter(e=>c(e)):[];return{show:l||d||f.length>0,databases:f.length>0&&!l?f:null}}function v(e,t){let n=new Set;for(let t of e)t.group_name&&n.add(t.group_name);for(let e of t)n.add(e);return[...n].sort((e,t)=>e.localeCompare(t))}function y(e){return e.type===`sqlite`?e.server??``:`${e.server?`${e.user?`${e.user}@`:``}${e.server}`:``}${e.default_database?`/${e.default_database}`:``}`}var b=[{kind:`table`,label:`Tables`,one:`table`},{kind:`view`,label:`Views`,one:`view`},{kind:`matview`,label:`Materialized views`,one:`materialized view`},{kind:`procedure`,label:`Procedures`,one:`procedure`},{kind:`function`,label:`Functions`,one:`function`},{kind:`trigger`,label:`Triggers`,one:`trigger`},{kind:`sequence`,label:`Sequences`,one:`sequence`}],x=new Set([`table`,`view`,`matview`]);function S(e){return e===`postgres`}function C(e){let t=new Map;for(let n of e.objects)n.schema!==null&&t.set(n.schema,(t.get(n.schema)??0)+1);return[...new Set([...e.schemas,...t.keys()])].sort((e,t)=>e.localeCompare(t)).map(e=>({schema:e,count:t.get(e)??0}))}function w(e,t){return t&&e.some(e=>e.schema===t)?t:e.some(e=>e.schema===`public`)?`public`:(e.find(e=>e.count>0)??e[0])?.schema??null}function T(e,t){return`${e??``}.${t}`}function E(e){let t=new Map;for(let n of e){let e=T(n.schema,n.table),r=t.get(e);r?r.push(n):t.set(e,[n])}return t}function D(e){return!!e.query.trim()&&(e.fields.includes(`column`)||e.fields.includes(`type`))}function O(e,t){let n=t.query.trim().toLowerCase();return!n||!t.fields.includes(`column`)?[]:(t.columns?.get(T(e.schema,e.name))??[]).filter(e=>e.name.toLowerCase().includes(n))}function k(e,t,n){let r=n.fields;return r.includes(`name`)&&e.name.toLowerCase().includes(t)||r.includes(`schema`)&&e.schema?.toLowerCase().includes(t)?!0:!r.includes(`column`)&&!r.includes(`type`)?!1:(n.columns?.get(T(e.schema,e.name))??[]).some(e=>r.includes(`column`)&&e.name.toLowerCase().includes(t)||r.includes(`type`)&&e.type.toLowerCase().includes(t))}function A(e,t,n){let r=n.query.trim().toLowerCase(),i=t===null?e.objects:e.objects.filter(e=>e.schema===t),a=(e,t)=>e.name.localeCompare(t.name)||(e.args??``).localeCompare(t.args??``),o=(e,t)=>(t.rowEstimate??-1)-(e.rowEstimate??-1)||a(e,t),s=[];for(let{kind:e,label:t}of b){let c=i.filter(t=>t.kind===e&&(!r||k(t,r,n)));n.onlyWithRows&&e===`table`&&(c=c.filter(e=>e.rowEstimate===void 0||e.rowEstimate>0)),c.length!==0&&s.push({kind:e,label:t,items:c.sort(n.sort===`rows`?o:a)})}return s}function j(e){return e>=1e6?`~${(e/1e6).toFixed(1)}M`:e>=1e4?`~${Math.round(e/1e3)}k`:e>=1e3?`~${(e/1e3).toFixed(1)}k`:e>=100?`~${e}`:String(e)}function M(e,t){let n=t.trim().toLowerCase();if(!n)return null;let r=e.toLowerCase().indexOf(n);return r<0?null:[e.slice(0,r),e.slice(r,r+n.length),e.slice(r+n.length)]}function N(e,t){return`${o(e)}|${T(t.schema,t.name)}`}function P(e){return Number(e.slice(0,e.indexOf(`/`)))}export{l as A,D as C,d as D,c as E,T as O,C as S,i as T,_,p as a,r as b,o as c,j as d,A as f,n as g,w as h,P as i,m as k,f as l,M as m,x as n,y as o,S as p,E as r,s,h as t,v as u,O as v,g as w,a as x,N as y};
1
+ import{p as e}from"./db-sidebar-reveal-CGqWBYay.js";import{n as t}from"./db-types-cHkNH-mN.js";function n(e){return e.type===`sqlite`||!!e.single_database}function r(e){return e.type===`sqlite`?null:e.default_database??null}function i(e){return n(e)?{conn:e.id,database:r(e)}:null}function a(e,t){return!!e&&!!t&&e.conn===t.conn&&e.database===t.database}function o(e){return`${e.conn}/${e.database??``}`}function s(e,t){return t.type===`sqlite`||e.database===null?void 0:e.database}function c(e,t){return e.database===null||e.database===r(t)?void 0:e.database}function l(e,t){return t===void 0?e:`${e}${e.includes(`?`)?`&`:`?`}database=${encodeURIComponent(t)}`}var u=[`database`,`db-structure`,`db-sql`,`db-query`];function d(e,t){if(!e||!u.includes(e.type))return null;let n=e.metadata?.connectionId;if(typeof n!=`number`)return null;let i=t(n);if(!i)return null;let a=e.metadata?.database;return typeof a==`string`&&a&&i.type!==`sqlite`?{conn:n,database:a}:{conn:n,database:r(i)}}function f(e,t,n){return!e||!n(e.conn)?!1:t?e.conn!==t.conn||e.database!==null&&e.database!==t.database:!0}function p(e,t,n){return f(e,t,n)?e.conn:t&&n(t.conn)?t.conn:null}function m(t,n){return e(n,{allowedDatabases:t.allowed_databases,allowedDatabasesRegex:t.allowed_databases_regex??void 0})}var h=[{field:`name`,label:`Display name`},{field:`server`,label:`Server`},{field:`user`,label:`User`},{field:`engine`,label:`Database engine`},{field:`database`,label:`Database name`}];function g(e){if(e.type!==`sqlite`)return e.default_database??``;let t=e.server??``;return t.slice(Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`))+1)}function _(e,r,i,a){let o=r.trim().toLowerCase();if(!o)return{show:!0,databases:null};let s=new Set(i),c=e=>!!e&&e.toLowerCase().includes(o),l=s.has(`name`)&&c(e.name)||s.has(`server`)&&c(e.server)||s.has(`user`)&&c(e.user)||s.has(`engine`)&&c(t[e.type]),u=n(e),d=s.has(`database`)&&u&&c(g(e)),f=s.has(`database`)&&!u&&a?a.filter(e=>c(e)):[];return{show:l||d||f.length>0,databases:f.length>0&&!l?f:null}}function v(e,t){let n=new Set;for(let t of e)t.group_name&&n.add(t.group_name);for(let e of t)n.add(e);return[...n].sort((e,t)=>e.localeCompare(t))}function y(e){return e.type===`sqlite`?e.server??``:`${e.server?`${e.user?`${e.user}@`:``}${e.server}`:``}${e.default_database?`/${e.default_database}`:``}`}var b=[{kind:`table`,label:`Tables`,one:`table`},{kind:`view`,label:`Views`,one:`view`},{kind:`matview`,label:`Materialized views`,one:`materialized view`},{kind:`procedure`,label:`Procedures`,one:`procedure`},{kind:`function`,label:`Functions`,one:`function`},{kind:`trigger`,label:`Triggers`,one:`trigger`},{kind:`sequence`,label:`Sequences`,one:`sequence`}],x=new Set([`table`,`view`,`matview`]);function S(e){return e===`postgres`}function C(e){let t=new Map;for(let n of e.objects)n.schema!==null&&t.set(n.schema,(t.get(n.schema)??0)+1);return[...new Set([...e.schemas,...t.keys()])].sort((e,t)=>e.localeCompare(t)).map(e=>({schema:e,count:t.get(e)??0}))}function w(e,t){return t&&e.some(e=>e.schema===t)?t:e.some(e=>e.schema===`public`)?`public`:(e.find(e=>e.count>0)??e[0])?.schema??null}function T(e,t){return`${e??``}.${t}`}function E(e){let t=new Map;for(let n of e){let e=T(n.schema,n.table),r=t.get(e);r?r.push(n):t.set(e,[n])}return t}function D(e){return!!e.query.trim()&&(e.fields.includes(`column`)||e.fields.includes(`type`))}function O(e,t){let n=t.query.trim().toLowerCase();return!n||!t.fields.includes(`column`)?[]:(t.columns?.get(T(e.schema,e.name))??[]).filter(e=>e.name.toLowerCase().includes(n))}function k(e,t,n){let r=n.fields;return r.includes(`name`)&&e.name.toLowerCase().includes(t)||r.includes(`schema`)&&e.schema?.toLowerCase().includes(t)?!0:!r.includes(`column`)&&!r.includes(`type`)?!1:(n.columns?.get(T(e.schema,e.name))??[]).some(e=>r.includes(`column`)&&e.name.toLowerCase().includes(t)||r.includes(`type`)&&e.type.toLowerCase().includes(t))}function A(e,t,n){let r=n.query.trim().toLowerCase(),i=t===null?e.objects:e.objects.filter(e=>e.schema===t),a=(e,t)=>e.name.localeCompare(t.name)||(e.args??``).localeCompare(t.args??``),o=(e,t)=>(t.rowEstimate??-1)-(e.rowEstimate??-1)||a(e,t),s=[];for(let{kind:e,label:t}of b){let c=i.filter(t=>t.kind===e&&(!r||k(t,r,n)));n.onlyWithRows&&e===`table`&&(c=c.filter(e=>e.rowEstimate===void 0||e.rowEstimate>0)),c.length!==0&&s.push({kind:e,label:t,items:c.sort(n.sort===`rows`?o:a)})}return s}function j(e){return e>=1e6?`~${(e/1e6).toFixed(1)}M`:e>=1e4?`~${Math.round(e/1e3)}k`:e>=1e3?`~${(e/1e3).toFixed(1)}k`:e>=100?`~${e}`:String(e)}function M(e,t){let n=t.trim().toLowerCase();if(!n)return null;let r=e.toLowerCase().indexOf(n);return r<0?null:[e.slice(0,r),e.slice(r,r+n.length),e.slice(r+n.length)]}function N(e,t){return`${o(e)}|${T(t.schema,t.name)}`}function P(e){return Number(e.slice(0,e.indexOf(`/`)))}export{l as A,D as C,d as D,c as E,T as O,C as S,i as T,_,p as a,r as b,o as c,j as d,A as f,n as g,w as h,P as i,m as k,f as l,M as m,x as n,y as o,S as p,E as r,s,h as t,v as u,O as v,g as w,a as x,N as y};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-C1wDt09O.js";import{t as r}from"./explorer-body-BHh5Qpvi.js";import"./api-client-BnYFnEfK.js";import"./settings-store-CBJCnE5L.js";import"./portal-container-context-Gepuvxdg.js";import"./window-store-UcSFgNCI.js";import"./panel-store-Dx2ziBLp.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./session-list-sync-triggers-D9i1FxWd.js";import"./tab-store-B4v2kAEY.js";import"./context-menu-DhKbkI1X.js";import"./file-store-Bn0vbkCx.js";import"./use-is-mobile-CL2I7hLf.js";import"./button-BHGVTbam.js";import"./dialog-DnE192fh.js";import"./file-icons-CB0RsVdl.js";import"./dropdown-menu-CxZR_vuV.js";import"./mobile-bottom-sheet-M9pZptfh.js";import"./use-visual-viewport-B_GFo6k2.js";import"./adaptive-context-menu-CxHkI7dL.js";import"./fs-api-BVIVh_De.js";import"./format-file-meta-BOAh9mam.js";import{Qr as i,Zr as a,si as o}from"./index-Cx9ZRibz.js";var s=e(t(),1),c=n();function l({id:e,payload:t}){let{host:n,error:l}=i(),u=o(e=>e.discard);(0,s.useEffect)(()=>()=>u(e),[e,u]);let d=(typeof t?.path==`string`?t.path:``)||a()||n?.homedir||``;return d?(0,c.jsx)(r,{windowId:e,initialPath:d}):(0,c.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-xs text-text-2`,children:l?`Could not reach the host: ${l}`:`Loading…`})}export{l as default};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-C1wDt09O.js";import{t as r}from"./explorer-body-DLaWmxri.js";import"./api-client-BnYFnEfK.js";import"./settings-store-CMpVMq3Y.js";import"./portal-container-context-Gepuvxdg.js";import"./window-store-D6EgLSfT.js";import"./panel-store-H7e9XHZF.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./session-list-sync-triggers-D9i1FxWd.js";import"./tab-store-NUmgzMPf.js";import"./context-menu-DhKbkI1X.js";import"./file-store-Bn0vbkCx.js";import"./use-is-mobile-CL2I7hLf.js";import"./button-BHGVTbam.js";import"./dialog-DnE192fh.js";import"./file-icons-CB0RsVdl.js";import"./dropdown-menu-CxZR_vuV.js";import"./mobile-bottom-sheet-M9pZptfh.js";import"./use-visual-viewport-B_GFo6k2.js";import"./adaptive-context-menu-CxHkI7dL.js";import"./fs-api-BVIVh_De.js";import"./format-file-meta-BOAh9mam.js";import{$r as i,Qr as a,ci as o}from"./index-Vd9Xr54k.js";var s=e(t(),1),c=n();function l({id:e,payload:t}){let{host:n,error:l}=i(),u=o(e=>e.discard);(0,s.useEffect)(()=>()=>u(e),[e,u]);let d=(typeof t?.path==`string`?t.path:``)||a()||n?.homedir||``;return d?(0,c.jsx)(r,{windowId:e,initialPath:d}):(0,c.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-xs text-text-2`,children:l?`Could not reach the host: ${l}`:`Loading…`})}export{l as default};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Kr as r,cr as i,fr as a,lr as o,xn as s,zt as c}from"./icons-C1wDt09O.js";import{t as l}from"./createLucideIcon-B2pji242.js";import{k as u,r as d}from"./api-client-BnYFnEfK.js";import{t as f}from"./button-BHGVTbam.js";import{t as p}from"./input-CReAuQTF.js";import{_i as m}from"./index-Cx9ZRibz.js";var h=l(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),g=e(t(),1),_=n();function v(){let[e,t]=(0,g.useState)([]),[n,l]=(0,g.useState)(!0),[v,y]=(0,g.useState)(``),[b,x]=(0,g.useState)(!1),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(!1),[E,D]=(0,g.useState)(null),[O,k]=(0,g.useState)(null),A=(0,g.useCallback)(async()=>{try{t(await d.get(`/api/extensions`))}catch(e){console.error(`Failed to load extensions:`,e)}finally{l(!1)}},[]);(0,g.useEffect)(()=>{A()},[A]);let j=async()=>{let e=v.trim();if(e){x(!0);try{await d.post(`/api/extensions/install`,{name:e}),u.success(`Installed ${e}`),y(``),A()}catch(e){u.error(e.message||`Install failed`)}finally{x(!1)}}},M=async e=>{D(e.id);try{await d.patch(`/api/extensions/${e.id}`,{enabled:!e.enabled}),A()}catch(e){u.error(e.message||`Toggle failed`)}finally{D(null)}},N=async e=>{k(e);try{await d.del(`/api/extensions/${e}`),u.success(`Removed ${e}`),A()}catch(e){u.error(e.message||`Remove failed`)}finally{k(null)}};return n?(0,_.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,_.jsx)(s,{className:`size-4 animate-spin text-muted-foreground`})}):(0,_.jsxs)(`div`,{className:`space-y-4`,children:[(0,_.jsxs)(`section`,{className:`space-y-2`,children:[(0,_.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Install Extension`}),(0,_.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,_.jsx)(p,{value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&j()},placeholder:`npm package name (e.g. @ppm/ext-myext)`,className:`h-8 text-xs flex-1`}),(0,_.jsxs)(f,{variant:`outline`,size:`sm`,className:`h-8 text-xs px-3 gap-1 cursor-pointer`,disabled:!v.trim()||b,onClick:j,children:[b?(0,_.jsx)(s,{className:`size-3 animate-spin`}):(0,_.jsx)(i,{className:`size-3`}),`Install`]})]}),(0,_.jsx)(`button`,{onClick:()=>T(!w),className:`text-[11px] text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,children:w?`Hide`:`Dev link local extension...`}),w&&(0,_.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,_.jsx)(p,{value:S,onChange:e=>C(e.target.value),placeholder:`Local path (e.g. ./packages/ext-myext)`,className:`h-8 text-xs flex-1`}),(0,_.jsxs)(f,{variant:`outline`,size:`sm`,className:`h-8 text-xs px-3 gap-1 cursor-pointer`,disabled:!S.trim(),onClick:async()=>{try{await d.post(`/api/extensions/dev-link`,{path:S.trim()}),u.success(`Dev-linked successfully`),C(``),A()}catch(e){u.error(e.message||`Dev link failed`)}},children:[(0,_.jsx)(c,{className:`size-3`}),`Link`]})]})]}),(0,_.jsxs)(`section`,{className:`space-y-2`,children:[(0,_.jsxs)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:[`Installed (`,e.length,`)`]}),e.length===0?(0,_.jsx)(`p`,{className:`text-[11px] text-muted-foreground py-4 text-center`,children:`No extensions installed`}):(0,_.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>(0,_.jsxs)(`div`,{className:`flex items-center gap-2 px-2.5 py-2 rounded-lg bg-muted/50 hover:bg-muted transition-colors`,children:[(0,_.jsx)(`div`,{className:`size-8 rounded-md bg-background flex items-center justify-center shrink-0`,children:(0,_.jsx)(m(e.icon)??a,{className:`size-4 text-muted-foreground`})}),(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,_.jsx)(`p`,{className:`text-xs font-medium truncate`,children:e.displayName||e.id}),(0,_.jsxs)(`p`,{className:`text-[11px] text-muted-foreground truncate`,children:[e.id,` v`,e.version,e.activated&&(0,_.jsx)(`span`,{className:`ml-1 text-success`,children:`active`})]})]}),(0,_.jsx)(f,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 cursor-pointer`,title:e.enabled?`Disable`:`Enable`,disabled:E===e.id,onClick:()=>M(e),children:E===e.id?(0,_.jsx)(s,{className:`size-3.5 animate-spin`}):e.enabled?(0,_.jsx)(o,{className:`size-3.5 text-success`}):(0,_.jsx)(h,{className:`size-3.5 text-muted-foreground`})}),(0,_.jsx)(f,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 cursor-pointer text-destructive hover:text-destructive`,title:`Remove`,disabled:O===e.id,onClick:()=>N(e.id),children:O===e.id?(0,_.jsx)(s,{className:`size-3.5 animate-spin`}):(0,_.jsx)(r,{className:`size-3.5`})})]},e.id))})]})]})}export{v as ExtensionManagerSection};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Kr as r,cr as i,fr as a,lr as o,xn as s,zt as c}from"./icons-C1wDt09O.js";import{t as l}from"./createLucideIcon-B2pji242.js";import{k as u,r as d}from"./api-client-BnYFnEfK.js";import{t as f}from"./button-BHGVTbam.js";import{t as p}from"./input-CReAuQTF.js";import{vi as m}from"./index-Vd9Xr54k.js";var h=l(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),g=e(t(),1),_=n();function v(){let[e,t]=(0,g.useState)([]),[n,l]=(0,g.useState)(!0),[v,y]=(0,g.useState)(``),[b,x]=(0,g.useState)(!1),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(!1),[E,D]=(0,g.useState)(null),[O,k]=(0,g.useState)(null),A=(0,g.useCallback)(async()=>{try{t(await d.get(`/api/extensions`))}catch(e){console.error(`Failed to load extensions:`,e)}finally{l(!1)}},[]);(0,g.useEffect)(()=>{A()},[A]);let j=async()=>{let e=v.trim();if(e){x(!0);try{await d.post(`/api/extensions/install`,{name:e}),u.success(`Installed ${e}`),y(``),A()}catch(e){u.error(e.message||`Install failed`)}finally{x(!1)}}},M=async e=>{D(e.id);try{await d.patch(`/api/extensions/${e.id}`,{enabled:!e.enabled}),A()}catch(e){u.error(e.message||`Toggle failed`)}finally{D(null)}},N=async e=>{k(e);try{await d.del(`/api/extensions/${e}`),u.success(`Removed ${e}`),A()}catch(e){u.error(e.message||`Remove failed`)}finally{k(null)}};return n?(0,_.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,_.jsx)(s,{className:`size-4 animate-spin text-muted-foreground`})}):(0,_.jsxs)(`div`,{className:`space-y-4`,children:[(0,_.jsxs)(`section`,{className:`space-y-2`,children:[(0,_.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Install Extension`}),(0,_.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,_.jsx)(p,{value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&j()},placeholder:`npm package name (e.g. @ppm/ext-myext)`,className:`h-8 text-xs flex-1`}),(0,_.jsxs)(f,{variant:`outline`,size:`sm`,className:`h-8 text-xs px-3 gap-1 cursor-pointer`,disabled:!v.trim()||b,onClick:j,children:[b?(0,_.jsx)(s,{className:`size-3 animate-spin`}):(0,_.jsx)(i,{className:`size-3`}),`Install`]})]}),(0,_.jsx)(`button`,{onClick:()=>T(!w),className:`text-[11px] text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,children:w?`Hide`:`Dev link local extension...`}),w&&(0,_.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,_.jsx)(p,{value:S,onChange:e=>C(e.target.value),placeholder:`Local path (e.g. ./packages/ext-myext)`,className:`h-8 text-xs flex-1`}),(0,_.jsxs)(f,{variant:`outline`,size:`sm`,className:`h-8 text-xs px-3 gap-1 cursor-pointer`,disabled:!S.trim(),onClick:async()=>{try{await d.post(`/api/extensions/dev-link`,{path:S.trim()}),u.success(`Dev-linked successfully`),C(``),A()}catch(e){u.error(e.message||`Dev link failed`)}},children:[(0,_.jsx)(c,{className:`size-3`}),`Link`]})]})]}),(0,_.jsxs)(`section`,{className:`space-y-2`,children:[(0,_.jsxs)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:[`Installed (`,e.length,`)`]}),e.length===0?(0,_.jsx)(`p`,{className:`text-[11px] text-muted-foreground py-4 text-center`,children:`No extensions installed`}):(0,_.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>(0,_.jsxs)(`div`,{className:`flex items-center gap-2 px-2.5 py-2 rounded-lg bg-muted/50 hover:bg-muted transition-colors`,children:[(0,_.jsx)(`div`,{className:`size-8 rounded-md bg-background flex items-center justify-center shrink-0`,children:(0,_.jsx)(m(e.icon)??a,{className:`size-4 text-muted-foreground`})}),(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,_.jsx)(`p`,{className:`text-xs font-medium truncate`,children:e.displayName||e.id}),(0,_.jsxs)(`p`,{className:`text-[11px] text-muted-foreground truncate`,children:[e.id,` v`,e.version,e.activated&&(0,_.jsx)(`span`,{className:`ml-1 text-success`,children:`active`})]})]}),(0,_.jsx)(f,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 cursor-pointer`,title:e.enabled?`Disable`:`Enable`,disabled:E===e.id,onClick:()=>M(e),children:E===e.id?(0,_.jsx)(s,{className:`size-3.5 animate-spin`}):e.enabled?(0,_.jsx)(o,{className:`size-3.5 text-success`}):(0,_.jsx)(h,{className:`size-3.5 text-muted-foreground`})}),(0,_.jsx)(f,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 cursor-pointer text-destructive hover:text-destructive`,title:`Remove`,disabled:O===e.id,onClick:()=>N(e.id),children:O===e.id?(0,_.jsx)(s,{className:`size-3.5 animate-spin`}):(0,_.jsx)(r,{className:`size-3.5`})})]},e.id))})]})]})}export{v as ExtensionManagerSection};
@@ -1,4 +1,4 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{xn as r}from"./icons-C1wDt09O.js";import{a as i}from"./api-client-BnYFnEfK.js";import{n as a}from"./project-framework-store-nuePqBBa.js";import{r as o,t as s}from"./git-repo-store-CESIqItW.js";import{t as c}from"./apply-theme-Kiqxd1NZ.js";import{a as l,i as u}from"./file-icons-CB0RsVdl.js";import{Ci as d}from"./index-Cx9ZRibz.js";var f=e(t(),1),p=[[`--bg`,`--bg-solid`],[`--surface`,`--panel`],[`--selected`,`--accent-wash`],[`--text`,`--text`],[`--subtext`,`--text-2`],[`--subtle`,`--text-3`],[`--border`,`--border-soft`],[`--border2`,`--border`],[`--blue`,`--accent`],[`--green`,`--success`],[`--yellow`,`--warning`],[`--red`,`--error`],[`--accent`,`--accent`],[`--accent-fg`,`--accent-fg`],[`--accent-wash`,`--accent-wash`],[`--accent-wash-border`,`--accent-wash-border`],[`--panel`,`--panel`],[`--panel-2`,`--panel-2`],[`--shadow-float`,`--shadow-float`],[`--shadow-panel`,`--shadow-panel`]];function m(e){let t=[];for(let[n,r]of p){let i=e(r).replace(/[<>]/g,``).trim();i&&t.push(`${n}: ${i};`)}return t.length?`:root[data-ppm-theme] { ${t.join(` `)} }`:``}function h(e){let t=getComputedStyle(e);return{mode:e.classList.contains(`dark`)?`dark`:`light`,css:m(e=>t.getPropertyValue(e))}}var g=`ppm:theme`,_=`<script>
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{xn as r}from"./icons-C1wDt09O.js";import{a as i}from"./api-client-BnYFnEfK.js";import{n as a}from"./project-framework-store-nuePqBBa.js";import{r as o,t as s}from"./git-repo-store-CESIqItW.js";import{t as c}from"./apply-theme-Kiqxd1NZ.js";import{a as l,i as u}from"./file-icons-CB0RsVdl.js";import{wi as d}from"./index-Vd9Xr54k.js";var f=e(t(),1),p=[[`--bg`,`--bg-solid`],[`--surface`,`--panel`],[`--selected`,`--accent-wash`],[`--text`,`--text`],[`--subtext`,`--text-2`],[`--subtle`,`--text-3`],[`--border`,`--border-soft`],[`--border2`,`--border`],[`--blue`,`--accent`],[`--green`,`--success`],[`--yellow`,`--warning`],[`--red`,`--error`],[`--accent`,`--accent`],[`--accent-fg`,`--accent-fg`],[`--accent-wash`,`--accent-wash`],[`--accent-wash-border`,`--accent-wash-border`],[`--panel`,`--panel`],[`--panel-2`,`--panel-2`],[`--shadow-float`,`--shadow-float`],[`--shadow-panel`,`--shadow-panel`]];function m(e){let t=[];for(let[n,r]of p){let i=e(r).replace(/[<>]/g,``).trim();i&&t.push(`${n}: ${i};`)}return t.length?`:root[data-ppm-theme] { ${t.join(` `)} }`:``}function h(e){let t=getComputedStyle(e);return{mode:e.classList.contains(`dark`)?`dark`:`light`,css:m(e=>t.getPropertyValue(e))}}var g=`ppm:theme`,_=`<script>
2
2
  window.addEventListener("message",function(e){
3
3
  if(e.source!==window.parent)return;
4
4
  var m=e.data;
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{cr as r,li as i}from"./icons-C1wDt09O.js";import{r as a}from"./api-client-BnYFnEfK.js";import{i as o}from"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import{o as s}from"./file-store-Bn0vbkCx.js";import{t as c}from"./button-BHGVTbam.js";import{t as l}from"./input-CReAuQTF.js";import{Zn as u,jr as d}from"./index-Cx9ZRibz.js";import{t as f}from"./separator-CYw7bF1W.js";var p=e(t(),1);function m(){return a.get(`/api/settings/files`)}function h(e){return a.patch(`/api/settings/files`,e)}function g(e){return a.get(`/api/projects/${encodeURIComponent(e)}/settings`)}function _(e,t){return a.patch(`/api/projects/${encodeURIComponent(e)}/settings`,t)}var v=n();function y({value:e,onChange:t,placeholder:n=`e.g. **/*.log`,disabled:a=!1}){let o=(0,p.useRef)([]);function s(n,r){let i=[...e];i[n]=r,t(i)}function u(n){t(e.filter((e,t)=>t!==n)),setTimeout(()=>{let e=Math.max(n-1,0);o.current[e]?.focus()},0)}function d(){t([...e,``]),setTimeout(()=>{o.current[e.length]?.focus()},0)}function f(t,n){n.key===`Enter`?(n.preventDefault(),e[t]?.trim()&&d()):n.key===`Backspace`&&e[t]===``&&(n.preventDefault(),u(t))}return(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[e.length===0&&(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground py-1`,children:`No patterns. Click "Add pattern" to start.`}),e.map((e,t)=>(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,v.jsx)(l,{ref:e=>{o.current[t]=e},value:e,onChange:e=>s(t,e.target.value),onKeyDown:e=>f(t,e),placeholder:n,disabled:a,className:`h-8 text-xs flex-1 font-mono`,"aria-label":`Pattern ${t+1}`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>u(t),disabled:a,"aria-label":`Remove pattern ${t+1}`,className:`shrink-0 flex items-center justify-center p-2.5 rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors disabled:opacity-40 disabled:pointer-events-none`,children:(0,v.jsx)(i,{className:`size-3.5`})})]},t)),(0,v.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:d,disabled:a,className:`h-8 text-xs gap-1.5 w-full cursor-pointer`,children:[(0,v.jsx)(r,{className:`size-3.5`}),`Add pattern`]})]})}var b={filesExclude:[],searchExclude:[],useIgnoreFiles:!0};function x(){let e=o(e=>e.activeProject),[t,n]=(0,p.useState)(`global`),[r,i]=(0,p.useState)([]),[a,l]=(0,p.useState)([]),[x,S]=(0,p.useState)(!0),[C,w]=(0,p.useState)(!1),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(null),[k,A]=(0,p.useState)(!1),j=(0,p.useRef)(null);(0,p.useEffect)(()=>{j.current?.abort();let n=new AbortController;return j.current=n,A(!0),O(null),(async()=>{try{if(t===`global`){let e=await m();if(n.signal.aborted)return;i(e.filesExclude),l(e.searchExclude),S(e.useIgnoreFiles)}else{if(!e)return;let t=await g(e.name);if(n.signal.aborted)return;let r=t.files??{};i(r.filesExclude??b.filesExclude),l(r.searchExclude??b.searchExclude),S(r.useIgnoreFiles??b.useIgnoreFiles)}}catch(e){if(n.signal.aborted)return;O(e.message)}finally{n.signal.aborted||A(!1)}})(),()=>n.abort()},[t,e?.name]);let M=async()=>{w(!0),E(!1),O(null);try{let n={filesExclude:r.filter(e=>e.trim()!==``),searchExclude:a.filter(e=>e.trim()!==``),useIgnoreFiles:x};if(t===`global`)await h(n);else{if(!e)throw Error(`No active project`);await _(e.name,{files:n})}let i=s.getState();i.invalidateIndex(),e&&i.loadIndex(e.name),E(!0),setTimeout(()=>E(!1),2e3)}catch(e){O(e.message)}finally{w(!1)}},N=!!e;return(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`File Filters`}),(0,v.jsxs)(`div`,{className:`flex gap-1`,children:[(0,v.jsx)(`button`,{type:`button`,onClick:()=>n(`global`),className:`flex-1 py-1.5 rounded-md text-xs font-medium transition-colors cursor-pointer ${t===`global`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-accent`}`,children:`Global`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>N&&n(`project`),disabled:!N,title:N?void 0:`Open a project to edit per-project overrides`,className:`flex-1 py-1.5 rounded-md text-xs font-medium transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed ${t===`project`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-accent`}`,children:e?e.name:`Per-project`})]}),t===`project`&&e&&(0,v.jsxs)(`p`,{className:`text-[11px] text-muted-foreground -mt-2`,children:[`Overrides for `,(0,v.jsx)(`span`,{className:`font-medium`,children:e.name}),`. Leave empty to use global settings.`]}),k?(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading...`}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(d,{className:`text-xs`,children:`Files to Exclude`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Glob patterns hidden from the file tree and palette.`}),(0,v.jsx)(y,{value:r,onChange:i,placeholder:`e.g. **/*.log or node_modules/**`,disabled:C})]}),(0,v.jsx)(f,{}),(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(d,{className:`text-xs`,children:`Search to Exclude`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Glob patterns excluded from file index / palette search.`}),(0,v.jsx)(y,{value:a,onChange:l,placeholder:`e.g. dist/** or **/*.min.js`,disabled:C})]}),(0,v.jsx)(f,{}),(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(d,{className:`text-xs`,children:`Use .gitignore rules`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Respect .gitignore when filtering the file tree and index.`})]}),(0,v.jsx)(u,{checked:x,onCheckedChange:S,disabled:C})]}),D&&(0,v.jsx)(`p`,{className:`text-[11px] text-destructive`,children:D}),(0,v.jsx)(c,{onClick:M,disabled:C||k,size:`sm`,className:`h-8 text-xs w-full cursor-pointer`,children:C?`Saving...`:T?`Saved`:`Save`})]})]})}export{x as FilesSettingsSection};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{cr as r,li as i}from"./icons-C1wDt09O.js";import{r as a}from"./api-client-BnYFnEfK.js";import{i as o}from"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import{o as s}from"./file-store-Bn0vbkCx.js";import{t as c}from"./button-BHGVTbam.js";import{t as l}from"./input-CReAuQTF.js";import{Mr as u,Qn as d}from"./index-Vd9Xr54k.js";import{t as f}from"./separator-DUdRLaL0.js";var p=e(t(),1);function m(){return a.get(`/api/settings/files`)}function h(e){return a.patch(`/api/settings/files`,e)}function g(e){return a.get(`/api/projects/${encodeURIComponent(e)}/settings`)}function _(e,t){return a.patch(`/api/projects/${encodeURIComponent(e)}/settings`,t)}var v=n();function y({value:e,onChange:t,placeholder:n=`e.g. **/*.log`,disabled:a=!1}){let o=(0,p.useRef)([]);function s(n,r){let i=[...e];i[n]=r,t(i)}function u(n){t(e.filter((e,t)=>t!==n)),setTimeout(()=>{let e=Math.max(n-1,0);o.current[e]?.focus()},0)}function d(){t([...e,``]),setTimeout(()=>{o.current[e.length]?.focus()},0)}function f(t,n){n.key===`Enter`?(n.preventDefault(),e[t]?.trim()&&d()):n.key===`Backspace`&&e[t]===``&&(n.preventDefault(),u(t))}return(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[e.length===0&&(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground py-1`,children:`No patterns. Click "Add pattern" to start.`}),e.map((e,t)=>(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,v.jsx)(l,{ref:e=>{o.current[t]=e},value:e,onChange:e=>s(t,e.target.value),onKeyDown:e=>f(t,e),placeholder:n,disabled:a,className:`h-8 text-xs flex-1 font-mono`,"aria-label":`Pattern ${t+1}`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>u(t),disabled:a,"aria-label":`Remove pattern ${t+1}`,className:`shrink-0 flex items-center justify-center p-2.5 rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors disabled:opacity-40 disabled:pointer-events-none`,children:(0,v.jsx)(i,{className:`size-3.5`})})]},t)),(0,v.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:d,disabled:a,className:`h-8 text-xs gap-1.5 w-full cursor-pointer`,children:[(0,v.jsx)(r,{className:`size-3.5`}),`Add pattern`]})]})}var b={filesExclude:[],searchExclude:[],useIgnoreFiles:!0};function x(){let e=o(e=>e.activeProject),[t,n]=(0,p.useState)(`global`),[r,i]=(0,p.useState)([]),[a,l]=(0,p.useState)([]),[x,S]=(0,p.useState)(!0),[C,w]=(0,p.useState)(!1),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(null),[k,A]=(0,p.useState)(!1),j=(0,p.useRef)(null);(0,p.useEffect)(()=>{j.current?.abort();let n=new AbortController;return j.current=n,A(!0),O(null),(async()=>{try{if(t===`global`){let e=await m();if(n.signal.aborted)return;i(e.filesExclude),l(e.searchExclude),S(e.useIgnoreFiles)}else{if(!e)return;let t=await g(e.name);if(n.signal.aborted)return;let r=t.files??{};i(r.filesExclude??b.filesExclude),l(r.searchExclude??b.searchExclude),S(r.useIgnoreFiles??b.useIgnoreFiles)}}catch(e){if(n.signal.aborted)return;O(e.message)}finally{n.signal.aborted||A(!1)}})(),()=>n.abort()},[t,e?.name]);let M=async()=>{w(!0),E(!1),O(null);try{let n={filesExclude:r.filter(e=>e.trim()!==``),searchExclude:a.filter(e=>e.trim()!==``),useIgnoreFiles:x};if(t===`global`)await h(n);else{if(!e)throw Error(`No active project`);await _(e.name,{files:n})}let i=s.getState();i.invalidateIndex(),e&&i.loadIndex(e.name),E(!0),setTimeout(()=>E(!1),2e3)}catch(e){O(e.message)}finally{w(!1)}},N=!!e;return(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`File Filters`}),(0,v.jsxs)(`div`,{className:`flex gap-1`,children:[(0,v.jsx)(`button`,{type:`button`,onClick:()=>n(`global`),className:`flex-1 py-1.5 rounded-md text-xs font-medium transition-colors cursor-pointer ${t===`global`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-accent`}`,children:`Global`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>N&&n(`project`),disabled:!N,title:N?void 0:`Open a project to edit per-project overrides`,className:`flex-1 py-1.5 rounded-md text-xs font-medium transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed ${t===`project`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-accent`}`,children:e?e.name:`Per-project`})]}),t===`project`&&e&&(0,v.jsxs)(`p`,{className:`text-[11px] text-muted-foreground -mt-2`,children:[`Overrides for `,(0,v.jsx)(`span`,{className:`font-medium`,children:e.name}),`. Leave empty to use global settings.`]}),k?(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading...`}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(u,{className:`text-xs`,children:`Files to Exclude`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Glob patterns hidden from the file tree and palette.`}),(0,v.jsx)(y,{value:r,onChange:i,placeholder:`e.g. **/*.log or node_modules/**`,disabled:C})]}),(0,v.jsx)(f,{}),(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(u,{className:`text-xs`,children:`Search to Exclude`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Glob patterns excluded from file index / palette search.`}),(0,v.jsx)(y,{value:a,onChange:l,placeholder:`e.g. dist/** or **/*.min.js`,disabled:C})]}),(0,v.jsx)(f,{}),(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(u,{className:`text-xs`,children:`Use .gitignore rules`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Respect .gitignore when filtering the file tree and index.`})]}),(0,v.jsx)(d,{checked:x,onCheckedChange:S,disabled:C})]}),D&&(0,v.jsx)(`p`,{className:`text-[11px] text-destructive`,children:D}),(0,v.jsx)(c,{onClick:M,disabled:C||k,size:`sm`,className:`h-8 text-xs w-full cursor-pointer`,children:C?`Saving...`:T?`Saved`:`Save`})]})]})}export{x as FilesSettingsSection};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{A as r,Ir as i,_t as a,ln as o,vt as s}from"./icons-C1wDt09O.js";import{r as c,s as l}from"./api-client-BnYFnEfK.js";import{t as u}from"./settings-store-CBJCnE5L.js";import"./portal-container-context-Gepuvxdg.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./use-is-mobile-CL2I7hLf.js";import"./onboarding-quick-orientation-DTMrcMf0.js";import{t as d}from"./button-BHGVTbam.js";import"./dialog-DnE192fh.js";import{t as f}from"./input-CReAuQTF.js";import{W as p,Zn as m,di as h,jr as g}from"./index-Cx9ZRibz.js";import{t as _}from"./onboarding-entry-Cn4k4SG7.js";import{t as v}from"./separator-CYw7bF1W.js";var y=e(t(),1),b=n();function x(){let[e,t]=(0,y.useState)(!1),[n,i]=(0,y.useState)(``),[u,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(!1),[g,_]=(0,y.useState)(!1),[v,x]=(0,y.useState)(!1),[S,C]=(0,y.useState)(null),w=u.length>0&&n!==u,T=n.trim().length>=4&&n===u&&!g,E=(0,y.useCallback)(async()=>{if(T){_(!0),C(null);try{let{token:e}=await c.put(`/api/settings/auth/password`,{password:n.trim(),confirm:u.trim()});l(e),x(!0),i(``),p(``),setTimeout(()=>{x(!1),t(!1)},1500)}catch(e){C(e instanceof Error?e.message:`Failed to change password`)}finally{_(!1)}}},[T,n,u]);return e?(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Change Password`}),(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsxs)(`div`,{className:`relative`,children:[(0,b.jsx)(f,{type:m?`text`:`password`,placeholder:`New password`,value:n,onChange:e=>i(e.target.value),className:`h-8 text-xs pr-8`,autoFocus:!0}),(0,b.jsx)(`button`,{type:`button`,className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground cursor-pointer`,onClick:()=>h(!m),tabIndex:-1,children:m?(0,b.jsx)(s,{className:`size-3.5`}):(0,b.jsx)(a,{className:`size-3.5`})})]}),(0,b.jsx)(f,{type:m?`text`:`password`,placeholder:`Confirm password`,value:u,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&E()},className:`h-8 text-xs`}),w&&(0,b.jsx)(`p`,{className:`text-[11px] text-destructive`,children:`Passwords do not match`}),S&&(0,b.jsx)(`p`,{className:`text-[11px] text-destructive`,children:S}),(0,b.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,b.jsx)(d,{variant:`outline`,size:`sm`,className:`h-8 text-xs flex-1 cursor-pointer`,onClick:()=>{t(!1),i(``),p(``),C(null)},children:`Cancel`}),(0,b.jsx)(d,{variant:v?`default`:`outline`,size:`sm`,className:`h-8 text-xs flex-1 cursor-pointer`,disabled:!T,onClick:E,children:g?`...`:v?(0,b.jsx)(r,{className:`size-3.5`}):`Save`})]}),(0,b.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Min 4 characters. You'll stay logged in on this device.`})]})]}):(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Security`}),(0,b.jsxs)(d,{variant:`outline`,size:`sm`,className:`h-8 text-xs gap-1.5 cursor-pointer`,onClick:()=>t(!0),children:[(0,b.jsx)(o,{className:`size-3.5`}),`Change Password`]})]})}function S(){let e=u(e=>e.minimalMode),{deviceName:t,setDeviceName:n,version:a,keepScreenAwake:o,setKeepScreenAwake:s}=u(h(e=>({deviceName:e.deviceName,setDeviceName:e.setDeviceName,version:e.version,keepScreenAwake:e.keepScreenAwake,setKeepScreenAwake:e.setKeepScreenAwake}))),[c]=(0,y.useState)(p),[l,S]=(0,y.useState)(t??``),[C,w]=(0,y.useState)(!1),[T,E]=(0,y.useState)(!1),D=(0,y.useRef)(void 0),O=l.trim()!==(t??``),k=(0,y.useCallback)(async()=>{if(O){w(!0);try{await n(l),E(!0),clearTimeout(D.current),D.current=setTimeout(()=>E(!1),2e3)}finally{w(!1)}}},[l,O,n]);return(0,b.jsxs)(`div`,{className:`space-y-6`,children:[!e&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium`,children:`Learn PPM`}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Choose your experience and a task. Guidance is saved in this browser.`}),(0,b.jsx)(_,{compact:!0})]}),(0,b.jsx)(v,{})]}),(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(g,{htmlFor:`device-name`,children:`Device Name`}),(0,b.jsxs)(`div`,{className:`flex gap-2`,children:[(0,b.jsx)(f,{id:`device-name`,value:l,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key===`Enter`&&k()},placeholder:`My Device`,className:`flex-1`,maxLength:100}),(0,b.jsx)(d,{variant:T?`default`:`outline`,className:`cursor-pointer shrink-0`,disabled:!O||C,onClick:k,children:C?`...`:T?(0,b.jsx)(r,{className:`size-4`}):`Save`})]}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Shown in page title and synced to PPM Cloud.`})]}),(0,b.jsx)(v,{}),(0,b.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,b.jsx)(i,{className:`size-4 text-muted-foreground shrink-0`}),(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`p`,{className:`text-sm font-medium`,children:`Keep Screen Awake`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c===`insecure`?`Unavailable over plain HTTP — reach PPM through its HTTPS tunnel address to use this.`:c===`unsupported`?`This browser does not support screen wake locks.`:`Stop this device dimming while a chat turn is running.`})]})]}),(0,b.jsx)(m,{checked:o&&c===`ok`,disabled:c!==`ok`,onCheckedChange:s})]}),(0,b.jsx)(v,{}),(0,b.jsx)(x,{}),(0,b.jsx)(v,{}),(0,b.jsxs)(`section`,{className:`space-y-1`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium`,children:`About`}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`PPM — Personal Project Manager`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A mobile-first web IDE for managing your projects.`}),a&&(0,b.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Version `,a]})]})]})}export{S as GeneralSettingsSection};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{A as r,Ir as i,_t as a,ln as o,vt as s}from"./icons-C1wDt09O.js";import{r as c,s as l}from"./api-client-BnYFnEfK.js";import{t as u}from"./settings-store-CMpVMq3Y.js";import"./portal-container-context-Gepuvxdg.js";import"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./use-is-mobile-CL2I7hLf.js";import"./onboarding-quick-orientation-DTMrcMf0.js";import{t as d}from"./button-BHGVTbam.js";import"./dialog-DnE192fh.js";import{t as f}from"./input-CReAuQTF.js";import{Mr as p,Qn as m,W as h,fi as g}from"./index-Vd9Xr54k.js";import{t as _}from"./onboarding-entry-Cn4k4SG7.js";import{t as v}from"./separator-DUdRLaL0.js";var y=e(t(),1),b=n();function x(){let[e,t]=(0,y.useState)(!1),[n,i]=(0,y.useState)(``),[u,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(!1),[g,_]=(0,y.useState)(!1),[v,x]=(0,y.useState)(!1),[S,C]=(0,y.useState)(null),w=u.length>0&&n!==u,T=n.trim().length>=4&&n===u&&!g,E=(0,y.useCallback)(async()=>{if(T){_(!0),C(null);try{let{token:e}=await c.put(`/api/settings/auth/password`,{password:n.trim(),confirm:u.trim()});l(e),x(!0),i(``),p(``),setTimeout(()=>{x(!1),t(!1)},1500)}catch(e){C(e instanceof Error?e.message:`Failed to change password`)}finally{_(!1)}}},[T,n,u]);return e?(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Change Password`}),(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsxs)(`div`,{className:`relative`,children:[(0,b.jsx)(f,{type:m?`text`:`password`,placeholder:`New password`,value:n,onChange:e=>i(e.target.value),className:`h-8 text-xs pr-8`,autoFocus:!0}),(0,b.jsx)(`button`,{type:`button`,className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground cursor-pointer`,onClick:()=>h(!m),tabIndex:-1,children:m?(0,b.jsx)(s,{className:`size-3.5`}):(0,b.jsx)(a,{className:`size-3.5`})})]}),(0,b.jsx)(f,{type:m?`text`:`password`,placeholder:`Confirm password`,value:u,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&E()},className:`h-8 text-xs`}),w&&(0,b.jsx)(`p`,{className:`text-[11px] text-destructive`,children:`Passwords do not match`}),S&&(0,b.jsx)(`p`,{className:`text-[11px] text-destructive`,children:S}),(0,b.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,b.jsx)(d,{variant:`outline`,size:`sm`,className:`h-8 text-xs flex-1 cursor-pointer`,onClick:()=>{t(!1),i(``),p(``),C(null)},children:`Cancel`}),(0,b.jsx)(d,{variant:v?`default`:`outline`,size:`sm`,className:`h-8 text-xs flex-1 cursor-pointer`,disabled:!T,onClick:E,children:g?`...`:v?(0,b.jsx)(r,{className:`size-3.5`}):`Save`})]}),(0,b.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Min 4 characters. You'll stay logged in on this device.`})]})]}):(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Security`}),(0,b.jsxs)(d,{variant:`outline`,size:`sm`,className:`h-8 text-xs gap-1.5 cursor-pointer`,onClick:()=>t(!0),children:[(0,b.jsx)(o,{className:`size-3.5`}),`Change Password`]})]})}function S(){let e=u(e=>e.minimalMode),{deviceName:t,setDeviceName:n,version:a,keepScreenAwake:o,setKeepScreenAwake:s}=u(g(e=>({deviceName:e.deviceName,setDeviceName:e.setDeviceName,version:e.version,keepScreenAwake:e.keepScreenAwake,setKeepScreenAwake:e.setKeepScreenAwake}))),[c]=(0,y.useState)(h),[l,S]=(0,y.useState)(t??``),[C,w]=(0,y.useState)(!1),[T,E]=(0,y.useState)(!1),D=(0,y.useRef)(void 0),O=l.trim()!==(t??``),k=(0,y.useCallback)(async()=>{if(O){w(!0);try{await n(l),E(!0),clearTimeout(D.current),D.current=setTimeout(()=>E(!1),2e3)}finally{w(!1)}}},[l,O,n]);return(0,b.jsxs)(`div`,{className:`space-y-6`,children:[!e&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium`,children:`Learn PPM`}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Choose your experience and a task. Guidance is saved in this browser.`}),(0,b.jsx)(_,{compact:!0})]}),(0,b.jsx)(v,{})]}),(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(p,{htmlFor:`device-name`,children:`Device Name`}),(0,b.jsxs)(`div`,{className:`flex gap-2`,children:[(0,b.jsx)(f,{id:`device-name`,value:l,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key===`Enter`&&k()},placeholder:`My Device`,className:`flex-1`,maxLength:100}),(0,b.jsx)(d,{variant:T?`default`:`outline`,className:`cursor-pointer shrink-0`,disabled:!O||C,onClick:k,children:C?`...`:T?(0,b.jsx)(r,{className:`size-4`}):`Save`})]}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Shown in page title and synced to PPM Cloud.`})]}),(0,b.jsx)(v,{}),(0,b.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,b.jsx)(i,{className:`size-4 text-muted-foreground shrink-0`}),(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`p`,{className:`text-sm font-medium`,children:`Keep Screen Awake`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c===`insecure`?`Unavailable over plain HTTP — reach PPM through its HTTPS tunnel address to use this.`:c===`unsupported`?`This browser does not support screen wake locks.`:`Stop this device dimming while a chat turn is running.`})]})]}),(0,b.jsx)(m,{checked:o&&c===`ok`,disabled:c!==`ok`,onCheckedChange:s})]}),(0,b.jsx)(v,{}),(0,b.jsx)(x,{}),(0,b.jsx)(v,{}),(0,b.jsxs)(`section`,{className:`space-y-1`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium`,children:`About`}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`PPM — Personal Project Manager`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A mobile-first web IDE for managing your projects.`}),a&&(0,b.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Version `,a]})]})]})}export{S as GeneralSettingsSection};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Br as r,g as i,hr as a,nt as o,o as s,rt as c,xn as l}from"./icons-C1wDt09O.js";import{t as u}from"./git-commit-horizontal-ZMFP54eB.js";import{r as d}from"./api-client-BnYFnEfK.js";import{n as f}from"./utils-D3xTlJyU.js";import{i as p}from"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./git-repo-store-CESIqItW.js";import"./scroll-area-CSmNLlfl.js";import{di as m,li as h}from"./index-Cx9ZRibz.js";var g=e(t(),1),_=n(),v=[`#2563eb`,`#16a34a`,`#d97706`,`#9333ea`,`#dc2626`,`#0891b2`,`#c026d3`,`#ea580c`];function y(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return v[Math.abs(t)%v.length]}function b({name:e,syncState:t,isHead:n,isTag:a,className:l}){let u=a?`#d97706`:y(e),d=a?r:t===`synced`?o:t===`ahead`?i:t===`behind`?s:t===`remote-only`?o:c,p=a?`Tag: ${e}`:t===`synced`?`${e} — synced with remote`:t===`ahead`?`${e} — ahead of remote`:t===`behind`?`${e} — behind remote`:t===`remote-only`?`${e} — remote only`:`${e} — local only`;return(0,_.jsxs)(`span`,{className:f(`inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] font-medium leading-tight max-w-[220px]`,n&&`ring-1 ring-offset-1 ring-offset-background`,t===`remote-only`&&`opacity-70`,l),style:{borderColor:u,backgroundColor:u+`1A`,color:`var(--text)`,...n?{"--tw-ring-color":u}:{}},title:p,children:[(0,_.jsx)(d,{className:`size-3 shrink-0`,style:{color:u}}),(0,_.jsx)(`span`,{className:`truncate`,children:e})]})}function x(e,t,n,r){let i=[],a=e===r;for(let e of t)e.startsWith(`tag: `)&&i.push({name:e.slice(5),syncState:`synced`,isTag:!0});let o=n.filter(t=>t.commitHash===e),s=o.filter(e=>!e.remote),c=o.filter(e=>e.remote);new Set(s.map(e=>e.name));let l=new Set;for(let e of s){let t=`local-only`;e.remotes.length>0&&(t=e.ahead>0&&e.behind===0?`ahead`:e.behind>0&&e.ahead===0?`behind`:`synced`),i.push({name:e.name,syncState:t,isHead:a&&e.current});for(let t of c){let n=t.name.replace(/^remotes\//,``),r=n.indexOf(`/`);r<0||n.slice(r+1)===e.name&&l.add(t.name)}}for(let e of c){if(l.has(e.name))continue;let t=e.name.replace(/^remotes\//,``);i.push({name:t,syncState:`remote-only`})}return i}var S=100;function C({metadata:e}){let t=e?.projectName??p(m(e=>e.activeProject))?.name,{gitUrl:n}=h(t),[r,i]=(0,g.useState)(null),[o,s]=(0,g.useState)(!1),[c,f]=(0,g.useState)(!0),v=(0,g.useRef)(null),y=(0,g.useCallback)(async(e=0,r=!1)=>{if(t){s(!0);try{let t=await d.get(n(`/graph?max=${S}&skip=${e}`));i(e=>r&&e?{...t,commits:[...e.commits,...t.commits]}:t),f(t.commits.length===S)}catch{}s(!1)}},[t]);(0,g.useEffect)(()=>{y()},[y]);let b=(0,g.useCallback)(()=>{o||!c||!r||y(r.commits.length,!0)},[o,c,r,y]),x=(0,g.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<200&&b()},[b]);return t?(0,_.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 border-b border-border shrink-0`,children:[(0,_.jsx)(u,{className:`size-4 text-text-secondary`}),(0,_.jsx)(`span`,{className:`text-xs font-medium text-text-primary`,children:`Git Log`}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle`,children:r?`${r.commits.length} commits`:``}),(0,_.jsx)(`div`,{className:`flex-1`}),(0,_.jsx)(`button`,{onClick:()=>y(),disabled:o,className:`p-1 rounded text-text-subtle hover:text-text-secondary transition-colors`,title:`Refresh`,children:(0,_.jsx)(a,{className:`size-3.5 ${o?`animate-spin`:``}`})})]}),!r&&o?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(l,{className:`size-5 animate-spin text-primary`})}):r&&r.commits.length===0?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:`No commits yet`}):r?(0,_.jsxs)(`div`,{ref:v,className:`flex-1 overflow-y-auto min-h-0`,onScroll:x,children:[r.commits.map(e=>(0,_.jsx)(w,{commit:e,branches:r.branches,head:r.head},e.hash)),o&&(0,_.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,_.jsx)(l,{className:`size-4 animate-spin text-text-subtle`})}),!c&&r.commits.length>0&&(0,_.jsx)(`div`,{className:`text-center text-[10px] text-text-subtle py-3`,children:`End of history`})]}):null]}):(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:`Select a project to view git log`})}function w({commit:e,branches:t,head:n}){let r=e.hash===n,i=x(e.hash,e.refs,t,n);return(0,_.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-1.5 border-b border-border/50 hover:bg-surface-elevated transition-colors ${r?`bg-primary/5`:``}`,children:[(0,_.jsx)(`div`,{className:`flex items-center pt-1 shrink-0`,children:(0,_.jsx)(`span`,{className:`size-2.5 rounded-full border-2 ${r?`border-primary bg-primary`:`border-text-subtle bg-transparent`}`})}),(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[i.length>0&&(0,_.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 mb-0.5`,children:i.map(e=>(0,_.jsx)(b,{...e},`${e.name}-${e.syncState}`))}),(0,_.jsx)(`p`,{className:`text-xs text-text-primary truncate leading-snug`,children:e.subject}),(0,_.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,_.jsx)(`span`,{className:`text-[10px] font-mono text-text-subtle`,children:e.abbreviatedHash}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle truncate`,children:e.authorName}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:T(e.authorDate)})]})]})]})}function T(e){let t=new Date(e),n=Date.now()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`now`;if(r<60)return`${r}m`;let i=Math.floor(r/60);if(i<24)return`${i}h`;let a=Math.floor(i/24);return a<30?`${a}d`:t.toLocaleDateString(`en`,{month:`short`,day:`numeric`})}export{C as GitLogPanel};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Br as r,g as i,hr as a,nt as o,o as s,rt as c,xn as l}from"./icons-C1wDt09O.js";import{t as u}from"./git-commit-horizontal-ZMFP54eB.js";import{r as d}from"./api-client-BnYFnEfK.js";import{n as f}from"./utils-D3xTlJyU.js";import{i as p}from"./project-store-Bs-kiU8m.js";import"./project-framework-store-nuePqBBa.js";import"./git-repo-store-CESIqItW.js";import"./scroll-area-CSmNLlfl.js";import{fi as m,ui as h}from"./index-Vd9Xr54k.js";var g=e(t(),1),_=n(),v=[`#2563eb`,`#16a34a`,`#d97706`,`#9333ea`,`#dc2626`,`#0891b2`,`#c026d3`,`#ea580c`];function y(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return v[Math.abs(t)%v.length]}function b({name:e,syncState:t,isHead:n,isTag:a,className:l}){let u=a?`#d97706`:y(e),d=a?r:t===`synced`?o:t===`ahead`?i:t===`behind`?s:t===`remote-only`?o:c,p=a?`Tag: ${e}`:t===`synced`?`${e} — synced with remote`:t===`ahead`?`${e} — ahead of remote`:t===`behind`?`${e} — behind remote`:t===`remote-only`?`${e} — remote only`:`${e} — local only`;return(0,_.jsxs)(`span`,{className:f(`inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] font-medium leading-tight max-w-[220px]`,n&&`ring-1 ring-offset-1 ring-offset-background`,t===`remote-only`&&`opacity-70`,l),style:{borderColor:u,backgroundColor:u+`1A`,color:`var(--text)`,...n?{"--tw-ring-color":u}:{}},title:p,children:[(0,_.jsx)(d,{className:`size-3 shrink-0`,style:{color:u}}),(0,_.jsx)(`span`,{className:`truncate`,children:e})]})}function x(e,t,n,r){let i=[],a=e===r;for(let e of t)e.startsWith(`tag: `)&&i.push({name:e.slice(5),syncState:`synced`,isTag:!0});let o=n.filter(t=>t.commitHash===e),s=o.filter(e=>!e.remote),c=o.filter(e=>e.remote);new Set(s.map(e=>e.name));let l=new Set;for(let e of s){let t=`local-only`;e.remotes.length>0&&(t=e.ahead>0&&e.behind===0?`ahead`:e.behind>0&&e.ahead===0?`behind`:`synced`),i.push({name:e.name,syncState:t,isHead:a&&e.current});for(let t of c){let n=t.name.replace(/^remotes\//,``),r=n.indexOf(`/`);r<0||n.slice(r+1)===e.name&&l.add(t.name)}}for(let e of c){if(l.has(e.name))continue;let t=e.name.replace(/^remotes\//,``);i.push({name:t,syncState:`remote-only`})}return i}var S=100;function C({metadata:e}){let t=e?.projectName??p(m(e=>e.activeProject))?.name,{gitUrl:n}=h(t),[r,i]=(0,g.useState)(null),[o,s]=(0,g.useState)(!1),[c,f]=(0,g.useState)(!0),v=(0,g.useRef)(null),y=(0,g.useCallback)(async(e=0,r=!1)=>{if(t){s(!0);try{let t=await d.get(n(`/graph?max=${S}&skip=${e}`));i(e=>r&&e?{...t,commits:[...e.commits,...t.commits]}:t),f(t.commits.length===S)}catch{}s(!1)}},[t]);(0,g.useEffect)(()=>{y()},[y]);let b=(0,g.useCallback)(()=>{o||!c||!r||y(r.commits.length,!0)},[o,c,r,y]),x=(0,g.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<200&&b()},[b]);return t?(0,_.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 border-b border-border shrink-0`,children:[(0,_.jsx)(u,{className:`size-4 text-text-secondary`}),(0,_.jsx)(`span`,{className:`text-xs font-medium text-text-primary`,children:`Git Log`}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle`,children:r?`${r.commits.length} commits`:``}),(0,_.jsx)(`div`,{className:`flex-1`}),(0,_.jsx)(`button`,{onClick:()=>y(),disabled:o,className:`p-1 rounded text-text-subtle hover:text-text-secondary transition-colors`,title:`Refresh`,children:(0,_.jsx)(a,{className:`size-3.5 ${o?`animate-spin`:``}`})})]}),!r&&o?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(l,{className:`size-5 animate-spin text-primary`})}):r&&r.commits.length===0?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:`No commits yet`}):r?(0,_.jsxs)(`div`,{ref:v,className:`flex-1 overflow-y-auto min-h-0`,onScroll:x,children:[r.commits.map(e=>(0,_.jsx)(w,{commit:e,branches:r.branches,head:r.head},e.hash)),o&&(0,_.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,_.jsx)(l,{className:`size-4 animate-spin text-text-subtle`})}),!c&&r.commits.length>0&&(0,_.jsx)(`div`,{className:`text-center text-[10px] text-text-subtle py-3`,children:`End of history`})]}):null]}):(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:`Select a project to view git log`})}function w({commit:e,branches:t,head:n}){let r=e.hash===n,i=x(e.hash,e.refs,t,n);return(0,_.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-1.5 border-b border-border/50 hover:bg-surface-elevated transition-colors ${r?`bg-primary/5`:``}`,children:[(0,_.jsx)(`div`,{className:`flex items-center pt-1 shrink-0`,children:(0,_.jsx)(`span`,{className:`size-2.5 rounded-full border-2 ${r?`border-primary bg-primary`:`border-text-subtle bg-transparent`}`})}),(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[i.length>0&&(0,_.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 mb-0.5`,children:i.map(e=>(0,_.jsx)(b,{...e},`${e.name}-${e.syncState}`))}),(0,_.jsx)(`p`,{className:`text-xs text-text-primary truncate leading-snug`,children:e.subject}),(0,_.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,_.jsx)(`span`,{className:`text-[10px] font-mono text-text-subtle`,children:e.abbreviatedHash}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle truncate`,children:e.authorName}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:T(e.authorDate)})]})]})]})}function T(e){let t=new Date(e),n=Date.now()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`now`;if(r<60)return`${r}m`;let i=Math.floor(r/60);if(i<24)return`${i}h`;let a=Math.floor(i/24);return a<30?`${a}d`:t.toLocaleDateString(`en`,{month:`short`,day:`numeric`})}export{C as GitLogPanel};