@bryanhu/codexly 0.37.0 → 0.37.1

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 (226) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/README.md +2 -2
  3. package/README.zh-CN.md +2 -2
  4. package/dist/{chunk-JHBSDMIM.js → chunk-5AELLXXE.js} +1 -1
  5. package/dist/{chunk-43QCECCY.js → chunk-5ULADQG3.js} +16 -16
  6. package/dist/{chunk-YAHXVRU3.js → chunk-63NQMTXZ.js} +1 -1
  7. package/dist/{chunk-ZK5H37U3.js → chunk-PFNMH4LN.js} +3 -3
  8. package/dist/cli.js +3 -3
  9. package/dist/client/index.js +2 -2
  10. package/dist/{command-RGXPFWPR.js → command-R5BTONU5.js} +1 -1
  11. package/dist/protocol/index.js +1 -1
  12. package/dist/providers/codex/index.js +1 -1
  13. package/dist/server/index.js +1 -1
  14. package/dist/web/.vite/manifest.json +114 -114
  15. package/dist/web/.vite/manifest.json.br +0 -0
  16. package/dist/web/.vite/manifest.json.gz +0 -0
  17. package/dist/web/assets/{agent-settings-panel-K1YqqkJL.js → agent-settings-panel-CRNaBDDS.js} +1 -1
  18. package/dist/web/assets/agent-settings-panel-CRNaBDDS.js.br +0 -0
  19. package/dist/web/assets/agent-settings-panel-CRNaBDDS.js.gz +0 -0
  20. package/dist/web/assets/{background-image-picker-BHqZ3SX1.js → background-image-picker-glORbeMR.js} +1 -1
  21. package/dist/web/assets/background-image-picker-glORbeMR.js.br +0 -0
  22. package/dist/web/assets/background-image-picker-glORbeMR.js.gz +0 -0
  23. package/dist/web/assets/{code-highlighter-DIfBIRTg.js → code-highlighter-Cg1b4nzi.js} +1 -1
  24. package/dist/web/assets/code-highlighter-Cg1b4nzi.js.br +5 -0
  25. package/dist/web/assets/code-highlighter-Cg1b4nzi.js.gz +0 -0
  26. package/dist/web/assets/{commit-settings-panel-B0i2Bqmu.js → commit-settings-panel-C-ALJcjd.js} +1 -1
  27. package/dist/web/assets/commit-settings-panel-C-ALJcjd.js.br +0 -0
  28. package/dist/web/assets/commit-settings-panel-C-ALJcjd.js.gz +0 -0
  29. package/dist/web/assets/{file-review-dialog-B3jUcADI.js → file-review-dialog-DNWufkfZ.js} +2 -2
  30. package/dist/web/assets/file-review-dialog-DNWufkfZ.js.br +0 -0
  31. package/dist/web/assets/file-review-dialog-DNWufkfZ.js.gz +0 -0
  32. package/dist/web/assets/{git-commit-review-Bz_j3wJo.js → git-commit-review-B3GGQldl.js} +2 -2
  33. package/dist/web/assets/git-commit-review-B3GGQldl.js.br +0 -0
  34. package/dist/web/assets/git-commit-review-B3GGQldl.js.gz +0 -0
  35. package/dist/web/assets/{git-history-panel-Bk5XtV-h.js → git-history-panel-BvNkd60B.js} +1 -1
  36. package/dist/web/assets/git-history-panel-BvNkd60B.js.br +0 -0
  37. package/dist/web/assets/git-history-panel-BvNkd60B.js.gz +0 -0
  38. package/dist/web/assets/{global-search-dialog-nP5Zoo16.js → global-search-dialog-CZnsxRQ7.js} +1 -1
  39. package/dist/web/assets/global-search-dialog-CZnsxRQ7.js.br +0 -0
  40. package/dist/web/assets/global-search-dialog-CZnsxRQ7.js.gz +0 -0
  41. package/dist/web/assets/{global-settings-about-Bdzkr5Fi.js → global-settings-about-CnBVv1BA.js} +1 -1
  42. package/dist/web/assets/global-settings-about-CnBVv1BA.js.br +0 -0
  43. package/dist/web/assets/global-settings-about-CnBVv1BA.js.gz +0 -0
  44. package/dist/web/assets/{global-settings-page-Bm6WTYej.js → global-settings-page-VbyWoa5s.js} +2 -2
  45. package/dist/web/assets/global-settings-page-VbyWoa5s.js.br +0 -0
  46. package/dist/web/assets/global-settings-page-VbyWoa5s.js.gz +0 -0
  47. package/dist/web/assets/{global-settings-pets-ChV29f_6.js → global-settings-pets-CAXRRfK_.js} +1 -1
  48. package/dist/web/assets/global-settings-pets-CAXRRfK_.js.br +0 -0
  49. package/dist/web/assets/global-settings-pets-CAXRRfK_.js.gz +0 -0
  50. package/dist/web/assets/{highlighted-body-OFNGDK62-D1VJUKau.js → highlighted-body-OFNGDK62-ClNmIb2W.js} +1 -1
  51. package/dist/web/assets/highlighted-body-OFNGDK62-ClNmIb2W.js.br +0 -0
  52. package/dist/web/assets/highlighted-body-OFNGDK62-ClNmIb2W.js.gz +0 -0
  53. package/dist/web/assets/{history-task-timeline-CphChwX0.js → history-task-timeline-bx1YeO4E.js} +1 -1
  54. package/dist/web/assets/history-task-timeline-bx1YeO4E.js.br +0 -0
  55. package/dist/web/assets/history-task-timeline-bx1YeO4E.js.gz +0 -0
  56. package/dist/web/assets/{image-preview-CZiY9KQs.js → image-preview-Cufuk95q.js} +2 -2
  57. package/dist/web/assets/image-preview-Cufuk95q.js.br +0 -0
  58. package/dist/web/assets/image-preview-Cufuk95q.js.gz +0 -0
  59. package/dist/web/assets/{image-preview-content-D54Quns6.js → image-preview-content-C9_jCSeW.js} +1 -1
  60. package/dist/web/assets/image-preview-content-C9_jCSeW.js.br +0 -0
  61. package/dist/web/assets/image-preview-content-C9_jCSeW.js.gz +0 -0
  62. package/dist/web/assets/index-DudvUciK.js +4 -0
  63. package/dist/web/assets/index-DudvUciK.js.br +0 -0
  64. package/dist/web/assets/index-DudvUciK.js.gz +0 -0
  65. package/dist/web/assets/initial-deps-B7SS8XxM.js +2 -0
  66. package/dist/web/assets/initial-deps-B7SS8XxM.js.br +0 -0
  67. package/dist/web/assets/initial-deps-B7SS8XxM.js.gz +0 -0
  68. package/dist/web/assets/{installed-skills-pane-DnKCXx4r.js → installed-skills-pane-B0a8IOZ0.js} +1 -1
  69. package/dist/web/assets/installed-skills-pane-B0a8IOZ0.js.br +0 -0
  70. package/dist/web/assets/installed-skills-pane-B0a8IOZ0.js.gz +0 -0
  71. package/dist/web/assets/{lazy-message-response-S2-ZO_oT.js → lazy-message-response-Q7-W7qvB.js} +2 -2
  72. package/dist/web/assets/lazy-message-response-Q7-W7qvB.js.br +0 -0
  73. package/dist/web/assets/lazy-message-response-Q7-W7qvB.js.gz +0 -0
  74. package/dist/web/assets/{mcp-management-pane-CAcqH6Ft.js → mcp-management-pane-BaRHPwX2.js} +1 -1
  75. package/dist/web/assets/mcp-management-pane-BaRHPwX2.js.br +0 -0
  76. package/dist/web/assets/mcp-management-pane-BaRHPwX2.js.gz +0 -0
  77. package/dist/web/assets/mermaid-GHXKKRXX-DywTXJ81.js +1 -0
  78. package/dist/web/assets/mermaid-GHXKKRXX-DywTXJ81.js.br +0 -0
  79. package/dist/web/assets/mermaid-GHXKKRXX-DywTXJ81.js.gz +0 -0
  80. package/dist/web/assets/message-assistant-directive-CaNrh5lx.js +3 -0
  81. package/dist/web/assets/message-assistant-directive-CaNrh5lx.js.br +0 -0
  82. package/dist/web/assets/message-assistant-directive-CaNrh5lx.js.gz +0 -0
  83. package/dist/web/assets/{message-response-D6AZoXZR.js → message-response-WYZfuphQ.js} +25 -25
  84. package/dist/web/assets/message-response-WYZfuphQ.js.br +0 -0
  85. package/dist/web/assets/message-response-WYZfuphQ.js.gz +0 -0
  86. package/dist/web/assets/{official-plugins-pane-CBk4rbLt.js → official-plugins-pane-KGXjJvv3.js} +1 -1
  87. package/dist/web/assets/official-plugins-pane-KGXjJvv3.js.br +0 -0
  88. package/dist/web/assets/official-plugins-pane-KGXjJvv3.js.gz +0 -0
  89. package/dist/web/assets/{patch-diff-viewer-nIzfWkKE.js → patch-diff-viewer-D_Ts5rez.js} +2 -2
  90. package/dist/web/assets/patch-diff-viewer-D_Ts5rez.js.br +0 -0
  91. package/dist/web/assets/patch-diff-viewer-D_Ts5rez.js.gz +0 -0
  92. package/dist/web/assets/{pdf-preview-Zrj4u-KR.js → pdf-preview-D46KssiK.js} +3 -3
  93. package/dist/web/assets/pdf-preview-D46KssiK.js.br +0 -0
  94. package/dist/web/assets/pdf-preview-D46KssiK.js.gz +0 -0
  95. package/dist/web/assets/{personalization-settings-panel-D3OqsNUV.js → personalization-settings-panel-CllzRqsG.js} +1 -1
  96. package/dist/web/assets/personalization-settings-panel-CllzRqsG.js.br +0 -0
  97. package/dist/web/assets/personalization-settings-panel-CllzRqsG.js.gz +0 -0
  98. package/dist/web/assets/{project-file-popup-page-7yzFqPZq.js → project-file-popup-page-CVnfABUU.js} +1 -1
  99. package/dist/web/assets/project-file-popup-page-CVnfABUU.js.br +0 -0
  100. package/dist/web/assets/project-file-popup-page-CVnfABUU.js.gz +0 -0
  101. package/dist/web/assets/{project-source-panel-C1tTwC1j.js → project-source-panel-Dl6nuWfg.js} +1 -1
  102. package/dist/web/assets/project-source-panel-Dl6nuWfg.js.br +0 -0
  103. package/dist/web/assets/project-source-panel-Dl6nuWfg.js.gz +0 -0
  104. package/dist/web/assets/{prompt-input--2KQl6SR.js → prompt-input-Ceptl3B-.js} +1 -1
  105. package/dist/web/assets/prompt-input-Ceptl3B-.js.br +0 -0
  106. package/dist/web/assets/prompt-input-Ceptl3B-.js.gz +0 -0
  107. package/dist/web/assets/resources-en-CzuCDOU2.js +1 -0
  108. package/dist/web/assets/resources-en-CzuCDOU2.js.br +0 -0
  109. package/dist/web/assets/resources-en-CzuCDOU2.js.gz +0 -0
  110. package/dist/web/assets/{scheduled-task-date-time-picker-BVYVGT78.js → scheduled-task-date-time-picker-CpT4cTpn.js} +1 -1
  111. package/dist/web/assets/scheduled-task-date-time-picker-CpT4cTpn.js.br +0 -0
  112. package/dist/web/assets/scheduled-task-date-time-picker-CpT4cTpn.js.gz +0 -0
  113. package/dist/web/assets/{scheduled-tasks-container-CQkfAgKW.js → scheduled-tasks-container-CRV2di5K.js} +2 -2
  114. package/dist/web/assets/scheduled-tasks-container-CRV2di5K.js.br +0 -0
  115. package/dist/web/assets/scheduled-tasks-container-CRV2di5K.js.gz +0 -0
  116. package/dist/web/assets/{shiki-bundle-COC_j-nR.js → shiki-bundle-C942xz2H.js} +1 -1
  117. package/dist/web/assets/shiki-bundle-C942xz2H.js.br +2 -0
  118. package/dist/web/assets/shiki-bundle-C942xz2H.js.gz +0 -0
  119. package/dist/web/assets/{skills-market-container-_ME3wZFP.js → skills-market-container--8qzUyrx.js} +2 -2
  120. package/dist/web/assets/skills-market-container--8qzUyrx.js.br +0 -0
  121. package/dist/web/assets/skills-market-container--8qzUyrx.js.gz +0 -0
  122. package/dist/web/assets/{split-workspace-menu-content-CkpZv1Nz.js → split-workspace-menu-content-CAL4JQt9.js} +1 -1
  123. package/dist/web/assets/split-workspace-menu-content-CAL4JQt9.js.br +5 -0
  124. package/dist/web/assets/split-workspace-menu-content-CAL4JQt9.js.gz +0 -0
  125. package/dist/web/assets/{third-party-marketplace-pane-D3AJNSoF.js → third-party-marketplace-pane-Can5ly44.js} +1 -1
  126. package/dist/web/assets/third-party-marketplace-pane-Can5ly44.js.br +0 -0
  127. package/dist/web/assets/third-party-marketplace-pane-Can5ly44.js.gz +0 -0
  128. package/dist/web/assets/{workbench-inspector-changes-DSbBqbXe.js → workbench-inspector-changes-D2ZiHtIT.js} +1 -1
  129. package/dist/web/assets/workbench-inspector-changes-D2ZiHtIT.js.br +0 -0
  130. package/dist/web/assets/workbench-inspector-changes-D2ZiHtIT.js.gz +0 -0
  131. package/dist/web/assets/{workbench-pet-canvas-Ct1J6Adp.js → workbench-pet-canvas-DuBL3mip.js} +1 -1
  132. package/dist/web/assets/workbench-pet-canvas-DuBL3mip.js.br +0 -0
  133. package/dist/web/assets/workbench-pet-canvas-DuBL3mip.js.gz +0 -0
  134. package/dist/web/assets/workbench-shell-CfN-sr8U.js +16 -0
  135. package/dist/web/assets/workbench-shell-CfN-sr8U.js.br +0 -0
  136. package/dist/web/assets/workbench-shell-CfN-sr8U.js.gz +0 -0
  137. package/dist/web/index.html +2 -2
  138. package/dist/web/index.html.br +0 -0
  139. package/dist/web/index.html.gz +0 -0
  140. package/package.json +1 -1
  141. package/dist/web/assets/agent-settings-panel-K1YqqkJL.js.br +0 -0
  142. package/dist/web/assets/agent-settings-panel-K1YqqkJL.js.gz +0 -0
  143. package/dist/web/assets/background-image-picker-BHqZ3SX1.js.br +0 -0
  144. package/dist/web/assets/background-image-picker-BHqZ3SX1.js.gz +0 -0
  145. package/dist/web/assets/code-highlighter-DIfBIRTg.js.br +0 -0
  146. package/dist/web/assets/code-highlighter-DIfBIRTg.js.gz +0 -0
  147. package/dist/web/assets/commit-settings-panel-B0i2Bqmu.js.br +0 -0
  148. package/dist/web/assets/commit-settings-panel-B0i2Bqmu.js.gz +0 -0
  149. package/dist/web/assets/file-review-dialog-B3jUcADI.js.br +0 -0
  150. package/dist/web/assets/file-review-dialog-B3jUcADI.js.gz +0 -0
  151. package/dist/web/assets/git-commit-review-Bz_j3wJo.js.br +0 -0
  152. package/dist/web/assets/git-commit-review-Bz_j3wJo.js.gz +0 -0
  153. package/dist/web/assets/git-history-panel-Bk5XtV-h.js.br +0 -0
  154. package/dist/web/assets/git-history-panel-Bk5XtV-h.js.gz +0 -0
  155. package/dist/web/assets/global-search-dialog-nP5Zoo16.js.br +0 -0
  156. package/dist/web/assets/global-search-dialog-nP5Zoo16.js.gz +0 -0
  157. package/dist/web/assets/global-settings-about-Bdzkr5Fi.js.br +0 -0
  158. package/dist/web/assets/global-settings-about-Bdzkr5Fi.js.gz +0 -0
  159. package/dist/web/assets/global-settings-page-Bm6WTYej.js.br +0 -0
  160. package/dist/web/assets/global-settings-page-Bm6WTYej.js.gz +0 -0
  161. package/dist/web/assets/global-settings-pets-ChV29f_6.js.br +0 -0
  162. package/dist/web/assets/global-settings-pets-ChV29f_6.js.gz +0 -0
  163. package/dist/web/assets/highlighted-body-OFNGDK62-D1VJUKau.js.br +0 -0
  164. package/dist/web/assets/highlighted-body-OFNGDK62-D1VJUKau.js.gz +0 -0
  165. package/dist/web/assets/history-task-timeline-CphChwX0.js.br +0 -0
  166. package/dist/web/assets/history-task-timeline-CphChwX0.js.gz +0 -0
  167. package/dist/web/assets/image-preview-CZiY9KQs.js.br +0 -4
  168. package/dist/web/assets/image-preview-CZiY9KQs.js.gz +0 -0
  169. package/dist/web/assets/image-preview-content-D54Quns6.js.br +0 -0
  170. package/dist/web/assets/image-preview-content-D54Quns6.js.gz +0 -0
  171. package/dist/web/assets/index-CV7PO8FJ.js +0 -4
  172. package/dist/web/assets/index-CV7PO8FJ.js.br +0 -0
  173. package/dist/web/assets/index-CV7PO8FJ.js.gz +0 -0
  174. package/dist/web/assets/initial-deps-DElr8S4a.js +0 -2
  175. package/dist/web/assets/initial-deps-DElr8S4a.js.br +0 -0
  176. package/dist/web/assets/initial-deps-DElr8S4a.js.gz +0 -0
  177. package/dist/web/assets/installed-skills-pane-DnKCXx4r.js.br +0 -0
  178. package/dist/web/assets/installed-skills-pane-DnKCXx4r.js.gz +0 -0
  179. package/dist/web/assets/lazy-message-response-S2-ZO_oT.js.br +0 -0
  180. package/dist/web/assets/lazy-message-response-S2-ZO_oT.js.gz +0 -0
  181. package/dist/web/assets/mcp-management-pane-CAcqH6Ft.js.br +0 -0
  182. package/dist/web/assets/mcp-management-pane-CAcqH6Ft.js.gz +0 -0
  183. package/dist/web/assets/mermaid-GHXKKRXX-CRcc_eOq.js +0 -1
  184. package/dist/web/assets/mermaid-GHXKKRXX-CRcc_eOq.js.br +0 -1
  185. package/dist/web/assets/mermaid-GHXKKRXX-CRcc_eOq.js.gz +0 -0
  186. package/dist/web/assets/message-assistant-directive-7AH4Pn2V.js +0 -3
  187. package/dist/web/assets/message-assistant-directive-7AH4Pn2V.js.br +0 -0
  188. package/dist/web/assets/message-assistant-directive-7AH4Pn2V.js.gz +0 -0
  189. package/dist/web/assets/message-response-D6AZoXZR.js.br +0 -0
  190. package/dist/web/assets/message-response-D6AZoXZR.js.gz +0 -0
  191. package/dist/web/assets/official-plugins-pane-CBk4rbLt.js.br +0 -0
  192. package/dist/web/assets/official-plugins-pane-CBk4rbLt.js.gz +0 -0
  193. package/dist/web/assets/patch-diff-viewer-nIzfWkKE.js.br +0 -0
  194. package/dist/web/assets/patch-diff-viewer-nIzfWkKE.js.gz +0 -0
  195. package/dist/web/assets/pdf-preview-Zrj4u-KR.js.br +0 -0
  196. package/dist/web/assets/pdf-preview-Zrj4u-KR.js.gz +0 -0
  197. package/dist/web/assets/personalization-settings-panel-D3OqsNUV.js.br +0 -0
  198. package/dist/web/assets/personalization-settings-panel-D3OqsNUV.js.gz +0 -0
  199. package/dist/web/assets/project-file-popup-page-7yzFqPZq.js.br +0 -0
  200. package/dist/web/assets/project-file-popup-page-7yzFqPZq.js.gz +0 -0
  201. package/dist/web/assets/project-source-panel-C1tTwC1j.js.br +0 -0
  202. package/dist/web/assets/project-source-panel-C1tTwC1j.js.gz +0 -0
  203. package/dist/web/assets/prompt-input--2KQl6SR.js.br +0 -0
  204. package/dist/web/assets/prompt-input--2KQl6SR.js.gz +0 -0
  205. package/dist/web/assets/resources-en-CNO1wrxl.js +0 -1
  206. package/dist/web/assets/resources-en-CNO1wrxl.js.br +0 -0
  207. package/dist/web/assets/resources-en-CNO1wrxl.js.gz +0 -0
  208. package/dist/web/assets/scheduled-task-date-time-picker-BVYVGT78.js.br +0 -0
  209. package/dist/web/assets/scheduled-task-date-time-picker-BVYVGT78.js.gz +0 -0
  210. package/dist/web/assets/scheduled-tasks-container-CQkfAgKW.js.br +0 -0
  211. package/dist/web/assets/scheduled-tasks-container-CQkfAgKW.js.gz +0 -0
  212. package/dist/web/assets/shiki-bundle-COC_j-nR.js.br +0 -3
  213. package/dist/web/assets/shiki-bundle-COC_j-nR.js.gz +0 -0
  214. package/dist/web/assets/skills-market-container-_ME3wZFP.js.br +0 -0
  215. package/dist/web/assets/skills-market-container-_ME3wZFP.js.gz +0 -0
  216. package/dist/web/assets/split-workspace-menu-content-CkpZv1Nz.js.br +0 -0
  217. package/dist/web/assets/split-workspace-menu-content-CkpZv1Nz.js.gz +0 -0
  218. package/dist/web/assets/third-party-marketplace-pane-D3AJNSoF.js.br +0 -0
  219. package/dist/web/assets/third-party-marketplace-pane-D3AJNSoF.js.gz +0 -0
  220. package/dist/web/assets/workbench-inspector-changes-DSbBqbXe.js.br +0 -0
  221. package/dist/web/assets/workbench-inspector-changes-DSbBqbXe.js.gz +0 -0
  222. package/dist/web/assets/workbench-pet-canvas-Ct1J6Adp.js.br +0 -0
  223. package/dist/web/assets/workbench-pet-canvas-Ct1J6Adp.js.gz +0 -0
  224. package/dist/web/assets/workbench-shell-CP0njkD8.js +0 -16
  225. package/dist/web/assets/workbench-shell-CP0njkD8.js.br +0 -0
  226. package/dist/web/assets/workbench-shell-CP0njkD8.js.gz +0 -0
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/split-workspace-menu-content-CkpZv1Nz.js","assets/react-runtime-CMZHB3u8.js","assets/rolldown-runtime-B0Z9INg1.js","assets/initial-deps-B8FrcWWN.js","assets/initial-deps-C0_XYRrC.js","assets/arrow-down-DoJlTckg.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./initial-deps-CqwWvUnY.js";import{i as n,t as r}from"./react-runtime-CMZHB3u8.js";import{t as i}from"./initial-deps-CW5Jl6i2.js";import{i as a,n as o,r as s,t as c}from"./initial-deps-CG4ykI_P.js";import{u as l}from"./initial-deps-C0_XYRrC.js";import{A as u,B as d,E as f,K as p,L as m,R as h,S as g,U as _,W as v,a as y,i as b,j as ee,n as te,o as x,q as ne}from"./initial-deps-B8FrcWWN.js";import{$ as re,A as S,B as C,C as ie,D as ae,E as oe,F as w,G as se,H as ce,I as le,J as ue,K as de,L as fe,M as pe,N as me,O as he,P as ge,Q as _e,R as ve,S as ye,T as be,U as xe,V as Se,W as Ce,X as we,Y as Te,Z as Ee,_ as De,a as Oe,b as ke,c as Ae,d as je,et as Me,f as Ne,g as Pe,h as Fe,i as Ie,j as Le,k as Re,l as ze,m as Be,n as Ve,o as He,p as Ue,pt as We,q as Ge,r as Ke,s as qe,t as Je,tt as Ye,u as Xe,v as Ze,w as Qe,x as $e,y as et,z as tt}from"./initial-deps-Cppvl2Gz.js";var T=o.String({maxLength:32768,minLength:1,pattern:`^(?!.*[\\u0000\\r\\n])(?:/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\/]+[\\\\/][^\\\\/]+).*$`}),nt=o.String({maxLength:64,minLength:1}),rt=o.Object({path:T},{additionalProperties:!1}),it=o.Object({id:nt,path:T},{additionalProperties:!1}),at=o.Readonly(o.Array(it,{minItems:1,uniqueItems:!0})),ot=o.Readonly(o.Array(rt,{minItems:1,uniqueItems:!0}));o.Object({rootPath:T},{additionalProperties:!1});function st(e){return e.length>0&&e.length<=255&&e===e.trim()&&!/[<>:"/\\|?*]/u.test(e)&&!Array.from(e).some(e=>e.charCodeAt(0)<32)&&!/[. ]$/u.test(e)&&!/^(con|prn|aux|nul|com[1-9¹²³]|lpt[1-9¹²³])(?:\.|$)/iu.test(e)}o.Object({parentPath:T,name:o.String({minLength:1,maxLength:255})},{additionalProperties:!1});var ct=o.Object({path:T,status:o.Union([o.Literal(`created`),o.Literal(`exists-directory`),o.Literal(`exists-file`)])},{additionalProperties:!1}),lt=o.Union([o.Object({enabled:o.Literal(!1),selectedPetId:o.Union([o.String(),o.Null()])},{additionalProperties:!1}),o.Object({enabled:o.Literal(!0),selectedPetId:o.String({minLength:1})},{additionalProperties:!1})]),ut=o.Object({columns:o.Integer({minimum:1}),height:o.Integer({minimum:1}),rows:o.Integer({minimum:1}),width:o.Integer({minimum:1})},{additionalProperties:!1}),dt=o.Object({durationMs:o.Integer({minimum:1}),spriteIndex:o.Integer({maximum:255,minimum:0})},{additionalProperties:!1}),ft=o.Object({fallback:o.String({minLength:1}),frames:o.Array(dt,{maxItems:512,minItems:1}),loopStart:o.Union([o.Integer({minimum:0}),o.Null()])},{additionalProperties:!1}),pt=o.Object({animations:o.Record(o.String({minLength:1}),ft),assetId:o.String({pattern:`^[a-f0-9]{64}$`}),availability:o.Union([o.Literal(`downloadable`),o.Literal(`ready`)]),description:o.String(),displayName:o.String({minLength:1}),frame:ut,id:o.String({minLength:1}),source:o.Union([o.Literal(`builtin`),o.Literal(`custom`),o.Literal(`legacy`)])},{additionalProperties:!1}),mt=o.Object({data:o.Array(pt)},{additionalProperties:!1});o.Object({petId:o.String({minLength:1})},{additionalProperties:!1});var ht=o.Object({pets:mt},{additionalProperties:!1});s(`date-time`)||a(`date-time`,e=>!Number.isNaN(Date.parse(e)));var E=o.String({format:`date-time`}),gt=o.Union([E,o.Null()]),D=o.Object({createdAt:E,id:o.String({minLength:1}),name:o.String({minLength:1}),roots:at},{additionalProperties:!1}),O=o.String({minLength:1,pattern:`^(?![A-Za-z]:)(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))(?!.*//)(?!.*\\\\)(?!.*\\/$).+$`}),_t=o.String({maxLength:128,minLength:1,pattern:`^[A-Za-z0-9._:-]+$`});o.Object({query:o.String({maxLength:256}),rootPath:o.Optional(T),sessionId:_t},{additionalProperties:!1});var vt=o.Object({name:o.String({minLength:1}),path:O,rootId:nt,rootPath:T},{additionalProperties:!1}),yt=o.Object({data:o.Array(vt,{maxItems:50})},{additionalProperties:!1});o.Object({rootPath:o.Optional(T),sessionId:_t},{additionalProperties:!1});var bt=o.Object({},{additionalProperties:!1}),xt=o.String({maxLength:32768,minLength:1,pattern:`^[^\\u0000\\r\\n]+$`}),k=T;o.Object({includeHidden:o.Optional(o.Boolean()),path:o.Optional(k)},{additionalProperties:!1});var St=o.Object({name:o.String({minLength:1}),path:k},{additionalProperties:!1}),Ct=o.Object({name:o.String({minLength:1}),path:k},{additionalProperties:!1}),wt=o.Object({entries:o.Array(St),parentPath:o.Union([k,o.Null()]),path:k,roots:o.Array(Ct)},{additionalProperties:!1}),Tt=o.Union([o.Literal(`file`),o.Literal(`image`)]);o.Object({includeHidden:o.Optional(o.Boolean()),kind:Tt,path:o.Optional(k)},{additionalProperties:!1});var Et=o.Object({name:o.String({minLength:1}),path:k,type:o.Union([o.Literal(`directory`),o.Literal(`file`)])},{additionalProperties:!1}),Dt=o.Object({entries:o.Array(Et),parentPath:o.Union([k,o.Null()]),path:k,roots:o.Array(Ct)},{additionalProperties:!1});o.Object({path:k},{additionalProperties:!1}),o.Object({roots:ot},{additionalProperties:!1});var Ot=o.Object({data:o.Array(D),nextCursor:o.Null()},{additionalProperties:!1}),kt=o.Object({project:D,projects:Ot},{additionalProperties:!1}),At=o.Union([o.Literal(`visual-studio-code`),o.Literal(`system-default`),o.Literal(`zed`),o.Literal(`windsurf`),o.Literal(`finder`),o.Literal(`terminal`),o.Literal(`ghostty`),o.Literal(`xcode`),o.Literal(`android-studio`),o.Literal(`file-manager`),o.Literal(`gnome-terminal`),o.Literal(`konsole`),o.Literal(`xfce-terminal`),o.Literal(`explorer`),o.Literal(`windows-terminal`),o.Literal(`command-prompt`)]),jt=o.Union([o.Literal(`editor`),o.Literal(`file-manager`),o.Literal(`system-default`),o.Literal(`terminal`),o.Literal(`tool`)]),Mt=o.Object({id:At,kind:jt,name:o.String({minLength:1})},{additionalProperties:!1}),Nt=o.Union([o.Literal(`darwin`),o.Literal(`linux`),o.Literal(`win32`)]),Pt=o.Object({apps:o.Array(Mt,{uniqueItems:!0}),platform:Nt},{additionalProperties:!1});o.Object({appId:At,path:o.Optional(xt)},{additionalProperties:!1});var Ft=o.Object({appId:At,path:o.Optional(xt)},{additionalProperties:!1});o.Object({projectIds:o.Array(o.String({minLength:1}),{minItems:1,uniqueItems:!0})},{additionalProperties:!1}),o.Object({name:o.String({maxLength:200,minLength:1,pattern:`\\S`})},{additionalProperties:!1});var It=o.Object({project:D,projects:Ot},{additionalProperties:!1});o.Object({},{additionalProperties:!1});var Lt=o.Object({projectId:o.String({minLength:1}),projects:Ot,status:o.Literal(`removed`)},{additionalProperties:!1}),Rt=o.Object({diff:o.String(),kind:o.Union([o.Literal(`create`),o.Literal(`update`),o.Literal(`delete`)]),path:o.String({minLength:1})},{additionalProperties:!1}),A=o.String({maxLength:64,minLength:64,pattern:`^[a-f0-9]{64}$`}),j=o.String({maxLength:1024,minLength:1,pattern:`\\S`}),zt=o.String({maxLength:1024,minLength:1,pattern:`^(?!\\.{1,2}$)(?!.*[\\u0000\\r\\n])[^/\\\\]+$`}),Bt=o.Array(O,{maxItems:500,minItems:1,uniqueItems:!0}),Vt=o.String({maxLength:1e4,minLength:1,pattern:`\\S`}),Ht=o.Object({diff:o.String(),kind:o.Union([o.Literal(`create`),o.Literal(`update`),o.Literal(`delete`)]),path:O},{additionalProperties:!1}),Ut=o.Object({baseBranches:o.Array(o.String({minLength:1}),{uniqueItems:!0}),branch:o.Union([o.String({minLength:1}),o.Null()]),branches:o.Array(j,{uniqueItems:!0}),repositoryMode:o.Union([o.Literal(`root`),o.Literal(`children`),o.Literal(`none`)]),snapshot:A,staged:o.Array(Ht),unstaged:o.Array(Ht)},{additionalProperties:!1});o.Object({includeDiff:o.Optional(o.Boolean()),repository:o.Optional(zt),rootPath:T},{additionalProperties:!1});var Wt=o.Object({authoredAt:o.String({format:`date-time`}),authorEmail:o.String({maxLength:320,minLength:1}),authorName:o.String({maxLength:512,minLength:1,pattern:`\\S`}),sha:o.String({maxLength:64,minLength:40,pattern:`^[a-f0-9]+$`}),title:o.String({maxLength:1e4,minLength:1,pattern:`\\S`}),unpushed:o.Optional(o.Boolean())},{additionalProperties:!1}),Gt=o.String({maxLength:20,minLength:1,pattern:`^[0-9]+$`});o.Object({cursor:o.Optional(Gt),repository:o.Optional(O),rootPath:T},{additionalProperties:!1});var Kt=o.Object({branch:o.Union([j,o.Null()]),commits:o.Array(Wt,{maxItems:20}),nextCursor:o.Union([Gt,o.Null()]),repositories:o.Array(O,{maxItems:256,uniqueItems:!0}),repository:o.Union([O,o.Null()]),repositoryMode:o.Union([o.Literal(`root`),o.Literal(`children`)])},{additionalProperties:!1}),qt=o.String({maxLength:64,minLength:40,pattern:`^[a-f0-9]+$`}),Jt=o.String({maxLength:20,minLength:1,pattern:`^[0-9]+$`});o.Object({cursor:o.Optional(Jt),repository:o.Optional(O),rootPath:T,sha:qt},{additionalProperties:!1});var Yt=o.Object({kind:o.Union([o.Literal(`create`),o.Literal(`update`),o.Literal(`delete`)]),path:O},{additionalProperties:!1}),Xt=o.Object({files:o.Array(Yt,{maxItems:100}),nextCursor:o.Union([Jt,o.Null()])},{additionalProperties:!1});o.Object({path:O,repository:o.Optional(O),rootPath:T,sha:qt},{additionalProperties:!1});var Zt=o.Object({diff:o.String({maxLength:524288}),truncated:o.Boolean()},{additionalProperties:!1});o.Object({branch:j,expectedSnapshot:A},{additionalProperties:!1}),o.Object({branch:j,expectedSnapshot:A},{additionalProperties:!1});var Qt=o.Object({branch:o.Union([j,o.Null()]),current:o.Boolean(),path:k},{additionalProperties:!1}),$t=o.Object({worktrees:o.Array(Qt,{maxItems:256})},{additionalProperties:!1});o.Object({branch:j,expectedSnapshot:A},{additionalProperties:!1}),o.Object({path:k},{additionalProperties:!1});var en=o.Object({project:D,projects:o.Object({data:o.Array(D),nextCursor:o.Null()},{additionalProperties:!1}),worktree:Qt,worktrees:$t},{additionalProperties:!1}),tn=o.Object({...en.properties,status:Ut},{additionalProperties:!1}),nn=o.Object({worktree:Qt},{additionalProperties:!1});o.Object({expectedSnapshot:A,paths:Bt,repository:o.Optional(zt)},{additionalProperties:!1});var rn=o.Object({message:Vt,snapshot:A},{additionalProperties:!1});o.Object({action:o.Union([o.Literal(`commit`),o.Literal(`commit_and_push`)]),expectedSnapshot:A,message:Vt,paths:Bt,repository:o.Optional(zt)},{additionalProperties:!1}),o.Object({expectedSnapshot:A,repository:o.Optional(zt),action:o.Optional(o.Union([o.Literal(`inspect`),o.Literal(`push`),o.Literal(`publish`),o.Literal(`fetch`),o.Literal(`integrate`),o.Literal(`configure`),o.Literal(`branch`)])),remote:o.Optional(o.String({minLength:1,maxLength:256,pattern:`^(?!-)[A-Za-z0-9_.-]+$`})),url:o.Optional(o.String({minLength:1,maxLength:4096,pattern:`^(?!-)[^\\u0000\\r\\n]+$`})),branchName:o.Optional(j),expectedHead:o.Optional(qt),expectedBranch:o.Optional(j)},{additionalProperties:!1});var an=o.Object({head:o.Union([o.String(),o.Null()]),upstream:o.Union([o.String(),o.Null()]),remote:o.Union([o.String(),o.Null()]),targetBranch:o.Union([o.String(),o.Null()]),remotes:o.Array(o.Object({name:o.String(),url:o.String()},{additionalProperties:!1}),{maxItems:64}),ahead:o.Union([o.Integer({minimum:0}),o.Null()]),behind:o.Union([o.Integer({minimum:0}),o.Null()]),checkedAt:o.String(),operation:o.Union([o.Literal(`none`),o.Literal(`merge`)]),conflicts:o.Array(o.String())},{additionalProperties:!1}),on=o.Object({branch:o.Union([o.String({minLength:1}),o.Null()]),pushError:o.Union([o.String({minLength:1}),o.Null()]),remoteState:o.Optional(an),pushStatus:o.Union([o.Literal(`checked`),o.Literal(`updated`),o.Literal(`pushed`),o.Literal(`failed`),o.Literal(`not_configured`)])},{additionalProperties:!1}),sn=o.Object({branch:o.Union([o.String({minLength:1}),o.Null()]),commitSha:o.String({maxLength:64,minLength:7,pattern:`^[a-f0-9]+$`}),history:Kt,message:Vt,pushError:o.Union([o.String({minLength:1}),o.Null()]),pushStatus:o.Union([o.Literal(`not_requested`),o.Literal(`pushed`),o.Literal(`failed`),o.Literal(`not_configured`)]),status:Ut},{additionalProperties:!1}),cn=o.Object({path:O,type:o.Union([o.Literal(`directory`),o.Literal(`file`)])},{additionalProperties:!1});o.Object({path:o.Optional(O),rootPath:o.Optional(T)},{additionalProperties:!1});var ln=o.Object({entries:o.Array(cn),path:o.Union([O,o.Null()])},{additionalProperties:!1}),un=o.String({maxLength:255,minLength:1,pattern:`^(?!\\.\\.?$)[^/\\\\\\u0000\\r\\n]+$`});o.Object({name:un,path:O},{additionalProperties:!1});var dn=o.Object({path:O,tree:ln},{additionalProperties:!1});o.Object({path:O},{additionalProperties:!1});var fn=o.Object({path:O,status:o.Literal(`deleted`),tree:ln},{additionalProperties:!1});o.Object({cursor:o.Optional(o.Integer({minimum:0})),path:xt,rootPath:o.Optional(T)},{additionalProperties:!1});var pn=o.Object({content:o.String(),nextCursor:o.Union([o.Integer({minimum:0}),o.Null()]),path:xt},{additionalProperties:!1}),mn=o.Object({id:o.String({minLength:1}),pinned:o.Boolean(),projectId:o.String({minLength:1}),title:o.String({minLength:1}),updatedAt:E},{additionalProperties:!1}),hn=o.Object({model:o.Union([o.String(),o.Null()]),reasoningEffort:o.Union([o.String(),o.Null()])},{additionalProperties:!1}),M=o.Object({...mn.properties,threadConfiguration:o.Optional(hn),workspacePath:o.Optional(T)},{additionalProperties:!1}),N=o.Union([o.Literal(`pending`),o.Literal(`running`),o.Literal(`completed`),o.Literal(`failed`),o.Literal(`declined`),o.Literal(`interrupted`)]),gn=o.Object({branch:o.Optional(o.String({minLength:1})),instructions:o.Optional(o.String({minLength:1})),sha:o.Optional(o.String({minLength:1})),title:o.Optional(o.String({minLength:1})),type:o.Union([o.Literal(`uncommitted_changes`),o.Literal(`base_branch`),o.Literal(`commit`),o.Literal(`custom`)])},{additionalProperties:!1}),_n=o.Intersect([gn,o.Union([o.Object({type:o.Literal(`uncommitted_changes`)}),o.Object({branch:o.String({minLength:1}),type:o.Literal(`base_branch`)}),o.Object({sha:o.String({minLength:1}),type:o.Literal(`commit`)}),o.Object({instructions:o.String({minLength:1}),type:o.Literal(`custom`)})])]),vn=52428800,yn=52428800,bn=10485760,xn=52428800,Sn=Math.max(vn,bn),Cn=1500,wn=536870912,Tn=`.png,.jpg,.jpeg,.webp,.gif`;o.Union([o.Literal(`image/gif`),o.Literal(`image/jpeg`),o.Literal(`image/png`),o.Literal(`image/webp`)]);var En=o.String({maxLength:255,minLength:1}),Dn=o.Union([o.Literal(`file`),o.Literal(`image`),o.Literal(`text`)]),On=o.Object({name:o.String({minLength:1})},{additionalProperties:!1});function kn(e,t){let n=new Set(t.map(e=>e.name)),r=e,i=!1;for(;r.length>0;){let e=/^\s*\$([^\s$]+)/u.exec(r),t=e?.[1];if(e===null||t===void 0||!n.has(t))break;r=r.slice(e[0].length),i=!0}return i?r.trimStart():e}var An=o.Object({id:o.String({minLength:1}),kind:Dn,mediaType:En,name:o.String({maxLength:255,minLength:1}),size:o.Integer({maximum:wn,minimum:1})},{additionalProperties:!1});o.Object({},{additionalProperties:!1});var jn=o.Object({attachmentId:o.String({minLength:1}),status:o.Literal(`opened`)},{additionalProperties:!1}),Mn=o.Union([o.Literal(`commentary`),o.Literal(`partial_answer`),o.Literal(`final_answer`)]),Nn=o.Object({identityAliases:o.Optional(o.Array(o.String({minLength:1}),{maxItems:256,uniqueItems:!0})),attachments:o.Optional(o.Array(An,{maxItems:Cn})),id:o.String({minLength:1}),phase:o.Optional(Mn),questions:o.Optional(o.Array(o.Object({title:o.String(),options:o.Union([o.Array(o.String()),o.Null()])},{additionalProperties:!1}))),role:o.Union([o.Literal(`user`),o.Literal(`assistant`)]),skills:o.Optional(o.Array(On)),text:o.String(),type:o.Literal(`message`)},{additionalProperties:!1}),Pn=o.Object({content:o.String(),id:o.String({minLength:1}),summary:o.String(),type:o.Literal(`reasoning`)},{additionalProperties:!1}),Fn=o.Object({bytes:o.Integer({minimum:0}),lines:o.Integer({minimum:0})},{additionalProperties:!1}),In=o.Object({command:o.String(),cwd:o.String(),exitCode:o.Optional(o.Integer()),id:o.String({minLength:1}),output:o.Optional(o.String()),outputOmitted:Fn,status:N,type:o.Literal(`command`)},{additionalProperties:!1}),Ln=o.Object({command:o.String({minLength:1}),cwd:o.String({minLength:1}),id:o.String({minLength:1}),itemId:o.String({minLength:1})},{additionalProperties:!1}),Rn=o.Object({data:o.Array(Ln)},{additionalProperties:!1}),zn=o.Object({status:o.Literal(`terminated`),terminalId:o.String({minLength:1}),terminals:Rn},{additionalProperties:!1}),Bn=o.Union([o.Literal(`tasks`),o.Literal(`history`)]);o.Object({archived:o.Boolean(),cursor:o.Optional(o.String({maxLength:8192,minLength:1})),kind:Bn,query:o.String({maxLength:1024,minLength:1})},{additionalProperties:!1});var Vn=o.Object({end:o.Integer({minimum:0}),start:o.Integer({minimum:0})},{additionalProperties:!1}),Hn=o.Object({itemId:o.String({minLength:1}),snippet:o.String({maxLength:8192}),snippetMatchRange:Vn,turnCursor:o.String({minLength:1}),turnId:o.String({minLength:1})},{additionalProperties:!1});o.Object({cursor:o.Optional(o.String({maxLength:8192,minLength:1})),query:o.String({maxLength:1024,minLength:1})},{additionalProperties:!1});var Un=o.Object({data:o.Array(Hn,{maxItems:30}),nextCursor:o.Union([o.String({minLength:1}),o.Null()])},{additionalProperties:!1}),Wn=o.Object({data:o.Array(o.Object({occurrence:o.Optional(Hn),snippet:o.String({maxLength:8192}),task:M},{additionalProperties:!1}),{maxItems:30}),nextCursor:o.Union([o.String({minLength:1}),o.Null()])},{additionalProperties:!1});o.Object({},{additionalProperties:!1,maxProperties:0});var Gn=o.Object({deletedCount:o.Integer({minimum:0}),failedCount:o.Integer({minimum:0})},{additionalProperties:!1}),P=o.String({pattern:`^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-(?:(?:0|[1-9][0-9]*)|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:(?:0|[1-9][0-9]*)|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$`}),Kn=o.Union([o.Literal(`current`),o.Literal(`available`),o.Literal(`restart-required`),o.Literal(`check-failed`)]),qn=o.Union([o.Literal(`checking`),o.Literal(`backing-up`),o.Literal(`downloading`),o.Literal(`installing`),o.Literal(`rolling-back`),o.Literal(`completed`)]),Jn=o.Object({percent:o.Integer({maximum:100,minimum:0}),phase:qn},{additionalProperties:!1}),Yn=o.Object({progress:o.Union([Jn,o.Null()])},{additionalProperties:!1}),Xn=o.Object({appVersion:P,codexVersion:P,latestVersion:o.Union([P,o.Null()]),releaseNotes:o.Union([o.String({maxLength:32768}),o.Null()]),status:Kn,updateAvailable:o.Boolean()},{additionalProperties:!1});o.Object({version:P},{additionalProperties:!1});var Zn=o.Object({appVersion:P,codexVersion:P,latestVersion:P,releaseNotes:o.Null(),status:o.Literal(`restart-required`),updateAvailable:o.Literal(!1)},{additionalProperties:!1}),Qn=o.Object({changedPlugins:o.Array(o.Object({id:o.String({minLength:1}),hasApps:o.Boolean(),hasHooks:o.Boolean(),hasMcps:o.Boolean(),hasSkills:o.Boolean()},{additionalProperties:!1})),failedRemotePluginIds:o.Array(o.String()),failedMaterializationRemotePluginIds:o.Array(o.String())},{additionalProperties:!1}),$n=o.Object({description:o.String(),displayName:o.String({minLength:1}),enabled:o.Boolean(),id:o.String({minLength:1}),marketplace:o.Optional(o.Object({installedVersion:o.String({minLength:1}),owner:o.String({minLength:1}),slug:o.String({minLength:1})},{additionalProperties:!1})),name:o.String({minLength:1}),path:o.String({minLength:1}),projectId:o.Optional(o.String({minLength:1})),projectName:o.Optional(o.String({minLength:1})),rootPath:o.Optional(o.String({minLength:1})),scope:o.Union([o.Literal(`user`),o.Literal(`repo`),o.Literal(`system`),o.Literal(`admin`)]),source:o.Union([o.Literal(`clawhub`),o.Literal(`local`)])},{additionalProperties:!1}),er=o.Object({data:o.Array($n),nextCursor:o.Null()},{additionalProperties:!1}),tr=o.Object({enabled:o.Boolean(),name:o.String({minLength:1})},{additionalProperties:!1}),nr=o.Object({data:o.Array(tr,{uniqueItems:!0})},{additionalProperties:!1}),rr=o.Object({canonicalUrl:o.String({minLength:1}),displayName:o.String({minLength:1}),downloads:o.Integer({minimum:0}),id:o.String({minLength:1}),latestVersion:o.String({minLength:1}),owner:o.String({minLength:1}),slug:o.String({minLength:1}),stars:o.Integer({minimum:0}),summary:o.String(),topics:o.Array(o.String()),updatedAt:o.Integer(),versionCount:o.Integer({minimum:0})},{additionalProperties:!1}),ir=o.Object({items:o.Array(rr),nextCursor:o.Union([o.String(),o.Null()])},{additionalProperties:!1}),ar=o.Object({changelog:o.String(),createdAt:o.Integer(),version:o.String({minLength:1})},{additionalProperties:!1}),or=o.Object({...rr.properties,changelog:o.String(),hasWarnings:o.Boolean(),readme:o.String(),scanStatus:o.String({minLength:1}),versions:o.Array(ar)},{additionalProperties:!1});o.Union([o.Literal(`project`),o.Literal(`user`)]);var sr={path:o.String({minLength:1}),status:o.Union([o.Literal(`current`),o.Literal(`installed`),o.Literal(`updated`)]),version:o.String({minLength:1})};o.Object(sr,{additionalProperties:!1});var cr=o.Object({...sr,installedSkills:er},{additionalProperties:!1}),lr={effectiveEnabled:o.Boolean()};o.Object(lr,{additionalProperties:!1});var ur=o.Object({...lr,installedSkills:er},{additionalProperties:!1}),dr={enabled:o.Boolean()};o.Object(dr,{additionalProperties:!1});var fr=o.Object({...dr,servers:nr},{additionalProperties:!1}),pr=o.Object({status:o.Literal(`opened`)},{additionalProperties:!1}),mr=o.Union([o.Literal(`ON_INSTALL`),o.Literal(`ON_USE`)]),hr=o.Object({authPolicy:mr,availability:o.Union([o.Literal(`AVAILABLE`),o.Literal(`DISABLED_BY_ADMIN`)]),description:o.String(),developerName:o.Union([o.String(),o.Null()]),disabledReason:o.Union([o.String(),o.Null()]),displayName:o.String({minLength:1}),enabled:o.Boolean(),id:o.String({minLength:1}),installPolicy:o.Union([o.Literal(`NOT_AVAILABLE`),o.Literal(`AVAILABLE`),o.Literal(`INSTALLED_BY_DEFAULT`)]),installed:o.Boolean(),localVersion:o.Union([o.String(),o.Null()]),logoUrl:o.Union([o.String(),o.Null()]),marketplaceName:o.String({minLength:1}),marketplacePath:o.Union([o.String(),o.Null()]),name:o.String({minLength:1}),pluginName:o.String({minLength:1}),version:o.Union([o.String(),o.Null()])},{additionalProperties:!1}),gr=o.Object({data:o.Array(hr)},{additionalProperties:!1}),_r=o.Object({description:o.String(),name:o.String({minLength:1})},{additionalProperties:!1}),vr=o.Object({description:o.String(),id:o.String({minLength:1}),installUrl:o.Union([o.String(),o.Null()]),name:o.String({minLength:1})},{additionalProperties:!1}),yr=o.Object({...hr.properties,apps:o.Array(vr),hooks:o.Array(o.String()),mcpServers:o.Array(o.String()),skills:o.Array(_r),websiteUrl:o.Union([o.String(),o.Null()])},{additionalProperties:!1}),br=o.Object({appsNeedingAuth:o.Array(vr),authPolicy:mr},{additionalProperties:!1}),xr=o.Object({...br.properties,plugins:gr},{additionalProperties:!1});o.Object({},{additionalProperties:!1});var Sr=o.Object({plugins:gr},{additionalProperties:!1}),Cr=o.Object({changes:o.Array(Rt),id:o.String({minLength:1}),status:N,type:o.Literal(`file_change`)},{additionalProperties:!1}),wr=o.Object({id:o.String({minLength:1}),input:o.Optional(o.Unknown()),name:o.String({minLength:1}),output:o.Optional(o.Unknown()),progress:o.Optional(o.String({maxLength:8192})),status:N,type:o.Literal(`tool`)},{additionalProperties:!1}),Tr=o.Object({fasterModel:o.Optional(o.String({minLength:1})),id:o.String({minLength:1}),kind:o.Literal(`safety_buffering`),model:o.String({minLength:1}),status:N,type:o.Literal(`runtime_status`)},{additionalProperties:!1}),Er=o.Object({fromModel:o.String({minLength:1}),id:o.String({minLength:1}),kind:o.Literal(`model_rerouted`),status:o.Literal(`completed`),toModel:o.String({minLength:1}),type:o.Literal(`runtime_status`)},{additionalProperties:!1}),Dr=o.Object({detail:o.Optional(o.String({maxLength:8192})),durationMs:o.Optional(o.Integer({minimum:0})),eventName:o.String({minLength:1}),id:o.String({minLength:1}),kind:o.Literal(`hook`),status:N,type:o.Literal(`runtime_status`)},{additionalProperties:!1}),Or=o.Union([Tr,Er,Dr]),kr=o.Object({id:o.String({minLength:1}),text:o.String(),type:o.Literal(`plan`)},{additionalProperties:!1}),Ar=o.Object({detail:o.Optional(o.String()),id:o.String({minLength:1}),label:o.String({minLength:1}),status:o.Optional(N),transient:o.Optional(o.Boolean()),type:o.Literal(`activity`)},{additionalProperties:!1}),jr=o.Union([o.Literal(`in_progress`),o.Literal(`approved`),o.Literal(`denied`),o.Literal(`timed_out`),o.Literal(`aborted`)]),Mr=o.Object({detail:o.String(),type:o.Union([o.Literal(`command`),o.Literal(`file_change`),o.Literal(`network_access`),o.Literal(`mcp_tool_call`),o.Literal(`permissions`)])},{additionalProperties:!1}),Nr=o.Object({action:Mr,id:o.String({minLength:1}),rationale:o.Optional(o.String()),riskLevel:o.Optional(o.Union([o.Literal(`low`),o.Literal(`medium`),o.Literal(`high`),o.Literal(`critical`)])),status:jr,targetItemId:o.Optional(o.String({minLength:1})),type:o.Literal(`approval_review`),userAuthorization:o.Optional(o.Union([o.Literal(`unknown`),o.Literal(`low`),o.Literal(`medium`),o.Literal(`high`)]))},{additionalProperties:!1}),Pr=o.Union([o.Object({type:o.Literal(`uncommitted_changes`)},{additionalProperties:!1}),o.Object({branch:o.String({minLength:1}),type:o.Literal(`base_branch`)},{additionalProperties:!1}),o.Object({sha:o.String({minLength:1}),title:o.Optional(o.String({minLength:1})),type:o.Literal(`commit`)},{additionalProperties:!1}),o.Object({instructions:o.String({minLength:1}),type:o.Literal(`custom`)},{additionalProperties:!1})]),Fr=o.Object({id:o.String({minLength:1}),target:Pr,type:o.Literal(`review`)},{additionalProperties:!1}),Ir=o.Union([Nn,Pn,In,Cr,wr,kr,Ar,Nr,Fr,Or]),Lr=o.Union([o.Literal(`running`),o.Literal(`completed`),o.Literal(`failed`),o.Literal(`interrupted`)]),F=o.Object({completedAt:gt,error:o.Union([o.String(),o.Null()]),id:o.String({minLength:1}),itemTimings:o.Optional(o.Record(o.String(),o.Object({completedAtMs:o.Optional(o.Integer({minimum:0})),startedAtMs:o.Optional(o.Integer({minimum:0}))},{additionalProperties:!1}))),items:o.Array(Ir),startedAt:gt,status:Lr},{additionalProperties:!1}),Rr=o.Object({id:o.String({minLength:1}),kind:Dn,mediaType:En,name:o.String({maxLength:255,minLength:1}),size:o.Integer({maximum:Sn,minimum:1})},{additionalProperties:!1}),zr=o.Object({attachment:Rr},{additionalProperties:!1}),Br=o.Union([o.Literal(`user`),o.Literal(`repo`),o.Literal(`system`),o.Literal(`admin`)]),Vr=o.Object({description:o.String(),displayName:o.String({minLength:1}),id:o.String({minLength:1}),name:o.String({minLength:1}),scope:Br},{additionalProperties:!1}),Hr=o.Union([o.Literal(`notStarted`),o.Literal(`starting`),o.Literal(`connected`),o.Literal(`authenticationRequired`),o.Literal(`failed`),o.Literal(`cancelled`),o.Literal(`disabled`),o.Literal(`unknown`)]),Ur=o.Union([o.Literal(`starting`),o.Literal(`ready`),o.Literal(`failed`),o.Literal(`cancelled`)]),Wr=o.Literal(`reauthenticationRequired`),Gr=o.Object({displayName:o.String({minLength:1}),httpOrigin:o.Optional(o.String({minLength:1})),name:o.String({minLength:1}),status:Hr,toolCount:o.Integer({minimum:0})},{additionalProperties:!1}),Kr=o.Object({data:o.Array(Gr,{uniqueItems:!0})},{additionalProperties:!1}),qr=o.Object({id:o.String({minLength:1}),name:o.String({minLength:1})},{additionalProperties:!1}),Jr=o.Object({id:o.String({minLength:1})},{additionalProperties:!1}),Yr={attachments:o.Array(Jr),skills:o.Array(qr),text:o.String({maxLength:1e5}),type:o.Literal(`prompt`)},I=o.Union([o.Object({...Yr,text:o.String({maxLength:1e5,minLength:1})},{additionalProperties:!1}),o.Object({...Yr,attachments:o.Array(Jr,{minItems:1})},{additionalProperties:!1}),o.Object({...Yr,skills:o.Array(qr,{minItems:1})},{additionalProperties:!1})]),Xr=o.Union([o.Literal(`editing`),o.Literal(`queued`)]),Zr=o.Object({attachments:o.Array(An,{maxItems:Cn}),clientUserMessageId:o.String({minLength:1}),id:o.String({minLength:1}),skills:o.Array(qr),status:Xr,text:o.String({maxLength:1e5})},{additionalProperties:!1});o.Object({data:o.Array(Zr),nextCursor:o.Union([o.String({minLength:1}),o.Null()])},{additionalProperties:!1});var L=o.Object({data:o.Array(Zr)},{additionalProperties:!1}),Qr=`gpt-6-luna`,$r=o.Object({mcp_elicitations:o.Boolean(),request_permissions:o.Boolean(),rules:o.Boolean(),sandbox_approval:o.Boolean(),skill_approval:o.Boolean()},{additionalProperties:!1}),ei=o.Object({granular:$r},{additionalProperties:!1}),ti=o.Union([o.Literal(`on-request`),ei,o.Literal(`never`)]),ni=o.Union([o.Literal(`untrusted`),o.Literal(`on-request`),ei,o.Literal(`never`)]),ri=o.Union([o.Literal(`user`),o.Literal(`auto_review`)]),ii=o.Union([o.Literal(`read-only`),o.Literal(`workspace-write`),o.Literal(`danger-full-access`)]),ai={model:o.String({minLength:1}),reasoningEffort:o.String({minLength:1}),sandboxMode:ii},oi=o.Object({approvalPolicy:ni,approvalsReviewer:ri,...ai},{additionalProperties:!1}),si=o.Literal(`plan`),ci={modelContextWindow:o.Union([o.Integer({minimum:1,maximum:2**53-1}),o.Null()]),commitMessageModel:o.String({minLength:1}),commitMessagePrompt:o.String({maxLength:4e3}),defaultOpenAppId:o.Union([o.Exclude(At,o.Literal(`system-default`)),o.Null()]),fastMode:o.Boolean(),followUpBehavior:o.Union([o.Literal(`queue`),o.Literal(`steer`)]),pet:lt,...ai},li=o.Object({approvalPolicy:ti,approvalsReviewer:ri,...ci},{additionalProperties:!1}),ui=o.Object({settings:li},{additionalProperties:!1}),di=o.Object({approvalPolicy:ni,approvalsReviewer:ri,fastMode:o.Boolean(),...ai},{additionalProperties:!1}),fi=o.Object({settings:di},{additionalProperties:!1}),pi=o.Object({settings:oi},{additionalProperties:!1});o.Object({settings:oi,fastMode:o.Boolean()},{additionalProperties:!1});var mi=o.Object({settings:oi,defaults:di},{additionalProperties:!1}),hi={collaborationMode:o.Optional(si),fastMode:o.Optional(o.Literal(!0)),goalMode:o.Optional(o.Literal(!0)),...ai},gi=o.Object({approvalPolicy:ni,approvalsReviewer:ri,...hi},{additionalProperties:!1}),_i=o.Object({description:o.String(),id:o.String({minLength:1})},{additionalProperties:!1}),vi=o.Object({defaultReasoningEffort:o.String({minLength:1}),description:o.String(),displayName:o.String({minLength:1}),id:o.String({minLength:1}),inputModalities:o.Optional(o.Array(o.String({minLength:1}),{maxItems:16})),isDefault:o.Boolean(),supportedReasoningEfforts:o.Array(_i,{minItems:1})},{additionalProperties:!1}),yi=o.Object({contextWindow:o.Union([o.Integer({minimum:1}),o.Null()]),usedTokens:o.Integer({minimum:0})},{additionalProperties:!1}),bi=o.Object({type:o.Literal(`scheduled-tasks.changed`)},{additionalProperties:!1}),xi=o.Union([o.Object({atUnixMs:o.Integer(),type:o.Literal(`once`)},{additionalProperties:!1}),o.Object({rrule:o.String({maxLength:2048,minLength:1}),startAtUnixMs:o.Integer(),timezone:o.String({maxLength:128,minLength:1}),type:o.Literal(`rrule`)},{additionalProperties:!1})]);o.Object({schedule:xi},{additionalProperties:!1});var Si=o.Object({dates:o.Array(o.Integer(),{maxItems:5})},{additionalProperties:!1}),Ci=o.Union([o.Literal(`unknown`),o.Literal(`cleanup_pending`),o.Literal(`failed`),o.Literal(`running`),o.Literal(`skipped`),o.Literal(`started`)]),wi=o.Object({error:o.Union([o.String(),o.Null()]),finishedAtUnixMs:o.Union([o.Integer(),o.Null()]),id:o.String({minLength:1}),startedAtUnixMs:o.Integer(),status:Ci,taskId:o.Union([o.String({minLength:1}),o.Null()])},{additionalProperties:!1}),Ti={enabled:o.Boolean(),messageAttachments:o.Array(An),name:o.String({maxLength:120,minLength:1}),projectId:o.String({maxLength:128,minLength:1}),projectName:o.String({maxLength:256,minLength:1}),prompt:I,schedule:xi,turnOptions:gi};o.Object(Ti,{additionalProperties:!1});var Ei=o.Object({...Ti,createdAtUnixMs:o.Integer(),id:o.String({minLength:1}),lastRunAtUnixMs:o.Union([o.Integer(),o.Null()]),lastRunStatus:o.Union([Ci,o.Null()]),nextRunAtUnixMs:o.Union([o.Integer(),o.Null()]),runs:o.Array(wi,{maxItems:20}),updatedAtUnixMs:o.Integer()},{additionalProperties:!1}),Di=o.Object({data:o.Array(Ei)},{additionalProperties:!1}),Oi=o.Object({task:Ei,tasks:Di},{additionalProperties:!1}),ki=o.Object({status:o.Literal(`deleted`),taskId:o.String({minLength:1}),tasks:Di},{additionalProperties:!1});o.Object({enabled:o.Boolean()},{additionalProperties:!1});var Ai=o.Union([o.Literal(`local`),o.Literal(`lan`)]),ji=o.Object({authenticated:o.Boolean(),mode:Ai,version:o.Literal(1)},{additionalProperties:!1});o.Object({code:o.String({minLength:1})},{additionalProperties:!1});var Mi=o.Union([o.String(),o.Null()]),Ni=o.Union([o.Number(),o.Null()]),R={description:Mi,id:o.String({minLength:1}),required:o.Boolean(),title:o.String({minLength:1})},Pi=o.Object({label:o.String({minLength:1}),value:o.String()},{additionalProperties:!1}),Fi=o.Union([o.Object({...R,defaultValue:o.Union([o.String(),o.Null()]),format:o.Union([o.Literal(`email`),o.Literal(`uri`),o.Literal(`date`),o.Literal(`date-time`),o.Null()]),maxLength:o.Union([o.Integer({minimum:0}),o.Null()]),minLength:o.Union([o.Integer({minimum:0}),o.Null()]),type:o.Literal(`string`)},{additionalProperties:!1}),o.Object({...R,defaultValue:o.Union([o.String(),o.Null()]),options:o.Array(Pi,{minItems:1}),type:o.Literal(`select`)},{additionalProperties:!1}),o.Object({...R,defaultValue:o.Array(o.String()),maximum:o.Union([o.Integer({minimum:0}),o.Null()]),minimum:o.Union([o.Integer({minimum:0}),o.Null()]),options:o.Array(Pi,{minItems:1}),type:o.Literal(`multi_select`)},{additionalProperties:!1}),o.Object({...R,defaultValue:Ni,maximum:Ni,minimum:Ni,type:o.Union([o.Literal(`number`),o.Literal(`integer`)])},{additionalProperties:!1}),o.Object({...R,defaultValue:o.Union([o.Boolean(),o.Null()]),type:o.Literal(`boolean`)},{additionalProperties:!1})]),Ii=o.Record(o.String(),o.Union([o.String(),o.Number(),o.Boolean(),o.Array(o.String())])),Li=o.Union([o.Object({action:o.Literal(`accept`),content:Ii},{additionalProperties:!1}),o.Object({action:o.Union([o.Literal(`decline`),o.Literal(`cancel`)]),content:o.Null()},{additionalProperties:!1})]),Ri=o.Union([o.Literal(`pending`),o.Literal(`resolved`),o.Literal(`expired`)]),zi=o.Union([o.Literal(`allow`),o.Literal(`allow_for_session`),o.Literal(`deny`)]),Bi=o.Object({host:o.String({minLength:1}),protocol:o.Union([o.Literal(`http`),o.Literal(`https`),o.Literal(`socks5Tcp`),o.Literal(`socks5Udp`)])},{additionalProperties:!1}),z={createdAt:E,expiresAt:gt,itemId:o.String({minLength:1}),projectId:o.String({minLength:1}),requestId:o.String({minLength:1}),status:Ri,taskId:o.String({minLength:1}),turnId:o.String({minLength:1})},B={itemId:o.String({minLength:1}),projectId:o.String({minLength:1}),taskId:o.String({minLength:1}),turnId:o.String({minLength:1})},Vi=o.Object({description:o.String(),label:o.String({minLength:1})},{additionalProperties:!1}),Hi={header:o.String({minLength:1}),id:o.String({minLength:1}),isSecret:o.Boolean(),prompt:o.String({minLength:1})},Ui=o.Union([o.Object({...Hi,isOther:o.Boolean(),options:o.Array(Vi,{minItems:1}),type:o.Literal(`choice`)},{additionalProperties:!1}),o.Object({...Hi,isOther:o.Literal(!0),options:o.Array(Vi,{maxItems:0}),type:o.Literal(`choice`)},{additionalProperties:!1}),o.Object({...Hi,isOther:o.Literal(!1),options:o.Array(Vi,{maxItems:2,minItems:2}),type:o.Literal(`confirmation`)},{additionalProperties:!1}),o.Object({...Hi,isOther:o.Boolean(),options:o.Array(Vi,{maxItems:0}),type:o.Literal(`short_text`)},{additionalProperties:!1})]),Wi=o.Object({...z,availableDecisions:o.Array(zi,{minItems:1}),grantRoot:o.Union([o.String(),o.Null()]),reason:o.Union([o.String(),o.Null()]),type:o.Literal(`file_change_approval`)},{additionalProperties:!1}),Gi=o.Union([o.Literal(`network`),o.Literal(`file_system`)]),Ki=o.Union([o.Literal(`read`),o.Literal(`write`),o.Literal(`deny`)]),qi=o.Union([o.Object({type:o.Literal(`path`),value:o.String({minLength:1})},{additionalProperties:!1}),o.Object({type:o.Literal(`glob`),value:o.String({minLength:1})},{additionalProperties:!1}),o.Object({kind:o.Union([o.Literal(`root`),o.Literal(`minimal`),o.Literal(`project_roots`),o.Literal(`tmpdir`),o.Literal(`slash_tmp`),o.Literal(`unknown`)]),path:o.Union([o.String({minLength:1}),o.Null()]),subpath:o.Union([o.String(),o.Null()]),type:o.Literal(`special`)},{additionalProperties:!1})]),Ji=o.Object({entries:o.Array(o.Object({access:Ki,path:qi},{additionalProperties:!1})),globScanMaxDepth:o.Union([o.Integer({minimum:0}),o.Null()]),read:o.Union([o.Array(o.String({minLength:1})),o.Null()]),write:o.Union([o.Array(o.String({minLength:1})),o.Null()])},{additionalProperties:!1}),Yi=o.Object({fileSystem:o.Union([Ji,o.Null()]),network:o.Union([o.Object({enabled:o.Union([o.Boolean(),o.Null()])},{additionalProperties:!1}),o.Null()])},{additionalProperties:!1}),Xi=o.Object({...z,additionalPermissions:o.Optional(o.Union([Yi,o.Null()])),availableDecisions:o.Array(zi,{minItems:1}),command:o.Union([o.String(),o.Null()]),cwd:o.Union([o.String(),o.Null()]),kind:o.Union([o.Literal(`command`),o.Literal(`write_stdin`)]),networkAccess:o.Union([Bi,o.Null()]),reason:o.Union([o.String(),o.Null()]),type:o.Literal(`command_approval`)},{additionalProperties:!1}),Zi=o.Object({...z,cwd:o.String({minLength:1}),environmentId:o.Union([o.String({minLength:1}),o.Null()]),permissions:Yi,reason:o.Union([o.String(),o.Null()]),type:o.Literal(`permissions_approval`)},{additionalProperties:!1}),Qi=o.Object({...z,questions:o.Array(Ui,{minItems:1,maxItems:3}),type:o.Literal(`user_input`)},{additionalProperties:!1}),$i={...z,message:o.String({minLength:1}),serverName:o.String({minLength:1}),type:o.Literal(`mcp_elicitation`)},ea=o.Object({...$i,fields:o.Array(Fi),mode:o.Literal(`form`)},{additionalProperties:!1}),ta=o.Object({...$i,mode:o.Literal(`url`),url:o.String({minLength:1})},{additionalProperties:!1}),na=o.Object({...$i,mode:o.Literal(`unsupported`)},{additionalProperties:!1}),ra=o.Union([ea,ta,na]),ia=o.Union([Xi,Wi,Zi,Qi,ra]);function aa(e){return o.Union([o.Object({...Xi.properties,status:o.Literal(e)},{additionalProperties:!1}),o.Object({...Wi.properties,status:o.Literal(e)},{additionalProperties:!1}),o.Object({...Zi.properties,status:o.Literal(e)},{additionalProperties:!1}),o.Object({...Qi.properties,status:o.Literal(e)},{additionalProperties:!1}),o.Object({...ea.properties,status:o.Literal(e)},{additionalProperties:!1}),o.Object({...ta.properties,status:o.Literal(e)},{additionalProperties:!1}),o.Object({...na.properties,status:o.Literal(e)},{additionalProperties:!1})])}var oa=aa(`pending`),sa=aa(`resolved`),ca=aa(`expired`),la=o.Object({decision:zi},{additionalProperties:!1}),ua=o.Object({answers:o.Record(o.String(),o.Array(o.String({minLength:1}),{maxItems:1,minItems:1}))},{additionalProperties:!1}),da=o.Object({grantedPermissions:o.Array(Gi,{maxItems:2,uniqueItems:!0}),scope:o.Union([o.Literal(`turn`),o.Literal(`session`)])},{additionalProperties:!1});o.Union([o.Object({...B,resolution:la,type:o.Literal(`command_approval`)},{additionalProperties:!1}),o.Object({...B,resolution:la,type:o.Literal(`file_change_approval`)},{additionalProperties:!1}),o.Object({...B,resolution:da,type:o.Literal(`permissions_approval`)},{additionalProperties:!1}),o.Object({...B,resolution:ua,type:o.Literal(`user_input`)},{additionalProperties:!1}),o.Object({...B,resolution:Li,type:o.Literal(`mcp_elicitation`)},{additionalProperties:!1})]);var fa=o.Object({request:ia},{additionalProperties:!1}),pa=o.Union([o.Literal(`active`),o.Literal(`paused`),o.Literal(`blocked`),o.Literal(`usage_limited`),o.Literal(`budget_limited`),o.Literal(`complete`)]),ma=o.Object({createdAt:E,objective:o.String({maxLength:4e3,minLength:1}),status:pa,timeUsedSeconds:o.Integer({minimum:0}),tokenBudget:o.Union([o.Integer({minimum:0}),o.Null()]),tokensUsed:o.Integer({minimum:0}),updatedAt:E},{additionalProperties:!1});o.Object({status:o.Union([o.Literal(`active`),o.Literal(`paused`)])},{additionalProperties:!1});var ha=o.Object({goal:ma},{additionalProperties:!1}),ga=o.Object({cleared:o.Boolean()},{additionalProperties:!1}),_a=`temporary`,va=`/v1/temporary`,ya=o.Union([o.Literal(`pending`),o.Literal(`in_progress`),o.Literal(`completed`)]),ba=o.Object({status:ya,text:o.String({minLength:1})},{additionalProperties:!1}),xa=o.Object({explanation:o.Union([o.String(),o.Null()]),steps:o.Array(ba)},{additionalProperties:!1}),Sa=o.Object({contextUsage:o.Union([yi,o.Null()]),goal:o.Union([ma,o.Null()]),id:o.String({minLength:1}),plan:o.Union([xa,o.Null()]),pendingRequests:o.Array(oa),pinned:o.Boolean(),projectId:o.String({minLength:1}),settings:oi,threadConfiguration:o.Optional(hn),status:o.Union([o.Literal(`idle`),o.Literal(`running`),o.Literal(`failed`)]),title:o.String({minLength:1}),turns:o.Array(F),turnsNextCursor:o.Union([o.String({minLength:1}),o.Null()]),updatedAt:E,workspacePath:o.Optional(T)},{additionalProperties:!1});function Ca(e){return o.Object({data:o.Array(e),nextCursor:o.Union([o.String(),o.Null()])},{additionalProperties:!1})}var wa=Ca(D),Ta=wa,Ea=Ca(M),Da=Ca(vi),Oa=Ca(Vr),ka=o.Object({status:o.Literal(`ok`),version:o.Literal(1)},{additionalProperties:!1}),Aa=o.Object({feedback:o.Object({upload:o.Boolean()},{additionalProperties:!1}),goals:o.Object({clear:o.Boolean(),read:o.Boolean(),update:o.Boolean()},{additionalProperties:!1}),provider:o.String({minLength:1}),skills:o.Object({list:o.Boolean(),use:o.Boolean()},{additionalProperties:!1}),tasks:o.Object({fork:o.Boolean(),list:o.Boolean(),read:o.Boolean(),start:o.Boolean()},{additionalProperties:!1}),turns:o.Object({compact:o.Boolean(),interrupt:o.Boolean(),review:o.Boolean(),start:o.Boolean(),steer:o.Boolean()},{additionalProperties:!1})},{additionalProperties:!1}),ja=o.Union([o.Literal(`official`),o.Literal(`custom`)]),Ma=o.Union([o.Literal(`disconnected`),o.Literal(`pending`),o.Literal(`connected`),o.Literal(`failed`)]),Na=o.Union([o.Object({email:o.Union([o.String({maxLength:320}),o.Null()]),planType:o.Union([o.String({maxLength:64}),o.Null()]),type:o.Literal(`chatgpt`)},{additionalProperties:!1}),o.Object({type:o.Literal(`apiKey`)},{additionalProperties:!1})]),Pa=o.Object({error:o.Union([o.String({maxLength:1e3}),o.Null()]),loginId:o.String({maxLength:256,minLength:1}),state:o.Union([o.Literal(`pending`),o.Literal(`failed`)])},{additionalProperties:!1}),Fa=o.Object({account:o.Union([Na,o.Null()]),customBaseUrl:o.Union([o.String({maxLength:2048,minLength:1}),o.Null()]),mode:ja,pendingLogin:o.Union([Pa,o.Null()]),state:Ma},{additionalProperties:!1});o.Object({},{additionalProperties:!1});var Ia=o.Object({authUrl:o.String({maxLength:8192,minLength:1}),loginId:o.String({maxLength:256,minLength:1}),status:Fa},{additionalProperties:!1});o.Object({apiKey:o.Optional(o.String({maxLength:16384,minLength:1})),baseUrl:o.String({maxLength:2048,minLength:1}),models:o.Optional(o.Array(o.Object({id:o.String({maxLength:256,minLength:1,pattern:`.*\\S.*`}),name:o.String({maxLength:256,minLength:1,pattern:`.*\\S.*`})},{additionalProperties:!1}),{maxItems:1e3}))},{additionalProperties:!1});var La=o.Object({models:Da,status:Fa},{additionalProperties:!1});o.Object({loginId:o.String({maxLength:256,minLength:1})},{additionalProperties:!1});var Ra=o.Object({status:Fa},{additionalProperties:!1});o.Object({customBaseUrl:o.Union([o.String({maxLength:2048,minLength:1}),o.Null()]),customModels:o.Union([Da,o.Null()]),mode:ja,updatedAt:E},{additionalProperties:!1});function za(e){return e.mode===`official`&&e.state===`connected`&&e.account?.type===`chatgpt`}var Ba=o.Object({sequence:o.Integer({minimum:0}),sessionId:o.String({minLength:1})},{additionalProperties:!1}),Va={provider:o.String({minLength:1}),sequence:o.Integer({minimum:0}),sessionId:o.String({minLength:1}),taskId:o.String({minLength:1}),timestamp:E,version:o.Literal(2)};function V(e){return o.Object({...Va,...e},{additionalProperties:!1})}var Ha=V({itemId:o.String({minLength:1}),payload:o.Object({delta:o.String()},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`message.delta`)}),Ua=V({itemId:o.String({minLength:1}),payload:o.Object({delta:o.String()},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`plan.delta`)}),Wa=V({itemId:o.String({minLength:1}),payload:o.Object({message:o.String({maxLength:8192})},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`tool.progress`)}),Ga=V({payload:o.Object({code:o.Union([o.Literal(`runtime_warning`),o.Literal(`guardian_warning`),o.Literal(`strict_review_required`),o.Literal(`model_verification`),o.Literal(`hook_status`)]),level:o.Union([o.Literal(`info`),o.Literal(`warning`)]),message:o.String({maxLength:8192,minLength:1})},{additionalProperties:!1}),type:o.Literal(`task.notice`)}),Ka=V({payload:o.Object({status:o.Union([o.Literal(`idle`),o.Literal(`running`),o.Literal(`failed`)])},{additionalProperties:!1}),type:o.Literal(`task.status_updated`)}),qa=V({payload:o.Object({reason:o.Union([o.Literal(`archived`),o.Literal(`deleted`)])},{additionalProperties:!1}),type:o.Literal(`task.removed`)}),Ja=V({payload:o.Object({},{additionalProperties:!1}),type:o.Literal(`skills.changed`)}),Ya=V({payload:o.Object({},{additionalProperties:!1}),type:o.Literal(`queue.changed`)}),Xa=V({payload:o.Object({rootPath:o.String({minLength:1})},{additionalProperties:!1}),type:o.Literal(`project.git_metadata_changed`)}),Za=V({itemId:o.String({minLength:1}),payload:o.Object({delta:o.String()},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`command.output_delta`)}),Qa=V({payload:o.Object({code:o.Optional(o.Union([o.Literal(`context_window_exceeded`),o.Literal(`session_budget_exceeded`),o.Literal(`usage_limit_exceeded`),o.Literal(`rate_limit_exceeded`),o.Literal(`flex_unavailable`),o.Literal(`server_overloaded`),o.Literal(`policy_blocked`),o.Literal(`too_many_denials`),o.Literal(`connection_failed`),o.Literal(`internal_error`),o.Literal(`unauthorized`),o.Literal(`bad_request`),o.Literal(`sandbox_error`),o.Literal(`other`)])),httpStatusCode:o.Optional(o.Integer({maximum:599,minimum:100})),message:o.String({minLength:1}),willRetry:o.Boolean()},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`provider.error`)}),$a=V({payload:o.Object({},{additionalProperties:!1}),type:o.Literal(`goal.cleared`)});o.Object({pinned:o.Optional(o.Literal(!0))},{additionalProperties:!1});var eo=o.Object({data:o.Array(M,{maxItems:1e4})},{additionalProperties:!1});o.Object({rootPath:o.Optional(T),worktreePath:o.Optional(T)},{additionalProperties:!1});var to=o.Object({task:M},{additionalProperties:!1});o.Object({pinned:o.Boolean()},{additionalProperties:!1});var no=o.Object({pinnedTasks:eo,task:M},{additionalProperties:!1});o.Object({title:o.String({maxLength:200,minLength:1,pattern:`\\S`})},{additionalProperties:!1});var ro=o.Object({task:M,taskCatalog:eo},{additionalProperties:!1});o.Object({},{additionalProperties:!1});var io=o.Object({status:o.Literal(`archived`),taskId:o.String({minLength:1}),tasks:Ea},{additionalProperties:!1});o.Object({},{additionalProperties:!1});var ao=o.Object({task:M,tasks:Ea},{additionalProperties:!1});o.Object({},{additionalProperties:!1});var oo=o.Object({status:o.Literal(`deleted`),taskId:o.String({minLength:1}),tasks:Ea},{additionalProperties:!1}),so=o.Object({status:o.Union([o.Literal(`busy`),o.Literal(`notLoaded`),o.Literal(`notSubscribed`),o.Literal(`unsubscribed`)]),taskId:o.String({minLength:1})},{additionalProperties:!1});o.Object({target:_n},{additionalProperties:!1});var co=o.Object({taskId:o.String({minLength:1}),turn:F},{additionalProperties:!1});o.Object({},{additionalProperties:!1});var lo=o.Object({status:o.Literal(`compacting`),taskId:o.String({minLength:1})},{additionalProperties:!1});o.Object({lastTurnId:o.Optional(o.String({minLength:1}))},{additionalProperties:!1});var uo=o.Object({task:M},{additionalProperties:!1});o.Object({},{additionalProperties:!1});var fo=Kr;o.Object({classification:o.String({maxLength:100,minLength:1}),includeLogs:o.Boolean(),reason:o.String({maxLength:4e3,minLength:1})},{additionalProperties:!1});var po=o.Object({status:o.Literal(`sent`),taskId:o.String({minLength:1})},{additionalProperties:!1});o.Object({input:I,options:gi},{additionalProperties:!1});var mo=o.Object({checkpoint:Ba,taskId:o.String({minLength:1}),turn:F},{additionalProperties:!1});o.Object({input:I,taskId:o.String({minLength:1})},{additionalProperties:!1});var ho=o.Object({status:o.Literal(`accepted`),taskId:o.String({minLength:1}),turnId:o.String({minLength:1})},{additionalProperties:!1});o.Object({clientUserMessageId:o.String({minLength:1}),input:I},{additionalProperties:!1});var go=o.Object({queue:L,queuedSubmission:Zr},{additionalProperties:!1});o.Object({input:I,status:o.Union([o.Literal(`editing`),o.Literal(`queued`)])},{additionalProperties:!1});var _o=go,vo=o.Object({deleted:o.Boolean(),queue:L},{additionalProperties:!1});o.Object({queuedSubmissionIds:o.Array(o.String({minLength:1}),{uniqueItems:!0})},{additionalProperties:!1});var yo=o.Object({queue:L,status:o.Literal(`reordered`)},{additionalProperties:!1});o.Object({queuedSubmissionId:o.Optional(o.String({minLength:1}))},{additionalProperties:!1});var bo=o.Object({queue:L,taskId:o.String({minLength:1}),turn:F},{additionalProperties:!1});o.Object({taskId:o.String({minLength:1})},{additionalProperties:!1});var xo=o.Object({status:o.Literal(`interrupting`),taskId:o.String({minLength:1}),turnId:o.String({minLength:1})},{additionalProperties:!1}),So=o.Union([o.Literal(`PROJECT_TODO_CHANGED`),o.Literal(`PROJECT_TODO_NOT_FOUND`),o.Literal(`SUBMISSION_OUTCOME_UNKNOWN`),o.Literal(`ACCESS_DENIED`),o.Literal(`IDEMPOTENCY_KEY_REQUIRED`),o.Literal(`IDEMPOTENCY_CONFLICT`),o.Literal(`IDEMPOTENCY_CAPACITY_EXCEEDED`),o.Literal(`INVALID_REQUEST`),o.Literal(`PROJECT_NOT_FOUND`),o.Literal(`PROJECT_FILE_NOT_FOUND`),o.Literal(`PROJECT_FILE_CONFLICT`),o.Literal(`PROJECT_FILE_MUTATION_FAILED`),o.Literal(`TASK_NOT_FOUND`),o.Literal(`TURN_NOT_FOUND`),o.Literal(`TURN_NOT_RUNNING`),o.Literal(`ATTACHMENT_NOT_FOUND`),o.Literal(`PENDING_REQUEST_NOT_FOUND`),o.Literal(`PENDING_REQUEST_EXPIRED`),o.Literal(`PENDING_REQUEST_ALREADY_RESOLVED`),o.Literal(`PENDING_REQUEST_MISMATCH`),o.Literal(`PAIRING_FAILED`),o.Literal(`PAIRING_RATE_LIMITED`),o.Literal(`GIT_STATUS_CHANGED`),o.Literal(`GIT_REPOSITORY_UNAVAILABLE`),o.Literal(`GIT_PATH_UNAVAILABLE`),o.Literal(`GIT_COMMIT_FAILED`),o.Literal(`GIT_PUSH_FAILED`),o.Literal(`GIT_BRANCH_ALREADY_ACTIVE`),o.Literal(`GIT_BRANCH_ALREADY_EXISTS`),o.Literal(`GIT_BRANCH_CREATE_FAILED`),o.Literal(`GIT_BRANCH_INVALID`),o.Literal(`GIT_BRANCH_NOT_FOUND`),o.Literal(`GIT_BRANCH_SWITCH_FAILED`),o.Literal(`GIT_WORKTREE_ALREADY_ACTIVE`),o.Literal(`GIT_WORKTREE_CREATE_FAILED`),o.Literal(`GIT_WORKTREE_NOT_FOUND`),o.Literal(`GIT_MUTATION_IN_PROGRESS`),o.Literal(`GIT_REPOSITORY_READ_ONLY`),o.Literal(`COMMIT_MESSAGE_GENERATION_FAILED`),o.Literal(`UPDATE_NOT_AVAILABLE`),o.Literal(`UPDATE_CHECK_FAILED`),o.Literal(`UPDATE_INSTALL_FAILED`),o.Literal(`PET_NOT_FOUND`),o.Literal(`PET_ASSET_INVALID`),o.Literal(`PET_DOWNLOAD_FAILED`),o.Literal(`SKILL_MARKET_CONFLICT`),o.Literal(`SKILL_MARKET_FILESYSTEM`),o.Literal(`SKILL_MARKET_INCOMPATIBLE`),o.Literal(`SKILL_MARKET_INVALID_ARCHIVE`),o.Literal(`SKILL_MARKET_INVALID_RESPONSE`),o.Literal(`SKILL_MARKET_NETWORK`),o.Literal(`SKILL_MARKET_NOT_FOUND`),o.Literal(`SKILL_MARKET_RATE_LIMITED`),o.Literal(`SKILL_MARKET_UNSAFE`),o.Literal(`PROVIDER_ERROR`),o.Literal(`GLOBAL_INSTRUCTIONS_CHANGED`),o.Literal(`TEXT_FILE_CONFLICT`),o.Literal(`TEXT_FILE_UNSUPPORTED`),o.Literal(`TEXT_FILE_UNAVAILABLE`),o.Literal(`ASYNC_QUESTION_NOT_FOUND`),o.Literal(`ASYNC_QUESTION_RESOLVED`)]),H=o.Object({code:So,message:o.String({minLength:1}),retryable:o.Boolean()},{additionalProperties:!1}),Co=o.String({minLength:1}),wo=o.Integer({minimum:0}),To={originalByteLength:o.Integer({minimum:0}),truncated:o.Boolean()};function U(e){return o.Object({...Va,...e},{additionalProperties:!1})}var Eo=U({payload:o.Object({turn:F},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`turn.started`)}),Do=U({itemId:o.String({minLength:1}),payload:o.Object({delta:o.String(),field:o.Union([o.Literal(`content`),o.Literal(`summary`)]),sectionIndex:o.Optional(o.Integer({minimum:0}))},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`reasoning.delta`)}),Oo=U({itemId:o.String({minLength:1}),payload:o.Object({changes:o.Array(Rt,{maxItems:100}),...To},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`file_change.updated`)}),ko=U({payload:o.Object({error:o.Union([o.String({maxLength:8192}),o.Null()]),failureReason:o.Union([Wr,o.Null()]),name:o.String({minLength:1}),status:Ur},{additionalProperties:!1}),type:o.Literal(`mcp_server.status_updated`)}),Ao=U({payload:o.Object({},{additionalProperties:!1}),type:o.Literal(`task.metadata_changed`)}),jo=U({itemId:o.String({minLength:1}),payload:o.Object({item:Ir},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`item.completed`)}),Mo=U({itemId:o.String({minLength:1}),payload:o.Object({item:Ir},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`item.started`)}),No=U({payload:o.Object({turn:F},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`turn.completed`)}),Po=U({payload:o.Object({usage:yi},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`usage.updated`)}),Fo=U({payload:o.Object({plan:xa},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(`plan.updated`)}),Io=U({payload:o.Object({goal:ma},{additionalProperties:!1}),type:o.Literal(`goal.updated`)});function Lo(e,t){return U({itemId:o.String({minLength:1}),payload:o.Object({request:t},{additionalProperties:!1}),turnId:o.String({minLength:1}),type:o.Literal(e)})}var Ro=Lo(`pending_request.created`,oa),zo=Lo(`pending_request.resolved`,sa),Bo=Lo(`pending_request.expired`,ca),Vo=o.Union([Eo,Ha,Do,Za,Ua,Wa,Oo,Mo,jo,No,Po,Fo,Io,$a,Qa,Ga,ko,Ka,Ao,qa,Ja,Ya,Xa,Ro,zo,Bo]),Ho=o.Object({events:o.Array(Vo,{maxItems:64,minItems:1}),type:o.Literal(`events.batch`),version:o.Literal(3)},{additionalProperties:!1}),Uo=o.Object({latestSequence:wo,sessionId:Co,type:o.Literal(`connection.ready`),version:o.Literal(3)},{additionalProperties:!1}),Wo=o.Object({latestSequence:wo,reason:o.Union([o.Literal(`event_retention_exceeded`),o.Literal(`session_changed`),o.Literal(`sequence_gap`)]),sessionId:Co,type:o.Literal(`resync.required`),version:o.Literal(3)},{additionalProperties:!1}),Go=o.Union([Uo,Wo,Ho]),Ko=o.Object({checkpoint:Ba,snapshot:Sa},{additionalProperties:!1}),qo=o.Object({task:o.Union([Ko,o.Null()])},{additionalProperties:!1}),Jo=o.Object({content:o.String(),path:o.String(),overrideActive:o.Boolean()},{additionalProperties:!1});o.Object({content:o.String({maxLength:1e6}),expectedContent:o.String({maxLength:1e6})},{additionalProperties:!1});var Yo=o.Object({enabled:o.Boolean(),allowExternalContext:o.Boolean()},{additionalProperties:!1});o.Partial(Yo);var Xo=o.Object({webSearch:o.Union([o.Literal(`disabled`),o.Literal(`cached`),o.Literal(`live`)]),modelVerbosity:o.Union([o.Literal(`low`),o.Literal(`medium`),o.Literal(`high`),o.Null()])},{additionalProperties:!1}),Zo=o.Object({success:o.Boolean()},{additionalProperties:!1}),Qo=o.Object({status:o.Literal(`scheduled`)},{additionalProperties:!1}),$o=o.Object({day:o.String({pattern:`^\\d{4}-\\d{2}-\\d{2}$`}),title:o.String(),copyright:o.String()},{additionalProperties:!1}),es=o.Array($o);o.Union([o.Object({type:o.Literal(`prompt`),taskId:o.Optional(o.String({minLength:1})),input:I,options:gi},{additionalProperties:!1}),o.Object({type:o.Literal(`review`),taskId:o.Optional(o.String({minLength:1})),target:_n},{additionalProperties:!1})]);var ts=o.Object({createdTask:o.Optional(M),taskId:o.String({minLength:1}),turn:F,checkpoint:Ba},{additionalProperties:!1}),ns=o.Union([o.Object({type:o.Literal(`text`),text:o.String({maxLength:2e5})},{additionalProperties:!1}),o.Object({type:o.Literal(`skill`),skill:Vr},{additionalProperties:!1}),o.Object({type:o.Literal(`file`),file:vt},{additionalProperties:!1})]),rs=o.Object({content:o.Array(ns,{maxItems:2e3}),attachments:o.Array(An,{maxItems:32})},{additionalProperties:!1}),is=o.Object({id:o.String({minLength:1}),projectId:o.String({minLength:1}),createdAt:o.Integer({minimum:0}),updatedAt:o.Integer({minimum:0}),version:o.Integer({minimum:1}),draft:rs},{additionalProperties:!1}),as=o.Object({data:o.Array(is)},{additionalProperties:!1}),os=o.Object({todo:is,todos:as},{additionalProperties:!1});o.Object({draft:rs,expectedVersion:o.Integer({minimum:1})},{additionalProperties:!1}),o.Object({expectedVersion:o.Integer({minimum:1})},{additionalProperties:!1});var ss=o.Object({deleted:o.Boolean(),todos:as},{additionalProperties:!1}),cs=o.Object({title:o.String({minLength:1,maxLength:1e5}),options:o.Union([o.Array(o.String({maxLength:1e5}),{maxItems:100}),o.Null()])},{additionalProperties:!1}),ls=o.Object({id:o.String({minLength:1,maxLength:128}),turnId:o.String({minLength:1}),questions:o.Array(cs,{minItems:1,maxItems:100}),createdAt:o.String(),status:o.Union([o.Literal(`pending`),o.Literal(`answering`),o.Literal(`answered`),o.Literal(`dismissed`)])},{additionalProperties:!1}),us=o.Object({data:o.Array(ls)},{additionalProperties:!1});o.Object({answers:o.Array(o.String({minLength:1,maxLength:4e3}),{minItems:1,maxItems:100})},{additionalProperties:!1});var ds={checkpoint:Ba,input:I,messageId:o.String({minLength:1}),question:ls,turn:o.Union([F,o.Null()]),turnId:o.String({minLength:1})};o.Object(ds,{additionalProperties:!1});var fs=o.Object({...ds,questions:us},{additionalProperties:!1});o.Object({ids:o.Array(o.String({minLength:1,maxLength:128}),{minItems:1,maxItems:1e4,uniqueItems:!0})},{additionalProperties:!1});var ps=o.Record(o.String(),o.Union([o.String({minLength:1,maxLength:4096}),o.Null()]),{maxProperties:100});o.Object({projectIds:o.Array(o.String({minLength:1,maxLength:256}),{maxItems:100,uniqueItems:!0}),cursor:o.Optional(ps)},{additionalProperties:!1});var ms=o.Object({data:o.Array(M,{maxItems:100}),nextCursor:o.Union([ps,o.Null()])},{additionalProperties:!1}),hs=2097152,gs=o.Object({revision:o.String({pattern:`^[a-f0-9]{64}$`})},{additionalProperties:!1}),_s=o.Object({path:o.String(),content:o.String({maxLength:hs}),version:o.String({pattern:`^[a-f0-9]{64}$`}),revision:o.Optional(o.String({pattern:`^[a-f0-9]{64}$`}))},{additionalProperties:!1});o.Object({path:o.String({minLength:1,maxLength:4096}),content:o.String({maxLength:hs}),expectedVersion:o.String({pattern:`^[a-f0-9]{64}$`})},{additionalProperties:!1});var vs=o.Object({version:o.String({pattern:`^[a-f0-9]{64}$`}),revision:o.Optional(o.String({pattern:`^[a-f0-9]{64}$`}))},{additionalProperties:!1}),ys=o.Union([o.Object({type:o.Literal(`workbench.ready`)},{additionalProperties:!1}),o.Object({type:o.Literal(`project-todos.changed`),projectId:o.String({minLength:1})},{additionalProperties:!1}),o.Object({type:o.Literal(`async-questions.changed`),projectId:o.String({minLength:1}),taskId:o.String({minLength:1})},{additionalProperties:!1})]),bs=class extends Error{constructor(e,t){super(e,t),this.name=`CodexlyEventError`}};function xs(e,t,n){let r=t===`temporary`?`${va}/events`:`/v1/projects/${encodeURIComponent(t)}/events`,i=e?new URL(`${e}${r}`):new URL(r,globalThis.location.href);return i.protocol=i.protocol===`https:`?`wss:`:`ws:`,i.searchParams.set(`afterSequence`,String(n)),i.toString()}function Ss(e,t,n){return{latestSequence:t,reason:n,sessionId:e,type:`resync.required`,version:3}}function Cs(e){if(e.length>1048576)return!0;if(e.length*3<=1048576)return!1;let t=0;for(let n=0;n<e.length;n+=1){let r=e.codePointAt(n);if(r===void 0)break;if(t+=r<=127?1:r<=2047?2:r<=65535?3:4,t>1048576)return!0;r>65535&&(n+=1)}return!1}function ws(e){let t=e.reconnectDelayMs??250,n=!0,r=!0,i=e.afterSequence,a=0,o,s,l,u=t=>{e.onConnectionState?.(t)},d=(e,t)=>{let n=s;n!==void 0&&(l?.(),l=void 0,s=void 0,n.close(e,t))},f=t=>{r=!1,e.onResyncRequired(t),d(1e3,`Snapshot resync required`),u(`closed`)},p=(t,n)=>{r=!1,e.onError?.(new bs(t,n===void 0?void 0:{cause:n})),d(1002,`Invalid Agent Event frame`),u(`closed`)},m=()=>{if(!n)return;o=void 0;let d=!1,h=e.webSocketFactory(xs(e.baseUrl,e.projectId,i));s=h;let g=()=>n&&s===h,_=t=>{if(!g())return;if(typeof t.data!=`string`){p(`Codexly event frame must be text`);return}if(Cs(t.data)){f(Ss(e.sessionId,i,`event_retention_exceeded`));return}let n;try{n=JSON.parse(t.data)}catch(e){p(`Codexly event frame is not valid JSON`,e);return}if(!c(Go,n)){p(`Codexly event frame does not match the protocol schema`);return}let r=n;if(r.type===`resync.required`){f(r);return}if(r.type===`connection.ready`){if(r.sessionId!==e.sessionId||r.latestSequence<i){f(Ss(r.sessionId,r.latestSequence,`session_changed`));return}d=!0,a=0,u(`connected`);return}if(!d){p(`Codexly event arrived before connection.ready`);return}for(let t of r.events){if(t.sessionId!==e.sessionId){f(Ss(t.sessionId,t.sequence,`session_changed`));return}if(!(t.sequence<=i)){if(t.sequence!==i+1){f(Ss(t.sessionId,t.sequence,`sequence_gap`));return}if(i=t.sequence,e.onEvent(t),!g())return}}},v=()=>{n&&s===h&&e.onError?.(new bs(`Codexly event connection failed`))},y=c=>{if(s!==h)return;if(n&&c.code===1009){f(Ss(e.sessionId,i,`event_retention_exceeded`));return}if(l?.(),l=void 0,s=void 0,!n)return;if(!r){u(`closed`);return}u(`reconnecting`);let d=Math.min(t*2**a,5e3);a+=1,o=setTimeout(m,d)};l=()=>{h.removeEventListener(`message`,_),h.removeEventListener(`error`,v),h.removeEventListener(`close`,y)},h.addEventListener(`message`,_),h.addEventListener(`error`,v),h.addEventListener(`close`,y)};return u(`connecting`),m(),()=>{n&&(n=!1,r=!1,o!==void 0&&clearTimeout(o),d(1e3,`Subscription cancelled`),u(`closed`))}}var Ts=15e4,Es=class extends Error{status;constructor(e,t,n){super(n??`Codexly request failed with ${String(e)} ${t}`.trim()),this.name=`CodexlyHttpError`,this.status=e}},Ds=class extends Es{code;retryable;constructor(e,t,n){super(e,t,n.message),this.name=`CodexlyMutationError`,this.code=n.code,this.retryable=n.retryable}},Os=class extends Error{constructor(e,t){super(e,t),this.name=`CodexlyResponseError`}};function W(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!==void 0&&n.set(e,String(r));let r=n.toString();return r?`${e}?${r}`:e}function G(e){return e===`temporary`?va:`/v1/projects/${encodeURIComponent(e)}`}function K(e,t){return`${G(e)}/tasks/${encodeURIComponent(t)}`}function ks(e,t,n,r){return`${e.replace(/\/$/u,``)}${K(t,n)}/attachments/${encodeURIComponent(r)}`}function As(e,t,n,r){let i=W(`${G(t)}/files/image`,{path:n,rootPath:r});return`${e.replace(/\/$/u,``)}${i}`}function js(e,t,n,r){let i=W(`${G(t)}/files/download`,{path:n,rootPath:r===``?void 0:r});return`${e.replace(/\/$/u,``)}${i}`}function Ms(e,t,n){return`${e.replace(/\/$/u,``)}${G(t)}/attachments/${encodeURIComponent(n)}`}function Ns(e,t=``){return`${t.replace(/\/$/u,``)}/v1/pets/assets/${encodeURIComponent(e)}`}var Ps=class{baseUrl;fetchImplementation;requestTimeouts;webSocketFactory;unauthorizedListeners=new Set;constructor(e={}){this.baseUrl=e.baseUrl?.replace(/\/$/u,``)??``,this.fetchImplementation=e.fetch??globalThis.fetch.bind(globalThis),this.requestTimeouts={mutationMs:e.requestTimeouts?.mutationMs??6e4,queryMs:e.requestTimeouts?.queryMs??3e4,readMs:e.requestTimeouts?.readMs??15e3},this.webSocketFactory=e.webSocketFactory??(e=>new WebSocket(e))}async getHealth(e={}){return this.read(`/v1/health`,ka,e)}async getAppInfo(e={}){return this.read(`/v1/app-info`,Xn,e)}async getAppUpdateProgress(e={}){return this.read(`/v1/app-update/progress`,Yn,e)}async installAppUpdate(e,t={}){return this.mutation(`/v1/app-update`,{version:e},Zn,t,`POST`,Ts)}async getAccessStatus(e={}){return this.read(`/v1/access`,ji,e)}async pairAccess(e){return this.request(`/v1/access/pair`,ji,{body:JSON.stringify({code:e}),headers:{"content-type":`application/json`},method:`POST`},H,{timeoutMs:this.requestTimeouts.mutationMs})}async logoutAccess(){return this.request(`/v1/access/logout`,ji,{body:`{}`,headers:{"content-type":`application/json`},method:`POST`},H,{timeoutMs:this.requestTimeouts.mutationMs})}subscribeUnauthorized(e){return this.unauthorizedListeners.add(e),()=>this.unauthorizedListeners.delete(e)}async getCapabilities(e={}){return this.read(`/v1/capabilities`,Aa,e)}async listModels(e={}){return this.read(`/v1/models`,Da,e)}async getProviderConnection(e={}){return this.read(`/v1/provider-connection`,Fa,e)}async startOfficialProviderLogin(e={}){return this.mutation(`/v1/provider-connection/official-login`,{},Ia,e)}async cancelProviderLogin(e,t={}){return this.mutation(`/v1/provider-connection/official-login/cancel`,{loginId:e},Ra,t)}async configureCustomProvider(e,t={}){return this.mutation(`/v1/provider-connection/custom`,e,La,t,`PUT`)}async logoutProvider(e={}){return this.mutation(`/v1/provider-connection/logout`,{},Ra,e)}async getGlobalSettings(e={}){return this.read(`/v1/settings`,ui,e)}async listWorkbenchPets(e={}){return this.read(`/v1/pets`,mt,e)}async downloadWorkbenchPet(e,t={}){return this.mutation(`/v1/pets/downloads`,{petId:e},ht,t)}async updateGlobalSettings(e,t={}){return this.mutation(`/v1/settings`,e,ui,t,`PUT`)}subscribeEvents(e){return ws({...e,baseUrl:this.baseUrl,webSocketFactory:this.webSocketFactory})}mutation(e,t,n,r,i=`POST`,a=this.requestTimeouts.mutationMs){return this.request(e,n,{body:JSON.stringify(t),headers:{"content-type":`application/json`,"idempotency-key":r.idempotencyKey??l()},method:i},H,{...r.signal===void 0?{}:{signal:r.signal},timeoutMs:a})}read(e,t,n,r){return this.request(e,t,{},r,{...n.signal===void 0?{}:{signal:n.signal},timeoutMs:n.signal===void 0?this.requestTimeouts.readMs:this.requestTimeouts.queryMs})}async request(e,t,n={},r,i={}){let a=AbortSignal.timeout(i.timeoutMs??this.requestTimeouts.readMs),o=i.signal===void 0?a:AbortSignal.any([i.signal,a]),s=await this.fetchImplementation(`${this.baseUrl}${e}`,{...n,credentials:`same-origin`,headers:{accept:`application/json`,...n.headers},signal:o});if(!s.ok){if(s.status===401)for(let e of this.unauthorizedListeners)try{e()}catch{}if(r!==void 0){let e;try{e=await s.json()}catch(e){throw new Os(`Codexly error response is not valid JSON`,{cause:e})}throw c(r,e)?new Ds(s.status,s.statusText,e):new Os(`Codexly error response does not match the protocol schema`)}try{let e=await s.json();if(typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`&&e.message.length>0)throw new Es(s.status,s.statusText,e.message)}catch(e){if(e instanceof Es)throw e}throw new Es(s.status,s.statusText)}let l;try{l=await s.json()}catch(e){throw new Os(`Codexly response is not valid JSON`,{cause:e})}if(!c(t,l))throw new Os(`Codexly response does not match the protocol schema`);return l}},Fs=class extends Ps{async reconcileOfficialPlugins(e={}){return this.mutation(`/v1/plugins/official/reconcile`,{},Qn,e)}async listOfficialPlugins(e,t={}){return this.read(W(`/v1/plugins/official`,{forceRefetch:e?`true`:void 0}),gr,t)}async getOfficialPlugin(e,t,n,r={}){return this.read(W(`/v1/plugins/official/${encodeURIComponent(e)}/${encodeURIComponent(n)}`,{marketplacePath:t??void 0}),yr,r,H)}async installOfficialPlugin(e,t,n,r,i={}){return this.mutation(`/v1/plugins/official/${encodeURIComponent(e)}/${encodeURIComponent(n)}/install`,{installAttemptId:r,marketplacePath:t},xr,i)}async uninstallOfficialPlugin(e,t,n,r={}){return this.mutation(`/v1/plugins/official/${encodeURIComponent(e)}/${encodeURIComponent(t)}/uninstall`,{pluginId:n},Sr,r)}async listInstalledSkills(e={}){return this.read(`/v1/skills/installed`,er,e)}async listClawhubSkills(e,t,n,r={}){return this.read(W(`/v1/skills/market`,{cursor:t??void 0,query:e.length===0?void 0:e,sort:n}),ir,r,H)}async getClawhubSkill(e,t,n={}){return this.read(`/v1/skills/market/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,or,n,H)}async installClawhubSkill(e,t,n,r,i,a={}){return this.mutation(`/v1/skills/market/${encodeURIComponent(e)}/${encodeURIComponent(t)}/install`,{projectId:r,rootPath:i,scope:n},cr,a)}async openSkillDirectory(e,t={}){return this.mutation(`/v1/skills/open`,{path:e},pr,t)}async setSkillEnabled(e,t,n={}){return this.mutation(`/v1/skills/enabled`,{enabled:t,path:e},ur,n,`PUT`)}async listConfiguredMcpServers(e={}){return this.read(`/v1/mcp-servers/configured`,nr,e)}async setMcpServerEnabled(e,t,n={}){return this.mutation(`/v1/mcp-servers/configured/${encodeURIComponent(e)}/enabled`,{enabled:t},fr,n,`PUT`)}},Is=class extends Fs{async createTaskWorktree(e,t,n,r={}){return this.mutation(W(`${G(e)}/git/task-worktrees`,{rootPath:t}),n,nn,r)}},Ls=class extends Is{async createProjectDirectory(e,t={}){return this.mutation(`/v1/project-directories`,e,ct,t)}},Rs=class extends Ls{async readProjectTextFileRevision(e,t,n,r={}){return this.read(W(`${G(e)}/files/text/revision`,{path:n,rootPath:t}),gs,r)}async readProjectTextFile(e,t,n,r={}){return this.read(W(`${G(e)}/files/text`,{path:n,rootPath:t}),_s,r)}async saveProjectTextFile(e,t,n,r={}){return this.mutation(W(`${G(e)}/files/text`,{rootPath:t}),n,vs,r)}},zs=class extends Rs{async pushProjectCommits(e,t,n,r={}){return this.mutation(W(`${G(e)}/git/push`,{rootPath:t}),n,on,r)}},Bs=class extends zs{async listSkills(e,t={}){return this.read(`${G(e)}/skills`,Oa,t)}async listMcpServers(e,t,n={}){return this.read(`${K(e,t)}/mcp-servers`,Kr,n,H)}async retryMcpServers(e,t,n={}){return this.mutation(`${K(e,t)}/mcp-servers/retry`,{},fo,n)}async listProjects(e={}){return this.read(`/v1/projects`,wa,e)}async listProjectDirectories(e,t={}){return this.read(W(`/v1/project-directories`,{path:e,includeHidden:t.includeHidden===!0?`true`:void 0}),wt,t)}async listHostFiles(e,t,n={}){return this.read(W(`/v1/host-files`,{kind:e,path:t,includeHidden:n.includeHidden===!0?`true`:void 0}),Dt,n)}async reorderProjects(e,t={}){return this.mutation(`/v1/projects/order`,{projectIds:e},Ta,t,`PUT`)}async getProjectDefaults(e,t={}){return this.read(`${G(e)}/defaults`,fi,t)}async updateProjectDefaults(e,t,n={}){return this.mutation(`${G(e)}/defaults`,t,fi,n,`PUT`)}async addProject(e,t={}){return this.mutation(`/v1/projects`,{roots:e.map(e=>({path:e}))},kt,t)}async renameProject(e,t,n={}){return this.mutation(`${G(e)}/rename`,{name:t},It,n)}async removeProject(e,t={}){return this.mutation(`${G(e)}/remove`,{},Lt,t)}async getProjectOpenCapabilities(e,t={}){return this.read(`${G(e)}/open-capabilities`,Pt,t)}async openProject(e,t,n,r={}){return this.mutation(W(`${G(e)}/open`,{rootPath:t}),n,Ft,r)}async getProjectGitStatus(e,t,n={}){return this.read(W(`/v1/projects/${encodeURIComponent(e)}/git/status`,{includeDiff:t.includeDiff===!0?`true`:void 0,repository:t.repository,rootPath:t.rootPath}),Ut,n)}async getProjectGitHistory(e,t,n={}){return this.read(W(`${G(e)}/git/history`,{cursor:t.cursor,repository:t.repository,rootPath:t.rootPath}),Kt,n)}async getProjectGitCommitFiles(e,t,n={}){return this.read(W(`${G(e)}/git/commit-files`,{cursor:t.cursor,repository:t.repository,rootPath:t.rootPath,sha:t.sha}),Xt,n)}async getProjectGitCommitFileDiff(e,t,n={}){return this.read(W(`${G(e)}/git/commit-diff`,{path:t.path,repository:t.repository,rootPath:t.rootPath,sha:t.sha}),Zt,n)}async switchProjectBranch(e,t,n,r={}){return this.mutation(W(`${G(e)}/git/branch`,{rootPath:t}),n,Ut,r)}async createProjectBranch(e,t,n,r={}){return this.mutation(W(`${G(e)}/git/branches`,{rootPath:t}),n,Ut,r)}async listProjectWorktrees(e,t,n={}){return this.read(W(`${G(e)}/git/worktrees`,{rootPath:t}),$t,n)}async createProjectWorktree(e,t,n,r={}){return this.mutation(W(`${G(e)}/git/worktrees`,{rootPath:t}),n,tn,r)}async switchProjectWorktree(e,t,n,r={}){return this.mutation(W(`${G(e)}/git/worktree`,{rootPath:t}),n,en,r)}async generateCommitMessage(e,t,n,r={}){return this.mutation(W(`${G(e)}/git/commit-message`,{rootPath:t}),n,rn,r)}async commitProjectChanges(e,t,n,r={}){return this.mutation(W(`${G(e)}/git/commits`,{rootPath:t}),n,sn,r)}async listProjectFiles(e,t,n,r={}){let i=W(`/v1/projects/${encodeURIComponent(e)}/files/tree`,{path:n??void 0,rootPath:t});return this.read(i,ln,r)}async renameProjectFile(e,t,n,r={}){return this.mutation(W(`/v1/projects/${encodeURIComponent(e)}/files/rename`,{rootPath:t}),n,dn,r)}async deleteProjectFile(e,t,n,r={}){return this.mutation(W(`/v1/projects/${encodeURIComponent(e)}/files/delete`,{rootPath:t}),n,fn,r)}async searchProjectFiles(e,t,n,r,i={}){let a=W(`/v1/projects/${encodeURIComponent(e)}/files/search`,{query:n,rootPath:t,sessionId:r});return this.read(a,yt,i)}async stopProjectFileSearch(e,t,n,r={}){return this.mutation(`/v1/projects/${encodeURIComponent(e)}/files/search/stop`,{rootPath:t,sessionId:n},bt,r)}async readProjectSourceFile(e,t,n,r,i={}){let a=W(`${G(e)}/files/source`,{cursor:r,path:n,rootPath:t});return this.read(a,pn,i)}},Vs=class extends Bs{deleteArchivedTasks(e,t={}){return this.mutation(`${G(e)}/tasks/archived`,{},Gn,t,`DELETE`)}async archiveTask(e,t,n={}){return this.mutation(`${K(e,t)}/archive`,{},io,n)}async unarchiveTask(e,t,n={}){return this.mutation(`${K(e,t)}/unarchive`,{},ao,n)}async deleteTask(e,t,n={}){return this.mutation(K(e,t),{},oo,n,`DELETE`)}},Hs=class extends Vs{async updateTaskGoal(e,t,n,r={}){return this.mutation(`${K(e,t)}/goal`,n,ha,r,`PUT`)}async clearTaskGoal(e,t,n={}){return this.mutation(`${K(e,t)}/goal`,{},ga,n,`DELETE`)}},Us=class extends Hs{readNavigableTask(e,t,n={}){return this.read(`${K(e,t)}/navigation`,qo,n)}updateTaskSettingsAndDefaults(e,t,n,r={}){return this.mutation(`${K(e,t)}/settings-and-defaults`,n,mi,r,`PUT`)}queryCompletedTasks(e,t={}){return this.request(`/v1/tasks/completed/query`,ms,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)},void 0,{...t,timeoutMs:this.requestTimeouts.queryMs})}listTaskCatalog(e,t={},n={}){return this.read(W(`${G(e)}/tasks/catalog`,t),eo,n)}},Ws=class extends Us{async searchTasks(e,t={}){return this.read(W(`/v1/search/tasks`,e),Wn,t)}async searchTaskOccurrences(e,t,n,r,i={}){return this.read(W(`${K(e,t)}/search-occurrences`,{cursor:r,query:n}),Un,i)}},Gs=class extends Ws{submitTask(e,t,n={}){return this.mutation(`${G(e)}/submissions`,t,ts,n)}async listQueuedSubmissions(e,t,n={}){return this.read(`${K(e,t)}/queue`,L,n)}async addQueuedSubmission(e,t,n,r,i={}){return this.mutation(`${K(e,t)}/queue`,{clientUserMessageId:r,input:n},go,i)}async updateQueuedSubmission(e,t,n,r,i,a={}){return this.mutation(`${K(e,t)}/queue/${encodeURIComponent(n)}`,{input:r,status:i},_o,a,`PUT`)}async deleteQueuedSubmission(e,t,n,r={}){return this.mutation(`${K(e,t)}/queue/${encodeURIComponent(n)}`,{},vo,r,`DELETE`)}async reorderQueuedSubmissions(e,t,n,r={}){return this.mutation(`${K(e,t)}/queue/reorder`,{queuedSubmissionIds:n},yo,r,`PUT`)}async startQueuedSubmission(e,t,n,r={}){return this.mutation(`${K(e,t)}/queue/start`,{...n===void 0?{}:{queuedSubmissionId:n}},bo,r)}async listTasks(e,t={},n={}){let r=W(`${G(e)}/tasks`,t);return this.read(r,Ea,n)}async readTask(e,t,n={}){let{cursor:r,...i}=n;return this.read(W(K(e,t),{cursor:r}),Ko,i)}getTaskAttachmentUrl(e,t,n){return ks(this.baseUrl,e,t,n)}async openTaskAttachment(e,t,n,r={}){return this.mutation(`${K(e,t)}/attachments/${encodeURIComponent(n)}/open`,{},jn,r)}async listBackgroundTerminals(e,t,n={}){return this.read(`${K(e,t)}/background-terminals`,Rn,n)}async terminateBackgroundTerminal(e,t,n,r={}){return this.mutation(`${K(e,t)}/background-terminals/${encodeURIComponent(n)}/terminate`,{},zn,r)}async getTaskSettings(e,t,n={}){return this.read(`${K(e,t)}/settings`,pi,n)}async updateTaskSettings(e,t,n,r={}){return this.mutation(`${K(e,t)}/settings`,n,pi,r,`PUT`)}async startTask(e,t={}){return this.mutation(`${G(e)}/tasks`,{},to,t)}async startWorktreeTask(e,t,n={}){return this.mutation(`${G(e)}/tasks`,t,to,n)}async pinTask(e,t,n,r={}){return this.mutation(`${K(e,t)}/pin`,{pinned:n},no,r,`PUT`)}async renameTask(e,t,n,r={}){return this.mutation(`${K(e,t)}/rename`,{title:n},ro,r)}async unsubscribeTask(e,t){return this.request(`${K(e,t)}/unsubscribe`,so,{body:`{}`,headers:{"content-type":`application/json`},method:`POST`})}async startReview(e,t,n,r={}){return this.mutation(`${K(e,t)}/review`,n,co,r)}async compactTask(e,t,n={}){return this.mutation(`${K(e,t)}/compact`,{},lo,n)}async forkTask(e,t,n,r={}){return this.mutation(`${K(e,t)}/fork`,n,uo,r)}async uploadFeedback(e,t,n,r={}){return this.mutation(`${K(e,t)}/feedback`,n,po,r)}async uploadAttachment(e,t,n={}){let r=new FormData;return r.set(`attachment`,t.content,t.name),this.request(`${G(e)}/attachments/${t.kind}`,zr,{body:r,headers:{"idempotency-key":n.idempotencyKey??l()},method:`POST`},H,{...n.signal===void 0?{}:{signal:n.signal},timeoutMs:this.requestTimeouts.mutationMs})}async importHostAttachment(e,t,n,r={}){return this.mutation(`${G(e)}/attachments/${t}/host`,{path:n},zr,r)}async startTurn(e,t,n,r,i={}){return this.mutation(`${K(e,t)}/turns`,{input:n,options:r},mo,i)}async steerTurn(e,t,n,r,i={}){return this.mutation(`${K(e,t)}/turns/${encodeURIComponent(n)}/steer`,{input:r,taskId:t},ho,i)}async interruptTurn(e,t,n,r={}){return this.mutation(`${K(e,t)}/turns/${encodeURIComponent(n)}/interrupt`,{taskId:t},xo,r)}async resolvePendingRequest(e,t,n={}){let r={itemId:e.itemId,projectId:e.projectId,resolution:t,taskId:e.taskId,turnId:e.turnId,type:e.type};return this.mutation(`${K(e.projectId,e.taskId)}/pending-requests/${encodeURIComponent(e.requestId)}/resolve`,r,fa,n)}};function Ks(e,t,n,r,i){let a=e?new URL(`${e}${n}`):new URL(n,globalThis.location.href);a.protocol=a.protocol===`https:`?`wss:`:`ws:`;let o=!0,s=0,l,u,d,f=()=>{o&&(l=setTimeout(p,Math.min(3e4,500*2**Math.min(s++,6))*(.8+Math.random()*.4)))},p=()=>{if(!o)return;l=void 0;let e;try{e=t(a.toString())}catch{f();return}u=e;let n=t=>{if(!o||u!==e)return;let n;try{n=JSON.parse(String(t.data))}catch{e.close(1002,`Invalid resource change frame`);return}if(!c(r,n)){e.close(1002,`Invalid resource change frame`);return}s=0,i(n)},p=t=>{u===e&&(d?.(),u=void 0,t.code!==1008&&t.code!==1002&&f())},m=()=>{e.close()};d=()=>{e.removeEventListener(`message`,n),e.removeEventListener(`close`,p),e.removeEventListener(`error`,m)},e.addEventListener(`message`,n),e.addEventListener(`close`,p),e.addEventListener(`error`,m)};return p(),()=>{o=!1,l!==void 0&&clearTimeout(l),d?.(),u?.close(1e3,`Resource subscription closed`),u=void 0}}function qs(e,t,n){return Ks(e,t,`/v1/scheduled-tasks/events`,bi,n)}var Js=class extends Gs{previewScheduledTask(e,t={}){return this.mutation(`/v1/scheduled-tasks/preview`,{schedule:e},Si,t)}subscribeScheduledTasks(e){return qs(this.baseUrl,this.webSocketFactory,e)}listScheduledTasks(e={}){return this.read(`/v1/scheduled-tasks`,Di,e)}createScheduledTask(e,t={}){return this.mutation(`/v1/scheduled-tasks`,e,Oi,t)}updateScheduledTask(e,t,n={}){return this.mutation(`/v1/scheduled-tasks/${encodeURIComponent(e)}`,t,Oi,n,`PUT`)}deleteScheduledTask(e,t={}){return this.mutation(`/v1/scheduled-tasks/${encodeURIComponent(e)}`,{},ki,t,`DELETE`)}setScheduledTaskEnabled(e,t,n={}){return this.mutation(`/v1/scheduled-tasks/${encodeURIComponent(e)}/enabled`,{enabled:t},Oi,n,`PATCH`)}runScheduledTaskNow(e,t={}){return this.mutation(`/v1/scheduled-tasks/${encodeURIComponent(e)}/run`,{},Oi,t)}},Ys=class extends Js{compressHistory(e={}){return this.mutation(`/v1/history/compress`,{},Qo,e)}listWorkbenchBackgrounds(e={}){return this.read(`/v1/workbench-background/bing/catalog`,es,e)}getGlobalInstructions(e={}){return this.read(`/v1/personalization/instructions`,Jo,e)}saveGlobalInstructions(e,t,n={}){return this.mutation(`/v1/personalization/instructions`,{content:e,expectedContent:t},Jo,n,`PUT`)}getMemorySettings(e={}){return this.read(`/v1/personalization/memories`,Yo,e)}updateMemorySettings(e,t={}){return this.mutation(`/v1/personalization/memories`,e,Yo,t,`PUT`)}resetMemories(e={}){return this.mutation(`/v1/personalization/memories/reset`,{},Zo,e)}getAgentPreferences(e={}){return this.read(`/v1/personalization/agent`,Xo,e)}updateAgentPreferences(e,t={}){return this.mutation(`/v1/personalization/agent`,e,Xo,t,`PUT`)}},Xs=class extends Ys{subscribeWorkbenchChanges(e){return Ks(this.baseUrl,this.webSocketFactory,`/v1/workbench/events`,ys,e)}importProjectTodo(e,t,n,r={}){return this.mutation(`${G(e)}/todos/${encodeURIComponent(t)}/import`,n,os,r)}listProjectTodos(e,t={}){return this.read(`${G(e)}/todos`,as,t)}createProjectTodo(e,t,n={}){return this.mutation(`${G(e)}/todos`,t,os,n)}saveProjectTodo(e,t,n,r={}){return this.mutation(`${G(e)}/todos/${encodeURIComponent(t)}`,n,os,r,`PUT`)}deleteProjectTodo(e,t,n,r={}){return this.mutation(`${G(e)}/todos/${encodeURIComponent(t)}`,{expectedVersion:n},ss,r,`DELETE`)}},Zs=(e,t)=>`${G(e)}/tasks/${encodeURIComponent(t)}/async-questions`,Qs=class extends Xs{listAsyncQuestions(e,t,n={}){return this.read(Zs(e,t),us,n)}answerAsyncQuestion(e,t,n,r,i={}){return this.mutation(`${Zs(e,t)}/${encodeURIComponent(n)}/answer`,{answers:r},fs,i)}dismissAsyncQuestions(e,t,n,r={}){return this.mutation(`${Zs(e,t)}/dismiss`,{ids:n},us,r)}},$s=class extends Qs{},ec=1048576,tc=1e4,nc=16384,rc=256,ic=new TextDecoder,ac=new TextEncoder,oc=class{#e;#t;#n=()=>this.materialize();#r;#i;#a=0;#o=[];#s=!1;#c=0;#l=!1;#u=``;#d=-1;#f=1;#p={bytes:0,lines:0};#m=0;#h=[];#g=0;#_=0;#v=0;#y=[];#b=-1;constructor(e,t,n={}){let r=n.maxBytes??ec,i=Math.max(1,n.maxLines??tc),a=Math.ceil(i/2),o=i-a;this.#e=Math.ceil(r/2),this.#r=r-this.#e,this.#t=a,this.#i=Math.max(0,o-1),this.replace(e,t)}append(e){this.#l=!0,this.#x(ac.encode(e)),this.#v+=1}getView(){return{chunks:this.#E(),hasOutput:this.#l,materialize:this.#n,outputBytes:this.#a+this.#m,outputLines:this.#c+this.#_,outputOmitted:this.#p,startIndex:0,version:this.#v}}materialize(){if(this.#d===this.#v)return this.#u;let e=this.#E().map(e=>e.text).join(``);return this.#u=e,this.#d=this.#v,e}replace(e,t){this.#a=0,this.#o=[],this.#s=!1,this.#c=0,this.#l=e!==void 0,this.#p=t,this.#m=0,this.#h=[],this.#g=0,this.#_=0,e!==void 0&&e.length>0&&this.#x(ac.encode(e)),this.#v+=1}#x(e){let t=0;if(!this.#s){let n=sc(e,this.#e-this.#a,this.#t-this.#c);if(n>0){let t=this.#S(this.#o,e.subarray(0,n));this.#a+=t.bytes,this.#c+=t.newlines}t=n,this.#s=n<e.byteLength}if(t<e.byteLength){let n=this.#S(this.#h,e.subarray(t),this.#g);this.#m+=n.bytes,this.#_+=n.newlines,this.#T()}}#S(e,t,n=0){let r=0,i=0;for(;r<t.byteLength;){let a=r,o=0;for(;a<t.byteLength;){let e=t[a]??0,n=lc(e);if(a>r&&a+n-r>nc||(a+=n,e===10&&(o+=1,o>=rc)))break}let s=t.subarray(r,a).slice();e.push(this.#C(s,o)),i+=o,this.#w(e,n),r=a}return{bytes:t.byteLength,newlines:i}}#C(e,t,n=0){let r={byteLength:e.byteLength,encodedValue:e,id:this.#f,mergeLevel:n,newlineCount:t,text:ic.decode(e)};return this.#f+=1,r}#w(e,t){for(;e.length-t>=2;){let t=e.at(-1),n=e.at(-2);if(t===void 0||n?.mergeLevel!==t.mergeLevel||n.byteLength+t.byteLength>nc||n.newlineCount+t.newlineCount>rc)return;let r=new Uint8Array(n.byteLength+t.byteLength);r.set(n.encodedValue),r.set(t.encodedValue,n.byteLength),e.splice(-2,2,this.#C(r,n.newlineCount+t.newlineCount,n.mergeLevel+1))}}#T(){for(;this.#m>this.#r||this.#_>this.#i;){let e=this.#h[this.#g];if(e===void 0)break;let t=cc(e.encodedValue,this.#m-this.#r,this.#_-this.#i);if(this.#m-=t.bytes,this.#_-=t.newlines,this.#p={bytes:this.#p.bytes+t.bytes,lines:this.#p.lines+t.newlines},t.bytes===e.byteLength)this.#g+=1;else{let n=e.encodedValue.subarray(t.bytes).slice();this.#h[this.#g]=this.#C(n,e.newlineCount-t.newlines)}}this.#g>=128&&this.#g*2>=this.#h.length&&(this.#h=this.#h.slice(this.#g),this.#g=0)}#E(){return this.#b!==this.#v&&(this.#y=[...this.#o,...this.#h.slice(this.#g)],this.#b=this.#v),this.#y}};function sc(e,t,n){let r=0,i=0;for(;r<e.byteLength&&!(i>=n);){let a=e[r]??0,o=lc(a);if(r+o>t||a===10&&i>=n)break;r+=o,a===10&&(i+=1)}return r}function cc(e,t,n){let r=0,i=0;for(;r<e.byteLength&&(r<t||i<n);){let t=e[r]??0;r+=lc(t),t===10&&(i+=1)}return{bytes:r,newlines:i}}function lc(e){return e&128?(e&224)==192?2:(e&240)==224?3:4:1}var uc=class{#e=0;#t;#n;#r=0;#i;#a;#o=0;#s=0;constructor(e){if(!Number.isSafeInteger(e.maxBytes)||e.maxBytes<0)throw RangeError(`Project Event history maxBytes must be non-negative`);if(!Number.isSafeInteger(e.maxEvents)||e.maxEvents<0)throw RangeError(`Project Event history maxEvents must be non-negative`);this.#n=e.estimateBytes,this.#i=e.maxBytes,this.#a=e.maxEvents,this.#t=Array(e.maxEvents)}get floorSequence(){return this.#r}append(e){let t=this.#n(e);if(t>this.#i||this.#a===0){this.reset(e.sequence);return}for(this.#e===this.#a&&this.#c(),this.#t[(this.#s+this.#e)%this.#a]={event:e,retainedBytes:t},this.#e+=1,this.#o+=t;this.#o>this.#i;)this.#c()}forEachAfter(e,t){for(let n=0;n<this.#e;n+=1){let r=this.#t[(this.#s+n)%this.#a];r!==void 0&&r.event.sequence>e&&t(r.event)}}reset(e=this.#r){this.#t.fill(void 0),this.#e=0,this.#r=e,this.#o=0,this.#s=0}#c(){let e=this.#t[this.#s];e!==void 0&&(this.#t[this.#s]=void 0,this.#s=(this.#s+1)%this.#a,--this.#e,this.#o-=e.retainedBytes,this.#r=e.event.sequence)}};function dc(e){return e.type===`message.delta`||e.type===`plan.delta`||e.type===`reasoning.delta`||e.type===`command.output_delta`}var fc=`pinned`,pc=[`task-board`,`completed`],mc=3e4,hc=(e,t)=>[`projects`,e,`tasks`,t,`queue`];function gc(e,t,n,r){return{queryFn:({signal:e})=>r(e),queryKey:[`projects`,e,`archived-tasks`,n,t??null],refetchOnMount:`always`}}function _c(e,t){return{getNextPageParam:(e,t,n)=>e.nextCursor===null||e.nextCursor===n?void 0:e.nextCursor,initialPageParam:void 0,queryFn:({pageParam:e,signal:n})=>t(e,n),queryKey:[`projects`,e,`tasks`]}}function vc(e,t,n){return{gcTime:mc,queryFn:({signal:e})=>n(e),queryKey:[`projects`,e,`tasks`,t]}}function yc(e,t,n){let r=new Map(e.turns.map(e=>[e.id,e])),i=new Set(t.turns.map(e=>e.id)),a=e.turns.flatMap((e,t)=>i.has(e.id)?[t]:[]),o=a.at(0),s=a.at(-1),c=t.turnsNextCursor!==null&&o!==void 0&&s!==void 0,l=c?e.turns.slice(0,o).filter(e=>!i.has(e.id)):[],u=c?e.turns.slice(s+1).filter(e=>!i.has(e.id)):[],d=c&&t.turns.some(e=>{let t=r.get(e.id),n=e.items?.[0];return n!==void 0&&(t?.items?.length??0)>(e.items?.length??0)&&t?.items?.some(e=>e.id===n.id)});return{...t,turns:[...l,...t.turns.map(e=>{let t=r.get(e.id);return t===void 0?e:n(t,e)}),...u],turnsNextCursor:l.length>0||d?e.turnsNextCursor:t.turnsNextCursor}}function bc(e,t){let n=t.turnIds.filter(t=>e.turnsById[t]===void 0),r=new Set,i={...e.itemKeysByTurnId},a={...e.turnsById};for(let n of t.turnIds){let o=t.turnsById[n];if(o===void 0)continue;let s=e.turnsById[n],c=e.itemKeysByTurnId[n]??[],l=new Set(c);if(i[n]=[...(t.itemKeysByTurnId[n]??[]).filter(e=>!l.has(e)&&(l.add(e),r.add(e),!0)),...c],s===void 0)a[n]=o;else if(o.itemTimings!==void 0){let e={...s.itemTimings};for(let[t,n]of Object.entries(o.itemTimings))e[t]={...n,...e[t]};a[n]={...s,itemTimings:e}}}return{addedItemKeys:r,addedTurnIds:n,itemKeysByTurnId:i,turnsById:a}}var xc=class{#e;#t=new Map;#n=new Map;#r;#i;#a=0;constructor(e){if(this.#e=e,this.#r=e.maxRetainedBytes??67108864,!Number.isSafeInteger(this.#r)||this.#r<0)throw RangeError(`Task store registry maxRetainedBytes must be non-negative`);if(this.#i=e.maxRetainedStores??20,!Number.isInteger(this.#i)||this.#i<0)throw RangeError(`Task store registry maxRetainedStores must be a non-negative integer`)}acquire(e,t){let n=JSON.stringify([e,t]),r=this.#t.get(n);return r===void 0?(r={consumers:0,identity:{projectId:e,taskId:t},retainedBytes:0,store:this.#e.createStore({projectId:e,taskId:t})},this.#t.set(n,r)):r.consumers===0&&this.#s(n,r),r.consumers+=1,r.store}release(e,t){let n=JSON.stringify([e,t]),r=this.#t.get(n);return r===void 0||r.consumers===0?!1:(--r.consumers,r.consumers===0&&(r.retainedBytes=r.store.getState().retainedBytes,this.#n.set(n,r),this.#a+=r.retainedBytes,this.#o()),r.consumers===0)}get retainedBytes(){return this.#a}get size(){return this.#t.size}peek(e,t){return this.#t.get(JSON.stringify([e,t]))?.store}remove(e,t){let n=JSON.stringify([e,t]),r=this.#t.get(n);return r===void 0||r.consumers>0?!1:(this.#s(n,r),this.#t.delete(n),this.#e.onEvict?.(r.identity,r.store),!0)}#o(){for(;this.#n.size>this.#i||this.#a>this.#r;){let e=this.#n.entries().next().value;if(e===void 0)return;let[t,n]=e;this.#s(t,n),this.#t.delete(t),this.#e.onEvict?.(n.identity,n.store)}}#s(e,t){this.#n.delete(e)&&(this.#a-=t.retainedBytes,t.retainedBytes=0)}};function Sc(e,t){let n=e.pendingRequestsById[t.requestId]!==void 0,r=e.pendingRequestIds;t.status===`pending`?n||(r=[...r,t.requestId]):r=[...r.filter(e=>e!==t.requestId),t.requestId];let i={...e.pendingRequestsById,[t.requestId]:t},a=r.filter(e=>i[e]?.status!==`pending`),o=new Set(a.slice(0,-20));return o.size===0?{pendingRequestIds:r,pendingRequestsById:i}:{pendingRequestIds:r.filter(e=>!o.has(e)),pendingRequestsById:Object.fromEntries(Object.entries(i).filter(([e])=>!o.has(e)))}}function Cc(e,t){return JSON.stringify([e,t])}function wc(e,t,n){return n.taskId===e&&t!==null&&n.sessionId===t.sessionId&&n.sequence>t.sequence}function Tc(e,t,n){if(n.turnId!==void 0){if(n.type===`command.output_delta`&&n.itemId!==void 0)return[Cc(n.turnId,n.itemId)];if((n.type===`item.started`||n.type===`item.completed`)&&n.itemId!==void 0){let t=Cc(n.turnId,n.itemId);return n.payload?.item?.type===`command`||e.commandOutputBytesByItemKey.has(t)?[t]:void 0}if(n.type===`turn.started`||n.type===`turn.completed`)return[...e.itemKeysByTurnId[n.turnId]??[],...t.itemKeysByTurnId[n.turnId]??[]]}}async function Ec(e,t,n){let{projectId:r,rootPath:i}=t,a=t.existingWorktreePath;if(a===void 0){let o=t.branch.trim();if(!o)throw Error(`Git branch name is required`);let s=await e.getProjectGitStatus(r,{rootPath:i});if(s.repositoryMode!==`root`)throw Error(`Git worktree requires a repository root`);a=(await e.createTaskWorktree(r,i,{branch:o,expectedSnapshot:s.snapshot})).worktree.path,n()}try{let{task:t}=await e.startWorktreeTask(r,{rootPath:i,worktreePath:a});return{task:t,worktreePath:a}}catch(e){return{error:e,worktreePath:a}}}function Dc(e,t){return{type:`backend`,read(n,r,i){e(n===`en`?`en`:`zh-CN`).then(()=>{let e=t(n,r);i(null,typeof e==`object`&&e&&!Array.isArray(e)?e:{})},e=>{i(e instanceof Error?e:Error(String(e)),{})})}}}function Oc(e,t){let n=!1,r;return async i=>{i!==`en`||n||(r??=e().then(e=>{for(let[n,r]of Object.entries(e))t(`en`,n,r);n=!0}).finally(()=>{r=void 0}),await r)}}var kc={moreRemoteActions:`更多远端操作`,fetchShort:`获取更新`,checkConnectionShort:`检查连接`,branchShort:`新建分支`,refreshShort:`刷新`,detailsShort:`详情`,remoteInfo:`远端信息`,pushDestination:`推送目标`,currentBranch:`当前分支`,lastCommit:`最近提交`,pullRemote:`拉取更新`,pullNeedsCommit:`提交当前变更后再拉取更新`,remoteReady:`可推送本地提交`,remoteUnknown:`状态尚未确认`,mergePending:`Git 操作尚未完成`,externalGitRequired:`需在外部 Git 工具处理`,gitOperationHelp:`Git 操作说明`,aheadShort:`待推送 {{count}}`,behindShort:`待拉取 {{count}}`,mergeExternalHelp:`请在外部 Git 工具处理当前合并,然后刷新状态。`,divergedExternalHelp:`本地与远端已有不同提交,请在外部 Git 工具整合后刷新状态。`,publishHelp:`将当前分支发布到所选远端,并建立跟踪关系。`,featureBranchHelp:`新分支会保留已有提交,创建后可发布到远端。`,branchFailedHelp:`未能创建分支,请检查分支名称后重试。`,publishFailedHelp:`分支尚未发布,请检查远端连接或权限后重试。`,remoteInfoHelp:`状态基于已获取的远端信息。获取更新后可查看最新状态。`,fetchRemoteHint:`获取远端更新,不改动工作文件`,localCommitSafe:`提交已保存到本地。`,operationDetails:`操作详情`,technicalDetails:`技术详情`,close:`关闭`,loadMore:`加载更多文件`,selectFiltered:`选择筛选结果中的文件`,createFeatureBranch:`创建功能分支`,branchName:`分支名称`,checkConnection:`检查远端连接`,cancel:`取消`,undoGeneration:`撤销生成`,draftSaved:`草稿自动保存`,partialStaged:`部分暂存文件仅提交已暂存内容`,selectedFiles:`本次提交:已选择 {{selected}} / {{total}} 个文件`,selectLoaded:`选择已加载文件`,clearSelection:`取消选择`,selectFilesHint:`请先选择本次提交的文件`,localOnly:`仅保存到本地;提交后可推送`,viewDetails:`查看详情`,remoteStatus:`远端状态`,detachedHead:`未处于分支`,pushPreservesChanges:`推送已有提交,保留未提交变更`,commitFailed:`提交未完成`,commitFailedHelp:`提交信息和文件选择已保留。请检查详情并重试提交。`,generateFailed:`AI 生成未完成`,generateFailedHelp:`当前提交信息已保留,请稍后重新生成。`,statusFailed:`暂时无法读取 Git 状态`,statusFailedHelp:`请检查项目目录是否可用,然后刷新状态。`,remoteSaveFailed:`未能保存远端配置,请检查名称和地址后重试。`,failure_state_changed:`本地提交或分支已更新`,fix_state_changed:`本次操作未执行,已有提交仍保留。请刷新状态并确认当前分支后重试。`,failure_working_changes:`请先处理未提交的变更`,fix_working_changes:`先提交或保存当前变更,再整合远端更新。`,failure_merge_conflicts:`合并尚未完成`,fix_merge_conflicts:`请在外部 Git 工具完成或取消当前合并,然后刷新状态。`,failure_invalid_remote:`远端配置无效`,fix_invalid_remote:`请输入有效的远端名称和仓库地址,然后重新保存。`,failure_authentication:`无法验证远端身份`,failure_permission:`当前身份没有仓库写入权限`,failure_remote_updates:`远端包含尚未整合的提交`,failure_protected_branch:`远端分支规则拒绝本次推送`,failure_network:`暂时无法连接远端`,failure_host_key:`远端 SSH 主机身份验证未通过`,failure_rules:`远端检查未通过`,failure_unknown_result:`连接中断,需要确认远端结果`,failure_unknown:`推送未完成`,fix_authentication:`检查凭据或 SSH 密钥,然后重试。凭据配置在运行 Git 的主机上生效。`,fix_permission:`检查仓库权限和当前 Git 身份,或选择有写权限的远端。`,fix_remote_updates:`先获取远端更新,查看并整合后继续推送。`,fix_protected_branch:`将提交推送到功能分支,再通过 Pull Request 合入。`,fix_network:`检查运行 Git 的主机网络连接,然后重试。`,fix_host_key:`在运行 Git 的主机核对远端指纹并配置 SSH 信任。`,fix_rules:`展开详情查看仓库检查结果,处理后重试。`,fix_unknown_result:`先检查远端是否已包含本地提交,避免重复操作。`,fix_unknown:`展开详情查看原因;本地提交与未提交变更均已保留。`,operationFailed:`操作未完成,草稿已保留`,publishBranch:`发布分支`,configureRemote:`配置远端`,inspectRemote:`检查远端状态`,refreshGitStatus:`刷新状态`,fetchRemote:`获取远端更新`,fetchingRemote:`获取更新中…`,inspectingRemote:`检查状态中…`,configuringRemote:`保存配置中…`,publishingBranch:`发布分支中…`,integratingRemote:`整合更新中…`,creatingFeatureBranch:`创建分支中…`,integrateRemote:`整合远端更新`,remoteUrl:`远端地址`,remoteName:`远端名称`,saveRemote:`保存远端`,synced:`已同步`,ahead:`待推送 {{count}} 个提交`,behind:`远端有 {{count}} 个新提交`,diverged:`本地与远端都有更新`,noRemote:`仓库尚未连接远端`,unpublished:`此分支尚未发布到远端`,lastChecked:`本地状态检查:{{time}}`,awaitingCheck:`正在读取远端配置…`,changes:`变更`,searchFiles:`搜索文件`,noMatchingFiles:`没有匹配的文件`,generationStale:`生成期间变更范围已更新,请重新生成。`},Ac={moreRemoteActions:`More remote actions`,fetchShort:`Fetch updates`,checkConnectionShort:`Check connection`,branchShort:`New branch`,refreshShort:`Refresh`,detailsShort:`Details`,remoteInfo:`Remote information`,pushDestination:`Push destination`,currentBranch:`Current branch`,lastCommit:`Latest commit`,pullRemote:`Pull updates`,pullNeedsCommit:`Commit your working changes before pulling updates`,remoteReady:`Ready to push local commits`,remoteUnknown:`Status not confirmed`,mergePending:`Git operation incomplete`,externalGitRequired:`Use an external Git tool`,gitOperationHelp:`Git operation guidance`,aheadShort:`{{count}} to push`,behindShort:`{{count}} incoming`,mergeExternalHelp:`Handle the current merge in an external Git tool, then refresh the status.`,divergedExternalHelp:`Local and remote histories have diverged. Integrate them in an external Git tool, then refresh the status.`,publishHelp:`Publish this branch to the selected remote and set up tracking.`,featureBranchHelp:`Keep existing commits on a new branch, then publish it.`,branchFailedHelp:`Could not create the branch. Check its name and retry.`,publishFailedHelp:`The branch was not published. Check the remote connection or access, then retry.`,remoteInfoHelp:`Status uses cached remote information. Fetch updates to check the latest state.`,fetchRemoteHint:`Fetch remote updates without changing working files`,localCommitSafe:`Your commit is saved locally.`,operationDetails:`Operation details`,technicalDetails:`Technical details`,close:`Close`,loadMore:`Load more files`,selectFiltered:`Select filtered files`,createFeatureBranch:`Create feature branch`,branchName:`Branch name`,checkConnection:`Check remote connection`,cancel:`Cancel`,undoGeneration:`Undo generation`,draftSaved:`Draft saved automatically`,partialStaged:`Partially staged files include staged changes only`,selectedFiles:`This commit: {{selected}} / {{total}} files selected`,selectLoaded:`Select loaded files`,clearSelection:`Clear selection`,selectFilesHint:`Select files for this commit`,localOnly:`Save locally; push when ready`,viewDetails:`View details`,remoteStatus:`Remote status`,detachedHead:`Detached HEAD`,pushPreservesChanges:`Push existing commits and preserve working changes`,commitFailed:`Commit incomplete`,commitFailedHelp:`Your message and file selection are preserved. Check the details and retry the commit.`,generateFailed:`AI generation incomplete`,generateFailedHelp:`Your current message is preserved. Try generating again shortly.`,statusFailed:`Could not read Git status`,statusFailedHelp:`Check that the project directory is available, then refresh the status.`,remoteSaveFailed:`Could not save the remote. Check its name and URL, then retry.`,failure_state_changed:`Local commits or branch have changed`,fix_state_changed:`This operation was not run. Your commits are preserved. Refresh the status, confirm the current branch, and retry.`,failure_working_changes:`Handle your uncommitted changes first`,fix_working_changes:`Commit or save your working changes before integrating remote updates.`,failure_merge_conflicts:`Merge incomplete`,fix_merge_conflicts:`Complete or cancel the current merge in an external Git tool, then refresh the status.`,failure_invalid_remote:`Invalid remote configuration`,fix_invalid_remote:`Enter a valid remote name and repository URL, then save again.`,failure_authentication:`Could not authenticate with the remote`,failure_permission:`The current identity has no write access`,failure_remote_updates:`The remote contains new commits`,failure_protected_branch:`Remote branch rules rejected the push`,failure_network:`Could not connect to the remote`,failure_host_key:`SSH host identity verification failed`,failure_rules:`Remote checks failed`,failure_unknown_result:`Connection interrupted; check the remote result`,failure_unknown:`Push incomplete`,fix_authentication:`Check credentials or SSH keys on the host running Git, then retry.`,fix_permission:`Check repository access and Git identity, or choose a writable remote.`,fix_remote_updates:`Fetch, review and integrate remote updates before pushing.`,fix_protected_branch:`Push to a feature branch and open a pull request.`,fix_network:`Check the network on the host running Git, then retry.`,fix_host_key:`Verify the remote fingerprint and SSH trust on the Git host.`,fix_rules:`View the remote check details, address them and retry.`,fix_unknown_result:`Check whether the remote already contains your commits first.`,fix_unknown:`View details. Local commits and working changes are preserved.`,operationFailed:`Operation incomplete; your draft is preserved`,publishBranch:`Publish branch`,configureRemote:`Configure remote`,inspectRemote:`Check remote status`,refreshGitStatus:`Refresh status`,fetchRemote:`Fetch remote updates`,fetchingRemote:`Fetching updates…`,inspectingRemote:`Checking status…`,configuringRemote:`Saving configuration…`,publishingBranch:`Publishing branch…`,integratingRemote:`Integrating updates…`,creatingFeatureBranch:`Creating branch…`,integrateRemote:`Integrate remote updates`,remoteUrl:`Remote URL`,remoteName:`Remote name`,saveRemote:`Save remote`,synced:`Up to date`,ahead:`{{count}} commits to push`,behind:`{{count}} incoming commits`,diverged:`Local and remote both have updates`,noRemote:`No remote configured`,unpublished:`Branch not published`,lastChecked:`Local status checked: {{time}}`,awaitingCheck:`Reading remote configuration…`,changes:`Changes`,searchFiles:`Search files`,noMatchingFiles:`No matching files`,generationStale:`Changes updated during generation. Generate again.`},jc={moreGitActions:`更多 Git 操作`,pushExistingCommits:`推送已有提交`,commitAndPushDescription:`保存所选变更,并推送本地提交`,pushExistingDescription:`只推送本地提交,保留未提交变更`,committing:`提交中…`,committingAndPushing:`提交并推送中…`,generatingMessage:`生成中…`,pushAgain:`重试推送`,pushed:`已推送`,emptyWorkingTree:`暂无未提交变更`,emptyWorkingTreeDescription:`已保存的本地提交仍可推送到远端。`,savedLocally:`已保存到本地,尚未推送`,pushedToRemote:`已推送到远端`,savedButPushFailed:`提交已保存,推送未完成`},Mc={moreGitActions:`More Git actions`,pushExistingCommits:`Push existing commits`,commitAndPushDescription:`Save selected changes and push local commits`,pushExistingDescription:`Push local commits without committing working changes`,committing:`Committing…`,committingAndPushing:`Committing and pushing…`,generatingMessage:`Generating…`,pushAgain:`Retry push`,pushed:`Pushed`,emptyWorkingTree:`No uncommitted changes`,emptyWorkingTreeDescription:`Saved local commits can still be pushed to the remote.`,savedLocally:`Saved locally, not pushed yet`,pushedToRemote:`Pushed to the remote`,savedButPushFailed:`Commit saved, push incomplete`};function Nc(e){return{commit:e(`commit.commit`),commitAndPush:e(`commit.commitAndPush`),push:e(`commit.push`),pushing:e(`commit.pushing`),pushFailed:e(`commit.pushFailed`),pushUpstreamMissing:e(`commit.pushUpstreamMissing`),moreGitActions:e(`commit.moreGitActions`),pushExistingCommits:e(`commit.pushExistingCommits`),commitAndPushDescription:e(`commit.commitAndPushDescription`),pushExistingDescription:e(`commit.pushExistingDescription`),committing:e(`commit.committing`),committingAndPushing:e(`commit.committingAndPushing`),generatingMessage:e(`commit.generatingMessage`),pushAgain:e(`commit.pushAgain`),pushed:e(`commit.pushed`),emptyWorkingTree:e(`commit.emptyWorkingTree`),emptyWorkingTreeDescription:e(`commit.emptyWorkingTreeDescription`),savedLocally:e(`commit.savedLocally`),pushedToRemote:e(`commit.pushedToRemote`),savedButPushFailed:e(`commit.savedButPushFailed`)}}function Pc(e,t,n){let r=[`projects`,e,t,`git-remote`];return{onMutate:()=>n.cancelQueries({queryKey:r}),onSettled:()=>n.invalidateQueries({queryKey:r,refetchType:`none`})}}function Fc(e,t){return t.pushStatus===`checked`&&t.remoteState!==void 0&&(e===`state_changed`||t.remoteState.ahead===0&&t.remoteState.behind===0)}var Ic={push:`推送`,pushing:`推送中…`,pushSucceeded:`推送成功`,pushFailed:`推送失败`,pushUpstreamMissing:`当前分支未配置上游,请先配置远端跟踪分支`},Lc={push:`Push`,pushing:`Pushing…`,pushSucceeded:`Push succeeded`,pushFailed:`Push failed`,pushUpstreamMissing:`No upstream is configured for this branch. Configure a remote tracking branch first.`};function Rc(e,t,n){return{meta:{actionNotification:!1},mutationFn:async r=>{if(![`push`,`publish`,`fetch`].includes(r.action??``))return n.pushProjectCommits(e,t,r);let i=await n.pushProjectCommits(e,t,{action:`inspect`,expectedSnapshot:r.expectedSnapshot,...r.repository===void 0?{}:{repository:r.repository}});if(r.expectedBranch!==void 0&&i.branch!==r.expectedBranch||r.expectedHead!==void 0&&i.remoteState?.head!==r.expectedHead)throw Error(`Git HEAD or branch changed; check the remote status and retry`);return n.pushProjectCommits(e,t,{...r,...i.remoteState?.head&&i.branch?{expectedHead:i.remoteState.head,expectedBranch:i.branch}:{}})},mutationKey:[`projects`,e,t,`git`,`push`],scope:{id:`project-git-mutation:${e}:${t}`}}}function zc(e,t,n,r,i,a=!1){return{queryKey:[`projects`,e,t,`git-remote`,n,r],enabled:!a,queryFn:()=>i.pushProjectCommits(e,t,{action:`inspect`,expectedSnapshot:r}),staleTime:15e3,gcTime:3e4,retry:!1,refetchOnWindowFocus:!1}}var Bc={saved:`文件已保存`,loadError:`暂时无法加载编辑器,当前以只读方式显示。你仍可查看和复制内容,请检查连接后重试编辑。`,saveError:`自动保存失败,修改已保留。再次离开编辑区域或按 ⌘/Ctrl+S 重试。`,conflict:`文件已被其他程序修改,自动保存失败。当前草稿已保留,请复制当前修改,并与磁盘内容核对后处理冲突。`,inputLimit:`本次输入会使文件超过 2 MiB,因此未应用。原有内容未变,你仍可继续编辑;请减少粘贴内容或先删除部分文字。`,capacity:`为保护已有未保存内容,暂时无法打开更多文件进行编辑。当前文件以只读方式显示,仍可查看和复制。请先保存或处理其他文件的草稿,或关闭已保存的编辑文件,再重试编辑。`,unsupported:`当前仅支持不超过 2 MiB 的 UTF-8 文本。此文件暂时以只读方式显示,你仍可查看和复制内容。`,plainText:`文件较大,为保持编辑流畅,已暂停语法高亮。你仍可正常编辑和保存;减少内容后会自动恢复高亮。`,retryEdit:`重试编辑`,retrySave:`重试保存`,retrying:`正在重试…`,dismiss:`知道了`},Vc={saved:`saved`,loadError:`The editor could not load. This file is shown read-only, so you can still view and copy it. Check your connection and retry editing.`,saveError:`Auto-save failed. Your edits are retained. Leave the editor again or press ⌘/Ctrl+S to retry.`,conflict:`Another program changed this file. Auto-save failed and your draft is retained. Copy your edits and compare them with the file on disk to resolve the conflict.`,inputLimit:`This input would make the file exceed 2 MiB, so it was not applied. Your existing content is unchanged and you can keep editing. Paste less text or remove some content first.`,capacity:`To protect your unsaved edits, no more files can be opened for editing right now. This file is read-only; you can still view and copy it. Save or resolve other drafts, or close saved editors, then retry editing.`,unsupported:`Editing currently supports UTF-8 text files up to 2 MiB. This file is shown read-only, so you can still view and copy its contents.`,plainText:`Syntax highlighting is paused to keep this large file responsive. You can still edit and save normally. Highlighting returns automatically when the content is smaller.`,retryEdit:`Retry editing`,retrySave:`Retry saving`,retrying:`Retrying…`,dismiss:`Got it`},Hc={chooseLayout:`Split layout`,twoPanes:`Two panes`,threePanes:`Three panes`,fourPanes:`Four panes`,auto:`Auto fit`,horizontal:`Columns`,vertical:`Rows`,"main-left":`Main on left`,"main-top":`Main on top`,grid:`2 × 2 grid`,presetHint:`Keep this chat; open new chats in the other panes.`,autoHint:`Choose a layout based on the current center area size`,label:`Split chats`,add:`Add to split view`,added:`Already in split view`,limit:`Maximum 4 tasks`,close:`Close this pane`,solo:`Show only this task`,expandComposer:`Expand composer`,collapseComposer:`Collapse composer`,up:`Split up`,down:`Split down`,left:`Split left`,right:`Split right`,resizeWidth:`Resize split pane width`,resizeHeight:`Resize split pane height`},Uc={chooseLayout:`分屏布局`,twoPanes:`双分屏`,threePanes:`三分屏`,fourPanes:`四分屏`,auto:`自适应`,horizontal:`左右横排`,vertical:`上下竖排`,"main-left":`左主右辅`,"main-top":`上主下辅`,grid:`田字四格`,presetHint:`保留当前会话,其余窗口打开新建页`,autoHint:`按当前中栏尺寸选择合适布局`,label:`分屏聊天`,add:`添加到分屏`,added:`已在分屏中`,limit:`最多打开 4 个任务`,close:`关闭此分屏`,solo:`仅显示此任务`,expandComposer:`展开输入框`,collapseComposer:`收起输入框`,up:`向上分屏`,down:`向下分屏`,left:`向左分屏`,right:`向右分屏`,resizeWidth:`调整分屏宽度`,resizeHeight:`调整分屏高度`};function Wc(e){return e?.repositoryMode===`root`}var q=e(n(),1),J=r(),Gc=new TextEncoder,Kc=32,qc=8,Jc=48,Yc=16,Xc=16;function Zc(e){return Gc.encode(e).byteLength}function Qc(e){let t=new WeakSet;function n(e){if(e==null)return 8;if(typeof e==`string`)return Xc+Zc(e);if(typeof e==`number`||typeof e==`bigint`)return 8;if(typeof e==`boolean`)return 4;if(typeof e==`symbol`||typeof e==`function`)return 16;if(t.has(e))return 0;if(t.add(e),Array.isArray(e)){let t=Kc+e.length*qc;for(let r of e)t+=n(r);return t}let r=Jc;for(let[t,i]of Object.entries(e))r+=Yc+Zc(t)+n(i);return r}return n(e)}var $c=class{#e=new Map;#t;#n;#r;#i;#a=0;constructor(e){if(!Number.isSafeInteger(e.maxBytes)||e.maxBytes<0)throw RangeError(`Byte LRU maxBytes must be a non-negative safe integer`);let t=e.maxEntries??2**53-1;if(!Number.isSafeInteger(t)||t<0)throw RangeError(`Byte LRU maxEntries must be a non-negative safe integer`);this.#t=e.getRetainedBytes,this.#n=e.maxBytes,this.#r=t,this.#i=e.onEvict}get retainedBytes(){return this.#a}get size(){return this.#e.size}delete(e){let t=this.#e.get(e);return t!==void 0&&(this.#e.delete(e),this.#a-=t.retainedBytes,!0)}get(e){let t=this.#e.get(e);if(t!==void 0)return this.#e.delete(e),this.#e.set(e,t),t.value}peek(e){return this.#e.get(e)?.value}set(e,t){let n=this.#t(e,t);if(!Number.isSafeInteger(n)||n<0)throw RangeError(`Byte LRU entry size must be a non-negative safe integer`);let r=this.#e.get(e);return r!==void 0&&(this.#e.delete(e),this.#a-=r.retainedBytes,this.#i?.(e,r.value,`replaced`)),n>this.#n||this.#r===0?!1:(this.#e.set(e,{retainedBytes:n,value:t}),this.#a+=n,this.#o(),this.#e.has(e))}#o(){for(;this.#e.size>this.#r||this.#a>this.#n;){let e=this.#e.entries().next().value;if(e===void 0)return;let[t,n]=e;this.#e.delete(t),this.#a-=n.retainedBytes,this.#i?.(t,n.value,this.#e.size>=this.#r?`entries`:`bytes`)}}};function el(e){let t=typeof document>`u`?void 0:document,n,r=()=>{n?.(),t?.removeEventListener(`visibilitychange`,i)},i=()=>{n?.();let i=!1,a=()=>{i||(r(),e())},o=t?.visibilityState===`hidden`,s=o?setTimeout(a,16):requestAnimationFrame(a);n=()=>{i=!0,o?clearTimeout(s):cancelAnimationFrame(s)}};return t?.addEventListener(`visibilitychange`,i),i(),r}var tl=/^cannot delete thread [^\s:]+: forked history still references it$/u;function nl(e){let t=e instanceof Error?e.message:e;return typeof t==`string`&&tl.test(t.trim())}var rl=te({extend:{theme:{text:[`caption`,`meta`,`label`,`body-small`,`body`,`heading`,`title`,`display`]}}});function Y(...e){return rl(y(e))}var il=b(`inline-flex shrink-0 touch-manipulation items-center gap-1.5 whitespace-nowrap rounded-control text-body-small outline-none transition-colors active:brightness-90 focus-visible:shadow-focus disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{defaultVariants:{contentAlign:`center`,size:`default`,variant:`default`},variants:{contentAlign:{center:`justify-center`,start:`justify-start text-left`},size:{compact:`h-8 px-3 text-label`,default:`h-8 px-3`,embedded:`h-auto p-0`,sm:`h-7 px-2 text-label`,toolbar:`h-6 px-2 text-label [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 px-4 text-body`,icon:`inline-grid size-9 place-items-center px-0`,"icon-compact":`inline-grid size-8 place-items-center px-0`,"icon-sm":`inline-grid size-7 place-items-center px-0 [&_svg:not([class*='size-'])]:size-3.5`,"icon-toolbar":`inline-grid size-6 place-items-center px-0 [&_svg:not([class*='size-'])]:size-3`,"icon-lg":`inline-grid size-10 place-items-center px-0`},variant:{default:`bg-brand font-medium text-white hover:bg-brand-strong`,destructive:`bg-danger font-medium text-white hover:opacity-90`,embedded:`rounded-none bg-transparent text-inherit hover:bg-transparent hover:text-inherit focus-visible:shadow-none`,ghost:`bg-transparent text-muted-foreground hover:bg-control-hover hover:text-foreground`,inverse:`rounded-pill bg-foreground text-raised hover:bg-brand-strong disabled:bg-control-active disabled:text-muted-foreground`,link:`h-auto px-0 text-brand underline-offset-4 hover:text-brand-strong hover:underline [&_svg:not([class*='size-'])]:size-3.5`,outline:`border border-separator-strong bg-panel text-foreground hover:bg-control-hover hover:text-foreground`,secondary:`bg-raised text-foreground shadow-sm hover:bg-control-hover`}}});function X({asChild:e=!1,className:t,contentAlign:n=`center`,size:r=`default`,variant:i=`default`,...a}){return(0,J.jsx)(e?We:`button`,{className:Y(il({className:t,contentAlign:n,size:r,variant:i})),"data-content-align":n,"data-size":r,"data-slot":`button`,"data-variant":i,...a})}function al(e){let[t,n,r,i]=e;return t===void 0||n===void 0?t:r===void 0?{axis:`horizontal`,first:t,second:n}:{axis:`horizontal`,first:i===void 0?t:{axis:`vertical`,first:t,second:r},second:{axis:`vertical`,first:n,second:i??r}}}function ol(e,t,n,r){if(typeof e==`string`){if(e!==t)return e;let i=r===`left`||r===`up`;return{axis:r===`left`||r===`right`?`horizontal`:`vertical`,first:i?n:t,second:i?t:n}}let i=ol(e.first,t,n,r),a=ol(e.second,t,n,r);return i===e.first&&a===e.second?e:{...e,first:i,second:a}}function Z(e,t){if(e===void 0)return;if(typeof e==`string`)return t(e);let n=Z(e.first,t),r=Z(e.second,t);return n===void 0?r:r===void 0?n:n===e.first&&r===e.second?e:{...e,first:n,second:r}}var sl=.1,cl=.9;function ll(e,t,n){if(typeof e==`string`||!Number.isFinite(n))return e;if(t===``){let t=Math.min(cl,Math.max(sl,n));return t===(e.ratio??.5)?e:{...e,ratio:t}}let r=t.startsWith(`0`)?`first`:t.startsWith(`1`)?`second`:void 0;if(r===void 0)return e;let i=ll(e[r],t.slice(1),n);return i===e[r]?e:{...e,[r]:i}}function ul(e,t,n){let r=(e,i,a)=>{if(typeof e==`string`){t(e,i);return}let o=e.ratio??.5;if(n({...i,path:a,axis:e.axis,ratio:o}),e.axis===`horizontal`){let t=i.width*o;r(e.first,{...i,width:t},`${a}0`),r(e.second,{...i,x:i.x+t,width:i.width-t},`${a}1`)}else{let t=i.height*o;r(e.first,{...i,height:t},`${a}0`),r(e.second,{...i,y:i.y+t,height:i.height-t},`${a}1`)}};r(e,{x:0,y:0,width:8,height:8},``)}function dl(e){let t=new Map;return ul(e,(e,n)=>t.set(e,n),()=>void 0),t}function fl(e){let t=[];return ul(e,()=>void 0,e=>t.push(e)),t}function pl(e,t){if(!(e.defaultPrevented||e.isComposing||e.repeat||e.shiftKey||!e.altKey)&&!(t?!e.metaKey||e.ctrlKey:!e.ctrlKey||e.metaKey))switch(e.key){case`ArrowUp`:return`up`;case`ArrowDown`:return`down`;case`ArrowLeft`:return`left`;case`ArrowRight`:return`right`;default:return}}var ml=`route-draft`;function Q(e){return e.taskId===void 0?JSON.stringify([e.projectId,null,e.draftId]):JSON.stringify([e.projectId,e.taskId])}function hl(e,t){return e?.enabled?e.panes.some(e=>Q(e)===Q(t))?`added`:e.panes.length>=4?`limit`:`add`:null}function gl(e,t){let n=Q(t);return e.length>=4||e.some(e=>Q(e)===n)?e:[...e,t]}function _l(e,t){return e.length<=1?e:e.filter(e=>Q(e)!==Q(t))}function vl(e,t,n){if(Q(t)===Q(n)||!e.some(e=>Q(e)===Q(t)))return e;let r=e.some(e=>Q(e)===Q(n));return e.flatMap(e=>Q(e)===Q(t)?r?[]:[n]:[e])}function yl(e,t){let n=Q(t);if(e.activeKey===n)return e;if(e.panes.some(e=>Q(e)===n))return{...e,activeKey:n};let r=e.panes.find(t=>Q(t)===e.activeKey);return r===void 0?e:{...e,panes:vl(e.panes,r,t),activeKey:n}}function bl(e){let t=e.panes[0];return t!==void 0&&(e.panes.length>1||Q(t)!==e.routePaneKey)}function xl(e,t,n,r){let i=t===void 0?void 0:Q(t);if(!r||e.panes.length<2||t?.taskId===void 0)return{routeKey:n,routePaneKey:i,panes:t===void 0?[]:[t],activeKey:i,layout:void 0};let a=yl(e,t);return{...a,routeKey:n,routePaneKey:i,layout:a.panes===e.panes?e.layout:Z(e.layout,t=>t===e.activeKey?i:t)}}function Sl(e,t,n){let r=Q(t);if(!e.panes.some(e=>Q(e)===r))return e;let i=e.panes.length===1?[n(t.projectId)]:_l(e.panes,t),a=i[0];return{...e,panes:i,activeKey:e.activeKey===r?a===void 0?void 0:Q(a):e.activeKey,layout:Z(e.layout,e=>i.some(t=>Q(t)===e)?e:void 0)}}var Cl=`codexly:split-task-navigation`;function wl(e){return typeof window>`u`?!1:!window.dispatchEvent(new CustomEvent(Cl,{detail:e,cancelable:!0}))}function Tl(e){let t=t=>{!t.defaultPrevented&&e(t.detail)&&t.preventDefault()};return window.addEventListener(Cl,t),()=>{window.removeEventListener(Cl,t)}}var El=[{count:2,presets:[`auto`,`horizontal`,`vertical`]},{count:3,presets:[`auto`,`horizontal`,`vertical`,`main-left`,`main-top`]},{count:4,presets:[`auto`,`horizontal`,`vertical`,`grid`]}];function Dl(e,t){let n=t.width>0&&t.height>0?t.width/t.height:1.4;return e===2?n>=1?`horizontal`:`vertical`:e===3?n>=1.8?`horizontal`:n<=.75?`vertical`:n>=1?`main-left`:`main-top`:n>=2.8?`horizontal`:n<=.36?`vertical`:`grid`}function Ol(e,t){if(e.length<=1)return e[0];let n=Math.ceil(e.length/2),r=Ol(e.slice(0,n),t),i=Ol(e.slice(n),t);return r===void 0||i===void 0?r:{axis:t,ratio:n/e.length,first:r,second:i}}function kl(e,t,n){let r=e.slice(0,4),[i,a,o,s]=r;if(i===void 0||a===void 0)return i;let c=t===`auto`?Dl(r.length,n):t;if((c===`main-left`||c===`main-top`)&&o!==void 0){let e=c===`main-left`;return{axis:e?`horizontal`:`vertical`,ratio:.6,first:i,second:Ol(r.slice(1),e?`vertical`:`horizontal`)??a}}return c===`grid`&&o!==void 0&&s!==void 0?{axis:`vertical`,first:{axis:`horizontal`,first:i,second:a},second:{axis:`horizontal`,first:o,second:s}}:Ol(r,c===`vertical`?`vertical`:`horizontal`)}function Al(e){return(0,J.jsx)(we,{"data-slot":`context-menu`,...e})}function jl(e){return(0,J.jsx)(Ye,{"data-slot":`context-menu-trigger`,...e})}function Ml(e){return(0,J.jsx)(_e,{"data-slot":`context-menu-sub`,...e})}function Nl({children:e,...t}){return typeof document>`u`?(0,J.jsx)(J.Fragment,{children:e}):(0,J.jsx)(Te,{"data-slot":`context-menu-portal`,...t,children:e})}function Pl({children:e,className:t,collisionPadding:n=8,...r}){return(0,J.jsx)(Nl,{children:(0,J.jsx)(de,{className:Y(`z-50 max-h-[var(--radix-context-menu-content-available-height)] min-w-32 overflow-x-hidden overflow-y-auto rounded-surface border border-separator-strong bg-raised p-1.5 text-foreground shadow-floating outline-none`,t),collisionPadding:n,"data-slot":`context-menu-content`,...r,children:e})})}function Fl({className:e,...t}){return(0,J.jsx)(Ge,{className:Y(`flex cursor-default select-none items-center gap-2.5 rounded-control px-2 py-1.5 text-body-small outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-control-hover [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),"data-slot":`context-menu-item`,...t})}function Il({children:e,className:t,...n}){return(0,J.jsxs)(Me,{className:Y(`flex cursor-default select-none items-center gap-2.5 rounded-control px-2 py-1.5 text-body-small outline-none transition-colors data-[state=open]:bg-control-hover data-[highlighted]:bg-control-hover [&_svg]:pointer-events-none [&_svg]:shrink-0`,t),"data-slot":`context-menu-sub-trigger`,...n,children:[e,(0,J.jsx)(v,{"aria-hidden":`true`,className:`ml-auto size-3.5 text-muted-foreground`})]})}function Ll({children:e,className:t,collisionPadding:n=8,sideOffset:r=0,...i}){return(0,J.jsx)(Nl,{children:(0,J.jsx)(re,{className:Y(`z-50 min-w-40 max-h-[calc(100dvh-1rem)] overflow-y-auto rounded-surface border border-separator-strong bg-raised p-1.5 text-foreground shadow-floating outline-none`,t),collisionPadding:n,"data-slot":`context-menu-sub-content`,sideOffset:r,...i,children:e})})}function Rl({className:e,...t}){return(0,J.jsx)(ue,{className:Y(`px-2 py-1 text-label font-medium text-foreground`,e),"data-slot":`context-menu-label`,...t})}function zl({className:e,...t}){return(0,J.jsx)(Ee,{className:Y(`-mx-1.5 my-1 h-px bg-separator`,e),"data-slot":`context-menu-separator`,...t})}function Bl(e,t,n){if(!(e instanceof Element)||e.closest(`a, button, input, textarea, select, label, [contenteditable]:not([contenteditable="false"]), [role="button"], [role="menu"], .xterm, img, video, audio, canvas, pre, code`))return!1;let r=e.ownerDocument;if(r.getSelection()?.isCollapsed===!1)return!1;let i=r,a=i.caretRangeFromPoint?.(t,n);if(a===void 0){let e=i.caretPositionFromPoint?.(t,n);e!=null&&(a=r.createRange(),a.setStart(e.offsetNode,e.offset))}let o=a?.startContainer;if(a&&o?.nodeType===Node.TEXT_NODE&&e.contains(o)){let e=a.startOffset;a.setStart(o,Math.max(0,e-1)),a.setEnd(o,Math.min(o.textContent?.length??0,e+1));for(let e of a.getClientRects())if(t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom)return!1}return!0}function Vl(e,t,n){return(0,q.useCallback)((r,i,a)=>{e&&t(e=>{let t=e.panes[0];if(t===void 0||e.panes.length!==1||![2,3,4].includes(r))return e;let o=[t];for(;o.length<r;)o.push(n(t.projectId));return{...e,panes:o,activeKey:Q(t),layout:kl(o.map(Q),i,a)}})},[e,t,n])}var Hl;function Ul(){return Hl??=t(()=>import(`./split-workspace-menu-content-CkpZv1Nz.js`),__vite__mapDeps([0,1,2,3,4,5])),Hl}var Wl=(0,q.lazy)(Ul);function Gl({pane:e,labels:t,children:n,workspace:r}){let[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),c=r.panes.length>=4;return(0,J.jsxs)(Al,{modal:!1,onOpenChange:s,children:[(0,J.jsx)(jl,{asChild:!0,style:{WebkitTouchCallout:`default`},disabled:!r.enabled||!i,onPointerEnter:()=>{r.enabled&&Ul().catch(()=>{Hl=void 0})},onPointerDownCapture:e=>{!r.enabled||e.button!==2&&e.pointerType!==`touch`||a(Bl(e.target,e.clientX,e.clientY))},onContextMenu:t=>{!t.defaultPrevented&&i&&r.focus(e)},children:n}),o?(0,J.jsx)(q.Suspense,{fallback:null,children:(0,J.jsx)(Wl,{labels:t,limit:c,onSplit:t=>{r.split(e,t)}})}):null]})}function Kl({workspace:e}){let t=(0,q.useEffectEvent)(t=>{if(!e.enabled||e.panes.length>=4)return!1;let n=e.panes.find(t=>Q(t)===e.activeKey);return n!==void 0&&(e.split(n,t),!0)});return(0,q.useEffect)(()=>{let e=/mac/i.test(navigator.platform),n=n=>{let r=pl(n,e);r!==void 0&&([...document.querySelectorAll(`[role="dialog"], [role="alertdialog"], [role="menu"], dialog[open]`)].some(e=>e.getClientRects().length>0)||t(r)&&(n.preventDefault(),n.stopPropagation()))};return document.addEventListener(`keydown`,n,!0),()=>{document.removeEventListener(`keydown`,n,!0)}},[]),null}var $=e=>`${String(e*12.5)}%`;function ql(e){return{left:$(e.x),top:$(e.y),width:$(e.width),height:$(e.height)}}function Jl(e){return e.axis===`horizontal`?{left:$(e.x+e.width*e.ratio),top:$(e.y),height:$(e.height)}:{left:$(e.x),top:$(e.y+e.height*e.ratio),width:$(e.width)}}function Yl(e,t){let n=dl(t),r=new Map(fl(t).map(e=>[e.path,e]));for(let t of e.querySelectorAll(`:scope > [data-split-pane]`)){let e=n.get(t.dataset.splitPane??``);e!==void 0&&Object.assign(t.style,ql(e))}for(let t of e.querySelectorAll(`:scope > [data-split-divider]`)){let e=r.get(t.dataset.splitDivider??``);e!==void 0&&(Object.assign(t.style,Jl(e)),t.setAttribute(`aria-valuenow`,String(Math.round(e.ratio*100))))}}function Xl({layout:e,containerRef:t,resize:n,widthLabel:r,heightLabel:i}){let a=(0,q.useRef)(null),o=(0,q.useCallback)((e,t=!0)=>{let r=a.current;r!==null&&(a.current=null,r.frame!==void 0&&cancelAnimationFrame(r.frame),r.handle.hasPointerCapture(r.pointerId)&&r.handle.releasePointerCapture(r.pointerId),delete r.container.dataset.resizing,t&&Yl(r.container,e?ll(r.layout,r.divider.path,r.ratio):r.layout),e&&n(r.divider.path,r.ratio))},[n]);(0,q.useLayoutEffect)(()=>{t.current!==null&&Yl(t.current,e);let n=()=>{o(!1)};return window.addEventListener(`blur`,n),()=>{window.removeEventListener(`blur`,n),o(!1,!1)}},[e,o,t]);let s=e=>{let t=a.current;if(t?.pointerId!==e.pointerId)return;let n=t.divider.axis===`horizontal`?e.clientX:e.clientY;t.ratio=Math.min(1-t.minimum,Math.max(t.minimum,t.divider.ratio+(n-t.start)/t.extent)),t.frame===void 0&&(t.frame=requestAnimationFrame(()=>{t.frame=void 0,Yl(t.container,ll(t.layout,t.divider.path,t.ratio))}))};return fl(e).map(c=>(0,J.jsx)(`div`,{className:`split-workspace-resizer`,"data-split-divider":c.path,"data-axis":c.axis,style:Jl(c),role:`separator`,tabIndex:0,"aria-label":c.axis===`horizontal`?r:i,"aria-orientation":c.axis===`horizontal`?`vertical`:`horizontal`,"aria-valuemin":sl*100,"aria-valuemax":cl*100,"aria-valuenow":Math.round(c.ratio*100),onPointerDown:n=>{let r=t.current;if(n.button!==0||a.current!==null||r===null)return;n.preventDefault(),n.stopPropagation();let i=r.getBoundingClientRect(),o=c.axis===`horizontal`,s=(o?i.width*c.width:i.height*c.height)/8;if(s<=0)return;let l=Math.min(.45,Math.max(sl,(o?140:100)/s));n.currentTarget.setPointerCapture(n.pointerId),n.currentTarget.focus({preventScroll:!0}),a.current={container:r,handle:n.currentTarget,pointerId:n.pointerId,divider:c,start:o?n.clientX:n.clientY,extent:s,minimum:l,ratio:c.ratio,layout:e,frame:void 0},r.dataset.resizing=c.axis},onPointerMove:s,onPointerUp:e=>{a.current?.pointerId===e.pointerId&&(s(e),o(!0))},onPointerCancel:e=>{a.current?.pointerId===e.pointerId&&o(!1)},onLostPointerCapture:e=>{a.current?.pointerId===e.pointerId&&o(!1)},onKeyDown:e=>{if(e.key===`Escape`&&a.current!==null){e.preventDefault(),o(!1);return}let t=c.axis===`horizontal`,r=e.key===(t?`ArrowLeft`:`ArrowUp`)?-.02:e.key===(t?`ArrowRight`:`ArrowDown`)?.02:0;r===0||a.current!==null||e.altKey||e.ctrlKey||e.metaKey||(e.preventDefault(),e.stopPropagation(),n(c.path,c.ratio+r))}},c.path))}var Zl=`(max-width: 760px), (hover: none) and (pointer: coarse)`;function Ql(e){let t=window.matchMedia(Zl);return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}}var $l=()=>window.matchMedia(Zl).matches,eu=()=>!1,tu=(0,q.createContext)(null),nu=(0,q.createContext)(null),ru=(0,q.createContext)(void 0),iu=(0,q.createContext)(null),au=(0,q.createContext)(void 0),ou=()=>(0,q.useContext)(nu),su=(e=!0)=>(0,q.useContext)(e?tu:iu),cu=(e=!0)=>(0,q.useContext)(e?ru:au);function lu(){let e=su(),t=ou(),n=cu();return(0,q.useMemo)(()=>e===null||t===null?null:{...e,...t,activeKey:n===void 0?void 0:Q(n)},[e,t,n])}function uu({children:e,current:t,routeKey:n,desktop:r=!1}){let i=(0,q.useSyncExternalStore)(Ql,$l,eu),a=r||!i,[o,s]=(0,q.useState)(()=>({routeKey:n,routePaneKey:t===void 0?void 0:Q(t),panes:t===void 0?[]:[t],activeKey:t===void 0?void 0:Q(t),layout:void 0}));o.routeKey!==n&&s(xl(o,t,n,a));let c=(0,q.useRef)(o);(0,q.useLayoutEffect)(()=>{c.current=o},[o]);let l=(0,q.useCallback)(e=>{a&&s(t=>{let n=gl(t.panes,e);return n===t.panes?t:{...t,panes:n,activeKey:Q(e),layout:t.layout===void 0?void 0:ol(t.layout,t.activeKey??Q(t.panes[0]??e),Q(e),`right`)}})},[a]),u=(0,q.useCallback)(e=>{s(t=>{let n=_l(t.panes,e);return{...t,panes:n,layout:Z(t.layout,e=>n.some(t=>Q(t)===e)?e:void 0),activeKey:t.activeKey===Q(e)?n[0]===void 0?void 0:Q(n[0]):t.activeKey}})},[]),d=(0,q.useCallback)(e=>!a||!bl(c.current)?!1:(s(t=>Sl(t,e,gu)),!0),[a]),f=(0,q.useCallback)(e=>{s(t=>{let n=Q(e);return t.activeKey===n||!t.panes.some(e=>Q(e)===n)?t:{...t,activeKey:n}})},[]),p=(0,q.useCallback)(e=>{s(t=>({...t,panes:[e],activeKey:Q(e),layout:void 0}))},[]),m=(0,q.useCallback)(e=>{let t=c.current.panes;return!t.some(t=>Q(t)===Q(e))&&(!a||t.length<2)?!1:(s(t=>{let n=yl(t,e);return n.panes===t.panes?n:{...n,layout:Z(t.layout,n=>n===t.activeKey?Q(e):n)}}),!0)},[a]),h=(0,q.useEffectEvent)(e=>a&&o.panes.length>1&&m(e));(0,q.useEffect)(()=>Tl(h),[]);let g=(0,q.useCallback)((e,t)=>{s(n=>{if(!n.panes.some(t=>Q(t)===Q(e)))return n;let r=vl(n.panes,e,t),i=Q(t);return r===n.panes&&i===n.activeKey?n:{...n,panes:r,activeKey:i,layout:r===n.panes?n.layout:Z(n.layout,t=>t===Q(e)?n.panes.some(e=>Q(e)===i)?void 0:i:t)}})},[]),_=(0,q.useCallback)((e,t)=>{a&&s(n=>{if(n.panes.length>=4||!n.panes.some(t=>Q(t)===Q(e)))return n;let r=gu(e.projectId),i=Q(r),a=n.layout??al(n.panes.map(Q));return a===void 0?n:{...n,panes:gl(n.panes,r),activeKey:i,layout:ol(a,Q(e),i,t)}})},[a]),v=(0,q.useCallback)((e,t)=>{s(n=>{let r=n.layout??al(n.panes.map(Q));if(r===void 0)return n;let i=ll(r,e,t);return i===r?n:{...n,layout:i}})},[]),y=Vl(a,s,gu),b=(0,q.useMemo)(()=>({enabled:a,panes:o.panes,layout:o.layout}),[a,o.panes,o.layout]),ee=(0,q.useMemo)(()=>({applyPreset:y,resize:v,split:_,add:l,close:u,dismiss:d,focus:f,select:m,solo:p,replace:g}),[y,v,_,l,u,d,f,m,p,g]),te=o.panes.find(e=>Q(e)===o.activeKey);return(0,J.jsx)(nu,{value:ee,children:(0,J.jsx)(tu,{value:b,children:(0,J.jsx)(ru,{value:te,children:e})})})}var du=(0,q.createContext)(null);function fu({children:e,...t}){let{pane:n,active:r,multiple:i,toggleSidebar:a,sidebarOpen:o}=t,s=(0,q.useMemo)(()=>({pane:n,active:r,multiple:i,toggleSidebar:a,sidebarOpen:o}),[n,r,i,a,o]);return(0,J.jsx)(du,{value:s,children:e})}function pu({children:e,label:t,toggleSidebar:n,sidebarOpen:r,splitLabels:i}){let a=lu(),o=(0,q.useRef)(null);if(a===null)throw Error(`Missing split workspace provider`);let[s,c]=(0,q.useState)(()=>({panes:a.panes,keys:a.panes.map((e,t)=>t),nextKey:a.panes.length}));if(s.panes!==a.panes){let e=s.nextKey,t=a.panes.map(t=>{let n=s.panes.findIndex(e=>Q(e)===Q(t));return(s.panes.length===1&&a.panes.length===1?s.keys[0]:s.keys[n])??e++});c({panes:a.panes,keys:t,nextKey:e})}let l=a.enabled&&a.panes.length>1,u=(0,q.useMemo)(()=>a.layout??al(a.panes.map(Q)),[a.layout,a.panes]),d=(0,q.useMemo)(()=>u===void 0?void 0:dl(u),[u]);return(0,J.jsxs)(`div`,{ref:o,className:`split-workspace`,"data-multiple":l,"data-count":l?a.panes.length:1,"data-directed":l&&d!==void 0,"aria-label":t,children:[(0,J.jsx)(Kl,{workspace:a}),a.panes.map((t,o)=>{let c=Q(t),u=c===a.activeKey,f=l?d?.get(c):void 0;return(0,J.jsx)(q.Activity,{mode:a.enabled||u?`visible`:`hidden`,children:(0,J.jsx)(Gl,{pane:t,labels:i,workspace:a,children:(0,J.jsx)(`section`,{className:`split-workspace-pane`,"data-split-pane":c,"data-active":u,tabIndex:-1,style:f===void 0?void 0:ql(f),onPointerDownCapture:()=>{a.focus(t)},onFocusCapture:()=>{a.focus(t)},children:(0,J.jsx)(fu,{pane:t,active:u,multiple:l,toggleSidebar:n,sidebarOpen:r,children:e(t)})})})},s.keys[o])}),l&&u!==void 0?(0,J.jsx)(Xl,{layout:u,containerRef:o,resize:a.resize,widthLabel:i.resizeWidth??`${t} ↔`,heightLabel:i.resizeHeight??`${t} ↕`}):null]})}function mu(){let e=(0,q.useContext)(du),t=su(e===null),n=cu(e===null),r=ou(),i=(e!==null&&(e.multiple||e.pane.draftId!==void 0&&e.pane.draftId!==`route-draft`)?e.pane:void 0)??(t?.enabled&&t.panes.length>1?n:void 0),a=r?.replace;return(0,q.useCallback)((e,t)=>i===void 0||a===void 0?!1:(a(i,{projectId:e,taskId:t}),!0),[i,a])}function hu(){let e=(0,q.useContext)(du),t=su(e===null),n=ou();return(0,q.useCallback)(r=>{if(n===null||e!==null&&!e.multiple&&(e.pane.draftId===void 0||e.pane.draftId===`route-draft`)||e===null&&(!t?.enabled||t.panes.length<2))return!1;let i=gu(r);return e===null?n.select(i):(n.replace(e.pane,i),!0)},[e,t,n])}function gu(e){return{projectId:e,draftId:`split-draft:${Array.from(crypto.getRandomValues(new Uint32Array(4)),e=>e.toString(16).padStart(8,`0`)).join(``)}`}}function _u(e,t){let n=hu();return{openDraft:async e=>{n(e)||await t(e)},onNewTaskClick:t=>{t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||n(e)&&t.preventDefault()}}}var vu=class{chunks;cachedText;materializedCount=1;snapshot;constructor(e){this.chunks=[e],this.cachedText=e,this.snapshot={chunks:this.chunks,chunkCount:1}}append(e){this.chunks.push(e),this.snapshot={chunks:this.chunks,chunkCount:this.chunks.length}}getSnapshot(){return this.snapshot}materialize(){for(;this.materializedCount<this.chunks.length;)this.cachedText+=this.chunks[this.materializedCount]??``,this.materializedCount+=1;return this.cachedText}},yu=(0,q.createContext)(null),bu=()=>(0,q.useContext)(yu);function xu({children:e,open:t,setOpen:n}){let[r,i]=(0,q.useState)(null),a=(0,q.useRef)(null),o=(0,q.useMemo)(()=>({open:t,setOpen:n,target:r,setTarget:i,openDocumentRef:a}),[t,n,r]);return(0,J.jsx)(yu,{value:o,children:e})}function Su(e,t){let n=bu(),r=(0,q.useContext)(du),i=cu(r===null),a=n?.setTarget,o=n?.openDocumentRef,s=r===null,c=r?.active??!1;return(0,q.useLayoutEffect)(()=>{if(s&&a!==void 0)return a(e.current),()=>{a(null)}},[s,a,e]),(0,q.useLayoutEffect)(()=>{if(c&&o!==void 0)return o.current=t,()=>{o.current===t&&(o.current=null)}},[c,t,o]),{activePane:i,openSidebarDocument:(0,q.useCallback)(e=>{s&&i!==void 0&&o!==void 0?o.current?.(e):t(e)},[s,i,o,t])}}function Cu(e){return(0,J.jsxs)(`label`,{className:`relative inline-grid size-5 shrink-0 place-items-center`,children:[(0,J.jsx)(`input`,{...e,className:`peer absolute inset-0 m-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed`,type:`radio`}),(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none grid size-3 place-items-center rounded-full border border-separator-strong bg-panel transition-colors after:size-1.5 after:rounded-full peer-checked:border-brand peer-checked:after:bg-brand peer-focus-visible:shadow-focus peer-disabled:opacity-50`})]})}function wu({className:e,...t}){return(0,J.jsx)(le,{className:Y(`peer inline-grid size-4 shrink-0 place-items-center rounded-[4px] border border-separator-strong bg-panel text-brand-contrast shadow-sm outline-none transition-colors focus-visible:border-brand focus-visible:shadow-focus disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-brand data-[state=checked]:bg-brand data-[state=indeterminate]:border-brand data-[state=indeterminate]:bg-brand`,e),"data-slot":`checkbox`,...t,children:(0,J.jsxs)(fe,{className:`group [&_svg]:size-3`,"data-slot":`checkbox-indicator`,children:[(0,J.jsx)(ne,{"aria-hidden":`true`,className:`group-data-[state=indeterminate]:hidden`}),(0,J.jsx)(g,{"aria-hidden":`true`,className:`hidden group-data-[state=indeterminate]:block`})]})})}function Tu(e){return(0,J.jsx)(ve,{"data-slot":`dialog`,...e})}function Eu(e){return(0,J.jsx)(se,{"data-slot":`dialog-trigger`,...e})}function Du({children:e,...t}){return typeof document>`u`?(0,J.jsx)(J.Fragment,{children:e}):(0,J.jsx)(xe,{"data-slot":`dialog-portal`,...t,children:e})}function Ou({className:e,...t}){return(0,J.jsx)(ce,{className:Y(`fixed inset-0 z-50 bg-scrim data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),"data-slot":`dialog-overlay`,...t})}function ku({children:e,className:t,...n}){return(0,J.jsxs)(Du,{children:[(0,J.jsx)(Ou,{}),(0,J.jsx)(C,{className:Y(`fixed left-1/2 top-1/2 z-50 grid min-w-0 max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 overflow-auto rounded-surface bg-dialog p-5 text-foreground shadow-panel outline-none duration-180 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,t),"data-slot":`dialog-content`,...n,children:e})]})}function Au({className:e,...t}){return(0,J.jsx)(`div`,{className:Y(`flex flex-col gap-1 text-left`,e),"data-slot":`dialog-header`,...t})}function ju({className:e,...t}){return(0,J.jsx)(`div`,{className:Y(`flex justify-end gap-2`,e),"data-slot":`dialog-footer`,...t})}function Mu({className:e,...t}){return(0,J.jsx)(Ce,{className:Y(`text-heading font-semibold leading-tight`,e),"data-slot":`dialog-title`,...t})}function Nu({className:e,...t}){return(0,J.jsx)(Se,{className:Y(`text-body-small text-muted-foreground`,e),"data-slot":`dialog-description`,...t})}var Pu=b(`min-w-0 text-foreground outline-none transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50`,{defaultVariants:{variant:`default`},variants:{variant:{compact:`h-8 w-full rounded-control bg-raised px-2.5 text-label shadow-sm focus-visible:shadow-focus`,default:`h-9 w-full rounded-control bg-control px-3 text-body focus-visible:shadow-focus`,embedded:`flex-1 bg-transparent`,outline:`h-11 w-full rounded-control border border-separator-strong bg-panel px-3 text-body-small focus-visible:border-brand focus-visible:shadow-focus sm:h-9`}}});function Fu({className:e,type:t,variant:n=`default`,...r}){return(0,J.jsx)(`input`,{className:Y(Pu({className:e,variant:n})),"data-slot":`input`,"data-variant":n,type:t,...r})}var Iu=`flex cursor-default items-center justify-center py-1 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`;function Lu({...e}){return(0,J.jsx)(He,{"data-slot":`select`,...e})}function Ru({...e}){return(0,J.jsx)(Pe,{"data-slot":`select-value`,...e})}function zu({className:e,size:t=`default`,children:n,...r}){return(0,J.jsxs)(Fe,{"data-slot":`select-trigger`,"data-size":t,className:Y(`flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-control border border-separator-strong bg-panel px-3 py-2 text-label outline-none transition-colors focus:border-brand focus:shadow-focus disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4`,t===`toolbar`&&`h-6 gap-1 px-1 text-caption [&_svg:not([class*='size-'])]:size-3`,e),...r,children:[n,(0,J.jsx)(Ae,{asChild:!0,children:(0,J.jsx)(p,{className:`opacity-50`})})]})}function Bu({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,J.jsx)(Ne,{children:(0,J.jsxs)(qe,{"data-slot":`select-content`,className:Y(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-control border border-separator bg-raised text-foreground shadow-panel data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,J.jsx)(Hu,{}),(0,J.jsx)(De,{className:Y(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,J.jsx)(Uu,{})]})})}function Vu({className:e,children:t,...n}){return(0,J.jsxs)(ze,{"data-slot":`select-item`,className:Y(`relative flex w-full cursor-default items-center gap-2 rounded-control py-1.5 pr-8 pl-2 text-label outline-hidden select-none focus:bg-control-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:text-muted-foreground [&_svg:not([class*='size-'])]:size-3.5`,e),...n,children:[(0,J.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,J.jsx)(Xe,{children:(0,J.jsx)(ne,{})})}),(0,J.jsx)(je,{children:t})]})}function Hu({className:e,...t}){return(0,J.jsx)(Be,{"data-slot":`select-scroll-up-button`,className:Y(Iu,e),...t,children:(0,J.jsx)(_,{})})}function Uu({className:e,...t}){return(0,J.jsx)(Ue,{"data-slot":`select-scroll-down-button`,className:Y(Iu,e),...t,children:(0,J.jsx)(p,{})})}function Wu({delayDuration:e=350,disableHoverableContent:t=!0,skipDelayDuration:n=150,...r}){return(0,J.jsx)(Ke,{"data-slot":`tooltip-provider`,delayDuration:e,disableHoverableContent:t,skipDelayDuration:n,...r})}function Gu(e){return(0,J.jsx)(Ie,{"data-slot":`tooltip`,...e})}function Ku({onFocus:e,...t}){return(0,J.jsx)(Oe,{"data-slot":`tooltip-trigger`,...t,onFocus:t=>{e?.(t),t.preventDefault()}})}function qu({children:e,className:t,collisionPadding:n=8,sideOffset:r=8,...i}){return(0,J.jsx)(Ve,{children:(0,J.jsx)(Je,{className:Y(`pointer-events-none z-50 w-fit max-w-[min(20rem,calc(100vw-1rem))] whitespace-normal rounded-control bg-foreground px-2 py-1 text-meta text-raised shadow-floating`,t),collisionPadding:n,"data-slot":`tooltip-content`,sideOffset:r,...i,children:e})})}function Ju({createRequestId:e,client:t,labels:n,hostLabel:r,storageKey:i,validateName:a,onAdd:o,onClose:s,renderDirectoryPicker:c}){let l=(0,q.useId)(),[d,p]=(0,q.useState)(``),[m,h]=(0,q.useState)(``),[g,_]=(0,q.useState)(!1),[v,y]=(0,q.useState)(!0),[b,te]=(0,q.useState)(0),[x,ne]=(0,q.useState)(!1),[re,S]=(0,q.useState)(),[C,ie]=(0,q.useState)(),ae=(0,q.useRef)(!1),oe=(0,q.useRef)(void 0),w=a(m),se=d.startsWith(`/`)?`/`:`\\`,ce=d?`${d.replace(/[\\/]+$/u,``)}${se}${m}`:``;(0,q.useEffect)(()=>{let e=new AbortController,n;try{n=localStorage.getItem(i)??void 0}catch{}return y(!0),S(void 0),(async()=>{try{let r;try{r=await t.listProjectDirectories(n,{signal:e.signal})}catch(i){if(!n||e.signal.aborted)throw i;r=await t.listProjectDirectories(void 0,{signal:e.signal})}e.signal.aborted||p(r.path)}catch{e.signal.aborted||S(`loadError`)}finally{e.signal.aborted||y(!1)}})(),()=>{e.abort()}},[t,i,b]);let le=async()=>{if(ae.current||!d||!w||v)return;ae.current=!0,ne(!0),S(void 0);let n=!1;try{let r=C;if(!r){(oe.current?.parentPath!==d||oe.current.name!==m)&&(oe.current={parentPath:d,name:m,key:e()});let n=await t.createProjectDirectory({parentPath:d,name:m},{idempotencyKey:oe.current.key});if(n.status===`exists-file`){S(`existsFile`);return}if(r={path:n.path,created:n.status===`created`},ie(r),!r.created){S(`existsDirectory`);return}try{localStorage.setItem(i,d)}catch{}}n=!0,await o([r.path])?s():S(`addError`)}catch{S(n?`addError`:`createError`)}finally{ae.current=!1,ne(!1)}};return g?c({initialPath:d,onCancel:()=>{_(!1)},onSelect:e=>{p(e),ie(void 0),S(void 0),_(!1)}}):(0,J.jsx)(Tu,{open:!0,onOpenChange:e=>{!e&&!x&&s()},children:(0,J.jsxs)(ku,{className:`max-w-lg gap-5`,onEscapeKeyDown:e=>{x&&e.preventDefault()},onInteractOutside:e=>{x&&e.preventDefault()},children:[(0,J.jsxs)(Au,{children:[(0,J.jsx)(Mu,{children:n.title}),(0,J.jsx)(Nu,{className:`break-words [overflow-wrap:anywhere]`,children:r})]}),(0,J.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-5`,onSubmit:e=>{e.preventDefault(),le()},children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`text-body-small font-medium`,id:`${l}-parent`,children:n.parent}),(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`p`,{"aria-labelledby":`${l}-parent`,className:`min-w-0 flex-1 break-words font-mono text-body-small [overflow-wrap:anywhere]`,children:v?n.loading:d||`—`}),(0,J.jsxs)(X,{className:`h-11 shrink-0 sm:h-9`,disabled:x||v||C?.created,onClick:()=>{_(!0)},type:`button`,variant:`outline`,children:[(0,J.jsx)(ee,{"aria-hidden":`true`}),n.choose]})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`label`,{className:`text-body-small font-medium`,htmlFor:`${l}-name`,children:n.name}),(0,J.jsx)(Fu,{autoFocus:!0,autoComplete:`off`,autoCapitalize:`none`,spellCheck:!1,id:`${l}-name`,className:`h-11 text-base sm:h-9`,disabled:x||C?.created,value:m,maxLength:255,"aria-invalid":m.length>0&&!w,"aria-describedby":m.length>0&&!w?`${l}-invalid`:void 0,onChange:e=>{h(e.target.value),ie(void 0),S(void 0)}}),m.length>0&&!w?(0,J.jsx)(`p`,{id:`${l}-invalid`,className:`text-caption text-danger`,children:n.invalidName}):null]}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:n.path}),(0,J.jsx)(`p`,{className:`break-words font-mono text-body-small [overflow-wrap:anywhere]`,children:(C?.path??ce)||`—`})]}),re?(0,J.jsxs)(`div`,{role:`alert`,className:`text-body-small text-danger`,children:[n[re],re===`loadError`?(0,J.jsx)(X,{type:`button`,variant:`ghost`,onClick:()=>{te(e=>e+1)},children:n.retry}):null]}):null,(0,J.jsxs)(ju,{className:`flex-col-reverse sm:flex-row`,children:[(0,J.jsx)(X,{className:`h-11 sm:h-9`,type:`button`,disabled:x,variant:`outline`,onClick:s,children:n.cancel}),(0,J.jsxs)(X,{className:`h-11 sm:h-9`,type:`submit`,disabled:x||v||!d||!w,children:[x?(0,J.jsx)(f,{className:`animate-spin`,"aria-hidden":`true`}):(0,J.jsx)(u,{"aria-hidden":`true`}),x?n.creating:C?C.created||re===`addError`?n.retryAdd:n.addExisting:n.create]})]})]})]})})}function Yu(e,t){let n=[],r=[];for(let i of e.values()){if(!t.has(i.projectId))continue;let e=i.pendingApprovalRequestIds.size>0;(i.isRunning||e)&&(e?n:r).push({id:i.taskId,projectId:i.projectId,title:i.taskName??i.taskId,status:e?`approval`:`running`})}return{tasks:[...n,...r],approvalCount:n.length,runningCount:r.length}}function Xu(e,t,n,r,i){let a=r?Math.min(2,t):0,o=i?Math.min(2,n):0,s=(e,t)=>e===0?0:28+t*32+(t>0&&t<e?24:0),c=()=>s(t,a)+s(n,o)+(t>0&&n>0?8:0),l=Math.min(240,Math.max(0,e)/3);for(let e of[`pinned`,`active`,`pinned`,`active`]){if(c()<=l)break;e===`pinned`?a=Math.max(0,a-1):o=Math.max(0,o-1)}return{pinnedLimit:a,activeLimit:o,height:c()}}var Zu=`codexly:sidebar:shortcuts-expanded:v1`;function Qu(e){try{let t=JSON.parse(e?.getItem(Zu)??`null`);if(typeof t==`object`&&t&&`version`in t&&t.version===1&&`pinned`in t&&typeof t.pinned==`boolean`&&`active`in t&&typeof t.active==`boolean`)return{pinned:t.pinned,active:t.active}}catch{}return{pinned:!0,active:!0}}function $u(e,t){try{e?.setItem(Zu,JSON.stringify({version:1,...t}))}catch{}}function ed(e){return(0,J.jsx)(ve,{"data-slot":`sheet`,...e})}function td({children:e,...t}){return typeof document>`u`?(0,J.jsx)(J.Fragment,{children:e}):(0,J.jsx)(xe,{"data-slot":`sheet-portal`,...t,children:e})}function nd({className:e,...t}){return(0,J.jsx)(ce,{className:Y(`fixed inset-0 z-50 bg-scrim data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),"data-slot":`sheet-overlay`,...t})}function rd({children:e,className:t,closeLabel:n=`Close`,showCloseButton:r=!0,side:i=`right`,...a}){return(0,J.jsxs)(td,{children:[(0,J.jsx)(nd,{}),(0,J.jsxs)(C,{className:Y(`fixed z-50 flex min-w-0 flex-col gap-0 overflow-hidden bg-raised text-foreground shadow-panel outline-none duration-180 data-[state=closed]:animate-out data-[state=open]:animate-in`,i===`right`&&`inset-y-0 right-0 h-dvh w-full border-l border-separator data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-[32rem]`,i===`left`&&`inset-y-0 left-0 h-dvh w-full border-r border-separator data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-[32rem]`,i===`top`&&`inset-x-0 top-0 max-h-dvh border-b border-separator data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,i===`bottom`&&`inset-x-0 bottom-0 max-h-dvh border-t border-separator data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,t),"data-slot":`sheet-content`,...a,children:[e,r?(0,J.jsxs)(tt,{className:`absolute right-3 top-3 inline-grid size-7 place-items-center rounded-control text-muted-foreground transition-colors hover:bg-control-hover hover:text-foreground focus-visible:shadow-focus focus-visible:outline-none disabled:pointer-events-none`,children:[(0,J.jsx)(x,{"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`sr-only`,children:n})]}):null]})]})}function id({className:e,...t}){return(0,J.jsx)(`div`,{className:Y(`flex flex-col gap-1 px-4 py-3`,e),"data-slot":`sheet-header`,...t})}function ad({className:e,...t}){return(0,J.jsx)(`div`,{className:Y(`mt-auto flex items-center justify-end gap-2 px-4 py-3`,e),"data-slot":`sheet-footer`,...t})}function od({className:e,...t}){return(0,J.jsx)(Ce,{className:Y(`text-heading font-semibold leading-tight`,e),"data-slot":`sheet-title`,...t})}function sd({className:e,...t}){return(0,J.jsx)(Se,{className:Y(`text-body-small text-muted-foreground`,e),"data-slot":`sheet-description`,...t})}function cd({tasks:e,taskKey:t,renderTask:n,onSelect:r}){let a=(0,q.useRef)(null),o=e.length>50,s=i({count:e.length,enabled:o,getScrollElement:()=>a.current,estimateSize:()=>32,overscan:5,getItemKey:n=>{let r=e[n];return r===void 0?n:t(r)}});return(0,J.jsx)(`div`,{ref:a,className:`min-h-0 overflow-y-auto overscroll-contain`,style:{maxHeight:`min(60dvh, 480px)`},onClick:e=>{e.target instanceof Element&&e.target.closest(`a`)&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&r()},children:o?(0,J.jsx)(`div`,{style:{height:s.getTotalSize(),position:`relative`},children:s.getVirtualItems().map(t=>{let r=e[t.index];return(0,J.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:32,transform:`translateY(${String(t.start)}px)`},children:r===void 0?null:n(r)},t.key)})}):e.map(e=>(0,J.jsx)(`div`,{children:n(e)},t(e)))})}function ld({name:e,title:t,summary:n,tasks:r,taskKey:i,renderTask:a,limit:o,expanded:s,onToggle:c,mobile:l,showAll:u,closeLabel:d,onNavigate:f}){let m=(0,q.useId)(),h=(0,q.useRef)(null),g=(0,q.useRef)(!1),[_,y]=(0,q.useState)(!1),b=e=>{e&&(g.current=!1),y(e)},ee=()=>(0,J.jsx)(cd,{tasks:r,taskKey:i,renderTask:a,onSelect:()=>{g.current=!0,y(!1),f?.()}}),te=e=>{g.current?e.preventDefault():l&&(e.preventDefault(),h.current?.focus())};return(0,J.jsxs)(ke,{open:_&&!l,onOpenChange:b,children:[(0,J.jsxs)(`section`,{"data-sidebar-shortcut-group":e,"aria-labelledby":`${m}-title`,className:`min-w-0 shrink-0`,children:[(0,J.jsxs)(`div`,{className:`flex h-7 min-w-0 items-center px-1`,children:[(0,J.jsx)(`h2`,{id:`${m}-title`,className:`flex min-w-0 flex-1`,children:(0,J.jsxs)(X,{variant:`ghost`,type:`button`,onClick:()=>{s&&o===0?b(!0):c()},"aria-expanded":s&&o>0,"aria-controls":`${m}-preview`,className:`h-7 w-full justify-start gap-1 px-1 text-meta font-semibold text-muted-foreground`,children:[s&&o>0?(0,J.jsx)(p,{"aria-hidden":`true`,className:`size-3`}):(0,J.jsx)(v,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(`span`,{className:`truncate`,children:t})]})}),(0,J.jsx)($e,{asChild:!0,onClick:l?e=>{e.preventDefault(),b(!0)}:void 0,children:(0,J.jsx)(X,{ref:h,variant:`ghost`,type:`button`,"aria-label":`${t}:${u}`,"aria-haspopup":`dialog`,className:`h-7 shrink-0 gap-1 px-1 text-caption text-subtle-foreground`,children:n})})]}),(0,J.jsxs)(`div`,{id:`${m}-preview`,className:`flex flex-col`,hidden:o===0,children:[r.slice(0,o).map(e=>(0,J.jsx)(`div`,{children:a(e)},i(e))),o>0&&o<r.length?(0,J.jsx)(X,{variant:`ghost`,type:`button`,onClick:()=>{b(!0)},className:`h-6 w-full justify-start px-2 text-caption text-subtle-foreground`,children:u}):null]})]}),_&&!l?(0,J.jsx)(et,{children:(0,J.jsxs)(Ze,{align:`start`,side:`right`,sideOffset:12,collisionPadding:8,"aria-label":`${t}:${u}`,onCloseAutoFocus:te,className:`z-50 flex max-h-[var(--radix-popover-content-available-height)] w-80 max-w-[calc(100vw-16px)] min-w-0 flex-col overflow-hidden rounded-surface border border-separator-strong bg-raised p-2 text-foreground shadow-floating outline-none`,children:[(0,J.jsxs)(`h3`,{className:`shrink-0 px-2 pb-2 text-body-small font-semibold`,children:[t,` `,(0,J.jsx)(`span`,{className:`text-caption font-normal text-subtle-foreground`,children:n})]}),ee()]})}):null,l?(0,J.jsx)(ed,{open:_,onOpenChange:b,children:(0,J.jsxs)(rd,{side:`left`,closeLabel:d,"aria-describedby":void 0,onCloseAutoFocus:te,children:[(0,J.jsx)(id,{children:(0,J.jsxs)(od,{children:[t,` `,(0,J.jsx)(`span`,{className:`text-caption font-normal text-subtle-foreground`,children:n})]})}),_?(0,J.jsx)(`div`,{className:`min-h-0 px-2`,children:ee()}):null]})}):null]})}var ud=e=>`${e.projectId??``}\u0000${e.id}`;function dd({pinnedTasks:e,activeTasks:t,runningCount:n,approvalCount:r,renderPinned:i,renderActive:a,storage:o,mobileEnabled:s=!1,onNavigate:c,labels:l}){let u=(0,q.useRef)(null),[d,f]=(0,q.useState)(()=>Qu(o)),[p,m]=(0,q.useState)(720),[h,g]=(0,q.useState)(!1);(0,q.useEffect)(()=>{let e=u.current?.parentElement;if(!e)return;let t=()=>{m(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]),(0,q.useEffect)(()=>{if(!s)return;let e=window.matchMedia(`(max-width: 760px)`),t=()=>{g(e.matches)};return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}},[s]);let _=Xu(p,e.length,t.length,d.pinned,d.active),v=e=>{f(t=>{let n={...t,[e]:!t[e]};return $u(o,n),n})};return(0,J.jsxs)(`div`,{ref:u,"data-testid":`sidebar-task-shortcuts`,className:`flex shrink-0 flex-col gap-2`,style:{height:_.height},children:[e.length>0?(0,J.jsx)(ld,{name:`pinned`,title:l.pinned,summary:e.length,tasks:e,taskKey:ud,renderTask:i,limit:_.pinnedLimit,expanded:d.pinned,onToggle:()=>{v(`pinned`)},mobile:h,showAll:l.showAll(e.length),closeLabel:l.close,onNavigate:c}):null,t.length>0?(0,J.jsx)(ld,{name:`active`,title:l.active,summary:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{children:n}),r>0?(0,J.jsxs)(`span`,{className:`text-task-waiting`,children:[`· `,l.approval(r)]}):null]}),tasks:t,taskKey:ud,renderTask:a,limit:_.activeLimit,expanded:d.active,onToggle:()=>{v(`active`)},mobile:h,showAll:l.showAll(t.length),closeLabel:l.close,onNavigate:c}):null]})}var fd={completed:3,approval:2,running:1};function pd(e){let t=new Map;for(let n of e.values()){let e=n.attention===`completed`?`completed`:n.pendingApprovalRequestIds.size>0||n.attention===`approval`?`approval`:n.isRunning?`running`:null;if(e===null)continue;let r=t.get(n.projectId);(r===void 0||fd[e]>fd[r])&&t.set(n.projectId,e)}return t}var md={completed:`text-task-completed`,approval:`text-task-waiting`,running:`text-task-running`};function hd({hideOnMobile:e=!1,status:t,labels:n}){return t===void 0?null:(0,J.jsx)(`span`,{"aria-label":n[t],className:`project-status pointer-events-none absolute right-[7px] size-3.5 shrink-0 place-items-center group-hover/project:invisible group-focus-within/project:invisible [@media(hover:none)]:hidden [@media(pointer:coarse)]:hidden ${e?`hidden min-[761px]:inline-grid`:`inline-grid`} ${md[t]}`,role:`status`,children:t===`completed`?(0,J.jsx)(d,{"aria-hidden":`true`,className:`size-3.5 stroke-[2.25]`}):t===`approval`?(0,J.jsx)(m,{"aria-hidden":`true`,className:`size-3.5 stroke-[2.25]`}):(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`task-status-dot block size-2 rounded-full bg-current`})})}function gd(e){return(0,J.jsx)(S,{"data-slot":`dropdown-menu`,...e})}function _d(e){return(0,J.jsx)(w,{"data-slot":`dropdown-menu-trigger`,...e})}function vd(e){return(0,J.jsx)(pe,{"data-slot":`dropdown-menu-sub`,...e})}function yd({children:e,...t}){return typeof document>`u`?(0,J.jsx)(J.Fragment,{children:e}):(0,J.jsx)(ae,{"data-slot":`dropdown-menu-portal`,...t,children:e})}function bd({children:e,className:t,collisionPadding:n=8,sideOffset:r=2,...i}){return(0,J.jsx)(yd,{children:(0,J.jsx)(ye,{className:Y(`z-50 min-w-32 overflow-hidden rounded-surface bg-raised p-1 text-foreground shadow-floating outline-none`,t),collisionPadding:n,"data-slot":`dropdown-menu-content`,sideOffset:r,...i,children:e})})}function xd({className:e,...t}){return(0,J.jsx)(Qe,{className:Y(`flex cursor-default select-none items-center gap-2 rounded-control px-2 py-1.5 text-body-small outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-control-hover [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),"data-slot":`dropdown-menu-item`,...t})}function Sd({children:e,className:t,...n}){return(0,J.jsxs)(ge,{className:Y(`flex cursor-default select-none items-center gap-2 rounded-control px-2 py-1.5 text-body-small outline-none transition-colors data-[state=open]:bg-control-hover data-[highlighted]:bg-control-hover [&_svg]:pointer-events-none [&_svg]:shrink-0`,t),"data-slot":`dropdown-menu-sub-trigger`,...n,children:[e,(0,J.jsx)(v,{"aria-hidden":`true`,className:`ml-auto size-3.5 text-muted-foreground`})]})}function Cd({children:e,className:t,collisionPadding:n=8,sideOffset:r=2,...i}){return(0,J.jsx)(yd,{children:(0,J.jsx)(me,{className:Y(`z-50 min-w-40 max-h-[calc(100dvh-1rem)] overflow-y-auto rounded-surface bg-raised p-1 text-foreground shadow-floating outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,t),collisionPadding:n,"data-slot":`dropdown-menu-sub-content`,sideOffset:r,...i,children:e})})}function wd(e){return(0,J.jsx)(ie,{"data-slot":`dropdown-menu-group`,...e})}function Td({className:e,...t}){return(0,J.jsx)(oe,{className:Y(`px-2 py-1 text-label font-medium text-foreground`,e),"data-slot":`dropdown-menu-label`,...t})}function Ed({className:e,...t}){return(0,J.jsx)(Le,{className:Y(`-mx-1 my-1 h-px bg-separator`,e),"data-slot":`dropdown-menu-separator`,...t})}function Dd(e){return(0,J.jsx)(he,{"data-slot":`dropdown-menu-radio-group`,...e})}function Od({children:e,className:t,indicator:n=`radio`,...r}){return(0,J.jsxs)(Re,{className:Y(`relative flex cursor-default select-none items-center gap-2.5 rounded-control py-1.5 text-body-small outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-control-hover [&_svg]:pointer-events-none [&_svg]:shrink-0`,n===`check`?`pl-2 pr-8`:`pl-8 pr-2`,t),"data-indicator":n,"data-indicator-position":n===`check`?`end`:`start`,"data-slot":`dropdown-menu-radio-item`,...r,children:[(0,J.jsx)(`span`,{className:Y(`pointer-events-none absolute flex size-3.5 items-center justify-center`,n===`check`?`right-2`:`left-2`),children:(0,J.jsx)(be,{children:n===`check`?(0,J.jsx)(ne,{"aria-hidden":`true`,className:`size-3.5`}):(0,J.jsx)(h,{"aria-hidden":`true`,className:`size-2 fill-current text-brand`})})}),e]})}function kd({projectName:e,title:t}){return e===void 0?(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}):(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,J.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate rounded border border-border px-1 text-caption font-normal text-subtle-foreground`,title:e,children:e}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:t,children:t})]})}function Ad({task:e,active:t,projectName:n,labels:r,renderLink:i}){let a=lu(),o={projectId:e.projectId,taskId:e.id};return a!==null&&a.panes.length>0&&(t=a.activeKey===Q(o)),i({taskActive:t,className:`flex h-8 min-w-0 items-center gap-2 rounded-control px-2 text-body-small transition-colors ${t?`bg-control-active font-medium text-foreground`:`text-muted-foreground hover:bg-control-hover hover:text-foreground`}`,onClick:e=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||a?.select(o)&&e.preventDefault()},children:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(kd,{projectName:n,title:e.title}),(0,J.jsx)(`span`,{role:`status`,"aria-label":e.status===`approval`?r.approval:r.running,className:`sidebar-shortcut-status ml-auto inline-grid size-3.5 shrink-0 place-items-center ${e.status===`approval`?`text-task-waiting`:`text-task-running`}`,children:e.status===`approval`?(0,J.jsx)(m,{"aria-hidden":`true`,className:`size-3.5 stroke-[2.25]`}):(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`task-status-dot block size-2 rounded-full bg-current`})})]})})}var jd=(0,q.forwardRef)(function({taskActive:e,...t},n){return(0,J.jsx)(`a`,{...t,ref:n,"aria-current":e?`page`:void 0,"data-status":e?`active`:void 0})}),Md=1048576,Nd=new Set([`gif`,`jpeg`,`jpg`,`png`,`webp`]),Pd=new Set(`7z.avi.dmg.doc.docm.docx.exe.gz.key.mov.mp3.mp4.numbers.odp.ods.odt.pages.pkg.ppt.pptm.pptx.rar.tar.tgz.wav.xls.xlsb.xlsm.xlsx.zip`.split(`.`));function Fd(e){let t=e.split(/[\\/]/u).at(-1)?.toLowerCase()??``,n=t.includes(`.`)?t.split(`.`).at(-1)??``:``;return n===`pdf`?`pdf`:Nd.has(n)?`image`:Pd.has(n)?`system`:`source`}function Id(e){return e.mediaType.split(`;`)[0]?.trim().toLowerCase()===`application/pdf`||Fd(e.name)===`pdf`?`pdf`:e.kind===`image`?`image`:e.kind===`text`?`source`:e.size>1048576?`system`:Fd(e.name)===`source`?`source`:`system`}var Ld=50331648;function Rd(e){return Array.isArray(e)&&e.length===4&&e[0]===`projects`&&typeof e[1]==`string`&&e[2]===`tasks`&&typeof e[3]==`string`}function zd(e,t=Ld,n=12){let r=e.getQueryCache(),i=new $c({getRetainedBytes:(e,t)=>t.retainedBytes,maxBytes:t,maxEntries:n,onEvict(t,n,i){i!==`replaced`&&r.find({exact:!0,queryKey:n.queryKey})?.getObserversCount()===0&&e.removeQueries({exact:!0,queryKey:n.queryKey})}});function a(t){let{queryHash:n,queryKey:a}=t;if(!Rd(a))return;let o=t.state.data;if(r.get(n)!==t||t.getObserversCount()>0||o===void 0){i.delete(n);return}let s=i.peek(n);(s?.data!==o||s.dataUpdatedAt!==t.state.dataUpdatedAt)&&!i.set(n,{data:o,dataUpdatedAt:t.state.dataUpdatedAt,queryKey:a,retainedBytes:s?.data===o?s.retainedBytes:Qc(o)})&&t.getObserversCount()===0&&e.removeQueries({exact:!0,queryKey:a})}let o=r.subscribe(e=>{a(e.query)});for(let e of r.getAll().sort((e,t)=>e.state.dataUpdatedAt-t.state.dataUpdatedAt))a(e);return o}export{vu as $,Cc as $t,Ju as A,st as An,Qc as At,Fu as B,zc as Bt,ed as C,Qr as Cn,Q as Ct,id as D,bn as Dn,nl as Dt,ad as E,yn as En,Y as Et,Lu as F,Bc as Ft,Au as G,Mc as Gt,ku as H,Fc as Ht,Bu as I,Vc as It,wu as J,Dc as Jt,Mu as K,kc as Kt,Vu as L,Ic as Lt,qu as M,Wc as Mt,Wu as N,Uc as Nt,od as O,xn as On,el as Ot,Ku as P,Hc as Pt,Su as Q,wc as Qt,zu as R,Lc as Rt,dd as S,_a as Sn,hl as St,sd as T,vn as Tn,X as Tt,Nu as U,Nc as Ut,Tu as V,Rc as Vt,ju as W,jc as Wt,xu as X,Ec as Xt,Cu as Y,Oc as Yt,bu as Z,xc as Zt,Cd as _,As as _n,jl as _t,jd as a,pc as an,hu as at,hd as b,G as bn,wl as bt,gd as c,hc as cn,su as ct,xd as d,dc as dn,Fl as dt,Sc as en,_u as et,Td as f,oc as fn,Rl as ft,vd as g,js as gn,Il as gt,Ed as h,Ms as hn,Ll as ht,Fd as i,fc as in,mu as it,Gu as j,Zc as jt,Yu as k,kn,$c as kt,bd as l,vc as ln,Al as lt,Od as m,W as mn,Ml as mt,Md as n,bc as nn,pu as nt,Ad as o,gc as on,lu as ot,Dd as p,$s as pn,zl as pt,Eu as q,Ac as qt,Id as r,yc as rn,uu as rt,kd as s,_c as sn,ou as st,zd as t,Tc as tn,du as tt,wd as u,uc as un,Pl as ut,Sd as v,ks as vn,kl as vt,rd as w,Tn as wn,dl as wt,pd as x,za as xn,ml as xt,_d as y,Ns as yn,El as yt,Ru as z,Pc as zt};
@@ -1 +0,0 @@
1
- import{a as e}from"./message-response-D6AZoXZR.js";export{e as Mermaid};
@@ -1 +0,0 @@
1
- �#�import{a as e}from"./message-response-D6AZoXZR.js";export{e as Mermaid};
@@ -1,3 +0,0 @@
1
- import{a as e,r as t}from"./rolldown-runtime-B0Z9INg1.js";import{i as n,t as r}from"./react-runtime-CMZHB3u8.js";import{H as i,K as a,M as o,P as s,Tt as c,V as l,_t as u,dt as d,j as f,lt as p,q as m,ut as h}from"./initial-deps-DElr8S4a.js";import{at as g,o as _,tt as v}from"./initial-deps-B8FrcWWN.js";import{t as y}from"./download-05FmZQzE.js";import{U as b}from"./index-CV7PO8FJ.js";import{t as x}from"./image-preview-CZiY9KQs.js";var S=v(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),C=v(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),w=e(n(),1),T=r(),E=[`/__codexly_relative__/`,`/__codeagent_relative__/`,`/__codexly_unc__/`,`/__codeagent_unc__/`];function D(e){if(/^(?:https?:|data:|blob:|asset:|\/\/)/iu.test(e))return null;let t=e;try{t=decodeURIComponent(t)}catch{}for(let e of E)if(t.startsWith(e)){let n=t.slice(e.length);return e.includes(`_unc__`)?`//${n}`:n}return/^file:\/\//iu.test(t)&&(t=t.replace(/^file:\/\//iu,``)),/^sandbox:/iu.test(t)&&(t=t.slice(8)),/^\/[a-z]:[\\/]/iu.test(t)&&(t=t.slice(1)),t}var O=(0,w.createContext)(void 0);function k({children:e,resolveImage:t}){let n=(0,w.useContext)(O);return(0,T.jsx)(O.Provider,{value:t??n,children:e})}function A({src:e,node:t,...n}){let r=(0,w.useContext)(O),i=typeof e==`string`?D(e):null,a=(0,w.useMemo)(()=>i===null?e:r?.(i),[i,r,e]);return(0,T.jsx)(ee,{...n,source:a},typeof e==`string`?e:`image`)}function ee({source:e,unavailableLabel:t,alt:n,renderPreview:r,...i}){let[a,o]=(0,w.useState)(),[s,c]=(0,w.useState)();(0,w.useEffect)(()=>{if(typeof e!=`function`)return;let t=!0;return e().then(n=>{t&&o({source:e,url:n})},()=>{t&&o({source:e})}),()=>{t=!1}},[e]);let l=a?.source===e?a:void 0,u=typeof e==`function`?l?.url:e;if(!u||s===u){let r=typeof e==`function`&&l===void 0;return(0,T.jsx)(`span`,{"aria-busy":r,role:`img`,"aria-label":n??t,className:`text-muted-foreground`,children:r?n:`${t}${n?`:${n}`:``}`})}let d=(0,T.jsx)(`img`,{...i,alt:n??``,src:u,loading:`lazy`,decoding:`async`,onError:e=>{c(u),i.onError?.(e)}});return r&&typeof u==`string`?r(d,u,n??``):d}var j=(0,w.createContext)(null);function M({children:e,resolveDownload:t}){return(0,T.jsx)(j.Provider,{value:t,children:e})}function te(e){return(0,w.useContext)(j)?.(e)??null}function N({children:e,enabled:t,name:n,open:r,url:i}){let{t:a}=g(`workbench`);return t?(0,T.jsxs)(p,{...r===void 0?{}:{open:r},modal:!1,children:[(0,T.jsx)(u,{asChild:!0,children:e}),(0,T.jsx)(h,{"aria-label":a(`openMenu.targetLabel`,{path:n}),children:(0,T.jsx)(d,{asChild:!0,children:(0,T.jsxs)(`a`,{download:n,href:i,children:[(0,T.jsx)(y,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,T.jsx)(`span`,{children:a(`openMenu.download`)})]})})})]}):e}var P={};function F(e,t){let n=t||P;return I(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function I(e,t,n){if(re(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return ne(e.children,t,n)}return Array.isArray(e)?ne(e,t,n):``}function ne(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=I(e[i],t,n);return r.join(``)}function re(e){return!!(e&&typeof e==`object`)}var ie=document.createElement(`i`);function ae(e){let t=`&`+e+`;`;ie.innerHTML=t;let n=ie.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function L(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function R(e,t){return e.length>0?(L(e,e.length,0,t),e):t}var oe={}.hasOwnProperty;function se(e){let t={},n=-1;for(;++n<e.length;)ce(t,e[n]);return t}function ce(e,t){let n;for(n in t){let r=(oe.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){oe.call(r,a)||(r[a]=[]);let e=i[a];le(r[a],Array.isArray(e)?e:e?[e]:[])}}}function le(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);L(e,0,0,r)}function ue(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function z(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var B=K(/[A-Za-z]/),V=K(/[\dA-Za-z]/),de=K(/[#-'*+\--9=?A-Z^-~]/);function H(e){return e!==null&&(e<32||e===127)}var fe=K(/\d/),pe=K(/[\dA-Fa-f]/),me=K(/[!-/:-@[-`{-~]/);function U(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function G(e){return e===-2||e===-1||e===32}var he=K(/\p{P}|\p{S}/u),ge=K(/\s/);function K(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return G(r)?(e.enter(n),s(r)):t(r)}function s(r){return G(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var _e={tokenize:ve};function ve(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return U(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var ye={tokenize:xe},be={tokenize:Se};function xe(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return L(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(be,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(be,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return U(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;L(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Se(e,t,n){return q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Ce(e){if(e===null||W(e)||ge(e))return 1;if(he(e))return 2}function we(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Te={name:`attention`,resolveAll:Ee,tokenize:De};function Ee(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Oe(d,-c),Oe(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=R(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=R(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=R(l,we(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=R(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=R(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,L(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function De(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ce(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Ce(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Oe(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ke={name:`autolink`,tokenize:Ae};function Ae(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return B(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||V(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||V(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||H(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):de(t)?(e.consume(t),l):n(t)}function u(e){return V(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||V(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var J={partial:!0,tokenize:je};function je(e,t,n){return r;function r(t){return G(t)?q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||U(e)?t(e):n(e)}}var Me={continuation:{tokenize:Pe},exit:Fe,name:`blockQuote`,tokenize:Ne};function Ne(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return G(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Pe(e,t,n){let r=this;return i;function i(t){return G(t)?q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Me,t,n)(r)}}function Fe(e){e.exit(`blockQuote`)}var Ie={name:`characterEscape`,tokenize:Le};function Le(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return me(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Re={name:`characterReference`,tokenize:ze};function ze(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=V,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=pe,u):(e.enter(`characterReferenceValue`),a=7,o=fe,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===V&&!ae(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Be={partial:!0,tokenize:Ue},Ve={concrete:!0,name:`codeFenced`,tokenize:He};function He(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),G(t)?q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||U(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Be,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):G(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||U(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&G(t)?q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||U(t)?e.check(Be,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||U(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),G(t)?q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),G(t)?q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||U(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Ue(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var We={name:`codeIndented`,tokenize:Ke},Ge={partial:!0,tokenize:qe};function Ke(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):U(t)?e.attempt(Ge,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||U(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function qe(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):U(e)?i(e):n(e)}}var Je={name:`codeText`,previous:Xe,resolve:Ye,tokenize:Ze};function Ye(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Xe(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ze(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||U(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Qe=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Y(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Y(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Y(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Y(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Y(this.left,t.reverse())}}}};function Y(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $e(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Qe(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,et(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return L(e,0,1/0,u.slice(0)),!l}function et(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var tt={resolve:rt,tokenize:it},nt={partial:!0,tokenize:at};function rt(e){return $e(e),e}function it(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):U(t)?e.check(nt,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function at(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),q(e,a,`linePrefix`)}function a(i){if(i===null||U(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ot(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||H(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||U(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||W(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||H(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function st(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):U(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||U(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!G(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function ct(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||U(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function X(e,t){let n;return r;function r(i){return U(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):G(i)?q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var lt={name:`definition`,tokenize:dt},ut={partial:!0,tokenize:ft};function dt(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return st.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=z(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return W(t)?X(e,l)(t):l(t)}function l(t){return ot(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(ut,d,d)(t)}function d(t){return G(t)?q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||U(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function ft(e,t,n){return r;function r(t){return W(t)?X(e,i)(t):n(t)}function i(t){return ct(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return G(t)?q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||U(e)?t(e):n(e)}}var pt={name:`hardBreakEscape`,tokenize:mt};function mt(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return U(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var ht={name:`headingAtx`,resolve:gt,tokenize:_t};function gt(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},L(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function _t(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||W(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||U(n)?(e.exit(`atxHeading`),t(n)):G(n)?q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||W(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var vt=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),yt=[`pre`,`script`,`style`,`textarea`],bt={concrete:!0,name:`htmlFlow`,resolveTo:Ct,tokenize:wt},xt={partial:!0,tokenize:Et},St={partial:!0,tokenize:Tt};function Ct(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function wt(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):B(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):B(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return B(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||W(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&yt.includes(l)?(i=1,r.interrupt?t(s):O(s)):vt.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||V(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return G(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||B(t)?(e.consume(t),b):G(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||V(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):G(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):G(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||U(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||W(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||G(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||U(t)?O(t):G(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),F):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),N):U(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(xt,I,k)(t)):t===null||U(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(St,A,I)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||U(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),P):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return yt.includes(n)?(e.consume(t),F):O(t)}return B(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function N(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),F):t===45&&i===2?(e.consume(t),P):O(t)}function F(t){return t===null||U(t)?(e.exit(`htmlFlowData`),I(t)):(e.consume(t),F)}function I(n){return e.exit(`htmlFlow`),t(n)}}function Tt(e,t,n){let r=this;return i;function i(t){return U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Et(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(J,t,n)}}var Dt={name:`htmlText`,tokenize:Ot};function Ot(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):B(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):B(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):U(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):U(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):U(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):U(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return B(t)?(e.consume(t),S):n(t)}function S(t){return t===45||V(t)?(e.consume(t),S):C(t)}function C(t){return U(t)?(o=C,M(t)):G(t)?(e.consume(t),C):j(t)}function w(t){return t===45||V(t)?(e.consume(t),w):t===47||t===62||W(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||B(t)?(e.consume(t),E):U(t)?(o=T,M(t)):G(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||V(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):U(t)?(o=D,M(t)):G(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):U(t)?(o=O,M(t)):G(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):U(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||W(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||W(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return G(t)?q(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var kt={name:`labelEnd`,resolveAll:Nt,resolveTo:Pt,tokenize:Ft},At={tokenize:It},jt={tokenize:Lt},Mt={tokenize:Rt};function Nt(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&L(e,0,e.length,n),e}function Pt(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=R(s,e.slice(a+1,a+r+3)),s=R(s,[[`enter`,u,t]]),s=R(s,we(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=R(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=R(s,e.slice(o+1)),s=R(s,[[`exit`,c,t]]),L(e,a,e.length,s),e}function Ft(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(z(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(At,u,o?u:d)(t):t===91?e.attempt(jt,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Mt,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function It(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return W(t)?X(e,a)(t):a(t)}function a(t){return t===41?u(t):ot(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return W(t)?X(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?ct(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return W(t)?X(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Lt(e,t,n){let r=this;return i;function i(t){return st.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(z(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Rt(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var zt={name:`labelStartImage`,resolveAll:kt.resolveAll,tokenize:Bt};function Bt(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Vt={name:`labelStartLink`,resolveAll:kt.resolveAll,tokenize:Ht};function Ht(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Ut={name:`lineEnding`,tokenize:Wt};function Wt(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),q(e,t,`linePrefix`)}}var Gt={name:`thematicBreak`,tokenize:Kt};function Kt(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||U(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),G(t)?q(e,s,`whitespace`)(t):s(t))}}var Z={continuation:{tokenize:Xt},exit:Qt,name:`list`,tokenize:Yt},qt={partial:!0,tokenize:$t},Jt={partial:!0,tokenize:Zt};function Yt(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:fe(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Gt,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return fe(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(J,r.interrupt?n:u,e.attempt(qt,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return G(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Xt(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(J,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!G(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Jt,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,q(e,e.attempt(Z,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Zt(e,t,n){let r=this;return q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Qt(e){e.exit(this.containerState.type)}function $t(e,t,n){let r=this;return q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!G(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var en={name:`setextUnderline`,resolveTo:tn,tokenize:nn};function tn(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function nn(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),G(t)?q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||U(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var rn={tokenize:an};function an(e){let t=this,n=e.attempt(J,r,e.attempt(this.parser.constructs.flowInitial,i,q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(tt,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var on={resolveAll:un()},sn=ln(`string`),cn=ln(`text`);function ln(e){return{resolveAll:un(e===`text`?dn:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function un(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function dn(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var fn=t({attentionMarkers:()=>bn,contentInitial:()=>mn,disable:()=>xn,document:()=>pn,flow:()=>gn,flowInitial:()=>hn,insideSpan:()=>yn,string:()=>_n,text:()=>vn}),pn={42:Z,43:Z,45:Z,48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,62:Me},mn={91:lt},hn={[-2]:We,[-1]:We,32:We},gn={35:ht,42:Gt,45:[en,Gt],60:bt,61:en,95:Gt,96:Ve,126:Ve},_n={38:Re,92:Ie},vn={[-5]:Ut,[-4]:Ut,[-3]:Ut,33:zt,38:Re,42:Te,60:[ke,Dt],91:Vt,92:[pt,Ie],93:kt,95:Te,96:Je},yn={null:[Te,on]},bn={null:[42,95]},xn={null:[]};function Sn(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=R(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=we(a,l.events,l),l.events):[]}function f(e,t){return wn(p(e),t)}function p(e){return Cn(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){U(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&L(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Cn(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function wn(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
2
- `;break;case-3:o=`\r
3
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Tn(e){let t={constructs:se([fn,...(e||{}).extensions||[]]),content:n(_e),defined:[],document:n(ye),flow:n(rn),lazy:{},string:n(sn),text:n(cn)};return t;function n(e){return n;function n(n){return Sn(t,e,n)}}}function En(e){for(;!$e(e););return e}var Dn=/[\0\t\n\r]/g;function On(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Dn.lastIndex=u,c=Dn.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var kn=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function An(e){return e.replace(kn,jn)}function jn(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return ue(n.slice(t?2:1),t?16:10)}return ae(n)||e}function Q(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Nn(e.position):`start`in e||`end`in e?Nn(e):`line`in e||`column`in e?Mn(e):``}function Mn(e){return Pn(e&&e.line)+`:`+Pn(e&&e.column)}function Nn(e){return Mn(e&&e.start)+`-`+Mn(e&&e.end)}function Pn(e){return e&&typeof e==`number`?e:1}var Fn={}.hasOwnProperty;function In(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Ln(n)(En(Tn(n).document().write(On()(e,t,!0))))}function Ln(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(W),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(fe),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(B),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(B,o),codeText:a(V,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(de),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(H),hardBreakEscape:a(pe),hardBreakTrailing:a(pe),htmlFlow:a(me,o),htmlFlowData:T,htmlText:a(me,o),htmlTextData:T,image:a(U),label:o,link:a(W),listItem:a(he),listItemValue:f,listOrdered:a(G,d),listUnordered:a(G),paragraph:a(ge),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(fe),strong:a(K),thematicBreak:a(_e)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:L,characterReferenceMarkerNumeric:L,characterReferenceValue:R,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:N,labelText:te,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:P,resourceTitleString:I,resource:ne,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Rn(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Fn.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Bn).call(a,void 0,e[0])}for(r.position={start:$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:$(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Bn).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Q({start:e.start,end:e.end})+`): it’s not open`);n.position.end=$(e.end)}function u(){return F(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=z(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=q(),n.position={start:$(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=$(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=$(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=An(t),n.identifier=z(t).toLowerCase()}function N(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=z(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function L(e){this.data.characterReferenceType=e.type}function R(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=ue(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ae(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=$(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function B(){return{type:`code`,lang:null,meta:null,value:``}}function V(){return{type:`inlineCode`,value:``}}function de(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function H(){return{type:`emphasis`,children:[]}}function fe(){return{type:`heading`,depth:0,children:[]}}function pe(){return{type:`break`}}function me(){return{type:`html`,value:``}}function U(){return{type:`image`,title:null,url:``,alt:null}}function W(){return{type:`link`,title:null,url:``,children:[]}}function G(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function he(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ge(){return{type:`paragraph`,children:[]}}function K(){return{type:`strong`,children:[]}}function q(){return{type:`text`,value:``}}function _e(){return{type:`thematicBreak`}}}function $(e){return{line:e.line,column:e.column,offset:e.offset}}function Rn(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Rn(e,r):zn(e,r)}}function zn(e,t){let n;for(n in t)if(Fn.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Bn(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Q({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Q({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Q({start:t.start,end:t.end})+`) is still open`)}function Vn({name:e,triggerChildren:t,triggerClassName:n,url:r}){let{t:u}=g(`conversation`),d=b(),[p,h]=(0,w.useState)(!1),v=(0,w.useId)();return(0,T.jsxs)(l,{onOpenChange:h,open:p,children:[(0,T.jsx)(N,{enabled:d,name:e,url:r,children:(0,T.jsx)(m,{asChild:!0,children:(0,T.jsx)(c,{"aria-label":u(`timeline.showImage`,{name:e}),className:n??`block size-40 max-w-full cursor-zoom-in overflow-hidden rounded-surface bg-control p-0 shadow-control transition-opacity hover:opacity-90 focus-visible:shadow-focus`,"data-message-attachment":`image`,type:`button`,variant:`ghost`,children:t??(0,T.jsx)(`img`,{alt:e,className:`size-full object-cover`,decoding:`async`,height:160,loading:`lazy`,src:r,width:160})})})}),(0,T.jsx)(i,{"aria-labelledby":v,className:`h-[min(92dvh,54rem)] max-w-[72rem] overflow-hidden p-0`,"data-message-image-preview":``,children:(0,T.jsxs)(`section`,{className:`grid size-full grid-rows-[auto_minmax(0,1fr)] bg-raised`,children:[(0,T.jsxs)(`header`,{className:`flex min-h-toolbar items-center gap-3 px-3 shadow-toolbar sm:px-4`,children:[(0,T.jsx)(a,{className:`min-w-0 flex-1 truncate text-body-small`,id:v,children:e}),(0,T.jsxs)(f,{children:[(0,T.jsx)(s,{asChild:!0,children:(0,T.jsx)(c,{"aria-label":u(`timeline.closeImagePreview`),onClick:()=>{h(!1)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,T.jsx)(_,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,T.jsx)(o,{children:u(`timeline.closeImagePreview`)})]})]}),(0,T.jsx)(x,{alt:e,src:r})]})})]})}function Hn(e,t,n){return(0,T.jsx)(Vn,{name:n,url:t,triggerChildren:e,triggerClassName:`block h-auto w-full max-w-full cursor-zoom-in overflow-hidden rounded-surface p-0 hover:opacity-90 focus-visible:shadow-focus`})}function Un(e){let{t}=g(`workbench`);return(0,T.jsx)(A,{...e,renderPreview:Hn,unavailableLabel:t(`composer.attachmentReadFailed`)})}var Wn=`inline-flex max-w-full items-center gap-1 rounded-control px-0.5 align-text-bottom text-sm leading-5 font-medium text-brand`,Gn=`/__codexly_followup__/`,Kn=`/__codexly_git_receipt__/`,qn=[`git-stage`,`git-commit`,`git-create-branch`,`git-push`,`git-create-pr`];function Jn(e){return qn.some(t=>t===e)}function Yn(e){if(!Jn(e.name))return null;let t=e.attributes.get(`cwd`),n=e.attributes.get(`branch`);if(!t?.trim()||e.name!==`git-stage`&&e.name!==`git-commit`&&!n?.trim())return null;let r=e.attributes.get(`url`);return{kind:e.name,cwd:t,...n===void 0?{}:{branch:n},...r!==void 0&&/^https?:\/\//iu.test(r)?{url:r}:{},isDraft:e.attributes.get(`isDraft`)===`true`}}function Xn(e){try{if(e?.startsWith(`/__codexly_followup__/`)){let t=decodeURIComponent(e.slice(22).split(`#`)[0]??``);return t.trim()?{kind:`followup`,prompt:t}:null}if(e?.startsWith(`/__codexly_git_receipt__/`)){let t=JSON.parse(decodeURIComponent(e.slice(25)));if(typeof t!=`object`||!t)return null;let n=t;if(typeof n.kind!=`string`||typeof n.cwd!=`string`)return null;let r=new Map([[`cwd`,n.cwd]]);return typeof n.branch==`string`&&r.set(`branch`,n.branch),typeof n.url==`string`&&r.set(`url`,n.url),n.isDraft===!0&&r.set(`isDraft`,`true`),Yn({start:0,end:0,name:n.kind,label:null,attributes:r})}}catch{return null}return null}var Zn=(0,w.createContext)(null);function Qn(e,t,n,r){let i=Xn(e);if(i===null)return null;let a=i.kind===`git-create-pr`&&i.isDraft?`git-create-pr-draft`:i.kind;return(0,T.jsx)(er,{directive:i,label:n(a),...r===void 0?{}:{onNavigate:r},children:t})}function $n({children:e,onSelect:t}){return(0,T.jsx)(Zn.Provider,{value:t,children:e})}function er({children:e,directive:t,label:n,onNavigate:r}){let i=(0,w.useContext)(Zn);if(t.kind===`followup`)return i===null?(0,T.jsx)(`span`,{"data-codex-followup":`true`,className:`inline-flex items-center gap-1.5`,children:e}):(0,T.jsx)(c,{variant:`outline`,size:`sm`,className:`my-1 h-auto max-w-full whitespace-normal py-1.5 text-left`,"data-codex-followup":`true`,title:n,onClick:()=>{i(t.prompt)},type:`button`,children:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(C,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{children:e})]})});let a=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{children:n}),t.branch?(0,T.jsx)(`span`,{className:`max-w-48 truncate font-mono text-caption`,children:t.branch}):null]}),o=`my-1 inline-flex max-w-full items-center gap-1.5 rounded-control border border-separator px-2 py-1 text-label text-muted-foreground align-middle`;return t.kind===`git-create-pr`&&t.url!==void 0?(0,T.jsx)(`a`,{className:`${o} text-brand hover:bg-control-hover`,"data-codex-git-receipt":t.kind,href:t.url,title:t.cwd,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>r?.(e,t.url??``),children:a}):(0,T.jsx)(`span`,{className:o,"data-codex-git-receipt":t.kind,title:t.cwd,children:a})}export{k as A,z as C,N as D,F as E,M as O,ge as S,L as T,H as _,Yn as a,G as b,Un as c,J as d,we as f,V as g,B as h,Kn as i,S as j,te as k,In as l,q as m,Qn as n,Wn as o,Ce as p,Gn as r,Vn as s,$n as t,Q as u,U as v,se as w,he as x,W as y};