@jingyi0605/codingns 0.1.0 → 0.1.2

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 (241) hide show
  1. package/README.md +14 -0
  2. package/dist/public/assets/TerminalPage-Dr7knYq2.js +55 -0
  3. package/dist/public/assets/index-BpUi6zoT.js +108 -0
  4. package/dist/public/assets/index-NMtdQNda.css +1 -0
  5. package/dist/public/index.html +2 -2
  6. package/dist/server/config/env.js +72 -7
  7. package/dist/server/config/env.js.map +1 -1
  8. package/dist/server/config/opencode-base-url-resolver.d.ts +13 -8
  9. package/dist/server/config/opencode-base-url-resolver.js +117 -147
  10. package/dist/server/config/opencode-base-url-resolver.js.map +1 -1
  11. package/dist/server/config/opencode-system-probe-helper-client.d.ts +18 -0
  12. package/dist/server/config/opencode-system-probe-helper-client.js +127 -0
  13. package/dist/server/config/opencode-system-probe-helper-client.js.map +1 -0
  14. package/dist/server/config/opencode-system-probe-helper-process.d.ts +1 -0
  15. package/dist/server/config/opencode-system-probe-helper-process.js +208 -0
  16. package/dist/server/config/opencode-system-probe-helper-process.js.map +1 -0
  17. package/dist/server/modules/git/git-command-helper-client.d.ts +25 -0
  18. package/dist/server/modules/git/git-command-helper-client.js +143 -0
  19. package/dist/server/modules/git/git-command-helper-client.js.map +1 -0
  20. package/dist/server/modules/git/git-command-helper-process.d.ts +1 -0
  21. package/dist/server/modules/git/git-command-helper-process.js +237 -0
  22. package/dist/server/modules/git/git-command-helper-process.js.map +1 -0
  23. package/dist/server/modules/git/git-command-runner.d.ts +8 -0
  24. package/dist/server/modules/git/git-command-runner.js +77 -6
  25. package/dist/server/modules/git/git-command-runner.js.map +1 -1
  26. package/dist/server/modules/git/git-controller.d.ts +4 -0
  27. package/dist/server/modules/git/git-controller.js +4 -1
  28. package/dist/server/modules/git/git-controller.js.map +1 -1
  29. package/dist/server/modules/git/git-read-service.d.ts +2 -1
  30. package/dist/server/modules/git/git-read-service.js +30 -0
  31. package/dist/server/modules/git/git-read-service.js.map +1 -1
  32. package/dist/server/modules/git/git-write-service.d.ts +1 -1
  33. package/dist/server/modules/git/git-write-service.js +8 -7
  34. package/dist/server/modules/git/git-write-service.js.map +1 -1
  35. package/dist/server/modules/git/types.d.ts +5 -0
  36. package/dist/server/modules/preferences/common.d.ts +2 -0
  37. package/dist/server/modules/preferences/common.js +13 -0
  38. package/dist/server/modules/preferences/common.js.map +1 -0
  39. package/dist/server/modules/preferences/profile-controller.d.ts +11 -0
  40. package/dist/server/modules/preferences/profile-controller.js +14 -0
  41. package/dist/server/modules/preferences/profile-controller.js.map +1 -0
  42. package/dist/server/modules/preferences/profile-service.d.ts +17 -0
  43. package/dist/server/modules/preferences/profile-service.js +213 -0
  44. package/dist/server/modules/preferences/profile-service.js.map +1 -0
  45. package/dist/server/modules/preferences/quick-phrase-controller.js +2 -12
  46. package/dist/server/modules/preferences/quick-phrase-controller.js.map +1 -1
  47. package/dist/server/modules/provider/codex-model-options.js +26 -165
  48. package/dist/server/modules/provider/codex-model-options.js.map +1 -1
  49. package/dist/server/modules/provider/opencode-model-options.js +6 -71
  50. package/dist/server/modules/provider/opencode-model-options.js.map +1 -1
  51. package/dist/server/modules/provider/provider-controller.d.ts +2 -0
  52. package/dist/server/modules/provider/provider-controller.js +21 -1
  53. package/dist/server/modules/provider/provider-controller.js.map +1 -1
  54. package/dist/server/modules/provider/provider-discovery-helper-client.d.ts +25 -0
  55. package/dist/server/modules/provider/provider-discovery-helper-client.js +114 -0
  56. package/dist/server/modules/provider/provider-discovery-helper-client.js.map +1 -0
  57. package/dist/server/modules/provider/provider-discovery-helper-process.d.ts +1 -0
  58. package/dist/server/modules/provider/provider-discovery-helper-process.js +296 -0
  59. package/dist/server/modules/provider/provider-discovery-helper-process.js.map +1 -0
  60. package/dist/server/modules/sessions/claude-runtime-helper-client.d.ts +28 -0
  61. package/dist/server/modules/sessions/claude-runtime-helper-client.js +221 -0
  62. package/dist/server/modules/sessions/claude-runtime-helper-client.js.map +1 -0
  63. package/dist/server/modules/sessions/claude-runtime-helper-process.d.ts +1 -0
  64. package/dist/server/modules/sessions/claude-runtime-helper-process.js +146 -0
  65. package/dist/server/modules/sessions/claude-runtime-helper-process.js.map +1 -0
  66. package/dist/server/modules/sessions/codex-app-server-helper-client.d.ts +16 -0
  67. package/dist/server/modules/sessions/codex-app-server-helper-client.js +237 -0
  68. package/dist/server/modules/sessions/codex-app-server-helper-client.js.map +1 -0
  69. package/dist/server/modules/sessions/codex-app-server-helper-process.d.ts +1 -0
  70. package/dist/server/modules/sessions/codex-app-server-helper-process.js +484 -0
  71. package/dist/server/modules/sessions/codex-app-server-helper-process.js.map +1 -0
  72. package/dist/server/modules/sessions/session-activity-authority-service.d.ts +52 -0
  73. package/dist/server/modules/sessions/session-activity-authority-service.js +377 -0
  74. package/dist/server/modules/sessions/session-activity-authority-service.js.map +1 -0
  75. package/dist/server/modules/sessions/session-activity-inspector.js +80 -40
  76. package/dist/server/modules/sessions/session-activity-inspector.js.map +1 -1
  77. package/dist/server/modules/sessions/session-controller.d.ts +15 -1
  78. package/dist/server/modules/sessions/session-controller.js +14 -1
  79. package/dist/server/modules/sessions/session-controller.js.map +1 -1
  80. package/dist/server/modules/sessions/session-history-service.d.ts +8 -3
  81. package/dist/server/modules/sessions/session-history-service.js +303 -64
  82. package/dist/server/modules/sessions/session-history-service.js.map +1 -1
  83. package/dist/server/modules/sessions/session-live-runtime-service.d.ts +40 -4
  84. package/dist/server/modules/sessions/session-live-runtime-service.js +334 -44
  85. package/dist/server/modules/sessions/session-live-runtime-service.js.map +1 -1
  86. package/dist/server/modules/sessions/session-permission-request-service.d.ts +175 -0
  87. package/dist/server/modules/sessions/session-permission-request-service.js +1615 -0
  88. package/dist/server/modules/sessions/session-permission-request-service.js.map +1 -0
  89. package/dist/server/modules/sessions/session-provider-error-mapper.js +14 -0
  90. package/dist/server/modules/sessions/session-provider-error-mapper.js.map +1 -1
  91. package/dist/server/modules/terminal/command-template-service.d.ts +2 -2
  92. package/dist/server/modules/terminal/command-template-service.js +3 -3
  93. package/dist/server/modules/terminal/command-template-service.js.map +1 -1
  94. package/dist/server/modules/terminal/runtime/adapters/conpty-control-helper-client.d.ts +24 -0
  95. package/dist/server/modules/terminal/runtime/adapters/conpty-control-helper-client.js +104 -0
  96. package/dist/server/modules/terminal/runtime/adapters/conpty-control-helper-client.js.map +1 -0
  97. package/dist/server/modules/terminal/runtime/adapters/conpty-control-helper-process.d.ts +1 -0
  98. package/dist/server/modules/terminal/runtime/adapters/conpty-control-helper-process.js +96 -0
  99. package/dist/server/modules/terminal/runtime/adapters/conpty-control-helper-process.js.map +1 -0
  100. package/dist/server/modules/terminal/runtime/adapters/conpty-runtime-adapter.d.ts +37 -0
  101. package/dist/server/modules/terminal/runtime/adapters/conpty-runtime-adapter.js +123 -0
  102. package/dist/server/modules/terminal/runtime/adapters/conpty-runtime-adapter.js.map +1 -0
  103. package/dist/server/modules/terminal/runtime/adapters/embedded-pty-runtime-adapter.d.ts +12 -5
  104. package/dist/server/modules/terminal/runtime/adapters/embedded-pty-runtime-adapter.js +44 -4
  105. package/dist/server/modules/terminal/runtime/adapters/embedded-pty-runtime-adapter.js.map +1 -1
  106. package/dist/server/modules/terminal/runtime/adapters/tmux-helper-client.d.ts +14 -0
  107. package/dist/server/modules/terminal/runtime/adapters/tmux-helper-client.js +105 -0
  108. package/dist/server/modules/terminal/runtime/adapters/tmux-helper-client.js.map +1 -0
  109. package/dist/server/modules/terminal/runtime/adapters/tmux-helper-process.d.ts +1 -0
  110. package/dist/server/modules/terminal/runtime/adapters/tmux-helper-process.js +67 -0
  111. package/dist/server/modules/terminal/runtime/adapters/tmux-helper-process.js.map +1 -0
  112. package/dist/server/modules/terminal/runtime/adapters/tmux-runtime-adapter.d.ts +8 -12
  113. package/dist/server/modules/terminal/runtime/adapters/tmux-runtime-adapter.js +112 -21
  114. package/dist/server/modules/terminal/runtime/adapters/tmux-runtime-adapter.js.map +1 -1
  115. package/dist/server/modules/terminal/runtime/conpty-runtime-shared.d.ts +25 -0
  116. package/dist/server/modules/terminal/runtime/conpty-runtime-shared.js +124 -0
  117. package/dist/server/modules/terminal/runtime/conpty-runtime-shared.js.map +1 -0
  118. package/dist/server/modules/terminal/runtime/conpty-session-agent-process.d.ts +1 -0
  119. package/dist/server/modules/terminal/runtime/conpty-session-agent-process.js +205 -0
  120. package/dist/server/modules/terminal/runtime/conpty-session-agent-process.js.map +1 -0
  121. package/dist/server/modules/terminal/runtime/conpty-session-attach-client.d.ts +1 -0
  122. package/dist/server/modules/terminal/runtime/conpty-session-attach-client.js +108 -0
  123. package/dist/server/modules/terminal/runtime/conpty-session-attach-client.js.map +1 -0
  124. package/dist/server/modules/terminal/runtime/conpty-session-control-client.d.ts +1 -0
  125. package/dist/server/modules/terminal/runtime/conpty-session-control-client.js +90 -0
  126. package/dist/server/modules/terminal/runtime/conpty-session-control-client.js.map +1 -0
  127. package/dist/server/modules/terminal/runtime/pty-broker-agent-process.d.ts +1 -0
  128. package/dist/server/modules/terminal/runtime/pty-broker-agent-process.js +179 -0
  129. package/dist/server/modules/terminal/runtime/pty-broker-agent-process.js.map +1 -0
  130. package/dist/server/modules/terminal/runtime/pty-broker-client.d.ts +29 -0
  131. package/dist/server/modules/terminal/runtime/pty-broker-client.js +169 -0
  132. package/dist/server/modules/terminal/runtime/pty-broker-client.js.map +1 -0
  133. package/dist/server/modules/terminal/runtime/pty-broker-shared.d.ts +22 -0
  134. package/dist/server/modules/terminal/runtime/pty-broker-shared.js +123 -0
  135. package/dist/server/modules/terminal/runtime/pty-broker-shared.js.map +1 -0
  136. package/dist/server/modules/terminal/runtime/pty-host-attachment-manager.d.ts +1 -0
  137. package/dist/server/modules/terminal/runtime/pty-host-attachment-manager.js +11 -1
  138. package/dist/server/modules/terminal/runtime/pty-host-attachment-manager.js.map +1 -1
  139. package/dist/server/modules/terminal/runtime/terminal-log-file-store.d.ts +1 -0
  140. package/dist/server/modules/terminal/runtime/terminal-log-file-store.js +7 -1
  141. package/dist/server/modules/terminal/runtime/terminal-log-file-store.js.map +1 -1
  142. package/dist/server/modules/terminal/runtime/terminal-log-spooler.js +3 -2
  143. package/dist/server/modules/terminal/runtime/terminal-log-spooler.js.map +1 -1
  144. package/dist/server/modules/terminal/runtime/terminal-runtime-adapter.d.ts +5 -3
  145. package/dist/server/modules/terminal/runtime/terminal-runtime-manager.d.ts +11 -5
  146. package/dist/server/modules/terminal/runtime/terminal-runtime-manager.js +110 -13
  147. package/dist/server/modules/terminal/runtime/terminal-runtime-manager.js.map +1 -1
  148. package/dist/server/modules/terminal/terminal-controller.js +7 -7
  149. package/dist/server/modules/terminal/terminal-controller.js.map +1 -1
  150. package/dist/server/modules/terminal/terminal-service.d.ts +30 -14
  151. package/dist/server/modules/terminal/terminal-service.js +260 -51
  152. package/dist/server/modules/terminal/terminal-service.js.map +1 -1
  153. package/dist/server/modules/terminal/terminal-shell.d.ts +4 -0
  154. package/dist/server/modules/terminal/terminal-shell.js +165 -18
  155. package/dist/server/modules/terminal/terminal-shell.js.map +1 -1
  156. package/dist/server/modules/workbench/workspace-file-watcher.d.ts +30 -0
  157. package/dist/server/modules/workbench/workspace-file-watcher.js +137 -0
  158. package/dist/server/modules/workbench/workspace-file-watcher.js.map +1 -0
  159. package/dist/server/modules/workbench/workspace-panel-snapshot-service.js +43 -7
  160. package/dist/server/modules/workbench/workspace-panel-snapshot-service.js.map +1 -1
  161. package/dist/server/routes/git.js +1 -0
  162. package/dist/server/routes/git.js.map +1 -1
  163. package/dist/server/routes/preferences.d.ts +2 -1
  164. package/dist/server/routes/preferences.js +3 -1
  165. package/dist/server/routes/preferences.js.map +1 -1
  166. package/dist/server/routes/sessions.js +2 -0
  167. package/dist/server/routes/sessions.js.map +1 -1
  168. package/dist/server/server/create-server.d.ts +4 -0
  169. package/dist/server/server/create-server.js +22 -5
  170. package/dist/server/server/create-server.js.map +1 -1
  171. package/dist/server/shared/utils/command-launch.d.ts +6 -0
  172. package/dist/server/shared/utils/command-launch.js +39 -0
  173. package/dist/server/shared/utils/command-launch.js.map +1 -0
  174. package/dist/server/shared/utils/perf-log.d.ts +1 -0
  175. package/dist/server/shared/utils/perf-log.js +8 -2
  176. package/dist/server/shared/utils/perf-log.js.map +1 -1
  177. package/dist/server/shared/utils/permission-debug-log.d.ts +2 -0
  178. package/dist/server/shared/utils/permission-debug-log.js +40 -0
  179. package/dist/server/shared/utils/permission-debug-log.js.map +1 -0
  180. package/dist/server/shared/utils/terminal-debug-log.d.ts +4 -0
  181. package/dist/server/shared/utils/terminal-debug-log.js +71 -0
  182. package/dist/server/shared/utils/terminal-debug-log.js.map +1 -0
  183. package/dist/server/storage/repositories/user-preference-profile-repository.d.ts +8 -0
  184. package/dist/server/storage/repositories/user-preference-profile-repository.js +46 -0
  185. package/dist/server/storage/repositories/user-preference-profile-repository.js.map +1 -0
  186. package/dist/server/storage/sqlite/schema.sql +13 -0
  187. package/dist/server/types/domain.d.ts +28 -1
  188. package/dist/server/ws/terminal-ws-hub.d.ts +2 -0
  189. package/dist/server/ws/terminal-ws-hub.js +42 -5
  190. package/dist/server/ws/terminal-ws-hub.js.map +1 -1
  191. package/dist/server/ws/workbench-ws-hub.d.ts +9 -1
  192. package/dist/server/ws/workbench-ws-hub.js +132 -21
  193. package/dist/server/ws/workbench-ws-hub.js.map +1 -1
  194. package/dist/server/ws/ws-server.d.ts +22 -1
  195. package/dist/server/ws/ws-server.js +134 -46
  196. package/dist/server/ws/ws-server.js.map +1 -1
  197. package/node_modules/@codingns/session-sync-core/dist/claude-message-utils.d.ts +4 -1
  198. package/node_modules/@codingns/session-sync-core/dist/claude-message-utils.js +107 -6
  199. package/node_modules/@codingns/session-sync-core/dist/claude-message-utils.js.map +1 -1
  200. package/node_modules/@codingns/session-sync-core/dist/patch-builder.d.ts +30 -0
  201. package/node_modules/@codingns/session-sync-core/dist/patch-builder.js +103 -0
  202. package/node_modules/@codingns/session-sync-core/dist/patch-builder.js.map +1 -0
  203. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.d.ts +1 -1
  204. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.js +38 -6
  205. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.js.map +1 -1
  206. package/node_modules/@codingns/session-sync-core/dist/providers/codex.d.ts +1 -1
  207. package/node_modules/@codingns/session-sync-core/dist/providers/codex.js +1 -1
  208. package/node_modules/@codingns/session-sync-core/dist/providers/codex.js.map +1 -1
  209. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-permissions.d.ts +1 -0
  210. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-permissions.js +8 -0
  211. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-permissions.js.map +1 -0
  212. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-shared.js +87 -7
  213. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-shared.js.map +1 -1
  214. package/node_modules/@codingns/session-sync-core/dist/providers/opencode.d.ts +1 -1
  215. package/node_modules/@codingns/session-sync-core/dist/providers/opencode.js +8 -4
  216. package/node_modules/@codingns/session-sync-core/dist/providers/opencode.js.map +1 -1
  217. package/node_modules/@codingns/session-sync-core/dist/runtime/active-run-registry.d.ts +1 -0
  218. package/node_modules/@codingns/session-sync-core/dist/runtime/active-run-registry.js +5 -0
  219. package/node_modules/@codingns/session-sync-core/dist/runtime/active-run-registry.js.map +1 -1
  220. package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.d.ts +5 -0
  221. package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.js +114 -6
  222. package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.js.map +1 -1
  223. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.d.ts +23 -0
  224. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js +721 -18
  225. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js.map +1 -1
  226. package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.d.ts +3 -0
  227. package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.js +106 -23
  228. package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.js.map +1 -1
  229. package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.d.ts +1 -0
  230. package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.js +3 -0
  231. package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.js.map +1 -1
  232. package/node_modules/@codingns/session-sync-core/dist/runtime/types.d.ts +1 -0
  233. package/node_modules/@codingns/session-sync-core/dist/services.d.ts +1 -1
  234. package/node_modules/@codingns/session-sync-core/dist/services.js +2 -2
  235. package/node_modules/@codingns/session-sync-core/dist/services.js.map +1 -1
  236. package/node_modules/@codingns/session-sync-core/dist/types.d.ts +1 -1
  237. package/package.json +6 -2
  238. package/scripts/postinstall.mjs +218 -0
  239. package/dist/public/assets/TerminalPage-Dj_VDew3.js +0 -54
  240. package/dist/public/assets/index-C1GZV2wq.js +0 -106
  241. package/dist/public/assets/index-DU7f8NaZ.css +0 -1
@@ -0,0 +1,108 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalPage-Dr7knYq2.js","assets/TerminalPage-6GBZ9nXN.css"])))=>i.map(i=>d[i]);
2
+ var U1=Object.defineProperty;var W1=(e,t,n)=>t in e?U1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ke=(e,t,n)=>W1(e,typeof t!="symbol"?t+"":t,n);function $b(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const c=Object.getOwnPropertyDescriptor(s,a);c&&Object.defineProperty(e,a,c.get?c:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(a){if(a.ep)return;a.ep=!0;const c=n(a);fetch(a.href,c)}})();function Fa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zd={exports:{}},ra={},Hd={exports:{}},It={};/**
3
+ * @license React
4
+ * react.production.min.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var sy;function z1(){if(sy)return It;sy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function b(W){return W===null||typeof W!="object"?null:(W=g&&W[g]||W["@@iterator"],typeof W=="function"?W:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function j(W,re,T){this.props=W,this.context=re,this.refs=C,this.updater=T||k}j.prototype.isReactComponent={},j.prototype.setState=function(W,re){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,re,"setState")},j.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function A(){}A.prototype=j.prototype;function L(W,re,T){this.props=W,this.context=re,this.refs=C,this.updater=T||k}var M=L.prototype=new A;M.constructor=L,S(M,j.prototype),M.isPureReactComponent=!0;var O=Array.isArray,q=Object.prototype.hasOwnProperty,_={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function F(W,re,T){var ae,Le={},je=null,He=null;if(re!=null)for(ae in re.ref!==void 0&&(He=re.ref),re.key!==void 0&&(je=""+re.key),re)q.call(re,ae)&&!I.hasOwnProperty(ae)&&(Le[ae]=re[ae]);var qe=arguments.length-2;if(qe===1)Le.children=T;else if(1<qe){for(var et=Array(qe),ot=0;ot<qe;ot++)et[ot]=arguments[ot+2];Le.children=et}if(W&&W.defaultProps)for(ae in qe=W.defaultProps,qe)Le[ae]===void 0&&(Le[ae]=qe[ae]);return{$$typeof:e,type:W,key:je,ref:He,props:Le,_owner:_.current}}function D(W,re){return{$$typeof:e,type:W.type,key:re,ref:W.ref,props:W.props,_owner:W._owner}}function P(W){return typeof W=="object"&&W!==null&&W.$$typeof===e}function K(W){var re={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(T){return re[T]})}var X=/\/+/g;function $(W,re){return typeof W=="object"&&W!==null&&W.key!=null?K(""+W.key):re.toString(36)}function ee(W,re,T,ae,Le){var je=typeof W;(je==="undefined"||je==="boolean")&&(W=null);var He=!1;if(W===null)He=!0;else switch(je){case"string":case"number":He=!0;break;case"object":switch(W.$$typeof){case e:case t:He=!0}}if(He)return He=W,Le=Le(He),W=ae===""?"."+$(He,0):ae,O(Le)?(T="",W!=null&&(T=W.replace(X,"$&/")+"/"),ee(Le,re,T,"",function(ot){return ot})):Le!=null&&(P(Le)&&(Le=D(Le,T+(!Le.key||He&&He.key===Le.key?"":(""+Le.key).replace(X,"$&/")+"/")+W)),re.push(Le)),1;if(He=0,ae=ae===""?".":ae+":",O(W))for(var qe=0;qe<W.length;qe++){je=W[qe];var et=ae+$(je,qe);He+=ee(je,re,T,et,Le)}else if(et=b(W),typeof et=="function")for(W=et.call(W),qe=0;!(je=W.next()).done;)je=je.value,et=ae+$(je,qe++),He+=ee(je,re,T,et,Le);else if(je==="object")throw re=String(W),Error("Objects are not valid as a React child (found: "+(re==="[object Object]"?"object with keys {"+Object.keys(W).join(", ")+"}":re)+"). If you meant to render a collection of children, use an array instead.");return He}function te(W,re,T){if(W==null)return W;var ae=[],Le=0;return ee(W,ae,"","",function(je){return re.call(T,je,Le++)}),ae}function pe(W){if(W._status===-1){var re=W._result;re=re(),re.then(function(T){(W._status===0||W._status===-1)&&(W._status=1,W._result=T)},function(T){(W._status===0||W._status===-1)&&(W._status=2,W._result=T)}),W._status===-1&&(W._status=0,W._result=re)}if(W._status===1)return W._result.default;throw W._result}var ne={current:null},z={transition:null},ye={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:z,ReactCurrentOwner:_};function E(){throw Error("act(...) is not supported in production builds of React.")}return It.Children={map:te,forEach:function(W,re,T){te(W,function(){re.apply(this,arguments)},T)},count:function(W){var re=0;return te(W,function(){re++}),re},toArray:function(W){return te(W,function(re){return re})||[]},only:function(W){if(!P(W))throw Error("React.Children.only expected to receive a single React element child.");return W}},It.Component=j,It.Fragment=n,It.Profiler=a,It.PureComponent=L,It.StrictMode=s,It.Suspense=f,It.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ye,It.act=E,It.cloneElement=function(W,re,T){if(W==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+W+".");var ae=S({},W.props),Le=W.key,je=W.ref,He=W._owner;if(re!=null){if(re.ref!==void 0&&(je=re.ref,He=_.current),re.key!==void 0&&(Le=""+re.key),W.type&&W.type.defaultProps)var qe=W.type.defaultProps;for(et in re)q.call(re,et)&&!I.hasOwnProperty(et)&&(ae[et]=re[et]===void 0&&qe!==void 0?qe[et]:re[et])}var et=arguments.length-2;if(et===1)ae.children=T;else if(1<et){qe=Array(et);for(var ot=0;ot<et;ot++)qe[ot]=arguments[ot+2];ae.children=qe}return{$$typeof:e,type:W.type,key:Le,ref:je,props:ae,_owner:He}},It.createContext=function(W){return W={$$typeof:l,_currentValue:W,_currentValue2:W,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},W.Provider={$$typeof:c,_context:W},W.Consumer=W},It.createElement=F,It.createFactory=function(W){var re=F.bind(null,W);return re.type=W,re},It.createRef=function(){return{current:null}},It.forwardRef=function(W){return{$$typeof:d,render:W}},It.isValidElement=P,It.lazy=function(W){return{$$typeof:y,_payload:{_status:-1,_result:W},_init:pe}},It.memo=function(W,re){return{$$typeof:p,type:W,compare:re===void 0?null:re}},It.startTransition=function(W){var re=z.transition;z.transition={};try{W()}finally{z.transition=re}},It.unstable_act=E,It.useCallback=function(W,re){return ne.current.useCallback(W,re)},It.useContext=function(W){return ne.current.useContext(W)},It.useDebugValue=function(){},It.useDeferredValue=function(W){return ne.current.useDeferredValue(W)},It.useEffect=function(W,re){return ne.current.useEffect(W,re)},It.useId=function(){return ne.current.useId()},It.useImperativeHandle=function(W,re,T){return ne.current.useImperativeHandle(W,re,T)},It.useInsertionEffect=function(W,re){return ne.current.useInsertionEffect(W,re)},It.useLayoutEffect=function(W,re){return ne.current.useLayoutEffect(W,re)},It.useMemo=function(W,re){return ne.current.useMemo(W,re)},It.useReducer=function(W,re,T){return ne.current.useReducer(W,re,T)},It.useRef=function(W){return ne.current.useRef(W)},It.useState=function(W){return ne.current.useState(W)},It.useSyncExternalStore=function(W,re,T){return ne.current.useSyncExternalStore(W,re,T)},It.useTransition=function(){return ne.current.useTransition()},It.version="18.3.1",It}var oy;function Ff(){return oy||(oy=1,Hd.exports=z1()),Hd.exports}/**
11
+ * @license React
12
+ * react-jsx-runtime.production.min.js
13
+ *
14
+ * Copyright (c) Facebook, Inc. and its affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var ay;function H1(){if(ay)return ra;ay=1;var e=Ff(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(d,f,p){var y,g={},b=null,k=null;p!==void 0&&(b=""+p),f.key!==void 0&&(b=""+f.key),f.ref!==void 0&&(k=f.ref);for(y in f)s.call(f,y)&&!c.hasOwnProperty(y)&&(g[y]=f[y]);if(d&&d.defaultProps)for(y in f=d.defaultProps,f)g[y]===void 0&&(g[y]=f[y]);return{$$typeof:t,type:d,key:b,ref:k,props:g,_owner:a.current}}return ra.Fragment=n,ra.jsx=l,ra.jsxs=l,ra}var ly;function q1(){return ly||(ly=1,zd.exports=H1()),zd.exports}var i=q1(),Jl={},qd={exports:{}},lr={},$d={exports:{}},Vd={};/**
19
+ * @license React
20
+ * scheduler.production.min.js
21
+ *
22
+ * Copyright (c) Facebook, Inc. and its affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var cy;function $1(){return cy||(cy=1,(function(e){function t(z,ye){var E=z.length;z.push(ye);e:for(;0<E;){var W=E-1>>>1,re=z[W];if(0<a(re,ye))z[W]=ye,z[E]=re,E=W;else break e}}function n(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var ye=z[0],E=z.pop();if(E!==ye){z[0]=E;e:for(var W=0,re=z.length,T=re>>>1;W<T;){var ae=2*(W+1)-1,Le=z[ae],je=ae+1,He=z[je];if(0>a(Le,E))je<re&&0>a(He,Le)?(z[W]=He,z[je]=E,W=je):(z[W]=Le,z[ae]=E,W=ae);else if(je<re&&0>a(He,E))z[W]=He,z[je]=E,W=je;else break e}}return ye}function a(z,ye){var E=z.sortIndex-ye.sortIndex;return E!==0?E:z.id-ye.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var f=[],p=[],y=1,g=null,b=3,k=!1,S=!1,C=!1,j=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(z){for(var ye=n(p);ye!==null;){if(ye.callback===null)s(p);else if(ye.startTime<=z)s(p),ye.sortIndex=ye.expirationTime,t(f,ye);else break;ye=n(p)}}function O(z){if(C=!1,M(z),!S)if(n(f)!==null)S=!0,pe(q);else{var ye=n(p);ye!==null&&ne(O,ye.startTime-z)}}function q(z,ye){S=!1,C&&(C=!1,A(F),F=-1),k=!0;var E=b;try{for(M(ye),g=n(f);g!==null&&(!(g.expirationTime>ye)||z&&!K());){var W=g.callback;if(typeof W=="function"){g.callback=null,b=g.priorityLevel;var re=W(g.expirationTime<=ye);ye=e.unstable_now(),typeof re=="function"?g.callback=re:g===n(f)&&s(f),M(ye)}else s(f);g=n(f)}if(g!==null)var T=!0;else{var ae=n(p);ae!==null&&ne(O,ae.startTime-ye),T=!1}return T}finally{g=null,b=E,k=!1}}var _=!1,I=null,F=-1,D=5,P=-1;function K(){return!(e.unstable_now()-P<D)}function X(){if(I!==null){var z=e.unstable_now();P=z;var ye=!0;try{ye=I(!0,z)}finally{ye?$():(_=!1,I=null)}}else _=!1}var $;if(typeof L=="function")$=function(){L(X)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=X,$=function(){te.postMessage(null)}}else $=function(){j(X,0)};function pe(z){I=z,_||(_=!0,$())}function ne(z,ye){F=j(function(){z(e.unstable_now())},ye)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){S||k||(S=!0,pe(q))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(z){switch(b){case 1:case 2:case 3:var ye=3;break;default:ye=b}var E=b;b=ye;try{return z()}finally{b=E}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,ye){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var E=b;b=z;try{return ye()}finally{b=E}},e.unstable_scheduleCallback=function(z,ye,E){var W=e.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?W+E:W):E=W,z){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=E+re,z={id:y++,callback:ye,priorityLevel:z,startTime:E,expirationTime:re,sortIndex:-1},E>W?(z.sortIndex=E,t(p,z),n(f)===null&&z===n(p)&&(C?(A(F),F=-1):C=!0,ne(O,E-W))):(z.sortIndex=re,t(f,z),S||k||(S=!0,pe(q))),z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(z){var ye=b;return function(){var E=b;b=ye;try{return z.apply(this,arguments)}finally{b=E}}}})(Vd)),Vd}var uy;function V1(){return uy||(uy=1,$d.exports=$1()),$d.exports}/**
27
+ * @license React
28
+ * react-dom.production.min.js
29
+ *
30
+ * Copyright (c) Facebook, Inc. and its affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var dy;function G1(){if(dy)return lr;dy=1;var e=Ff(),t=V1();function n(r){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function c(r,o){l(r,o),l(r+"Capture",o)}function l(r,o){for(a[r]=o,r=0;r<o.length;r++)s.add(o[r])}var d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y={},g={};function b(r){return f.call(g,r)?!0:f.call(y,r)?!1:p.test(r)?g[r]=!0:(y[r]=!0,!1)}function k(r,o,u,m){if(u!==null&&u.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return m?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function S(r,o,u,m){if(o===null||typeof o>"u"||k(r,o,u,m))return!0;if(m)return!1;if(u!==null)switch(u.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function C(r,o,u,m,w,x,N){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=m,this.attributeNamespace=w,this.mustUseProperty=u,this.propertyName=r,this.type=o,this.sanitizeURL=x,this.removeEmptyString=N}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){j[r]=new C(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var o=r[0];j[o]=new C(o,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){j[r]=new C(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){j[r]=new C(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){j[r]=new C(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){j[r]=new C(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){j[r]=new C(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){j[r]=new C(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){j[r]=new C(r,5,!1,r.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function L(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var o=r.replace(A,L);j[o]=new C(o,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var o=r.replace(A,L);j[o]=new C(o,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var o=r.replace(A,L);j[o]=new C(o,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){j[r]=new C(r,1,!1,r.toLowerCase(),null,!1,!1)}),j.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){j[r]=new C(r,1,!1,r.toLowerCase(),null,!0,!0)});function M(r,o,u,m){var w=j.hasOwnProperty(o)?j[o]:null;(w!==null?w.type!==0:m||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(S(o,u,w,m)&&(u=null),m||w===null?b(o)&&(u===null?r.removeAttribute(o):r.setAttribute(o,""+u)):w.mustUseProperty?r[w.propertyName]=u===null?w.type===3?!1:"":u:(o=w.attributeName,m=w.attributeNamespace,u===null?r.removeAttribute(o):(w=w.type,u=w===3||w===4&&u===!0?"":""+u,m?r.setAttributeNS(m,o,u):r.setAttribute(o,u))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,q=Symbol.for("react.element"),_=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),K=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),z=Symbol.iterator;function ye(r){return r===null||typeof r!="object"?null:(r=z&&r[z]||r["@@iterator"],typeof r=="function"?r:null)}var E=Object.assign,W;function re(r){if(W===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);W=o&&o[1]||""}return`
35
+ `+W+r}var T=!1;function ae(r,o){if(!r||T)return"";T=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(fe){var m=fe}Reflect.construct(r,[],o)}else{try{o.call()}catch(fe){m=fe}r.call(o.prototype)}else{try{throw Error()}catch(fe){m=fe}r()}}catch(fe){if(fe&&m&&typeof fe.stack=="string"){for(var w=fe.stack.split(`
36
+ `),x=m.stack.split(`
37
+ `),N=w.length-1,U=x.length-1;1<=N&&0<=U&&w[N]!==x[U];)U--;for(;1<=N&&0<=U;N--,U--)if(w[N]!==x[U]){if(N!==1||U!==1)do if(N--,U--,0>U||w[N]!==x[U]){var G=`
38
+ `+w[N].replace(" at new "," at ");return r.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",r.displayName)),G}while(1<=N&&0<=U);break}}}finally{T=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?re(r):""}function Le(r){switch(r.tag){case 5:return re(r.type);case 16:return re("Lazy");case 13:return re("Suspense");case 19:return re("SuspenseList");case 0:case 2:case 15:return r=ae(r.type,!1),r;case 11:return r=ae(r.type.render,!1),r;case 1:return r=ae(r.type,!0),r;default:return""}}function je(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case I:return"Fragment";case _:return"Portal";case D:return"Profiler";case F:return"StrictMode";case $:return"Suspense";case ee:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case K:return(r.displayName||"Context")+".Consumer";case P:return(r._context.displayName||"Context")+".Provider";case X:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case te:return o=r.displayName||null,o!==null?o:je(r.type)||"Memo";case pe:o=r._payload,r=r._init;try{return je(r(o))}catch{}}return null}function He(r){var o=r.type;switch(r.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=o.render,r=r.displayName||r.name||"",o.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return je(o);case 8:return o===F?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function qe(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function et(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function ot(r){var o=et(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o),m=""+r[o];if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var w=u.get,x=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return w.call(this)},set:function(N){m=""+N,x.call(this,N)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return m},setValue:function(N){m=""+N},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function bt(r){r._valueTracker||(r._valueTracker=ot(r))}function Ct(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var u=o.getValue(),m="";return r&&(m=et(r)?r.checked?"true":"false":r.value),r=m,r!==u?(o.setValue(r),!0):!1}function lt(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function kt(r,o){var u=o.checked;return E({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Ve(r,o){var u=o.defaultValue==null?"":o.defaultValue,m=o.checked!=null?o.checked:o.defaultChecked;u=qe(o.value!=null?o.value:u),r._wrapperState={initialChecked:m,initialValue:u,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function Tt(r,o){o=o.checked,o!=null&&M(r,"checked",o,!1)}function Ot(r,o){Tt(r,o);var u=qe(o.value),m=o.type;if(u!=null)m==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(m==="submit"||m==="reset"){r.removeAttribute("value");return}o.hasOwnProperty("value")?Mt(r,o.type,u):o.hasOwnProperty("defaultValue")&&Mt(r,o.type,qe(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(r.defaultChecked=!!o.defaultChecked)}function St(r,o,u){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var m=o.type;if(!(m!=="submit"&&m!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+r._wrapperState.initialValue,u||o===r.value||(r.value=o),r.defaultValue=o}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function Mt(r,o,u){(o!=="number"||lt(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var Ht=Array.isArray;function At(r,o,u,m){if(r=r.options,o){o={};for(var w=0;w<u.length;w++)o["$"+u[w]]=!0;for(u=0;u<r.length;u++)w=o.hasOwnProperty("$"+r[u].value),r[u].selected!==w&&(r[u].selected=w),w&&m&&(r[u].defaultSelected=!0)}else{for(u=""+qe(u),o=null,w=0;w<r.length;w++){if(r[w].value===u){r[w].selected=!0,m&&(r[w].defaultSelected=!0);return}o!==null||r[w].disabled||(o=r[w])}o!==null&&(o.selected=!0)}}function vt(r,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return E({},o,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function $t(r,o){var u=o.value;if(u==null){if(u=o.children,o=o.defaultValue,u!=null){if(o!=null)throw Error(n(92));if(Ht(u)){if(1<u.length)throw Error(n(93));u=u[0]}o=u}o==null&&(o=""),u=o}r._wrapperState={initialValue:qe(u)}}function Dt(r,o){var u=qe(o.value),m=qe(o.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),o.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),m!=null&&(r.defaultValue=""+m)}function Lt(r){var o=r.textContent;o===r._wrapperState.initialValue&&o!==""&&o!==null&&(r.value=o)}function ue(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ge(r,o){return r==null||r==="http://www.w3.org/1999/xhtml"?ue(o):r==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Be,Pe=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,u,m,w){MSApp.execUnsafeLocalFunction(function(){return r(o,u,m,w)})}:r})(function(r,o){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=o;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Be.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;o.firstChild;)r.appendChild(o.firstChild)}});function ft(r,o){if(o){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=o;return}}r.textContent=o}var dt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Rt=["Webkit","ms","Moz","O"];Object.keys(dt).forEach(function(r){Rt.forEach(function(o){o=o+r.charAt(0).toUpperCase()+r.substring(1),dt[o]=dt[r]})});function ht(r,o,u){return o==null||typeof o=="boolean"||o===""?"":u||typeof o!="number"||o===0||dt.hasOwnProperty(r)&&dt[r]?(""+o).trim():o+"px"}function Nt(r,o){r=r.style;for(var u in o)if(o.hasOwnProperty(u)){var m=u.indexOf("--")===0,w=ht(u,o[u],m);u==="float"&&(u="cssFloat"),m?r.setProperty(u,w):r[u]=w}}var jt=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function V(r,o){if(o){if(jt[r]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function Me(r,o){if(r.indexOf("-")===-1)return typeof o.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ze=null;function wt(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Bt=null,Zt=null,Vt=null;function ke(r){if(r=zo(r)){if(typeof Bt!="function")throw Error(n(280));var o=r.stateNode;o&&(o=fl(o),Bt(r.stateNode,r.type,o))}}function Qe(r){Zt?Vt?Vt.push(r):Vt=[r]:Zt=r}function cn(){if(Zt){var r=Zt,o=Vt;if(Vt=Zt=null,ke(r),o)for(r=0;r<o.length;r++)ke(o[r])}}function yn(r,o){return r(o)}function un(){}var on=!1;function wn(r,o,u){if(on)return r(o,u);on=!0;try{return yn(r,o,u)}finally{on=!1,(Zt!==null||Vt!==null)&&(un(),cn())}}function xn(r,o){var u=r.stateNode;if(u===null)return null;var m=fl(u);if(m===null)return null;u=m[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(r=r.type,m=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!m;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,o,typeof u));return u}var H=!1;if(d)try{var Z={};Object.defineProperty(Z,"passive",{get:function(){H=!0}}),window.addEventListener("test",Z,Z),window.removeEventListener("test",Z,Z)}catch{H=!1}function ie(r,o,u,m,w,x,N,U,G){var fe=Array.prototype.slice.call(arguments,3);try{o.apply(u,fe)}catch(Ee){this.onError(Ee)}}var we=!1,Te=null,Ae=!1,$e=null,Ie={onError:function(r){we=!0,Te=r}};function Ue(r,o,u,m,w,x,N,U,G){we=!1,Te=null,ie.apply(Ie,arguments)}function Fe(r,o,u,m,w,x,N,U,G){if(Ue.apply(this,arguments),we){if(we){var fe=Te;we=!1,Te=null}else throw Error(n(198));Ae||(Ae=!0,$e=fe)}}function Oe(r){var o=r,u=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(u=o.return),r=o.return;while(r)}return o.tag===3?u:null}function ct(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function rt(r){if(Oe(r)!==r)throw Error(n(188))}function Ut(r){var o=r.alternate;if(!o){if(o=Oe(r),o===null)throw Error(n(188));return o!==r?null:r}for(var u=r,m=o;;){var w=u.return;if(w===null)break;var x=w.alternate;if(x===null){if(m=w.return,m!==null){u=m;continue}break}if(w.child===x.child){for(x=w.child;x;){if(x===u)return rt(w),r;if(x===m)return rt(w),o;x=x.sibling}throw Error(n(188))}if(u.return!==m.return)u=w,m=x;else{for(var N=!1,U=w.child;U;){if(U===u){N=!0,u=w,m=x;break}if(U===m){N=!0,m=w,u=x;break}U=U.sibling}if(!N){for(U=x.child;U;){if(U===u){N=!0,u=x,m=w;break}if(U===m){N=!0,m=x,u=w;break}U=U.sibling}if(!N)throw Error(n(189))}}if(u.alternate!==m)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:o}function Pt(r){return r=Ut(r),r!==null?We(r):null}function We(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var o=We(r);if(o!==null)return o;r=r.sibling}return null}var se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,B=t.unstable_shouldYield,le=t.unstable_requestPaint,Se=t.unstable_now,Ye=t.unstable_getCurrentPriorityLevel,tt=t.unstable_ImmediatePriority,nn=t.unstable_UserBlockingPriority,Ln=t.unstable_NormalPriority,Y=t.unstable_LowPriority,xe=t.unstable_IdlePriority,R=null,de=null;function he(r){if(de&&typeof de.onCommitFiberRoot=="function")try{de.onCommitFiberRoot(R,r,void 0,(r.current.flags&128)===128)}catch{}}var ve=Math.clz32?Math.clz32:zt,it=Math.log,ut=Math.LN2;function zt(r){return r>>>=0,r===0?32:31-(it(r)/ut|0)|0}var Xt=64,Fr=4194304;function nr(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Jr(r,o){var u=r.pendingLanes;if(u===0)return 0;var m=0,w=r.suspendedLanes,x=r.pingedLanes,N=u&268435455;if(N!==0){var U=N&~w;U!==0?m=nr(U):(x&=N,x!==0&&(m=nr(x)))}else N=u&~w,N!==0?m=nr(N):x!==0&&(m=nr(x));if(m===0)return 0;if(o!==0&&o!==m&&(o&w)===0&&(w=m&-m,x=o&-o,w>=x||w===16&&(x&4194240)!==0))return o;if((m&4)!==0&&(m|=u&16),o=r.entangledLanes,o!==0)for(r=r.entanglements,o&=m;0<o;)u=31-ve(o),w=1<<u,m|=r[u],o&=~w;return m}function wo(r,o){switch(r){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xa(r,o){for(var u=r.suspendedLanes,m=r.pingedLanes,w=r.expirationTimes,x=r.pendingLanes;0<x;){var N=31-ve(x),U=1<<N,G=w[N];G===-1?((U&u)===0||(U&m)!==0)&&(w[N]=wo(U,o)):G<=o&&(r.expiredLanes|=U),x&=~U}}function bo(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function xo(){var r=Xt;return Xt<<=1,(Xt&4194240)===0&&(Xt=64),r}function Si(r){for(var o=[],u=0;31>u;u++)o.push(r);return o}function Xi(r,o,u){r.pendingLanes|=o,o!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,o=31-ve(o),r[o]=u}function Ja(r,o){var u=r.pendingLanes&~o;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=o,r.mutableReadLanes&=o,r.entangledLanes&=o,o=r.entanglements;var m=r.eventTimes;for(r=r.expirationTimes;0<u;){var w=31-ve(u),x=1<<w;o[w]=0,m[w]=-1,r[w]=-1,u&=~x}}function ko(r,o){var u=r.entangledLanes|=o;for(r=r.entanglements;u;){var m=31-ve(u),w=1<<m;w&o|r[m]&o&&(r[m]|=o),u&=~w}}var Jt=0;function So(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Co,Ns,jo,No,Q,me=!1,Xe=[],mt=null,Gt=null,kn=null,mr=new Map,ci=new Map,pr=[],Kt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function In(r,o){switch(r){case"focusin":case"focusout":mt=null;break;case"dragenter":case"dragleave":Gt=null;break;case"mouseover":case"mouseout":kn=null;break;case"pointerover":case"pointerout":mr.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ci.delete(o.pointerId)}}function Or(r,o,u,m,w,x){return r===null||r.nativeEvent!==x?(r={blockedOn:o,domEventName:u,eventSystemFlags:m,nativeEvent:x,targetContainers:[w]},o!==null&&(o=zo(o),o!==null&&Ns(o)),r):(r.eventSystemFlags|=m,o=r.targetContainers,w!==null&&o.indexOf(w)===-1&&o.push(w),r)}function Po(r,o,u,m,w){switch(o){case"focusin":return mt=Or(mt,r,o,u,m,w),!0;case"dragenter":return Gt=Or(Gt,r,o,u,m,w),!0;case"mouseover":return kn=Or(kn,r,o,u,m,w),!0;case"pointerover":var x=w.pointerId;return mr.set(x,Or(mr.get(x)||null,r,o,u,m,w)),!0;case"gotpointercapture":return x=w.pointerId,ci.set(x,Or(ci.get(x)||null,r,o,u,m,w)),!0}return!1}function To(r){var o=Zi(r.target);if(o!==null){var u=Oe(o);if(u!==null){if(o=u.tag,o===13){if(o=ct(u),o!==null){r.blockedOn=o,Q(r.priority,function(){jo(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ji(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var u=pu(r.domEventName,r.eventSystemFlags,o[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var m=new u.constructor(u.type,u);ze=m,u.target.dispatchEvent(m),ze=null}else return o=zo(u),o!==null&&Ns(o),r.blockedOn=u,!1;o.shift()}return!0}function Za(r,o,u){Ji(r)&&u.delete(o)}function u0(){me=!1,mt!==null&&Ji(mt)&&(mt=null),Gt!==null&&Ji(Gt)&&(Gt=null),kn!==null&&Ji(kn)&&(kn=null),mr.forEach(Za),ci.forEach(Za)}function Eo(r,o){r.blockedOn===o&&(r.blockedOn=null,me||(me=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,u0)))}function Ro(r){function o(w){return Eo(w,r)}if(0<Xe.length){Eo(Xe[0],r);for(var u=1;u<Xe.length;u++){var m=Xe[u];m.blockedOn===r&&(m.blockedOn=null)}}for(mt!==null&&Eo(mt,r),Gt!==null&&Eo(Gt,r),kn!==null&&Eo(kn,r),mr.forEach(o),ci.forEach(o),u=0;u<pr.length;u++)m=pr[u],m.blockedOn===r&&(m.blockedOn=null);for(;0<pr.length&&(u=pr[0],u.blockedOn===null);)To(u),u.blockedOn===null&&pr.shift()}var Ps=O.ReactCurrentBatchConfig,el=!0;function d0(r,o,u,m){var w=Jt,x=Ps.transition;Ps.transition=null;try{Jt=1,mu(r,o,u,m)}finally{Jt=w,Ps.transition=x}}function h0(r,o,u,m){var w=Jt,x=Ps.transition;Ps.transition=null;try{Jt=4,mu(r,o,u,m)}finally{Jt=w,Ps.transition=x}}function mu(r,o,u,m){if(el){var w=pu(r,o,u,m);if(w===null)Au(r,o,m,tl,u),In(r,m);else if(Po(w,r,o,u,m))m.stopPropagation();else if(In(r,m),o&4&&-1<Kt.indexOf(r)){for(;w!==null;){var x=zo(w);if(x!==null&&Co(x),x=pu(r,o,u,m),x===null&&Au(r,o,m,tl,u),x===w)break;w=x}w!==null&&m.stopPropagation()}else Au(r,o,m,null,u)}}var tl=null;function pu(r,o,u,m){if(tl=null,r=wt(m),r=Zi(r),r!==null)if(o=Oe(r),o===null)r=null;else if(u=o.tag,u===13){if(r=ct(o),r!==null)return r;r=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null);return tl=r,null}function $m(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ye()){case tt:return 1;case nn:return 4;case Ln:case Y:return 16;case xe:return 536870912;default:return 16}default:return 16}}var Ci=null,gu=null,nl=null;function Vm(){if(nl)return nl;var r,o=gu,u=o.length,m,w="value"in Ci?Ci.value:Ci.textContent,x=w.length;for(r=0;r<u&&o[r]===w[r];r++);var N=u-r;for(m=1;m<=N&&o[u-m]===w[x-m];m++);return nl=w.slice(r,1<m?1-m:void 0)}function rl(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function il(){return!0}function Gm(){return!1}function gr(r){function o(u,m,w,x,N){this._reactName=u,this._targetInst=w,this.type=m,this.nativeEvent=x,this.target=N,this.currentTarget=null;for(var U in r)r.hasOwnProperty(U)&&(u=r[U],this[U]=u?u(x):x[U]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?il:Gm,this.isPropagationStopped=Gm,this}return E(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=il)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=il)},persist:function(){},isPersistent:il}),o}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yu=gr(Ts),Mo=E({},Ts,{view:0,detail:0}),f0=gr(Mo),vu,wu,Ao,sl=E({},Mo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xu,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Ao&&(Ao&&r.type==="mousemove"?(vu=r.screenX-Ao.screenX,wu=r.screenY-Ao.screenY):wu=vu=0,Ao=r),vu)},movementY:function(r){return"movementY"in r?r.movementY:wu}}),Km=gr(sl),m0=E({},sl,{dataTransfer:0}),p0=gr(m0),g0=E({},Mo,{relatedTarget:0}),bu=gr(g0),y0=E({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),v0=gr(y0),w0=E({},Ts,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),b0=gr(w0),x0=E({},Ts,{data:0}),Qm=gr(x0),k0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},S0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},C0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function j0(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=C0[r])?!!o[r]:!1}function xu(){return j0}var N0=E({},Mo,{key:function(r){if(r.key){var o=k0[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=rl(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?S0[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xu,charCode:function(r){return r.type==="keypress"?rl(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?rl(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),P0=gr(N0),T0=E({},sl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ym=gr(T0),E0=E({},Mo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xu}),R0=gr(E0),M0=E({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),A0=gr(M0),L0=E({},sl,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),I0=gr(L0),D0=[9,13,27,32],ku=d&&"CompositionEvent"in window,Lo=null;d&&"documentMode"in document&&(Lo=document.documentMode);var _0=d&&"TextEvent"in window&&!Lo,Xm=d&&(!ku||Lo&&8<Lo&&11>=Lo),Jm=" ",Zm=!1;function ep(r,o){switch(r){case"keyup":return D0.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Es=!1;function F0(r,o){switch(r){case"compositionend":return tp(o);case"keypress":return o.which!==32?null:(Zm=!0,Jm);case"textInput":return r=o.data,r===Jm&&Zm?null:r;default:return null}}function O0(r,o){if(Es)return r==="compositionend"||!ku&&ep(r,o)?(r=Vm(),nl=gu=Ci=null,Es=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Xm&&o.locale!=="ko"?null:o.data;default:return null}}var B0={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function np(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!B0[r.type]:o==="textarea"}function rp(r,o,u,m){Qe(m),o=ul(o,"onChange"),0<o.length&&(u=new yu("onChange","change",null,u,m),r.push({event:u,listeners:o}))}var Io=null,Do=null;function U0(r){xp(r,0)}function ol(r){var o=Is(r);if(Ct(o))return r}function W0(r,o){if(r==="change")return o}var ip=!1;if(d){var Su;if(d){var Cu="oninput"in document;if(!Cu){var sp=document.createElement("div");sp.setAttribute("oninput","return;"),Cu=typeof sp.oninput=="function"}Su=Cu}else Su=!1;ip=Su&&(!document.documentMode||9<document.documentMode)}function op(){Io&&(Io.detachEvent("onpropertychange",ap),Do=Io=null)}function ap(r){if(r.propertyName==="value"&&ol(Do)){var o=[];rp(o,Do,r,wt(r)),wn(U0,o)}}function z0(r,o,u){r==="focusin"?(op(),Io=o,Do=u,Io.attachEvent("onpropertychange",ap)):r==="focusout"&&op()}function H0(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return ol(Do)}function q0(r,o){if(r==="click")return ol(o)}function $0(r,o){if(r==="input"||r==="change")return ol(o)}function V0(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Br=typeof Object.is=="function"?Object.is:V0;function _o(r,o){if(Br(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var u=Object.keys(r),m=Object.keys(o);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var w=u[m];if(!f.call(o,w)||!Br(r[w],o[w]))return!1}return!0}function lp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function cp(r,o){var u=lp(r);r=0;for(var m;u;){if(u.nodeType===3){if(m=r+u.textContent.length,r<=o&&m>=o)return{node:u,offset:o-r};r=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=lp(u)}}function up(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?up(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function dp(){for(var r=window,o=lt();o instanceof r.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)r=o.contentWindow;else break;o=lt(r.document)}return o}function ju(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}function G0(r){var o=dp(),u=r.focusedElem,m=r.selectionRange;if(o!==u&&u&&u.ownerDocument&&up(u.ownerDocument.documentElement,u)){if(m!==null&&ju(u)){if(o=m.start,r=m.end,r===void 0&&(r=o),"selectionStart"in u)u.selectionStart=o,u.selectionEnd=Math.min(r,u.value.length);else if(r=(o=u.ownerDocument||document)&&o.defaultView||window,r.getSelection){r=r.getSelection();var w=u.textContent.length,x=Math.min(m.start,w);m=m.end===void 0?x:Math.min(m.end,w),!r.extend&&x>m&&(w=m,m=x,x=w),w=cp(u,x);var N=cp(u,m);w&&N&&(r.rangeCount!==1||r.anchorNode!==w.node||r.anchorOffset!==w.offset||r.focusNode!==N.node||r.focusOffset!==N.offset)&&(o=o.createRange(),o.setStart(w.node,w.offset),r.removeAllRanges(),x>m?(r.addRange(o),r.extend(N.node,N.offset)):(o.setEnd(N.node,N.offset),r.addRange(o)))}}for(o=[],r=u;r=r.parentNode;)r.nodeType===1&&o.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<o.length;u++)r=o[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var K0=d&&"documentMode"in document&&11>=document.documentMode,Rs=null,Nu=null,Fo=null,Pu=!1;function hp(r,o,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Pu||Rs==null||Rs!==lt(m)||(m=Rs,"selectionStart"in m&&ju(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Fo&&_o(Fo,m)||(Fo=m,m=ul(Nu,"onSelect"),0<m.length&&(o=new yu("onSelect","select",null,o,u),r.push({event:o,listeners:m}),o.target=Rs)))}function al(r,o){var u={};return u[r.toLowerCase()]=o.toLowerCase(),u["Webkit"+r]="webkit"+o,u["Moz"+r]="moz"+o,u}var Ms={animationend:al("Animation","AnimationEnd"),animationiteration:al("Animation","AnimationIteration"),animationstart:al("Animation","AnimationStart"),transitionend:al("Transition","TransitionEnd")},Tu={},fp={};d&&(fp=document.createElement("div").style,"AnimationEvent"in window||(delete Ms.animationend.animation,delete Ms.animationiteration.animation,delete Ms.animationstart.animation),"TransitionEvent"in window||delete Ms.transitionend.transition);function ll(r){if(Tu[r])return Tu[r];if(!Ms[r])return r;var o=Ms[r],u;for(u in o)if(o.hasOwnProperty(u)&&u in fp)return Tu[r]=o[u];return r}var mp=ll("animationend"),pp=ll("animationiteration"),gp=ll("animationstart"),yp=ll("transitionend"),vp=new Map,wp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ji(r,o){vp.set(r,o),c(o,[r])}for(var Eu=0;Eu<wp.length;Eu++){var Ru=wp[Eu],Q0=Ru.toLowerCase(),Y0=Ru[0].toUpperCase()+Ru.slice(1);ji(Q0,"on"+Y0)}ji(mp,"onAnimationEnd"),ji(pp,"onAnimationIteration"),ji(gp,"onAnimationStart"),ji("dblclick","onDoubleClick"),ji("focusin","onFocus"),ji("focusout","onBlur"),ji(yp,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),X0=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oo));function bp(r,o,u){var m=r.type||"unknown-event";r.currentTarget=u,Fe(m,o,void 0,r),r.currentTarget=null}function xp(r,o){o=(o&4)!==0;for(var u=0;u<r.length;u++){var m=r[u],w=m.event;m=m.listeners;e:{var x=void 0;if(o)for(var N=m.length-1;0<=N;N--){var U=m[N],G=U.instance,fe=U.currentTarget;if(U=U.listener,G!==x&&w.isPropagationStopped())break e;bp(w,U,fe),x=G}else for(N=0;N<m.length;N++){if(U=m[N],G=U.instance,fe=U.currentTarget,U=U.listener,G!==x&&w.isPropagationStopped())break e;bp(w,U,fe),x=G}}}if(Ae)throw r=$e,Ae=!1,$e=null,r}function an(r,o){var u=o[Ou];u===void 0&&(u=o[Ou]=new Set);var m=r+"__bubble";u.has(m)||(kp(o,r,2,!1),u.add(m))}function Mu(r,o,u){var m=0;o&&(m|=4),kp(u,r,m,o)}var cl="_reactListening"+Math.random().toString(36).slice(2);function Bo(r){if(!r[cl]){r[cl]=!0,s.forEach(function(u){u!=="selectionchange"&&(X0.has(u)||Mu(u,!1,r),Mu(u,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[cl]||(o[cl]=!0,Mu("selectionchange",!1,o))}}function kp(r,o,u,m){switch($m(o)){case 1:var w=d0;break;case 4:w=h0;break;default:w=mu}u=w.bind(null,o,u,r),w=void 0,!H||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(w=!0),m?w!==void 0?r.addEventListener(o,u,{capture:!0,passive:w}):r.addEventListener(o,u,!0):w!==void 0?r.addEventListener(o,u,{passive:w}):r.addEventListener(o,u,!1)}function Au(r,o,u,m,w){var x=m;if((o&1)===0&&(o&2)===0&&m!==null)e:for(;;){if(m===null)return;var N=m.tag;if(N===3||N===4){var U=m.stateNode.containerInfo;if(U===w||U.nodeType===8&&U.parentNode===w)break;if(N===4)for(N=m.return;N!==null;){var G=N.tag;if((G===3||G===4)&&(G=N.stateNode.containerInfo,G===w||G.nodeType===8&&G.parentNode===w))return;N=N.return}for(;U!==null;){if(N=Zi(U),N===null)return;if(G=N.tag,G===5||G===6){m=x=N;continue e}U=U.parentNode}}m=m.return}wn(function(){var fe=x,Ee=wt(u),Re=[];e:{var Ne=vp.get(r);if(Ne!==void 0){var Ge=yu,nt=r;switch(r){case"keypress":if(rl(u)===0)break e;case"keydown":case"keyup":Ge=P0;break;case"focusin":nt="focus",Ge=bu;break;case"focusout":nt="blur",Ge=bu;break;case"beforeblur":case"afterblur":Ge=bu;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ge=Km;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ge=p0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ge=R0;break;case mp:case pp:case gp:Ge=v0;break;case yp:Ge=A0;break;case"scroll":Ge=f0;break;case"wheel":Ge=I0;break;case"copy":case"cut":case"paste":Ge=b0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ge=Ym}var st=(o&4)!==0,bn=!st&&r==="scroll",oe=st?Ne!==null?Ne+"Capture":null:Ne;st=[];for(var J=fe,ce;J!==null;){ce=J;var _e=ce.stateNode;if(ce.tag===5&&_e!==null&&(ce=_e,oe!==null&&(_e=xn(J,oe),_e!=null&&st.push(Uo(J,_e,ce)))),bn)break;J=J.return}0<st.length&&(Ne=new Ge(Ne,nt,null,u,Ee),Re.push({event:Ne,listeners:st}))}}if((o&7)===0){e:{if(Ne=r==="mouseover"||r==="pointerover",Ge=r==="mouseout"||r==="pointerout",Ne&&u!==ze&&(nt=u.relatedTarget||u.fromElement)&&(Zi(nt)||nt[ui]))break e;if((Ge||Ne)&&(Ne=Ee.window===Ee?Ee:(Ne=Ee.ownerDocument)?Ne.defaultView||Ne.parentWindow:window,Ge?(nt=u.relatedTarget||u.toElement,Ge=fe,nt=nt?Zi(nt):null,nt!==null&&(bn=Oe(nt),nt!==bn||nt.tag!==5&&nt.tag!==6)&&(nt=null)):(Ge=null,nt=fe),Ge!==nt)){if(st=Km,_e="onMouseLeave",oe="onMouseEnter",J="mouse",(r==="pointerout"||r==="pointerover")&&(st=Ym,_e="onPointerLeave",oe="onPointerEnter",J="pointer"),bn=Ge==null?Ne:Is(Ge),ce=nt==null?Ne:Is(nt),Ne=new st(_e,J+"leave",Ge,u,Ee),Ne.target=bn,Ne.relatedTarget=ce,_e=null,Zi(Ee)===fe&&(st=new st(oe,J+"enter",nt,u,Ee),st.target=ce,st.relatedTarget=bn,_e=st),bn=_e,Ge&&nt)t:{for(st=Ge,oe=nt,J=0,ce=st;ce;ce=As(ce))J++;for(ce=0,_e=oe;_e;_e=As(_e))ce++;for(;0<J-ce;)st=As(st),J--;for(;0<ce-J;)oe=As(oe),ce--;for(;J--;){if(st===oe||oe!==null&&st===oe.alternate)break t;st=As(st),oe=As(oe)}st=null}else st=null;Ge!==null&&Sp(Re,Ne,Ge,st,!1),nt!==null&&bn!==null&&Sp(Re,bn,nt,st,!0)}}e:{if(Ne=fe?Is(fe):window,Ge=Ne.nodeName&&Ne.nodeName.toLowerCase(),Ge==="select"||Ge==="input"&&Ne.type==="file")var at=W0;else if(np(Ne))if(ip)at=$0;else{at=H0;var pt=z0}else(Ge=Ne.nodeName)&&Ge.toLowerCase()==="input"&&(Ne.type==="checkbox"||Ne.type==="radio")&&(at=q0);if(at&&(at=at(r,fe))){rp(Re,at,u,Ee);break e}pt&&pt(r,Ne,fe),r==="focusout"&&(pt=Ne._wrapperState)&&pt.controlled&&Ne.type==="number"&&Mt(Ne,"number",Ne.value)}switch(pt=fe?Is(fe):window,r){case"focusin":(np(pt)||pt.contentEditable==="true")&&(Rs=pt,Nu=fe,Fo=null);break;case"focusout":Fo=Nu=Rs=null;break;case"mousedown":Pu=!0;break;case"contextmenu":case"mouseup":case"dragend":Pu=!1,hp(Re,u,Ee);break;case"selectionchange":if(K0)break;case"keydown":case"keyup":hp(Re,u,Ee)}var gt;if(ku)e:{switch(r){case"compositionstart":var xt="onCompositionStart";break e;case"compositionend":xt="onCompositionEnd";break e;case"compositionupdate":xt="onCompositionUpdate";break e}xt=void 0}else Es?ep(r,u)&&(xt="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(xt="onCompositionStart");xt&&(Xm&&u.locale!=="ko"&&(Es||xt!=="onCompositionStart"?xt==="onCompositionEnd"&&Es&&(gt=Vm()):(Ci=Ee,gu="value"in Ci?Ci.value:Ci.textContent,Es=!0)),pt=ul(fe,xt),0<pt.length&&(xt=new Qm(xt,r,null,u,Ee),Re.push({event:xt,listeners:pt}),gt?xt.data=gt:(gt=tp(u),gt!==null&&(xt.data=gt)))),(gt=_0?F0(r,u):O0(r,u))&&(fe=ul(fe,"onBeforeInput"),0<fe.length&&(Ee=new Qm("onBeforeInput","beforeinput",null,u,Ee),Re.push({event:Ee,listeners:fe}),Ee.data=gt))}xp(Re,o)})}function Uo(r,o,u){return{instance:r,listener:o,currentTarget:u}}function ul(r,o){for(var u=o+"Capture",m=[];r!==null;){var w=r,x=w.stateNode;w.tag===5&&x!==null&&(w=x,x=xn(r,u),x!=null&&m.unshift(Uo(r,x,w)),x=xn(r,o),x!=null&&m.push(Uo(r,x,w))),r=r.return}return m}function As(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Sp(r,o,u,m,w){for(var x=o._reactName,N=[];u!==null&&u!==m;){var U=u,G=U.alternate,fe=U.stateNode;if(G!==null&&G===m)break;U.tag===5&&fe!==null&&(U=fe,w?(G=xn(u,x),G!=null&&N.unshift(Uo(u,G,U))):w||(G=xn(u,x),G!=null&&N.push(Uo(u,G,U)))),u=u.return}N.length!==0&&r.push({event:o,listeners:N})}var J0=/\r\n?/g,Z0=/\u0000|\uFFFD/g;function Cp(r){return(typeof r=="string"?r:""+r).replace(J0,`
39
+ `).replace(Z0,"")}function dl(r,o,u){if(o=Cp(o),Cp(r)!==o&&u)throw Error(n(425))}function hl(){}var Lu=null,Iu=null;function Du(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var _u=typeof setTimeout=="function"?setTimeout:void 0,e1=typeof clearTimeout=="function"?clearTimeout:void 0,jp=typeof Promise=="function"?Promise:void 0,t1=typeof queueMicrotask=="function"?queueMicrotask:typeof jp<"u"?function(r){return jp.resolve(null).then(r).catch(n1)}:_u;function n1(r){setTimeout(function(){throw r})}function Fu(r,o){var u=o,m=0;do{var w=u.nextSibling;if(r.removeChild(u),w&&w.nodeType===8)if(u=w.data,u==="/$"){if(m===0){r.removeChild(w),Ro(o);return}m--}else u!=="$"&&u!=="$?"&&u!=="$!"||m++;u=w}while(u);Ro(o)}function Ni(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return r}function Np(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(o===0)return r;o--}else u==="/$"&&o++}r=r.previousSibling}return null}var Ls=Math.random().toString(36).slice(2),Zr="__reactFiber$"+Ls,Wo="__reactProps$"+Ls,ui="__reactContainer$"+Ls,Ou="__reactEvents$"+Ls,r1="__reactListeners$"+Ls,i1="__reactHandles$"+Ls;function Zi(r){var o=r[Zr];if(o)return o;for(var u=r.parentNode;u;){if(o=u[ui]||u[Zr]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(r=Np(r);r!==null;){if(u=r[Zr])return u;r=Np(r)}return o}r=u,u=r.parentNode}return null}function zo(r){return r=r[Zr]||r[ui],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Is(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function fl(r){return r[Wo]||null}var Bu=[],Ds=-1;function Pi(r){return{current:r}}function ln(r){0>Ds||(r.current=Bu[Ds],Bu[Ds]=null,Ds--)}function rn(r,o){Ds++,Bu[Ds]=r.current,r.current=o}var Ti={},zn=Pi(Ti),rr=Pi(!1),es=Ti;function _s(r,o){var u=r.type.contextTypes;if(!u)return Ti;var m=r.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===o)return m.__reactInternalMemoizedMaskedChildContext;var w={},x;for(x in u)w[x]=o[x];return m&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=o,r.__reactInternalMemoizedMaskedChildContext=w),w}function ir(r){return r=r.childContextTypes,r!=null}function ml(){ln(rr),ln(zn)}function Pp(r,o,u){if(zn.current!==Ti)throw Error(n(168));rn(zn,o),rn(rr,u)}function Tp(r,o,u){var m=r.stateNode;if(o=o.childContextTypes,typeof m.getChildContext!="function")return u;m=m.getChildContext();for(var w in m)if(!(w in o))throw Error(n(108,He(r)||"Unknown",w));return E({},u,m)}function pl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Ti,es=zn.current,rn(zn,r),rn(rr,rr.current),!0}function Ep(r,o,u){var m=r.stateNode;if(!m)throw Error(n(169));u?(r=Tp(r,o,es),m.__reactInternalMemoizedMergedChildContext=r,ln(rr),ln(zn),rn(zn,r)):ln(rr),rn(rr,u)}var di=null,gl=!1,Uu=!1;function Rp(r){di===null?di=[r]:di.push(r)}function s1(r){gl=!0,Rp(r)}function Ei(){if(!Uu&&di!==null){Uu=!0;var r=0,o=Jt;try{var u=di;for(Jt=1;r<u.length;r++){var m=u[r];do m=m(!0);while(m!==null)}di=null,gl=!1}catch(w){throw di!==null&&(di=di.slice(r+1)),se(tt,Ei),w}finally{Jt=o,Uu=!1}}return null}var Fs=[],Os=0,yl=null,vl=0,Pr=[],Tr=0,ts=null,hi=1,fi="";function ns(r,o){Fs[Os++]=vl,Fs[Os++]=yl,yl=r,vl=o}function Mp(r,o,u){Pr[Tr++]=hi,Pr[Tr++]=fi,Pr[Tr++]=ts,ts=r;var m=hi;r=fi;var w=32-ve(m)-1;m&=~(1<<w),u+=1;var x=32-ve(o)+w;if(30<x){var N=w-w%5;x=(m&(1<<N)-1).toString(32),m>>=N,w-=N,hi=1<<32-ve(o)+w|u<<w|m,fi=x+r}else hi=1<<x|u<<w|m,fi=r}function Wu(r){r.return!==null&&(ns(r,1),Mp(r,1,0))}function zu(r){for(;r===yl;)yl=Fs[--Os],Fs[Os]=null,vl=Fs[--Os],Fs[Os]=null;for(;r===ts;)ts=Pr[--Tr],Pr[Tr]=null,fi=Pr[--Tr],Pr[Tr]=null,hi=Pr[--Tr],Pr[Tr]=null}var yr=null,vr=null,dn=!1,Ur=null;function Ap(r,o){var u=Ar(5,null,null,0);u.elementType="DELETED",u.stateNode=o,u.return=r,o=r.deletions,o===null?(r.deletions=[u],r.flags|=16):o.push(u)}function Lp(r,o){switch(r.tag){case 5:var u=r.type;return o=o.nodeType!==1||u.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(r.stateNode=o,yr=r,vr=Ni(o.firstChild),!0):!1;case 6:return o=r.pendingProps===""||o.nodeType!==3?null:o,o!==null?(r.stateNode=o,yr=r,vr=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(u=ts!==null?{id:hi,overflow:fi}:null,r.memoizedState={dehydrated:o,treeContext:u,retryLane:1073741824},u=Ar(18,null,null,0),u.stateNode=o,u.return=r,r.child=u,yr=r,vr=null,!0):!1;default:return!1}}function Hu(r){return(r.mode&1)!==0&&(r.flags&128)===0}function qu(r){if(dn){var o=vr;if(o){var u=o;if(!Lp(r,o)){if(Hu(r))throw Error(n(418));o=Ni(u.nextSibling);var m=yr;o&&Lp(r,o)?Ap(m,u):(r.flags=r.flags&-4097|2,dn=!1,yr=r)}}else{if(Hu(r))throw Error(n(418));r.flags=r.flags&-4097|2,dn=!1,yr=r}}}function Ip(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;yr=r}function wl(r){if(r!==yr)return!1;if(!dn)return Ip(r),dn=!0,!1;var o;if((o=r.tag!==3)&&!(o=r.tag!==5)&&(o=r.type,o=o!=="head"&&o!=="body"&&!Du(r.type,r.memoizedProps)),o&&(o=vr)){if(Hu(r))throw Dp(),Error(n(418));for(;o;)Ap(r,o),o=Ni(o.nextSibling)}if(Ip(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,o=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(o===0){vr=Ni(r.nextSibling);break e}o--}else u!=="$"&&u!=="$!"&&u!=="$?"||o++}r=r.nextSibling}vr=null}}else vr=yr?Ni(r.stateNode.nextSibling):null;return!0}function Dp(){for(var r=vr;r;)r=Ni(r.nextSibling)}function Bs(){vr=yr=null,dn=!1}function $u(r){Ur===null?Ur=[r]:Ur.push(r)}var o1=O.ReactCurrentBatchConfig;function Ho(r,o,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var m=u.stateNode}if(!m)throw Error(n(147,r));var w=m,x=""+r;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===x?o.ref:(o=function(N){var U=w.refs;N===null?delete U[x]:U[x]=N},o._stringRef=x,o)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function bl(r,o){throw r=Object.prototype.toString.call(o),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r))}function _p(r){var o=r._init;return o(r._payload)}function Fp(r){function o(oe,J){if(r){var ce=oe.deletions;ce===null?(oe.deletions=[J],oe.flags|=16):ce.push(J)}}function u(oe,J){if(!r)return null;for(;J!==null;)o(oe,J),J=J.sibling;return null}function m(oe,J){for(oe=new Map;J!==null;)J.key!==null?oe.set(J.key,J):oe.set(J.index,J),J=J.sibling;return oe}function w(oe,J){return oe=Fi(oe,J),oe.index=0,oe.sibling=null,oe}function x(oe,J,ce){return oe.index=ce,r?(ce=oe.alternate,ce!==null?(ce=ce.index,ce<J?(oe.flags|=2,J):ce):(oe.flags|=2,J)):(oe.flags|=1048576,J)}function N(oe){return r&&oe.alternate===null&&(oe.flags|=2),oe}function U(oe,J,ce,_e){return J===null||J.tag!==6?(J=_d(ce,oe.mode,_e),J.return=oe,J):(J=w(J,ce),J.return=oe,J)}function G(oe,J,ce,_e){var at=ce.type;return at===I?Ee(oe,J,ce.props.children,_e,ce.key):J!==null&&(J.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===pe&&_p(at)===J.type)?(_e=w(J,ce.props),_e.ref=Ho(oe,J,ce),_e.return=oe,_e):(_e=ql(ce.type,ce.key,ce.props,null,oe.mode,_e),_e.ref=Ho(oe,J,ce),_e.return=oe,_e)}function fe(oe,J,ce,_e){return J===null||J.tag!==4||J.stateNode.containerInfo!==ce.containerInfo||J.stateNode.implementation!==ce.implementation?(J=Fd(ce,oe.mode,_e),J.return=oe,J):(J=w(J,ce.children||[]),J.return=oe,J)}function Ee(oe,J,ce,_e,at){return J===null||J.tag!==7?(J=us(ce,oe.mode,_e,at),J.return=oe,J):(J=w(J,ce),J.return=oe,J)}function Re(oe,J,ce){if(typeof J=="string"&&J!==""||typeof J=="number")return J=_d(""+J,oe.mode,ce),J.return=oe,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case q:return ce=ql(J.type,J.key,J.props,null,oe.mode,ce),ce.ref=Ho(oe,null,J),ce.return=oe,ce;case _:return J=Fd(J,oe.mode,ce),J.return=oe,J;case pe:var _e=J._init;return Re(oe,_e(J._payload),ce)}if(Ht(J)||ye(J))return J=us(J,oe.mode,ce,null),J.return=oe,J;bl(oe,J)}return null}function Ne(oe,J,ce,_e){var at=J!==null?J.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number")return at!==null?null:U(oe,J,""+ce,_e);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case q:return ce.key===at?G(oe,J,ce,_e):null;case _:return ce.key===at?fe(oe,J,ce,_e):null;case pe:return at=ce._init,Ne(oe,J,at(ce._payload),_e)}if(Ht(ce)||ye(ce))return at!==null?null:Ee(oe,J,ce,_e,null);bl(oe,ce)}return null}function Ge(oe,J,ce,_e,at){if(typeof _e=="string"&&_e!==""||typeof _e=="number")return oe=oe.get(ce)||null,U(J,oe,""+_e,at);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case q:return oe=oe.get(_e.key===null?ce:_e.key)||null,G(J,oe,_e,at);case _:return oe=oe.get(_e.key===null?ce:_e.key)||null,fe(J,oe,_e,at);case pe:var pt=_e._init;return Ge(oe,J,ce,pt(_e._payload),at)}if(Ht(_e)||ye(_e))return oe=oe.get(ce)||null,Ee(J,oe,_e,at,null);bl(J,_e)}return null}function nt(oe,J,ce,_e){for(var at=null,pt=null,gt=J,xt=J=0,Fn=null;gt!==null&&xt<ce.length;xt++){gt.index>xt?(Fn=gt,gt=null):Fn=gt.sibling;var Yt=Ne(oe,gt,ce[xt],_e);if(Yt===null){gt===null&&(gt=Fn);break}r&&gt&&Yt.alternate===null&&o(oe,gt),J=x(Yt,J,xt),pt===null?at=Yt:pt.sibling=Yt,pt=Yt,gt=Fn}if(xt===ce.length)return u(oe,gt),dn&&ns(oe,xt),at;if(gt===null){for(;xt<ce.length;xt++)gt=Re(oe,ce[xt],_e),gt!==null&&(J=x(gt,J,xt),pt===null?at=gt:pt.sibling=gt,pt=gt);return dn&&ns(oe,xt),at}for(gt=m(oe,gt);xt<ce.length;xt++)Fn=Ge(gt,oe,xt,ce[xt],_e),Fn!==null&&(r&&Fn.alternate!==null&&gt.delete(Fn.key===null?xt:Fn.key),J=x(Fn,J,xt),pt===null?at=Fn:pt.sibling=Fn,pt=Fn);return r&&gt.forEach(function(Oi){return o(oe,Oi)}),dn&&ns(oe,xt),at}function st(oe,J,ce,_e){var at=ye(ce);if(typeof at!="function")throw Error(n(150));if(ce=at.call(ce),ce==null)throw Error(n(151));for(var pt=at=null,gt=J,xt=J=0,Fn=null,Yt=ce.next();gt!==null&&!Yt.done;xt++,Yt=ce.next()){gt.index>xt?(Fn=gt,gt=null):Fn=gt.sibling;var Oi=Ne(oe,gt,Yt.value,_e);if(Oi===null){gt===null&&(gt=Fn);break}r&&gt&&Oi.alternate===null&&o(oe,gt),J=x(Oi,J,xt),pt===null?at=Oi:pt.sibling=Oi,pt=Oi,gt=Fn}if(Yt.done)return u(oe,gt),dn&&ns(oe,xt),at;if(gt===null){for(;!Yt.done;xt++,Yt=ce.next())Yt=Re(oe,Yt.value,_e),Yt!==null&&(J=x(Yt,J,xt),pt===null?at=Yt:pt.sibling=Yt,pt=Yt);return dn&&ns(oe,xt),at}for(gt=m(oe,gt);!Yt.done;xt++,Yt=ce.next())Yt=Ge(gt,oe,xt,Yt.value,_e),Yt!==null&&(r&&Yt.alternate!==null&&gt.delete(Yt.key===null?xt:Yt.key),J=x(Yt,J,xt),pt===null?at=Yt:pt.sibling=Yt,pt=Yt);return r&&gt.forEach(function(B1){return o(oe,B1)}),dn&&ns(oe,xt),at}function bn(oe,J,ce,_e){if(typeof ce=="object"&&ce!==null&&ce.type===I&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case q:e:{for(var at=ce.key,pt=J;pt!==null;){if(pt.key===at){if(at=ce.type,at===I){if(pt.tag===7){u(oe,pt.sibling),J=w(pt,ce.props.children),J.return=oe,oe=J;break e}}else if(pt.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===pe&&_p(at)===pt.type){u(oe,pt.sibling),J=w(pt,ce.props),J.ref=Ho(oe,pt,ce),J.return=oe,oe=J;break e}u(oe,pt);break}else o(oe,pt);pt=pt.sibling}ce.type===I?(J=us(ce.props.children,oe.mode,_e,ce.key),J.return=oe,oe=J):(_e=ql(ce.type,ce.key,ce.props,null,oe.mode,_e),_e.ref=Ho(oe,J,ce),_e.return=oe,oe=_e)}return N(oe);case _:e:{for(pt=ce.key;J!==null;){if(J.key===pt)if(J.tag===4&&J.stateNode.containerInfo===ce.containerInfo&&J.stateNode.implementation===ce.implementation){u(oe,J.sibling),J=w(J,ce.children||[]),J.return=oe,oe=J;break e}else{u(oe,J);break}else o(oe,J);J=J.sibling}J=Fd(ce,oe.mode,_e),J.return=oe,oe=J}return N(oe);case pe:return pt=ce._init,bn(oe,J,pt(ce._payload),_e)}if(Ht(ce))return nt(oe,J,ce,_e);if(ye(ce))return st(oe,J,ce,_e);bl(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,J!==null&&J.tag===6?(u(oe,J.sibling),J=w(J,ce),J.return=oe,oe=J):(u(oe,J),J=_d(ce,oe.mode,_e),J.return=oe,oe=J),N(oe)):u(oe,J)}return bn}var Us=Fp(!0),Op=Fp(!1),xl=Pi(null),kl=null,Ws=null,Vu=null;function Gu(){Vu=Ws=kl=null}function Ku(r){var o=xl.current;ln(xl),r._currentValue=o}function Qu(r,o,u){for(;r!==null;){var m=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,m!==null&&(m.childLanes|=o)):m!==null&&(m.childLanes&o)!==o&&(m.childLanes|=o),r===u)break;r=r.return}}function zs(r,o){kl=r,Vu=Ws=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&o)!==0&&(sr=!0),r.firstContext=null)}function Er(r){var o=r._currentValue;if(Vu!==r)if(r={context:r,memoizedValue:o,next:null},Ws===null){if(kl===null)throw Error(n(308));Ws=r,kl.dependencies={lanes:0,firstContext:r}}else Ws=Ws.next=r;return o}var rs=null;function Yu(r){rs===null?rs=[r]:rs.push(r)}function Bp(r,o,u,m){var w=o.interleaved;return w===null?(u.next=u,Yu(o)):(u.next=w.next,w.next=u),o.interleaved=u,mi(r,m)}function mi(r,o){r.lanes|=o;var u=r.alternate;for(u!==null&&(u.lanes|=o),u=r,r=r.return;r!==null;)r.childLanes|=o,u=r.alternate,u!==null&&(u.childLanes|=o),u=r,r=r.return;return u.tag===3?u.stateNode:null}var Ri=!1;function Xu(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Up(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function pi(r,o){return{eventTime:r,lane:o,tag:0,payload:null,callback:null,next:null}}function Mi(r,o,u){var m=r.updateQueue;if(m===null)return null;if(m=m.shared,(Qt&2)!==0){var w=m.pending;return w===null?o.next=o:(o.next=w.next,w.next=o),m.pending=o,mi(r,u)}return w=m.interleaved,w===null?(o.next=o,Yu(m)):(o.next=w.next,w.next=o),m.interleaved=o,mi(r,u)}function Sl(r,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194240)!==0)){var m=o.lanes;m&=r.pendingLanes,u|=m,o.lanes=u,ko(r,u)}}function Wp(r,o){var u=r.updateQueue,m=r.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var w=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var N={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};x===null?w=x=N:x=x.next=N,u=u.next}while(u!==null);x===null?w=x=o:x=x.next=o}else w=x=o;u={baseState:m.baseState,firstBaseUpdate:w,lastBaseUpdate:x,shared:m.shared,effects:m.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=o:r.next=o,u.lastBaseUpdate=o}function Cl(r,o,u,m){var w=r.updateQueue;Ri=!1;var x=w.firstBaseUpdate,N=w.lastBaseUpdate,U=w.shared.pending;if(U!==null){w.shared.pending=null;var G=U,fe=G.next;G.next=null,N===null?x=fe:N.next=fe,N=G;var Ee=r.alternate;Ee!==null&&(Ee=Ee.updateQueue,U=Ee.lastBaseUpdate,U!==N&&(U===null?Ee.firstBaseUpdate=fe:U.next=fe,Ee.lastBaseUpdate=G))}if(x!==null){var Re=w.baseState;N=0,Ee=fe=G=null,U=x;do{var Ne=U.lane,Ge=U.eventTime;if((m&Ne)===Ne){Ee!==null&&(Ee=Ee.next={eventTime:Ge,lane:0,tag:U.tag,payload:U.payload,callback:U.callback,next:null});e:{var nt=r,st=U;switch(Ne=o,Ge=u,st.tag){case 1:if(nt=st.payload,typeof nt=="function"){Re=nt.call(Ge,Re,Ne);break e}Re=nt;break e;case 3:nt.flags=nt.flags&-65537|128;case 0:if(nt=st.payload,Ne=typeof nt=="function"?nt.call(Ge,Re,Ne):nt,Ne==null)break e;Re=E({},Re,Ne);break e;case 2:Ri=!0}}U.callback!==null&&U.lane!==0&&(r.flags|=64,Ne=w.effects,Ne===null?w.effects=[U]:Ne.push(U))}else Ge={eventTime:Ge,lane:Ne,tag:U.tag,payload:U.payload,callback:U.callback,next:null},Ee===null?(fe=Ee=Ge,G=Re):Ee=Ee.next=Ge,N|=Ne;if(U=U.next,U===null){if(U=w.shared.pending,U===null)break;Ne=U,U=Ne.next,Ne.next=null,w.lastBaseUpdate=Ne,w.shared.pending=null}}while(!0);if(Ee===null&&(G=Re),w.baseState=G,w.firstBaseUpdate=fe,w.lastBaseUpdate=Ee,o=w.shared.interleaved,o!==null){w=o;do N|=w.lane,w=w.next;while(w!==o)}else x===null&&(w.shared.lanes=0);os|=N,r.lanes=N,r.memoizedState=Re}}function zp(r,o,u){if(r=o.effects,o.effects=null,r!==null)for(o=0;o<r.length;o++){var m=r[o],w=m.callback;if(w!==null){if(m.callback=null,m=u,typeof w!="function")throw Error(n(191,w));w.call(m)}}}var qo={},ei=Pi(qo),$o=Pi(qo),Vo=Pi(qo);function is(r){if(r===qo)throw Error(n(174));return r}function Ju(r,o){switch(rn(Vo,o),rn($o,r),rn(ei,qo),r=o.nodeType,r){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:ge(null,"");break;default:r=r===8?o.parentNode:o,o=r.namespaceURI||null,r=r.tagName,o=ge(o,r)}ln(ei),rn(ei,o)}function Hs(){ln(ei),ln($o),ln(Vo)}function Hp(r){is(Vo.current);var o=is(ei.current),u=ge(o,r.type);o!==u&&(rn($o,r),rn(ei,u))}function Zu(r){$o.current===r&&(ln(ei),ln($o))}var fn=Pi(0);function jl(r){for(var o=r;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ed=[];function td(){for(var r=0;r<ed.length;r++)ed[r]._workInProgressVersionPrimary=null;ed.length=0}var Nl=O.ReactCurrentDispatcher,nd=O.ReactCurrentBatchConfig,ss=0,mn=null,Nn=null,Dn=null,Pl=!1,Go=!1,Ko=0,a1=0;function Hn(){throw Error(n(321))}function rd(r,o){if(o===null)return!1;for(var u=0;u<o.length&&u<r.length;u++)if(!Br(r[u],o[u]))return!1;return!0}function id(r,o,u,m,w,x){if(ss=x,mn=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Nl.current=r===null||r.memoizedState===null?d1:h1,r=u(m,w),Go){x=0;do{if(Go=!1,Ko=0,25<=x)throw Error(n(301));x+=1,Dn=Nn=null,o.updateQueue=null,Nl.current=f1,r=u(m,w)}while(Go)}if(Nl.current=Rl,o=Nn!==null&&Nn.next!==null,ss=0,Dn=Nn=mn=null,Pl=!1,o)throw Error(n(300));return r}function sd(){var r=Ko!==0;return Ko=0,r}function ti(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dn===null?mn.memoizedState=Dn=r:Dn=Dn.next=r,Dn}function Rr(){if(Nn===null){var r=mn.alternate;r=r!==null?r.memoizedState:null}else r=Nn.next;var o=Dn===null?mn.memoizedState:Dn.next;if(o!==null)Dn=o,Nn=r;else{if(r===null)throw Error(n(310));Nn=r,r={memoizedState:Nn.memoizedState,baseState:Nn.baseState,baseQueue:Nn.baseQueue,queue:Nn.queue,next:null},Dn===null?mn.memoizedState=Dn=r:Dn=Dn.next=r}return Dn}function Qo(r,o){return typeof o=="function"?o(r):o}function od(r){var o=Rr(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var m=Nn,w=m.baseQueue,x=u.pending;if(x!==null){if(w!==null){var N=w.next;w.next=x.next,x.next=N}m.baseQueue=w=x,u.pending=null}if(w!==null){x=w.next,m=m.baseState;var U=N=null,G=null,fe=x;do{var Ee=fe.lane;if((ss&Ee)===Ee)G!==null&&(G=G.next={lane:0,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),m=fe.hasEagerState?fe.eagerState:r(m,fe.action);else{var Re={lane:Ee,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null};G===null?(U=G=Re,N=m):G=G.next=Re,mn.lanes|=Ee,os|=Ee}fe=fe.next}while(fe!==null&&fe!==x);G===null?N=m:G.next=U,Br(m,o.memoizedState)||(sr=!0),o.memoizedState=m,o.baseState=N,o.baseQueue=G,u.lastRenderedState=m}if(r=u.interleaved,r!==null){w=r;do x=w.lane,mn.lanes|=x,os|=x,w=w.next;while(w!==r)}else w===null&&(u.lanes=0);return[o.memoizedState,u.dispatch]}function ad(r){var o=Rr(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var m=u.dispatch,w=u.pending,x=o.memoizedState;if(w!==null){u.pending=null;var N=w=w.next;do x=r(x,N.action),N=N.next;while(N!==w);Br(x,o.memoizedState)||(sr=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),u.lastRenderedState=x}return[x,m]}function qp(){}function $p(r,o){var u=mn,m=Rr(),w=o(),x=!Br(m.memoizedState,w);if(x&&(m.memoizedState=w,sr=!0),m=m.queue,ld(Kp.bind(null,u,m,r),[r]),m.getSnapshot!==o||x||Dn!==null&&Dn.memoizedState.tag&1){if(u.flags|=2048,Yo(9,Gp.bind(null,u,m,w,o),void 0,null),_n===null)throw Error(n(349));(ss&30)!==0||Vp(u,o,w)}return w}function Vp(r,o,u){r.flags|=16384,r={getSnapshot:o,value:u},o=mn.updateQueue,o===null?(o={lastEffect:null,stores:null},mn.updateQueue=o,o.stores=[r]):(u=o.stores,u===null?o.stores=[r]:u.push(r))}function Gp(r,o,u,m){o.value=u,o.getSnapshot=m,Qp(o)&&Yp(r)}function Kp(r,o,u){return u(function(){Qp(o)&&Yp(r)})}function Qp(r){var o=r.getSnapshot;r=r.value;try{var u=o();return!Br(r,u)}catch{return!0}}function Yp(r){var o=mi(r,1);o!==null&&qr(o,r,1,-1)}function Xp(r){var o=ti();return typeof r=="function"&&(r=r()),o.memoizedState=o.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:r},o.queue=r,r=r.dispatch=u1.bind(null,mn,r),[o.memoizedState,r]}function Yo(r,o,u,m){return r={tag:r,create:o,destroy:u,deps:m,next:null},o=mn.updateQueue,o===null?(o={lastEffect:null,stores:null},mn.updateQueue=o,o.lastEffect=r.next=r):(u=o.lastEffect,u===null?o.lastEffect=r.next=r:(m=u.next,u.next=r,r.next=m,o.lastEffect=r)),r}function Jp(){return Rr().memoizedState}function Tl(r,o,u,m){var w=ti();mn.flags|=r,w.memoizedState=Yo(1|o,u,void 0,m===void 0?null:m)}function El(r,o,u,m){var w=Rr();m=m===void 0?null:m;var x=void 0;if(Nn!==null){var N=Nn.memoizedState;if(x=N.destroy,m!==null&&rd(m,N.deps)){w.memoizedState=Yo(o,u,x,m);return}}mn.flags|=r,w.memoizedState=Yo(1|o,u,x,m)}function Zp(r,o){return Tl(8390656,8,r,o)}function ld(r,o){return El(2048,8,r,o)}function eg(r,o){return El(4,2,r,o)}function tg(r,o){return El(4,4,r,o)}function ng(r,o){if(typeof o=="function")return r=r(),o(r),function(){o(null)};if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function rg(r,o,u){return u=u!=null?u.concat([r]):null,El(4,4,ng.bind(null,o,r),u)}function cd(){}function ig(r,o){var u=Rr();o=o===void 0?null:o;var m=u.memoizedState;return m!==null&&o!==null&&rd(o,m[1])?m[0]:(u.memoizedState=[r,o],r)}function sg(r,o){var u=Rr();o=o===void 0?null:o;var m=u.memoizedState;return m!==null&&o!==null&&rd(o,m[1])?m[0]:(r=r(),u.memoizedState=[r,o],r)}function og(r,o,u){return(ss&21)===0?(r.baseState&&(r.baseState=!1,sr=!0),r.memoizedState=u):(Br(u,o)||(u=xo(),mn.lanes|=u,os|=u,r.baseState=!0),o)}function l1(r,o){var u=Jt;Jt=u!==0&&4>u?u:4,r(!0);var m=nd.transition;nd.transition={};try{r(!1),o()}finally{Jt=u,nd.transition=m}}function ag(){return Rr().memoizedState}function c1(r,o,u){var m=Di(r);if(u={lane:m,action:u,hasEagerState:!1,eagerState:null,next:null},lg(r))cg(o,u);else if(u=Bp(r,o,u,m),u!==null){var w=Xn();qr(u,r,m,w),ug(u,o,m)}}function u1(r,o,u){var m=Di(r),w={lane:m,action:u,hasEagerState:!1,eagerState:null,next:null};if(lg(r))cg(o,w);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=o.lastRenderedReducer,x!==null))try{var N=o.lastRenderedState,U=x(N,u);if(w.hasEagerState=!0,w.eagerState=U,Br(U,N)){var G=o.interleaved;G===null?(w.next=w,Yu(o)):(w.next=G.next,G.next=w),o.interleaved=w;return}}catch{}finally{}u=Bp(r,o,w,m),u!==null&&(w=Xn(),qr(u,r,m,w),ug(u,o,m))}}function lg(r){var o=r.alternate;return r===mn||o!==null&&o===mn}function cg(r,o){Go=Pl=!0;var u=r.pending;u===null?o.next=o:(o.next=u.next,u.next=o),r.pending=o}function ug(r,o,u){if((u&4194240)!==0){var m=o.lanes;m&=r.pendingLanes,u|=m,o.lanes=u,ko(r,u)}}var Rl={readContext:Er,useCallback:Hn,useContext:Hn,useEffect:Hn,useImperativeHandle:Hn,useInsertionEffect:Hn,useLayoutEffect:Hn,useMemo:Hn,useReducer:Hn,useRef:Hn,useState:Hn,useDebugValue:Hn,useDeferredValue:Hn,useTransition:Hn,useMutableSource:Hn,useSyncExternalStore:Hn,useId:Hn,unstable_isNewReconciler:!1},d1={readContext:Er,useCallback:function(r,o){return ti().memoizedState=[r,o===void 0?null:o],r},useContext:Er,useEffect:Zp,useImperativeHandle:function(r,o,u){return u=u!=null?u.concat([r]):null,Tl(4194308,4,ng.bind(null,o,r),u)},useLayoutEffect:function(r,o){return Tl(4194308,4,r,o)},useInsertionEffect:function(r,o){return Tl(4,2,r,o)},useMemo:function(r,o){var u=ti();return o=o===void 0?null:o,r=r(),u.memoizedState=[r,o],r},useReducer:function(r,o,u){var m=ti();return o=u!==void 0?u(o):o,m.memoizedState=m.baseState=o,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:o},m.queue=r,r=r.dispatch=c1.bind(null,mn,r),[m.memoizedState,r]},useRef:function(r){var o=ti();return r={current:r},o.memoizedState=r},useState:Xp,useDebugValue:cd,useDeferredValue:function(r){return ti().memoizedState=r},useTransition:function(){var r=Xp(!1),o=r[0];return r=l1.bind(null,r[1]),ti().memoizedState=r,[o,r]},useMutableSource:function(){},useSyncExternalStore:function(r,o,u){var m=mn,w=ti();if(dn){if(u===void 0)throw Error(n(407));u=u()}else{if(u=o(),_n===null)throw Error(n(349));(ss&30)!==0||Vp(m,o,u)}w.memoizedState=u;var x={value:u,getSnapshot:o};return w.queue=x,Zp(Kp.bind(null,m,x,r),[r]),m.flags|=2048,Yo(9,Gp.bind(null,m,x,u,o),void 0,null),u},useId:function(){var r=ti(),o=_n.identifierPrefix;if(dn){var u=fi,m=hi;u=(m&~(1<<32-ve(m)-1)).toString(32)+u,o=":"+o+"R"+u,u=Ko++,0<u&&(o+="H"+u.toString(32)),o+=":"}else u=a1++,o=":"+o+"r"+u.toString(32)+":";return r.memoizedState=o},unstable_isNewReconciler:!1},h1={readContext:Er,useCallback:ig,useContext:Er,useEffect:ld,useImperativeHandle:rg,useInsertionEffect:eg,useLayoutEffect:tg,useMemo:sg,useReducer:od,useRef:Jp,useState:function(){return od(Qo)},useDebugValue:cd,useDeferredValue:function(r){var o=Rr();return og(o,Nn.memoizedState,r)},useTransition:function(){var r=od(Qo)[0],o=Rr().memoizedState;return[r,o]},useMutableSource:qp,useSyncExternalStore:$p,useId:ag,unstable_isNewReconciler:!1},f1={readContext:Er,useCallback:ig,useContext:Er,useEffect:ld,useImperativeHandle:rg,useInsertionEffect:eg,useLayoutEffect:tg,useMemo:sg,useReducer:ad,useRef:Jp,useState:function(){return ad(Qo)},useDebugValue:cd,useDeferredValue:function(r){var o=Rr();return Nn===null?o.memoizedState=r:og(o,Nn.memoizedState,r)},useTransition:function(){var r=ad(Qo)[0],o=Rr().memoizedState;return[r,o]},useMutableSource:qp,useSyncExternalStore:$p,useId:ag,unstable_isNewReconciler:!1};function Wr(r,o){if(r&&r.defaultProps){o=E({},o),r=r.defaultProps;for(var u in r)o[u]===void 0&&(o[u]=r[u]);return o}return o}function ud(r,o,u,m){o=r.memoizedState,u=u(m,o),u=u==null?o:E({},o,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Ml={isMounted:function(r){return(r=r._reactInternals)?Oe(r)===r:!1},enqueueSetState:function(r,o,u){r=r._reactInternals;var m=Xn(),w=Di(r),x=pi(m,w);x.payload=o,u!=null&&(x.callback=u),o=Mi(r,x,w),o!==null&&(qr(o,r,w,m),Sl(o,r,w))},enqueueReplaceState:function(r,o,u){r=r._reactInternals;var m=Xn(),w=Di(r),x=pi(m,w);x.tag=1,x.payload=o,u!=null&&(x.callback=u),o=Mi(r,x,w),o!==null&&(qr(o,r,w,m),Sl(o,r,w))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var u=Xn(),m=Di(r),w=pi(u,m);w.tag=2,o!=null&&(w.callback=o),o=Mi(r,w,m),o!==null&&(qr(o,r,m,u),Sl(o,r,m))}};function dg(r,o,u,m,w,x,N){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(m,x,N):o.prototype&&o.prototype.isPureReactComponent?!_o(u,m)||!_o(w,x):!0}function hg(r,o,u){var m=!1,w=Ti,x=o.contextType;return typeof x=="object"&&x!==null?x=Er(x):(w=ir(o)?es:zn.current,m=o.contextTypes,x=(m=m!=null)?_s(r,w):Ti),o=new o(u,x),r.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Ml,r.stateNode=o,o._reactInternals=r,m&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=w,r.__reactInternalMemoizedMaskedChildContext=x),o}function fg(r,o,u,m){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,m),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,m),o.state!==r&&Ml.enqueueReplaceState(o,o.state,null)}function dd(r,o,u,m){var w=r.stateNode;w.props=u,w.state=r.memoizedState,w.refs={},Xu(r);var x=o.contextType;typeof x=="object"&&x!==null?w.context=Er(x):(x=ir(o)?es:zn.current,w.context=_s(r,x)),w.state=r.memoizedState,x=o.getDerivedStateFromProps,typeof x=="function"&&(ud(r,o,x,u),w.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(o=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),o!==w.state&&Ml.enqueueReplaceState(w,w.state,null),Cl(r,u,w,m),w.state=r.memoizedState),typeof w.componentDidMount=="function"&&(r.flags|=4194308)}function qs(r,o){try{var u="",m=o;do u+=Le(m),m=m.return;while(m);var w=u}catch(x){w=`
40
+ Error generating stack: `+x.message+`
41
+ `+x.stack}return{value:r,source:o,stack:w,digest:null}}function hd(r,o,u){return{value:r,source:null,stack:u??null,digest:o??null}}function fd(r,o){try{console.error(o.value)}catch(u){setTimeout(function(){throw u})}}var m1=typeof WeakMap=="function"?WeakMap:Map;function mg(r,o,u){u=pi(-1,u),u.tag=3,u.payload={element:null};var m=o.value;return u.callback=function(){Ol||(Ol=!0,Td=m),fd(r,o)},u}function pg(r,o,u){u=pi(-1,u),u.tag=3;var m=r.type.getDerivedStateFromError;if(typeof m=="function"){var w=o.value;u.payload=function(){return m(w)},u.callback=function(){fd(r,o)}}var x=r.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){fd(r,o),typeof m!="function"&&(Li===null?Li=new Set([this]):Li.add(this));var N=o.stack;this.componentDidCatch(o.value,{componentStack:N!==null?N:""})}),u}function gg(r,o,u){var m=r.pingCache;if(m===null){m=r.pingCache=new m1;var w=new Set;m.set(o,w)}else w=m.get(o),w===void 0&&(w=new Set,m.set(o,w));w.has(u)||(w.add(u),r=T1.bind(null,r,o,u),o.then(r,r))}function yg(r){do{var o;if((o=r.tag===13)&&(o=r.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return r;r=r.return}while(r!==null);return null}function vg(r,o,u,m,w){return(r.mode&1)===0?(r===o?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(o=pi(-1,1),o.tag=2,Mi(u,o,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=w,r)}var p1=O.ReactCurrentOwner,sr=!1;function Yn(r,o,u,m){o.child=r===null?Op(o,null,u,m):Us(o,r.child,u,m)}function wg(r,o,u,m,w){u=u.render;var x=o.ref;return zs(o,w),m=id(r,o,u,m,x,w),u=sd(),r!==null&&!sr?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~w,gi(r,o,w)):(dn&&u&&Wu(o),o.flags|=1,Yn(r,o,m,w),o.child)}function bg(r,o,u,m,w){if(r===null){var x=u.type;return typeof x=="function"&&!Dd(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(o.tag=15,o.type=x,xg(r,o,x,m,w)):(r=ql(u.type,null,m,o,o.mode,w),r.ref=o.ref,r.return=o,o.child=r)}if(x=r.child,(r.lanes&w)===0){var N=x.memoizedProps;if(u=u.compare,u=u!==null?u:_o,u(N,m)&&r.ref===o.ref)return gi(r,o,w)}return o.flags|=1,r=Fi(x,m),r.ref=o.ref,r.return=o,o.child=r}function xg(r,o,u,m,w){if(r!==null){var x=r.memoizedProps;if(_o(x,m)&&r.ref===o.ref)if(sr=!1,o.pendingProps=m=x,(r.lanes&w)!==0)(r.flags&131072)!==0&&(sr=!0);else return o.lanes=r.lanes,gi(r,o,w)}return md(r,o,u,m,w)}function kg(r,o,u){var m=o.pendingProps,w=m.children,x=r!==null?r.memoizedState:null;if(m.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},rn(Vs,wr),wr|=u;else{if((u&1073741824)===0)return r=x!==null?x.baseLanes|u:u,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:r,cachePool:null,transitions:null},o.updateQueue=null,rn(Vs,wr),wr|=r,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=x!==null?x.baseLanes:u,rn(Vs,wr),wr|=m}else x!==null?(m=x.baseLanes|u,o.memoizedState=null):m=u,rn(Vs,wr),wr|=m;return Yn(r,o,w,u),o.child}function Sg(r,o){var u=o.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(o.flags|=512,o.flags|=2097152)}function md(r,o,u,m,w){var x=ir(u)?es:zn.current;return x=_s(o,x),zs(o,w),u=id(r,o,u,m,x,w),m=sd(),r!==null&&!sr?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~w,gi(r,o,w)):(dn&&m&&Wu(o),o.flags|=1,Yn(r,o,u,w),o.child)}function Cg(r,o,u,m,w){if(ir(u)){var x=!0;pl(o)}else x=!1;if(zs(o,w),o.stateNode===null)Ll(r,o),hg(o,u,m),dd(o,u,m,w),m=!0;else if(r===null){var N=o.stateNode,U=o.memoizedProps;N.props=U;var G=N.context,fe=u.contextType;typeof fe=="object"&&fe!==null?fe=Er(fe):(fe=ir(u)?es:zn.current,fe=_s(o,fe));var Ee=u.getDerivedStateFromProps,Re=typeof Ee=="function"||typeof N.getSnapshotBeforeUpdate=="function";Re||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(U!==m||G!==fe)&&fg(o,N,m,fe),Ri=!1;var Ne=o.memoizedState;N.state=Ne,Cl(o,m,N,w),G=o.memoizedState,U!==m||Ne!==G||rr.current||Ri?(typeof Ee=="function"&&(ud(o,u,Ee,m),G=o.memoizedState),(U=Ri||dg(o,u,U,m,Ne,G,fe))?(Re||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(o.flags|=4194308)):(typeof N.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=m,o.memoizedState=G),N.props=m,N.state=G,N.context=fe,m=U):(typeof N.componentDidMount=="function"&&(o.flags|=4194308),m=!1)}else{N=o.stateNode,Up(r,o),U=o.memoizedProps,fe=o.type===o.elementType?U:Wr(o.type,U),N.props=fe,Re=o.pendingProps,Ne=N.context,G=u.contextType,typeof G=="object"&&G!==null?G=Er(G):(G=ir(u)?es:zn.current,G=_s(o,G));var Ge=u.getDerivedStateFromProps;(Ee=typeof Ge=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(U!==Re||Ne!==G)&&fg(o,N,m,G),Ri=!1,Ne=o.memoizedState,N.state=Ne,Cl(o,m,N,w);var nt=o.memoizedState;U!==Re||Ne!==nt||rr.current||Ri?(typeof Ge=="function"&&(ud(o,u,Ge,m),nt=o.memoizedState),(fe=Ri||dg(o,u,fe,m,Ne,nt,G)||!1)?(Ee||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(m,nt,G),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(m,nt,G)),typeof N.componentDidUpdate=="function"&&(o.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof N.componentDidUpdate!="function"||U===r.memoizedProps&&Ne===r.memoizedState||(o.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||U===r.memoizedProps&&Ne===r.memoizedState||(o.flags|=1024),o.memoizedProps=m,o.memoizedState=nt),N.props=m,N.state=nt,N.context=G,m=fe):(typeof N.componentDidUpdate!="function"||U===r.memoizedProps&&Ne===r.memoizedState||(o.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||U===r.memoizedProps&&Ne===r.memoizedState||(o.flags|=1024),m=!1)}return pd(r,o,u,m,x,w)}function pd(r,o,u,m,w,x){Sg(r,o);var N=(o.flags&128)!==0;if(!m&&!N)return w&&Ep(o,u,!1),gi(r,o,x);m=o.stateNode,p1.current=o;var U=N&&typeof u.getDerivedStateFromError!="function"?null:m.render();return o.flags|=1,r!==null&&N?(o.child=Us(o,r.child,null,x),o.child=Us(o,null,U,x)):Yn(r,o,U,x),o.memoizedState=m.state,w&&Ep(o,u,!0),o.child}function jg(r){var o=r.stateNode;o.pendingContext?Pp(r,o.pendingContext,o.pendingContext!==o.context):o.context&&Pp(r,o.context,!1),Ju(r,o.containerInfo)}function Ng(r,o,u,m,w){return Bs(),$u(w),o.flags|=256,Yn(r,o,u,m),o.child}var gd={dehydrated:null,treeContext:null,retryLane:0};function yd(r){return{baseLanes:r,cachePool:null,transitions:null}}function Pg(r,o,u){var m=o.pendingProps,w=fn.current,x=!1,N=(o.flags&128)!==0,U;if((U=N)||(U=r!==null&&r.memoizedState===null?!1:(w&2)!==0),U?(x=!0,o.flags&=-129):(r===null||r.memoizedState!==null)&&(w|=1),rn(fn,w&1),r===null)return qu(o),r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((o.mode&1)===0?o.lanes=1:r.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(N=m.children,r=m.fallback,x?(m=o.mode,x=o.child,N={mode:"hidden",children:N},(m&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=N):x=$l(N,m,0,null),r=us(r,m,u,null),x.return=o,r.return=o,x.sibling=r,o.child=x,o.child.memoizedState=yd(u),o.memoizedState=gd,r):vd(o,N));if(w=r.memoizedState,w!==null&&(U=w.dehydrated,U!==null))return g1(r,o,N,m,U,w,u);if(x){x=m.fallback,N=o.mode,w=r.child,U=w.sibling;var G={mode:"hidden",children:m.children};return(N&1)===0&&o.child!==w?(m=o.child,m.childLanes=0,m.pendingProps=G,o.deletions=null):(m=Fi(w,G),m.subtreeFlags=w.subtreeFlags&14680064),U!==null?x=Fi(U,x):(x=us(x,N,u,null),x.flags|=2),x.return=o,m.return=o,m.sibling=x,o.child=m,m=x,x=o.child,N=r.child.memoizedState,N=N===null?yd(u):{baseLanes:N.baseLanes|u,cachePool:null,transitions:N.transitions},x.memoizedState=N,x.childLanes=r.childLanes&~u,o.memoizedState=gd,m}return x=r.child,r=x.sibling,m=Fi(x,{mode:"visible",children:m.children}),(o.mode&1)===0&&(m.lanes=u),m.return=o,m.sibling=null,r!==null&&(u=o.deletions,u===null?(o.deletions=[r],o.flags|=16):u.push(r)),o.child=m,o.memoizedState=null,m}function vd(r,o){return o=$l({mode:"visible",children:o},r.mode,0,null),o.return=r,r.child=o}function Al(r,o,u,m){return m!==null&&$u(m),Us(o,r.child,null,u),r=vd(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function g1(r,o,u,m,w,x,N){if(u)return o.flags&256?(o.flags&=-257,m=hd(Error(n(422))),Al(r,o,N,m)):o.memoizedState!==null?(o.child=r.child,o.flags|=128,null):(x=m.fallback,w=o.mode,m=$l({mode:"visible",children:m.children},w,0,null),x=us(x,w,N,null),x.flags|=2,m.return=o,x.return=o,m.sibling=x,o.child=m,(o.mode&1)!==0&&Us(o,r.child,null,N),o.child.memoizedState=yd(N),o.memoizedState=gd,x);if((o.mode&1)===0)return Al(r,o,N,null);if(w.data==="$!"){if(m=w.nextSibling&&w.nextSibling.dataset,m)var U=m.dgst;return m=U,x=Error(n(419)),m=hd(x,m,void 0),Al(r,o,N,m)}if(U=(N&r.childLanes)!==0,sr||U){if(m=_n,m!==null){switch(N&-N){case 4:w=2;break;case 16:w=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(m.suspendedLanes|N))!==0?0:w,w!==0&&w!==x.retryLane&&(x.retryLane=w,mi(r,w),qr(m,r,w,-1))}return Id(),m=hd(Error(n(421))),Al(r,o,N,m)}return w.data==="$?"?(o.flags|=128,o.child=r.child,o=E1.bind(null,r),w._reactRetry=o,null):(r=x.treeContext,vr=Ni(w.nextSibling),yr=o,dn=!0,Ur=null,r!==null&&(Pr[Tr++]=hi,Pr[Tr++]=fi,Pr[Tr++]=ts,hi=r.id,fi=r.overflow,ts=o),o=vd(o,m.children),o.flags|=4096,o)}function Tg(r,o,u){r.lanes|=o;var m=r.alternate;m!==null&&(m.lanes|=o),Qu(r.return,o,u)}function wd(r,o,u,m,w){var x=r.memoizedState;x===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:w}:(x.isBackwards=o,x.rendering=null,x.renderingStartTime=0,x.last=m,x.tail=u,x.tailMode=w)}function Eg(r,o,u){var m=o.pendingProps,w=m.revealOrder,x=m.tail;if(Yn(r,o,m.children,u),m=fn.current,(m&2)!==0)m=m&1|2,o.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Tg(r,u,o);else if(r.tag===19)Tg(r,u,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}m&=1}if(rn(fn,m),(o.mode&1)===0)o.memoizedState=null;else switch(w){case"forwards":for(u=o.child,w=null;u!==null;)r=u.alternate,r!==null&&jl(r)===null&&(w=u),u=u.sibling;u=w,u===null?(w=o.child,o.child=null):(w=u.sibling,u.sibling=null),wd(o,!1,w,u,x);break;case"backwards":for(u=null,w=o.child,o.child=null;w!==null;){if(r=w.alternate,r!==null&&jl(r)===null){o.child=w;break}r=w.sibling,w.sibling=u,u=w,w=r}wd(o,!0,u,null,x);break;case"together":wd(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Ll(r,o){(o.mode&1)===0&&r!==null&&(r.alternate=null,o.alternate=null,o.flags|=2)}function gi(r,o,u){if(r!==null&&(o.dependencies=r.dependencies),os|=o.lanes,(u&o.childLanes)===0)return null;if(r!==null&&o.child!==r.child)throw Error(n(153));if(o.child!==null){for(r=o.child,u=Fi(r,r.pendingProps),o.child=u,u.return=o;r.sibling!==null;)r=r.sibling,u=u.sibling=Fi(r,r.pendingProps),u.return=o;u.sibling=null}return o.child}function y1(r,o,u){switch(o.tag){case 3:jg(o),Bs();break;case 5:Hp(o);break;case 1:ir(o.type)&&pl(o);break;case 4:Ju(o,o.stateNode.containerInfo);break;case 10:var m=o.type._context,w=o.memoizedProps.value;rn(xl,m._currentValue),m._currentValue=w;break;case 13:if(m=o.memoizedState,m!==null)return m.dehydrated!==null?(rn(fn,fn.current&1),o.flags|=128,null):(u&o.child.childLanes)!==0?Pg(r,o,u):(rn(fn,fn.current&1),r=gi(r,o,u),r!==null?r.sibling:null);rn(fn,fn.current&1);break;case 19:if(m=(u&o.childLanes)!==0,(r.flags&128)!==0){if(m)return Eg(r,o,u);o.flags|=128}if(w=o.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),rn(fn,fn.current),m)break;return null;case 22:case 23:return o.lanes=0,kg(r,o,u)}return gi(r,o,u)}var Rg,bd,Mg,Ag;Rg=function(r,o){for(var u=o.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},bd=function(){},Mg=function(r,o,u,m){var w=r.memoizedProps;if(w!==m){r=o.stateNode,is(ei.current);var x=null;switch(u){case"input":w=kt(r,w),m=kt(r,m),x=[];break;case"select":w=E({},w,{value:void 0}),m=E({},m,{value:void 0}),x=[];break;case"textarea":w=vt(r,w),m=vt(r,m),x=[];break;default:typeof w.onClick!="function"&&typeof m.onClick=="function"&&(r.onclick=hl)}V(u,m);var N;u=null;for(fe in w)if(!m.hasOwnProperty(fe)&&w.hasOwnProperty(fe)&&w[fe]!=null)if(fe==="style"){var U=w[fe];for(N in U)U.hasOwnProperty(N)&&(u||(u={}),u[N]="")}else fe!=="dangerouslySetInnerHTML"&&fe!=="children"&&fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&fe!=="autoFocus"&&(a.hasOwnProperty(fe)?x||(x=[]):(x=x||[]).push(fe,null));for(fe in m){var G=m[fe];if(U=w!=null?w[fe]:void 0,m.hasOwnProperty(fe)&&G!==U&&(G!=null||U!=null))if(fe==="style")if(U){for(N in U)!U.hasOwnProperty(N)||G&&G.hasOwnProperty(N)||(u||(u={}),u[N]="");for(N in G)G.hasOwnProperty(N)&&U[N]!==G[N]&&(u||(u={}),u[N]=G[N])}else u||(x||(x=[]),x.push(fe,u)),u=G;else fe==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,U=U?U.__html:void 0,G!=null&&U!==G&&(x=x||[]).push(fe,G)):fe==="children"?typeof G!="string"&&typeof G!="number"||(x=x||[]).push(fe,""+G):fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&(a.hasOwnProperty(fe)?(G!=null&&fe==="onScroll"&&an("scroll",r),x||U===G||(x=[])):(x=x||[]).push(fe,G))}u&&(x=x||[]).push("style",u);var fe=x;(o.updateQueue=fe)&&(o.flags|=4)}},Ag=function(r,o,u,m){u!==m&&(o.flags|=4)};function Xo(r,o){if(!dn)switch(r.tailMode){case"hidden":o=r.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:m.sibling=null}}function qn(r){var o=r.alternate!==null&&r.alternate.child===r.child,u=0,m=0;if(o)for(var w=r.child;w!==null;)u|=w.lanes|w.childLanes,m|=w.subtreeFlags&14680064,m|=w.flags&14680064,w.return=r,w=w.sibling;else for(w=r.child;w!==null;)u|=w.lanes|w.childLanes,m|=w.subtreeFlags,m|=w.flags,w.return=r,w=w.sibling;return r.subtreeFlags|=m,r.childLanes=u,o}function v1(r,o,u){var m=o.pendingProps;switch(zu(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qn(o),null;case 1:return ir(o.type)&&ml(),qn(o),null;case 3:return m=o.stateNode,Hs(),ln(rr),ln(zn),td(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(r===null||r.child===null)&&(wl(o)?o.flags|=4:r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Ur!==null&&(Md(Ur),Ur=null))),bd(r,o),qn(o),null;case 5:Zu(o);var w=is(Vo.current);if(u=o.type,r!==null&&o.stateNode!=null)Mg(r,o,u,m,w),r.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!m){if(o.stateNode===null)throw Error(n(166));return qn(o),null}if(r=is(ei.current),wl(o)){m=o.stateNode,u=o.type;var x=o.memoizedProps;switch(m[Zr]=o,m[Wo]=x,r=(o.mode&1)!==0,u){case"dialog":an("cancel",m),an("close",m);break;case"iframe":case"object":case"embed":an("load",m);break;case"video":case"audio":for(w=0;w<Oo.length;w++)an(Oo[w],m);break;case"source":an("error",m);break;case"img":case"image":case"link":an("error",m),an("load",m);break;case"details":an("toggle",m);break;case"input":Ve(m,x),an("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!x.multiple},an("invalid",m);break;case"textarea":$t(m,x),an("invalid",m)}V(u,x),w=null;for(var N in x)if(x.hasOwnProperty(N)){var U=x[N];N==="children"?typeof U=="string"?m.textContent!==U&&(x.suppressHydrationWarning!==!0&&dl(m.textContent,U,r),w=["children",U]):typeof U=="number"&&m.textContent!==""+U&&(x.suppressHydrationWarning!==!0&&dl(m.textContent,U,r),w=["children",""+U]):a.hasOwnProperty(N)&&U!=null&&N==="onScroll"&&an("scroll",m)}switch(u){case"input":bt(m),St(m,x,!0);break;case"textarea":bt(m),Lt(m);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(m.onclick=hl)}m=w,o.updateQueue=m,m!==null&&(o.flags|=4)}else{N=w.nodeType===9?w:w.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=ue(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=N.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof m.is=="string"?r=N.createElement(u,{is:m.is}):(r=N.createElement(u),u==="select"&&(N=r,m.multiple?N.multiple=!0:m.size&&(N.size=m.size))):r=N.createElementNS(r,u),r[Zr]=o,r[Wo]=m,Rg(r,o,!1,!1),o.stateNode=r;e:{switch(N=Me(u,m),u){case"dialog":an("cancel",r),an("close",r),w=m;break;case"iframe":case"object":case"embed":an("load",r),w=m;break;case"video":case"audio":for(w=0;w<Oo.length;w++)an(Oo[w],r);w=m;break;case"source":an("error",r),w=m;break;case"img":case"image":case"link":an("error",r),an("load",r),w=m;break;case"details":an("toggle",r),w=m;break;case"input":Ve(r,m),w=kt(r,m),an("invalid",r);break;case"option":w=m;break;case"select":r._wrapperState={wasMultiple:!!m.multiple},w=E({},m,{value:void 0}),an("invalid",r);break;case"textarea":$t(r,m),w=vt(r,m),an("invalid",r);break;default:w=m}V(u,w),U=w;for(x in U)if(U.hasOwnProperty(x)){var G=U[x];x==="style"?Nt(r,G):x==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,G!=null&&Pe(r,G)):x==="children"?typeof G=="string"?(u!=="textarea"||G!=="")&&ft(r,G):typeof G=="number"&&ft(r,""+G):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(a.hasOwnProperty(x)?G!=null&&x==="onScroll"&&an("scroll",r):G!=null&&M(r,x,G,N))}switch(u){case"input":bt(r),St(r,m,!1);break;case"textarea":bt(r),Lt(r);break;case"option":m.value!=null&&r.setAttribute("value",""+qe(m.value));break;case"select":r.multiple=!!m.multiple,x=m.value,x!=null?At(r,!!m.multiple,x,!1):m.defaultValue!=null&&At(r,!!m.multiple,m.defaultValue,!0);break;default:typeof w.onClick=="function"&&(r.onclick=hl)}switch(u){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return qn(o),null;case 6:if(r&&o.stateNode!=null)Ag(r,o,r.memoizedProps,m);else{if(typeof m!="string"&&o.stateNode===null)throw Error(n(166));if(u=is(Vo.current),is(ei.current),wl(o)){if(m=o.stateNode,u=o.memoizedProps,m[Zr]=o,(x=m.nodeValue!==u)&&(r=yr,r!==null))switch(r.tag){case 3:dl(m.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&dl(m.nodeValue,u,(r.mode&1)!==0)}x&&(o.flags|=4)}else m=(u.nodeType===9?u:u.ownerDocument).createTextNode(m),m[Zr]=o,o.stateNode=m}return qn(o),null;case 13:if(ln(fn),m=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(dn&&vr!==null&&(o.mode&1)!==0&&(o.flags&128)===0)Dp(),Bs(),o.flags|=98560,x=!1;else if(x=wl(o),m!==null&&m.dehydrated!==null){if(r===null){if(!x)throw Error(n(318));if(x=o.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[Zr]=o}else Bs(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;qn(o),x=!1}else Ur!==null&&(Md(Ur),Ur=null),x=!0;if(!x)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=u,o):(m=m!==null,m!==(r!==null&&r.memoizedState!==null)&&m&&(o.child.flags|=8192,(o.mode&1)!==0&&(r===null||(fn.current&1)!==0?Pn===0&&(Pn=3):Id())),o.updateQueue!==null&&(o.flags|=4),qn(o),null);case 4:return Hs(),bd(r,o),r===null&&Bo(o.stateNode.containerInfo),qn(o),null;case 10:return Ku(o.type._context),qn(o),null;case 17:return ir(o.type)&&ml(),qn(o),null;case 19:if(ln(fn),x=o.memoizedState,x===null)return qn(o),null;if(m=(o.flags&128)!==0,N=x.rendering,N===null)if(m)Xo(x,!1);else{if(Pn!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(N=jl(r),N!==null){for(o.flags|=128,Xo(x,!1),m=N.updateQueue,m!==null&&(o.updateQueue=m,o.flags|=4),o.subtreeFlags=0,m=u,u=o.child;u!==null;)x=u,r=m,x.flags&=14680066,N=x.alternate,N===null?(x.childLanes=0,x.lanes=r,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=N.childLanes,x.lanes=N.lanes,x.child=N.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=N.memoizedProps,x.memoizedState=N.memoizedState,x.updateQueue=N.updateQueue,x.type=N.type,r=N.dependencies,x.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return rn(fn,fn.current&1|2),o.child}r=r.sibling}x.tail!==null&&Se()>Gs&&(o.flags|=128,m=!0,Xo(x,!1),o.lanes=4194304)}else{if(!m)if(r=jl(N),r!==null){if(o.flags|=128,m=!0,u=r.updateQueue,u!==null&&(o.updateQueue=u,o.flags|=4),Xo(x,!0),x.tail===null&&x.tailMode==="hidden"&&!N.alternate&&!dn)return qn(o),null}else 2*Se()-x.renderingStartTime>Gs&&u!==1073741824&&(o.flags|=128,m=!0,Xo(x,!1),o.lanes=4194304);x.isBackwards?(N.sibling=o.child,o.child=N):(u=x.last,u!==null?u.sibling=N:o.child=N,x.last=N)}return x.tail!==null?(o=x.tail,x.rendering=o,x.tail=o.sibling,x.renderingStartTime=Se(),o.sibling=null,u=fn.current,rn(fn,m?u&1|2:u&1),o):(qn(o),null);case 22:case 23:return Ld(),m=o.memoizedState!==null,r!==null&&r.memoizedState!==null!==m&&(o.flags|=8192),m&&(o.mode&1)!==0?(wr&1073741824)!==0&&(qn(o),o.subtreeFlags&6&&(o.flags|=8192)):qn(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function w1(r,o){switch(zu(o),o.tag){case 1:return ir(o.type)&&ml(),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Hs(),ln(rr),ln(zn),td(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 5:return Zu(o),null;case 13:if(ln(fn),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Bs()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return ln(fn),null;case 4:return Hs(),null;case 10:return Ku(o.type._context),null;case 22:case 23:return Ld(),null;case 24:return null;default:return null}}var Il=!1,$n=!1,b1=typeof WeakSet=="function"?WeakSet:Set,Ze=null;function $s(r,o){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(m){vn(r,o,m)}else u.current=null}function xd(r,o,u){try{u()}catch(m){vn(r,o,m)}}var Lg=!1;function x1(r,o){if(Lu=el,r=dp(),ju(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var w=m.anchorOffset,x=m.focusNode;m=m.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var N=0,U=-1,G=-1,fe=0,Ee=0,Re=r,Ne=null;t:for(;;){for(var Ge;Re!==u||w!==0&&Re.nodeType!==3||(U=N+w),Re!==x||m!==0&&Re.nodeType!==3||(G=N+m),Re.nodeType===3&&(N+=Re.nodeValue.length),(Ge=Re.firstChild)!==null;)Ne=Re,Re=Ge;for(;;){if(Re===r)break t;if(Ne===u&&++fe===w&&(U=N),Ne===x&&++Ee===m&&(G=N),(Ge=Re.nextSibling)!==null)break;Re=Ne,Ne=Re.parentNode}Re=Ge}u=U===-1||G===-1?null:{start:U,end:G}}else u=null}u=u||{start:0,end:0}}else u=null;for(Iu={focusedElem:r,selectionRange:u},el=!1,Ze=o;Ze!==null;)if(o=Ze,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,Ze=r;else for(;Ze!==null;){o=Ze;try{var nt=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(nt!==null){var st=nt.memoizedProps,bn=nt.memoizedState,oe=o.stateNode,J=oe.getSnapshotBeforeUpdate(o.elementType===o.type?st:Wr(o.type,st),bn);oe.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var ce=o.stateNode.containerInfo;ce.nodeType===1?ce.textContent="":ce.nodeType===9&&ce.documentElement&&ce.removeChild(ce.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(_e){vn(o,o.return,_e)}if(r=o.sibling,r!==null){r.return=o.return,Ze=r;break}Ze=o.return}return nt=Lg,Lg=!1,nt}function Jo(r,o,u){var m=o.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var w=m=m.next;do{if((w.tag&r)===r){var x=w.destroy;w.destroy=void 0,x!==void 0&&xd(o,u,x)}w=w.next}while(w!==m)}}function Dl(r,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&r)===r){var m=u.create;u.destroy=m()}u=u.next}while(u!==o)}}function kd(r){var o=r.ref;if(o!==null){var u=r.stateNode;switch(r.tag){case 5:r=u;break;default:r=u}typeof o=="function"?o(r):o.current=r}}function Ig(r){var o=r.alternate;o!==null&&(r.alternate=null,Ig(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&(delete o[Zr],delete o[Wo],delete o[Ou],delete o[r1],delete o[i1])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Dg(r){return r.tag===5||r.tag===3||r.tag===4}function _g(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Dg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Sd(r,o,u){var m=r.tag;if(m===5||m===6)r=r.stateNode,o?u.nodeType===8?u.parentNode.insertBefore(r,o):u.insertBefore(r,o):(u.nodeType===8?(o=u.parentNode,o.insertBefore(r,u)):(o=u,o.appendChild(r)),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=hl));else if(m!==4&&(r=r.child,r!==null))for(Sd(r,o,u),r=r.sibling;r!==null;)Sd(r,o,u),r=r.sibling}function Cd(r,o,u){var m=r.tag;if(m===5||m===6)r=r.stateNode,o?u.insertBefore(r,o):u.appendChild(r);else if(m!==4&&(r=r.child,r!==null))for(Cd(r,o,u),r=r.sibling;r!==null;)Cd(r,o,u),r=r.sibling}var Bn=null,zr=!1;function Ai(r,o,u){for(u=u.child;u!==null;)Fg(r,o,u),u=u.sibling}function Fg(r,o,u){if(de&&typeof de.onCommitFiberUnmount=="function")try{de.onCommitFiberUnmount(R,u)}catch{}switch(u.tag){case 5:$n||$s(u,o);case 6:var m=Bn,w=zr;Bn=null,Ai(r,o,u),Bn=m,zr=w,Bn!==null&&(zr?(r=Bn,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):Bn.removeChild(u.stateNode));break;case 18:Bn!==null&&(zr?(r=Bn,u=u.stateNode,r.nodeType===8?Fu(r.parentNode,u):r.nodeType===1&&Fu(r,u),Ro(r)):Fu(Bn,u.stateNode));break;case 4:m=Bn,w=zr,Bn=u.stateNode.containerInfo,zr=!0,Ai(r,o,u),Bn=m,zr=w;break;case 0:case 11:case 14:case 15:if(!$n&&(m=u.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){w=m=m.next;do{var x=w,N=x.destroy;x=x.tag,N!==void 0&&((x&2)!==0||(x&4)!==0)&&xd(u,o,N),w=w.next}while(w!==m)}Ai(r,o,u);break;case 1:if(!$n&&($s(u,o),m=u.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=u.memoizedProps,m.state=u.memoizedState,m.componentWillUnmount()}catch(U){vn(u,o,U)}Ai(r,o,u);break;case 21:Ai(r,o,u);break;case 22:u.mode&1?($n=(m=$n)||u.memoizedState!==null,Ai(r,o,u),$n=m):Ai(r,o,u);break;default:Ai(r,o,u)}}function Og(r){var o=r.updateQueue;if(o!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new b1),o.forEach(function(m){var w=R1.bind(null,r,m);u.has(m)||(u.add(m),m.then(w,w))})}}function Hr(r,o){var u=o.deletions;if(u!==null)for(var m=0;m<u.length;m++){var w=u[m];try{var x=r,N=o,U=N;e:for(;U!==null;){switch(U.tag){case 5:Bn=U.stateNode,zr=!1;break e;case 3:Bn=U.stateNode.containerInfo,zr=!0;break e;case 4:Bn=U.stateNode.containerInfo,zr=!0;break e}U=U.return}if(Bn===null)throw Error(n(160));Fg(x,N,w),Bn=null,zr=!1;var G=w.alternate;G!==null&&(G.return=null),w.return=null}catch(fe){vn(w,o,fe)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)Bg(o,r),o=o.sibling}function Bg(r,o){var u=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Hr(o,r),ni(r),m&4){try{Jo(3,r,r.return),Dl(3,r)}catch(st){vn(r,r.return,st)}try{Jo(5,r,r.return)}catch(st){vn(r,r.return,st)}}break;case 1:Hr(o,r),ni(r),m&512&&u!==null&&$s(u,u.return);break;case 5:if(Hr(o,r),ni(r),m&512&&u!==null&&$s(u,u.return),r.flags&32){var w=r.stateNode;try{ft(w,"")}catch(st){vn(r,r.return,st)}}if(m&4&&(w=r.stateNode,w!=null)){var x=r.memoizedProps,N=u!==null?u.memoizedProps:x,U=r.type,G=r.updateQueue;if(r.updateQueue=null,G!==null)try{U==="input"&&x.type==="radio"&&x.name!=null&&Tt(w,x),Me(U,N);var fe=Me(U,x);for(N=0;N<G.length;N+=2){var Ee=G[N],Re=G[N+1];Ee==="style"?Nt(w,Re):Ee==="dangerouslySetInnerHTML"?Pe(w,Re):Ee==="children"?ft(w,Re):M(w,Ee,Re,fe)}switch(U){case"input":Ot(w,x);break;case"textarea":Dt(w,x);break;case"select":var Ne=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!x.multiple;var Ge=x.value;Ge!=null?At(w,!!x.multiple,Ge,!1):Ne!==!!x.multiple&&(x.defaultValue!=null?At(w,!!x.multiple,x.defaultValue,!0):At(w,!!x.multiple,x.multiple?[]:"",!1))}w[Wo]=x}catch(st){vn(r,r.return,st)}}break;case 6:if(Hr(o,r),ni(r),m&4){if(r.stateNode===null)throw Error(n(162));w=r.stateNode,x=r.memoizedProps;try{w.nodeValue=x}catch(st){vn(r,r.return,st)}}break;case 3:if(Hr(o,r),ni(r),m&4&&u!==null&&u.memoizedState.isDehydrated)try{Ro(o.containerInfo)}catch(st){vn(r,r.return,st)}break;case 4:Hr(o,r),ni(r);break;case 13:Hr(o,r),ni(r),w=r.child,w.flags&8192&&(x=w.memoizedState!==null,w.stateNode.isHidden=x,!x||w.alternate!==null&&w.alternate.memoizedState!==null||(Pd=Se())),m&4&&Og(r);break;case 22:if(Ee=u!==null&&u.memoizedState!==null,r.mode&1?($n=(fe=$n)||Ee,Hr(o,r),$n=fe):Hr(o,r),ni(r),m&8192){if(fe=r.memoizedState!==null,(r.stateNode.isHidden=fe)&&!Ee&&(r.mode&1)!==0)for(Ze=r,Ee=r.child;Ee!==null;){for(Re=Ze=Ee;Ze!==null;){switch(Ne=Ze,Ge=Ne.child,Ne.tag){case 0:case 11:case 14:case 15:Jo(4,Ne,Ne.return);break;case 1:$s(Ne,Ne.return);var nt=Ne.stateNode;if(typeof nt.componentWillUnmount=="function"){m=Ne,u=Ne.return;try{o=m,nt.props=o.memoizedProps,nt.state=o.memoizedState,nt.componentWillUnmount()}catch(st){vn(m,u,st)}}break;case 5:$s(Ne,Ne.return);break;case 22:if(Ne.memoizedState!==null){zg(Re);continue}}Ge!==null?(Ge.return=Ne,Ze=Ge):zg(Re)}Ee=Ee.sibling}e:for(Ee=null,Re=r;;){if(Re.tag===5){if(Ee===null){Ee=Re;try{w=Re.stateNode,fe?(x=w.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(U=Re.stateNode,G=Re.memoizedProps.style,N=G!=null&&G.hasOwnProperty("display")?G.display:null,U.style.display=ht("display",N))}catch(st){vn(r,r.return,st)}}}else if(Re.tag===6){if(Ee===null)try{Re.stateNode.nodeValue=fe?"":Re.memoizedProps}catch(st){vn(r,r.return,st)}}else if((Re.tag!==22&&Re.tag!==23||Re.memoizedState===null||Re===r)&&Re.child!==null){Re.child.return=Re,Re=Re.child;continue}if(Re===r)break e;for(;Re.sibling===null;){if(Re.return===null||Re.return===r)break e;Ee===Re&&(Ee=null),Re=Re.return}Ee===Re&&(Ee=null),Re.sibling.return=Re.return,Re=Re.sibling}}break;case 19:Hr(o,r),ni(r),m&4&&Og(r);break;case 21:break;default:Hr(o,r),ni(r)}}function ni(r){var o=r.flags;if(o&2){try{e:{for(var u=r.return;u!==null;){if(Dg(u)){var m=u;break e}u=u.return}throw Error(n(160))}switch(m.tag){case 5:var w=m.stateNode;m.flags&32&&(ft(w,""),m.flags&=-33);var x=_g(r);Cd(r,x,w);break;case 3:case 4:var N=m.stateNode.containerInfo,U=_g(r);Sd(r,U,N);break;default:throw Error(n(161))}}catch(G){vn(r,r.return,G)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function k1(r,o,u){Ze=r,Ug(r)}function Ug(r,o,u){for(var m=(r.mode&1)!==0;Ze!==null;){var w=Ze,x=w.child;if(w.tag===22&&m){var N=w.memoizedState!==null||Il;if(!N){var U=w.alternate,G=U!==null&&U.memoizedState!==null||$n;U=Il;var fe=$n;if(Il=N,($n=G)&&!fe)for(Ze=w;Ze!==null;)N=Ze,G=N.child,N.tag===22&&N.memoizedState!==null?Hg(w):G!==null?(G.return=N,Ze=G):Hg(w);for(;x!==null;)Ze=x,Ug(x),x=x.sibling;Ze=w,Il=U,$n=fe}Wg(r)}else(w.subtreeFlags&8772)!==0&&x!==null?(x.return=w,Ze=x):Wg(r)}}function Wg(r){for(;Ze!==null;){var o=Ze;if((o.flags&8772)!==0){var u=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:$n||Dl(5,o);break;case 1:var m=o.stateNode;if(o.flags&4&&!$n)if(u===null)m.componentDidMount();else{var w=o.elementType===o.type?u.memoizedProps:Wr(o.type,u.memoizedProps);m.componentDidUpdate(w,u.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var x=o.updateQueue;x!==null&&zp(o,x,m);break;case 3:var N=o.updateQueue;if(N!==null){if(u=null,o.child!==null)switch(o.child.tag){case 5:u=o.child.stateNode;break;case 1:u=o.child.stateNode}zp(o,N,u)}break;case 5:var U=o.stateNode;if(u===null&&o.flags&4){u=U;var G=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":G.autoFocus&&u.focus();break;case"img":G.src&&(u.src=G.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var fe=o.alternate;if(fe!==null){var Ee=fe.memoizedState;if(Ee!==null){var Re=Ee.dehydrated;Re!==null&&Ro(Re)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}$n||o.flags&512&&kd(o)}catch(Ne){vn(o,o.return,Ne)}}if(o===r){Ze=null;break}if(u=o.sibling,u!==null){u.return=o.return,Ze=u;break}Ze=o.return}}function zg(r){for(;Ze!==null;){var o=Ze;if(o===r){Ze=null;break}var u=o.sibling;if(u!==null){u.return=o.return,Ze=u;break}Ze=o.return}}function Hg(r){for(;Ze!==null;){var o=Ze;try{switch(o.tag){case 0:case 11:case 15:var u=o.return;try{Dl(4,o)}catch(G){vn(o,u,G)}break;case 1:var m=o.stateNode;if(typeof m.componentDidMount=="function"){var w=o.return;try{m.componentDidMount()}catch(G){vn(o,w,G)}}var x=o.return;try{kd(o)}catch(G){vn(o,x,G)}break;case 5:var N=o.return;try{kd(o)}catch(G){vn(o,N,G)}}}catch(G){vn(o,o.return,G)}if(o===r){Ze=null;break}var U=o.sibling;if(U!==null){U.return=o.return,Ze=U;break}Ze=o.return}}var S1=Math.ceil,_l=O.ReactCurrentDispatcher,jd=O.ReactCurrentOwner,Mr=O.ReactCurrentBatchConfig,Qt=0,_n=null,Sn=null,Un=0,wr=0,Vs=Pi(0),Pn=0,Zo=null,os=0,Fl=0,Nd=0,ea=null,or=null,Pd=0,Gs=1/0,yi=null,Ol=!1,Td=null,Li=null,Bl=!1,Ii=null,Ul=0,ta=0,Ed=null,Wl=-1,zl=0;function Xn(){return(Qt&6)!==0?Se():Wl!==-1?Wl:Wl=Se()}function Di(r){return(r.mode&1)===0?1:(Qt&2)!==0&&Un!==0?Un&-Un:o1.transition!==null?(zl===0&&(zl=xo()),zl):(r=Jt,r!==0||(r=window.event,r=r===void 0?16:$m(r.type)),r)}function qr(r,o,u,m){if(50<ta)throw ta=0,Ed=null,Error(n(185));Xi(r,u,m),((Qt&2)===0||r!==_n)&&(r===_n&&((Qt&2)===0&&(Fl|=u),Pn===4&&_i(r,Un)),ar(r,m),u===1&&Qt===0&&(o.mode&1)===0&&(Gs=Se()+500,gl&&Ei()))}function ar(r,o){var u=r.callbackNode;Xa(r,o);var m=Jr(r,r===_n?Un:0);if(m===0)u!==null&&Ce(u),r.callbackNode=null,r.callbackPriority=0;else if(o=m&-m,r.callbackPriority!==o){if(u!=null&&Ce(u),o===1)r.tag===0?s1($g.bind(null,r)):Rp($g.bind(null,r)),t1(function(){(Qt&6)===0&&Ei()}),u=null;else{switch(So(m)){case 1:u=tt;break;case 4:u=nn;break;case 16:u=Ln;break;case 536870912:u=xe;break;default:u=Ln}u=Zg(u,qg.bind(null,r))}r.callbackPriority=o,r.callbackNode=u}}function qg(r,o){if(Wl=-1,zl=0,(Qt&6)!==0)throw Error(n(327));var u=r.callbackNode;if(Ks()&&r.callbackNode!==u)return null;var m=Jr(r,r===_n?Un:0);if(m===0)return null;if((m&30)!==0||(m&r.expiredLanes)!==0||o)o=Hl(r,m);else{o=m;var w=Qt;Qt|=2;var x=Gg();(_n!==r||Un!==o)&&(yi=null,Gs=Se()+500,ls(r,o));do try{N1();break}catch(U){Vg(r,U)}while(!0);Gu(),_l.current=x,Qt=w,Sn!==null?o=0:(_n=null,Un=0,o=Pn)}if(o!==0){if(o===2&&(w=bo(r),w!==0&&(m=w,o=Rd(r,w))),o===1)throw u=Zo,ls(r,0),_i(r,m),ar(r,Se()),u;if(o===6)_i(r,m);else{if(w=r.current.alternate,(m&30)===0&&!C1(w)&&(o=Hl(r,m),o===2&&(x=bo(r),x!==0&&(m=x,o=Rd(r,x))),o===1))throw u=Zo,ls(r,0),_i(r,m),ar(r,Se()),u;switch(r.finishedWork=w,r.finishedLanes=m,o){case 0:case 1:throw Error(n(345));case 2:cs(r,or,yi);break;case 3:if(_i(r,m),(m&130023424)===m&&(o=Pd+500-Se(),10<o)){if(Jr(r,0)!==0)break;if(w=r.suspendedLanes,(w&m)!==m){Xn(),r.pingedLanes|=r.suspendedLanes&w;break}r.timeoutHandle=_u(cs.bind(null,r,or,yi),o);break}cs(r,or,yi);break;case 4:if(_i(r,m),(m&4194240)===m)break;for(o=r.eventTimes,w=-1;0<m;){var N=31-ve(m);x=1<<N,N=o[N],N>w&&(w=N),m&=~x}if(m=w,m=Se()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*S1(m/1960))-m,10<m){r.timeoutHandle=_u(cs.bind(null,r,or,yi),m);break}cs(r,or,yi);break;case 5:cs(r,or,yi);break;default:throw Error(n(329))}}}return ar(r,Se()),r.callbackNode===u?qg.bind(null,r):null}function Rd(r,o){var u=ea;return r.current.memoizedState.isDehydrated&&(ls(r,o).flags|=256),r=Hl(r,o),r!==2&&(o=or,or=u,o!==null&&Md(o)),r}function Md(r){or===null?or=r:or.push.apply(or,r)}function C1(r){for(var o=r;;){if(o.flags&16384){var u=o.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var m=0;m<u.length;m++){var w=u[m],x=w.getSnapshot;w=w.value;try{if(!Br(x(),w))return!1}catch{return!1}}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function _i(r,o){for(o&=~Nd,o&=~Fl,r.suspendedLanes|=o,r.pingedLanes&=~o,r=r.expirationTimes;0<o;){var u=31-ve(o),m=1<<u;r[u]=-1,o&=~m}}function $g(r){if((Qt&6)!==0)throw Error(n(327));Ks();var o=Jr(r,0);if((o&1)===0)return ar(r,Se()),null;var u=Hl(r,o);if(r.tag!==0&&u===2){var m=bo(r);m!==0&&(o=m,u=Rd(r,m))}if(u===1)throw u=Zo,ls(r,0),_i(r,o),ar(r,Se()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=o,cs(r,or,yi),ar(r,Se()),null}function Ad(r,o){var u=Qt;Qt|=1;try{return r(o)}finally{Qt=u,Qt===0&&(Gs=Se()+500,gl&&Ei())}}function as(r){Ii!==null&&Ii.tag===0&&(Qt&6)===0&&Ks();var o=Qt;Qt|=1;var u=Mr.transition,m=Jt;try{if(Mr.transition=null,Jt=1,r)return r()}finally{Jt=m,Mr.transition=u,Qt=o,(Qt&6)===0&&Ei()}}function Ld(){wr=Vs.current,ln(Vs)}function ls(r,o){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,e1(u)),Sn!==null)for(u=Sn.return;u!==null;){var m=u;switch(zu(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&ml();break;case 3:Hs(),ln(rr),ln(zn),td();break;case 5:Zu(m);break;case 4:Hs();break;case 13:ln(fn);break;case 19:ln(fn);break;case 10:Ku(m.type._context);break;case 22:case 23:Ld()}u=u.return}if(_n=r,Sn=r=Fi(r.current,null),Un=wr=o,Pn=0,Zo=null,Nd=Fl=os=0,or=ea=null,rs!==null){for(o=0;o<rs.length;o++)if(u=rs[o],m=u.interleaved,m!==null){u.interleaved=null;var w=m.next,x=u.pending;if(x!==null){var N=x.next;x.next=w,m.next=N}u.pending=m}rs=null}return r}function Vg(r,o){do{var u=Sn;try{if(Gu(),Nl.current=Rl,Pl){for(var m=mn.memoizedState;m!==null;){var w=m.queue;w!==null&&(w.pending=null),m=m.next}Pl=!1}if(ss=0,Dn=Nn=mn=null,Go=!1,Ko=0,jd.current=null,u===null||u.return===null){Pn=1,Zo=o,Sn=null;break}e:{var x=r,N=u.return,U=u,G=o;if(o=Un,U.flags|=32768,G!==null&&typeof G=="object"&&typeof G.then=="function"){var fe=G,Ee=U,Re=Ee.tag;if((Ee.mode&1)===0&&(Re===0||Re===11||Re===15)){var Ne=Ee.alternate;Ne?(Ee.updateQueue=Ne.updateQueue,Ee.memoizedState=Ne.memoizedState,Ee.lanes=Ne.lanes):(Ee.updateQueue=null,Ee.memoizedState=null)}var Ge=yg(N);if(Ge!==null){Ge.flags&=-257,vg(Ge,N,U,x,o),Ge.mode&1&&gg(x,fe,o),o=Ge,G=fe;var nt=o.updateQueue;if(nt===null){var st=new Set;st.add(G),o.updateQueue=st}else nt.add(G);break e}else{if((o&1)===0){gg(x,fe,o),Id();break e}G=Error(n(426))}}else if(dn&&U.mode&1){var bn=yg(N);if(bn!==null){(bn.flags&65536)===0&&(bn.flags|=256),vg(bn,N,U,x,o),$u(qs(G,U));break e}}x=G=qs(G,U),Pn!==4&&(Pn=2),ea===null?ea=[x]:ea.push(x),x=N;do{switch(x.tag){case 3:x.flags|=65536,o&=-o,x.lanes|=o;var oe=mg(x,G,o);Wp(x,oe);break e;case 1:U=G;var J=x.type,ce=x.stateNode;if((x.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||ce!==null&&typeof ce.componentDidCatch=="function"&&(Li===null||!Li.has(ce)))){x.flags|=65536,o&=-o,x.lanes|=o;var _e=pg(x,U,o);Wp(x,_e);break e}}x=x.return}while(x!==null)}Qg(u)}catch(at){o=at,Sn===u&&u!==null&&(Sn=u=u.return);continue}break}while(!0)}function Gg(){var r=_l.current;return _l.current=Rl,r===null?Rl:r}function Id(){(Pn===0||Pn===3||Pn===2)&&(Pn=4),_n===null||(os&268435455)===0&&(Fl&268435455)===0||_i(_n,Un)}function Hl(r,o){var u=Qt;Qt|=2;var m=Gg();(_n!==r||Un!==o)&&(yi=null,ls(r,o));do try{j1();break}catch(w){Vg(r,w)}while(!0);if(Gu(),Qt=u,_l.current=m,Sn!==null)throw Error(n(261));return _n=null,Un=0,Pn}function j1(){for(;Sn!==null;)Kg(Sn)}function N1(){for(;Sn!==null&&!B();)Kg(Sn)}function Kg(r){var o=Jg(r.alternate,r,wr);r.memoizedProps=r.pendingProps,o===null?Qg(r):Sn=o,jd.current=null}function Qg(r){var o=r;do{var u=o.alternate;if(r=o.return,(o.flags&32768)===0){if(u=v1(u,o,wr),u!==null){Sn=u;return}}else{if(u=w1(u,o),u!==null){u.flags&=32767,Sn=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{Pn=6,Sn=null;return}}if(o=o.sibling,o!==null){Sn=o;return}Sn=o=r}while(o!==null);Pn===0&&(Pn=5)}function cs(r,o,u){var m=Jt,w=Mr.transition;try{Mr.transition=null,Jt=1,P1(r,o,u,m)}finally{Mr.transition=w,Jt=m}return null}function P1(r,o,u,m){do Ks();while(Ii!==null);if((Qt&6)!==0)throw Error(n(327));u=r.finishedWork;var w=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var x=u.lanes|u.childLanes;if(Ja(r,x),r===_n&&(Sn=_n=null,Un=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Bl||(Bl=!0,Zg(Ln,function(){return Ks(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=Mr.transition,Mr.transition=null;var N=Jt;Jt=1;var U=Qt;Qt|=4,jd.current=null,x1(r,u),Bg(u,r),G0(Iu),el=!!Lu,Iu=Lu=null,r.current=u,k1(u),le(),Qt=U,Jt=N,Mr.transition=x}else r.current=u;if(Bl&&(Bl=!1,Ii=r,Ul=w),x=r.pendingLanes,x===0&&(Li=null),he(u.stateNode),ar(r,Se()),o!==null)for(m=r.onRecoverableError,u=0;u<o.length;u++)w=o[u],m(w.value,{componentStack:w.stack,digest:w.digest});if(Ol)throw Ol=!1,r=Td,Td=null,r;return(Ul&1)!==0&&r.tag!==0&&Ks(),x=r.pendingLanes,(x&1)!==0?r===Ed?ta++:(ta=0,Ed=r):ta=0,Ei(),null}function Ks(){if(Ii!==null){var r=So(Ul),o=Mr.transition,u=Jt;try{if(Mr.transition=null,Jt=16>r?16:r,Ii===null)var m=!1;else{if(r=Ii,Ii=null,Ul=0,(Qt&6)!==0)throw Error(n(331));var w=Qt;for(Qt|=4,Ze=r.current;Ze!==null;){var x=Ze,N=x.child;if((Ze.flags&16)!==0){var U=x.deletions;if(U!==null){for(var G=0;G<U.length;G++){var fe=U[G];for(Ze=fe;Ze!==null;){var Ee=Ze;switch(Ee.tag){case 0:case 11:case 15:Jo(8,Ee,x)}var Re=Ee.child;if(Re!==null)Re.return=Ee,Ze=Re;else for(;Ze!==null;){Ee=Ze;var Ne=Ee.sibling,Ge=Ee.return;if(Ig(Ee),Ee===fe){Ze=null;break}if(Ne!==null){Ne.return=Ge,Ze=Ne;break}Ze=Ge}}}var nt=x.alternate;if(nt!==null){var st=nt.child;if(st!==null){nt.child=null;do{var bn=st.sibling;st.sibling=null,st=bn}while(st!==null)}}Ze=x}}if((x.subtreeFlags&2064)!==0&&N!==null)N.return=x,Ze=N;else e:for(;Ze!==null;){if(x=Ze,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:Jo(9,x,x.return)}var oe=x.sibling;if(oe!==null){oe.return=x.return,Ze=oe;break e}Ze=x.return}}var J=r.current;for(Ze=J;Ze!==null;){N=Ze;var ce=N.child;if((N.subtreeFlags&2064)!==0&&ce!==null)ce.return=N,Ze=ce;else e:for(N=J;Ze!==null;){if(U=Ze,(U.flags&2048)!==0)try{switch(U.tag){case 0:case 11:case 15:Dl(9,U)}}catch(at){vn(U,U.return,at)}if(U===N){Ze=null;break e}var _e=U.sibling;if(_e!==null){_e.return=U.return,Ze=_e;break e}Ze=U.return}}if(Qt=w,Ei(),de&&typeof de.onPostCommitFiberRoot=="function")try{de.onPostCommitFiberRoot(R,r)}catch{}m=!0}return m}finally{Jt=u,Mr.transition=o}}return!1}function Yg(r,o,u){o=qs(u,o),o=mg(r,o,1),r=Mi(r,o,1),o=Xn(),r!==null&&(Xi(r,1,o),ar(r,o))}function vn(r,o,u){if(r.tag===3)Yg(r,r,u);else for(;o!==null;){if(o.tag===3){Yg(o,r,u);break}else if(o.tag===1){var m=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Li===null||!Li.has(m))){r=qs(u,r),r=pg(o,r,1),o=Mi(o,r,1),r=Xn(),o!==null&&(Xi(o,1,r),ar(o,r));break}}o=o.return}}function T1(r,o,u){var m=r.pingCache;m!==null&&m.delete(o),o=Xn(),r.pingedLanes|=r.suspendedLanes&u,_n===r&&(Un&u)===u&&(Pn===4||Pn===3&&(Un&130023424)===Un&&500>Se()-Pd?ls(r,0):Nd|=u),ar(r,o)}function Xg(r,o){o===0&&((r.mode&1)===0?o=1:(o=Fr,Fr<<=1,(Fr&130023424)===0&&(Fr=4194304)));var u=Xn();r=mi(r,o),r!==null&&(Xi(r,o,u),ar(r,u))}function E1(r){var o=r.memoizedState,u=0;o!==null&&(u=o.retryLane),Xg(r,u)}function R1(r,o){var u=0;switch(r.tag){case 13:var m=r.stateNode,w=r.memoizedState;w!==null&&(u=w.retryLane);break;case 19:m=r.stateNode;break;default:throw Error(n(314))}m!==null&&m.delete(o),Xg(r,u)}var Jg;Jg=function(r,o,u){if(r!==null)if(r.memoizedProps!==o.pendingProps||rr.current)sr=!0;else{if((r.lanes&u)===0&&(o.flags&128)===0)return sr=!1,y1(r,o,u);sr=(r.flags&131072)!==0}else sr=!1,dn&&(o.flags&1048576)!==0&&Mp(o,vl,o.index);switch(o.lanes=0,o.tag){case 2:var m=o.type;Ll(r,o),r=o.pendingProps;var w=_s(o,zn.current);zs(o,u),w=id(null,o,m,r,w,u);var x=sd();return o.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,ir(m)?(x=!0,pl(o)):x=!1,o.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,Xu(o),w.updater=Ml,o.stateNode=w,w._reactInternals=o,dd(o,m,r,u),o=pd(null,o,m,!0,x,u)):(o.tag=0,dn&&x&&Wu(o),Yn(null,o,w,u),o=o.child),o;case 16:m=o.elementType;e:{switch(Ll(r,o),r=o.pendingProps,w=m._init,m=w(m._payload),o.type=m,w=o.tag=A1(m),r=Wr(m,r),w){case 0:o=md(null,o,m,r,u);break e;case 1:o=Cg(null,o,m,r,u);break e;case 11:o=wg(null,o,m,r,u);break e;case 14:o=bg(null,o,m,Wr(m.type,r),u);break e}throw Error(n(306,m,""))}return o;case 0:return m=o.type,w=o.pendingProps,w=o.elementType===m?w:Wr(m,w),md(r,o,m,w,u);case 1:return m=o.type,w=o.pendingProps,w=o.elementType===m?w:Wr(m,w),Cg(r,o,m,w,u);case 3:e:{if(jg(o),r===null)throw Error(n(387));m=o.pendingProps,x=o.memoizedState,w=x.element,Up(r,o),Cl(o,m,null,u);var N=o.memoizedState;if(m=N.element,x.isDehydrated)if(x={element:m,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){w=qs(Error(n(423)),o),o=Ng(r,o,m,u,w);break e}else if(m!==w){w=qs(Error(n(424)),o),o=Ng(r,o,m,u,w);break e}else for(vr=Ni(o.stateNode.containerInfo.firstChild),yr=o,dn=!0,Ur=null,u=Op(o,null,m,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Bs(),m===w){o=gi(r,o,u);break e}Yn(r,o,m,u)}o=o.child}return o;case 5:return Hp(o),r===null&&qu(o),m=o.type,w=o.pendingProps,x=r!==null?r.memoizedProps:null,N=w.children,Du(m,w)?N=null:x!==null&&Du(m,x)&&(o.flags|=32),Sg(r,o),Yn(r,o,N,u),o.child;case 6:return r===null&&qu(o),null;case 13:return Pg(r,o,u);case 4:return Ju(o,o.stateNode.containerInfo),m=o.pendingProps,r===null?o.child=Us(o,null,m,u):Yn(r,o,m,u),o.child;case 11:return m=o.type,w=o.pendingProps,w=o.elementType===m?w:Wr(m,w),wg(r,o,m,w,u);case 7:return Yn(r,o,o.pendingProps,u),o.child;case 8:return Yn(r,o,o.pendingProps.children,u),o.child;case 12:return Yn(r,o,o.pendingProps.children,u),o.child;case 10:e:{if(m=o.type._context,w=o.pendingProps,x=o.memoizedProps,N=w.value,rn(xl,m._currentValue),m._currentValue=N,x!==null)if(Br(x.value,N)){if(x.children===w.children&&!rr.current){o=gi(r,o,u);break e}}else for(x=o.child,x!==null&&(x.return=o);x!==null;){var U=x.dependencies;if(U!==null){N=x.child;for(var G=U.firstContext;G!==null;){if(G.context===m){if(x.tag===1){G=pi(-1,u&-u),G.tag=2;var fe=x.updateQueue;if(fe!==null){fe=fe.shared;var Ee=fe.pending;Ee===null?G.next=G:(G.next=Ee.next,Ee.next=G),fe.pending=G}}x.lanes|=u,G=x.alternate,G!==null&&(G.lanes|=u),Qu(x.return,u,o),U.lanes|=u;break}G=G.next}}else if(x.tag===10)N=x.type===o.type?null:x.child;else if(x.tag===18){if(N=x.return,N===null)throw Error(n(341));N.lanes|=u,U=N.alternate,U!==null&&(U.lanes|=u),Qu(N,u,o),N=x.sibling}else N=x.child;if(N!==null)N.return=x;else for(N=x;N!==null;){if(N===o){N=null;break}if(x=N.sibling,x!==null){x.return=N.return,N=x;break}N=N.return}x=N}Yn(r,o,w.children,u),o=o.child}return o;case 9:return w=o.type,m=o.pendingProps.children,zs(o,u),w=Er(w),m=m(w),o.flags|=1,Yn(r,o,m,u),o.child;case 14:return m=o.type,w=Wr(m,o.pendingProps),w=Wr(m.type,w),bg(r,o,m,w,u);case 15:return xg(r,o,o.type,o.pendingProps,u);case 17:return m=o.type,w=o.pendingProps,w=o.elementType===m?w:Wr(m,w),Ll(r,o),o.tag=1,ir(m)?(r=!0,pl(o)):r=!1,zs(o,u),hg(o,m,w),dd(o,m,w,u),pd(null,o,m,!0,r,u);case 19:return Eg(r,o,u);case 22:return kg(r,o,u)}throw Error(n(156,o.tag))};function Zg(r,o){return se(r,o)}function M1(r,o,u,m){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ar(r,o,u,m){return new M1(r,o,u,m)}function Dd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function A1(r){if(typeof r=="function")return Dd(r)?1:0;if(r!=null){if(r=r.$$typeof,r===X)return 11;if(r===te)return 14}return 2}function Fi(r,o){var u=r.alternate;return u===null?(u=Ar(r.tag,o,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=o,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,o=r.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function ql(r,o,u,m,w,x){var N=2;if(m=r,typeof r=="function")Dd(r)&&(N=1);else if(typeof r=="string")N=5;else e:switch(r){case I:return us(u.children,w,x,o);case F:N=8,w|=8;break;case D:return r=Ar(12,u,o,w|2),r.elementType=D,r.lanes=x,r;case $:return r=Ar(13,u,o,w),r.elementType=$,r.lanes=x,r;case ee:return r=Ar(19,u,o,w),r.elementType=ee,r.lanes=x,r;case ne:return $l(u,w,x,o);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case P:N=10;break e;case K:N=9;break e;case X:N=11;break e;case te:N=14;break e;case pe:N=16,m=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return o=Ar(N,u,o,w),o.elementType=r,o.type=m,o.lanes=x,o}function us(r,o,u,m){return r=Ar(7,r,m,o),r.lanes=u,r}function $l(r,o,u,m){return r=Ar(22,r,m,o),r.elementType=ne,r.lanes=u,r.stateNode={isHidden:!1},r}function _d(r,o,u){return r=Ar(6,r,null,o),r.lanes=u,r}function Fd(r,o,u){return o=Ar(4,r.children!==null?r.children:[],r.key,o),o.lanes=u,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}function L1(r,o,u,m,w){this.tag=o,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Si(0),this.expirationTimes=Si(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Si(0),this.identifierPrefix=m,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function Od(r,o,u,m,w,x,N,U,G){return r=new L1(r,o,u,U,G),o===1?(o=1,x===!0&&(o|=8)):o=0,x=Ar(3,null,null,o),r.current=x,x.stateNode=r,x.memoizedState={element:m,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xu(x),r}function I1(r,o,u){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_,key:m==null?null:""+m,children:r,containerInfo:o,implementation:u}}function ey(r){if(!r)return Ti;r=r._reactInternals;e:{if(Oe(r)!==r||r.tag!==1)throw Error(n(170));var o=r;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(ir(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(ir(u))return Tp(r,u,o)}return o}function ty(r,o,u,m,w,x,N,U,G){return r=Od(u,m,!0,r,w,x,N,U,G),r.context=ey(null),u=r.current,m=Xn(),w=Di(u),x=pi(m,w),x.callback=o??null,Mi(u,x,w),r.current.lanes=w,Xi(r,w,m),ar(r,m),r}function Vl(r,o,u,m){var w=o.current,x=Xn(),N=Di(w);return u=ey(u),o.context===null?o.context=u:o.pendingContext=u,o=pi(x,N),o.payload={element:r},m=m===void 0?null:m,m!==null&&(o.callback=m),r=Mi(w,o,N),r!==null&&(qr(r,w,N,x),Sl(r,w,N)),N}function Gl(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function ny(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<o?u:o}}function Bd(r,o){ny(r,o),(r=r.alternate)&&ny(r,o)}function D1(){return null}var ry=typeof reportError=="function"?reportError:function(r){console.error(r)};function Ud(r){this._internalRoot=r}Kl.prototype.render=Ud.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(n(409));Vl(r,o,null,null)},Kl.prototype.unmount=Ud.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;as(function(){Vl(null,r,null,null)}),o[ui]=null}};function Kl(r){this._internalRoot=r}Kl.prototype.unstable_scheduleHydration=function(r){if(r){var o=No();r={blockedOn:null,target:r,priority:o};for(var u=0;u<pr.length&&o!==0&&o<pr[u].priority;u++);pr.splice(u,0,r),u===0&&To(r)}};function Wd(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function Ql(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function iy(){}function _1(r,o,u,m,w){if(w){if(typeof m=="function"){var x=m;m=function(){var fe=Gl(N);x.call(fe)}}var N=ty(o,m,r,0,null,!1,!1,"",iy);return r._reactRootContainer=N,r[ui]=N.current,Bo(r.nodeType===8?r.parentNode:r),as(),N}for(;w=r.lastChild;)r.removeChild(w);if(typeof m=="function"){var U=m;m=function(){var fe=Gl(G);U.call(fe)}}var G=Od(r,0,!1,null,null,!1,!1,"",iy);return r._reactRootContainer=G,r[ui]=G.current,Bo(r.nodeType===8?r.parentNode:r),as(function(){Vl(o,G,u,m)}),G}function Yl(r,o,u,m,w){var x=u._reactRootContainer;if(x){var N=x;if(typeof w=="function"){var U=w;w=function(){var G=Gl(N);U.call(G)}}Vl(o,N,r,w)}else N=_1(u,o,r,w,m);return Gl(N)}Co=function(r){switch(r.tag){case 3:var o=r.stateNode;if(o.current.memoizedState.isDehydrated){var u=nr(o.pendingLanes);u!==0&&(ko(o,u|1),ar(o,Se()),(Qt&6)===0&&(Gs=Se()+500,Ei()))}break;case 13:as(function(){var m=mi(r,1);if(m!==null){var w=Xn();qr(m,r,1,w)}}),Bd(r,1)}},Ns=function(r){if(r.tag===13){var o=mi(r,134217728);if(o!==null){var u=Xn();qr(o,r,134217728,u)}Bd(r,134217728)}},jo=function(r){if(r.tag===13){var o=Di(r),u=mi(r,o);if(u!==null){var m=Xn();qr(u,r,o,m)}Bd(r,o)}},No=function(){return Jt},Q=function(r,o){var u=Jt;try{return Jt=r,o()}finally{Jt=u}},Bt=function(r,o,u){switch(o){case"input":if(Ot(r,u),o=u.name,u.type==="radio"&&o!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<u.length;o++){var m=u[o];if(m!==r&&m.form===r.form){var w=fl(m);if(!w)throw Error(n(90));Ct(m),Ot(m,w)}}}break;case"textarea":Dt(r,u);break;case"select":o=u.value,o!=null&&At(r,!!u.multiple,o,!1)}},yn=Ad,un=as;var F1={usingClientEntryPoint:!1,Events:[zo,Is,fl,Qe,cn,Ad]},na={findFiberByHostInstance:Zi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},O1={bundleType:na.bundleType,version:na.version,rendererPackageName:na.rendererPackageName,rendererConfig:na.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Pt(r),r===null?null:r.stateNode},findFiberByHostInstance:na.findFiberByHostInstance||D1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xl.isDisabled&&Xl.supportsFiber)try{R=Xl.inject(O1),de=Xl}catch{}}return lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F1,lr.createPortal=function(r,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wd(o))throw Error(n(200));return I1(r,o,null,u)},lr.createRoot=function(r,o){if(!Wd(r))throw Error(n(299));var u=!1,m="",w=ry;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onRecoverableError!==void 0&&(w=o.onRecoverableError)),o=Od(r,1,!1,null,null,u,!1,m,w),r[ui]=o.current,Bo(r.nodeType===8?r.parentNode:r),new Ud(o)},lr.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=Pt(o),r=r===null?null:r.stateNode,r},lr.flushSync=function(r){return as(r)},lr.hydrate=function(r,o,u){if(!Ql(o))throw Error(n(200));return Yl(null,r,o,!0,u)},lr.hydrateRoot=function(r,o,u){if(!Wd(r))throw Error(n(405));var m=u!=null&&u.hydratedSources||null,w=!1,x="",N=ry;if(u!=null&&(u.unstable_strictMode===!0&&(w=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(N=u.onRecoverableError)),o=ty(o,null,r,1,u??null,w,!1,x,N),r[ui]=o.current,Bo(r),m)for(r=0;r<m.length;r++)u=m[r],w=u._getVersion,w=w(u._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[u,w]:o.mutableSourceEagerHydrationData.push(u,w);return new Kl(o)},lr.render=function(r,o,u){if(!Ql(o))throw Error(n(200));return Yl(null,r,o,!1,u)},lr.unmountComponentAtNode=function(r){if(!Ql(r))throw Error(n(40));return r._reactRootContainer?(as(function(){Yl(null,null,r,!1,function(){r._reactRootContainer=null,r[ui]=null})}),!0):!1},lr.unstable_batchedUpdates=Ad,lr.unstable_renderSubtreeIntoContainer=function(r,o,u,m){if(!Ql(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return Yl(r,o,u,!1,m)},lr.version="18.3.1-next-f1338f8080-20240426",lr}var hy;function Vb(){if(hy)return qd.exports;hy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qd.exports=G1(),qd.exports}var fy;function K1(){if(fy)return Jl;fy=1;var e=Vb();return Jl.createRoot=e.createRoot,Jl.hydrateRoot=e.hydrateRoot,Jl}var Q1=K1();const Y1=Fa(Q1);var v=Ff();const X1=Fa(v),J1=$b({__proto__:null,default:X1},[v]);function Z1(e){return e==="http:"||e==="https:"}function bi(e){const t=e.trim();if(!t)throw new Error("EMPTY_SERVER_URL");const n=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//.test(t)?t:`http://${t}`,s=new URL(n);if(!Z1(s.protocol))throw new Error("INVALID_SERVER_PROTOCOL");s.hash="",s.search="";const a=s.pathname.replace(/\/+$/,"");return`${s.origin}${a==="/"?"":a}`}const ro="codingns.auth.remembered-login";function Of(){return typeof window<"u"&&typeof window.localStorage<"u"}function ej(e){return e.isNativeMobile?!0:e.isDesktop?e.ui.osFamily==="windows"||e.ui.osFamily==="macos":!1}function Gb(){if(!Of())return null;const e=window.localStorage.getItem(ro);if(!e)return null;try{const t=JSON.parse(e);if(typeof t.username!="string"||typeof t.password!="string"||typeof t.serverBaseUrl!="string")return window.localStorage.removeItem(ro),null;const n=t.username.trim(),s=t.password,a=bi(t.serverBaseUrl);return!n||!s?(window.localStorage.removeItem(ro),null):{username:n,password:s,serverBaseUrl:a}}catch{return window.localStorage.removeItem(ro),null}}function Kb(e){if(!Of())return;const t={username:e.username.trim(),password:e.password,serverBaseUrl:bi(e.serverBaseUrl)};window.localStorage.setItem(ro,JSON.stringify(t))}function tj(e){const t=Gb();t&&Kb({...t,serverBaseUrl:e})}function nj(){Of()&&window.localStorage.removeItem(ro)}function Qb(){return typeof window<"u"&&typeof window.__TAURI_INTERNALS__<"u"}function Yb(){var c,l;if(typeof navigator>"u")return"unknown";const e=navigator.userAgent.toLowerCase(),t=navigator.userAgentData,n=((c=t==null?void 0:t.platform)==null?void 0:c.toLowerCase())??((l=navigator.platform)==null?void 0:l.toLowerCase())??"",s=`${n} ${e}`,a=n.includes("mac")&&navigator.maxTouchPoints>1;return s.includes("android")?"android":s.includes("iphone")||s.includes("ipad")||s.includes("ipod")||a?"ios":s.includes("mac")?"macos":s.includes("win")?"windows":s.includes("linux")?"linux":"unknown"}function rj(e){var t;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:typeof window<"u"&&Number.isFinite(window.innerWidth)&&window.innerWidth>0?window.innerWidth:typeof document<"u"&&Number.isFinite((t=document.documentElement)==null?void 0:t.clientWidth)&&document.documentElement.clientWidth>0?document.documentElement.clientWidth:1280}function ij(e){const t=rj(e);return t<768?"compact":t<1024?"medium":"expanded"}function sj(e){const t=Yb();return e==="desktop"?{osFamily:t,windowControlsStyle:t==="macos"?"traffic-lights":t==="windows"?"windows":"none",prefersDesktopChrome:!0,prefersOverlayTitlebar:t==="macos",prefersSystemFontStack:!0}:{osFamily:t,windowControlsStyle:"none",prefersDesktopChrome:!1,prefersOverlayTitlebar:!1,prefersSystemFontStack:!0}}function kr(e){return{ok:!1,errorCode:"PLATFORM_NOT_SUPPORTED",detail:e}}async function $r(e,t){return Xb(e,t)}async function Xb(e,t){if(!Qb())return kr("当前运行环境不支持桌面壳能力。");try{return{ok:!0,value:await window.__TAURI_INTERNALS__.invoke(e,t)}}catch(n){return{ok:!1,errorCode:"SHELL_BRIDGE_ERROR",detail:n instanceof Error?n.message:"桌面壳调用失败。"}}}function oj(e){switch(e){case"selection":return 10;case"action":return[12];case"gesture":return[10,18,10];case"success":return[16,30,20];case"warning":return[20,36,18];case"error":return[24,40,24,40,20];default:return 10}}function Jb(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}async function Zb(e){if(Jb())try{navigator.vibrate(oj(e))}catch{return}}async function ex(e,t){if(typeof window>"u"||typeof Notification>"u")return kr("当前环境不支持系统通知。");try{if(Notification.permission==="default"&&await Notification.requestPermission()!=="granted"||Notification.permission!=="granted")return kr("系统通知权限未授予。");const n=new Notification(e,{body:t});return n.onerror=()=>{},{ok:!0}}catch(n){return{ok:!1,errorCode:"NOTIFICATION_FAILED",detail:n instanceof Error?n.message:"系统通知发送失败。"}}}class aj{constructor(){Ke(this,"supported",!1)}openExternal(t){return typeof window>"u"?Promise.resolve(kr("当前环境无法打开外部链接。")):(window.open(t,"_blank","noopener,noreferrer"),Promise.resolve({ok:!0}))}showNotification(t,n){return ex(t,n)}writeClipboardText(){return Promise.resolve(kr("当前不是桌面端运行环境。"))}setWindowState(){return Promise.resolve(kr("当前不是桌面端运行环境。"))}readDesktopConfig(){return Promise.resolve(kr("当前不是桌面端运行环境。"))}writeDesktopConfig(){return Promise.resolve(kr("当前不是桌面端运行环境。"))}getRuntimeInfo(){return Promise.resolve(kr("当前不是桌面端运行环境。"))}checkForUpdate(){return Promise.resolve(kr("当前不是桌面端运行环境。"))}installUpdate(){return Promise.resolve({ok:!1,errorCode:"PLATFORM_NOT_SUPPORTED",detail:"当前不是桌面端运行环境。"})}rollbackToPreviousVersion(){return Promise.resolve(kr("当前不是桌面端运行环境。"))}pickDirectory(){return Promise.resolve(kr("当前不是桌面端运行环境。"))}}class lj{constructor(){Ke(this,"supported",Jb())}trigger(t){return Zb(t)}}class cj{constructor(){Ke(this,"supported",!0)}openExternal(t){return $r("open_external",{url:t})}async showNotification(t,n){const s=await ex(t,n);return s.ok?s:$r("show_notification",{title:t,body:n})}writeClipboardText(t){return $r("copy_text",{text:t})}setWindowState(t){return $r("set_window_state",{state:t})}readDesktopConfig(){return $r("read_desktop_config")}writeDesktopConfig(t){return $r("write_desktop_config",{patch:t})}getRuntimeInfo(){return $r("get_runtime_info")}checkForUpdate(t){return $r("check_for_update",{channel:t})}async installUpdate(t){const n=await $r("install_update",{manifest:t});return n.ok?n.value??{ok:!0}:{ok:!1,errorCode:n.errorCode,detail:n.detail}}rollbackToPreviousVersion(){return $r("rollback_to_previous_version")}pickDirectory(){return $r("pick_directory")}}class uj{constructor(){Ke(this,"supported",!0)}async trigger(t){(await Xb("perform_haptic_feedback",{kind:t})).ok||await Zb(t)}}function tx(){if(!Qb())return"web";const e=Yb();return e==="ios"?"ios":e==="android"?"android":"desktop"}function ai(e={}){const t=tx(),n=ij(e.viewportWidth),s=t==="ios"||t==="android";return{platform:t,isDesktop:t==="desktop",isWeb:t==="web",isMobile:s||n!=="expanded",isNativeMobile:s,viewportClass:n,ui:sj(t),bridge:t==="desktop"?new cj:new aj,haptics:s?new uj:new lj}}const Zh="codingns.client.runtime-config";function Bf(e){return e==="desktop"||e==="ios"||e==="android"}function nx(e){return e==="en"||e==="en-US"?"en-US":"zh-CN"}function dj(){return typeof navigator>"u"?"zh-CN":nx(navigator.language)}function hj(e){return e==="acceptEdits"||e==="bypassPermissions"?e:"default"}function rx(){return typeof window<"u"&&typeof window.localStorage<"u"}function fj(){if(!rx())return null;const e=window.localStorage.getItem(Zh);if(!e)return null;try{return JSON.parse(e)}catch{return window.localStorage.removeItem(Zh),null}}function ix(e){rx()&&window.localStorage.setItem(Zh,JSON.stringify(e))}function mj(){var e;return typeof window>"u"||!((e=window.location)!=null&&e.origin)?null:window.location.origin}function pj(e){if(!e)return null;try{return bi(e)}catch{return null}}function Uf(e){if(e==="web"){const t=pj(mj());if(t)return t}return bi("http://127.0.0.1:3002")}function gj(e){return{platform:e,hostBaseUrl:Uf(e),releaseChannel:"stable",autoReconnect:!0,autoCheckUpdate:e==="desktop",language:dj(),defaultPermissionMode:"default"}}function ef(e,t){if(!t)return e;const n=t.platform??e.platform;return{...e,...t,hostBaseUrl:Bf(n)?t.hostBaseUrl?bi(t.hostBaseUrl):e.hostBaseUrl:Uf(n),platform:n,releaseChannel:t.releaseChannel??e.releaseChannel,autoReconnect:t.autoReconnect??e.autoReconnect,autoCheckUpdate:t.autoCheckUpdate??e.autoCheckUpdate,language:nx(t.language??e.language),defaultPermissionMode:hj(t.defaultPermissionMode??e.defaultPermissionMode)}}async function yj(){const e=ai(),t=gj(e.platform),n=fj();let s=null;if(e.isDesktop){const c=await e.bridge.readDesktopConfig();c.ok&&c.value&&(s=c.value)}const a=ef(ef(t,n),s);return ix(a),a}async function vj(e,t){const n=ef(e,t);ix(n),tj(n.hostBaseUrl);const s=ai();return s.isDesktop&&await s.bridge.writeDesktopConfig(n),n}function wj(){const e=tx();return{platform:e,hostBaseUrl:Uf(e),releaseChannel:"stable",autoReconnect:!0,autoCheckUpdate:e==="desktop",language:"zh-CN",defaultPermissionMode:"default"}}class bj{constructor(){Ke(this,"state",wj());Ke(this,"listeners",new Set);Ke(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Ke(this,"getState",()=>this.state)}hydrate(t){this.state=t,this.emit()}async initialize(){const t=await yj();return this.hydrate(t),t}async update(t){const n=await vj(this.state,t);return this.hydrate(n),n}emit(){for(const t of this.listeners)t()}}const Rn=new bj;function xj(e){return v.useSyncExternalStore(Rn.subscribe,()=>e(Rn.getState()))}function kj(e){return e.endsWith("/")?e:`${e}/`}function Sj(e){return e.replace(/^\/+/,"")}function Pa(){return Rn.getState().hostBaseUrl}function sx(e,t=Pa()){return new URL(Sj(e),kj(t)).toString()}function ox(e,t=Pa()){const n=new URL(sx(e,t));return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.toString()}class Jn extends Error{constructor(n,s){super(s.detail);Ke(this,"status");Ke(this,"errorCode");Ke(this,"field");this.name="ApiError",this.status=n,this.errorCode=s.error_code,this.field=s.field}}class Cj{async request(t,n={}){const s=await this.performRequest(t,n);if(s.status===204||s.status===205)return;const a=await s.text();if(a)return JSON.parse(a)}async requestBlob(t,n={}){return(await this.performRequest(t,n)).blob()}async performRequest(t,n){var d;const s=new Headers(n.headers),a=n.body!==void 0&&n.body!==null,c=sx(t,n.baseUrl??Pa());if(a&&!s.has("Content-Type")&&s.set("Content-Type","application/json"),!n.skipAuth){const f=(d=gn.getState().session)==null?void 0:d.accessToken;if(!f)throw gn.clear(),new Jn(401,{detail:"当前没有可用的登录态",error_code:"UNAUTHORIZED"});s.set("Authorization",`Bearer ${f}`)}let l;try{l=await fetch(c,{...n,headers:s})}catch(f){const p=f instanceof Error?f.message:"未知网络错误";throw new Jn(0,{detail:`请求 ${c} 失败:${p}`,error_code:"NETWORK_ERROR"})}if(!l.ok){const f=await jj(l);if(ax(l.status,f.error_code)&&!n.skipAuth&&!n.retryAfterRefresh){const p=await gn.refresh();if(p.status==="refreshed")return this.performRequest(t,{...n,retryAfterRefresh:!0});throw p.status==="invalid"?new Jn(401,{detail:"登录态已经失效,请重新登录",error_code:"UNAUTHORIZED"}):new Jn(0,{detail:"登录态暂时无法恢复,请稍后重试",error_code:"AUTH_REFRESH_UNAVAILABLE"})}throw!n.skipAuth&&Nj(l.status,f.error_code)&&gn.clear(),new Jn(l.status,f)}return l}}const Je=new Cj;async function jj(e){const t=await e.text();if(!t)return my(e.status);try{const n=JSON.parse(t);if(typeof n.detail=="string"&&typeof n.error_code=="string")return{detail:n.detail,error_code:n.error_code,field:typeof n.field=="string"?n.field:void 0,timestamp:typeof n.timestamp=="string"?n.timestamp:void 0}}catch{}return my(e.status,t)}function my(e,t){return{detail:(t==null?void 0:t.trim())||`请求失败(HTTP ${e})`,error_code:e===401?"UNAUTHORIZED":"HTTP_ERROR"}}function ax(e,t){return e!==401?!1:t==="UNAUTHORIZED"||t==="TOKEN_EXPIRED"||t==="TOKEN_INVALID"}function Nj(e,t){return e===403&&t==="BOOTSTRAP_REQUIRED"?!0:ax(e,t)}function Pj(e){return Je.request("/api/public/bootstrap-status",{baseUrl:e,skipAuth:!0})}function Tj(e,t){return Je.request("/api/public/setup",{method:"POST",body:JSON.stringify(e),baseUrl:t,skipAuth:!0})}function Ej(e,t){return Je.request("/api/auth/login",{method:"POST",body:JSON.stringify(e),baseUrl:t,skipAuth:!0})}function Rj(e,t){return Je.request("/api/auth/refresh",{method:"POST",body:JSON.stringify(e),baseUrl:t,skipAuth:!0})}const ia="codingns.auth.session";class Mj{constructor(){Ke(this,"state",{status:"anonymous",session:this.readSession()});Ke(this,"listeners",new Set);Ke(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Ke(this,"getState",()=>this.state);this.state.session&&(this.state={status:"authenticated",session:this.state.session})}async login(t,n,s){const a=await Ej({username:t,password:n},s);return this.setSession(a),a}async bootstrap(t,n,s){await Tj({username:t,password:n},s)}hydrate(t){if(!t){this.clear();return}this.setSession(t)}async refresh(){const t=this.state.session,n=t==null?void 0:t.refreshToken;if(!n)return this.clear(),{status:"invalid",session:null};this.state={...this.state,status:"refreshing"},this.emit();try{const s=await Rj({refreshToken:n});return this.setSession(s),{status:"refreshed",session:s}}catch(s){return Lj(s)?(this.clear(),{status:"invalid",session:null}):(this.state={status:t?"authenticated":"anonymous",session:t},this.emit(),{status:"deferred",session:t,error:s})}}clear(){this.state={status:"anonymous",session:null},window.localStorage.removeItem(ia),this.emit()}setSession(t){this.state={status:"authenticated",session:t};const n={serverBaseUrl:Pa(),session:t};window.localStorage.setItem(ia,JSON.stringify(n)),this.emit()}readSession(){const t=window.localStorage.getItem(ia);if(!t)return null;try{const n=JSON.parse(t),s=Pa();return Aj(n)?(n.serverBaseUrl&&n.serverBaseUrl!==s,n.session):cx(n)?n:(window.localStorage.removeItem(ia),null)}catch{return window.localStorage.removeItem(ia),null}}emit(){for(const t of this.listeners)t()}}const gn=new Mj;function lx(e){return v.useSyncExternalStore(gn.subscribe,()=>e(gn.getState()))}function Aj(e){return typeof e!="object"||e===null?!1:"session"in e&&cx(e.session)}function cx(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.accessToken=="string"&&typeof t.refreshToken=="string"&&typeof t.expiresIn=="number"&&typeof t.user=="object"&&t.user!==null}function Lj(e){return e instanceof Jn?e.status===401?!0:e.status===403&&e.errorCode==="BOOTSTRAP_REQUIRED":!1}const ux="/api/preferences/profile";async function Ij(){return Je.request(ux)}async function dx(e){return Je.request(ux,{method:"PUT",body:JSON.stringify(e)})}const tu=["claude-code","codex","opencode"],hx="codingns.account.preferences.shadow",Dj="codingns.client.runtime-config",_j="codingns-theme",Fj="composer-selected-model:",Oj="composer-reasoning-level:";function Oa(){return typeof window<"u"&&typeof window.localStorage<"u"}function Wf(e){return e==="en-US"||e==="en"?"en-US":e==="zh-CN"?"zh-CN":null}function Bj(){return typeof navigator>"u"?"zh-CN":Wf(navigator.language)??"zh-CN"}function fx(e){return e==="light"||e==="dark"||e==="sky-blue"||e==="eye-green"?e:null}function Uj(){return typeof window>"u"||typeof window.matchMedia!="function"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function mx(e){return e==="acceptEdits"||e==="bypassPermissions"||e==="default"?e:null}function px(e){return e==="low"||e==="medium"||e==="high"||e==="xhigh"?e:null}function gx(){return{"claude-code":{defaultModel:null,defaultReasoningLevel:null},codex:{defaultModel:null,defaultReasoningLevel:null},opencode:{defaultModel:null,defaultReasoningLevel:null}}}function yx(){return{initialized:!0,profile:{language:Bj(),theme:Uj(),defaultPermissionMode:"default"},providers:gx(),updatedAt:null,source:"default"}}function Wj(){const e=Rn.getState(),t={language:e.language,defaultPermissionMode:e.defaultPermissionMode};if(!Oa())return t;const n=window.localStorage.getItem(Dj);if(!n)return t;try{const s=JSON.parse(n);return{language:Wf(s.language)??t.language,defaultPermissionMode:mx(s.defaultPermissionMode)??t.defaultPermissionMode}}catch{return t}}function zj(){return Oa()?fx(window.localStorage.getItem(_j)):null}function Hj(){var t;if(!Oa())return;const e={};for(const n of tu){const s=((t=window.localStorage.getItem(`${Fj}${n}`))==null?void 0:t.trim())||null,a=px(window.localStorage.getItem(`${Oj}${n}`));s===null&&a===null||(e[n]={defaultModel:s,defaultReasoningLevel:a})}return Object.keys(e).length>0?e:void 0}function vx(){const e=Wj(),t=zj(),n=Hj(),s={};return e.language&&(s.language=e.language),t&&(s.theme=t),e.defaultPermissionMode&&(s.defaultPermissionMode=e.defaultPermissionMode),n&&(s.providers=n),wx(s)?s:null}function wx(e){return e?e.language!==void 0||e.theme!==void 0||e.defaultPermissionMode!==void 0||e.providers!==void 0&&Object.keys(e.providers).length>0:!1}function Ic(e){var s;const t=yx(),n=gx();for(const a of tu){const c=(s=e==null?void 0:e.providers)==null?void 0:s[a];n[a]={defaultModel:typeof(c==null?void 0:c.defaultModel)=="string"&&c.defaultModel.trim()||null,defaultReasoningLevel:px(c==null?void 0:c.defaultReasoningLevel)??null}}return{language:Wf(e==null?void 0:e.language)??t.profile.language,theme:fx(e==null?void 0:e.theme)??t.profile.theme,defaultPermissionMode:mx(e==null?void 0:e.defaultPermissionMode)??t.profile.defaultPermissionMode,providers:n,updatedAt:typeof(e==null?void 0:e.updatedAt)=="string"?e.updatedAt:null}}function qj(){var t,n,s;if(!Oa())return null;const e=window.localStorage.getItem(hx);if(!e)return null;try{const a=JSON.parse(e),c=Ic({language:(t=a.profile)==null?void 0:t.language,theme:(n=a.profile)==null?void 0:n.theme,defaultPermissionMode:(s=a.profile)==null?void 0:s.defaultPermissionMode,providers:a.providers,updatedAt:a.updatedAt});return{profile:{language:c.language,theme:c.theme,defaultPermissionMode:c.defaultPermissionMode},providers:c.providers,updatedAt:c.updatedAt}}catch{return null}}function Dc(e){if(!Oa())return;const t={profile:e.profile,providers:e.providers,updatedAt:e.updatedAt};window.localStorage.setItem(hx,JSON.stringify(t))}function Qs(){const e=yx(),t=vx(),n=t?bx(e,t,"default"):e,s=qj();return s?{initialized:!0,profile:s.profile,providers:s.providers,updatedAt:s.updatedAt,source:"shadow"}:n}function tf(e,t){return{initialized:!0,profile:{language:e.language,theme:e.theme,defaultPermissionMode:e.defaultPermissionMode},providers:e.providers,updatedAt:e.updatedAt,source:t}}function bx(e,t,n){const s={...e.providers};if(t.providers)for(const a of tu){const c=t.providers[a];c&&(s[a]={defaultModel:c.defaultModel!==void 0?c.defaultModel??null:e.providers[a].defaultModel,defaultReasoningLevel:c.defaultReasoningLevel!==void 0?c.defaultReasoningLevel??null:e.providers[a].defaultReasoningLevel})}return{initialized:!0,profile:{language:t.language??e.profile.language,theme:t.theme??e.profile.theme,defaultPermissionMode:t.defaultPermissionMode??e.profile.defaultPermissionMode},providers:s,updatedAt:e.updatedAt,source:n}}async function $j(){const e=Ic(await Ij());if(e.updatedAt===null){const n=vx();if(wx(n)){const s=Ic(await dx(n)),a=tf(s,"remote");return Dc(a),a}}const t=tf(e,"remote");return Dc(t),t}class Vj{constructor(){Ke(this,"state",Qs());Ke(this,"listeners",new Set);Ke(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Ke(this,"getState",()=>this.state);Rn.subscribe(()=>{gn.getState().session||this.state.source==="remote"||this.hydrate(Qs())})}hydrate(t){this.state=t,this.emit()}resetToLocalFallback(){this.hydrate(Qs())}async initialize(){if(!gn.getState().session){const t=Qs();return this.hydrate(t),t}return this.refreshForAuthenticatedUser()}async refreshForAuthenticatedUser(){if(!gn.getState().session){const t=Qs();return this.hydrate(t),t}try{const t=await $j();return this.hydrate(t),t}catch{const t=Qs();return this.hydrate(t),t}}async updateProfile(t){const n=this.state,s=bx(n,t,n.source);if(this.hydrate(s),!gn.getState().session)return Dc(s),s;try{const a=Ic(await dx(t)),c=tf(a,"remote");return Dc(c),this.hydrate(c),c}catch(a){throw this.hydrate(n),a}}async updateProviderPreference(t,n){return this.updateProfile({providers:{[t]:n}})}emit(){for(const t of this.listeners)t()}}const Yr=new Vj;function nf(e){return v.useSyncExternalStore(Yr.subscribe,()=>e(Yr.getState()))}function Gd(e){return tu.includes(e)}function Gj(){return Yr.initialize()}function _c(e){return Yr.updateProfile(e)}function uo(e){return nf(t=>e({profile:{...t.profile,providers:t.providers,updatedAt:t.updatedAt},isFetching:!1,error:null}))}async function Kj(){const e=ai();return await Rn.initialize(),await Gj(),{platform:e.platform}}var On=Vb();const Qj=Fa(On),Yj=$b({__proto__:null,default:Qj},[On]);/**
42
+ * @remix-run/router v1.23.2
43
+ *
44
+ * Copyright (c) Remix Software Inc.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE.md file in the root directory of this source tree.
48
+ *
49
+ * @license MIT
50
+ */function hn(){return hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},hn.apply(this,arguments)}var jn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(jn||(jn={}));const py="popstate";function Xj(e){e===void 0&&(e={});function t(s,a){let{pathname:c,search:l,hash:d}=s.location;return Ta("",{pathname:c,search:l,hash:d},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(s,a){return typeof a=="string"?a:Ba(a)}return Zj(t,n,null,e)}function Wt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function xs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Jj(){return Math.random().toString(36).substr(2,8)}function gy(e,t){return{usr:e.state,key:e.key,idx:t}}function Ta(e,t,n,s){return n===void 0&&(n=null),hn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ki(t):t,{state:n,key:t&&t.key||s||Jj()})}function Ba(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Ki(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function Zj(e,t,n,s){s===void 0&&(s={});let{window:a=document.defaultView,v5Compat:c=!1}=s,l=a.history,d=jn.Pop,f=null,p=y();p==null&&(p=0,l.replaceState(hn({},l.state,{idx:p}),""));function y(){return(l.state||{idx:null}).idx}function g(){d=jn.Pop;let j=y(),A=j==null?null:j-p;p=j,f&&f({action:d,location:C.location,delta:A})}function b(j,A){d=jn.Push;let L=Ta(C.location,j,A);p=y()+1;let M=gy(L,p),O=C.createHref(L);try{l.pushState(M,"",O)}catch(q){if(q instanceof DOMException&&q.name==="DataCloneError")throw q;a.location.assign(O)}c&&f&&f({action:d,location:C.location,delta:1})}function k(j,A){d=jn.Replace;let L=Ta(C.location,j,A);p=y();let M=gy(L,p),O=C.createHref(L);l.replaceState(M,"",O),c&&f&&f({action:d,location:C.location,delta:0})}function S(j){let A=a.location.origin!=="null"?a.location.origin:a.location.href,L=typeof j=="string"?j:Ba(j);return L=L.replace(/ $/,"%20"),Wt(A,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,A)}let C={get action(){return d},get location(){return e(a,l)},listen(j){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(py,g),f=j,()=>{a.removeEventListener(py,g),f=null}},createHref(j){return t(a,j)},createURL:S,encodeLocation(j){let A=S(j);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:b,replace:k,go(j){return l.go(j)}};return C}var en;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(en||(en={}));const eN=new Set(["lazy","caseSensitive","path","id","index","children"]);function tN(e){return e.index===!0}function Fc(e,t,n,s){return n===void 0&&(n=[]),s===void 0&&(s={}),e.map((a,c)=>{let l=[...n,String(c)],d=typeof a.id=="string"?a.id:l.join("-");if(Wt(a.index!==!0||!a.children,"Cannot specify children on an index route"),Wt(!s[d],'Found a route id collision on id "'+d+`". Route id's must be globally unique within Data Router usages`),tN(a)){let f=hn({},a,t(a),{id:d});return s[d]=f,f}else{let f=hn({},a,t(a),{id:d,children:void 0});return s[d]=f,a.children&&(f.children=Fc(a.children,t,l,s)),f}})}function gs(e,t,n){return n===void 0&&(n="/"),bc(e,t,n,!1)}function bc(e,t,n,s){let a=typeof t=="string"?Ki(t):t,c=Ua(a.pathname||"/",n);if(c==null)return null;let l=xx(e);rN(l);let d=null;for(let f=0;d==null&&f<l.length;++f){let p=mN(c);d=hN(l[f],p,s)}return d}function nN(e,t){let{route:n,pathname:s,params:a}=e;return{id:n.id,pathname:s,params:a,data:t[n.id],handle:n.handle}}function xx(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let a=(c,l,d)=>{let f={relativePath:d===void 0?c.path||"":d,caseSensitive:c.caseSensitive===!0,childrenIndex:l,route:c};f.relativePath.startsWith("/")&&(Wt(f.relativePath.startsWith(s),'Absolute route path "'+f.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),f.relativePath=f.relativePath.slice(s.length));let p=Gi([s,f.relativePath]),y=n.concat(f);c.children&&c.children.length>0&&(Wt(c.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),xx(c.children,t,y,p)),!(c.path==null&&!c.index)&&t.push({path:p,score:uN(p,c.index),routesMeta:y})};return e.forEach((c,l)=>{var d;if(c.path===""||!((d=c.path)!=null&&d.includes("?")))a(c,l);else for(let f of kx(c.path))a(c,l,f)}),t}function kx(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,a=n.endsWith("?"),c=n.replace(/\?$/,"");if(s.length===0)return a?[c,""]:[c];let l=kx(s.join("/")),d=[];return d.push(...l.map(f=>f===""?c:[c,f].join("/"))),a&&d.push(...l),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function rN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dN(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const iN=/^:[\w-]+$/,sN=3,oN=2,aN=1,lN=10,cN=-2,yy=e=>e==="*";function uN(e,t){let n=e.split("/"),s=n.length;return n.some(yy)&&(s+=cN),t&&(s+=oN),n.filter(a=>!yy(a)).reduce((a,c)=>a+(iN.test(c)?sN:c===""?aN:lN),s)}function dN(e,t){return e.length===t.length&&e.slice(0,-1).every((s,a)=>s===t[a])?e[e.length-1]-t[t.length-1]:0}function hN(e,t,n){n===void 0&&(n=!1);let{routesMeta:s}=e,a={},c="/",l=[];for(let d=0;d<s.length;++d){let f=s[d],p=d===s.length-1,y=c==="/"?t:t.slice(c.length)||"/",g=En({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},y),b=f.route;if(!g&&p&&n&&!s[s.length-1].route.index&&(g=En({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},y)),!g)return null;Object.assign(a,g.params),l.push({params:a,pathname:Gi([c,g.pathname]),pathnameBase:vN(Gi([c,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(c=Gi([c,g.pathnameBase]))}return l}function En(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=fN(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let c=a[0],l=c.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:s.reduce((p,y,g)=>{let{paramName:b,isOptional:k}=y;if(b==="*"){let C=d[g]||"";l=c.slice(0,c.length-C.length).replace(/(.)\/+$/,"$1")}const S=d[g];return k&&!S?p[b]=void 0:p[b]=(S||"").replace(/%2F/g,"/"),p},{}),pathname:c,pathnameBase:l,pattern:e}}function fN(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),xs(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,d,f)=>(s.push({paramName:d,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),s]}function mN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return xs(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ua(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const pN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gN=e=>pN.test(e);function yN(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:a=""}=typeof e=="string"?Ki(e):e,c;if(n)if(gN(n))c=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),xs(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?c=vy(n.substring(1),"/"):c=vy(n,t)}else c=t;return{pathname:c,search:wN(s),hash:bN(a)}}function vy(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Kd(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Sx(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function zf(e,t){let n=Sx(e);return t?n.map((s,a)=>a===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function Hf(e,t,n,s){s===void 0&&(s=!1);let a;typeof e=="string"?a=Ki(e):(a=hn({},e),Wt(!a.pathname||!a.pathname.includes("?"),Kd("?","pathname","search",a)),Wt(!a.pathname||!a.pathname.includes("#"),Kd("#","pathname","hash",a)),Wt(!a.search||!a.search.includes("#"),Kd("#","search","hash",a)));let c=e===""||a.pathname==="",l=c?"/":a.pathname,d;if(l==null)d=n;else{let g=t.length-1;if(!s&&l.startsWith("..")){let b=l.split("/");for(;b[0]==="..";)b.shift(),g-=1;a.pathname=b.join("/")}d=g>=0?t[g]:"/"}let f=yN(a,d),p=l&&l!=="/"&&l.endsWith("/"),y=(c||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||y)&&(f.pathname+="/"),f}const Gi=e=>e.join("/").replace(/\/\/+/g,"/"),vN=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,bN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Oc{constructor(t,n,s,a){a===void 0&&(a=!1),this.status=t,this.statusText=n||"",this.internal=a,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}}function Ea(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Cx=["post","put","patch","delete"],xN=new Set(Cx),kN=["get",...Cx],SN=new Set(kN),CN=new Set([301,302,303,307,308]),jN=new Set([307,308]),Qd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},NN={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sa={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},qf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,PN=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),jx="remix-router-transitions";function TN(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",s=!n;Wt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let H=e.detectErrorBoundary;a=Z=>({hasErrorBoundary:H(Z)})}else a=PN;let c={},l=Fc(e.routes,a,void 0,c),d,f=e.basename||"/",p=e.dataStrategy||AN,y=e.patchRoutesOnNavigation,g=hn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),b=null,k=new Set,S=null,C=null,j=null,A=e.hydrationData!=null,L=gs(l,e.history.location,f),M=!1,O=null;if(L==null&&!y){let H=dr(404,{pathname:e.history.location.pathname}),{matches:Z,route:ie}=Ey(l);L=Z,O={[ie.id]:H}}L&&!e.hydrationData&&un(L,l,e.history.location.pathname).active&&(L=null);let q;if(L)if(L.some(H=>H.route.lazy))q=!1;else if(!L.some(H=>H.route.loader))q=!0;else if(g.v7_partialHydration){let H=e.hydrationData?e.hydrationData.loaderData:null,Z=e.hydrationData?e.hydrationData.errors:null;if(Z){let ie=L.findIndex(we=>Z[we.route.id]!==void 0);q=L.slice(0,ie+1).every(we=>!sf(we.route,H,Z))}else q=L.every(ie=>!sf(ie.route,H,Z))}else q=e.hydrationData!=null;else if(q=!1,L=[],g.v7_partialHydration){let H=un(null,l,e.history.location.pathname);H.active&&H.matches&&(M=!0,L=H.matches)}let _,I={historyAction:e.history.action,location:e.history.location,matches:L,initialized:q,navigation:Qd,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},F=jn.Pop,D=!1,P,K=!1,X=new Map,$=null,ee=!1,te=!1,pe=[],ne=new Set,z=new Map,ye=0,E=-1,W=new Map,re=new Set,T=new Map,ae=new Map,Le=new Set,je=new Map,He=new Map,qe;function et(){if(b=e.history.listen(H=>{let{action:Z,location:ie,delta:we}=H;if(qe){qe(),qe=void 0;return}xs(He.size===0||we!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Te=Bt({currentLocation:I.location,nextLocation:ie,historyAction:Z});if(Te&&we!=null){let Ae=new Promise($e=>{qe=$e});e.history.go(we*-1),wt(Te,{state:"blocked",location:ie,proceed(){wt(Te,{state:"proceeding",proceed:void 0,reset:void 0,location:ie}),Ae.then(()=>e.history.go(we))},reset(){let $e=new Map(I.blockers);$e.set(Te,sa),Ct({blockers:$e})}});return}return Tt(Z,ie)}),n){VN(t,X);let H=()=>GN(t,X);t.addEventListener("pagehide",H),$=()=>t.removeEventListener("pagehide",H)}return I.initialized||Tt(jn.Pop,I.location,{initialHydration:!0}),_}function ot(){b&&b(),$&&$(),k.clear(),P&&P.abort(),I.fetchers.forEach((H,Z)=>dt(Z)),I.blockers.forEach((H,Z)=>ze(Z))}function bt(H){return k.add(H),()=>k.delete(H)}function Ct(H,Z){Z===void 0&&(Z={}),I=hn({},I,H);let ie=[],we=[];g.v7_fetcherPersist&&I.fetchers.forEach((Te,Ae)=>{Te.state==="idle"&&(Le.has(Ae)?we.push(Ae):ie.push(Ae))}),Le.forEach(Te=>{!I.fetchers.has(Te)&&!z.has(Te)&&we.push(Te)}),[...k].forEach(Te=>Te(I,{deletedFetchers:we,viewTransitionOpts:Z.viewTransitionOpts,flushSync:Z.flushSync===!0})),g.v7_fetcherPersist?(ie.forEach(Te=>I.fetchers.delete(Te)),we.forEach(Te=>dt(Te))):we.forEach(Te=>Le.delete(Te))}function lt(H,Z,ie){var we,Te;let{flushSync:Ae}=ie===void 0?{}:ie,$e=I.actionData!=null&&I.navigation.formMethod!=null&&Kr(I.navigation.formMethod)&&I.navigation.state==="loading"&&((we=H.state)==null?void 0:we._isRedirect)!==!0,Ie;Z.actionData?Object.keys(Z.actionData).length>0?Ie=Z.actionData:Ie=null:$e?Ie=I.actionData:Ie=null;let Ue=Z.loaderData?Py(I.loaderData,Z.loaderData,Z.matches||[],Z.errors):I.loaderData,Fe=I.blockers;Fe.size>0&&(Fe=new Map(Fe),Fe.forEach((rt,Ut)=>Fe.set(Ut,sa)));let Oe=D===!0||I.navigation.formMethod!=null&&Kr(I.navigation.formMethod)&&((Te=H.state)==null?void 0:Te._isRedirect)!==!0;d&&(l=d,d=void 0),ee||F===jn.Pop||(F===jn.Push?e.history.push(H,H.state):F===jn.Replace&&e.history.replace(H,H.state));let ct;if(F===jn.Pop){let rt=X.get(I.location.pathname);rt&&rt.has(H.pathname)?ct={currentLocation:I.location,nextLocation:H}:X.has(H.pathname)&&(ct={currentLocation:H,nextLocation:I.location})}else if(K){let rt=X.get(I.location.pathname);rt?rt.add(H.pathname):(rt=new Set([H.pathname]),X.set(I.location.pathname,rt)),ct={currentLocation:I.location,nextLocation:H}}Ct(hn({},Z,{actionData:Ie,loaderData:Ue,historyAction:F,location:H,initialized:!0,navigation:Qd,revalidation:"idle",restoreScrollPosition:yn(H,Z.matches||I.matches),preventScrollReset:Oe,blockers:Fe}),{viewTransitionOpts:ct,flushSync:Ae===!0}),F=jn.Pop,D=!1,K=!1,ee=!1,te=!1,pe=[]}async function kt(H,Z){if(typeof H=="number"){e.history.go(H);return}let ie=rf(I.location,I.matches,f,g.v7_prependBasename,H,g.v7_relativeSplatPath,Z==null?void 0:Z.fromRouteId,Z==null?void 0:Z.relative),{path:we,submission:Te,error:Ae}=wy(g.v7_normalizeFormMethod,!1,ie,Z),$e=I.location,Ie=Ta(I.location,we,Z&&Z.state);Ie=hn({},Ie,e.history.encodeLocation(Ie));let Ue=Z&&Z.replace!=null?Z.replace:void 0,Fe=jn.Push;Ue===!0?Fe=jn.Replace:Ue===!1||Te!=null&&Kr(Te.formMethod)&&Te.formAction===I.location.pathname+I.location.search&&(Fe=jn.Replace);let Oe=Z&&"preventScrollReset"in Z?Z.preventScrollReset===!0:void 0,ct=(Z&&Z.flushSync)===!0,rt=Bt({currentLocation:$e,nextLocation:Ie,historyAction:Fe});if(rt){wt(rt,{state:"blocked",location:Ie,proceed(){wt(rt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ie}),kt(H,Z)},reset(){let Ut=new Map(I.blockers);Ut.set(rt,sa),Ct({blockers:Ut})}});return}return await Tt(Fe,Ie,{submission:Te,pendingError:Ae,preventScrollReset:Oe,replace:Z&&Z.replace,enableViewTransition:Z&&Z.viewTransition,flushSync:ct})}function Ve(){if(ge(),Ct({revalidation:"loading"}),I.navigation.state!=="submitting"){if(I.navigation.state==="idle"){Tt(I.historyAction,I.location,{startUninterruptedRevalidation:!0});return}Tt(F||I.historyAction,I.navigation.location,{overrideNavigation:I.navigation,enableViewTransition:K===!0})}}async function Tt(H,Z,ie){P&&P.abort(),P=null,F=H,ee=(ie&&ie.startUninterruptedRevalidation)===!0,cn(I.location,I.matches),D=(ie&&ie.preventScrollReset)===!0,K=(ie&&ie.enableViewTransition)===!0;let we=d||l,Te=ie&&ie.overrideNavigation,Ae=ie!=null&&ie.initialHydration&&I.matches&&I.matches.length>0&&!M?I.matches:gs(we,Z,f),$e=(ie&&ie.flushSync)===!0;if(Ae&&I.initialized&&!te&&ON(I.location,Z)&&!(ie&&ie.submission&&Kr(ie.submission.formMethod))){lt(Z,{matches:Ae},{flushSync:$e});return}let Ie=un(Ae,we,Z.pathname);if(Ie.active&&Ie.matches&&(Ae=Ie.matches),!Ae){let{error:Pt,notFoundMatches:We,route:se}=Zt(Z.pathname);lt(Z,{matches:We,loaderData:{},errors:{[se.id]:Pt}},{flushSync:$e});return}P=new AbortController;let Ue=Ys(e.history,Z,P.signal,ie&&ie.submission),Fe;if(ie&&ie.pendingError)Fe=[ys(Ae).route.id,{type:en.error,error:ie.pendingError}];else if(ie&&ie.submission&&Kr(ie.submission.formMethod)){let Pt=await Ot(Ue,Z,ie.submission,Ae,Ie.active,{replace:ie.replace,flushSync:$e});if(Pt.shortCircuited)return;if(Pt.pendingActionResult){let[We,se]=Pt.pendingActionResult;if(Sr(se)&&Ea(se.error)&&se.error.status===404){P=null,lt(Z,{matches:Pt.matches,loaderData:{},errors:{[We]:se.error}});return}}Ae=Pt.matches||Ae,Fe=Pt.pendingActionResult,Te=Yd(Z,ie.submission),$e=!1,Ie.active=!1,Ue=Ys(e.history,Ue.url,Ue.signal)}let{shortCircuited:Oe,matches:ct,loaderData:rt,errors:Ut}=await St(Ue,Z,Ae,Ie.active,Te,ie&&ie.submission,ie&&ie.fetcherSubmission,ie&&ie.replace,ie&&ie.initialHydration===!0,$e,Fe);Oe||(P=null,lt(Z,hn({matches:ct||Ae},Ty(Fe),{loaderData:rt,errors:Ut})))}async function Ot(H,Z,ie,we,Te,Ae){Ae===void 0&&(Ae={}),ge();let $e=qN(Z,ie);if(Ct({navigation:$e},{flushSync:Ae.flushSync===!0}),Te){let Fe=await on(we,Z.pathname,H.signal);if(Fe.type==="aborted")return{shortCircuited:!0};if(Fe.type==="error"){let Oe=ys(Fe.partialMatches).route.id;return{matches:Fe.partialMatches,pendingActionResult:[Oe,{type:en.error,error:Fe.error}]}}else if(Fe.matches)we=Fe.matches;else{let{notFoundMatches:Oe,error:ct,route:rt}=Zt(Z.pathname);return{matches:Oe,pendingActionResult:[rt.id,{type:en.error,error:ct}]}}}let Ie,Ue=pa(we,Z);if(!Ue.route.action&&!Ue.route.lazy)Ie={type:en.error,error:dr(405,{method:H.method,pathname:Z.pathname,routeId:Ue.route.id})};else if(Ie=(await Lt("action",I,H,[Ue],we,null))[Ue.route.id],H.signal.aborted)return{shortCircuited:!0};if(ws(Ie)){let Fe;return Ae&&Ae.replace!=null?Fe=Ae.replace:Fe=Cy(Ie.response.headers.get("Location"),new URL(H.url),f,e.history)===I.location.pathname+I.location.search,await Dt(H,Ie,!0,{submission:ie,replace:Fe}),{shortCircuited:!0}}if($i(Ie))throw dr(400,{type:"defer-action"});if(Sr(Ie)){let Fe=ys(we,Ue.route.id);return(Ae&&Ae.replace)!==!0&&(F=jn.Push),{matches:we,pendingActionResult:[Fe.route.id,Ie]}}return{matches:we,pendingActionResult:[Ue.route.id,Ie]}}async function St(H,Z,ie,we,Te,Ae,$e,Ie,Ue,Fe,Oe){let ct=Te||Yd(Z,Ae),rt=Ae||$e||My(ct),Ut=!ee&&(!g.v7_partialHydration||!Ue);if(we){if(Ut){let R=Mt(Oe);Ct(hn({navigation:ct},R!==void 0?{actionData:R}:{}),{flushSync:Fe})}let xe=await on(ie,Z.pathname,H.signal);if(xe.type==="aborted")return{shortCircuited:!0};if(xe.type==="error"){let R=ys(xe.partialMatches).route.id;return{matches:xe.partialMatches,loaderData:{},errors:{[R]:xe.error}}}else if(xe.matches)ie=xe.matches;else{let{error:R,notFoundMatches:de,route:he}=Zt(Z.pathname);return{matches:de,loaderData:{},errors:{[he.id]:R}}}}let Pt=d||l,[We,se]=xy(e.history,I,ie,rt,Z,g.v7_partialHydration&&Ue===!0,g.v7_skipActionErrorRevalidation,te,pe,ne,Le,T,re,Pt,f,Oe);if(Vt(xe=>!(ie&&ie.some(R=>R.route.id===xe))||We&&We.some(R=>R.route.id===xe)),E=++ye,We.length===0&&se.length===0){let xe=jt();return lt(Z,hn({matches:ie,loaderData:{},errors:Oe&&Sr(Oe[1])?{[Oe[0]]:Oe[1].error}:null},Ty(Oe),xe?{fetchers:new Map(I.fetchers)}:{}),{flushSync:Fe}),{shortCircuited:!0}}if(Ut){let xe={};if(!we){xe.navigation=ct;let R=Mt(Oe);R!==void 0&&(xe.actionData=R)}se.length>0&&(xe.fetchers=Ht(se)),Ct(xe,{flushSync:Fe})}se.forEach(xe=>{ht(xe.key),xe.controller&&z.set(xe.key,xe.controller)});let Ce=()=>se.forEach(xe=>ht(xe.key));P&&P.signal.addEventListener("abort",Ce);let{loaderResults:B,fetcherResults:le}=await ue(I,ie,We,se,H);if(H.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",Ce),se.forEach(xe=>z.delete(xe.key));let Se=Zl(B);if(Se)return await Dt(H,Se.result,!0,{replace:Ie}),{shortCircuited:!0};if(Se=Zl(le),Se)return re.add(Se.key),await Dt(H,Se.result,!0,{replace:Ie}),{shortCircuited:!0};let{loaderData:Ye,errors:tt}=Ny(I,ie,B,Oe,se,le,je);je.forEach((xe,R)=>{xe.subscribe(de=>{(de||xe.done)&&je.delete(R)})}),g.v7_partialHydration&&Ue&&I.errors&&(tt=hn({},I.errors,tt));let nn=jt(),Ln=V(E),Y=nn||Ln||se.length>0;return hn({matches:ie,loaderData:Ye,errors:tt},Y?{fetchers:new Map(I.fetchers)}:{})}function Mt(H){if(H&&!Sr(H[1]))return{[H[0]]:H[1].data};if(I.actionData)return Object.keys(I.actionData).length===0?null:I.actionData}function Ht(H){return H.forEach(Z=>{let ie=I.fetchers.get(Z.key),we=oa(void 0,ie?ie.data:void 0);I.fetchers.set(Z.key,we)}),new Map(I.fetchers)}function At(H,Z,ie,we){if(s)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ht(H);let Te=(we&&we.flushSync)===!0,Ae=d||l,$e=rf(I.location,I.matches,f,g.v7_prependBasename,ie,g.v7_relativeSplatPath,Z,we==null?void 0:we.relative),Ie=gs(Ae,$e,f),Ue=un(Ie,Ae,$e);if(Ue.active&&Ue.matches&&(Ie=Ue.matches),!Ie){Pe(H,Z,dr(404,{pathname:$e}),{flushSync:Te});return}let{path:Fe,submission:Oe,error:ct}=wy(g.v7_normalizeFormMethod,!0,$e,we);if(ct){Pe(H,Z,ct,{flushSync:Te});return}let rt=pa(Ie,Fe),Ut=(we&&we.preventScrollReset)===!0;if(Oe&&Kr(Oe.formMethod)){vt(H,Z,Fe,rt,Ie,Ue.active,Te,Ut,Oe);return}T.set(H,{routeId:Z,path:Fe}),$t(H,Z,Fe,rt,Ie,Ue.active,Te,Ut,Oe)}async function vt(H,Z,ie,we,Te,Ae,$e,Ie,Ue){ge(),T.delete(H);function Fe(ve){if(!ve.route.action&&!ve.route.lazy){let it=dr(405,{method:Ue.formMethod,pathname:ie,routeId:Z});return Pe(H,Z,it,{flushSync:$e}),!0}return!1}if(!Ae&&Fe(we))return;let Oe=I.fetchers.get(H);Be(H,$N(Ue,Oe),{flushSync:$e});let ct=new AbortController,rt=Ys(e.history,ie,ct.signal,Ue);if(Ae){let ve=await on(Te,new URL(rt.url).pathname,rt.signal,H);if(ve.type==="aborted")return;if(ve.type==="error"){Pe(H,Z,ve.error,{flushSync:$e});return}else if(ve.matches){if(Te=ve.matches,we=pa(Te,ie),Fe(we))return}else{Pe(H,Z,dr(404,{pathname:ie}),{flushSync:$e});return}}z.set(H,ct);let Ut=ye,We=(await Lt("action",I,rt,[we],Te,H))[we.route.id];if(rt.signal.aborted){z.get(H)===ct&&z.delete(H);return}if(g.v7_fetcherPersist&&Le.has(H)){if(ws(We)||Sr(We)){Be(H,zi(void 0));return}}else{if(ws(We))if(z.delete(H),E>Ut){Be(H,zi(void 0));return}else return re.add(H),Be(H,oa(Ue)),Dt(rt,We,!1,{fetcherSubmission:Ue,preventScrollReset:Ie});if(Sr(We)){Pe(H,Z,We.error);return}}if($i(We))throw dr(400,{type:"defer-action"});let se=I.navigation.location||I.location,Ce=Ys(e.history,se,ct.signal),B=d||l,le=I.navigation.state!=="idle"?gs(B,I.navigation.location,f):I.matches;Wt(le,"Didn't find any matches after fetcher action");let Se=++ye;W.set(H,Se);let Ye=oa(Ue,We.data);I.fetchers.set(H,Ye);let[tt,nn]=xy(e.history,I,le,Ue,se,!1,g.v7_skipActionErrorRevalidation,te,pe,ne,Le,T,re,B,f,[we.route.id,We]);nn.filter(ve=>ve.key!==H).forEach(ve=>{let it=ve.key,ut=I.fetchers.get(it),zt=oa(void 0,ut?ut.data:void 0);I.fetchers.set(it,zt),ht(it),ve.controller&&z.set(it,ve.controller)}),Ct({fetchers:new Map(I.fetchers)});let Ln=()=>nn.forEach(ve=>ht(ve.key));ct.signal.addEventListener("abort",Ln);let{loaderResults:Y,fetcherResults:xe}=await ue(I,le,tt,nn,Ce);if(ct.signal.aborted)return;ct.signal.removeEventListener("abort",Ln),W.delete(H),z.delete(H),nn.forEach(ve=>z.delete(ve.key));let R=Zl(Y);if(R)return Dt(Ce,R.result,!1,{preventScrollReset:Ie});if(R=Zl(xe),R)return re.add(R.key),Dt(Ce,R.result,!1,{preventScrollReset:Ie});let{loaderData:de,errors:he}=Ny(I,le,Y,void 0,nn,xe,je);if(I.fetchers.has(H)){let ve=zi(We.data);I.fetchers.set(H,ve)}V(Se),I.navigation.state==="loading"&&Se>E?(Wt(F,"Expected pending action"),P&&P.abort(),lt(I.navigation.location,{matches:le,loaderData:de,errors:he,fetchers:new Map(I.fetchers)})):(Ct({errors:he,loaderData:Py(I.loaderData,de,le,he),fetchers:new Map(I.fetchers)}),te=!1)}async function $t(H,Z,ie,we,Te,Ae,$e,Ie,Ue){let Fe=I.fetchers.get(H);Be(H,oa(Ue,Fe?Fe.data:void 0),{flushSync:$e});let Oe=new AbortController,ct=Ys(e.history,ie,Oe.signal);if(Ae){let We=await on(Te,new URL(ct.url).pathname,ct.signal,H);if(We.type==="aborted")return;if(We.type==="error"){Pe(H,Z,We.error,{flushSync:$e});return}else if(We.matches)Te=We.matches,we=pa(Te,ie);else{Pe(H,Z,dr(404,{pathname:ie}),{flushSync:$e});return}}z.set(H,Oe);let rt=ye,Pt=(await Lt("loader",I,ct,[we],Te,H))[we.route.id];if($i(Pt)&&(Pt=await $f(Pt,ct.signal,!0)||Pt),z.get(H)===Oe&&z.delete(H),!ct.signal.aborted){if(Le.has(H)){Be(H,zi(void 0));return}if(ws(Pt))if(E>rt){Be(H,zi(void 0));return}else{re.add(H),await Dt(ct,Pt,!1,{preventScrollReset:Ie});return}if(Sr(Pt)){Pe(H,Z,Pt.error);return}Wt(!$i(Pt),"Unhandled fetcher deferred data"),Be(H,zi(Pt.data))}}async function Dt(H,Z,ie,we){let{submission:Te,fetcherSubmission:Ae,preventScrollReset:$e,replace:Ie}=we===void 0?{}:we;Z.response.headers.has("X-Remix-Revalidate")&&(te=!0);let Ue=Z.response.headers.get("Location");Wt(Ue,"Expected a Location header on the redirect Response"),Ue=Cy(Ue,new URL(H.url),f,e.history);let Fe=Ta(I.location,Ue,{_isRedirect:!0});if(n){let We=!1;if(Z.response.headers.has("X-Remix-Reload-Document"))We=!0;else if(qf.test(Ue)){const se=e.history.createURL(Ue);We=se.origin!==t.location.origin||Ua(se.pathname,f)==null}if(We){Ie?t.location.replace(Ue):t.location.assign(Ue);return}}P=null;let Oe=Ie===!0||Z.response.headers.has("X-Remix-Replace")?jn.Replace:jn.Push,{formMethod:ct,formAction:rt,formEncType:Ut}=I.navigation;!Te&&!Ae&&ct&&rt&&Ut&&(Te=My(I.navigation));let Pt=Te||Ae;if(jN.has(Z.response.status)&&Pt&&Kr(Pt.formMethod))await Tt(Oe,Fe,{submission:hn({},Pt,{formAction:Ue}),preventScrollReset:$e||D,enableViewTransition:ie?K:void 0});else{let We=Yd(Fe,Te);await Tt(Oe,Fe,{overrideNavigation:We,fetcherSubmission:Ae,preventScrollReset:$e||D,enableViewTransition:ie?K:void 0})}}async function Lt(H,Z,ie,we,Te,Ae){let $e,Ie={};try{$e=await LN(p,H,Z,ie,we,Te,Ae,c,a)}catch(Ue){return we.forEach(Fe=>{Ie[Fe.route.id]={type:en.error,error:Ue}}),Ie}for(let[Ue,Fe]of Object.entries($e))if(BN(Fe)){let Oe=Fe.result;Ie[Ue]={type:en.redirect,response:_N(Oe,ie,Ue,Te,f,g.v7_relativeSplatPath)}}else Ie[Ue]=await DN(Fe);return Ie}async function ue(H,Z,ie,we,Te){let Ae=H.matches,$e=Lt("loader",H,Te,ie,Z,null),Ie=Promise.all(we.map(async Oe=>{if(Oe.matches&&Oe.match&&Oe.controller){let rt=(await Lt("loader",H,Ys(e.history,Oe.path,Oe.controller.signal),[Oe.match],Oe.matches,Oe.key))[Oe.match.route.id];return{[Oe.key]:rt}}else return Promise.resolve({[Oe.key]:{type:en.error,error:dr(404,{pathname:Oe.path})}})})),Ue=await $e,Fe=(await Ie).reduce((Oe,ct)=>Object.assign(Oe,ct),{});return await Promise.all([zN(Z,Ue,Te.signal,Ae,H.loaderData),HN(Z,Fe,we)]),{loaderResults:Ue,fetcherResults:Fe}}function ge(){te=!0,pe.push(...Vt()),T.forEach((H,Z)=>{z.has(Z)&&ne.add(Z),ht(Z)})}function Be(H,Z,ie){ie===void 0&&(ie={}),I.fetchers.set(H,Z),Ct({fetchers:new Map(I.fetchers)},{flushSync:(ie&&ie.flushSync)===!0})}function Pe(H,Z,ie,we){we===void 0&&(we={});let Te=ys(I.matches,Z);dt(H),Ct({errors:{[Te.route.id]:ie},fetchers:new Map(I.fetchers)},{flushSync:(we&&we.flushSync)===!0})}function ft(H){return ae.set(H,(ae.get(H)||0)+1),Le.has(H)&&Le.delete(H),I.fetchers.get(H)||NN}function dt(H){let Z=I.fetchers.get(H);z.has(H)&&!(Z&&Z.state==="loading"&&W.has(H))&&ht(H),T.delete(H),W.delete(H),re.delete(H),g.v7_fetcherPersist&&Le.delete(H),ne.delete(H),I.fetchers.delete(H)}function Rt(H){let Z=(ae.get(H)||0)-1;Z<=0?(ae.delete(H),Le.add(H),g.v7_fetcherPersist||dt(H)):ae.set(H,Z),Ct({fetchers:new Map(I.fetchers)})}function ht(H){let Z=z.get(H);Z&&(Z.abort(),z.delete(H))}function Nt(H){for(let Z of H){let ie=ft(Z),we=zi(ie.data);I.fetchers.set(Z,we)}}function jt(){let H=[],Z=!1;for(let ie of re){let we=I.fetchers.get(ie);Wt(we,"Expected fetcher: "+ie),we.state==="loading"&&(re.delete(ie),H.push(ie),Z=!0)}return Nt(H),Z}function V(H){let Z=[];for(let[ie,we]of W)if(we<H){let Te=I.fetchers.get(ie);Wt(Te,"Expected fetcher: "+ie),Te.state==="loading"&&(ht(ie),W.delete(ie),Z.push(ie))}return Nt(Z),Z.length>0}function Me(H,Z){let ie=I.blockers.get(H)||sa;return He.get(H)!==Z&&He.set(H,Z),ie}function ze(H){I.blockers.delete(H),He.delete(H)}function wt(H,Z){let ie=I.blockers.get(H)||sa;Wt(ie.state==="unblocked"&&Z.state==="blocked"||ie.state==="blocked"&&Z.state==="blocked"||ie.state==="blocked"&&Z.state==="proceeding"||ie.state==="blocked"&&Z.state==="unblocked"||ie.state==="proceeding"&&Z.state==="unblocked","Invalid blocker state transition: "+ie.state+" -> "+Z.state);let we=new Map(I.blockers);we.set(H,Z),Ct({blockers:we})}function Bt(H){let{currentLocation:Z,nextLocation:ie,historyAction:we}=H;if(He.size===0)return;He.size>1&&xs(!1,"A router only supports one blocker at a time");let Te=Array.from(He.entries()),[Ae,$e]=Te[Te.length-1],Ie=I.blockers.get(Ae);if(!(Ie&&Ie.state==="proceeding")&&$e({currentLocation:Z,nextLocation:ie,historyAction:we}))return Ae}function Zt(H){let Z=dr(404,{pathname:H}),ie=d||l,{matches:we,route:Te}=Ey(ie);return Vt(),{notFoundMatches:we,route:Te,error:Z}}function Vt(H){let Z=[];return je.forEach((ie,we)=>{(!H||H(we))&&(ie.cancel(),Z.push(we),je.delete(we))}),Z}function ke(H,Z,ie){if(S=H,j=Z,C=ie||null,!A&&I.navigation===Qd){A=!0;let we=yn(I.location,I.matches);we!=null&&Ct({restoreScrollPosition:we})}return()=>{S=null,j=null,C=null}}function Qe(H,Z){return C&&C(H,Z.map(we=>nN(we,I.loaderData)))||H.key}function cn(H,Z){if(S&&j){let ie=Qe(H,Z);S[ie]=j()}}function yn(H,Z){if(S){let ie=Qe(H,Z),we=S[ie];if(typeof we=="number")return we}return null}function un(H,Z,ie){if(y)if(H){if(Object.keys(H[0].params).length>0)return{active:!0,matches:bc(Z,ie,f,!0)}}else return{active:!0,matches:bc(Z,ie,f,!0)||[]};return{active:!1,matches:null}}async function on(H,Z,ie,we){if(!y)return{type:"success",matches:H};let Te=H;for(;;){let Ae=d==null,$e=d||l,Ie=c;try{await y({signal:ie,path:Z,matches:Te,fetcherKey:we,patch:(Oe,ct)=>{ie.aborted||Sy(Oe,ct,$e,Ie,a)}})}catch(Oe){return{type:"error",error:Oe,partialMatches:Te}}finally{Ae&&!ie.aborted&&(l=[...l])}if(ie.aborted)return{type:"aborted"};let Ue=gs($e,Z,f);if(Ue)return{type:"success",matches:Ue};let Fe=bc($e,Z,f,!0);if(!Fe||Te.length===Fe.length&&Te.every((Oe,ct)=>Oe.route.id===Fe[ct].route.id))return{type:"success",matches:null};Te=Fe}}function wn(H){c={},d=Fc(H,a,void 0,c)}function xn(H,Z){let ie=d==null;Sy(H,Z,d||l,c,a),ie&&(l=[...l],Ct({}))}return _={get basename(){return f},get future(){return g},get state(){return I},get routes(){return l},get window(){return t},initialize:et,subscribe:bt,enableScrollRestoration:ke,navigate:kt,fetch:At,revalidate:Ve,createHref:H=>e.history.createHref(H),encodeLocation:H=>e.history.encodeLocation(H),getFetcher:ft,deleteFetcher:Rt,dispose:ot,getBlocker:Me,deleteBlocker:ze,patchRoutes:xn,_internalFetchControllers:z,_internalActiveDeferreds:je,_internalSetRoutes:wn},_}function EN(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function rf(e,t,n,s,a,c,l,d){let f,p;if(l){f=[];for(let g of t)if(f.push(g),g.route.id===l){p=g;break}}else f=t,p=t[t.length-1];let y=Hf(a||".",zf(f,c),Ua(e.pathname,n)||e.pathname,d==="path");if(a==null&&(y.search=e.search,y.hash=e.hash),(a==null||a===""||a===".")&&p){let g=Vf(y.search);if(p.route.index&&!g)y.search=y.search?y.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&g){let b=new URLSearchParams(y.search),k=b.getAll("index");b.delete("index"),k.filter(C=>C).forEach(C=>b.append("index",C));let S=b.toString();y.search=S?"?"+S:""}}return s&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Gi([n,y.pathname])),Ba(y)}function wy(e,t,n,s){if(!s||!EN(s))return{path:n};if(s.formMethod&&!WN(s.formMethod))return{path:n,error:dr(405,{method:s.formMethod})};let a=()=>({path:n,error:dr(400,{type:"invalid-body"})}),c=s.formMethod||"get",l=e?c.toUpperCase():c.toLowerCase(),d=Tx(n);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!Kr(l))return a();let b=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((k,S)=>{let[C,j]=S;return""+k+C+"="+j+`
51
+ `},""):String(s.body);return{path:n,submission:{formMethod:l,formAction:d,formEncType:s.formEncType,formData:void 0,json:void 0,text:b}}}else if(s.formEncType==="application/json"){if(!Kr(l))return a();try{let b=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:n,submission:{formMethod:l,formAction:d,formEncType:s.formEncType,formData:void 0,json:b,text:void 0}}}catch{return a()}}}Wt(typeof FormData=="function","FormData is not available in this environment");let f,p;if(s.formData)f=of(s.formData),p=s.formData;else if(s.body instanceof FormData)f=of(s.body),p=s.body;else if(s.body instanceof URLSearchParams)f=s.body,p=jy(f);else if(s.body==null)f=new URLSearchParams,p=new FormData;else try{f=new URLSearchParams(s.body),p=jy(f)}catch{return a()}let y={formMethod:l,formAction:d,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(Kr(y.formMethod))return{path:n,submission:y};let g=Ki(n);return t&&g.search&&Vf(g.search)&&f.append("index",""),g.search="?"+f,{path:Ba(g),submission:y}}function by(e,t,n){n===void 0&&(n=!1);let s=e.findIndex(a=>a.route.id===t);return s>=0?e.slice(0,n?s+1:s):e}function xy(e,t,n,s,a,c,l,d,f,p,y,g,b,k,S,C){let j=C?Sr(C[1])?C[1].error:C[1].data:void 0,A=e.createURL(t.location),L=e.createURL(a),M=n;c&&t.errors?M=by(n,Object.keys(t.errors)[0],!0):C&&Sr(C[1])&&(M=by(n,C[0]));let O=C?C[1].statusCode:void 0,q=l&&O&&O>=400,_=M.filter((F,D)=>{let{route:P}=F;if(P.lazy)return!0;if(P.loader==null)return!1;if(c)return sf(P,t.loaderData,t.errors);if(RN(t.loaderData,t.matches[D],F)||f.some($=>$===F.route.id))return!0;let K=t.matches[D],X=F;return ky(F,hn({currentUrl:A,currentParams:K.params,nextUrl:L,nextParams:X.params},s,{actionResult:j,actionStatus:O,defaultShouldRevalidate:q?!1:d||A.pathname+A.search===L.pathname+L.search||A.search!==L.search||Nx(K,X)}))}),I=[];return g.forEach((F,D)=>{if(c||!n.some(ee=>ee.route.id===F.routeId)||y.has(D))return;let P=gs(k,F.path,S);if(!P){I.push({key:D,routeId:F.routeId,path:F.path,matches:null,match:null,controller:null});return}let K=t.fetchers.get(D),X=pa(P,F.path),$=!1;b.has(D)?$=!1:p.has(D)?(p.delete(D),$=!0):K&&K.state!=="idle"&&K.data===void 0?$=d:$=ky(X,hn({currentUrl:A,currentParams:t.matches[t.matches.length-1].params,nextUrl:L,nextParams:n[n.length-1].params},s,{actionResult:j,actionStatus:O,defaultShouldRevalidate:q?!1:d})),$&&I.push({key:D,routeId:F.routeId,path:F.path,matches:P,match:X,controller:new AbortController})}),[_,I]}function sf(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let s=t!=null&&t[e.id]!==void 0,a=n!=null&&n[e.id]!==void 0;return!s&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!s&&!a}function RN(e,t,n){let s=!t||n.route.id!==t.route.id,a=e[n.route.id]===void 0;return s||a}function Nx(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ky(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Sy(e,t,n,s,a){var c;let l;if(e){let p=s[e];Wt(p,"No route found to patch children into: routeId = "+e),p.children||(p.children=[]),l=p.children}else l=n;let d=t.filter(p=>!l.some(y=>Px(p,y))),f=Fc(d,a,[e||"_","patch",String(((c=l)==null?void 0:c.length)||"0")],s);l.push(...f)}function Px(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,s)=>{var a;return(a=t.children)==null?void 0:a.some(c=>Px(n,c))}):!1}async function MN(e,t,n){if(!e.lazy)return;let s=await e.lazy();if(!e.lazy)return;let a=n[e.id];Wt(a,"No route found in manifest");let c={};for(let l in s){let f=a[l]!==void 0&&l!=="hasErrorBoundary";xs(!f,'Route "'+a.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!f&&!eN.has(l)&&(c[l]=s[l])}Object.assign(a,c),Object.assign(a,hn({},t(a),{lazy:void 0}))}async function AN(e){let{matches:t}=e,n=t.filter(a=>a.shouldLoad);return(await Promise.all(n.map(a=>a.resolve()))).reduce((a,c,l)=>Object.assign(a,{[n[l].route.id]:c}),{})}async function LN(e,t,n,s,a,c,l,d,f,p){let y=c.map(k=>k.route.lazy?MN(k.route,f,d):void 0),g=c.map((k,S)=>{let C=y[S],j=a.some(L=>L.route.id===k.route.id);return hn({},k,{shouldLoad:j,resolve:async L=>(L&&s.method==="GET"&&(k.route.lazy||k.route.loader)&&(j=!0),j?IN(t,s,k,C,L,p):Promise.resolve({type:en.data,result:void 0}))})}),b=await e({matches:g,request:s,params:c[0].params,fetcherKey:l,context:p});try{await Promise.all(y)}catch{}return b}async function IN(e,t,n,s,a,c){let l,d,f=p=>{let y,g=new Promise((S,C)=>y=C);d=()=>y(),t.signal.addEventListener("abort",d);let b=S=>typeof p!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):p({request:t,params:n.params,context:c},...S!==void 0?[S]:[]),k=(async()=>{try{return{type:"data",result:await(a?a(C=>b(C)):b())}}catch(S){return{type:"error",result:S}}})();return Promise.race([k,g])};try{let p=n.route[e];if(s)if(p){let y,[g]=await Promise.all([f(p).catch(b=>{y=b}),s]);if(y!==void 0)throw y;l=g}else if(await s,p=n.route[e],p)l=await f(p);else if(e==="action"){let y=new URL(t.url),g=y.pathname+y.search;throw dr(405,{method:t.method,pathname:g,routeId:n.route.id})}else return{type:en.data,result:void 0};else if(p)l=await f(p);else{let y=new URL(t.url),g=y.pathname+y.search;throw dr(404,{pathname:g})}Wt(l.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(p){return{type:en.error,result:p}}finally{d&&t.signal.removeEventListener("abort",d)}return l}async function DN(e){let{result:t,type:n}=e;if(Ex(t)){let g;try{let b=t.headers.get("Content-Type");b&&/\bapplication\/json\b/.test(b)?t.body==null?g=null:g=await t.json():g=await t.text()}catch(b){return{type:en.error,error:b}}return n===en.error?{type:en.error,error:new Oc(t.status,t.statusText,g),statusCode:t.status,headers:t.headers}:{type:en.data,data:g,statusCode:t.status,headers:t.headers}}if(n===en.error){if(Ry(t)){var s,a;if(t.data instanceof Error){var c,l;return{type:en.error,error:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}}return{type:en.error,error:new Oc(((s=t.init)==null?void 0:s.status)||500,void 0,t.data),statusCode:Ea(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:en.error,error:t,statusCode:Ea(t)?t.status:void 0}}if(UN(t)){var d,f;return{type:en.deferred,deferredData:t,statusCode:(d=t.init)==null?void 0:d.status,headers:((f=t.init)==null?void 0:f.headers)&&new Headers(t.init.headers)}}if(Ry(t)){var p,y;return{type:en.data,data:t.data,statusCode:(p=t.init)==null?void 0:p.status,headers:(y=t.init)!=null&&y.headers?new Headers(t.init.headers):void 0}}return{type:en.data,data:t}}function _N(e,t,n,s,a,c){let l=e.headers.get("Location");if(Wt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!qf.test(l)){let d=s.slice(0,s.findIndex(f=>f.route.id===n)+1);l=rf(new URL(t.url),d,a,!0,l,c),e.headers.set("Location",l)}return e}function Cy(e,t,n,s){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(qf.test(e)){let c=e,l=c.startsWith("//")?new URL(t.protocol+c):new URL(c);if(a.includes(l.protocol))throw new Error("Invalid redirect location");let d=Ua(l.pathname,n)!=null;if(l.origin===t.origin&&d)return l.pathname+l.search+l.hash}try{let c=s.createURL(e);if(a.includes(c.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Ys(e,t,n,s){let a=e.createURL(Tx(t)).toString(),c={signal:n};if(s&&Kr(s.formMethod)){let{formMethod:l,formEncType:d}=s;c.method=l.toUpperCase(),d==="application/json"?(c.headers=new Headers({"Content-Type":d}),c.body=JSON.stringify(s.json)):d==="text/plain"?c.body=s.text:d==="application/x-www-form-urlencoded"&&s.formData?c.body=of(s.formData):c.body=s.formData}return new Request(a,c)}function of(e){let t=new URLSearchParams;for(let[n,s]of e.entries())t.append(n,typeof s=="string"?s:s.name);return t}function jy(e){let t=new FormData;for(let[n,s]of e.entries())t.append(n,s);return t}function FN(e,t,n,s,a){let c={},l=null,d,f=!1,p={},y=n&&Sr(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let b=g.route.id,k=t[b];if(Wt(!ws(k),"Cannot handle redirect results in processLoaderData"),Sr(k)){let S=k.error;y!==void 0&&(S=y,y=void 0),l=l||{};{let C=ys(e,b);l[C.route.id]==null&&(l[C.route.id]=S)}c[b]=void 0,f||(f=!0,d=Ea(k.error)?k.error.status:500),k.headers&&(p[b]=k.headers)}else $i(k)?(s.set(b,k.deferredData),c[b]=k.deferredData.data,k.statusCode!=null&&k.statusCode!==200&&!f&&(d=k.statusCode),k.headers&&(p[b]=k.headers)):(c[b]=k.data,k.statusCode&&k.statusCode!==200&&!f&&(d=k.statusCode),k.headers&&(p[b]=k.headers))}),y!==void 0&&n&&(l={[n[0]]:y},c[n[0]]=void 0),{loaderData:c,errors:l,statusCode:d||200,loaderHeaders:p}}function Ny(e,t,n,s,a,c,l){let{loaderData:d,errors:f}=FN(t,n,s,l);return a.forEach(p=>{let{key:y,match:g,controller:b}=p,k=c[y];if(Wt(k,"Did not find corresponding fetcher result"),!(b&&b.signal.aborted))if(Sr(k)){let S=ys(e.matches,g==null?void 0:g.route.id);f&&f[S.route.id]||(f=hn({},f,{[S.route.id]:k.error})),e.fetchers.delete(y)}else if(ws(k))Wt(!1,"Unhandled fetcher revalidation redirect");else if($i(k))Wt(!1,"Unhandled fetcher deferred data");else{let S=zi(k.data);e.fetchers.set(y,S)}}),{loaderData:d,errors:f}}function Py(e,t,n,s){let a=hn({},t);for(let c of n){let l=c.route.id;if(t.hasOwnProperty(l)?t[l]!==void 0&&(a[l]=t[l]):e[l]!==void 0&&c.route.loader&&(a[l]=e[l]),s&&s.hasOwnProperty(l))break}return a}function Ty(e){return e?Sr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ys(e,t){return(t?e.slice(0,e.findIndex(s=>s.route.id===t)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function Ey(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function dr(e,t){let{pathname:n,routeId:s,method:a,type:c,message:l}=t===void 0?{}:t,d="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(d="Bad Request",a&&n&&s?f="You made a "+a+' request to "'+n+'" but '+('did not provide a `loader` for route "'+s+'", ')+"so there is no way to handle the request.":c==="defer-action"?f="defer() is not supported in actions":c==="invalid-body"&&(f="Unable to encode submission body")):e===403?(d="Forbidden",f='Route "'+s+'" does not match URL "'+n+'"'):e===404?(d="Not Found",f='No route matches URL "'+n+'"'):e===405&&(d="Method Not Allowed",a&&n&&s?f="You made a "+a.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+s+'", ')+"so there is no way to handle the request.":a&&(f='Invalid request method "'+a.toUpperCase()+'"')),new Oc(e||500,d,new Error(f),!0)}function Zl(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[s,a]=t[n];if(ws(a))return{key:s,result:a}}}function Tx(e){let t=typeof e=="string"?Ki(e):e;return Ba(hn({},t,{hash:""}))}function ON(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function BN(e){return Ex(e.result)&&CN.has(e.result.status)}function $i(e){return e.type===en.deferred}function Sr(e){return e.type===en.error}function ws(e){return(e&&e.type)===en.redirect}function Ry(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function UN(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Ex(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function WN(e){return SN.has(e.toLowerCase())}function Kr(e){return xN.has(e.toLowerCase())}async function zN(e,t,n,s,a){let c=Object.entries(t);for(let l=0;l<c.length;l++){let[d,f]=c[l],p=e.find(b=>(b==null?void 0:b.route.id)===d);if(!p)continue;let y=s.find(b=>b.route.id===p.route.id),g=y!=null&&!Nx(y,p)&&(a&&a[p.route.id])!==void 0;$i(f)&&g&&await $f(f,n,!1).then(b=>{b&&(t[d]=b)})}}async function HN(e,t,n){for(let s=0;s<n.length;s++){let{key:a,routeId:c,controller:l}=n[s],d=t[a];e.find(p=>(p==null?void 0:p.route.id)===c)&&$i(d)&&(Wt(l,"Expected an AbortController for revalidating fetcher deferred result"),await $f(d,l.signal,!0).then(p=>{p&&(t[a]=p)}))}}async function $f(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:en.data,data:e.deferredData.unwrappedData}}catch(a){return{type:en.error,error:a}}return{type:en.data,data:e.deferredData.data}}}function Vf(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function pa(e,t){let n=typeof t=="string"?Ki(t).search:t.search;if(e[e.length-1].route.index&&Vf(n||""))return e[e.length-1];let s=Sx(e);return s[s.length-1]}function My(e){let{formMethod:t,formAction:n,formEncType:s,text:a,formData:c,json:l}=e;if(!(!t||!n||!s)){if(a!=null)return{formMethod:t,formAction:n,formEncType:s,formData:void 0,json:void 0,text:a};if(c!=null)return{formMethod:t,formAction:n,formEncType:s,formData:c,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:s,formData:void 0,json:l,text:void 0}}}function Yd(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function qN(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function oa(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function $N(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function zi(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function VN(e,t){try{let n=e.sessionStorage.getItem(jx);if(n){let s=JSON.parse(n);for(let[a,c]of Object.entries(s||{}))c&&Array.isArray(c)&&t.set(a,new Set(c||[]))}}catch{}}function GN(e,t){if(t.size>0){let n={};for(let[s,a]of t)n[s]=[...a];try{e.sessionStorage.setItem(jx,JSON.stringify(n))}catch(s){xs(!1,"Failed to save applied view transitions in sessionStorage ("+s+").")}}}/**
52
+ * React Router v6.30.3
53
+ *
54
+ * Copyright (c) Remix Software Inc.
55
+ *
56
+ * This source code is licensed under the MIT license found in the
57
+ * LICENSE.md file in the root directory of this source tree.
58
+ *
59
+ * @license MIT
60
+ */function Bc(){return Bc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Bc.apply(this,arguments)}const nu=v.createContext(null),Rx=v.createContext(null),Wa=v.createContext(null),Gf=v.createContext(null),xi=v.createContext({outlet:null,matches:[],isDataRoute:!1}),Mx=v.createContext(null);function za(){return v.useContext(Gf)!=null}function Xr(){return za()||Wt(!1),v.useContext(Gf).location}function Ax(e){v.useContext(Wa).static||v.useLayoutEffect(e)}function Wn(){let{isDataRoute:e}=v.useContext(xi);return e?aP():KN()}function KN(){za()||Wt(!1);let e=v.useContext(nu),{basename:t,future:n,navigator:s}=v.useContext(Wa),{matches:a}=v.useContext(xi),{pathname:c}=Xr(),l=JSON.stringify(zf(a,n.v7_relativeSplatPath)),d=v.useRef(!1);return Ax(()=>{d.current=!0}),v.useCallback(function(p,y){if(y===void 0&&(y={}),!d.current)return;if(typeof p=="number"){s.go(p);return}let g=Hf(p,JSON.parse(l),c,y.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Gi([t,g.pathname])),(y.replace?s.replace:s.push)(g,y.state,y)},[t,s,l,c,e])}const QN=v.createContext(null);function YN(e){let t=v.useContext(xi).outlet;return t&&v.createElement(QN.Provider,{value:e},t)}function Kf(){let{matches:e}=v.useContext(xi),t=e[e.length-1];return t?t.params:{}}function XN(e,t,n,s){za()||Wt(!1);let{navigator:a}=v.useContext(Wa),{matches:c}=v.useContext(xi),l=c[c.length-1],d=l?l.params:{};l&&l.pathname;let f=l?l.pathnameBase:"/";l&&l.route;let p=Xr(),y;y=p;let g=y.pathname||"/",b=g;if(f!=="/"){let C=f.replace(/^\//,"").split("/");b="/"+g.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=gs(e,{pathname:b});return nP(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},d,C.params),pathname:Gi([f,a.encodeLocation?a.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?f:Gi([f,a.encodeLocation?a.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),c,n,s)}function JN(){let e=oP(),t=Ea(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:a},n):null,null)}const ZN=v.createElement(JN,null);class eP extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(xi.Provider,{value:this.props.routeContext},v.createElement(Mx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tP(e){let{routeContext:t,match:n,children:s}=e,a=v.useContext(nu);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(xi.Provider,{value:t},s)}function nP(e,t,n,s){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var c;if(!n)return null;if(n.errors)e=n.matches;else if((c=s)!=null&&c.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,d=(a=n)==null?void 0:a.errors;if(d!=null){let y=l.findIndex(g=>g.route.id&&(d==null?void 0:d[g.route.id])!==void 0);y>=0||Wt(!1),l=l.slice(0,Math.min(l.length,y+1))}let f=!1,p=-1;if(n&&s&&s.v7_partialHydration)for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(p=y),g.route.id){let{loaderData:b,errors:k}=n,S=g.route.loader&&b[g.route.id]===void 0&&(!k||k[g.route.id]===void 0);if(g.route.lazy||S){f=!0,p>=0?l=l.slice(0,p+1):l=[l[0]];break}}}return l.reduceRight((y,g,b)=>{let k,S=!1,C=null,j=null;n&&(k=d&&g.route.id?d[g.route.id]:void 0,C=g.route.errorElement||ZN,f&&(p<0&&b===0?(lP("route-fallback"),S=!0,j=null):p===b&&(S=!0,j=g.route.hydrateFallbackElement||null)));let A=t.concat(l.slice(0,b+1)),L=()=>{let M;return k?M=C:S?M=j:g.route.Component?M=v.createElement(g.route.Component,null):g.route.element?M=g.route.element:M=y,v.createElement(tP,{match:g,routeContext:{outlet:y,matches:A,isDataRoute:n!=null},children:M})};return n&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?v.createElement(eP,{location:n.location,revalidation:n.revalidation,component:C,error:k,children:L(),routeContext:{outlet:null,matches:A,isDataRoute:!0}}):L()},null)}var Lx=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Lx||{}),Ix=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Ix||{});function rP(e){let t=v.useContext(nu);return t||Wt(!1),t}function iP(e){let t=v.useContext(Rx);return t||Wt(!1),t}function sP(e){let t=v.useContext(xi);return t||Wt(!1),t}function Dx(e){let t=sP(),n=t.matches[t.matches.length-1];return n.route.id||Wt(!1),n.route.id}function oP(){var e;let t=v.useContext(Mx),n=iP(Ix.UseRouteError),s=Dx();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function aP(){let{router:e}=rP(Lx.UseNavigateStable),t=Dx(),n=v.useRef(!1);return Ax(()=>{n.current=!0}),v.useCallback(function(a,c){c===void 0&&(c={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Bc({fromRouteId:t},c)))},[e,t])}const Ay={};function lP(e,t,n){Ay[e]||(Ay[e]=!0)}function cP(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function Ha(e){let{to:t,replace:n,state:s,relative:a}=e;za()||Wt(!1);let{future:c,static:l}=v.useContext(Wa),{matches:d}=v.useContext(xi),{pathname:f}=Xr(),p=Wn(),y=Hf(t,zf(d,c.v7_relativeSplatPath),f,a==="path"),g=JSON.stringify(y);return v.useEffect(()=>p(JSON.parse(g),{replace:n,state:s,relative:a}),[p,g,a,n,s]),null}function af(e){return YN(e.context)}function uP(e){let{basename:t="/",children:n=null,location:s,navigationType:a=jn.Pop,navigator:c,static:l=!1,future:d}=e;za()&&Wt(!1);let f=t.replace(/^\/*/,"/"),p=v.useMemo(()=>({basename:f,navigator:c,static:l,future:Bc({v7_relativeSplatPath:!1},d)}),[f,d,c,l]);typeof s=="string"&&(s=Ki(s));let{pathname:y="/",search:g="",hash:b="",state:k=null,key:S="default"}=s,C=v.useMemo(()=>{let j=Ua(y,f);return j==null?null:{location:{pathname:j,search:g,hash:b,state:k,key:S},navigationType:a}},[f,y,g,b,k,S,a]);return C==null?null:v.createElement(Wa.Provider,{value:p},v.createElement(Gf.Provider,{children:n,value:C}))}new Promise(()=>{});function dP(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:v.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
61
+ * React Router DOM v6.30.3
62
+ *
63
+ * Copyright (c) Remix Software Inc.
64
+ *
65
+ * This source code is licensed under the MIT license found in the
66
+ * LICENSE.md file in the root directory of this source tree.
67
+ *
68
+ * @license MIT
69
+ */function Uc(){return Uc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Uc.apply(this,arguments)}function lf(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(a=>[n,a]):[[n,s]])},[]))}function hP(e,t){let n=lf(e);return t&&t.forEach((s,a)=>{n.has(a)||t.getAll(a).forEach(c=>{n.append(a,c)})}),n}const fP="6";try{window.__reactRouterVersion=fP}catch{}function mP(e,t){return TN({basename:void 0,future:Uc({},void 0,{v7_prependBasename:!0}),history:Xj({window:void 0}),hydrationData:pP(),routes:e,mapRouteProperties:dP,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function pP(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Uc({},t,{errors:gP(t.errors)})),t}function gP(e){if(!e)return null;let t=Object.entries(e),n={};for(let[s,a]of t)if(a&&a.__type==="RouteErrorResponse")n[s]=new Oc(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let c=window[a.__subType];if(typeof c=="function")try{let l=new c(a.message);l.stack="",n[s]=l}catch{}}if(n[s]==null){let c=new Error(a.message);c.stack="",n[s]=c}}else n[s]=a;return n}const yP=v.createContext({isTransitioning:!1}),vP=v.createContext(new Map),wP="startTransition",Ly=J1[wP],bP="flushSync",Iy=Yj[bP];function xP(e){Ly?Ly(e):e()}function aa(e){Iy?Iy(e):e()}class kP{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",t(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",n(s))}})}}function SP(e){let{fallbackElement:t,router:n,future:s}=e,[a,c]=v.useState(n.state),[l,d]=v.useState(),[f,p]=v.useState({isTransitioning:!1}),[y,g]=v.useState(),[b,k]=v.useState(),[S,C]=v.useState(),j=v.useRef(new Map),{v7_startTransition:A}=s||{},L=v.useCallback(F=>{A?xP(F):F()},[A]),M=v.useCallback((F,D)=>{let{deletedFetchers:P,flushSync:K,viewTransitionOpts:X}=D;F.fetchers.forEach((ee,te)=>{ee.data!==void 0&&j.current.set(te,ee.data)}),P.forEach(ee=>j.current.delete(ee));let $=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!X||$){K?aa(()=>c(F)):L(()=>c(F));return}if(K){aa(()=>{b&&(y&&y.resolve(),b.skipTransition()),p({isTransitioning:!0,flushSync:!0,currentLocation:X.currentLocation,nextLocation:X.nextLocation})});let ee=n.window.document.startViewTransition(()=>{aa(()=>c(F))});ee.finished.finally(()=>{aa(()=>{g(void 0),k(void 0),d(void 0),p({isTransitioning:!1})})}),aa(()=>k(ee));return}b?(y&&y.resolve(),b.skipTransition(),C({state:F,currentLocation:X.currentLocation,nextLocation:X.nextLocation})):(d(F),p({isTransitioning:!0,flushSync:!1,currentLocation:X.currentLocation,nextLocation:X.nextLocation}))},[n.window,b,y,j,L]);v.useLayoutEffect(()=>n.subscribe(M),[n,M]),v.useEffect(()=>{f.isTransitioning&&!f.flushSync&&g(new kP)},[f]),v.useEffect(()=>{if(y&&l&&n.window){let F=l,D=y.promise,P=n.window.document.startViewTransition(async()=>{L(()=>c(F)),await D});P.finished.finally(()=>{g(void 0),k(void 0),d(void 0),p({isTransitioning:!1})}),k(P)}},[L,l,y,n.window]),v.useEffect(()=>{y&&l&&a.location.key===l.location.key&&y.resolve()},[y,b,a.location,l]),v.useEffect(()=>{!f.isTransitioning&&S&&(d(S.state),p({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),C(void 0))},[f.isTransitioning,S]),v.useEffect(()=>{},[]);let O=v.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:F=>n.navigate(F),push:(F,D,P)=>n.navigate(F,{state:D,preventScrollReset:P==null?void 0:P.preventScrollReset}),replace:(F,D,P)=>n.navigate(F,{replace:!0,state:D,preventScrollReset:P==null?void 0:P.preventScrollReset})}),[n]),q=n.basename||"/",_=v.useMemo(()=>({router:n,navigator:O,static:!1,basename:q}),[n,O,q]),I=v.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return v.useEffect(()=>cP(s,n.future),[s,n.future]),v.createElement(v.Fragment,null,v.createElement(nu.Provider,{value:_},v.createElement(Rx.Provider,{value:a},v.createElement(vP.Provider,{value:j.current},v.createElement(yP.Provider,{value:f},v.createElement(uP,{basename:q,location:a.location,navigationType:a.historyAction,navigator:O,future:I},a.initialized||n.future.v7_partialHydration?v.createElement(CP,{routes:n.routes,future:n.future,state:a}):t))))),null)}const CP=v.memo(jP);function jP(e){let{routes:t,future:n,state:s}=e;return XN(t,void 0,s,n)}var Dy;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Dy||(Dy={}));var _y;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(_y||(_y={}));function NP(e){let t=v.useRef(lf(e)),n=v.useRef(!1),s=Xr(),a=v.useMemo(()=>hP(s.search,n.current?null:t.current),[s.search]),c=Wn(),l=v.useCallback((d,f)=>{const p=lf(typeof d=="function"?d(a):d);n.current=!0,c("?"+p,f)},[c,a]);return[a,l]}const _x=v.createContext(null);function PP(e){if(typeof document>"u")return;const{documentElement:t,body:n}=document;t.dataset.runtimePlatform=e.platform,t.dataset.osFamily=e.ui.osFamily,t.dataset.windowControls=e.ui.windowControlsStyle,t.dataset.viewportClass=e.viewportClass,t.dataset.overlayTitlebar=String(e.ui.prefersOverlayTitlebar),n&&(n.dataset.runtimePlatform=e.platform,n.dataset.osFamily=e.ui.osFamily,n.dataset.windowControls=e.ui.windowControlsStyle,n.dataset.viewportClass=e.viewportClass,n.dataset.overlayTitlebar=String(e.ui.prefersOverlayTitlebar))}function TP(){if(!(typeof window>"u"))return window.innerWidth}function EP({children:e}){const[t,n]=v.useState(()=>TP()),s=v.useMemo(()=>ai({viewportWidth:t}),[t]);return v.useEffect(()=>{if(typeof window>"u")return;function a(){n(window.innerWidth)}return a(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[]),v.useEffect(()=>{PP(s)},[s]),i.jsx(_x.Provider,{value:s,children:e})}function An(){return v.useContext(_x)??ai()}const RP={common:{appName:"CodingNS",loading:"Loading...",retry:"Retry",back:"Back",save:"Save",logout:"Log out",unknown:"Unknown session",close:"Close",cancel:"Cancel",language:"Language"},auth:{loginTitle:"Resume your coding session",loginSubtitle:"INITIALIZING DEVELOPMENT ENVIRONMENT...",serverPreset:"Server Preset",serverCustomOption:"Use custom server",serverAddress:"Server Address",serverPlaceholder:"For example: http://127.0.0.1:3002",serverHint:"Login, realtime messages, and terminals all connect through this host. Point the client at the Host API endpoint such as http://127.0.0.1:3002; frontend dev ports like 4174 or 5173 are not meant for packaged clients and only work for temporary debugging when proxying and CORS are configured correctly.",serverInvalid:"Invalid server address. Check it and try again.",serverCurrent:"Current Server",bootstrapTitle:"Complete the first-time bootstrap",bootstrapSubtitle:"This Host does not have an admin account yet. Create the minimal login entry first.",username:"Username",password:"Password",rememberPassword:"Remember Password",confirmPassword:"Confirm Password",submitLogin:"Enter Workspace",submitBootstrap:"Create Admin Account",bootstrapSuccess:"Bootstrap completed. You can log in now.",bootstrapMismatch:"The two passwords do not match.",authUnavailable:"Host is unreachable right now. Check the server and try again.",logoutSuccess:"The current login state has been cleared.",serverSettings:"Server Settings",serverSettingsTitle:"Server Configuration",saveServerSettings:"Save Settings"},settings:{title:"Settings",appearance:"Appearance",appearanceSectionSummary:"Language, theme, and interface colors",language:"Language",languageDescription:"Choose the display language used by the interface.",theme:"Theme",themeDescription:"Choose the color theme that fits the way you work.",fileManager:"File Manager",showSystemFiles:"Show system files",showSystemFilesDescription:"Display common macOS and Windows system files in the file manager, such as .DS_Store and Thumbs.db. This setting only applies to the current device.",serverConnection:"Server Connection",serverConnectionSectionSummary:"Server address and reconnection behavior",securityPrivacy:"Security & Privacy",securityPrivacySectionSummary:"Session permissions, risk boundaries, and default approval policy",softwareUpdate:"Software Update",softwareUpdateSectionSummary:"Server and client versions",serverAddress:"Server Address",serverDescription:"Login, API requests, and realtime connections all use this Host entry, while the frontend UI is bundled inside the client itself.",releaseChannel:"Release Channel",releaseChannelDescription:"Stable or beta",releaseStable:"Stable",releaseBeta:"Beta",autoReconnect:"Auto Reconnect",autoReconnectDescription:"Retry HTTP and WebSocket links automatically when Host is briefly unavailable.",autoCheckUpdate:"Auto Check Client Updates",autoCheckUpdateDescription:"Clients only",defaultPermissionMode:"Default Session Permissions",defaultPermissionModeDescription:"Controls the default tool permissions for new and resumed sessions. Full access disables approval prompts and should only be used for trusted projects and environments.",permissionModeDefault:"Follow CLI defaults",permissionModeAcceptEdits:"Allow workspace edits without asking",permissionModeBypassPermissions:"Full access without asking",enabled:"Enabled",disabled:"Disabled",serverUpdate:"Server Update",serverUpdateDescription:"",clientUpdate:"Client Update",clientUpdateDescription:"",serverCurrentVersion:"Server Current Version",serverTargetVersion:"Server Target Version",serverPackageName:"npm Package",serverUpdateCommand:"Upgrade Command",serverCheckNow:"Check Server",serverOpenPage:"Open npm",serverLatestUnknown:"Unavailable",serverUpdateReady:"New version found",serverUpToDate:"Up to date",serverCheckFailed:"Check failed",serverOpenPageFailed:"Failed to open page",releaseCurrentVersion:"Current Version",releaseTargetVersion:"Target Version",releaseTargetTag:"Target Tag",releasePublishedAt:"Published At",releaseUnknownVersion:"Unknown",releaseNotes:"What's New",releaseNotesEmpty:"No details",releaseCheckNow:"Check Client",releaseInstallNow:"Install",releaseOpenPage:"Open Release",releaseRollback:"Rollback",releaseUpdateReady:"New version found",releaseUpToDate:"Up to date",releaseCheckFailed:"Check failed",releaseInstallerMissing:"A new version is available, but this release does not include a supported installer yet.",releaseSignatureMissing:"A new version is available, but this release does not provide checksum information yet.",releaseInstallStarted:"Install started",releaseInstallFailed:"Install failed",releasePageOpenFailed:"Failed to open page",releaseRollbackStarted:"Rollback started",releaseRollbackFailed:"Rollback failed",clientUpdateUnsupported:"Install updates are not supported here",logout:"Log out"},home:{title:"Continue from a session, not from a backend table",subtitle:"Pick a workspace and session here first. The real work starts in the next step.",terminalsEntry:"Open Terminal",workspaceSection:"Workspaces",sessionSection:"Recent Sessions",emptyWorkspaces:"No workspace has been imported yet. Import one on the Host side first, and the entry will appear here.",emptySessions:"There is no session to continue in the current workspace yet.",noActivity:"No activity yet"},terminal:{title:"Terminal",heroTitle:"Keep the real PTY on Host, keep the control surface in the workspace",heroSubtitle:"This page does not fake output and does not mix terminal with process management. It only consumes the real terminal stream managed by Host.",workspaceSection:"Workspace & Terminal",workspaceField:"Current Workspace",shellField:"Shell for New Terminal",runtimeField:"Runtime",runtimeAutoOption:"Auto",runtimeAutoShortLabel:"auto",runtimeAutoDescription:"Use the Host default policy for this terminal runtime.",runtimePersistentLabel:"Persistent Session",runtimePersistentShortLabel:"persist",runtimeTmuxDescription:"Use a persistent external session, ideal for development terminals that should stay alive.",runtimeWindowsPersistentDescription:"Use a Windows persistent session backed by ConPTY so the shell can survive Host restarts.",runtimeEmbeddedDescription:"Managed directly by the current Host and useful as the lightweight fallback.",runtimeConptyPowerShellLabel:"PowerShell Persistent",runtimeConptyCmdLabel:"CMD Persistent",runtimeConptyGitBashLabel:"Git Bash Persistent",runtimeMissingDialogTitle:"tmux is not installed on this system",runtimeMissingDialogDescription:"The tmux runtime cannot create a persistent terminal right now. Install tmux first, or temporarily switch to embedded-pty to continue.",runtimeMissingInstallDescription:"Installing tmux is recommended if you want terminals to survive Host restarts.",runtimeMissingInstallMacArm:"macOS (Apple Silicon / Homebrew): arch -arm64 brew install tmux",runtimeMissingInstallMacIntel:"macOS (Intel Mac / Homebrew): brew install tmux",runtimeMissingInstallDebian:"Ubuntu / Debian: sudo apt install tmux",runtimeMissingInstallFedora:"Fedora: sudo dnf install tmux",runtimeMissingFallbackDescription:"If you switch to embedded-pty now, the terminal can still start, but it will not stay as an external persistent session.",runtimeMissingKeepAction:"Not now",runtimeMissingFallbackAction:"Switch to embedded-pty",runtimeMissingFallbackPending:"Switching...",shellUnavailable:"Unavailable",workspaceLoadFailed:"The workspace or terminal list is not available right now.",terminalSection:"Terminal Instances",templateSection:"Command Templates",stageEmptyTitle:"No terminal selected yet",stageEmptySubtitle:"Create a terminal first, or run a command template.",emptyTerminals:"There is no terminal instance in the current workspace yet.",emptyTemplates:"There is no command template in the current workspace yet.",createButton:"Create Terminal",creating:"Creating terminal...",creationPendingDescription:"Host is starting the real PTY. This pane will take over as soon as the stream is ready.",defaultTerminalName:"Workspace Terminal",created:"The terminal has been created and connected to Host.",createFailed:"Failed to create terminal.",closeButton:"Close Terminal",closing:"Closing terminal...",closed:"The terminal close request has been submitted.",closeCompleted:"Terminal closed.",closePendingDescription:"The close request has been sent to Host. The page stays responsive and keeps syncing the final result in the background.",closeSyncDelayed:"Host is still finishing the close in the background. The list will keep syncing on the next refresh.",closeFailed:"Failed to close terminal.",inputLabel:"Send command to current terminal",inputPlaceholder:"For example: npm test",sendButton:"Send to Terminal",inputFailed:"Failed to send terminal input.",outputEmpty:"The terminal is connected, but there is no output yet.",outputTruncated:"Some output exceeded the cache window while disconnected. Only the retained part has been restored.",connectedHint:"Current output is coming from the real PTY stream on Host.",moreActions:"Terminal Actions",duplicateAction:"Duplicate Tab",duplicateSuccess:"A new terminal tab has been created with the same setup.",duplicateFailed:"Failed to duplicate the terminal tab.",disconnectAction:"Disconnect",disconnected:"Terminal connection has been disconnected.",reconnectAction:"Reconnect",reconnectRequested:"Reconnect request sent.",deleteAction:"Delete",deleting:"Deleting terminal...",deleted:"Terminal record deleted.",deletePendingDescription:"The delete request has been sent to Host. The page stays responsive and keeps syncing the list in the background.",deleteSyncDelayed:"Host is still finishing the delete in the background. The list will keep syncing on the next refresh.",deleteFailed:"Failed to delete the terminal record.",closePendingBadge:"Closing",deletePendingBadge:"Deleting",pinAction:"Pin",unpinAction:"Unpin",zoomLabel:"Terminal Zoom",zoomInAction:"Zoom in terminal display",zoomOutAction:"Zoom out terminal display",zoomResetAction:"Reset terminal zoom",toolbarToggleAction:"Open terminal toolbar",mobileSwipeHint:"Swipe left or right to switch terminals",mobileSwipePosition:"{current} / {total}",mobileDrawerAction:"Open quick terminal list",mobileDrawerTitle:"Quick Terminals",mobileDrawerDescription:"Swipe right to reveal the list, then tap to jump to another terminal.",mobilePinnedSectionTitle:"Pinned Terminals",mobileDrawerEmptyTitle:"No terminals yet",mobileDrawerEmptyDescription:"Create one first and the quick switcher will appear here.",mobileCreateSheetTitle:"Create Terminal",mobileCreateShellLabel:"Terminal Type",mobileCreateShellDescription:"Pick the shell for this terminal instead of squeezing desktop dropdowns onto mobile.",mobileCreateRuntimeLabel:"Session Type",mobileCreateRuntimeDescription:"Choose whether this terminal should stay persistent or only live in the current runtime.",mobileCreateLoadingShells:"Loading available terminal types for this system...",mobileCreateConfirm:"Create this terminal",createDialogTitle:"Create Terminal",createDialogShellDescription:"Choose the shell for this terminal before creation. On Windows we should not silently fall back to CMD anymore.",createDialogRuntimeDescription:"Choose whether this terminal should stay persistent or only live in the current runtime.",createDialogConfirm:"Create Terminal",mobileRuntimePersistentTitle:"Persistent Session",mobileRuntimePersistentDescription:"Best for development terminals that should stay alive and reconnect as a recoverable session.",mobileRuntimeSessionTitle:"runtime (current session)",mobileRuntimeSessionDescription:"Managed directly by the current Host. Lighter, but not an external persistent session.",mobileWorkspaceSwitcherPlaceholder:"Choose Workspace",mobileEmptyTitle:"No terminal content yet",mobileEmptyDescription:"Create a terminal first, or swipe right to open the quick list and switch to an existing one.",layoutLabel:"Layout",layoutSingleAction:"Single pane",layoutVerticalAction:"Split left and right",layoutHorizontalAction:"Split top and bottom",saveLogAction:"Save Log",saveLogSuccess:"The terminal log has been saved.",saveLogFailed:"Failed to save the terminal log.",logEmpty:"There is no terminal log to save yet.",bindToPaneAction:"Bind to current pane",bindToPrimaryPaneAction:"Bind to main pane",bindToSecondaryPaneAction:"Bind to side pane",panePrimary:"Main Pane",paneSecondary:"Side Pane",splitEmptySubtitle:"Pick a tab or create a terminal first, then bind it to this pane.",statusBadge:{creating:"starting",running:"running",closed:"closed",error:"error"},recoveryComplete:"Recovered to the terminal from before refresh. Key cached output has been restored.",recoveryTruncated:"Recovered to the previous terminal, but some disconnected output exceeded the cache window.",recoveryIdleClosed:"The previous terminal was auto-closed by Host after being idle too long. You are seeing the output kept before close.",reconnect:"Reconnect",liveConnected:"Live stream connected",templateName:"Template Name",templateCommand:"Main Command",templateArgs:"Arguments (space separated)",templateCreateButton:"Save Template",templateCreated:"The command template has been saved.",templateCreateFailed:"Failed to save the command template.",templateRunSent:"The command template has been sent to the current terminal.",templateRunCreatedTerminal:"The command template started in a new terminal.",templateRunFailed:"Failed to run the command template.",connection:{connected:"Connected",reconnecting:"Reconnecting",reconnect_failed:"Reconnect failed",closed:"Closed"}},conversation:{titleFallback:"Continue Conversation",historyLoading:"Loading message history from Host...",historyLoadingOlder:"Loading older messages...",historyLoadFailed:"Message history is not available right now. Try again later.",timelineEmpty:"There are no messages in this session yet. Your first message will go straight into the Host chain.",rawRefLabel:"Source",copyAction:"Copy",copyContentSuccess:"Content copied.",copyContentFailed:"Failed to copy the content.",loadMore:"Load More",composerPlaceholder:"State the next step clearly. Let the rest continue inside this session.",sendButton:"Send Message",queueTitle:"Queued Messages",queueDescription:"After the current run finishes, these messages will be processed automatically in order.",queueOrderPrefix:"Queue Position",queueStatusQueued:"Queued",queueStatusFailed:"Dispatch Failed",queueDelete:"Delete",queueDeleting:"Deleting",queueImageOnly:"Image attachments only",sendGuidanceButton:"Add Guidance",queueGuidanceButton:"Queue Guidance",queueSteer:"Steer",queueSteering:"Steering",resendButton:"Resend",quickPhraseTrigger:"Quick Phrases",quickPhraseModalTitle:"Quick Phrases",quickPhraseModalDescription:"Keep the prompts you reuse often in one place and drop them straight into the current composer.",quickPhraseCreateLabel:"New Phrase",quickPhraseOpenCreateAction:"Add Phrase",quickPhraseCreateModalTitle:"Create Quick Phrase",quickPhraseCreateModalDescription:"Save a reusable prompt on its own so it is ready across devices whenever you need it.",quickPhraseCreatePlaceholder:"Write a phrase you want to reuse later.",quickPhraseCreateAction:"Add Phrase",quickPhraseListLabel:"Quick phrase list",quickPhraseEmpty:"There are no quick phrases yet. Add the first one you actually reuse.",quickPhraseOrderLabel:"Item {index}",quickPhraseMoveUp:"Move phrase up",quickPhraseMoveDown:"Move phrase down",quickPhraseDelete:"Delete phrase",quickPhraseSaveFailed:"Failed to save quick phrases. Try again later.",sendingState:"Sending",sentState:"Synced",failedState:"Send failed",contextUsageTitle:"Context Usage",contextUsageUnavailable:"Context usage is not available yet",contextUsageEstimated:"Window is estimated",contextUsageCachedTokens:"{count} cached",contextUsageSourceProviderLog:"window from provider log",contextUsageSourceProviderRuntime:"window from provider runtime",contextUsageSourceProviderConfig:"window from provider config",contextUsageSourceModelMap:"window from model map",headerWorkspace:"Workspace",headerProvider:"Provider",headerCapability:"Capability Summary",connectionConnected:"Connected",connectionReconnecting:"Reconnecting",connectionReconnectFailed:"Reconnect failed",connectionClosed:"Connection closed",runtimeErrorTitle:"Session run failed",permissionRequestSectionTitle:"Pending approvals",permissionRequestSectionDescription:"Provider-side approvals are unified here so you do not need to learn three different dialogs.",permissionRequestToastTitle:"Approval needed",permissionRequestReplyFailed:"Failed to reply to the approval request.",permissionRequestSubmitting:"Submitting...",permissionRequestReasonLabel:"Reason",permissionRequestCommandLabel:"Command",permissionRequestToolLabel:"Tool",permissionRequestCwdLabel:"Working directory",permissionRequestPathsLabel:"Related paths",permissionRequestPermissionsLabel:"Requested permissions",permissionRequestReadLabel:"Read",permissionRequestWriteLabel:"Write",permissionRequestNetworkLabel:"Network",permissionRequestQuestionsLabel:"Questions",permissionRequestDetailLabel:"Details",permissionRequestEmpty:"None",permissionRequestUnknown:"Unknown",permissionRequestKindCommand:"Command",permissionRequestKindFileChange:"File Change",permissionRequestKindPermissions:"Permissions",permissionRequestKindUserInput:"User Input",permissionRequestKindToolCall:"Tool Call",reconnectExplain:"The realtime link is broken. The system is replaying missing messages.",reconnectFailedExplain:"Automatic recovery failed. Retry manually, or reopen the session later.",capabilityDenied:"This action is not supported in the current session.",capabilitySendDisabled:"The current provider does not support sending new messages.",capabilityAttachmentDisabled:"This session does not support attachment input yet.",capabilityInterruptDisabled:"This session does not support interruption.",sidebarTitle:"Current Session Context",sidebarSubtitle:"This sidebar only keeps the minimum capability summary. It does not turn the page into an admin console.",reconnectButton:"Restore Realtime Sync",headerResumedAt:"Last Resumed",headerLastSyncAt:"Last Synced",historyPages:"History Pages",syncStatusIdle:"Sync Idle",syncStatusSyncing:"Syncing",syncStatusError:"Sync Error",capabilityResume:"Resumable",capabilitySend:"Send Enabled",capabilityInterrupt:"Interrupt Enabled",capabilityTools:"Tool Calls",attachmentsLabel:"Attachments",filePanelTitle:"File Manager",filePanelSubtitle:"File capabilities here only serve the current session. This is not a heavy IDE shell.",filePanelNoWorkspace:"There is no selected workspace yet. Browsing or attaching files is unavailable.",filePanelRefresh:"Refresh",filePanelCopyPath:"Copy Path",filePanelCopyAbsolutePath:"Copy Absolute Path",filePanelCopyRelativePath:"Copy Relative Path",filePanelCopyAbsolutePathSuccess:"Absolute path copied.",filePanelCopyRelativePathSuccess:"Relative path copied.",filePanelCopyPathFailed:"Failed to copy the path.",filePanelActionsMenu:"File Actions",filePanelSearchPlaceholder:"Enter a file name or path fragment",filePanelSearchButton:"Search",filePanelShowSearch:"Open Search",filePanelHideSearch:"Hide Search",filePanelSearchEmpty:"No matching files found.",filePanelSearchResults:"Search Results",filePanelSearchFailed:"File search failed. Try again later.",filePanelBrowse:"Workspace Files",filePanelCollapseCurrent:"Collapse Current",filePanelCollapseAll:"Collapse All",filePanelBackDirectory:"Go to Parent",filePanelEmptyDirectory:"There are no files to show in this directory.",filePanelRecentTitle:"Recently Opened",filePanelEmptyRecent:"There is no recently opened file yet.",filePanelContextTitle:"Attached Files",filePanelEmptyContexts:"No file is attached to the current session yet.",filePanelEditorTitle:"Preview & Editor",filePanelEditorPlaceholder:"This is a lightweight text editor, not a full IDE.",filePanelSelectHint:"Pick a file first from browse, search, or recent items.",filePanelUnsupported:"This file cannot be edited directly in the sidebar right now.",filePanelAttach:"Attach to Session",filePanelAttached:"Attached",filePanelDetach:"Detach",filePanelSave:"Save",filePanelSaving:"Saving...",filePanelLoadFailed:"Failed to load the file panel.",filePanelOpenFailed:"Failed to open the file.",filePanelSaveSuccess:"File saved.",filePanelSaveFailed:"Failed to save the file.",fileViewerHint:"Opened in {language} mode. Preview and save after editing are supported.",fileViewerModeLabel:"File View Mode",fileViewerPreview:"Preview",fileViewerCode:"Code",fileViewerEdit:"Edit",fileViewerPlainText:"Plain Text",filePanelAttachSuccess:"The file has been attached to the current session.",filePanelAttachFailed:"Failed to attach the file.",filePanelDetachSuccess:"The file has been detached from the current session.",filePanelDetachFailed:"Failed to detach the file.",filePanelNewFile:"New File",filePanelNewDirectory:"New Directory",filePanelUpload:"Upload File",filePanelDownload:"Download File",filePanelUploadSuccess:"{name} uploaded.",filePanelUploadFailed:"Failed to upload the file.",filePanelDownloadSuccess:"Started downloading {name}.",filePanelDownloadFailed:"Failed to download the file.",filePanelDelete:"Delete",filePanelRenameMove:"Rename / Move",filePanelMutateFailed:"File operation failed. Check the path and current state.",filePanelCreateFilePrompt:"Enter the relative path of the file to create",filePanelCreateDirectoryPrompt:"Enter the relative path of the directory to create",filePanelFilterChanges:"Changes Only",filePanelShowAll:"Show All",filePanelNoChanges:"No changed files.",filePanelBinaryPreview:"Binary files cannot be previewed.",filePanelDeleteConfirm:"Delete this file? {path}",filePanelRenameMovePrompt:"Enter the new relative path",unavailableAction:"Unavailable",roleUser:"User",roleAssistant:"Assistant",roleTool:"Tool",roleSystem:"System"},git:{title:"Git Context",subtitle:"This is the session-side support area. It only handles Git facts inside the current workspace.",loading:"Loading Git context for the current workspace...",refresh:"Refresh",panelLoadFailed:"Git context is not available right now.",ahead:"Ahead",behind:"Behind",dirty:"Dirty",clean:"Clean",changeCount:"{count} changed files in the current workspace",noChanges:"There are no pending changes right now.",changesTitle:"Current Changes",rulesFirstHint:"Rules come first. Drafts must not bypass validation.",stage:"Stage",unstage:"Unstage",preview:"Preview",stageFailed:"Stage operation failed.",diffTitle:"Diff Preview",diffLoadFailed:"Diff content is not available right now.",binaryDiff:"This file is a binary change. The sidebar does not render its content directly.",stagedDiff:"Staged diff",worktreeDiff:"Working tree diff",emptyDiff:"There is no text diff to display right now.",diffTruncated:"The diff is too long and has been truncated for safety.",commitTitle:"Commit Draft",defaultRuleName:"Default Commit Rule",language:"Language",maxLength:"Max Length",bodyRequired:"Body Required",bodyOptional:"Body Optional",issueRequired:"Issue Required",issueOptional:"Issue Optional",commitSubject:"Commit Subject",commitSubjectPlaceholder:"Enter the commit message here",commitBody:"Commit Body",commitBodyPlaceholder:"Explain the change clearly. Do not write empty words.",commitFooter:"Commit Footer",commitFooterPlaceholder:"For example: Refs: #123",generateDraft:"AI Draft",validate:"Validate Draft",commit:"Commit",draftFailed:"Failed to generate the commit draft.",validateFailed:"Commit rule validation failed.",commitFailed:"Commit failed.",commitSuccess:"The commit has been written to the current repository.",validationPassed:"Rule validation passed. You can continue to commit.",validationFailed:"Rule validation failed. Fix the issues below first.",branchTitle:"Branch",branchPlaceholder:"Enter the branch name to switch to or create",switchBranch:"Switch",createBranch:"Create",branchFailed:"Branch operation failed.",historyTitle:"Recent History",historyHint:"Only keep the latest few entries here. This is not a graphical history tree.",noHistory:"There is no commit history to show right now.",remoteTitle:"Remote Sync",remoteReady:"A remote is configured for the current repository.",remoteMissing:"The current repository has no remote configured yet.",fetch:"Fetch",pull:"Pull",push:"Push",pushNow:"Push Now",publish:"Publish",remoteFailed:"Remote sync failed.",selectRemoteTitle:"Select Remote to Push",selectRemoteDesc:"Select remote repositories to push to. Multiple selection supported.",noRemotes:"No remote repositories are configured.",pushSelected:"Push ({count})",pushing:"Pushing…",pushAllSuccess:"Successfully pushed to {count} remote(s).",errors:{unauthorized:"The current login is no longer valid. Log in again and retry.",workspaceNotFound:"The workspace bound to the current session does not exist. Check whether it is still available.",invalidWorkspace:"The current workspace config is invalid. The Git sidebar must not operate outside the repo root.",notGitRepository:"The current workspace is not a Git repository. The Git sidebar will not fake a state.",repoNotFound:"No usable Git repository root was found for the current workspace.",pathOutOfWorkspace:"The Git target is outside the current workspace repository boundary. The operation was blocked.",invalidTarget:"The Git target path is invalid. Refresh the sidebar and try again.",notStaged:"The target file is not staged yet. Check the current change state first.",emptyStagedChanges:"The staging area is empty. Stage the changes before committing.",branchConflict:"The current branch has conflicts or is not a fast-forward update. Sync and resolve differences first.",branchNotFound:"The target branch does not exist. Check the branch name first.",remoteNotFound:"The current repository does not have a usable origin remote yet.",remoteAuthFailed:"Remote repository authentication failed. Check the current credentials first.",pushFailed:"Push failed. Check remote state and local commits first.",pullFailed:"Pull failed. Check the remote branch state first.",remoteFailed:"Remote sync failed. Check Git output and network state.",commitValidationFailed:"The commit draft has not passed validation yet. Fix validation issues first.",commandTimeout:"The Git operation timed out. Check repository state and network conditions."}},theme:{light:"浅色",dark:"深色",skyBlue:"赛博",eyeGreen:"护眼",switchLabel:"Theme"},locale:{zhCN:"Simplified Chinese",enUS:"English"}},MP={common:{appName:"CodingNS",loading:"正在准备会话工作区…",retry:"重新尝试",back:"返回",save:"保存",close:"关闭",cancel:"取消",logout:"退出登录",unknown:"未命名会话"},auth:{loginTitle:"继续你的编码会话",loginSubtitle:"INITIALIZING DEVELOPMENT ENVIRONMENT...",serverPreset:"服务器列表",serverCustomOption:"使用自定义服务器",serverAddress:"服务器地址",serverPlaceholder:"例如:http://127.0.0.1:3002",serverHint:"登录、实时消息和终端都会连接到这里。客户端应填写 Host API 地址,例如 http://127.0.0.1:3002;4174、5173 这类前端开发端口不是给正式客户端直接连接的,只有代理和跨域都配好时才适合临时调试。",serverInvalid:"服务器地址无效,请检查后再试。",serverCurrent:"当前服务器",bootstrapTitle:"先完成首次初始化",bootstrapSubtitle:"这个 Host 还没有管理员账号,先创建一个最小登录入口。",username:"用户名",password:"密码",rememberPassword:"保存密码",confirmPassword:"确认密码",submitLogin:"进入工作台",submitBootstrap:"创建管理员账号",bootstrapSuccess:"初始化完成,现在可以登录了。",bootstrapMismatch:"两次输入的密码不一致。",authUnavailable:"暂时连不上 Host,请确认服务可访问。",logoutSuccess:"当前登录态已经清空。",serverSettings:"服务器设置",serverSettingsTitle:"服务器配置",saveServerSettings:"保存设置"},settings:{title:"设置",appearance:"外观",appearanceSectionSummary:"语言、主题与界面配色",language:"语言",languageDescription:"选择界面显示语言,切换后立即应用到当前页面。",theme:"主题",themeDescription:"选择适合你的界面配色方案",fileManager:"文件管理",showSystemFiles:"显示系统文件",showSystemFilesDescription:"在文件管理里显示 macOS 和 Windows 常见的系统文件,例如 .DS_Store、Thumbs.db。这个开关只影响当前设备。",serverConnection:"服务器连接",serverConnectionSectionSummary:"服务器地址与连接恢复策略",securityPrivacy:"安全与隐私",securityPrivacySectionSummary:"会话权限、风险边界与默认授权策略",softwareUpdate:"软件更新",softwareUpdateSectionSummary:"服务端和客户端版本",serverAddress:"服务器地址",serverDescription:"客户端的登录、接口请求和实时连接都通过这个 Host 入口工作;前端界面资源由应用自身携带。",releaseChannel:"发布通道",releaseChannelDescription:"稳定版或测试版",releaseStable:"稳定版",releaseBeta:"测试版",autoReconnect:"自动重连",autoReconnectDescription:"当 Host 短暂不可达时,自动尝试恢复 HTTP 和 WebSocket 链路。",autoCheckUpdate:"自动检查客户端更新",autoCheckUpdateDescription:"仅客户端",defaultPermissionMode:"默认会话权限",defaultPermissionModeDescription:"控制新建和继续会话时默认使用的工具权限。完整权限会关闭询问,只适合你已经信任当前项目和运行环境时使用。",permissionModeDefault:"跟随 CLI 默认策略",permissionModeAcceptEdits:"允许编辑工作区,不询问",permissionModeBypassPermissions:"完整权限,不询问",enabled:"已启用",disabled:"已关闭",serverUpdate:"服务端更新",serverUpdateDescription:"",clientUpdate:"客户端更新",clientUpdateDescription:"",serverCurrentVersion:"服务端当前版本",serverTargetVersion:"服务端目标版本",serverPackageName:"npm 包名",serverUpdateCommand:"升级命令",serverCheckNow:"检查服务端",serverOpenPage:"打开 npm",serverLatestUnknown:"暂未获取",serverUpdateReady:"发现新版本",serverUpToDate:"已是最新版本",serverCheckFailed:"检查失败",serverOpenPageFailed:"打开页面失败",releaseCurrentVersion:"当前版本",releaseTargetVersion:"目标版本",releaseTargetTag:"目标 Tag",releasePublishedAt:"发布时间",releaseUnknownVersion:"未知",releaseNotes:"更新内容",releaseNotesEmpty:"暂无更新内容",releaseCheckNow:"检查客户端",releaseInstallNow:"安装更新",releaseOpenPage:"打开发布页",releaseRollback:"回退版本",releaseUpdateReady:"发现新版本",releaseUpToDate:"已是最新版本",releaseCheckFailed:"检查失败",releaseInstallerMissing:"有新版本,暂无安装包",releaseSignatureMissing:"有新版本,缺少校验信息",releaseInstallStarted:"安装已开始",releaseInstallFailed:"安装失败",releasePageOpenFailed:"打开页面失败",releaseRollbackStarted:"已开始回退",releaseRollbackFailed:"回退失败",clientUpdateUnsupported:"当前不支持安装更新",logout:"退出登录"},home:{title:"从一条会话继续,而不是从后台表格开始",subtitle:"这里先挑一个工作区和会话,真正的工作区在下一步。",terminalsEntry:"进入终端页",workspaceSection:"工作区",sessionSection:"最近会话",emptyWorkspaces:"还没有导入工作区。先在 Host 侧导入后,这里会出现入口。",emptySessions:"当前工作区还没有可继续的会话。",noActivity:"暂时还没有活动"},terminal:{title:"终端",heroTitle:"把真实 PTY 留在 Host,把操作入口留在工作台",heroSubtitle:"这里不伪造输出,不把终端和进程搅在一起,只消费 Host 统一托管的真实终端流。",workspaceSection:"工作区与终端",workspaceField:"当前工作区",shellField:"新终端使用的 Shell",runtimeField:"Runtime",runtimeAutoOption:"自动选择",runtimeAutoShortLabel:"auto",runtimeAutoDescription:"按 Host 默认策略选择当前终端 runtime。",runtimePersistentLabel:"持久会话",runtimePersistentShortLabel:"持久",runtimeTmuxDescription:"持久化外部会话,适合需要后台常驻的开发终端。",runtimeWindowsPersistentDescription:"使用基于 ConPTY 的 Windows 持久化会话,让终端在 Host 重启后仍可继续保留。",runtimeEmbeddedDescription:"由当前 Host 直接托管,适合作为轻量回退方案。",runtimeConptyPowerShellLabel:"PowerShell 持久会话",runtimeConptyCmdLabel:"CMD 持久会话",runtimeConptyGitBashLabel:"Git Bash 持久会话",runtimeMissingDialogTitle:"当前系统没有安装 tmux",runtimeMissingDialogDescription:"tmux runtime 无法继续创建持久化终端。你可以先安装 tmux,或者临时切换到 embedded-pty 继续。",runtimeMissingInstallDescription:"建议优先安装 tmux,这样终端才能在 Host 重启后继续保留。",runtimeMissingInstallMacArm:"macOS(Apple Silicon / Homebrew):arch -arm64 brew install tmux",runtimeMissingInstallMacIntel:"macOS(Intel Mac / Homebrew):brew install tmux",runtimeMissingInstallDebian:"Ubuntu / Debian:sudo apt install tmux",runtimeMissingInstallFedora:"Fedora:sudo dnf install tmux",runtimeMissingFallbackDescription:"如果现在先切到 embedded-pty,本次终端可以继续创建,但它不会作为外部持久会话保留。",runtimeMissingKeepAction:"先不切换",runtimeMissingFallbackAction:"切换到 embedded-pty 并继续",runtimeMissingFallbackPending:"正在切换…",shellUnavailable:"当前不可用",workspaceLoadFailed:"工作区或终端列表暂时没有拉回来。",terminalSection:"终端实例",templateSection:"命令模板",stageEmptyTitle:"还没有选中终端",stageEmptySubtitle:"先创建一个终端,或者运行一个命令模板。",emptyTerminals:"当前工作区还没有终端实例。",emptyTemplates:"当前工作区还没有命令模板。",createButton:"新建终端",creating:"正在创建终端…",creationPendingDescription:"Host 正在启动真实 PTY,连上以后这个窗口会立刻接管显示。",defaultTerminalName:"工作终端",created:"终端已经创建并接入 Host。",createFailed:"终端创建失败。",closeButton:"关闭终端",closing:"正在关闭终端…",closed:"终端关闭请求已经提交。",closeCompleted:"终端已关闭。",closePendingDescription:"关闭请求已经发给 Host,前台不会阻塞,系统会继续同步最终结果。",closeSyncDelayed:"Host 还在后台处理关闭,列表会在后续刷新时继续同步。",closeFailed:"终端关闭失败。",inputLabel:"向当前终端发送命令",inputPlaceholder:"例如:pnpm test",sendButton:"发送到终端",inputFailed:"终端输入发送失败。",outputEmpty:"终端已经连上,但暂时还没有输出。",outputTruncated:"断线期间有一段输出超出缓存窗口,当前只补回了仍保留的部分。",connectedHint:"当前输出来自 Host 真实 PTY 流。",moreActions:"终端操作",duplicateAction:"复制标签",duplicateSuccess:"已按当前终端配置新建一个标签。",duplicateFailed:"复制终端标签失败。",disconnectAction:"断开",disconnected:"终端连接已断开。",reconnectAction:"重连",reconnectRequested:"终端重连请求已发出。",deleteAction:"删除",deleting:"正在删除终端…",deleted:"终端记录已删除。",deletePendingDescription:"删除请求已经发给 Host,前台不会阻塞,系统会在后台继续同步列表。",deleteSyncDelayed:"Host 还在后台处理删除,列表会在后续刷新时继续同步。",deleteFailed:"终端记录删除失败。",closePendingBadge:"关闭中",deletePendingBadge:"删除中",pinAction:"固定",unpinAction:"取消固定",zoomLabel:"终端缩放",zoomInAction:"放大终端显示",zoomOutAction:"缩小终端显示",zoomResetAction:"恢复默认缩放",toolbarToggleAction:"展开终端工具栏",mobileSwipeHint:"左右滑动切换终端",mobileSwipePosition:"{current} / {total}",mobileDrawerAction:"打开快捷终端列表",mobileDrawerTitle:"快捷终端",mobileDrawerDescription:"右滑呼出列表,点一下就切到别的终端。",mobilePinnedSectionTitle:"已固定终端",mobileDrawerEmptyTitle:"当前还没有终端",mobileDrawerEmptyDescription:"先新建一个终端,这里才会出现可切换的列表。",mobileCreateSheetTitle:"新建终端",mobileCreateShellLabel:"终端类型",mobileCreateShellDescription:"先选这次要开的 Shell,别把桌面端那套下拉框搬到手机上。",mobileCreateRuntimeLabel:"会话方式",mobileCreateRuntimeDescription:"再决定它是持久保留,还是只作为当前 runtime 会话。",mobileCreateLoadingShells:"正在读取当前系统可用的终端类型…",mobileCreateConfirm:"创建这个终端",createDialogTitle:"新建终端",createDialogShellDescription:"先选这次要开的 Shell,再创建终端。Windows 下不再偷偷按默认值直接起。",createDialogRuntimeDescription:"再决定它是持久保留,还是只作为当前 runtime 会话。",createDialogConfirm:"创建终端",mobileRuntimePersistentTitle:"持久会话",mobileRuntimePersistentDescription:"适合需要一直挂着的开发终端,创建后会作为可恢复会话保留。",mobileRuntimeSessionTitle:"runtime(当前会话)",mobileRuntimeSessionDescription:"直接由当前 Host 托管,创建更轻,但不会保留成外部持久会话。",mobileWorkspaceSwitcherPlaceholder:"选择项目",mobileEmptyTitle:"这里还没有终端内容",mobileEmptyDescription:"先新建一个终端,或者右滑呼出快捷列表,切到当前工作区已有的终端。",layoutLabel:"分栏布局",layoutSingleAction:"单栏显示",layoutVerticalAction:"左右分栏",layoutHorizontalAction:"上下分栏",saveLogAction:"保存日志",saveLogSuccess:"终端日志已保存。",saveLogFailed:"终端日志保存失败。",logEmpty:"当前终端还没有可保存的日志内容。",bindToPaneAction:"绑定到当前分栏",bindToPrimaryPaneAction:"绑定到主分栏",bindToSecondaryPaneAction:"绑定到副分栏",panePrimary:"主分栏",paneSecondary:"副分栏",splitEmptySubtitle:"先点一个标签,或者新建一个终端,把它绑定到当前分栏。",statusBadge:{creating:"启动中",running:"运行中",closed:"已关闭",error:"异常"},recoveryComplete:"已回到刷新前的终端,缓存内的关键输出已经补回。",recoveryTruncated:"已恢复到上一个终端,但断线期间的部分输出已经超出缓存窗口。",recoveryIdleClosed:"上一个终端已因空闲超时被 Host 自动关闭,你现在看到的是关闭前保留的输出。",reconnect:"手动重连",liveConnected:"实时流已接入",templateName:"模板名称",templateCommand:"主命令",templateArgs:"参数(空格分隔)",templateCreateButton:"保存模板",templateCreated:"命令模板已经保存。",templateCreateFailed:"命令模板保存失败。",templateRunSent:"命令模板已经发送到当前终端。",templateRunCreatedTerminal:"命令模板已在新终端中启动。",templateRunFailed:"命令模板执行失败。",connection:{connected:"已连接",reconnecting:"正在重连",reconnect_failed:"重连失败",closed:"已关闭"}},conversation:{titleFallback:"继续对话",historyLoading:"正在从 Host 拉取消息历史…",historyLoadingOlder:"正在加载更早的消息…",historyLoadFailed:"历史消息暂时没有拉回来,可以稍后再试。",timelineEmpty:"这条会话还没有消息。你发出的第一句话会直接进入 Host 链路。",rawRefLabel:"来源",copyAction:"复制",copyContentSuccess:"内容已复制。",copyContentFailed:"内容复制失败。",loadMore:"加载更多消息",composerPlaceholder:"把下一步交代清楚,剩下的交给这条会话继续跑。",sendButton:"发送消息",queueTitle:"待发队列",queueDescription:"当前这轮结束后,队列里的消息会按顺序自动继续处理。",queueOrderPrefix:"队列序号",queueStatusQueued:"等待中",queueStatusFailed:"发送失败",queueDelete:"删除",queueDeleting:"删除中",queueImageOnly:"仅图片附件",sendGuidanceButton:"追加引导",queueGuidanceButton:"加入队列",queueSteer:"引导",queueSteering:"引导中",resendButton:"重试发送",quickPhraseTrigger:"快捷短语",quickPhraseModalTitle:"快捷短语",quickPhraseModalDescription:"这里集中管理你常用的会话指令,点一下就能直接填回当前输入框。",quickPhraseCreateLabel:"新增短语",quickPhraseOpenCreateAction:"新增短语",quickPhraseCreateModalTitle:"新增快捷短语",quickPhraseCreateModalDescription:"把常用指令单独存起来,后面在任何设备上都能直接复用。",quickPhraseCreatePlaceholder:"输入一条常用短语,保存后下次可以直接复用。",quickPhraseCreateAction:"添加短语",quickPhraseListLabel:"快捷短语列表",quickPhraseEmpty:"还没有可用的快捷短语,先加一条最常用的。",quickPhraseOrderLabel:"第 {index} 条",quickPhraseMoveUp:"上移短语",quickPhraseMoveDown:"下移短语",quickPhraseDelete:"删除短语",quickPhraseSaveFailed:"快捷短语保存失败,请稍后再试。",sendingState:"发送中",sentState:"已同步",failedState:"发送失败",contextUsageTitle:"当前上下文占用",contextUsageUnavailable:"当前上下文占用暂时不可用",contextUsageEstimated:"上限为估算值",contextUsageCachedTokens:"缓存命中 {count}",contextUsageSourceProviderLog:"上限来自 provider 运行日志",contextUsageSourceProviderRuntime:"上限来自 provider runtime",contextUsageSourceProviderConfig:"上限来自 provider 配置",contextUsageSourceModelMap:"上限来自模型映射",headerWorkspace:"工作区",headerProvider:"Provider",headerCapability:"能力摘要",connectionConnected:"已连接",connectionReconnecting:"正在重连",connectionReconnectFailed:"重连失败",connectionClosed:"连接已关闭",runtimeErrorTitle:"会话运行失败",reconnectExplain:"实时链路断开了,系统正在补回缺失消息。",reconnectFailedExplain:"自动恢复没有成功。你可以手动重试,或者稍后重新进入会话。",capabilityDenied:"当前会话不支持这个动作",capabilitySendDisabled:"当前 provider 不支持发送新消息",capabilityAttachmentDisabled:"当前会话还不支持附件输入",capabilityInterruptDisabled:"当前会话不支持中断运行",sidebarTitle:"当前会话上下文",sidebarSubtitle:"这里只保留最小能力摘要,不把页面做成后台控制台。",reconnectButton:"手动恢复实时同步",headerResumedAt:"最近续接",headerLastSyncAt:"最近同步",historyPages:"历史分页",syncStatusIdle:"同步空闲",syncStatusSyncing:"同步中",syncStatusError:"同步异常",capabilityResume:"可续接",capabilitySend:"可发送",capabilityInterrupt:"可中断",capabilityTools:"工具调用",attachmentsLabel:"附件",filePanelTitle:"文件管理",filePanelSubtitle:"这里的文件能力只服务当前会话,不把页面拉成重型 IDE。",filePanelNoWorkspace:"当前还没有选中项目,暂时不能浏览或挂载文件。",filePanelRefresh:"刷新",filePanelCopyPath:"复制路径",filePanelCopyAbsolutePath:"复制绝对路径",filePanelCopyRelativePath:"复制相对路径",filePanelCopyAbsolutePathSuccess:"绝对路径已复制。",filePanelCopyRelativePathSuccess:"相对路径已复制。",filePanelCopyPathFailed:"路径复制失败。",filePanelActionsMenu:"文件操作",filePanelSearchPlaceholder:"输入文件名或路径片段",filePanelSearchButton:"搜索",filePanelShowSearch:"打开搜索",filePanelHideSearch:"收起搜索",filePanelSearchEmpty:"没有找到匹配的文件。",filePanelSearchResults:"搜索结果",filePanelSearchFailed:"文件搜索失败,请稍后再试。",filePanelBrowse:"工作区文件",filePanelCollapseCurrent:"折叠当前选中",filePanelCollapseAll:"全部折叠",filePanelBackDirectory:"返回上级",filePanelEmptyDirectory:"这个目录里暂时没有可显示的文件。",filePanelRecentTitle:"最近打开",filePanelEmptyRecent:"最近还没有打开记录。",filePanelContextTitle:"已挂载文件",filePanelEmptyContexts:"当前会话还没有挂载文件管理。",filePanelEditorTitle:"预览与编辑",filePanelEditorPlaceholder:"这里只做轻量文本编辑,不在这里做完整 IDE。",filePanelSelectHint:"先从目录、搜索或最近打开里选一个文件。",filePanelUnsupported:"这个文件当前不能在侧栏里直接编辑。",filePanelAttach:"挂到会话",filePanelAttached:"已挂载",filePanelDetach:"解绑",filePanelSave:"保存",filePanelSaving:"保存中",filePanelLoadFailed:"文件管理面板加载失败。",filePanelOpenFailed:"文件打开失败。",filePanelSaveSuccess:"文件已经保存。",filePanelSaveFailed:"文件保存失败。",fileViewerHint:"当前以 {language} 模式打开,支持预览与编辑保存。",fileViewerModeLabel:"文件查看模式",fileViewerPreview:"预览",fileViewerCode:"代码",fileViewerEdit:"编辑",fileViewerPlainText:"纯文本",filePanelAttachSuccess:"文件已经挂到当前会话。",filePanelAttachFailed:"文件挂载失败。",filePanelDetachSuccess:"文件已经从当前会话解绑。",filePanelDetachFailed:"文件解绑失败。",filePanelNewFile:"新建文件",filePanelNewDirectory:"新建目录",filePanelUpload:"上传文件",filePanelDownload:"下载文件",filePanelUploadSuccess:"已上传 {name}。",filePanelUploadFailed:"文件上传失败。",filePanelDownloadSuccess:"已开始下载 {name}。",filePanelDownloadFailed:"文件下载失败。",filePanelDelete:"删除",filePanelRenameMove:"重命名/移动",filePanelMutateFailed:"文件操作失败,请检查路径和当前状态。",filePanelCreateFilePrompt:"输入要创建的相对文件路径",filePanelCreateDirectoryPrompt:"输入要创建的相对目录路径",filePanelFilterChanges:"仅显示变更",filePanelShowAll:"显示全部",filePanelNoChanges:"当前没有变更文件。",filePanelBinaryPreview:"二进制文件不支持预览。",filePanelDeleteConfirm:"确认删除这个文件吗?{path}",filePanelRenameMovePrompt:"输入新的相对路径",unavailableAction:"当前不可用",roleUser:"你",roleAssistant:"助手",roleTool:"工具",roleSystem:"系统"},git:{title:"Git 上下文",subtitle:"这里是会话侧边的辅助区,只处理当前工作区里的 Git 事实。",loading:"正在读取当前工作区的 Git 上下文。",refresh:"刷新",panelLoadFailed:"Git 上下文暂时没有加载出来。",ahead:"领先",behind:"落后",dirty:"有改动",clean:"已干净",changeCount:"当前有 {count} 个变更文件",noChanges:"当前没有待处理改动。",changesTitle:"当前变更",rulesFirstHint:"规则先于生成,草稿不能绕过校验。",stage:"暂存",unstage:"取消暂存",preview:"预览",stageFailed:"暂存操作失败。",diffTitle:"差异预览",diffLoadFailed:"差异内容暂时没有拉回来。",binaryDiff:"这个文件是二进制改动,侧栏不直接展示内容。",stagedDiff:"暂存区 diff",worktreeDiff:"工作区 diff",emptyDiff:"当前没有可展示的文本差异。",diffTruncated:"差异内容过长,已经做了截断保护。",commitTitle:"提交草稿",defaultRuleName:"默认提交规则",language:"语言",maxLength:"长度",bodyRequired:"正文必填",bodyOptional:"正文可选",issueRequired:"Issue 必填",issueOptional:"Issue 可选",commitSubject:"提交标题",commitSubjectPlaceholder:"在这里输入提交信息",commitBody:"提交正文",commitBodyPlaceholder:"把这次改动说清楚,别写空话。",commitFooter:"提交脚注",commitFooterPlaceholder:"例如:Refs: #123",generateDraft:"AI 起草",validate:"校验草稿",commit:"执行提交",draftFailed:"提交草稿生成失败。",validateFailed:"提交规则校验失败。",commitFailed:"提交失败。",commitSuccess:"提交已经写入当前仓库。",validationPassed:"规则校验通过,可以继续提交。",validationFailed:"规则校验没有通过,先把下面的问题修掉。",branchTitle:"分支",branchPlaceholder:"输入要切换或创建的分支名",switchBranch:"切换",createBranch:"新建",branchFailed:"分支操作失败。",historyTitle:"最近历史",historyHint:"只放最近几条,不做图形历史树。",noHistory:"当前没有可展示的提交历史。",remoteTitle:"远程同步",remoteReady:"当前仓库已配置远程。",remoteMissing:"当前仓库还没有远程。",fetch:"Fetch",pull:"Pull",push:"Push",pushNow:"立即推送",publish:"Publish",remoteFailed:"远程同步失败。",selectRemoteTitle:"选择推送仓库",selectRemoteDesc:"勾选要推送到的远程仓库,支持多选。",noRemotes:"当前仓库没有配置任何远程仓库。",pushSelected:"推送 ({count})",pushing:"推送中…",pushAllSuccess:"已成功推送到 {count} 个远程仓库。",errors:{unauthorized:"当前登录态已经失效,请重新登录后再试。",workspaceNotFound:"当前会话绑定的工作区不存在,先确认工作区是否还可用。",invalidWorkspace:"当前工作区配置无效,Git 侧栏不能脱离仓库根目录执行。",notGitRepository:"当前工作区不是 Git 仓库,Git 侧栏不会伪造状态。",repoNotFound:"当前工作区找不到可用的 Git 仓库根目录。",pathOutOfWorkspace:"Git 目标超出了当前工作区仓库边界,操作已被拦截。",invalidTarget:"Git 目标路径无效,请先刷新侧栏后重试。",notStaged:"目标文件还不在暂存区里,先确认当前变更状态。",emptyStagedChanges:"暂存区为空,先把要提交的改动放进暂存区。",branchConflict:"当前分支存在冲突或不是快进更新,先同步并处理差异。",branchNotFound:"目标分支不存在,先确认分支名是否正确。",remoteNotFound:"当前仓库还没有可用的 origin 远程,先配置远程再同步。",remoteAuthFailed:"远程仓库认证失败,请先确认当前仓库凭据可用。",pushFailed:"推送失败,请先检查远程状态和本地提交。",pullFailed:"拉取失败,请先确认远程分支状态。",remoteFailed:"远程同步失败,请检查 Git 输出和网络状态。",commitValidationFailed:"提交草稿还没通过规则校验,先把校验问题修掉。",commandTimeout:"Git 操作超时了,先确认仓库状态和网络环境。"}}},AP=[{id:"zh-CN",labelKey:"locale.zhCN"},{id:"en-US",labelKey:"locale.enUS"}];function Qf({variant:e="default",className:t}){const n=uo(a=>a.profile.language);function s(a){a!==n&&_c({language:a}).catch(()=>{})}return i.jsxs("label",{className:`language-switcher language-switcher-${e}${t?` ${t}`:""}`,children:[i.jsx("span",{className:"language-switcher-label",children:h("common.language")}),i.jsx("div",{className:"language-switcher-options",role:"group","aria-label":h("common.language"),children:AP.map(a=>i.jsx("button",{type:"button",className:`language-switcher-option${n===a.id?" active":""}`,"aria-pressed":n===a.id,onClick:()=>s(a.id),children:h(a.labelKey)},a.id))})]})}const LP={common:{close:"关闭",cancel:"取消",logout:"退出登录",language:"语言"},locale:{zhCN:"简体中文",enUS:"English"},settings:{title:"设置",appearance:"外观",language:"语言",languageDescription:"选择界面显示语言,切换后立即应用到当前页面。",theme:"主题",themeDescription:"选择适合你的界面配色方案",connection:"连接与更新",serverAddress:"服务地址",serverDescription:"桌面端和 H5 都通过这个 Host 入口工作。",releaseChannel:"发布通道",releaseChannelDescription:"稳定版或测试版",releaseStable:"Stable",releaseBeta:"Beta",autoReconnect:"自动重连",autoReconnectDescription:"当 Host 短暂不可达时,自动尝试恢复 HTTP 和 WebSocket 链路。",autoCheckUpdate:"自动检查客户端更新",autoCheckUpdateDescription:"仅客户端",enabled:"已启用",disabled:"已关闭",serverUpdate:"服务端更新",serverUpdateDescription:"",clientUpdate:"客户端更新",clientUpdateDescription:"",serverCurrentVersion:"服务端当前版本",serverTargetVersion:"服务端目标版本",serverPackageName:"npm 包名",serverUpdateCommand:"升级命令",serverCheckNow:"检查服务端",serverOpenPage:"打开 npm",serverLatestUnknown:"暂未获取",serverUpdateReady:"发现新版本",serverUpToDate:"已是最新版本",serverCheckFailed:"检查失败",serverOpenPageFailed:"打开页面失败",runtimePlatform:"当前运行平台",runtimePlatformDescription:"用来确认现在是 Web/H5、Desktop、iOS 还是 Android 运行环境。",platformDesktop:"Desktop",platformWeb:"Web",platformIos:"iOS",platformAndroid:"Android",releaseDesktopOnly:"当前是 Web/H5 运行环境,不支持桌面更新。",releaseCurrentVersion:"当前版本",releaseTargetVersion:"目标版本",releaseUnknownVersion:"未知",releaseNotes:"更新内容",releaseNotesEmpty:"暂无更新内容",releaseCheckNow:"检查客户端",releaseInstallNow:"安装更新",releaseRollback:"回退版本",releaseUpdateReady:"发现新版本",releaseUpToDate:"已是最新版本",releaseCheckFailed:"检查失败",releaseInstallStarted:"安装已开始",releaseInstallFailed:"安装失败",releaseRollbackStarted:"已开始回退",releaseRollbackFailed:"回退失败",clientUpdateUnsupported:"当前不支持安装更新",account:"账号",logout:"退出登录",logoutDescription:"退出当前账号并返回登录页面"},shell:{title:"工作台",subtitle:"管理代码项目里的 AI 会话",mobileWorkspacesEntry:"工作区",mobileTerminalsEntry:"终端",mobileSessionsEntry:"对话",mobileToolsEntry:"工具",mobileSettingsEntry:"设置",mobileNavigationAction:"打开工作台菜单",mobileSearchAction:"打开搜索",mobileAuxiliaryAction:"打开工具面板",mobileRevealNavigationAction:"显示主导航",mobileHideNavigationAction:"收起主导航",mobileConversationPreviewTitle:"快速预览",mobileConversationCurrentWorkspaceSection:"当前工作区",mobileConversationCollapsePreviewAction:"收起预览",mobileConversationRestorePreviewAction:"恢复会话预览",iosMoreAction:"更多操作",androidMoreAction:"更多操作",conversationEntry:"对话",terminalsEntry:"终端",searchEntry:"搜索",searchModalTitle:"搜索",searchModalDescription:"支持搜会话标题,或在当前工作区里搜代码文件。",searchModeLabel:"搜索模式",searchModeSessions:"会话",searchModeCode:"代码",searchKeywordLabel:"关键词",searchWorkspaceLabel:"工作区",searchSessionPlaceholder:"输入会话名称、工作区或 provider",searchCodePlaceholder:"输入文件名或路径片段",searchSessionHint:"输入关键词后,这里会立即列出匹配的会话。",searchCodeHint:"选一个工作区,然后搜文件名或路径。",searchSessionEmpty:"没找到匹配的会话。",searchCodeEmpty:"没找到匹配的文件。",searchCodeFailed:"代码搜索失败,请稍后重试。",searchSubmit:"开始搜索",filesEntry:"文件管理",gitEntry:"GIT管理",terminalManagerEntry:"进程管理",workspaceSectionTitle:"工作区",goBack:"后退",goForward:"前进",workspaceCount:"项目",sessionCount:"会话",manageWorkspaceAction:"管理项目",manageWorkspaceTitle:"管理项目",manageWorkspaceDescription:"默认只列出当前已加载的项目,展开后可以查看路径、Git 摘要、代码类型组成,也可以从当前工作台列表里移除。",manageWorkspaceEmpty:"当前没有可管理的项目。",manageWorkspaceLoading:"正在读取项目详情...",manageWorkspaceLoadFailed:"项目详情加载失败",manageWorkspacePathLabel:"路径",manageWorkspaceGitCommitCount:"Git 提交版本数",manageWorkspaceGitInfoLabel:"Git 仓库信息",manageWorkspaceRepoRoot:"仓库根目录",manageWorkspaceCurrentBranch:"当前分支",manageWorkspaceRemoteLabel:"远程",manageWorkspaceNoRemote:"未配置远程",manageWorkspaceNotGit:"当前项目不是 Git 仓库。",manageWorkspaceCodeCompositionLabel:"代码类型组成",manageWorkspaceCodeCompositionFiles:"文件",manageWorkspaceCodeCompositionOther:"其他",manageWorkspaceNoCodeComposition:"暂时没有识别到可统计的代码文件。",manageWorkspaceCodeTruncated:"文件过多,只统计了前 {count} 个可识别文件。",manageWorkspaceRemoveAction:"移除项目",manageWorkspaceRemoving:"移除中...",manageWorkspaceRemoveSuccess:"项目已从当前工作台移除",manageWorkspaceRemoveFailed:"移除项目失败",manageWorkspaceRemoveConfirmTitle:"确认移除项目",manageWorkspaceRemoveConfirmDescription:"这只会把项目从当前工作台列表移除,不会删除任何磁盘数据或历史记录。后续重新加载同一路径时,旧记录会直接恢复显示。",manageWorkspaceRemoveConfirmTarget:"确定移除「{name}」吗?",manageWorkspaceRemoveConfirmAction:"确认移除",importWorkspaceTitle:"添加项目",importWorkspaceHint:"导入本地代码目录",importExpand:"展开",importCollapse:"收起",importPathLabel:"项目路径",importPathPlaceholder:"输入项目文件夹路径",importNameLabel:"项目名称",importNamePlaceholder:"可选",importSubmit:"添加项目",importSubmitting:"添加中...",importChooseFolder:"选择文件夹",importPickFolderFailed:"打开文件夹选择器失败",importDesktopDropHint:"支持把本地项目文件夹直接拖到这个区域",importHint:"输入本地代码目录后就能开始工作",importServerDirectoryHint:"浏览并选择运行服务器上的项目目录",importBrowserTitle:"选择服务器目录",importBrowserDescription:"这里浏览的是项目运行所在服务器上的目录,不是当前设备的本地目录。",importBrowserCurrentPath:"当前目录",importBrowserRoots:"根目录",importBrowserOpenParent:"返回上一级",importBrowserOpenPath:"打开路径",importBrowserCreateDirectory:"新建文件夹",importBrowserCreateDirectoryTitle:"新建文件夹",importBrowserCreateDirectoryDescription:"只在当前服务器目录下新建一层子文件夹,不接受带路径的输入。",importBrowserCreateDirectoryLabel:"文件夹名称",importBrowserCreateDirectoryPlaceholder:"输入新文件夹名称",importBrowserCreateDirectorySuccess:"文件夹已创建",importBrowserCreateDirectoryFailed:"新建文件夹失败",importBrowserCreateDirectorySubmit:"确认新建",importBrowserCreatingDirectory:"新建中...",importBrowserEmpty:"当前目录下没有可选的子目录",importBrowserBrowseFailed:"加载服务器目录失败",importBrowserSubmit:"导入当前目录",importPathRequired:"请输入项目路径",importSuccess:"项目已添加",importFailed:"添加失败",cloneWorkspaceTitle:"Clone项目",cloneWorkspaceHint:"从 Git 仓库拉取代码到服务端目录,完成后直接加入项目列表。",cloneSubmit:"Clone项目",cloneSubmitting:"Clone 中...",cloneRepositoryLabel:"Git 仓库地址",cloneRepositoryPlaceholder:"例如:https://github.com/org/repo.git",cloneParentPathLabel:"目标父目录",cloneParentPathPlaceholder:"选择后端服务上已存在的目录",cloneDirectoryNameLabel:"新项目目录名",cloneDirectoryNamePlaceholder:"留空时默认使用仓库名",clonePickDirectory:"选择目录",cloneAuthModeLabel:"认证方式",cloneAuthModeNone:"无认证",cloneAuthModeBasic:"用户名 + 密码",cloneAuthModeToken:"Token",cloneUsernameLabel:"用户名",cloneUsernamePlaceholder:"输入 Git 用户名",clonePasswordLabel:"密码",clonePasswordPlaceholder:"输入 Git 密码",cloneTokenLabel:"Token",cloneTokenPlaceholder:"输入 access token",cloneTokenUsernamePlaceholder:"可选,留空时默认使用 git",cloneRepoRequired:"请输入 Git 仓库地址",clonePathRequired:"请选择目标父目录",cloneSuccess:"项目已成功 Clone",cloneFailed:"Clone 失败",cloneHint:"目标父目录必须已经存在,Clone 时会在这个目录下新建仓库文件夹。",cloneBrowserTitle:"选择 Clone 目标父目录",cloneBrowserDescription:"这里选的是服务端已存在的父目录,Clone 时会在其下新建一个项目文件夹。",cloneBrowserSubmit:"使用当前目录",refreshNavigation:"刷新",desktopChromeLabel:"桌面工作台",windowMinimize:"最小化窗口",windowMaximize:"最大化或还原窗口",windowClose:"关闭窗口",contextOpenSession:"打开会话",navigationLoadFailed:"加载失败,请重试",emptyNavigationTitle:"还没有项目",emptyNavigationBody:"添加本地代码目录开始工作",emptyWorkspaceSessions:"暂无会话",favoriteSectionTitle:"收藏会话",favoriteSectionEmpty:"收藏后的会话会固定放在这里,方便你快速回到常用链路。",favoriteAction:"收藏会话",unfavoriteAction:"取消收藏",favoriteAdded:"会话已加入收藏",favoriteRemoved:"会话已取消收藏",favoriteToggleFailed:"收藏状态更新失败",sessionMoreAction:"更多操作",sessionStateInferred:"推断",renameAction:"重命名",renameSuccess:"会话名称已更新",renameFailed:"会话重命名失败",renameModalTitle:"重命名会话",renameModalDescription:"改成你自己能一眼认出来的名字,只改标题,不改消息内容。",renameInputLabel:"会话名称",renameInputPlaceholder:"输入新的会话名称",renamingSession:"保存中...",archiveFolderLabel:"归档会话",archiveFolderAction:"打开归档文件夹",archiveAction:"归档会话",archiveCurrentSessionAction:"归档当前会话",archiveAdded:"会话已归档",archiveConfirmTitle:"确认归档会话",archiveConfirmDescription:"归档后,这条会话会从当前工作区主列表里隐藏,你仍然可以在归档区恢复它。",unarchiveAction:"取消归档",archiveRestored:"会话已恢复到主列表",archiveModalTitle:"归档会话",archiveModalDescription:"这里列出当前项目暂时隐藏的会话,需要时可以恢复到主列表。",archiveEmpty:"这个项目还没有归档会话。",subagentBadge:"子代理",subagentExpand:"展开子代理列表",subagentCollapse:"收起子代理列表",subagentExpandMore:"展开更多子代理",favoriteExpandMore:"显示更多收藏",sessionExpandMore:"显示更多会话",archiveExpandMore:"查看更多归档会话",workspaceCollapse:"收起项目",workspaceExpand:"展开项目",switchWorkspace:"切换到此项目",workspaceHomeSwitcherLabel:"切换工作区",workspaceHomeSwitcherTitle:"工作区",workspaceHomeStatusSectionTitle:"当前工作区",workspaceHomeViewAllAction:"查看全部会话",workspaceHomeMetricActive:"活动",workspaceHomeMetricUnread:"待看",workspaceHomeMetricTerminal:"终端",workspaceHomeMetricChanges:"变更",workspaceHomeActiveSessionsSectionTitle:"活动会话",workspaceHomeQuickLaunchStatusLabel:"快捷启动进程",workspaceHomeQuickLaunchRunning:"运行中",workspaceHomeQuickLaunchStopped:"未运行",workspaceHomeWaitingInputLabel:"等待输入",workspaceOverviewTitle:"把项目入口放到看得见的地方",workspaceOverviewBody:"先选项目,再决定是继续已有会话,还是开一条新的工作链路。",workspaceListBody:"这里保留当前工作台里的全部项目,并把高频操作直接放到首页。",workspaceDetailTitle:"项目详情",workspaceDetailSummaryTitle:"项目概览",workspaceDetailSummaryBody:"先看当前项目路径、Git 摘要和代码规模,再决定下一步去哪做事。",workspaceDetailMissingTitle:"没找到这个项目",workspaceDetailMissingBody:"这个项目可能已经被移除,或者当前快照还没加载到它。",workspaceSessionListBody:"项目里的会话、收藏和归档操作都收在这里,不再让你先去翻侧栏。",recentSessionsSectionTitle:"最近会话",recentSessionsSectionBody:"先回到最近在做的事情,别让手机端还要你猜入口。",currentWorkspaceSectionTitle:"当前项目会话",currentWorkspaceSectionBody:"当前项目下的会话都集中在这里,方便继续刚才的上下文。",sessionIndexTitle:"会话入口单独成页",sessionIndexBody:"最近、收藏、当前项目三块分开看,手机上找会话别再靠侧栏折叠。",toolsMoreAction:"更多",toolsSwipeHint:"左右滑动切换文件管理和 Git 管理",toolsSwipePosition:"{current} / {total}",toolFilesBody:"查看项目文件、变更文件和代码上下文,不再靠桌面右栏概念。",toolGitBody:"把当前项目的 Git 状态、提交和分支操作收进一个明确入口。",toolTerminalsBody:"进入终端主页面,处理输入密集和滚动密集的操作。",toolProcessesBody:"查看当前项目的终端模板、运行状态和进程入口。",toolsWorkspaceRequiredBody:"先选一个项目,再打开对应的工具页。",createSession:"新建会话",createSessionModalTitle:"选择新会话类型",createSessionModalDescription:"先选会话类型,再启动真正的会话进程。",createSessionWorkspaceLabel:"选择工作区",createSessionProviderLabel:"选择供应商",createSessionTarget:"当前项目",providerClaudeCode:"Claude Code",providerCodexDescription:"创建 Codex 会话,适合继续当前默认工作流。",providerClaudeDescription:"创建 Claude Code 会话,适合切换另一条会话链路。",providerOpenCodeDescription:"创建 OpenCode 会话,适合通过 OpenCode server 延续当前上下文。",providerOptionHint:"选择后会立即创建会话",startClaude:"Claude",startCodex:"Codex",startingSession:"创建中...",startClaudeSuccess:"Claude 会话已创建",startCodexSuccess:"Codex 会话已创建",startSessionFailed:"创建失败",auxiliaryTitle:"信息",auxiliarySubtitle:"文件与 Git 状态",expandAuxiliary:"展开",collapseAuxiliary:"收起",auxiliaryEmptyTitle:"选择一个会话",auxiliaryEmptyBody:"会话文件和 Git 信息将显示在这里",batchSelectSessions:"批量选择会话",batchSelectionMode:"批量选择",selectAllSessions:"全选",clearSelectedSessions:"清空选择",batchArchiveAction:"归档已选",batchArchiving:"归档中...",batchArchiveSuccess:"已归档选中的会话",batchArchivePartialFailed:"部分会话归档失败,请重试",batchArchiveFailed:"批量归档失败",hideSessionSidebar:"隐藏会话列表",showSessionSidebar:"显示会话列表",hideInfoSidebar:"隐藏信息栏",showInfoSidebar:"显示信息栏",centerTabsLabel:"中间区域标签",infoTabsLabel:"信息栏标签",leftResizerLabel:"调整左侧宽度",rightResizerLabel:"调整右侧宽度",filesPanelEmpty:"先导入或选中一个项目,文件管理才能显示。",gitPanelEmpty:"先导入或选中一个工作区,Git 信息才能显示。",infoPanelDeferred:"左侧会话列表优先加载,右侧附属面板稍后再挂载。"},workbench:{emptyEyebrow:"开始",emptyTitle:"先选一个会话",emptyBody:"从左侧继续之前的内容,或新建一个会话。",emptyResumeTitle:"继续",emptyResumeBody:"回到上次停下的地方。",emptyNewTitle:"新建",emptyNewBody:"把新问题放进新会话。",emptyCompanionTitle:"查看辅助信息",emptyCompanionBody:"需要文件、Git 或终端时,再看右侧。",emptyTip:"准备好后,从左侧选一个会话开始。"},conversation:{resendButton:"重发",historyLoading:"加载中...",historyLoadingOlder:"加载更早的消息...",historyLoadFailed:"加载失败",timelineEmpty:"开始对话",composerPlaceholder:"把下一步交代清楚,剩下的交给这条会话继续跑。",sendButton:"发送消息",attachFiles:"附加文件",attachmentSourceSheetTitle:"添加图片",attachmentSourceSheetDescription:"选择直接拍照,或从相册里挑一张现有图片。",attachmentTakePhoto:"拍照",attachmentTakePhotoHint:"直接打开相机拍一张新图片",attachmentChooseFromLibrary:"从相册选择",attachmentChooseFromLibraryHint:"从手机相册或图片库里挑选",pasteImagesHint:"支持直接粘贴图片",attachmentImageOnly:"目前只支持图片附件",attachmentReadFailed:"图片读取失败,请重试",attachmentPreviewAlt:"已选图片预览",attachmentPreviewOpen:"点击查看大图",attachmentPreviewClose:"关闭图片预览",attachmentPreviewLoading:"图片加载中",attachmentPreviewUnavailable:"图片暂时不可预览",imageAttachmentLabel:"图片附件",imagePreviewTitle:"图片预览",imagePreviewHint:"点击遮罩或按 Esc 可以关闭预览",removeAttachment:"移除附件",modelSelectorLabel:"选择模型",modelUseCliDefault:"默认",modelUseCodexConfig:"跟随当前 Codex 配置",modelUseOpenCodeConfig:"跟随当前 OpenCode 配置",reasoningSelectorLabel:"选择推理强度",reasoningLow:"低",reasoningMedium:"中",reasoningHigh:"高",reasoningMaximum:"极高",slashMenu:"命令",slashMenuTitle:"快捷命令",slashCommandPlan:"先让对方给出执行路线",slashCommandReview:"直接进入代码审查模式",slashCommandExplain:"要求用更清楚的方式解释",toolInputLabel:"输入",toolResultLabel:"结果",toolResultEmpty:"暂无输出",toolPreviewCommand:"命令",toolPreviewTerminal:"终端",toolStatusRunning:"运行中",toolStatusFailed:"已失败",toolStatusCompleted:"已完成",applyPatchEditedLabel:"已编辑",applyPatchAddedLabel:"已新增",applyPatchDeletedLabel:"已删除",applyPatchDialogTitle:"Patch 变更预览",applyPatchDialogDescription:"这里按文件显示 apply_patch 将要执行的变更。",applyPatchOpenDiff:"查看 diff",applyPatchAddedStat:"新增",applyPatchRemovedStat:"减少",applyPatchEmpty:"这个 patch 暂时没有可展示的文件变更。",titleFallback:"继续对话",draftTitleCodex:"New Codex session",draftTitleClaude:"New Claude Code session",draftTitleOpenCode:"New OpenCode session",headerWorkspace:"工作区",headerWorkspaceUnknown:"未知工作区",headerProvider:"Provider",headerConnection:"连接",headerRuntime:"运行态",providerCodex:"Codex",providerClaude:"Claude",providerOpenCode:"OpenCode",capabilitySend:"可发送",queueTitle:"待发队列",queueDescription:"当前运行结束后,会按顺序自动继续处理下面的消息。",queueOrderPrefix:"等待顺序",queueStatusQueued:"等待中",queueStatusFailed:"续跑失败",queueDelete:"删除",queueDeleting:"删除中",permissionRequestSectionTitle:"待处理审批",permissionRequestSectionDescription:"这里把供应商原生的权限申请统一收口,不再让你面对三套不同的确认框。",permissionRequestToastTitle:"需要审批",permissionRequestReplyFailed:"回复权限申请失败。",permissionRequestSubmitting:"提交中...",permissionRequestReasonLabel:"原因",permissionRequestCommandLabel:"命令",permissionRequestToolLabel:"工具",permissionRequestCwdLabel:"工作目录",permissionRequestPathsLabel:"相关路径",permissionRequestPermissionsLabel:"申请权限",permissionRequestReadLabel:"读取",permissionRequestWriteLabel:"写入",permissionRequestNetworkLabel:"网络",permissionRequestQuestionsLabel:"补充问题",permissionRequestDetailLabel:"详情",permissionRequestEmpty:"无",permissionRequestUnknown:"未知",permissionRequestKindCommand:"命令",permissionRequestKindFileChange:"文件改动",permissionRequestKindPermissions:"权限扩展",permissionRequestKindUserInput:"补充输入",permissionRequestKindToolCall:"工具调用",queueImageOnly:"只包含图片附件",sendGuidanceButton:"追加指导",queueGuidanceButton:"加入队列",capabilityDenied:"受限",capabilitySendDisabled:"发送受限",connectionConnected:"实时已连接",connectionReconnecting:"正在重连",connectionReconnectFailed:"重连失败",connectionClosed:"连接已关闭",runtimeIdle:"空闲",runtimeStarting:"启动中",runtimeRunning:"运行中",runtimeReconnecting:"恢复中",runtimeStale:"运行待确认",runtimeUnknown:"状态待确认",runtimeCompleted:"已完成",runtimeInterrupted:"已中断",runtimeFailed:"失败",rulesMessageTitle:"规则信息",rulesMessageHint:"这是一段会话启动规则,默认折叠显示,需要时再展开查看。",rulesMessageExpand:"展开规则",rulesMessageCollapse:"收起规则",thinkingLabel:"思考中",filePanelWorkspaceTab:"工作区",filePanelSessionTab:"本次会话",filePanelSessionViewLabel:"本次会话视图",filePanelSessionTreeView:"树状",filePanelSessionListView:"列表",filePanelSessionLoading:"正在整理本次会话修改的文件...",filePanelSessionEmpty:"这条会话还没识别到可暂存的修改文件。",filePanelSessionNoSession:"当前只选中了项目,还没选中会话,无法查看“本次会话”文件。",filePanelSessionStageAll:"全部暂存",filePanelSessionStageSuccess:"已把本次会话的修改加入暂存区。",filePanelSessionLoadFailed:"本次会话修改文件加载失败。",filePanelSessionSummary:"已识别文件",filePanelSessionUnstagedSummary:"未暂存",filePanelSessionDeleted:"已删除"},git:{recentVersionsTitle:"最近版本",stagedChangesTitle:"暂存的更改",expandRecentVersions:"展开最近版本",collapseRecentVersions:"折叠最近版本",stagedLabel:"暂存区",workingTreeLabel:"工作区",changeTreeHint:"按目录层级展示当前变更",discard:"放弃改动",discardFailed:"放弃改动失败",operationMenu:"操作菜单",currentBranch:"当前分支",resizePanels:"调整文件区和最近版本高度",switchBranchTo:"切换到",undoLastCommit:"撤销上次提交",undoLastCommitFailed:"撤销上次提交失败",undoLastCommitSuccess:"已撤销上次提交",historyKindLocal:"本地",historyKindRemote:"远程",historyKindShared:"已同步",pushNow:"推送",commitNow:"提交",refreshNow:"刷新",stageAll:"暂存全部",unstageAll:"取消暂存全部",discardAll:"放弃全部改动",selectedFiles:"已选文件",clearSelection:"清空选中",selectFile:"选中文件",discardConfirm:"确认放弃这些改动吗?{path}",historyItemMenu:"版本操作",copyCommitHash:"复制 Commit Hash",copyCommitHashSuccess:"Commit Hash 已复制。",copyCommitSubject:"复制提交标题",copyCommitSubjectSuccess:"提交标题已复制。"},terminalManager:{workspaceField:"当前工作区",refresh:"刷新列表",loadFailed:"终端管理面板加载失败",shellLoadFailed:"终端 Shell 列表加载失败",emptyWorkspaceBody:"还没有可用工作区。",noCurrentWorkspaceBody:"先选中一条会话,进程管理才能绑定对应的工作区。",emptyTerminalBody:"当前工作区还没有终端实例。",emptyTemplateBody:"还没有快捷启动项,可以先保存一条命令或脚本。",shellField:"新终端 Shell",shellUnavailable:"当前不可用",cwdField:"启动目录",cwdLabel:"目录",cwdPlaceholder:"留空时默认使用工作区根目录",modeField:"启动方式",commandMode:"命令",scriptMode:"脚本",quickLaunchTitle:"快捷启动",quickLaunchDescription:"先保存启动方式,需要时一键拉起到新终端。",desktopPanelDescription:"默认只看启动决策所需的信息,路径和命令行收进详情层。",runningCountLabel:"运行中",portWatchCountLabel:"已监控端口",terminalCountLabel:"终端数",templateSectionTitle:"启动项",templateSectionDescription:"右侧优先显示启动项的端口状态,看清楚是否已被占用。",openCreateModalAction:"添加快捷启动项",createModalTitle:"添加快捷启动项",createModalDescription:"在这里保存命令或脚本,可以附带端口,后面就能一键启动并判断是否在跑。",editAction:"编辑启动项",editModalTitle:"编辑快捷启动项",editModalDescription:"直接修改这条快捷启动的名称、命令、目录和端口配置。",saveTemplateChangesAction:"保存修改",templateUpdating:"保存修改中...",templateUpdateSuccess:"快捷启动项已更新。",templateUpdateFailed:"快捷启动项更新失败",removeAction:"移除启动项",templateRemoving:"移除中...",removeConfirmTitle:"确认移除启动项",removeConfirmAction:"确认移除",removeConfirmTarget:"确认移除“{name}”吗?移除后将不再出现在快捷启动列表中。",removeRunningConfirmTarget:"“{name}”对应的进程还在跑。现在移除的是启动项配置,不会自动结束已经运行的进程。确认继续吗?",templateDeleteSuccess:"快捷启动项已移除。",templateDeleteFailed:"快捷启动项移除失败",terminalSectionTitle:"终端实例",terminalSectionDescription:"这里显示当前工作区由 CodingNS 托管的终端。",closeAction:"关闭终端",closing:"关闭中...",closeSuccess:"终端关闭请求已提交。",closeFailed:"终端关闭失败",createTerminalAction:"新建空终端",creatingTerminal:"创建中...",createTerminalSuccess:"新终端已创建。",createTerminalFailed:"新终端创建失败",defaultTerminalName:"工作终端",templateNameField:"名称",templateNamePlaceholder:"留空时会自动生成",commandField:"启动命令",commandPlaceholder:"例如:npm",scriptPathField:"脚本路径",scriptPathPlaceholder:"例如:scripts/dev.ps1 或 scripts/dev.sh",argsField:"参数",argsPlaceholder:"例如:run dev 或 --watch",portField:"监听端口",portLabel:"端口",portPlaceholder:"例如:3000",invalidPort:"端口必须是 1 到 65535 的整数",saveLaunchAction:"保存为快速启动",templateSaving:"保存中...",templateSaveSuccess:"快捷启动项已保存。",templateSaveFailed:"快捷启动项保存失败",runTemplateAction:"启动到新终端",runningTemplate:"启动中...",templateRunSuccess:"快捷启动已发送到新终端。",templateRunFailed:"快捷启动执行失败",showDetailsAction:"显示详细信息",hideDetailsAction:"隐藏详细信息",detailsSectionTitle:"启动项详情",commandPreviewLabel:"启动命令",processIdLabel:"进程 ID",processCommandLabel:"进程命令行",stopProcessAction:"结束进程",stoppingProcess:"结束中...",stopProcessSuccess:"监听进程已结束。",stopProcessFailed:"监听进程结束失败",defaultCommandName:"新启动命令",defaultScriptName:"新启动脚本",lastActiveAt:"最近活跃",updatedAt:"最后更新",processCommandFallback:"这个进程没有暴露命令行",portUnset:"未配置端口",portUnsetDescription:"没有端口时,只能启动,不能自动判断服务是否在跑。",portOccupied:"进程已启动",portAvailable:"端口暂未被占用",portAvailableDescription:"这个启动项对应的端口目前还没有监听进程。",statusRunning:"运行中",statusStopped:"未运行",exitCode:"Exit Code",runningValue:"运行中"},theme:{light:"浅色",dark:"深色",skyBlue:"赛博",eyeGreen:"护眼",switchLabel:"主题"}},IP={common:{close:"Close",cancel:"Cancel",logout:"Log out",language:"Language"},locale:{zhCN:"Simplified Chinese",enUS:"English"},settings:{title:"Settings",appearance:"Appearance",language:"Language",languageDescription:"Choose the display language used by the interface. The page updates immediately.",theme:"Theme",themeDescription:"Choose the color theme that fits the way you work.",connection:"Connection & Updates",serverAddress:"Server Address",serverDescription:"Desktop and H5 both work through this host entry.",releaseChannel:"Release Channel",releaseChannelDescription:"Stable or beta",releaseStable:"Stable",releaseBeta:"Beta",autoReconnect:"Auto Reconnect",autoReconnectDescription:"Retry HTTP and WebSocket links automatically when Host is briefly unavailable.",autoCheckUpdate:"Auto Check Client Updates",autoCheckUpdateDescription:"Clients only",enabled:"Enabled",disabled:"Disabled",serverUpdate:"Server Update",serverUpdateDescription:"",clientUpdate:"Client Update",clientUpdateDescription:"",serverCurrentVersion:"Server Current Version",serverTargetVersion:"Server Target Version",serverPackageName:"npm Package",serverUpdateCommand:"Upgrade Command",serverCheckNow:"Check Server",serverOpenPage:"Open npm",serverLatestUnknown:"Unavailable",serverUpdateReady:"New version found",serverUpToDate:"Up to date",serverCheckFailed:"Check failed",serverOpenPageFailed:"Failed to open page",runtimePlatform:"Runtime Platform",runtimePlatformDescription:"Shows whether the app is running in Web/H5, Desktop, iOS, or Android.",platformDesktop:"Desktop",platformWeb:"Web",platformIos:"iOS",platformAndroid:"Android",releaseDesktopOnly:"Desktop updates are not available in the current Web/H5 runtime.",releaseCurrentVersion:"Current Version",releaseTargetVersion:"Target Version",releaseUnknownVersion:"Unknown",releaseNotes:"What's New",releaseNotesEmpty:"No details",releaseCheckNow:"Check Client",releaseInstallNow:"Install",releaseRollback:"Rollback",releaseUpdateReady:"New version found",releaseUpToDate:"Up to date",releaseCheckFailed:"Check failed",releaseInstallStarted:"Install started",releaseInstallFailed:"Install failed",releaseRollbackStarted:"Rollback started",releaseRollbackFailed:"Rollback failed",clientUpdateUnsupported:"Install updates are not supported here",account:"Account",logout:"Log out",logoutDescription:"Sign out of the current account and return to the login page."},shell:{title:"Workbench",subtitle:"Manage AI sessions inside code projects",mobileWorkspacesEntry:"Workspaces",mobileTerminalsEntry:"Terminal",mobileSessionsEntry:"Conversation",mobileToolsEntry:"Tools",mobileSettingsEntry:"Settings",mobileNavigationAction:"Open workbench menu",mobileSearchAction:"Open search",mobileAuxiliaryAction:"Open tools panel",mobileRevealNavigationAction:"Show primary navigation",mobileHideNavigationAction:"Hide primary navigation",mobileConversationPreviewTitle:"Quick Preview",mobileConversationCurrentWorkspaceSection:"Current Workspace",mobileConversationCollapsePreviewAction:"Hide Preview",mobileConversationRestorePreviewAction:"Restore Session Preview",iosMoreAction:"More actions",androidMoreAction:"More actions",conversationEntry:"Conversation",terminalsEntry:"Terminal",searchEntry:"Search",searchModalTitle:"Search",searchModalDescription:"Search sessions by title, or search code files inside the selected workspace.",searchModeLabel:"Search mode",searchModeSessions:"Sessions",searchModeCode:"Code",searchKeywordLabel:"Keyword",searchWorkspaceLabel:"Workspace",searchSessionPlaceholder:"Search by session title, workspace, or provider",searchCodePlaceholder:"Search by file name or path fragment",searchSessionHint:"Type a keyword to instantly filter matching sessions.",searchCodeHint:"Pick a workspace, then search by file name or path.",searchSessionEmpty:"No matching sessions found.",searchCodeEmpty:"No matching files found.",searchCodeFailed:"Code search failed. Please try again later.",searchSubmit:"Search",filesEntry:"Files",gitEntry:"Git",terminalManagerEntry:"Process Manager",workspaceSectionTitle:"Workspaces",goBack:"Back",goForward:"Forward",workspaceCount:"Projects",sessionCount:"Sessions",manageWorkspaceAction:"Manage Projects",manageWorkspaceTitle:"Manage Projects",manageWorkspaceDescription:"The list starts with the currently loaded projects. Expand one to inspect its path, Git summary, and code composition, or remove it from the current workbench list.",manageWorkspaceEmpty:"There are no projects to manage right now.",manageWorkspaceLoading:"Loading project details...",manageWorkspaceLoadFailed:"Failed to load project details.",manageWorkspacePathLabel:"Path",manageWorkspaceGitCommitCount:"Git Commit Count",manageWorkspaceGitInfoLabel:"Git Repository Info",manageWorkspaceRepoRoot:"Repository Root",manageWorkspaceCurrentBranch:"Current Branch",manageWorkspaceRemoteLabel:"Remote",manageWorkspaceNoRemote:"No remote configured",manageWorkspaceNotGit:"This project is not a Git repository.",manageWorkspaceCodeCompositionLabel:"Code Composition",manageWorkspaceCodeCompositionFiles:"files",manageWorkspaceCodeCompositionOther:"Other",manageWorkspaceNoCodeComposition:"No recognizable code files were found for composition stats.",manageWorkspaceCodeTruncated:"The project is large, so only the first {count} recognizable files were counted.",manageWorkspaceRemoveAction:"Remove Project",manageWorkspaceRemoving:"Removing...",manageWorkspaceRemoveSuccess:"Project removed from the current workbench list",manageWorkspaceRemoveFailed:"Failed to remove the project",manageWorkspaceRemoveConfirmTitle:"Confirm Project Removal",manageWorkspaceRemoveConfirmDescription:"This only removes the project from the current workbench list. It does not delete any files on disk or historical records. If you load the same path again later, the old records will appear again.",manageWorkspaceRemoveConfirmTarget:'Remove "{name}" from the current workbench?',manageWorkspaceRemoveConfirmAction:"Remove Project",importWorkspaceTitle:"Add Project",importWorkspaceHint:"Import a local code directory",importExpand:"Expand",importCollapse:"Collapse",importPathLabel:"Project Path",importPathPlaceholder:"Enter the project folder path",importNameLabel:"Project Name",importNamePlaceholder:"Optional",importSubmit:"Add Project",importSubmitting:"Adding...",importChooseFolder:"Choose Folder",importPickFolderFailed:"Failed to open the folder picker",importDesktopDropHint:"You can drag a local project folder directly into this area",importHint:"Enter a local code directory and start working",importServerDirectoryHint:"Browse and select the project directory on the server",importBrowserTitle:"Select Server Directory",importBrowserDescription:"You are browsing directories on the server, not on the current device.",importBrowserCurrentPath:"Current Path",importBrowserRoots:"Root Directories",importBrowserOpenParent:"Go Up",importBrowserOpenPath:"Open Path",importBrowserCreateDirectory:"New Folder",importBrowserCreateDirectoryTitle:"New Folder",importBrowserCreateDirectoryDescription:"Create a single child folder in the current server path. Path separators are not accepted.",importBrowserCreateDirectoryLabel:"Folder Name",importBrowserCreateDirectoryPlaceholder:"Enter the new folder name",importBrowserCreateDirectorySuccess:"Folder created",importBrowserCreateDirectoryFailed:"Failed to create folder",importBrowserCreateDirectorySubmit:"Create Folder",importBrowserCreatingDirectory:"Creating...",importBrowserEmpty:"No subdirectory is available in the current path",importBrowserBrowseFailed:"Failed to load server directories",importBrowserSubmit:"Import Current Directory",importPathRequired:"Enter the project path",importSuccess:"Project added",importFailed:"Failed to add project",cloneWorkspaceTitle:"Clone Project",cloneWorkspaceHint:"Clone a Git repository into a server directory and add it to the project list.",cloneSubmit:"Clone Project",cloneSubmitting:"Cloning...",cloneRepositoryLabel:"Git Repository URL",cloneRepositoryPlaceholder:"For example: https://github.com/org/repo.git",cloneParentPathLabel:"Target Parent Directory",cloneParentPathPlaceholder:"Choose an existing directory on the backend server",cloneDirectoryNameLabel:"New Project Directory Name",cloneDirectoryNamePlaceholder:"Defaults to the repository name when left empty",clonePickDirectory:"Choose Directory",cloneAuthModeLabel:"Authentication",cloneAuthModeNone:"No Authentication",cloneAuthModeBasic:"Username + Password",cloneAuthModeToken:"Token",cloneUsernameLabel:"Username",cloneUsernamePlaceholder:"Enter Git username",clonePasswordLabel:"Password",clonePasswordPlaceholder:"Enter Git password",cloneTokenLabel:"Token",cloneTokenPlaceholder:"Enter access token",cloneTokenUsernamePlaceholder:"Optional, defaults to git when left empty",cloneRepoRequired:"Enter the Git repository URL",clonePathRequired:"Select the target parent directory",cloneSuccess:"Project cloned successfully",cloneFailed:"Clone failed",cloneHint:"The target parent directory must already exist. Clone creates a new repository folder under it.",cloneBrowserTitle:"Select Clone Parent Directory",cloneBrowserDescription:"Choose an existing server-side parent directory. Clone will create a new project folder under it.",cloneBrowserSubmit:"Use Current Directory",refreshNavigation:"Refresh",desktopChromeLabel:"Desktop Workbench",windowMinimize:"Minimize Window",windowMaximize:"Maximize or Restore Window",windowClose:"Close Window",contextOpenSession:"Open Session",navigationLoadFailed:"Load failed. Retry.",emptyNavigationTitle:"No project yet",emptyNavigationBody:"Add a local code directory to start working",emptyWorkspaceSessions:"No sessions",favoriteSectionTitle:"Pinned Sessions",favoriteSectionEmpty:"Pinned sessions stay here for quick access.",favoriteAction:"Pin Session",unfavoriteAction:"Unpin",favoriteAdded:"Session pinned",favoriteRemoved:"Session unpinned",favoriteToggleFailed:"Failed to update pinned state",sessionMoreAction:"More Actions",sessionStateInferred:"Inferred",renameAction:"Rename",renameSuccess:"Session name updated",renameFailed:"Failed to rename session",renameModalTitle:"Rename Session",renameModalDescription:"Use a name you can recognize at a glance. This changes only the title, not the content.",renameInputLabel:"Session Name",renameInputPlaceholder:"Enter a new session name",renamingSession:"Saving...",archiveFolderLabel:"Archived Sessions",archiveFolderAction:"Open Archive Folder",archiveAction:"Archive Session",archiveCurrentSessionAction:"Archive Current Session",archiveAdded:"Session archived",archiveConfirmTitle:"Archive This Session",archiveConfirmDescription:"After archiving, this session will be hidden from the main list for the current workspace, and you can still restore it from archive.",unarchiveAction:"Restore from Archive",archiveRestored:"Session restored to the main list",archiveModalTitle:"Archived Sessions",archiveModalDescription:"This list shows sessions temporarily hidden in the current project. Restore them when needed.",archiveEmpty:"There are no archived sessions in this project yet.",subagentBadge:"Sub-agent",subagentExpand:"Expand Sub-agent List",subagentCollapse:"Collapse Sub-agent List",subagentExpandMore:"Show More Sub-agents",favoriteExpandMore:"Show More Pinned",sessionExpandMore:"Show More Sessions",archiveExpandMore:"Show More Archived Sessions",workspaceCollapse:"Collapse Project",workspaceExpand:"Expand Project",switchWorkspace:"Switch to Project",workspaceHomeSwitcherLabel:"Switch Workspace",workspaceHomeSwitcherTitle:"Workspace",workspaceHomeStatusSectionTitle:"Current Workspace",workspaceHomeViewAllAction:"View All Sessions",workspaceHomeMetricActive:"Active",workspaceHomeMetricUnread:"Review",workspaceHomeMetricTerminal:"Terminals",workspaceHomeMetricChanges:"Changes",workspaceHomeActiveSessionsSectionTitle:"Active Sessions",workspaceHomeQuickLaunchStatusLabel:"Quick Launch Process",workspaceHomeQuickLaunchRunning:"Running",workspaceHomeQuickLaunchStopped:"Stopped",workspaceHomeWaitingInputLabel:"Waiting Input",workspaceOverviewTitle:"Put project entry points where you can actually see them",workspaceOverviewBody:"Choose a project first, then decide whether to continue or start a new session.",workspaceListBody:"Keep every loaded project here and surface the frequent actions on the page.",workspaceDetailTitle:"Project Details",workspaceDetailSummaryTitle:"Project Overview",workspaceDetailSummaryBody:"See the path, Git summary, and code footprint first, then jump into the right tool.",workspaceDetailMissingTitle:"Project not found",workspaceDetailMissingBody:"This project may have been removed, or the current snapshot has not loaded it yet.",workspaceSessionListBody:"Project sessions, favorites, and archive actions live here instead of hiding in a sidebar.",recentSessionsSectionTitle:"Recent Sessions",recentSessionsSectionBody:"Jump back into the work you touched most recently.",currentWorkspaceSectionTitle:"Current Project Sessions",currentWorkspaceSectionBody:"Keep the sessions for the current project together so the context stays obvious.",sessionIndexTitle:"Sessions deserve their own page",sessionIndexBody:"Recent, favorites, and current-project sessions are split into clear sections for mobile.",toolsMoreAction:"More",toolsSwipeHint:"Swipe left or right to switch between files and Git",toolsSwipePosition:"{current} / {total}",toolFilesBody:"Browse project files, changed files, and code context without relying on a desktop sidebar.",toolGitBody:"Open a clear Git entry for status, commits, and branches in the current project.",toolTerminalsBody:"Open the full terminal page for input-heavy and scroll-heavy tasks.",toolProcessesBody:"Review terminal templates, runtime status, and process entry points for the current project.",toolsWorkspaceRequiredBody:"Pick a project before opening this tool page.",createSession:"New Session",createSessionModalTitle:"Choose Session Type",createSessionModalDescription:"Pick the session type first, then start the actual session process.",createSessionWorkspaceLabel:"Choose Workspace",createSessionProviderLabel:"Choose Provider",createSessionTarget:"Current Project",providerClaudeCode:"Claude Code",providerCodexDescription:"Create a Codex session for the current default workflow.",providerClaudeDescription:"Create a Claude Code session when you want to switch to another conversation chain.",providerOpenCodeDescription:"Create an OpenCode session to continue context via the OpenCode service.",providerOptionHint:"A session is created immediately after selection",startClaude:"Claude",startCodex:"Codex",startingSession:"Creating...",startClaudeSuccess:"Claude session created",startCodexSuccess:"Codex session created",startSessionFailed:"Failed to create session",auxiliaryTitle:"Info",auxiliarySubtitle:"Files and Git status",expandAuxiliary:"Expand",collapseAuxiliary:"Collapse",auxiliaryEmptyTitle:"Select a session",auxiliaryEmptyBody:"Session files and Git info will appear here",batchSelectSessions:"Select Sessions in Bulk",batchSelectionMode:"Batch Selection",selectAllSessions:"Select All",clearSelectedSessions:"Clear Selection",batchArchiveAction:"Archive Selected",batchArchiving:"Archiving...",batchArchiveSuccess:"Selected sessions archived",batchArchivePartialFailed:"Some sessions failed to archive. Retry.",batchArchiveFailed:"Batch archive failed",hideSessionSidebar:"Hide Session List",showSessionSidebar:"Show Session List",hideInfoSidebar:"Hide Info Sidebar",showInfoSidebar:"Show Info Sidebar",centerTabsLabel:"Center Area Tabs",infoTabsLabel:"Info Sidebar Tabs",leftResizerLabel:"Resize Left Sidebar",rightResizerLabel:"Resize Right Sidebar",filesPanelEmpty:"Import or select a workspace first to use file management.",gitPanelEmpty:"Import or select a workspace first to view Git info.",infoPanelDeferred:"The left session list loads first. The right auxiliary panel mounts slightly later."},workbench:{emptyEyebrow:"Start",emptyTitle:"Choose a session first",emptyBody:"Continue from the left, or create a new session.",emptyResumeTitle:"Continue",emptyResumeBody:"Go back to where you stopped.",emptyNewTitle:"New session",emptyNewBody:"Put a new question into a clean session.",emptyCompanionTitle:"Side details",emptyCompanionBody:"Open files, Git, or terminal on the right when needed.",emptyTip:"When you are ready, pick a session from the left."},conversation:{resendButton:"Resend",historyLoading:"Loading...",historyLoadingOlder:"Loading older messages...",historyLoadFailed:"Load failed",timelineEmpty:"Start Conversation",composerPlaceholder:"State the next step clearly. Let the session continue from there.",sendButton:"Send Message",attachFiles:"Attach File",attachmentSourceSheetTitle:"Add Image",attachmentSourceSheetDescription:"Take a new photo now, or choose one from the photo library.",attachmentTakePhoto:"Take Photo",attachmentTakePhotoHint:"Open the camera and capture a new image",attachmentChooseFromLibrary:"Choose from Library",attachmentChooseFromLibraryHint:"Pick an existing image from the system photo library",pasteImagesHint:"Supports pasting images directly",attachmentImageOnly:"Only image attachments are supported right now",attachmentReadFailed:"Failed to read image. Retry.",attachmentPreviewAlt:"Selected image preview",attachmentPreviewOpen:"Click to view full image",attachmentPreviewClose:"Close image preview",attachmentPreviewLoading:"Loading image...",attachmentPreviewUnavailable:"Image preview unavailable",imageAttachmentLabel:"Image Attachment",imagePreviewTitle:"Image Preview",imagePreviewHint:"Click the backdrop or press Esc to close the preview",removeAttachment:"Remove Attachment",modelSelectorLabel:"Model",modelUseCliDefault:"Default",modelUseCodexConfig:"Follow current Codex config",modelUseOpenCodeConfig:"Follow current OpenCode config",reasoningSelectorLabel:"Reasoning Effort",reasoningLow:"Low",reasoningMedium:"Medium",reasoningHigh:"High",reasoningMaximum:"Maximum",slashMenu:"Commands",slashMenuTitle:"Quick Commands",slashCommandPlan:"Ask for an execution plan first",slashCommandReview:"Switch directly to code review mode",slashCommandExplain:"Ask for a clearer explanation",toolInputLabel:"Input",toolResultLabel:"Result",toolResultEmpty:"No output yet",toolPreviewCommand:"Command",toolPreviewTerminal:"Terminal",toolStatusRunning:"Running",toolStatusFailed:"Failed",toolStatusCompleted:"Completed",applyPatchEditedLabel:"Edited",applyPatchAddedLabel:"Added",applyPatchDeletedLabel:"Deleted",applyPatchDialogTitle:"Patch Change Preview",applyPatchDialogDescription:"This shows the file-level changes that apply_patch is about to perform.",applyPatchOpenDiff:"View Diff",applyPatchAddedStat:"Added",applyPatchRemovedStat:"Removed",applyPatchEmpty:"This patch does not contain any file change that can be displayed right now.",titleFallback:"Continue Conversation",draftTitleCodex:"New Codex session",draftTitleClaude:"New Claude Code session",draftTitleOpenCode:"New OpenCode session",headerWorkspace:"Workspace",headerWorkspaceUnknown:"Unknown Workspace",headerProvider:"Provider",headerConnection:"Connection",headerRuntime:"Runtime",providerCodex:"Codex",providerClaude:"Claude",providerOpenCode:"OpenCode",capabilitySend:"Send Enabled",queueTitle:"Queued Messages",queueDescription:"After the current run finishes, these messages will be processed automatically in order.",queueOrderPrefix:"Queue Position",queueStatusQueued:"Queued",queueStatusFailed:"Dispatch Failed",queueDelete:"Delete",queueDeleting:"Deleting",permissionRequestSectionTitle:"Pending approvals",permissionRequestSectionDescription:"Provider-side approvals are unified here so you do not need to learn three different dialogs.",permissionRequestToastTitle:"Approval needed",permissionRequestReplyFailed:"Failed to reply to the approval request.",permissionRequestSubmitting:"Submitting...",permissionRequestReasonLabel:"Reason",permissionRequestCommandLabel:"Command",permissionRequestToolLabel:"Tool",permissionRequestCwdLabel:"Working directory",permissionRequestPathsLabel:"Related paths",permissionRequestPermissionsLabel:"Requested permissions",permissionRequestReadLabel:"Read",permissionRequestWriteLabel:"Write",permissionRequestNetworkLabel:"Network",permissionRequestQuestionsLabel:"Questions",permissionRequestDetailLabel:"Details",permissionRequestEmpty:"None",permissionRequestUnknown:"Unknown",permissionRequestKindCommand:"Command",permissionRequestKindFileChange:"File Change",permissionRequestKindPermissions:"Permissions",permissionRequestKindUserInput:"User Input",permissionRequestKindToolCall:"Tool Call",queueImageOnly:"Image attachments only",sendGuidanceButton:"Add Guidance",queueGuidanceButton:"Queue Guidance",capabilityDenied:"Restricted",capabilitySendDisabled:"Sending disabled",connectionConnected:"Realtime connected",connectionReconnecting:"Reconnecting",connectionReconnectFailed:"Reconnect failed",connectionClosed:"Connection closed",runtimeIdle:"Idle",runtimeStarting:"Starting",runtimeRunning:"Running",runtimeReconnecting:"Recovering",runtimeStale:"Awaiting confirmation",runtimeUnknown:"Status pending",runtimeCompleted:"Completed",runtimeInterrupted:"Interrupted",runtimeFailed:"Failed",rulesMessageTitle:"Rules",rulesMessageHint:"This is the startup rule block for the session. It is collapsed by default and can be expanded when needed.",rulesMessageExpand:"Expand Rules",rulesMessageCollapse:"Collapse Rules",thinkingLabel:"Thinking",filePanelWorkspaceTab:"Workspace",filePanelSessionTab:"Session",filePanelSessionViewLabel:"Session File View",filePanelSessionTreeView:"Tree",filePanelSessionListView:"List",filePanelSessionLoading:"Collecting files changed in this session...",filePanelSessionEmpty:"No cacheable changed files have been detected in this session yet.",filePanelSessionNoSession:"Only the workspace is selected right now. Pick a session before viewing session-scoped files.",filePanelSessionStageAll:"Stage All",filePanelSessionStageSuccess:"Changes from this session have been added to the staging area.",filePanelSessionLoadFailed:"Failed to load changed files for this session.",filePanelSessionSummary:"Detected Files",filePanelSessionUnstagedSummary:"Unstaged",filePanelSessionDeleted:"Deleted"},git:{recentVersionsTitle:"Recent Versions",stagedChangesTitle:"Staged Changes",expandRecentVersions:"Expand Recent Versions",collapseRecentVersions:"Collapse Recent Versions",stagedLabel:"Staged",workingTreeLabel:"Working Tree",changeTreeHint:"Show current changes by directory hierarchy",discard:"Discard Changes",discardFailed:"Failed to discard changes",operationMenu:"Actions",currentBranch:"Current Branch",resizePanels:"Resize file and recent-version panels",switchBranchTo:"Switch To",undoLastCommit:"Undo Last Commit",undoLastCommitFailed:"Failed to undo last commit",undoLastCommitSuccess:"Last commit undone",historyKindLocal:"Local",historyKindRemote:"Remote",historyKindShared:"Synced",pushNow:"Push",commitNow:"Commit",refreshNow:"Refresh",stageAll:"Stage All",unstageAll:"Unstage All",discardAll:"Discard All Changes",selectedFiles:"Selected Files",clearSelection:"Clear Selection",selectFile:"Select File",discardConfirm:"Discard these changes? {path}",historyItemMenu:"Commit Actions",copyCommitHash:"Copy Commit Hash",copyCommitHashSuccess:"Commit hash copied.",copyCommitSubject:"Copy Commit Title",copyCommitSubjectSuccess:"Commit title copied."},terminalManager:{workspaceField:"Current Workspace",refresh:"Refresh List",loadFailed:"Failed to load the terminal management panel",shellLoadFailed:"Failed to load the terminal shell list",emptyWorkspaceBody:"There is no available workspace yet.",noCurrentWorkspaceBody:"Select a session first so process management can bind to its workspace.",emptyTerminalBody:"There is no terminal instance in the current workspace yet.",emptyTemplateBody:"There is no quick launch item yet. Save a command or script first.",shellField:"Shell for New Terminal",shellUnavailable:"Unavailable",cwdField:"Startup Directory",cwdLabel:"Directory",cwdPlaceholder:"Defaults to the workspace root when left empty",modeField:"Launch Mode",commandMode:"Command",scriptMode:"Script",quickLaunchTitle:"Quick Launch",quickLaunchDescription:"Save a launch preset here so you can start it in a new terminal with one click later.",desktopPanelDescription:"Keep the default view focused on launch decisions, while paths and command lines stay inside the details layer.",runningCountLabel:"Running",portWatchCountLabel:"Watched Ports",terminalCountLabel:"Terminals",templateSectionTitle:"Launch Items",templateSectionDescription:"The right side prioritizes the port status of launch items so you can see whether a service is already in use.",openCreateModalAction:"Add Quick Launch Item",createModalTitle:"Add Quick Launch Item",createModalDescription:"Save a command or script here. You can attach a port and then start it with one click while checking whether it is already running.",editAction:"Edit Launch Item",editModalTitle:"Edit Quick Launch Item",editModalDescription:"Update the name, command, directory, and port for this quick launch item.",saveTemplateChangesAction:"Save Changes",templateUpdating:"Saving changes...",templateUpdateSuccess:"Quick launch item updated.",templateUpdateFailed:"Failed to update quick launch item",removeAction:"Remove Launch Item",templateRemoving:"Removing...",removeConfirmTitle:"Remove Quick Launch Item",removeConfirmAction:"Remove Item",removeConfirmTarget:'Remove "{name}"? It will disappear from the quick launch list after removal.',removeRunningConfirmTarget:'"{name}" is still running. Removing it only deletes the launch item configuration and will not stop the active process. Continue?',templateDeleteSuccess:"Quick launch item removed.",templateDeleteFailed:"Failed to remove quick launch item",terminalSectionTitle:"Terminal Instances",terminalSectionDescription:"This area shows terminals currently managed by CodingNS for the workspace.",closeAction:"Close Terminal",closing:"Closing...",closeSuccess:"Terminal close request submitted.",closeFailed:"Failed to close terminal",createTerminalAction:"New Empty Terminal",creatingTerminal:"Creating...",createTerminalSuccess:"New terminal created.",createTerminalFailed:"Failed to create a new terminal",defaultTerminalName:"Workspace Terminal",templateNameField:"Name",templateNamePlaceholder:"Generated automatically when left empty",commandField:"Launch Command",commandPlaceholder:"For example: npm",scriptPathField:"Script Path",scriptPathPlaceholder:"For example: scripts/dev.ps1 or scripts/dev.sh",argsField:"Arguments",argsPlaceholder:"For example: run dev or --watch",portField:"Listening Port",portLabel:"Port",portPlaceholder:"For example: 3000",invalidPort:"Port must be an integer between 1 and 65535",saveLaunchAction:"Save as Quick Launch",templateSaving:"Saving...",templateSaveSuccess:"Quick launch item saved.",templateSaveFailed:"Failed to save quick launch item",runTemplateAction:"Run in New Terminal",runningTemplate:"Starting...",templateRunSuccess:"Quick launch item sent to a new terminal.",templateRunFailed:"Failed to run quick launch item",showDetailsAction:"Show details",hideDetailsAction:"Hide details",detailsSectionTitle:"Launch item details",commandPreviewLabel:"Launch Command",processIdLabel:"Process ID",processCommandLabel:"Process Command Line",stopProcessAction:"Stop Process",stoppingProcess:"Stopping...",stopProcessSuccess:"The listening process has been stopped.",stopProcessFailed:"Failed to stop the listening process",defaultCommandName:"New Launch Command",defaultScriptName:"New Launch Script",lastActiveAt:"Last Active",updatedAt:"Updated At",processCommandFallback:"This process did not expose its command line",portUnset:"Port Not Configured",portUnsetDescription:"Without a port, the item can only be started. The system cannot determine automatically whether the service is running.",portOccupied:"Process Started",portAvailable:"Port Available",portAvailableDescription:"There is currently no listening process on the port used by this launch item.",statusRunning:"Running",statusStopped:"Stopped",exitCode:"Exit Code",runningValue:"Running"},theme:{light:"浅色",dark:"深色",skyBlue:"赛博",eyeGreen:"护眼",switchLabel:"Theme"}},Fx={"zh-CN":MP,"en-US":RP},Ox={"zh-CN":LP,"en-US":IP};function Wc(e,t){const n=e.split(".");let s=t;for(const a of n){if(!s||typeof s=="string")return e;const c=s[a];if(c==null)return e;s=c}return typeof s=="string"?s:e}function DP(){return Yr.getState().profile.language??"zh-CN"}function h(e,t){const s=DP()==="en-US"?["en-US","zh-CN"]:["zh-CN"];for(const a of s){const c=Wc(e,Ox[a]);if(c!==e)return Xd(c,t);const l=Wc(e,Fx[a]);if(l!==e)return Xd(l,t)}return Xd(e,t)}function Xd(e,t){return t?e.replace(/\{([^}]+)\}/g,(n,s)=>{const a=t[s];return a==null?n:String(a)}):e}function _P({children:e,language:t}){return v.useEffect(()=>{document.documentElement.setAttribute("lang",t)},[t]),e}function FP(){const e=uo(t=>t.profile.language);return t=>{const n=e==="en-US"?["en-US","zh-CN"]:["zh-CN"];for(const s of n){const a=Wc(t,Ox[s]);if(a!==t)return a;const c=Wc(t,Fx[s]);if(c!==t)return c}return t}}const Bx=[{id:"light",labelKey:"theme.light",color:"#f6f4ef"},{id:"dark",labelKey:"theme.dark",color:"#1b1b1b"},{id:"sky-blue",labelKey:"theme.skyBlue",color:"#00f0ff"},{id:"eye-green",labelKey:"theme.eyeGreen",color:"#16a34a"}];function Ux(e){return h(e.labelKey)}function OP(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function BP(){return Yr.getState().profile.theme??OP()}function UP(e){typeof window>"u"||(document.documentElement.setAttribute("data-theme",e),_c({theme:e}).catch(()=>{}))}function Wx(){return{theme:uo(t=>t.profile.theme),setTheme:UP}}function WP(){typeof window>"u"||document.documentElement.setAttribute("data-theme",BP())}function zP({children:e}){const t=uo(n=>n.profile.theme);return v.useEffect(()=>{WP()},[t]),i.jsx(i.Fragment,{children:e})}const HP={showToast:()=>"",dismissToast:()=>{}},zx=v.createContext(HP);function qP(){return`toast-${Math.random().toString(36).slice(2,10)}`}function $P({toast:e,onDismiss:t}){const{id:n,title:s,description:a,tone:c,durationMs:l,action:d}=e;return v.useEffect(()=>{if(l===null)return;const f=window.setTimeout(()=>{t(n)},l);return()=>{window.clearTimeout(f)}},[l,n,t,s,a,c]),i.jsxs("article",{className:"toast-card","data-tone":c,role:c==="error"?"alert":"status",children:[i.jsxs("div",{className:"toast-body",children:[i.jsx("strong",{className:"toast-title",children:s}),a?i.jsx("p",{className:"toast-description",children:a}):null]}),i.jsxs("div",{className:"toast-actions",children:[d?i.jsx("button",{className:"toast-action",type:"button",onClick:()=>{d.onClick(),t(n)},children:d.label}):null,i.jsx("button",{className:"toast-dismiss",type:"button","aria-label":"关闭通知",onClick:()=>t(n),children:"x"})]})]})}function VP({children:e}){const[t,n]=v.useState([]),s=v.useCallback(l=>{n(d=>d.filter(f=>f.id!==l))},[]),a=v.useCallback(l=>{const d=l.id??qP(),f={id:d,title:l.title,description:l.description,tone:l.tone??"info",durationMs:l.durationMs===void 0?4200:l.durationMs,action:l.action};return n(p=>{const y=p.findIndex(b=>b.id===d);if(y===-1)return[...p,f];const g=[...p];return g[y]=f,g}),d},[]),c=v.useMemo(()=>({showToast:a,dismissToast:s}),[s,a]);return i.jsxs(zx.Provider,{value:c,children:[e,i.jsx("div",{className:"toast-viewport","aria-live":"polite","aria-atomic":"false",children:t.map(l=>i.jsx($P,{toast:l,onDismiss:s},l.id))})]})}function Kn(){return v.useContext(zx)}const xc="0.1.2",Hx=v.createContext(xc);function GP({children:e}){const t=An(),[n,s]=v.useState(xc);return v.useEffect(()=>{let a=!1;return t.isDesktop?(t.bridge.getRuntimeInfo().then(c=>{var d,f;if(a)return;const l=c.ok?(f=(d=c.value)==null?void 0:d.version)==null?void 0:f.trim():"";s(l||xc)}),()=>{a=!0}):(s(xc),()=>{a=!0})},[t]),i.jsx(Hx.Provider,{value:n,children:e})}function qx(){return v.useContext(Hx)}const KP="modulepreload",QP=function(e){return"/"+e},Fy={},ru=function(t,n,s){let a=Promise.resolve();if(n&&n.length>0){let l=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=l(n.map(p=>{if(p=QP(p),p in Fy)return;Fy[p]=!0;const y=p.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":KP,y||(b.as="script"),b.crossOrigin="",b.href=p,f&&b.setAttribute("nonce",f),document.head.appendChild(b),y)return new Promise((k,S)=>{b.addEventListener("load",k),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${p}`)))})}))}function c(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return a.then(l=>{for(const d of l||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})},$x="codingns.server.base-url.history",Vx=6,Gx="__custom__";function Kx(){return typeof window<"u"&&typeof window.localStorage<"u"}function YP(){return typeof window>"u"||!window.location.origin?null:window.location.origin}function Qx(e){if(!e)return null;try{return bi(e)}catch{return null}}function XP(){if(!Kx())return[];const e=window.localStorage.getItem($x);if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.map(n=>typeof n=="string"?Qx(n):null).filter(n=>!!n):[]}catch{return[]}}function JP(e){const t=new Set,n=[];for(const s of e)!s||t.has(s)||(t.add(s),n.push(s));return n}function ZP(e){const t=XP();return JP([e,...t,Qx(YP())]).slice(0,Vx)}function eT(e){Kx()&&window.localStorage.setItem($x,JSON.stringify(e.slice(0,Vx)))}class tT{constructor(){Ke(this,"state",this.createState(Rn.getState().hostBaseUrl));Ke(this,"listeners",new Set);Ke(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Ke(this,"getState",()=>this.state);Rn.subscribe(()=>{const t=this.createState(Rn.getState().hostBaseUrl);t.baseUrl===this.state.baseUrl&&t.options.length===this.state.options.length&&t.options.every((n,s)=>n===this.state.options[s])||(this.state=t,this.emit())})}setBaseUrl(t){const n=bi(t),s=n!==Rn.getState().hostBaseUrl;return this.state=this.createState(n),this.emit(),Rn.update({hostBaseUrl:n}),s}reset(){this.state=this.createState(Rn.getState().hostBaseUrl),this.emit()}createState(t){const n=ZP(t);return eT(n),{baseUrl:t,options:n}}emit(){for(const t of this.listeners)t()}}const zc=new tT;function Hc(e){return v.useSyncExternalStore(zc.subscribe,()=>e(zc.getState()))}function nT(e,t){return t.includes(e)?e:Gx}function rT(){return Gx}const Yx={login(e,t,n){return gn.login(e,t,n)},bootstrap(e,t,n){return gn.bootstrap(e,t,n)},refresh(){return gn.refresh()},logout(){gn.clear()}};function iT(){const e=Wn(),t=Hc(C=>C.baseUrl),[n,s]=v.useState("admin"),[a,c]=v.useState(""),[l,d]=v.useState(""),[f,p]=v.useState(null),[y,g]=v.useState("error"),[b,k]=v.useState(!1);async function S(C){if(C.preventDefault(),a!==l){g("error"),p(h("auth.bootstrapMismatch"));return}k(!0),p(null);try{await Yx.bootstrap(n,a),g("success"),p(h("auth.bootstrapSuccess")),window.setTimeout(()=>e("/login",{replace:!0}),500)}catch(j){g("error"),j instanceof Jn?p(j.message):p(h("auth.authUnavailable"))}finally{k(!1)}}return i.jsx("main",{className:"page-center app-shell",children:i.jsxs("section",{className:"auth-card surface-card",children:[i.jsx("h1",{children:h("auth.bootstrapTitle")}),i.jsx("p",{className:"status-text",children:h("auth.bootstrapSubtitle")}),i.jsxs("div",{className:"field-group",children:[i.jsx("span",{children:h("auth.serverCurrent")}),i.jsx("span",{className:"auth-server-value",children:t})]}),i.jsxs("form",{className:"auth-form",onSubmit:S,children:[i.jsxs("label",{className:"field-group",children:[i.jsx("span",{children:h("auth.username")}),i.jsx("input",{value:n,onChange:C=>s(C.target.value)})]}),i.jsxs("label",{className:"field-group",children:[i.jsx("span",{children:h("auth.password")}),i.jsx("input",{type:"password",value:a,onChange:C=>c(C.target.value)})]}),i.jsxs("label",{className:"field-group",children:[i.jsx("span",{children:h("auth.confirmPassword")}),i.jsx("input",{type:"password",value:l,onChange:C=>d(C.target.value)})]}),f?i.jsx("p",{className:"status-text","data-tone":y,children:f}):null,i.jsx("button",{className:"primary-button",type:"submit",disabled:b,children:h(b?"common.loading":"auth.submitBootstrap")})]})]})})}async function sT(e){try{return{...await Pj(e),reachable:!0}}catch{return{initialized:!1,reachable:!1}}}function oT({isOpen:e,onClose:t,onSave:n,theme:s="dark"}){const a=Hc(L=>L.baseUrl),c=Hc(L=>L.options),l=rT(),[d,f]=v.useState(a),[p,y]=v.useState(null),g=v.useMemo(()=>{try{return bi(d)}catch{return null}},[d]),b=nT(g??d,c),k="server-settings-preset",S="server-settings-address";if(v.useEffect(()=>{e&&(f(a),y(null))},[e,a]),!e)return null;function C(){if(!g){y(h("auth.serverInvalid"));return}zc.setBaseUrl(g),n==null||n(g),t()}function j(L){L.target===L.currentTarget&&t()}function A(){g&&f(g)}return i.jsx("div",{className:"server-settings-modal-backdrop","data-theme":s,onClick:j,role:"dialog","aria-modal":"true","aria-labelledby":"server-settings-title",children:i.jsxs("div",{className:"server-settings-modal",children:[i.jsxs("div",{className:"server-settings-modal-header",children:[i.jsx("div",{className:"cyber-header-line"}),i.jsxs("h2",{id:"server-settings-title",className:"cyber-title",children:[i.jsx("span",{className:"cyber-title-icon",children:"◈"}),h("auth.serverSettingsTitle")]}),i.jsx("div",{className:"cyber-header-line"}),i.jsx("button",{className:"server-settings-close",onClick:t,"aria-label":h("common.close"),children:"×"})]}),i.jsxs("div",{className:"server-settings-modal-content",children:[i.jsxs("label",{className:"field-group cyber-field",htmlFor:k,children:[i.jsx("span",{className:"cyber-label",children:h("auth.serverPreset")}),i.jsxs("div",{className:"cyber-select-wrapper",children:[i.jsxs("select",{id:k,"aria-label":h("auth.serverPreset"),className:"cyber-select",value:b,onChange:L=>{const M=L.target.value;M!==l&&(f(M),y(null))},children:[c.map(L=>i.jsx("option",{value:L,children:L},L)),i.jsx("option",{value:l,children:h("auth.serverCustomOption")})]}),i.jsx("span",{className:"cyber-select-arrow",children:"▼"})]})]}),i.jsxs("label",{className:"field-group cyber-field",htmlFor:S,children:[i.jsx("span",{className:"cyber-label",children:h("auth.serverAddress")}),i.jsxs("div",{className:"cyber-input-wrapper",children:[i.jsx("input",{id:S,"aria-label":h("auth.serverAddress"),className:"cyber-input",value:d,placeholder:h("auth.serverPlaceholder"),onBlur:A,onChange:L=>{f(L.target.value),y(null)}}),i.jsx("div",{className:"cyber-input-glow"})]})]}),i.jsxs("p",{className:"cyber-hint",children:[i.jsx("span",{className:"cyber-hint-icon",children:"ℹ"}),h("auth.serverHint")]}),p?i.jsxs("p",{className:"cyber-status","data-tone":"error",children:[i.jsx("span",{className:"cyber-status-icon",children:"⚠"}),p]}):null]}),i.jsxs("div",{className:"server-settings-modal-footer",children:[i.jsx("button",{className:"cyber-button cyber-button-secondary",onClick:t,children:h("common.cancel")}),i.jsxs("button",{className:"cyber-button cyber-button-primary",onClick:C,children:[i.jsx("span",{className:"cyber-button-glow"}),i.jsx("span",{className:"cyber-button-text",children:h("auth.saveServerSettings")})]})]})]})})}const Oy="width=device-width, initial-scale=1.0, viewport-fit=cover",aT="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover";function lT(){const e=v.useRef(null);return v.useEffect(()=>{const t=e.current;if(!t)return;const n=t.getContext("2d");if(!n)return;let s;const a=()=>{l(),d()};let c=[];const l=()=>{t.width=window.innerWidth,t.height=window.innerHeight},d=()=>{c=[];const p=Math.min(50,Math.floor(t.width*t.height/25e3));for(let y=0;y<p;y++)c.push({x:Math.random()*t.width,y:Math.random()*t.height,vx:(Math.random()-.5)*.5,vy:(Math.random()-.5)*.5,size:Math.random()*2+1,opacity:Math.random()*.5+.2})},f=()=>{n.clearRect(0,0,t.width,t.height),c.forEach((p,y)=>{p.x+=p.vx,p.y+=p.vy,p.x<0&&(p.x=t.width),p.x>t.width&&(p.x=0),p.y<0&&(p.y=t.height),p.y>t.height&&(p.y=0),n.beginPath(),n.arc(p.x,p.y,p.size,0,Math.PI*2),n.fillStyle=`rgba(10, 132, 255, ${p.opacity})`,n.fill(),c.slice(y+1).forEach(g=>{const b=p.x-g.x,k=p.y-g.y,S=Math.sqrt(b*b+k*k);S<150&&(n.beginPath(),n.moveTo(p.x,p.y),n.lineTo(g.x,g.y),n.strokeStyle=`rgba(10, 132, 255, ${.1*(1-S/150)})`,n.stroke())})}),s=requestAnimationFrame(f)};return l(),d(),f(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),cancelAnimationFrame(s)}},[]),i.jsx("canvas",{ref:e,className:"particle-canvas"})}function cT({text:e}){return i.jsx("span",{className:"glitch-text","data-text":e,children:e})}function uT({text:e}){const[t,n]=v.useState(""),[s,a]=v.useState(!0);return v.useEffect(()=>{let c=0,l=null;const d=setInterval(()=>{c<=e.length?(n(e.slice(0,c)),c++):(clearInterval(d),l=window.setTimeout(()=>a(!1),1e3))},50);return()=>{clearInterval(d),l!==null&&window.clearTimeout(l)}},[e]),i.jsxs("span",{className:"typewriter-text",children:[t,s&&i.jsx("span",{className:"typewriter-cursor",children:"_"})]})}function dT(){const e=Wn(),t=FP(),[n]=NP(),s=An(),a=qx(),c=Bf(s.platform),l=v.useMemo(()=>ej(s),[s]),d=v.useMemo(()=>l?Gb():null,[l]),f=(d==null?void 0:d.serverBaseUrl)??null,[p,y]=v.useState(()=>(d==null?void 0:d.username)??"admin"),[g,b]=v.useState(()=>(d==null?void 0:d.password)??""),[k,S]=v.useState(()=>!!d),C=Hc(E=>E.baseUrl),[j,A]=v.useState(C),[L,M]=v.useState(null),[O,q]=v.useState(!1),[_,I]=v.useState(!1),[F,D]=v.useState(null),P=lx(E=>E.session),K=v.useMemo(()=>n.get("returnTo")??"/",[n]),{theme:X}=Wx(),$=v.useRef(!1),ee=s.isNativeMobile,te=v.useMemo(()=>X==="light"?"light":"dark",[X]);v.useEffect(()=>{if(typeof document>"u")return;const E=document.querySelector('meta[name="viewport"]');if(!(E instanceof HTMLMetaElement))return;const W=E.getAttribute("content")??Oy;return ee?E.setAttribute("content",aT):E.setAttribute("content",Oy),()=>{E.setAttribute("content",W)}},[ee]),v.useEffect(()=>{$.current||($.current=!0,!(!l||!f||f===C)&&(zc.setBaseUrl(f),A(f)))},[C,l,f]),v.useEffect(()=>{if(P){e(K,{replace:!0});return}if(!j)return;let E=!1;return sT(j).then(W=>{!E&&W.reachable&&!W.initialized&&e("/bootstrap",{replace:!0})}).catch(()=>{E||M(t("auth.authUnavailable"))}),()=>{E=!0}},[P,e,j,K,t]);async function pe(E){E.preventDefault(),q(!0),M(null),A(C),l&&!k&&nj();try{await Yx.login(p,g,C),await Yr.refreshForAuthenticatedUser(),l&&k&&Kb({username:p,password:g,serverBaseUrl:C}),e(K,{replace:!0})}catch(W){if(W instanceof Jn){if(W.errorCode==="BOOTSTRAP_REQUIRED"){e("/bootstrap",{replace:!0});return}M(W.message)}else M(t("auth.authUnavailable"))}finally{q(!1)}}function ne(E){A(E),M(null)}const z="login-username",ye="login-password";return i.jsxs("main",{className:"cyber-login-page","data-theme":te,"data-native-mobile":ee?"true":"false",children:[i.jsxs("div",{className:"cyber-bg",children:[i.jsx("div",{className:"cyber-grid"}),i.jsx("div",{className:"cyber-glow cyber-glow-1"}),i.jsx("div",{className:"cyber-glow cyber-glow-2"}),i.jsx(lT,{})]}),i.jsx("div",{className:"scanlines"}),i.jsxs("div",{className:"cyber-login-container",children:[i.jsx("div",{className:"cyber-login-toolbar",children:i.jsx(Qf,{variant:"compact"})}),i.jsxs("div",{className:"cyber-login-content",children:[i.jsxs("div",{className:"cyber-brand",children:[i.jsx("div",{className:"cyber-logo",children:i.jsx("img",{src:"/logo.png",alt:"CodingNS",className:"cyber-logo-svg"})}),i.jsx("h1",{className:"cyber-brand-title",children:i.jsx(cT,{text:"CodingNS"})}),i.jsx("p",{className:"cyber-brand-subtitle",children:i.jsx(uT,{text:t("auth.loginSubtitle")})})]}),i.jsxs("div",{className:"cyber-card",children:[i.jsx("div",{className:"cyber-corner corner-tl"}),i.jsx("div",{className:"cyber-corner corner-tr"}),i.jsx("div",{className:"cyber-corner corner-bl"}),i.jsx("div",{className:"cyber-corner corner-br"}),i.jsxs("div",{className:"cyber-card-header",children:[i.jsx("div",{className:"cyber-line"}),i.jsx("span",{className:"cyber-card-label",children:t("auth.loginTitle").toUpperCase()}),i.jsx("div",{className:"cyber-line"})]}),i.jsxs("form",{className:"cyber-form",onSubmit:pe,children:[i.jsxs("div",{className:`cyber-field ${F==="username"?"focused":""}`,children:[i.jsx("div",{className:"cyber-field-border",children:i.jsx("div",{className:"cyber-field-border-glow"})}),i.jsxs("label",{className:"cyber-field-label",htmlFor:z,children:[i.jsx("span",{className:"cyber-field-icon",children:"❯"}),t("auth.username")]}),i.jsx("input",{id:z,"aria-label":t("auth.username"),className:"cyber-input",value:p,onChange:E=>y(E.target.value),onFocus:()=>D("username"),onBlur:()=>D(null),autoComplete:"username"})]}),i.jsxs("div",{className:`cyber-field ${F==="password"?"focused":""}`,children:[i.jsx("div",{className:"cyber-field-border",children:i.jsx("div",{className:"cyber-field-border-glow"})}),i.jsxs("label",{className:"cyber-field-label",htmlFor:ye,children:[i.jsx("span",{className:"cyber-field-icon",children:"⚷"}),t("auth.password")]}),i.jsx("input",{id:ye,"aria-label":t("auth.password"),className:"cyber-input",type:"password",value:g,onChange:E=>b(E.target.value),onFocus:()=>D("password"),onBlur:()=>D(null),autoComplete:"current-password"})]}),l?i.jsxs("label",{className:"cyber-remember-toggle",children:[i.jsx("input",{"aria-label":t("auth.rememberPassword"),type:"checkbox",checked:k,onChange:E=>S(E.target.checked)}),i.jsx("span",{children:t("auth.rememberPassword")})]}):null,L?i.jsxs("div",{className:"cyber-status","data-tone":"error",children:[i.jsx("span",{className:"cyber-status-icon",children:"⚠"}),i.jsx("span",{children:L})]}):null,i.jsxs("button",{className:`cyber-submit ${O?"loading":""}`,type:"submit",disabled:O,children:[i.jsx("span",{className:"cyber-submit-glow"}),i.jsx("span",{className:"cyber-submit-border"}),i.jsx("span",{className:"cyber-submit-text",children:O?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"cyber-spinner"}),t("common.loading")]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"cyber-submit-icon",children:"➤"}),t("auth.submitLogin")]})})]})]}),c?i.jsxs("div",{className:"cyber-footer",children:[i.jsxs("div",{className:"cyber-divider",children:[i.jsx("span",{className:"cyber-divider-line"}),i.jsx("span",{className:"cyber-divider-text",children:"//"}),i.jsx("span",{className:"cyber-divider-line"})]}),i.jsxs("button",{className:"cyber-server-btn",onClick:()=>I(!0),type:"button",children:[i.jsx("span",{className:"cyber-server-icon",children:"⚙"}),i.jsx("span",{className:"cyber-server-text",children:t("auth.serverSettings")}),i.jsx("span",{className:"cyber-server-current",children:C})]})]}):null]})]}),i.jsxs("div",{className:"cyber-version",children:[i.jsxs("span",{className:"cyber-version-text",children:["v",a]}),i.jsx("span",{className:"cyber-version-divider",children:"|"}),i.jsx("span",{className:"cyber-version-text",children:"SYSTEM READY"})]})]}),c?i.jsx(oT,{isOpen:_,onClose:()=>I(!1),onSave:ne,theme:te}):null]})}function _r(){return An().haptics}function hT(){return Je.request("/api/workspaces")}async function fT(){try{return await Je.request("/api/workbench")}catch(e){if(!(e instanceof Jn)||e.status!==404)throw e;const t=await hT();return{items:await Promise.all(t.items.map(async s=>({workspace:s,sessions:(await yT(s.id)).items})))}}}function mT(e){return Je.request("/api/workspaces/import",{method:"POST",body:JSON.stringify(e)})}function pT(e){return Je.request("/api/workspaces/clone",{method:"POST",body:JSON.stringify(e)})}function Xx(e){return Je.request(`/api/workspaces/${encodeURIComponent(e)}`,{method:"DELETE"})}function Jx(e){const t=new URLSearchParams;return e!=null&&e.trim()&&t.set("path",e.trim()),Je.request(`/api/workspaces/browse${t.size>0?`?${t.toString()}`:""}`)}function gT(e){return Je.request("/api/workspaces/directories",{method:"POST",body:JSON.stringify(e)})}function yT(e){return Je.request(`/api/sessions?workspaceId=${encodeURIComponent(e)}`)}function vT(e){return Je.request(`/api/sessions/${encodeURIComponent(e)}`)}function wT(e){return Je.request(`/api/sessions/${encodeURIComponent(e)}/changed-files`)}function bT(e){return Je.request(`/api/sessions/${encodeURIComponent(e)}/seen`,{method:"POST"})}function Zx(e,t){return Je.request(`/api/sessions/${encodeURIComponent(e)}/title`,{method:"PATCH",body:JSON.stringify({title:t})})}function ek(e,t){return Je.request(`/api/sessions/${encodeURIComponent(e)}/archive`,{method:"PATCH",body:JSON.stringify({archived:t})})}function xT(e,t){return Je.request(`/api/sessions/${encodeURIComponent(e)}/favorite`,{method:"PATCH",body:JSON.stringify({favorite:t})})}function kT(e){return Je.request(`/api/sessions/${encodeURIComponent(e)}/capabilities`)}function ST(e){return Je.request(`/api/sessions/${encodeURIComponent(e)}/permission-requests`)}function CT(){return Je.request("/api/preferences/quick-phrases")}function jT(e){return Je.request("/api/preferences/quick-phrases",{method:"PUT",body:JSON.stringify({items:e})})}function NT(e,t){const n=new URLSearchParams;return t!=null&&t.trim()&&n.set("workspaceId",t.trim()),Je.request(`/api/providers/${encodeURIComponent(e)}/capabilities${n.size>0?`?${n.toString()}`:""}`)}function PT(e,t){return Je.requestBlob(`/api/sessions/${encodeURIComponent(e)}/attachments/${encodeURIComponent(t)}/content`)}function TT(e,t){return Je.request(`/api/sessions/${encodeURIComponent(e)}/messages`,{method:"POST",body:JSON.stringify(t)})}function ET(e){return Je.request("/api/sessions/start-live",{method:"POST",body:JSON.stringify(e)})}function RT(e,t){return Je.request(`/api/sessions/${encodeURIComponent(e)}/messages/live`,{method:"POST",body:JSON.stringify(t)})}function MT(e){return Je.request(`/api/sessions/${encodeURIComponent(e)}/queue`)}function AT(e,t){return Je.request(`/api/sessions/${encodeURIComponent(e)}/queue`,{method:"POST",body:JSON.stringify(t)})}function LT(e,t){return Je.request(`/api/sessions/${encodeURIComponent(e)}/queue/${encodeURIComponent(t)}`,{method:"DELETE"})}function IT(e,t){return Je.request(`/api/sessions/${encodeURIComponent(e)}/queue/${encodeURIComponent(t)}/steer`,{method:"POST"})}function By(e){return Je.request(`/api/sessions/${encodeURIComponent(e)}/runtime`)}function DT(e){return Je.request(`/api/sessions/${encodeURIComponent(e)}/interrupt`,{method:"POST"})}function _T(e,t,n){return Je.request(`/api/sessions/${encodeURIComponent(e)}/permission-requests/${encodeURIComponent(t)}/reply`,{method:"POST",body:JSON.stringify(n)})}function tk({connectionState:e,onReconnect:t}){const{showToast:n,dismissToast:s}=Kn();return v.useEffect(()=>{if(e==="connected"||e==="closed"){s("conversation-connection-state");return}if(e==="reconnect_failed"){n({id:"conversation-connection-state",title:h("conversation.connectionReconnectFailed"),description:h("conversation.reconnectFailedExplain"),tone:"warning",durationMs:null,action:{label:h("conversation.reconnectButton"),onClick:t}});return}n({id:"conversation-connection-state",title:h("conversation.connectionReconnecting"),description:h("conversation.reconnectExplain"),tone:"info",durationMs:3200})},[e,s,t,n]),null}function Jd(e,t){if(!e)return{allowed:!1,hidden:!1,reason:h("conversation.capabilityDenied")};switch(t){case"send_message":return e.canSendMessage===!1?{allowed:!1,hidden:!1,reason:h("conversation.capabilitySendDisabled")}:{allowed:!0,hidden:!1,reason:null};case"attachments":return e.supportsAttachments?{allowed:!0,hidden:!1,reason:null}:{allowed:!1,hidden:!1,reason:h("conversation.capabilityAttachmentDisabled")};case"interrupt":return e.supportsInterrupt?{allowed:!0,hidden:!1,reason:null}:{allowed:!1,hidden:!1,reason:h("conversation.capabilityInterruptDisabled")};default:return{allowed:!1,hidden:!1,reason:h("conversation.capabilityDenied")}}}const FT=new Set(["low","medium","high","xhigh"]),OT={"claude-code":{displayNameKey:"conversation.providerClaude",draftTitleKey:"conversation.draftTitleClaude",defaultModelLabelKey:"conversation.modelUseCliDefault",defaultRunInputMode:"streaming_guidance",reasoningLevelPersists:!1,defaultReasoningLevel:void 0,supportsSlashMenuByDefault:!0,foldRulesMessagesByDefault:!1},codex:{displayNameKey:"conversation.providerCodex",draftTitleKey:"conversation.draftTitleCodex",defaultModelLabelKey:"conversation.modelUseCliDefault",defaultRunInputMode:"none",reasoningLevelPersists:!0,defaultReasoningLevel:null,supportsSlashMenuByDefault:!1,foldRulesMessagesByDefault:!0},opencode:{displayNameKey:"conversation.providerOpenCode",draftTitleKey:"conversation.draftTitleOpenCode",defaultModelLabelKey:"conversation.modelUseCliDefault",defaultRunInputMode:"none",reasoningLevelPersists:!1,defaultReasoningLevel:void 0,supportsSlashMenuByDefault:!1,foldRulesMessagesByDefault:!1}};function ho(e){return e?OT[e]??null:null}function BT(e){return[{id:"provider-default",name:h(e),usesProviderDefault:!0}]}function UT(e){const t=ho(e);return BT((t==null?void 0:t.defaultModelLabelKey)??"conversation.modelUseCliDefault")}function WT(e){return!!e}function zT(e){const t=ho(e);return h((t==null?void 0:t.draftTitleKey)??"conversation.draftTitleCodex")}function HT(e){const t=ho(e);return{provider:e,canStartSession:!0,canResumeSession:!0,canSendMessage:!0,inRunInputMode:(t==null?void 0:t.defaultRunInputMode)??"none",supportsSubagents:!1,supportsInterrupt:!1,supportsStructuredToolCalls:!0,supportsTokenUsage:!0,supportsAttachments:!0,supportsPermissionPrompt:!0,supportsCheckpoint:!1,modelOptions:UT(e),defaultReasoningLevel:t==null?void 0:t.defaultReasoningLevel,limitations:[]}}function qT(e){return(e==null?void 0:e.provider)??"claude-code"}function $T(e){var n;if((e==null?void 0:e.supportsSlashMenu)!==void 0)return e.supportsSlashMenu;const t=(e==null?void 0:e.provider)??null;return((n=ho(t))==null?void 0:n.supportsSlashMenuByDefault)??!1}function VT(e){var t;return(e==null?void 0:e.supportsReasoningSelector)!==void 0?e.supportsReasoningSelector:!!((t=e==null?void 0:e.modelOptions)!=null&&t.some(n=>{var s;return((s=n.supportedReasoningEfforts)==null?void 0:s.some(a=>FT.has(a)))??!1}))}function GT(e,t){if((e==null?void 0:e.supportsQueueWhileRunning)!==void 0)return e.supportsQueueWhileRunning;const n=(e==null?void 0:e.inRunInputMode)??"none";return n==="queued_guidance"||n==="none"||n==="streaming_guidance"&&t===!1}function nk(e){return(e==null?void 0:e.supportsRunSteering)!==void 0?e.supportsRunSteering:(e==null?void 0:e.inRunInputMode)==="streaming_guidance"}function KT(e){const t=ho(e);return(t==null?void 0:t.reasoningLevelPersists)??!1}function QT(e,t){var s;return((s=ho(t??null))==null?void 0:s.foldRulesMessagesByDefault)??!1}function YT(){return i.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{d:"M7 7L17 17M17 7L7 17",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})})}function Cr({open:e,title:t,description:n,className:s,onClose:a,children:c}){return v.useEffect(()=>{if(!e)return;function l(d){d.key==="Escape"&&a()}return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[a,e]),!e||typeof document>"u"?null:On.createPortal(i.jsxs("div",{className:"workbench-modal-layer",children:[i.jsx("button",{type:"button",className:"workbench-modal-backdrop","aria-label":h("common.close"),onClick:a}),i.jsxs("section",{className:`workbench-modal-card surface-card${s?` ${s}`:""}`,role:"dialog","aria-modal":"true","aria-label":t,children:[i.jsxs("div",{className:"workbench-modal-header",children:[i.jsxs("div",{className:"workbench-modal-title-wrap",children:[i.jsx("h2",{children:t}),i.jsx("p",{children:n})]}),i.jsx("button",{type:"button",className:"workbench-modal-close","aria-label":h("common.close"),onClick:a,children:i.jsx(YT,{})})]}),i.jsx("div",{className:"workbench-modal-body",children:c})]})]}),document.body)}const XT="codingns.conversation.composer-draft:",JT=1,ZT=[{id:"builtin-stage-and-summarize",text:"请将本次会话变更的所有代码提交到git暂存区,然后总结一条中文的提交信息"},{id:"builtin-review-module",text:"分析本项目 模块的代码实现,并分析存在的问题"},{id:"builtin-group-commits",text:"分析当前项目中的未提交文件,按照功能模块进行分类提交,提交信息格式请参考我最近的提交记录"}];function Yf(){return typeof window<"u"&&typeof window.localStorage<"u"}function eE(e){if(!e||typeof e!="object")return null;const t="id"in e?e.id:null,n="fileName"in e?e.fileName:null,s="mimeType"in e?e.mimeType:null,a="fileSize"in e?e.fileSize:null,c="lastModified"in e?e.lastModified:null,l="contentBase64"in e?e.contentBase64:null;if(typeof t!="string"||typeof n!="string"||typeof s!="string"||typeof a!="number"||typeof c!="number"||typeof l!="string")return null;const d=t.trim(),f=n.trim(),p=s.trim(),y=l.trim();return!d||!f||!p||a<0||c<0||!y?null:{id:d,fileName:f,mimeType:p,fileSize:a,lastModified:c,contentBase64:y}}function tE(e){if(!e||typeof e!="object")return null;const t="content"in e?e.content:null,n="attachments"in e?e.attachments:null;if(typeof t!="string"||!Array.isArray(n))return null;const s=n.map(a=>eE(a)).filter(a=>a!==null);return s.length!==n.length||t.length===0&&s.length===0?null:{content:t,attachments:s}}function wa(e){return`${XT}${e}`}function nE(e){var t,n;return{id:((n=(t=globalThis.crypto)==null?void 0:t.randomUUID)==null?void 0:n.call(t))??`phrase-${Date.now()}-${Math.random().toString(16).slice(2)}`,text:e.trim()}}function rE(e){if(!Yf())return null;const t=e.trim();if(!t)return null;const n=window.localStorage.getItem(wa(t));if(!n)return null;try{const s=JSON.parse(n),a=s&&typeof s=="object"&&"draft"in s&&s.draft&&typeof s.draft=="object"?s.draft:s,c=tE(a);return c||(window.localStorage.removeItem(wa(t)),null)}catch{return window.localStorage.removeItem(wa(t)),null}}function iE(e,t){if(!Yf())return!1;const n=e.trim();if(!n)return!1;if(t.content.length===0&&t.attachments.length===0)return rk(n),!0;try{return window.localStorage.setItem(wa(n),JSON.stringify({schemaVersion:JT,draft:t})),!0}catch{return!1}}function rk(e){if(!Yf())return;const t=e.trim();t&&window.localStorage.removeItem(wa(t))}const sE="provider-default",oE="provider-default",aE="provider-default",Uy="workbench:focus-composer",lE="provider-default",Wy={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0};function cE(){return[{id:sE,name:h("conversation.modelUseCliDefault"),provider:"claude-code",usesProviderDefault:!0}]}function uE(){return[{id:oE,name:h("conversation.modelUseCliDefault"),provider:"codex",usesProviderDefault:!0}]}function dE(){return[{id:aE,name:h("conversation.modelUseCliDefault"),provider:"opencode",usesProviderDefault:!0}]}function hE(e){return e==="claude-code"?cE():e==="opencode"?dE():uE()}function fE(e){return e.usesProviderDefault===!0||e.id===lE}function mE(){var e,t;return((t=(e=globalThis.crypto)==null?void 0:e.randomUUID)==null?void 0:t.call(e))??`${Date.now()}-${Math.random().toString(16).slice(2)}`}function pE(e){if(e){e.value="";try{const t=e.showPicker;if(typeof t=="function"){t.call(e);return}}catch{}e.click()}}function gE(e,t,n,s){const a=globalThis.atob(n),c=Uint8Array.from(a,l=>l.charCodeAt(0));return new File([c],e,{type:t,lastModified:s})}function yE(e){const t=gE(e.fileName,e.mimeType,e.contentBase64,e.lastModified);return{id:e.id,file:t,previewUrl:URL.createObjectURL(t)}}function vE(e,t){return{id:t,kind:"image",fileName:e.name,mimeType:e.type||"image/png",fileSize:e.size}}function zy(e){return new Promise((t,n)=>{const s=new FileReader;s.onerror=()=>{n(s.error??new Error("FILE_READ_FAILED"))},s.onload=()=>{const a=typeof s.result=="string"?s.result:"",c=a.includes(",")?a.split(",").at(-1)??"":a;t(c)},s.readAsDataURL(e)})}function wE(e){e.forEach(t=>{URL.revokeObjectURL(t.previewUrl)})}function bE(e){const t=[];let n=0;for(const s of e){if(s.type.startsWith("image/")){t.push(s);continue}n+=1}return{accepted:t,rejectedCount:n}}function xE(e,t){const n=new Set(e.map(a=>`${a.file.name}:${a.file.size}:${a.file.lastModified}`)),s=[...e];return t.forEach(a=>{const c=`${a.name}:${a.size}:${a.lastModified}`;n.has(c)||(n.add(c),s.push({id:mE(),file:a,previewUrl:URL.createObjectURL(a)}))}),s}function ik({capabilities:e,draftStorageId:t,panelRef:n,portalContainer:s=null,hasActiveRun:a=null,canInterrupt:c=null,contextUsage:l=null,hasPendingQueuedMessages:d=!1,isSubmitting:f,isRunning:p=!1,onInterrupt:y,onQueueSend:g,onSend:b}){const k=An(),S=v.useId(),C=v.useId(),[j,A]=v.useState(""),[L,M]=v.useState(""),[O,q]=v.useState("medium"),[_,I]=v.useState([]),[F,D]=v.useState(!1),[P,K]=v.useState(ZT),[X,$]=v.useState(!1),[ee,te]=v.useState(!1),[pe,ne]=v.useState(""),[z,ye]=v.useState(!1),[E,W]=v.useState(!1),[re,T]=v.useState(!1),[ae,Le]=v.useState(!1),je=v.useRef(null),He=v.useRef(null),qe=v.useRef(null),et=v.useRef(!1),ot=v.useRef(new Set),bt=v.useRef(new Map),Ct=v.useRef(0),{showToast:lt}=Kn(),kt=_r(),Ve=qT(e),Tt=uo(se=>Gd(Ve)?se.profile.providers[Ve]:null),Ot=(Tt==null?void 0:Tt.defaultModel)??null,St=(Tt==null?void 0:Tt.defaultReasoningLevel)??null,Mt=v.useMemo(()=>Jd(e,"send_message"),[e]),Ht=v.useMemo(()=>Jd(e,"interrupt"),[e]),At=v.useMemo(()=>Jd(e,"attachments"),[e]),vt=v.useMemo(()=>{var Ce;const se=(Ce=e==null?void 0:e.modelOptions)==null?void 0:Ce.map(B=>{var le;return{...B,provider:Ve,supportedReasoningEfforts:(le=B.supportedReasoningEfforts)==null?void 0:le.filter(Se=>Se==="low"||Se==="medium"||Se==="high"||Se==="xhigh")}});return se!=null&&se.length?se:hE(Ve)},[e==null?void 0:e.modelOptions,Ve]),$t=v.useMemo(()=>vt.find(se=>se.id===L)??null,[vt,L]),Dt=VT(e),Lt=$T(e),ue=v.useMemo(()=>[{value:"low",label:h("conversation.reasoningLow")},{value:"medium",label:h("conversation.reasoningMedium")},{value:"high",label:h("conversation.reasoningHigh")},{value:"xhigh",label:h("conversation.reasoningMaximum")}],[]),ge=v.useMemo(()=>{if(!Dt)return[];const se=$t==null?void 0:$t.supportedReasoningEfforts;return!se||se.length===0?ue:ue.filter(Ce=>se.includes(Ce.value))},[Dt,ue,$t==null?void 0:$t.supportedReasoningEfforts]),Be=v.useMemo(()=>vt.map(se=>({value:se.id,label:fE(se)?h("conversation.modelUseCliDefault"):se.name})),[vt]),Pe=v.useMemo(()=>ge.map(se=>({value:se.value,label:se.label})),[ge]),ft=v.useMemo(()=>[{command:"/plan",label:h("conversation.slashCommandPlan")},{command:"/review",label:h("conversation.slashCommandReview")},{command:"/explain",label:h("conversation.slashCommandExplain")}],[]),dt=(e==null?void 0:e.inRunInputMode)??"none",Rt=a??null,ht=p&&dt==="streaming_guidance"&&Rt===!1&&!nk(e),Nt=p&&dt==="streaming_guidance"&&!ht,jt=p&&typeof g=="function"&&GT(e,Rt),V=p&&!Nt&&!jt,Me=j.trim().length>0||_.length>0,ze=c??Ht.allowed,Bt=p&&ze&&!!y&&!re&&!Me&&!ae&&!f,Zt=!Bt&&!Me&&(ae||f||p||!p&&d),Vt=h(ae||f||d?"conversation.sendingState":"conversation.runtimeRunning"),ke=h(p?jt?"conversation.queueGuidanceButton":Nt?"conversation.sendGuidanceButton":"conversation.sendButton":"conversation.sendButton"),Qe=v.useCallback(se=>{M(se),Gd(Ve)&&_c({providers:{[Ve]:{defaultModel:se}}}).catch(()=>{})},[Ve]),cn=v.useCallback(se=>{q(se),Gd(Ve)&&_c({providers:{[Ve]:{defaultReasoningLevel:se}}}).catch(()=>{})},[Ve]),yn=v.useCallback(se=>{ot.current.forEach(Ce=>{URL.revokeObjectURL(Ce)}),ot.current.clear(),se.forEach(Ce=>{ot.current.add(Ce.previewUrl)}),I(se)},[]),un=v.useCallback(se=>{const{accepted:Ce,rejectedCount:B}=bE(se);B>0&&lt({title:h("conversation.attachmentImageOnly"),tone:"error"}),Ce.length!==0&&I(le=>{const Se=xE(le,Ce);return Se.forEach(Ye=>{ot.current.add(Ye.previewUrl)}),Se})},[lt]),on=v.useCallback(se=>{bt.current.delete(se),I(Ce=>{const B=Ce.find(le=>le.id===se);return B&&(ot.current.delete(B.previewUrl),URL.revokeObjectURL(B.previewUrl)),Ce.filter(le=>le.id!==se)})},[]),wn=v.useCallback(se=>{const Ce=Array.from(se.target.files??[]);Ce.length>0&&un(Ce),se.target.value=""},[un]),xn=v.useCallback(()=>{!At.allowed||V||D(!1)},[At.allowed,V]),H=v.useCallback(()=>{if(!(!At.allowed||V)){if(W(!1),k.isNativeMobile){kt.trigger("selection"),D(!0);return}pE(He.current)}},[At.allowed,kt,V,k.isNativeMobile]),Z=v.useCallback(()=>{W(se=>!se)},[]),ie=v.useCallback(se=>{var Ce;A(B=>B.trimStart().startsWith(se)?B:B.trim()?`${se} ${B.trim()}`:`${se} `),W(!1),(Ce=je.current)==null||Ce.focus()},[]),we=v.useCallback(async se=>{const Ce=P;Ct.current+=1,K(se),ye(!0);try{const B=await jT(se.map(le=>({id:le.id,text:le.text})));return K(B.items.map(le=>({id:le.id,text:le.text}))),!0}catch(B){return K(Ce),lt({title:B instanceof Error?B.message:h("conversation.quickPhraseSaveFailed"),tone:"error"}),!1}finally{ye(!1)}},[P,lt]),Te=v.useCallback(async()=>{const se=pe.trim();!se||!await we([...P,nE(se)])||(ne(""),te(!1))},[we,pe,P]),Ae=v.useCallback(se=>{we(P.filter(Ce=>Ce.id!==se))},[we,P]),$e=v.useCallback((se,Ce)=>{const B=P.findIndex(tt=>tt.id===se);if(B<0)return;const le=B+Ce;if(le<0||le>=P.length)return;const Se=[...P],[Ye]=Se.splice(B,1);Se.splice(le,0,Ye),we(Se)},[we,P]),Ie=v.useCallback(se=>{var Ce;A(se),$(!1),(Ce=je.current)==null||Ce.focus()},[]),Ue=v.useCallback(se=>{const Ce=se?rE(se):null,B=(Ce==null?void 0:Ce.attachments.map(le=>yE(le)))??[];bt.current=new Map(((Ce==null?void 0:Ce.attachments)??[]).map(le=>[le.id,le])),yn(B),A((Ce==null?void 0:Ce.content)??""),W(!1)},[yn]);v.useEffect(()=>{if(!vt.length)return;if(Ot&&vt.some(Ce=>Ce.id===Ot)){L!==Ot&&M(Ot);return}if(vt.some(Ce=>Ce.id===L))return;const se=vt[0].id;M(se)},[vt,Ve,L,Ot]),v.useEffect(()=>{if(!KT(Ve)||ge.length===0)return;if(St&&ge.some(B=>B.value===St)){O!==St&&q(St);return}const se=e==null?void 0:e.defaultReasoningLevel;if(se&&ge.some(B=>B.value===se)){O!==se&&q(se);return}if(ge.some(B=>B.value===O))return;const Ce=ge[0].value;q(Ce)},[ge,e==null?void 0:e.defaultReasoningLevel,Ve,O,St]),v.useEffect(()=>{let se=!1;const Ce=Ct.current;return CT().then(B=>{se||Ct.current!==Ce||K(B.items.map(le=>({id:le.id,text:le.text})))}).catch(()=>{}),()=>{se=!0}},[]),v.useEffect(()=>{Ue(t)},[t,Ue]),v.useEffect(()=>{if(!t)return;const se=t,Ce=new Set(_.map(Se=>Se.id));bt.current.forEach((Se,Ye)=>{Ce.has(Ye)||bt.current.delete(Ye)});let B=!1;async function le(){if(j.length===0&&_.length===0){rk(se);return}const Se=await Promise.all(_.map(async Ye=>{const tt=bt.current.get(Ye.id);return tt&&tt.fileName===Ye.file.name&&tt.fileSize===Ye.file.size&&tt.lastModified===Ye.file.lastModified&&tt.mimeType===(Ye.file.type||"image/png")?tt:{id:Ye.id,fileName:Ye.file.name,mimeType:Ye.file.type||"image/png",fileSize:Ye.file.size,lastModified:Ye.file.lastModified,contentBase64:await zy(Ye.file)}}));B||(bt.current=new Map(Se.map(Ye=>[Ye.id,Ye])),iE(se,{content:j,attachments:Se}))}return le(),()=>{B=!0}},[_,j,t]),v.useEffect(()=>{const se=je.current;se&&(se.style.height="0px",se.style.height=`${Math.min(se.scrollHeight,120)}px`)},[j]),v.useEffect(()=>{At.allowed||(bt.current.clear(),D(!1),yn([]))},[At.allowed,yn]),v.useEffect(()=>{k.isMobile||D(!1)},[k.isMobile]),v.useEffect(()=>()=>{ot.current.forEach(se=>{URL.revokeObjectURL(se)}),ot.current.clear()},[]),v.useEffect(()=>{function se(){var Ce;(Ce=je.current)==null||Ce.focus()}return window.addEventListener(Uy,se),()=>{window.removeEventListener(Uy,se)}},[]);async function Fe(se){if(et.current)return;const Ce=j.trim(),B=_;if(Ce.length===0&&B.length===0||!Mt.allowed||V){lt({title:V?h("conversation.runtimeRunning"):Mt.reason??h("conversation.capabilityDenied"),tone:"error"});return}et.current=!0,kt.trigger(se==="queue"?"selection":"action"),Le(!0),A(""),I([]),D(!1),$(!1),te(!1),W(!1);try{const le=await Promise.all(B.map(async tt=>({fileName:tt.file.name,mimeType:tt.file.type||"image/png",fileSize:tt.file.size,contentBase64:await zy(tt.file)}))),Se=B.map(tt=>vE(tt.file,tt.id));await(se==="queue"&&g?g:b)(Ce,{model:$t!=null&&$t.usesProviderDefault?void 0:L||void 0,reasoningLevel:Dt&&ge.length>0?O:void 0,attachments:le,attachmentMeta:Se}),wE(B),B.forEach(tt=>{ot.current.delete(tt.previewUrl)})}catch(le){A(Ce),I(B),lt({title:le instanceof Error&&le.message==="FILE_READ_FAILED"?h("conversation.attachmentReadFailed"):le instanceof Error?le.message:h("conversation.capabilityDenied"),tone:"error"})}finally{Le(!1),et.current=!1}}async function Oe(se){se.preventDefault(),await Fe(jt?"queue":"send")}async function ct(){if(!(!ze||!y||re))try{T(!0),kt.trigger("action"),await y()}catch(se){lt({title:se instanceof Error?se.message:h("conversation.capabilityInterruptDisabled"),tone:"error"})}finally{T(!1)}}const rt=ae||f||V||!Mt.allowed||!Me,Ut=ae||f||V||!At.allowed,Pt=j.length===0&&!V,We=i.jsxs("section",{ref:n,className:"composer-panel",children:[i.jsxs("form",{className:"composer-form",onSubmit:Oe,children:[i.jsx("input",{id:S,ref:He,type:"file",accept:"image/*",multiple:!0,tabIndex:-1,"aria-hidden":"true",style:Wy,onChange:wn}),i.jsx("input",{id:C,ref:qe,type:"file",accept:"image/*",capture:"environment",tabIndex:-1,"aria-hidden":"true",style:Wy,onChange:wn}),i.jsxs("div",{className:"composer-input-container",children:[_.length>0?i.jsx("div",{className:"composer-attachments",children:_.map(se=>i.jsxs("div",{className:"composer-attachment-card",children:[i.jsx("img",{src:se.previewUrl,alt:h("conversation.attachmentPreviewAlt"),className:"composer-attachment-preview"}),i.jsxs("div",{className:"composer-attachment-meta",children:[i.jsx("span",{className:"attachment-name",title:se.file.name,children:se.file.name}),i.jsxs("span",{className:"attachment-size",children:[(se.file.size/1024).toFixed(1)," KB"]})]}),i.jsx("button",{type:"button",className:"attachment-remove",onClick:()=>on(se.id),"aria-label":h("conversation.removeAttachment"),children:i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},se.id))}):null,i.jsxs("div",{className:"composer-input-wrapper",children:[i.jsx("textarea",{ref:je,className:"composer-input",value:j,placeholder:h("conversation.composerPlaceholder"),readOnly:V,"aria-readonly":V,onChange:se=>A(se.target.value),rows:1,onFocus:()=>W(!1),onPaste:se=>{if(V||!At.allowed)return;const Ce=Array.from(se.clipboardData.items).filter(B=>B.kind==="file").map(B=>B.getAsFile()).filter(B=>!!B);Ce.length!==0&&(se.preventDefault(),un(Ce))},onKeyDown:se=>{se.key==="Escape"&&W(!1),se.key==="Enter"&&!se.shiftKey&&(se.preventDefault(),rt||Oe(se))}}),Pt?i.jsx("button",{type:"button",className:"composer-quick-phrase-trigger","aria-label":h("conversation.quickPhraseTrigger"),title:h("conversation.quickPhraseTrigger"),onClick:()=>{$(!0),W(!1)},children:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("path",{d:"M7 8h10"}),i.jsx("path",{d:"M7 12h8"}),i.jsx("path",{d:"M7 16h5"}),i.jsx("path",{d:"M5 5h14v14H9l-4 4V5z"})]})}):null]}),E?i.jsx("div",{className:"composer-slash-menu",role:"menu","aria-label":h("conversation.slashMenuTitle"),children:ft.map(se=>i.jsxs("button",{type:"button",className:"composer-slash-item",onClick:()=>ie(se.command),children:[i.jsx("span",{className:"composer-slash-command",children:se.command}),i.jsx("span",{className:"composer-slash-label",children:se.label})]},se.command))}):null,i.jsxs("div",{className:"composer-controls",children:[i.jsxs("div",{className:"composer-controls-left",children:[At.allowed?k.isNativeMobile?i.jsx("button",{type:"button",className:"composer-attach-btn","aria-label":h("conversation.attachFiles"),title:h("conversation.attachFiles"),disabled:Ut,onClick:H,children:i.jsx(Zd,{})}):Ut?i.jsx("button",{type:"button",className:"composer-attach-btn","aria-label":h("conversation.attachFiles"),title:h("conversation.attachFiles"),disabled:!0,children:i.jsx(Zd,{})}):i.jsx("label",{htmlFor:S,className:"composer-attach-btn","aria-label":h("conversation.attachFiles"),title:h("conversation.attachFiles"),onClick:()=>{W(!1)},children:i.jsx(Zd,{})}):null,i.jsx(Hy,{ariaLabel:h("conversation.modelSelectorLabel"),value:L,options:Be,onChange:Qe}),Dt&&ge.length>0?i.jsx(Hy,{ariaLabel:h("conversation.reasoningSelectorLabel"),value:O,options:Pe,onChange:se=>cn(se),compact:!0}):null,Lt?i.jsxs("button",{type:"button",className:"composer-slash-btn",onClick:Z,title:h("conversation.slashMenu"),children:[i.jsx("span",{className:"slash-icon",children:"/"}),i.jsx("span",{children:h("conversation.slashMenu")})]}):null,i.jsx(jE,{contextUsage:l})]}),Zt?i.jsx("div",{className:"composer-send-group",children:i.jsx("button",{className:"composer-send composer-send-busy",type:"button",disabled:!0,"aria-label":Vt,title:Vt,children:i.jsxs("svg",{className:"composer-send-spinner",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[i.jsx("circle",{cx:"12",cy:"12",r:"8",stroke:"currentColor",strokeOpacity:"0.28",strokeWidth:"2.5"}),i.jsx("path",{d:"M20 12a8 8 0 0 0-8-8",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})]})})}):i.jsx("div",{className:"composer-send-group",children:Bt?i.jsx("button",{className:"composer-send composer-send-busy",type:"button",onClick:()=>{ct()},"aria-label":h("conversation.capabilityInterrupt"),title:h("conversation.capabilityInterrupt"),children:i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:i.jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})}):i.jsx("button",{className:"composer-send",type:"submit",disabled:rt,"aria-label":ke,title:ke,children:i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[i.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),i.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})})]})]})]}),i.jsx(Cr,{open:X,title:h("conversation.quickPhraseModalTitle"),description:h("conversation.quickPhraseModalDescription"),className:"composer-quick-phrase-modal",onClose:()=>{$(!1),te(!1)},children:i.jsxs("div",{className:"composer-quick-phrase-modal-body",children:[i.jsxs("div",{className:"composer-quick-phrase-toolbar",children:[i.jsx("div",{className:"composer-quick-phrase-toolbar-copy",children:i.jsx("span",{children:h("conversation.quickPhraseListLabel")})}),i.jsx("button",{type:"button",className:"primary-button",disabled:z,onClick:()=>te(!0),children:h("conversation.quickPhraseOpenCreateAction")})]}),i.jsx("div",{className:"composer-quick-phrase-list",role:"list","aria-label":h("conversation.quickPhraseListLabel"),children:P.length===0?i.jsx("div",{className:"composer-quick-phrase-empty",children:h("conversation.quickPhraseEmpty")}):P.map((se,Ce)=>i.jsxs("div",{className:"composer-quick-phrase-item",role:"listitem",children:[i.jsxs("button",{type:"button",className:"composer-quick-phrase-select",onClick:()=>Ie(se.text),children:[i.jsx("span",{className:"composer-quick-phrase-order",children:h("conversation.quickPhraseOrderLabel",{index:Ce+1})}),i.jsx("span",{className:"composer-quick-phrase-text",children:se.text})]}),i.jsxs("div",{className:"composer-quick-phrase-actions",children:[i.jsx("button",{type:"button",className:"composer-quick-phrase-action",disabled:z||Ce===0,"aria-label":h("conversation.quickPhraseMoveUp"),title:h("conversation.quickPhraseMoveUp"),onClick:()=>$e(se.id,-1),children:"↑"}),i.jsx("button",{type:"button",className:"composer-quick-phrase-action",disabled:z||Ce===P.length-1,"aria-label":h("conversation.quickPhraseMoveDown"),title:h("conversation.quickPhraseMoveDown"),onClick:()=>$e(se.id,1),children:"↓"}),i.jsx("button",{type:"button",className:"composer-quick-phrase-action is-danger",disabled:z,"aria-label":h("conversation.quickPhraseDelete"),title:h("conversation.quickPhraseDelete"),onClick:()=>Ae(se.id),children:"×"})]})]},se.id))})]})}),i.jsx(Cr,{open:ee,title:h("conversation.quickPhraseCreateModalTitle"),description:h("conversation.quickPhraseCreateModalDescription"),className:"composer-quick-phrase-create-modal",onClose:()=>te(!1),children:i.jsxs("div",{className:"composer-quick-phrase-modal-body",children:[i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("conversation.quickPhraseCreateLabel")}),i.jsx("textarea",{className:"composer-quick-phrase-textarea",value:pe,placeholder:h("conversation.quickPhraseCreatePlaceholder"),rows:4,onChange:se=>ne(se.target.value)})]}),i.jsxs("div",{className:"workbench-modal-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",onClick:()=>te(!1),children:h("common.cancel")}),i.jsx("button",{type:"button",className:"primary-button",disabled:z||pe.trim().length===0,onClick:()=>{Te()},children:h("conversation.quickPhraseCreateAction")})]})]})}),i.jsx(kE,{open:F&&k.isNativeMobile,cameraInputId:C,libraryInputId:S,onClose:()=>D(!1),onSelectCamera:xn,onSelectLibrary:xn})]});return s?On.createPortal(We,s):We}function kE({open:e,cameraInputId:t,libraryInputId:n,onClose:s,onSelectCamera:a,onSelectLibrary:c}){return!e||typeof document>"u"?null:On.createPortal(i.jsx("div",{className:"ios-action-sheet-overlay composer-attachment-sheet-overlay",role:"presentation",onClick:s,children:i.jsxs("div",{className:"mobile-workspace-home-sheet composer-attachment-sheet",role:"dialog","aria-modal":"true","aria-label":h("conversation.attachmentSourceSheetTitle"),onClick:l=>l.stopPropagation(),children:[i.jsxs("div",{className:"mobile-workspace-home-sheet-card composer-attachment-sheet-card",children:[i.jsxs("div",{className:"mobile-workspace-home-sheet-header",children:[i.jsx("strong",{children:h("conversation.attachmentSourceSheetTitle")}),i.jsx("span",{children:h("conversation.attachmentSourceSheetDescription")})]}),i.jsxs("div",{className:"mobile-workspace-home-group composer-attachment-sheet-actions",children:[i.jsxs("label",{htmlFor:t,className:"mobile-workspace-home-row composer-attachment-sheet-option","aria-label":h("conversation.attachmentTakePhoto"),onClick:a,children:[i.jsxs("span",{className:"composer-attachment-sheet-option-copy",children:[i.jsx("strong",{children:h("conversation.attachmentTakePhoto")}),i.jsx("span",{children:h("conversation.attachmentTakePhotoHint")})]}),i.jsx(SE,{})]}),i.jsxs("label",{htmlFor:n,className:"mobile-workspace-home-row composer-attachment-sheet-option","aria-label":h("conversation.attachmentChooseFromLibrary"),onClick:c,children:[i.jsxs("span",{className:"composer-attachment-sheet-option-copy",children:[i.jsx("strong",{children:h("conversation.attachmentChooseFromLibrary")}),i.jsx("span",{children:h("conversation.attachmentChooseFromLibraryHint")})]}),i.jsx(CE,{})]})]})]}),i.jsx("button",{type:"button",className:"ios-action-sheet-cancel",onClick:s,children:h("common.cancel")})]})}),document.body)}function SE(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("path",{d:"M4 8h3l1.5-2h7L17 8h3a1 1 0 0 1 1 1v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a1 1 0 0 1 1-1Z"}),i.jsx("circle",{cx:"12",cy:"13",r:"4"})]})}function Zd(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4"}),i.jsx("path",{d:"M8 12h8M12 8v8"})]})}function CE(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2.5"}),i.jsx("path",{d:"m7.5 15 3-3 2.5 2.5 3-4L18 13.5"}),i.jsx("circle",{cx:"8.75",cy:"8.75",r:"1.25",fill:"currentColor",stroke:"none"})]})}function Hy({ariaLabel:e,value:t,options:n,onChange:s,compact:a=!1}){const[c,l]=v.useState(!1),d=v.useRef(null),f=v.useRef(null),p=v.useRef(null),[y,g]=v.useState(null),b=v.useId(),k=n.find(C=>C.value===t)??n[0]??null,S=v.useCallback(()=>{const C=f.current;if(!C||typeof window>"u")return;const j=C.getBoundingClientRect(),A=window.innerWidth,L=window.innerHeight,M=12,O=10,q=Math.max(160,A-M*2),_=a?140:220,I=Math.min(q,Math.max(j.width,_)),F=Math.min(Math.max(M,j.left),Math.max(M,A-I-M)),D=j.top-M,P=L-j.bottom-M,K=D>=180||D>=P;g({position:"fixed",left:F,width:I,maxWidth:q,top:K?void 0:j.bottom+O,bottom:K?L-j.top+O:void 0})},[a]);return v.useEffect(()=>{if(!c)return;function C(A){var M,O;const L=A.target;!((M=d.current)!=null&&M.contains(L))&&!((O=p.current)!=null&&O.contains(L))&&l(!1)}function j(A){A.key==="Escape"&&l(!1)}return window.addEventListener("pointerdown",C),window.addEventListener("keydown",j),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),S(),()=>{window.removeEventListener("pointerdown",C),window.removeEventListener("keydown",j),window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0)}},[c,S]),k?i.jsxs("div",{ref:d,className:`composer-mac-select ${a?"is-compact":""}`,"data-open":c?"true":"false",children:[i.jsxs("button",{ref:f,type:"button",className:"composer-mac-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":c,"aria-controls":b,onClick:()=>l(C=>!C),children:[i.jsx("span",{className:"composer-mac-select-label",children:k.label}),i.jsx("svg",{className:"composer-mac-select-chevron",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("polyline",{points:"6 14 12 8 18 14"})})]}),c&&y&&typeof document<"u"?On.createPortal(i.jsx("div",{ref:p,className:"composer-mac-select-popover",style:y,role:"presentation",children:i.jsx("div",{id:b,className:"composer-mac-select-list",role:"listbox","aria-label":e,children:n.map(C=>{const j=C.value===t;return i.jsxs("button",{type:"button",role:"option","aria-selected":j,className:`composer-mac-select-option ${j?"is-selected":""}`,onClick:()=>{s(C.value),l(!1)},children:[i.jsx("span",{className:"composer-mac-select-option-check","aria-hidden":"true",children:j?"✓":""}),i.jsx("span",{className:"composer-mac-select-option-label",children:C.label})]},C.value)})})}),document.body):null]}):null}function jE({contextUsage:e}){const[t,n]=v.useState(!1),s=v.useRef(null),a=v.useRef(null),[c,l]=v.useState(null),d=v.useId(),f=e?Math.round(e.usageRatio*100):null,p=e?Math.max(0,Math.min(e.usageRatio,1)):0,y=NE(p),g=e?PE(e.contextWindowSource):null,b=e?`${h("conversation.contextUsageTitle")} ${f}%`:h("conversation.contextUsageUnavailable"),k=v.useCallback(()=>{const S=s.current;if(!S||typeof window>"u")return;const C=S.getBoundingClientRect(),j=window.innerWidth,A=window.innerHeight,L=12,M=10,O=Math.min(240,Math.max(188,j-L*2)),q=Math.min(Math.max(L,C.left+C.width/2-O/2),Math.max(L,j-O-L)),_=C.top-L,I=A-C.bottom-L,F=_>=140||_>=I;l({position:"fixed",left:q,width:O,maxWidth:j-L*2,top:F?void 0:C.bottom+M,bottom:F?A-C.top+M:void 0})},[]);return v.useEffect(()=>{if(!t)return;function S(j){var L,M;const A=j.target;!((L=s.current)!=null&&L.contains(A))&&!((M=a.current)!=null&&M.contains(A))&&n(!1)}function C(j){j.key==="Escape"&&n(!1)}return window.addEventListener("pointerdown",S),window.addEventListener("keydown",C),window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),k(),()=>{window.removeEventListener("pointerdown",S),window.removeEventListener("keydown",C),window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0)}},[t,k]),i.jsxs(i.Fragment,{children:[i.jsx("button",{ref:s,type:"button",className:`composer-context-ring ${y}`,style:{"--context-usage-progress":`${p}`},"aria-label":b,"aria-expanded":t,"aria-describedby":t?d:void 0,onClick:()=>n(S=>!S),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),children:i.jsx("span",{className:"composer-context-ring-value",children:f===null?"--":i.jsxs(i.Fragment,{children:[i.jsx("span",{children:f}),i.jsx("span",{className:"composer-context-ring-suffix",children:"%"})]})})}),t&&c&&typeof document<"u"?On.createPortal(i.jsx("div",{ref:a,id:d,className:"composer-context-tooltip",style:c,role:"tooltip",children:e?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"composer-context-tooltip-title",children:h("conversation.contextUsageTitle")}),i.jsxs("div",{className:"composer-context-tooltip-line",children:[f,"% · ",eh(e.promptTokens)," /"," ",eh(e.contextWindow)," tokens"]}),e.cachedInputTokens>0?i.jsx("div",{className:"composer-context-tooltip-line",children:h("conversation.contextUsageCachedTokens").replace("{count}",eh(e.cachedInputTokens))}):null,g?i.jsx("div",{className:"composer-context-tooltip-meta",children:g}):null,e.isEstimated?i.jsx("div",{className:"composer-context-tooltip-meta",children:h("conversation.contextUsageEstimated")}):null]}):i.jsx("div",{className:"composer-context-tooltip-line",children:h("conversation.contextUsageUnavailable")})}),document.body):null]})}function NE(e){return e>=.95?"is-critical":e>=.8?"is-warning":"is-normal"}function PE(e){switch(e){case"provider-log":return h("conversation.contextUsageSourceProviderLog");case"provider-runtime":return h("conversation.contextUsageSourceProviderRuntime");case"provider-config":return h("conversation.contextUsageSourceProviderConfig");case"model-map":return h("conversation.contextUsageSourceModelMap");default:return""}}function eh(e){return new Intl.NumberFormat().format(e)}function TE(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const EE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RE=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ME={};function qy(e,t){return(ME.jsx?RE:EE).test(e)}const AE=/[ \t\n\f\r]/g;function LE(e){return typeof e=="object"?e.type==="text"?$y(e.value):!1:$y(e)}function $y(e){return e.replace(AE,"")===""}class qa{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}qa.prototype.normal={};qa.prototype.property={};qa.prototype.space=void 0;function sk(e,t){const n={},s={};for(const a of e)Object.assign(n,a.property),Object.assign(s,a.normal);return new qa(n,s,t)}function cf(e){return e.toLowerCase()}class fr{constructor(t,n){this.attribute=n,this.property=t}}fr.prototype.attribute="";fr.prototype.booleanish=!1;fr.prototype.boolean=!1;fr.prototype.commaOrSpaceSeparated=!1;fr.prototype.commaSeparated=!1;fr.prototype.defined=!1;fr.prototype.mustUseProperty=!1;fr.prototype.number=!1;fr.prototype.overloadedBoolean=!1;fr.prototype.property="";fr.prototype.spaceSeparated=!1;fr.prototype.space=void 0;let IE=0;const Et=js(),Cn=js(),uf=js(),De=js(),sn=js(),oo=js(),br=js();function js(){return 2**++IE}const df=Object.freeze(Object.defineProperty({__proto__:null,boolean:Et,booleanish:Cn,commaOrSpaceSeparated:br,commaSeparated:oo,number:De,overloadedBoolean:uf,spaceSeparated:sn},Symbol.toStringTag,{value:"Module"})),th=Object.keys(df);class Xf extends fr{constructor(t,n,s,a){let c=-1;if(super(t,n),Vy(this,"space",a),typeof s=="number")for(;++c<th.length;){const l=th[c];Vy(this,th[c],(s&df[l])===df[l])}}}Xf.prototype.defined=!0;function Vy(e,t,n){n&&(e[t]=n)}function fo(e){const t={},n={};for(const[s,a]of Object.entries(e.properties)){const c=new Xf(s,e.transform(e.attributes||{},s),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(c.mustUseProperty=!0),t[s]=c,n[cf(s)]=s,n[cf(c.attribute)]=s}return new qa(t,n,e.space)}const ok=fo({properties:{ariaActiveDescendant:null,ariaAtomic:Cn,ariaAutoComplete:null,ariaBusy:Cn,ariaChecked:Cn,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:sn,ariaCurrent:null,ariaDescribedBy:sn,ariaDetails:null,ariaDisabled:Cn,ariaDropEffect:sn,ariaErrorMessage:null,ariaExpanded:Cn,ariaFlowTo:sn,ariaGrabbed:Cn,ariaHasPopup:null,ariaHidden:Cn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:sn,ariaLevel:De,ariaLive:null,ariaModal:Cn,ariaMultiLine:Cn,ariaMultiSelectable:Cn,ariaOrientation:null,ariaOwns:sn,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:Cn,ariaReadOnly:Cn,ariaRelevant:null,ariaRequired:Cn,ariaRoleDescription:sn,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:Cn,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ak(e,t){return t in e?e[t]:t}function lk(e,t){return ak(e,t.toLowerCase())}const DE=fo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oo,acceptCharset:sn,accessKey:sn,action:null,allow:null,allowFullScreen:Et,allowPaymentRequest:Et,allowUserMedia:Et,alt:null,as:null,async:Et,autoCapitalize:null,autoComplete:sn,autoFocus:Et,autoPlay:Et,blocking:sn,capture:null,charSet:null,checked:Et,cite:null,className:sn,cols:De,colSpan:null,content:null,contentEditable:Cn,controls:Et,controlsList:sn,coords:De|oo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Et,defer:Et,dir:null,dirName:null,disabled:Et,download:uf,draggable:Cn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Et,formTarget:null,headers:sn,height:De,hidden:uf,high:De,href:null,hrefLang:null,htmlFor:sn,httpEquiv:sn,id:null,imageSizes:null,imageSrcSet:null,inert:Et,inputMode:null,integrity:null,is:null,isMap:Et,itemId:null,itemProp:sn,itemRef:sn,itemScope:Et,itemType:sn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Et,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:Et,muted:Et,name:null,nonce:null,noModule:Et,noValidate:Et,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Et,optimum:De,pattern:null,ping:sn,placeholder:null,playsInline:Et,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Et,referrerPolicy:null,rel:sn,required:Et,reversed:Et,rows:De,rowSpan:De,sandbox:sn,scope:null,scoped:Et,seamless:Et,selected:Et,shadowRootClonable:Et,shadowRootDelegatesFocus:Et,shadowRootMode:null,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:Cn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:Et,useMap:null,value:Cn,width:De,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:sn,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Et,declare:Et,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:Et,noHref:Et,noShade:Et,noWrap:Et,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:Cn,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Et,disableRemotePlayback:Et,prefix:null,property:null,results:De,security:null,unselectable:null},space:"html",transform:lk}),_E=fo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:br,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:sn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:Et,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:oo,g2:oo,glyphName:oo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:br,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:De,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:sn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:br,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:br,rev:br,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:br,requiredFeatures:br,requiredFonts:br,requiredFormats:br,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:br,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:br,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:br,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ak}),ck=fo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),uk=fo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:lk}),dk=fo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),FE={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},OE=/[A-Z]/g,Gy=/-[a-z]/g,BE=/^data[-\w.:]+$/i;function UE(e,t){const n=cf(t);let s=t,a=fr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&BE.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(Gy,zE);s="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!Gy.test(c)){let l=c.replace(OE,WE);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=Xf}return new a(s,t)}function WE(e){return"-"+e.toLowerCase()}function zE(e){return e.charAt(1).toUpperCase()}const HE=sk([ok,DE,ck,uk,dk],"html"),Jf=sk([ok,_E,ck,uk,dk],"svg");function qE(e){return e.join(" ").trim()}var Xs={},nh,Ky;function $E(){if(Ky)return nh;Ky=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,d=/^\s+|\s+$/g,f=`
70
+ `,p="/",y="*",g="",b="comment",k="declaration";function S(j,A){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];A=A||{};var L=1,M=1;function O(ee){var te=ee.match(t);te&&(L+=te.length);var pe=ee.lastIndexOf(f);M=~pe?ee.length-pe:M+ee.length}function q(){var ee={line:L,column:M};return function(te){return te.position=new _(ee),D(),te}}function _(ee){this.start=ee,this.end={line:L,column:M},this.source=A.source}_.prototype.content=j;function I(ee){var te=new Error(A.source+":"+L+":"+M+": "+ee);if(te.reason=ee,te.filename=A.source,te.line=L,te.column=M,te.source=j,!A.silent)throw te}function F(ee){var te=ee.exec(j);if(te){var pe=te[0];return O(pe),j=j.slice(pe.length),te}}function D(){F(n)}function P(ee){var te;for(ee=ee||[];te=K();)te!==!1&&ee.push(te);return ee}function K(){var ee=q();if(!(p!=j.charAt(0)||y!=j.charAt(1))){for(var te=2;g!=j.charAt(te)&&(y!=j.charAt(te)||p!=j.charAt(te+1));)++te;if(te+=2,g===j.charAt(te-1))return I("End of comment missing");var pe=j.slice(2,te-2);return M+=2,O(pe),j=j.slice(te),M+=2,ee({type:b,comment:pe})}}function X(){var ee=q(),te=F(s);if(te){if(K(),!F(a))return I("property missing ':'");var pe=F(c),ne=ee({type:k,property:C(te[0].replace(e,g)),value:pe?C(pe[0].replace(e,g)):g});return F(l),ne}}function $(){var ee=[];P(ee);for(var te;te=X();)te!==!1&&(ee.push(te),P(ee));return ee}return D(),$()}function C(j){return j?j.replace(d,g):g}return nh=S,nh}var Qy;function VE(){if(Qy)return Xs;Qy=1;var e=Xs&&Xs.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.default=n;const t=e($E());function n(s,a){let c=null;if(!s||typeof s!="string")return c;const l=(0,t.default)(s),d=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:p,value:y}=f;d?a(p,y,f):y&&(c=c||{},c[p]=y)}),c}return Xs}var la={},Yy;function GE(){if(Yy)return la;Yy=1,Object.defineProperty(la,"__esModule",{value:!0}),la.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,c=function(p){return!p||n.test(p)||e.test(p)},l=function(p,y){return y.toUpperCase()},d=function(p,y){return"".concat(y,"-")},f=function(p,y){return y===void 0&&(y={}),c(p)?p:(p=p.toLowerCase(),y.reactCompat?p=p.replace(a,d):p=p.replace(s,d),p.replace(t,l))};return la.camelCase=f,la}var ca,Xy;function KE(){if(Xy)return ca;Xy=1;var e=ca&&ca.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(VE()),n=GE();function s(a,c){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(d,f){d&&f&&(l[(0,n.camelCase)(d,c)]=f)}),l}return s.default=s,ca=s,ca}var QE=KE();const YE=Fa(QE),hk=fk("end"),Zf=fk("start");function fk(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function XE(e){const t=Zf(e),n=hk(e);if(t&&n)return{start:t,end:n}}function ba(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jy(e.position):"start"in e||"end"in e?Jy(e):"line"in e||"column"in e?hf(e):""}function hf(e){return Zy(e&&e.line)+":"+Zy(e&&e.column)}function Jy(e){return hf(e&&e.start)+"-"+hf(e&&e.end)}function Zy(e){return e&&typeof e=="number"?e:1}class Qn extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let a="",c={},l=!1;if(n&&("line"in n&&"column"in n?c={place:n}:"start"in n&&"end"in n?c={place:n}:"type"in n?c={ancestors:[n],place:n.position}:c={...n}),typeof t=="string"?a=t:!c.cause&&t&&(l=!0,a=t.message,c.cause=t),!c.ruleId&&!c.source&&typeof s=="string"){const f=s.indexOf(":");f===-1?c.ruleId=s:(c.source=s.slice(0,f),c.ruleId=s.slice(f+1))}if(!c.place&&c.ancestors&&c.ancestors){const f=c.ancestors[c.ancestors.length-1];f&&(c.place=f.position)}const d=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=d?d.line:void 0,this.name=ba(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=l&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qn.prototype.file="";Qn.prototype.name="";Qn.prototype.reason="";Qn.prototype.message="";Qn.prototype.stack="";Qn.prototype.column=void 0;Qn.prototype.line=void 0;Qn.prototype.ancestors=void 0;Qn.prototype.cause=void 0;Qn.prototype.fatal=void 0;Qn.prototype.place=void 0;Qn.prototype.ruleId=void 0;Qn.prototype.source=void 0;const em={}.hasOwnProperty,JE=new Map,ZE=/[A-Z]/g,eR=new Set(["table","tbody","thead","tfoot","tr"]),tR=new Set(["td","th"]),mk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nR(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=uR(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=cR(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Jf:HE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},c=pk(a,e,void 0);return c&&typeof c!="string"?c:a.create(e,a.Fragment,{children:c||void 0},void 0)}function pk(e,t,n){if(t.type==="element")return rR(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return iR(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return oR(e,t,n);if(t.type==="mdxjsEsm")return sR(e,t);if(t.type==="root")return aR(e,t,n);if(t.type==="text")return lR(e,t)}function rR(e,t,n){const s=e.schema;let a=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(a=Jf,e.schema=a),e.ancestors.push(t);const c=yk(e,t.tagName,!1),l=dR(e,t);let d=nm(e,t);return eR.has(t.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!LE(f):!0})),gk(e,l,c,t),tm(l,d),e.ancestors.pop(),e.schema=s,e.create(t,c,l,n)}function iR(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Ra(e,t.position)}function sR(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ra(e,t.position)}function oR(e,t,n){const s=e.schema;let a=s;t.name==="svg"&&s.space==="html"&&(a=Jf,e.schema=a),e.ancestors.push(t);const c=t.name===null?e.Fragment:yk(e,t.name,!0),l=hR(e,t),d=nm(e,t);return gk(e,l,c,t),tm(l,d),e.ancestors.pop(),e.schema=s,e.create(t,c,l,n)}function aR(e,t,n){const s={};return tm(s,nm(e,t)),e.create(t,e.Fragment,s,n)}function lR(e,t){return t.value}function gk(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function tm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function cR(e,t,n){return s;function s(a,c,l,d){const p=Array.isArray(l.children)?n:t;return d?p(c,l,d):p(c,l)}}function uR(e,t){return n;function n(s,a,c,l){const d=Array.isArray(c.children),f=Zf(s);return t(a,c,l,d,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function dR(e,t){const n={};let s,a;for(a in t.properties)if(a!=="children"&&em.call(t.properties,a)){const c=fR(e,a,t.properties[a]);if(c){const[l,d]=c;e.tableCellAlignToStyle&&l==="align"&&typeof d=="string"&&tR.has(t.tagName)?s=d:n[l]=d}}if(s){const c=n.style||(n.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function hR(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const c=s.data.estree.body[0];c.type;const l=c.expression;l.type;const d=l.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else Ra(e,t.position);else{const a=s.name;let c;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const d=s.value.data.estree.body[0];d.type,c=e.evaluater.evaluateExpression(d.expression)}else Ra(e,t.position);else c=s.value===null?!0:s.value;n[a]=c}return n}function nm(e,t){const n=[];let s=-1;const a=e.passKeys?new Map:JE;for(;++s<t.children.length;){const c=t.children[s];let l;if(e.passKeys){const f=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(f){const p=a.get(f)||0;l=f+"-"+p,a.set(f,p+1)}}const d=pk(e,c,l);d!==void 0&&n.push(d)}return n}function fR(e,t,n){const s=UE(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?TE(n):qE(n)),s.property==="style"){let a=typeof n=="object"?n:mR(e,String(n));return e.stylePropertyNameCase==="css"&&(a=pR(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&s.space?FE[s.property]||s.property:s.attribute,n]}}function mR(e,t){try{return YE(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,a=new Qn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=mk+"#cannot-parse-style-attribute",a}}function yk(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let c=-1,l;for(;++c<a.length;){const d=qy(a[c])?{type:"Identifier",name:a[c]}:{type:"Literal",value:a[c]};l=l?{type:"MemberExpression",object:l,property:d,computed:!!(c&&d.type==="Literal"),optional:!1}:d}s=l}else s=qy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const a=s.value;return em.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(s);Ra(e)}function Ra(e,t){const n=new Qn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=mk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pR(e){const t={};let n;for(n in e)em.call(e,n)&&(t[gR(n)]=e[n]);return t}function gR(e){let t=e.replace(ZE,yR);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function yR(e){return"-"+e.toLowerCase()}const rh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vR={};function rm(e,t){const n=vR,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return vk(e,s,a)}function vk(e,t,n){if(wR(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 ev(e.children,t,n)}return Array.isArray(e)?ev(e,t,n):""}function ev(e,t,n){const s=[];let a=-1;for(;++a<e.length;)s[a]=vk(e[a],t,n);return s.join("")}function wR(e){return!!(e&&typeof e=="object")}const tv=document.createElement("i");function im(e){const t="&"+e+";";tv.innerHTML=t;const n=tv.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Nr(e,t,n,s){const a=e.length;let c=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,s.length<1e4)l=Array.from(s),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);c<s.length;)l=s.slice(c,c+1e4),l.unshift(t,0),e.splice(...l),c+=1e4,t+=1e4}function Dr(e,t){return e.length>0?(Nr(e,e.length,0,t),e):t}const nv={}.hasOwnProperty;function wk(e){const t={};let n=-1;for(;++n<e.length;)bR(t,e[n]);return t}function bR(e,t){let n;for(n in t){const a=(nv.call(e,n)?e[n]:void 0)||(e[n]={}),c=t[n];let l;if(c)for(l in c){nv.call(a,l)||(a[l]=[]);const d=c[l];xR(a[l],Array.isArray(d)?d:d?[d]:[])}}}function xR(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);Nr(e,0,0,s)}function bk(e,t){const 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 Qr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zn=Qi(/[A-Za-z]/),Vn=Qi(/[\dA-Za-z]/),kR=Qi(/[#-'*+\--9=?A-Z^-~]/);function qc(e){return e!==null&&(e<32||e===127)}const ff=Qi(/\d/),SR=Qi(/[\dA-Fa-f]/),CR=Qi(/[!-/:-@[-`{-~]/);function yt(e){return e!==null&&e<-2}function tn(e){return e!==null&&(e<0||e===32)}function Ft(e){return e===-2||e===-1||e===32}const iu=Qi(new RegExp("\\p{P}|\\p{S}","u")),ks=Qi(/\s/);function Qi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function mo(e){const t=[];let n=-1,s=0,a=0;for(;++n<e.length;){const c=e.charCodeAt(n);let l="";if(c===37&&Vn(e.charCodeAt(n+1))&&Vn(e.charCodeAt(n+2)))a=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(l=String.fromCharCode(c));else if(c>55295&&c<57344){const d=e.charCodeAt(n+1);c<56320&&d>56319&&d<57344?(l=String.fromCharCode(c,d),a=1):l="�"}else l=String.fromCharCode(c);l&&(t.push(e.slice(s,n),encodeURIComponent(l)),s=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(s)}function qt(e,t,n,s){const a=s?s-1:Number.POSITIVE_INFINITY;let c=0;return l;function l(f){return Ft(f)?(e.enter(n),d(f)):t(f)}function d(f){return Ft(f)&&c++<a?(e.consume(f),d):(e.exit(n),t(f))}}const jR={tokenize:NR};function NR(e){const t=e.attempt(this.parser.constructs.contentInitial,s,a);let n;return t;function s(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),qt(e,t,"linePrefix")}function a(d){return e.enter("paragraph"),c(d)}function c(d){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(d)}function l(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return yt(d)?(e.consume(d),e.exit("chunkText"),c):(e.consume(d),l)}}const PR={tokenize:TR},rv={tokenize:ER};function TR(e){const t=this,n=[];let s=0,a,c,l;return d;function d(M){if(s<n.length){const O=n[s];return t.containerState=O[1],e.attempt(O[0].continuation,f,p)(M)}return p(M)}function f(M){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&L();const O=t.events.length;let q=O,_;for(;q--;)if(t.events[q][0]==="exit"&&t.events[q][1].type==="chunkFlow"){_=t.events[q][1].end;break}A(s);let I=O;for(;I<t.events.length;)t.events[I][1].end={..._},I++;return Nr(t.events,q+1,0,t.events.slice(O)),t.events.length=I,p(M)}return d(M)}function p(M){if(s===n.length){if(!a)return b(M);if(a.currentConstruct&&a.currentConstruct.concrete)return S(M);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(rv,y,g)(M)}function y(M){return a&&L(),A(s),b(M)}function g(M){return t.parser.lazy[t.now().line]=s!==n.length,l=t.now().offset,S(M)}function b(M){return t.containerState={},e.attempt(rv,k,S)(M)}function k(M){return s++,n.push([t.currentConstruct,t.containerState]),b(M)}function S(M){if(M===null){a&&L(),A(0),e.consume(M);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:c}),C(M)}function C(M){if(M===null){j(e.exit("chunkFlow"),!0),A(0),e.consume(M);return}return yt(M)?(e.consume(M),j(e.exit("chunkFlow")),s=0,t.interrupt=void 0,d):(e.consume(M),C)}function j(M,O){const q=t.sliceStream(M);if(O&&q.push(null),M.previous=c,c&&(c.next=M),c=M,a.defineSkip(M.start),a.write(q),t.parser.lazy[M.start.line]){let _=a.events.length;for(;_--;)if(a.events[_][1].start.offset<l&&(!a.events[_][1].end||a.events[_][1].end.offset>l))return;const I=t.events.length;let F=I,D,P;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(D){P=t.events[F][1].end;break}D=!0}for(A(s),_=I;_<t.events.length;)t.events[_][1].end={...P},_++;Nr(t.events,F+1,0,t.events.slice(I)),t.events.length=_}}function A(M){let O=n.length;for(;O-- >M;){const q=n[O];t.containerState=q[1],q[0].exit.call(t,e)}n.length=M}function L(){a.write([null]),c=void 0,a=void 0,t.containerState._closeFlow=void 0}}function ER(e,t,n){return qt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function lo(e){if(e===null||tn(e)||ks(e))return 1;if(iu(e))return 2}function su(e,t,n){const s=[];let a=-1;for(;++a<e.length;){const c=e[a].resolveAll;c&&!s.includes(c)&&(t=c(t,n),s.push(c))}return t}const mf={name:"attention",resolveAll:RR,tokenize:MR};function RR(e,t){let n=-1,s,a,c,l,d,f,p,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(s=n;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[s][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[s][1].end.offset-e[s][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[s][1].end},b={...e[n][1].start};iv(g,-f),iv(b,f),l={type:f>1?"strongSequence":"emphasisSequence",start:g,end:{...e[s][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},c={type:f>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...d.end}},e[s][1].end={...l.start},e[n][1].start={...d.end},p=[],e[s][1].end.offset-e[s][1].start.offset&&(p=Dr(p,[["enter",e[s][1],t],["exit",e[s][1],t]])),p=Dr(p,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",c,t]]),p=Dr(p,su(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),p=Dr(p,[["exit",c,t],["enter",d,t],["exit",d,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,p=Dr(p,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,Nr(e,s-1,n-s+3,p),n=s+p.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function MR(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,a=lo(s);let c;return l;function l(f){return c=f,e.enter("attentionSequence"),d(f)}function d(f){if(f===c)return e.consume(f),d;const p=e.exit("attentionSequence"),y=lo(f),g=!y||y===2&&a||n.includes(f),b=!a||a===2&&y||n.includes(s);return p._open=!!(c===42?g:g&&(a||!b)),p._close=!!(c===42?b:b&&(y||!g)),t(f)}}function iv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const AR={name:"autolink",tokenize:LR};function LR(e,t,n){let s=0;return a;function a(k){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(k){return Zn(k)?(e.consume(k),l):k===64?n(k):p(k)}function l(k){return k===43||k===45||k===46||Vn(k)?(s=1,d(k)):p(k)}function d(k){return k===58?(e.consume(k),s=0,f):(k===43||k===45||k===46||Vn(k))&&s++<32?(e.consume(k),d):(s=0,p(k))}function f(k){return k===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.exit("autolink"),t):k===null||k===32||k===60||qc(k)?n(k):(e.consume(k),f)}function p(k){return k===64?(e.consume(k),y):kR(k)?(e.consume(k),p):n(k)}function y(k){return Vn(k)?g(k):n(k)}function g(k){return k===46?(e.consume(k),s=0,y):k===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.exit("autolink"),t):b(k)}function b(k){if((k===45||Vn(k))&&s++<63){const S=k===45?b:g;return e.consume(k),S}return n(k)}}const $a={partial:!0,tokenize:IR};function IR(e,t,n){return s;function s(c){return Ft(c)?qt(e,a,"linePrefix")(c):a(c)}function a(c){return c===null||yt(c)?t(c):n(c)}}const xk={continuation:{tokenize:_R},exit:FR,name:"blockQuote",tokenize:DR};function DR(e,t,n){const s=this;return a;function a(l){if(l===62){const d=s.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),c}return n(l)}function c(l){return Ft(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function _R(e,t,n){const s=this;return a;function a(l){return Ft(l)?qt(e,c,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):c(l)}function c(l){return e.attempt(xk,t,n)(l)}}function FR(e){e.exit("blockQuote")}const kk={name:"characterEscape",tokenize:OR};function OR(e,t,n){return s;function s(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),a}function a(c){return CR(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(c)}}const Sk={name:"characterReference",tokenize:BR};function BR(e,t,n){const s=this;let a=0,c,l;return d;function d(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),f}function f(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),c=31,l=Vn,y(g))}function p(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,l=SR,y):(e.enter("characterReferenceValue"),c=7,l=ff,y(g))}function y(g){if(g===59&&a){const b=e.exit("characterReferenceValue");return l===Vn&&!im(s.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(g)&&a++<c?(e.consume(g),y):n(g)}}const sv={partial:!0,tokenize:WR},ov={concrete:!0,name:"codeFenced",tokenize:UR};function UR(e,t,n){const s=this,a={partial:!0,tokenize:q};let c=0,l=0,d;return f;function f(_){return p(_)}function p(_){const I=s.events[s.events.length-1];return c=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,d=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(_)}function y(_){return _===d?(l++,e.consume(_),y):l<3?n(_):(e.exit("codeFencedFenceSequence"),Ft(_)?qt(e,g,"whitespace")(_):g(_))}function g(_){return _===null||yt(_)?(e.exit("codeFencedFence"),s.interrupt?t(_):e.check(sv,C,O)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===null||yt(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(_)):Ft(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qt(e,k,"whitespace")(_)):_===96&&_===d?n(_):(e.consume(_),b)}function k(_){return _===null||yt(_)?g(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(_))}function S(_){return _===null||yt(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(_)):_===96&&_===d?n(_):(e.consume(_),S)}function C(_){return e.attempt(a,O,j)(_)}function j(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),A}function A(_){return c>0&&Ft(_)?qt(e,L,"linePrefix",c+1)(_):L(_)}function L(_){return _===null||yt(_)?e.check(sv,C,O)(_):(e.enter("codeFlowValue"),M(_))}function M(_){return _===null||yt(_)?(e.exit("codeFlowValue"),L(_)):(e.consume(_),M)}function O(_){return e.exit("codeFenced"),t(_)}function q(_,I,F){let D=0;return P;function P(te){return _.enter("lineEnding"),_.consume(te),_.exit("lineEnding"),K}function K(te){return _.enter("codeFencedFence"),Ft(te)?qt(_,X,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):X(te)}function X(te){return te===d?(_.enter("codeFencedFenceSequence"),$(te)):F(te)}function $(te){return te===d?(D++,_.consume(te),$):D>=l?(_.exit("codeFencedFenceSequence"),Ft(te)?qt(_,ee,"whitespace")(te):ee(te)):F(te)}function ee(te){return te===null||yt(te)?(_.exit("codeFencedFence"),I(te)):F(te)}}}function WR(e,t,n){const s=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),c)}function c(l){return s.parser.lazy[s.now().line]?n(l):t(l)}}const ih={name:"codeIndented",tokenize:HR},zR={partial:!0,tokenize:qR};function HR(e,t,n){const s=this;return a;function a(p){return e.enter("codeIndented"),qt(e,c,"linePrefix",5)(p)}function c(p){const y=s.events[s.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?l(p):n(p)}function l(p){return p===null?f(p):yt(p)?e.attempt(zR,l,f)(p):(e.enter("codeFlowValue"),d(p))}function d(p){return p===null||yt(p)?(e.exit("codeFlowValue"),l(p)):(e.consume(p),d)}function f(p){return e.exit("codeIndented"),t(p)}}function qR(e,t,n){const s=this;return a;function a(l){return s.parser.lazy[s.now().line]?n(l):yt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):qt(e,c,"linePrefix",5)(l)}function c(l){const d=s.events[s.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):yt(l)?a(l):n(l)}}const $R={name:"codeText",previous:GR,resolve:VR,tokenize:KR};function VR(e){let t=e.length-4,n=3,s,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)a===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(a=s):(s===t||e[s][1].type==="lineEnding")&&(e[a][1].type="codeTextData",s!==a+2&&(e[a][1].end=e[s-1][1].end,e.splice(a+2,s-a-2),t-=s-a-2,s=a+2),a=void 0);return e}function GR(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function KR(e,t,n){let s=0,a,c;return l;function l(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),s++,d):(e.exit("codeTextSequence"),f(g))}function f(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),f):g===96?(c=e.enter("codeTextSequence"),a=0,y(g)):yt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),f):(e.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||yt(g)?(e.exit("codeTextData"),f(g)):(e.consume(g),p)}function y(g){return g===96?(e.consume(g),a++,y):a===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(c.type="codeTextData",p(g))}}class QR{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const a=n||0;this.setCursor(Math.trunc(t));const c=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return s&&ua(this.left,s),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ua(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ua(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ua(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ua(this.left,n.reverse())}}}function ua(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 Ck(e){const t={};let n=-1,s,a,c,l,d,f,p;const y=new QR(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(s=y.get(n),n&&s[1].type==="chunkFlow"&&y.get(n-1)[1].type==="listItemPrefix"&&(f=s[1]._tokenizer.events,c=0,c<f.length&&f[c][1].type==="lineEndingBlank"&&(c+=2),c<f.length&&f[c][1].type==="content"))for(;++c<f.length&&f[c][1].type!=="content";)f[c][1].type==="chunkText"&&(f[c][1]._isInFirstContentOfListItem=!0,c++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,YR(y,n)),n=t[n],p=!0);else if(s[1]._container){for(c=n,a=void 0;c--;)if(l=y.get(c),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(y.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=c);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(s[1].end={...y.get(a)[1].start},d=y.slice(a,n),d.unshift(s),y.splice(a,n-a+1,d))}}return Nr(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!p}function YR(e,t){const n=e.get(t)[1],s=e.get(t)[2];let a=t-1;const c=[];let l=n._tokenizer;l||(l=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const d=l.events,f=[],p={};let y,g,b=-1,k=n,S=0,C=0;const j=[C];for(;k;){for(;e.get(++a)[1]!==k;);c.push(a),k._tokenizer||(y=s.sliceStream(k),k.next||y.push(null),g&&l.defineSkip(k.start),k._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(y),k._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=k,k=k.next}for(k=n;++b<d.length;)d[b][0]==="exit"&&d[b-1][0]==="enter"&&d[b][1].type===d[b-1][1].type&&d[b][1].start.line!==d[b][1].end.line&&(C=b+1,j.push(C),k._tokenizer=void 0,k.previous=void 0,k=k.next);for(l.events=[],k?(k._tokenizer=void 0,k.previous=void 0):j.pop(),b=j.length;b--;){const A=d.slice(j[b],j[b+1]),L=c.pop();f.push([L,L+A.length-1]),e.splice(L,2,A)}for(f.reverse(),b=-1;++b<f.length;)p[S+f[b][0]]=S+f[b][1],S+=f[b][1]-f[b][0]-1;return p}const XR={resolve:ZR,tokenize:eM},JR={partial:!0,tokenize:tM};function ZR(e){return Ck(e),e}function eM(e,t){let n;return s;function s(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(d)}function a(d){return d===null?c(d):yt(d)?e.check(JR,l,c)(d):(e.consume(d),a)}function c(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function l(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function tM(e,t,n){const s=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),qt(e,c,"linePrefix")}function c(l){if(l===null||yt(l))return n(l);const d=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):e.interrupt(s.parser.constructs.flow,n,t)(l)}}function jk(e,t,n,s,a,c,l,d,f){const p=f||Number.POSITIVE_INFINITY;let y=0;return g;function g(A){return A===60?(e.enter(s),e.enter(a),e.enter(c),e.consume(A),e.exit(c),b):A===null||A===32||A===41||qc(A)?n(A):(e.enter(s),e.enter(l),e.enter(d),e.enter("chunkString",{contentType:"string"}),C(A))}function b(A){return A===62?(e.enter(c),e.consume(A),e.exit(c),e.exit(a),e.exit(s),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),k(A))}function k(A){return A===62?(e.exit("chunkString"),e.exit(d),b(A)):A===null||A===60||yt(A)?n(A):(e.consume(A),A===92?S:k)}function S(A){return A===60||A===62||A===92?(e.consume(A),k):k(A)}function C(A){return!y&&(A===null||A===41||tn(A))?(e.exit("chunkString"),e.exit(d),e.exit(l),e.exit(s),t(A)):y<p&&A===40?(e.consume(A),y++,C):A===41?(e.consume(A),y--,C):A===null||A===32||A===40||qc(A)?n(A):(e.consume(A),A===92?j:C)}function j(A){return A===40||A===41||A===92?(e.consume(A),C):C(A)}}function Nk(e,t,n,s,a,c){const l=this;let d=0,f;return p;function p(k){return e.enter(s),e.enter(a),e.consume(k),e.exit(a),e.enter(c),y}function y(k){return d>999||k===null||k===91||k===93&&!f||k===94&&!d&&"_hiddenFootnoteSupport"in l.parser.constructs?n(k):k===93?(e.exit(c),e.enter(a),e.consume(k),e.exit(a),e.exit(s),t):yt(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||k===91||k===93||yt(k)||d++>999?(e.exit("chunkString"),y(k)):(e.consume(k),f||(f=!Ft(k)),k===92?b:g)}function b(k){return k===91||k===92||k===93?(e.consume(k),d++,g):g(k)}}function Pk(e,t,n,s,a,c){let l;return d;function d(b){return b===34||b===39||b===40?(e.enter(s),e.enter(a),e.consume(b),e.exit(a),l=b===40?41:b,f):n(b)}function f(b){return b===l?(e.enter(a),e.consume(b),e.exit(a),e.exit(s),t):(e.enter(c),p(b))}function p(b){return b===l?(e.exit(c),f(l)):b===null?n(b):yt(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),qt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===l||b===null||yt(b)?(e.exit("chunkString"),p(b)):(e.consume(b),b===92?g:y)}function g(b){return b===l||b===92?(e.consume(b),y):y(b)}}function xa(e,t){let n;return s;function s(a){return yt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,s):Ft(a)?qt(e,s,n?"linePrefix":"lineSuffix")(a):t(a)}}const nM={name:"definition",tokenize:iM},rM={partial:!0,tokenize:sM};function iM(e,t,n){const s=this;let a;return c;function c(k){return e.enter("definition"),l(k)}function l(k){return Nk.call(s,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(k)}function d(k){return a=Qr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),f):n(k)}function f(k){return tn(k)?xa(e,p)(k):p(k)}function p(k){return jk(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(k)}function y(k){return e.attempt(rM,g,g)(k)}function g(k){return Ft(k)?qt(e,b,"whitespace")(k):b(k)}function b(k){return k===null||yt(k)?(e.exit("definition"),s.parser.defined.push(a),t(k)):n(k)}}function sM(e,t,n){return s;function s(d){return tn(d)?xa(e,a)(d):n(d)}function a(d){return Pk(e,c,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function c(d){return Ft(d)?qt(e,l,"whitespace")(d):l(d)}function l(d){return d===null||yt(d)?t(d):n(d)}}const oM={name:"hardBreakEscape",tokenize:aM};function aM(e,t,n){return s;function s(c){return e.enter("hardBreakEscape"),e.consume(c),a}function a(c){return yt(c)?(e.exit("hardBreakEscape"),t(c)):n(c)}}const lM={name:"headingAtx",resolve:cM,tokenize:uM};function cM(e,t){let n=e.length-2,s=3,a,c;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(a={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},c={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},Nr(e,s,n-s+1,[["enter",a,t],["enter",c,t],["exit",c,t],["exit",a,t]])),e}function uM(e,t,n){let s=0;return a;function a(y){return e.enter("atxHeading"),c(y)}function c(y){return e.enter("atxHeadingSequence"),l(y)}function l(y){return y===35&&s++<6?(e.consume(y),l):y===null||tn(y)?(e.exit("atxHeadingSequence"),d(y)):n(y)}function d(y){return y===35?(e.enter("atxHeadingSequence"),f(y)):y===null||yt(y)?(e.exit("atxHeading"),t(y)):Ft(y)?qt(e,d,"whitespace")(y):(e.enter("atxHeadingText"),p(y))}function f(y){return y===35?(e.consume(y),f):(e.exit("atxHeadingSequence"),d(y))}function p(y){return y===null||y===35||tn(y)?(e.exit("atxHeadingText"),d(y)):(e.consume(y),p)}}const dM=["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"],av=["pre","script","style","textarea"],hM={concrete:!0,name:"htmlFlow",resolveTo:pM,tokenize:gM},fM={partial:!0,tokenize:vM},mM={partial:!0,tokenize:yM};function pM(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 gM(e,t,n){const s=this;let a,c,l,d,f;return p;function p(T){return y(T)}function y(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),b):T===47?(e.consume(T),c=!0,C):T===63?(e.consume(T),a=3,s.interrupt?t:E):Zn(T)?(e.consume(T),l=String.fromCharCode(T),j):n(T)}function b(T){return T===45?(e.consume(T),a=2,k):T===91?(e.consume(T),a=5,d=0,S):Zn(T)?(e.consume(T),a=4,s.interrupt?t:E):n(T)}function k(T){return T===45?(e.consume(T),s.interrupt?t:E):n(T)}function S(T){const ae="CDATA[";return T===ae.charCodeAt(d++)?(e.consume(T),d===ae.length?s.interrupt?t:X:S):n(T)}function C(T){return Zn(T)?(e.consume(T),l=String.fromCharCode(T),j):n(T)}function j(T){if(T===null||T===47||T===62||tn(T)){const ae=T===47,Le=l.toLowerCase();return!ae&&!c&&av.includes(Le)?(a=1,s.interrupt?t(T):X(T)):dM.includes(l.toLowerCase())?(a=6,ae?(e.consume(T),A):s.interrupt?t(T):X(T)):(a=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(T):c?L(T):M(T))}return T===45||Vn(T)?(e.consume(T),l+=String.fromCharCode(T),j):n(T)}function A(T){return T===62?(e.consume(T),s.interrupt?t:X):n(T)}function L(T){return Ft(T)?(e.consume(T),L):P(T)}function M(T){return T===47?(e.consume(T),P):T===58||T===95||Zn(T)?(e.consume(T),O):Ft(T)?(e.consume(T),M):P(T)}function O(T){return T===45||T===46||T===58||T===95||Vn(T)?(e.consume(T),O):q(T)}function q(T){return T===61?(e.consume(T),_):Ft(T)?(e.consume(T),q):M(T)}function _(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),f=T,I):Ft(T)?(e.consume(T),_):F(T)}function I(T){return T===f?(e.consume(T),f=null,D):T===null||yt(T)?n(T):(e.consume(T),I)}function F(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||tn(T)?q(T):(e.consume(T),F)}function D(T){return T===47||T===62||Ft(T)?M(T):n(T)}function P(T){return T===62?(e.consume(T),K):n(T)}function K(T){return T===null||yt(T)?X(T):Ft(T)?(e.consume(T),K):n(T)}function X(T){return T===45&&a===2?(e.consume(T),pe):T===60&&a===1?(e.consume(T),ne):T===62&&a===4?(e.consume(T),W):T===63&&a===3?(e.consume(T),E):T===93&&a===5?(e.consume(T),ye):yt(T)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(fM,re,$)(T)):T===null||yt(T)?(e.exit("htmlFlowData"),$(T)):(e.consume(T),X)}function $(T){return e.check(mM,ee,re)(T)}function ee(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),te}function te(T){return T===null||yt(T)?$(T):(e.enter("htmlFlowData"),X(T))}function pe(T){return T===45?(e.consume(T),E):X(T)}function ne(T){return T===47?(e.consume(T),l="",z):X(T)}function z(T){if(T===62){const ae=l.toLowerCase();return av.includes(ae)?(e.consume(T),W):X(T)}return Zn(T)&&l.length<8?(e.consume(T),l+=String.fromCharCode(T),z):X(T)}function ye(T){return T===93?(e.consume(T),E):X(T)}function E(T){return T===62?(e.consume(T),W):T===45&&a===2?(e.consume(T),E):X(T)}function W(T){return T===null||yt(T)?(e.exit("htmlFlowData"),re(T)):(e.consume(T),W)}function re(T){return e.exit("htmlFlow"),t(T)}}function yM(e,t,n){const s=this;return a;function a(l){return yt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),c):n(l)}function c(l){return s.parser.lazy[s.now().line]?n(l):t(l)}}function vM(e,t,n){return s;function s(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt($a,t,n)}}const wM={name:"htmlText",tokenize:bM};function bM(e,t,n){const s=this;let a,c,l;return d;function d(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),f}function f(E){return E===33?(e.consume(E),p):E===47?(e.consume(E),q):E===63?(e.consume(E),M):Zn(E)?(e.consume(E),F):n(E)}function p(E){return E===45?(e.consume(E),y):E===91?(e.consume(E),c=0,S):Zn(E)?(e.consume(E),L):n(E)}function y(E){return E===45?(e.consume(E),k):n(E)}function g(E){return E===null?n(E):E===45?(e.consume(E),b):yt(E)?(l=g,ne(E)):(e.consume(E),g)}function b(E){return E===45?(e.consume(E),k):g(E)}function k(E){return E===62?pe(E):E===45?b(E):g(E)}function S(E){const W="CDATA[";return E===W.charCodeAt(c++)?(e.consume(E),c===W.length?C:S):n(E)}function C(E){return E===null?n(E):E===93?(e.consume(E),j):yt(E)?(l=C,ne(E)):(e.consume(E),C)}function j(E){return E===93?(e.consume(E),A):C(E)}function A(E){return E===62?pe(E):E===93?(e.consume(E),A):C(E)}function L(E){return E===null||E===62?pe(E):yt(E)?(l=L,ne(E)):(e.consume(E),L)}function M(E){return E===null?n(E):E===63?(e.consume(E),O):yt(E)?(l=M,ne(E)):(e.consume(E),M)}function O(E){return E===62?pe(E):M(E)}function q(E){return Zn(E)?(e.consume(E),_):n(E)}function _(E){return E===45||Vn(E)?(e.consume(E),_):I(E)}function I(E){return yt(E)?(l=I,ne(E)):Ft(E)?(e.consume(E),I):pe(E)}function F(E){return E===45||Vn(E)?(e.consume(E),F):E===47||E===62||tn(E)?D(E):n(E)}function D(E){return E===47?(e.consume(E),pe):E===58||E===95||Zn(E)?(e.consume(E),P):yt(E)?(l=D,ne(E)):Ft(E)?(e.consume(E),D):pe(E)}function P(E){return E===45||E===46||E===58||E===95||Vn(E)?(e.consume(E),P):K(E)}function K(E){return E===61?(e.consume(E),X):yt(E)?(l=K,ne(E)):Ft(E)?(e.consume(E),K):D(E)}function X(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),a=E,$):yt(E)?(l=X,ne(E)):Ft(E)?(e.consume(E),X):(e.consume(E),ee)}function $(E){return E===a?(e.consume(E),a=void 0,te):E===null?n(E):yt(E)?(l=$,ne(E)):(e.consume(E),$)}function ee(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||tn(E)?D(E):(e.consume(E),ee)}function te(E){return E===47||E===62||tn(E)?D(E):n(E)}function pe(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function ne(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),z}function z(E){return Ft(E)?qt(e,ye,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):ye(E)}function ye(E){return e.enter("htmlTextData"),l(E)}}const sm={name:"labelEnd",resolveAll:CM,resolveTo:jM,tokenize:NM},xM={tokenize:PM},kM={tokenize:TM},SM={tokenize:EM};function CM(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const a=s.type==="labelImage"?4:2;s.type="data",t+=a}}return e.length!==n.length&&Nr(e,0,e.length,n),e}function jM(e,t){let n=e.length,s=0,a,c,l,d;for(;n--;)if(a=e[n][1],c){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(c=n,a.type!=="labelLink")){s=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[c][1].start},end:{...e[l][1].end}},y={type:"labelText",start:{...e[c+s+2][1].end},end:{...e[l-2][1].start}};return d=[["enter",f,t],["enter",p,t]],d=Dr(d,e.slice(c+1,c+s+3)),d=Dr(d,[["enter",y,t]]),d=Dr(d,su(t.parser.constructs.insideSpan.null,e.slice(c+s+4,l-3),t)),d=Dr(d,[["exit",y,t],e[l-2],e[l-1],["exit",p,t]]),d=Dr(d,e.slice(l+1)),d=Dr(d,[["exit",f,t]]),Nr(e,c,e.length,d),e}function NM(e,t,n){const s=this;let a=s.events.length,c,l;for(;a--;)if((s.events[a][1].type==="labelImage"||s.events[a][1].type==="labelLink")&&!s.events[a][1]._balanced){c=s.events[a][1];break}return d;function d(b){return c?c._inactive?g(b):(l=s.parser.defined.includes(Qr(s.sliceSerialize({start:c.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),f):n(b)}function f(b){return b===40?e.attempt(xM,y,l?y:g)(b):b===91?e.attempt(kM,y,l?p:g)(b):l?y(b):g(b)}function p(b){return e.attempt(SM,y,g)(b)}function y(b){return t(b)}function g(b){return c._balanced=!0,n(b)}}function PM(e,t,n){return s;function s(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),a}function a(g){return tn(g)?xa(e,c)(g):c(g)}function c(g){return g===41?y(g):jk(e,l,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return tn(g)?xa(e,f)(g):y(g)}function d(g){return n(g)}function f(g){return g===34||g===39||g===40?Pk(e,p,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function p(g){return tn(g)?xa(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function TM(e,t,n){const s=this;return a;function a(d){return Nk.call(s,e,c,l,"reference","referenceMarker","referenceString")(d)}function c(d){return s.parser.defined.includes(Qr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function l(d){return n(d)}}function EM(e,t,n){return s;function s(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),a}function a(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),t):n(c)}}const RM={name:"labelStartImage",resolveAll:sm.resolveAll,tokenize:MM};function MM(e,t,n){const s=this;return a;function a(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),c}function c(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),l):n(d)}function l(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):t(d)}}const AM={name:"labelStartLink",resolveAll:sm.resolveAll,tokenize:LM};function LM(e,t,n){const s=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),c}function c(l){return l===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(l):t(l)}}const sh={name:"lineEnding",tokenize:IM};function IM(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),qt(e,t,"linePrefix")}}const kc={name:"thematicBreak",tokenize:DM};function DM(e,t,n){let s=0,a;return c;function c(p){return e.enter("thematicBreak"),l(p)}function l(p){return a=p,d(p)}function d(p){return p===a?(e.enter("thematicBreakSequence"),f(p)):s>=3&&(p===null||yt(p))?(e.exit("thematicBreak"),t(p)):n(p)}function f(p){return p===a?(e.consume(p),s++,f):(e.exit("thematicBreakSequence"),Ft(p)?qt(e,d,"whitespace")(p):d(p))}}const ur={continuation:{tokenize:BM},exit:WM,name:"list",tokenize:OM},_M={partial:!0,tokenize:zM},FM={partial:!0,tokenize:UM};function OM(e,t,n){const s=this,a=s.events[s.events.length-1];let c=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return d;function d(k){const S=s.containerState.type||(k===42||k===43||k===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!s.containerState.marker||k===s.containerState.marker:ff(k)){if(s.containerState.type||(s.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),k===42||k===45?e.check(kc,n,p)(k):p(k);if(!s.interrupt||k===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(k)}return n(k)}function f(k){return ff(k)&&++l<10?(e.consume(k),f):(!s.interrupt||l<2)&&(s.containerState.marker?k===s.containerState.marker:k===41||k===46)?(e.exit("listItemValue"),p(k)):n(k)}function p(k){return e.enter("listItemMarker"),e.consume(k),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||k,e.check($a,s.interrupt?n:y,e.attempt(_M,b,g))}function y(k){return s.containerState.initialBlankLine=!0,c++,b(k)}function g(k){return Ft(k)?(e.enter("listItemPrefixWhitespace"),e.consume(k),e.exit("listItemPrefixWhitespace"),b):n(k)}function b(k){return s.containerState.size=c+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(k)}}function BM(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check($a,a,c);function a(d){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,qt(e,t,"listItemIndent",s.containerState.size+1)(d)}function c(d){return s.containerState.furtherBlankLines||!Ft(d)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,l(d)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(FM,t,l)(d))}function l(d){return s.containerState._closeFlow=!0,s.interrupt=void 0,qt(e,e.attempt(ur,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function UM(e,t,n){const s=this;return qt(e,a,"listItemIndent",s.containerState.size+1);function a(c){const l=s.events[s.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===s.containerState.size?t(c):n(c)}}function WM(e){e.exit(this.containerState.type)}function zM(e,t,n){const s=this;return qt(e,a,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(c){const l=s.events[s.events.length-1];return!Ft(c)&&l&&l[1].type==="listItemPrefixWhitespace"?t(c):n(c)}}const lv={name:"setextUnderline",resolveTo:HM,tokenize:qM};function HM(e,t){let n=e.length,s,a,c;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!c&&e[n][1].type==="definition"&&(c=n);const l={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",c?(e.splice(a,0,["enter",l,t]),e.splice(c+1,0,["exit",e[s][1],t]),e[s][1].end={...e[c][1].end}):e[s][1]=l,e.push(["exit",l,t]),e}function qM(e,t,n){const s=this;let a;return c;function c(p){let y=s.events.length,g;for(;y--;)if(s.events[y][1].type!=="lineEnding"&&s.events[y][1].type!=="linePrefix"&&s.events[y][1].type!=="content"){g=s.events[y][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||g)?(e.enter("setextHeadingLine"),a=p,l(p)):n(p)}function l(p){return e.enter("setextHeadingLineSequence"),d(p)}function d(p){return p===a?(e.consume(p),d):(e.exit("setextHeadingLineSequence"),Ft(p)?qt(e,f,"lineSuffix")(p):f(p))}function f(p){return p===null||yt(p)?(e.exit("setextHeadingLine"),t(p)):n(p)}}const $M={tokenize:VM};function VM(e){const t=this,n=e.attempt($a,s,e.attempt(this.parser.constructs.flowInitial,a,qt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(XR,a)),"linePrefix")));return n;function s(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const GM={resolveAll:Ek()},KM=Tk("string"),QM=Tk("text");function Tk(e){return{resolveAll:Ek(e==="text"?YM:void 0),tokenize:t};function t(n){const s=this,a=this.parser.constructs[e],c=n.attempt(a,l,d);return l;function l(y){return p(y)?c(y):d(y)}function d(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),f}function f(y){return p(y)?(n.exit("data"),c(y)):(n.consume(y),f)}function p(y){if(y===null)return!0;const g=a[y];let b=-1;if(g)for(;++b<g.length;){const k=g[b];if(!k.previous||k.previous.call(s,s.previous))return!0}return!1}}}function Ek(e){return t;function t(n,s){let a=-1,c;for(;++a<=n.length;)c===void 0?n[a]&&n[a][1].type==="data"&&(c=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==c+2&&(n[c][1].end=n[a-1][1].end,n.splice(c+2,a-c-2),a=c+2),c=void 0);return e?e(n,s):n}}function YM(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const s=e[n-1][1],a=t.sliceStream(s);let c=a.length,l=-1,d=0,f;for(;c--;){const p=a[c];if(typeof p=="string"){for(l=p.length;p.charCodeAt(l-1)===32;)d++,l--;if(l)break;l=-1}else if(p===-2)f=!0,d++;else if(p!==-1){c++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const p={type:n===e.length||f||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?l:s.start._bufferIndex+l,_index:s.start._index+c,line:s.end.line,column:s.end.column-d,offset:s.end.offset-d},end:{...s.end}};s.end={...p.start},s.start.offset===s.end.offset?Object.assign(s,p):(e.splice(n,0,["enter",p,t],["exit",p,t]),n+=2)}n++}return e}const XM={42:ur,43:ur,45:ur,48:ur,49:ur,50:ur,51:ur,52:ur,53:ur,54:ur,55:ur,56:ur,57:ur,62:xk},JM={91:nM},ZM={[-2]:ih,[-1]:ih,32:ih},eA={35:lM,42:kc,45:[lv,kc],60:hM,61:lv,95:kc,96:ov,126:ov},tA={38:Sk,92:kk},nA={[-5]:sh,[-4]:sh,[-3]:sh,33:RM,38:Sk,42:mf,60:[AR,wM],91:AM,92:[oM,kk],93:sm,95:mf,96:$R},rA={null:[mf,GM]},iA={null:[42,95]},sA={null:[]},oA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:iA,contentInitial:JM,disable:sA,document:XM,flow:eA,flowInitial:ZM,insideSpan:rA,string:tA,text:nA},Symbol.toStringTag,{value:"Module"}));function aA(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},c=[];let l=[],d=[];const f={attempt:I(q),check:I(_),consume:L,enter:M,exit:O,interrupt:I(_,{interrupt:!0})},p={code:null,containerState:{},defineSkip:C,events:[],now:S,parser:e,previous:null,sliceSerialize:b,sliceStream:k,write:g};let y=t.tokenize.call(p,f);return t.resolveAll&&c.push(t),p;function g(K){return l=Dr(l,K),j(),l[l.length-1]!==null?[]:(F(t,0),p.events=su(c,p.events,p),p.events)}function b(K,X){return cA(k(K),X)}function k(K){return lA(l,K)}function S(){const{_bufferIndex:K,_index:X,line:$,column:ee,offset:te}=s;return{_bufferIndex:K,_index:X,line:$,column:ee,offset:te}}function C(K){a[K.line]=K.column,P()}function j(){let K;for(;s._index<l.length;){const X=l[s._index];if(typeof X=="string")for(K=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===K&&s._bufferIndex<X.length;)A(X.charCodeAt(s._bufferIndex));else A(X)}}function A(K){y=y(K)}function L(K){yt(K)?(s.line++,s.column=1,s.offset+=K===-3?2:1,P()):K!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===l[s._index].length&&(s._bufferIndex=-1,s._index++)),p.previous=K}function M(K,X){const $=X||{};return $.type=K,$.start=S(),p.events.push(["enter",$,p]),d.push($),$}function O(K){const X=d.pop();return X.end=S(),p.events.push(["exit",X,p]),X}function q(K,X){F(K,X.from)}function _(K,X){X.restore()}function I(K,X){return $;function $(ee,te,pe){let ne,z,ye,E;return Array.isArray(ee)?re(ee):"tokenize"in ee?re([ee]):W(ee);function W(je){return He;function He(qe){const et=qe!==null&&je[qe],ot=qe!==null&&je.null,bt=[...Array.isArray(et)?et:et?[et]:[],...Array.isArray(ot)?ot:ot?[ot]:[]];return re(bt)(qe)}}function re(je){return ne=je,z=0,je.length===0?pe:T(je[z])}function T(je){return He;function He(qe){return E=D(),ye=je,je.partial||(p.currentConstruct=je),je.name&&p.parser.constructs.disable.null.includes(je.name)?Le():je.tokenize.call(X?Object.assign(Object.create(p),X):p,f,ae,Le)(qe)}}function ae(je){return K(ye,E),te}function Le(je){return E.restore(),++z<ne.length?T(ne[z]):pe}}}function F(K,X){K.resolveAll&&!c.includes(K)&&c.push(K),K.resolve&&Nr(p.events,X,p.events.length-X,K.resolve(p.events.slice(X),p)),K.resolveTo&&(p.events=K.resolveTo(p.events,p))}function D(){const K=S(),X=p.previous,$=p.currentConstruct,ee=p.events.length,te=Array.from(d);return{from:ee,restore:pe};function pe(){s=K,p.previous=X,p.currentConstruct=$,p.events.length=ee,d=te,P()}}function P(){s.line in a&&s.column<2&&(s.column=a[s.line],s.offset+=a[s.line]-1)}}function lA(e,t){const n=t.start._index,s=t.start._bufferIndex,a=t.end._index,c=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(s,c)];else{if(l=e.slice(n,a),s>-1){const d=l[0];typeof d=="string"?l[0]=d.slice(s):l.shift()}c>0&&l.push(e[a].slice(0,c))}return l}function cA(e,t){let n=-1;const s=[];let a;for(;++n<e.length;){const c=e[n];let l;if(typeof c=="string")l=c;else switch(c){case-5:{l="\r";break}case-4:{l=`
71
+ `;break}case-3:{l=`\r
72
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(c)}a=c===-2,s.push(l)}return s.join("")}function uA(e){const s={constructs:wk([oA,...(e||{}).extensions||[]]),content:a(jR),defined:[],document:a(PR),flow:a($M),lazy:{},string:a(KM),text:a(QM)};return s;function a(c){return l;function l(d){return aA(s,c,d)}}}function dA(e){for(;!Ck(e););return e}const cv=/[\0\t\n\r]/g;function hA(){let e=1,t="",n=!0,s;return a;function a(c,l,d){const f=[];let p,y,g,b,k;for(c=t+(typeof c=="string"?c.toString():new TextDecoder(l||void 0).decode(c)),g=0,t="",n&&(c.charCodeAt(0)===65279&&g++,n=void 0);g<c.length;){if(cv.lastIndex=g,p=cv.exec(c),b=p&&p.index!==void 0?p.index:c.length,k=c.charCodeAt(b),!p){t=c.slice(g);break}if(k===10&&g===b&&s)f.push(-3),s=void 0;else switch(s&&(f.push(-5),s=void 0),g<b&&(f.push(c.slice(g,b)),e+=b-g),k){case 0:{f.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,f.push(-2);e++<y;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:s=!0,e=1}g=b+1}return d&&(s&&f.push(-5),t&&f.push(t),f.push(null)),f}}const fA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function mA(e){return e.replace(fA,pA)}function pA(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),c=a===120||a===88;return bk(n.slice(c?2:1),c?16:10)}return im(n)||e}const Rk={}.hasOwnProperty;function gA(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),yA(n)(dA(uA(n).document().write(hA()(e,t,!0))))}function yA(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Mt),autolinkProtocol:D,autolinkEmail:D,atxHeading:c(Ve),blockQuote:c(ot),characterEscape:D,characterReference:D,codeFenced:c(bt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:c(bt,l),codeText:c(Ct,l),codeTextData:D,data:D,codeFlowValue:D,definition:c(lt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:c(kt),hardBreakEscape:c(Tt),hardBreakTrailing:c(Tt),htmlFlow:c(Ot,l),htmlFlowData:D,htmlText:c(Ot,l),htmlTextData:D,image:c(St),label:l,link:c(Mt),listItem:c(At),listItemValue:b,listOrdered:c(Ht,g),listUnordered:c(Ht),paragraph:c(vt),reference:T,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:c(Ve),strong:c($t),thematicBreak:c(Lt)},exit:{atxHeading:f(),atxHeadingSequence:q,autolink:f(),autolinkEmail:et,autolinkProtocol:qe,blockQuote:f(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:Le,characterReferenceMarkerNumeric:Le,characterReferenceValue:je,characterReference:He,codeFenced:f(j),codeFencedFence:C,codeFencedFenceInfo:k,codeFencedFenceMeta:S,codeFlowValue:P,codeIndented:f(A),codeText:f(te),codeTextData:P,data:P,definition:f(),definitionDestinationString:O,definitionLabelString:L,definitionTitleString:M,emphasis:f(),hardBreakEscape:f(X),hardBreakTrailing:f(X),htmlFlow:f($),htmlFlowData:P,htmlText:f(ee),htmlTextData:P,image:f(ne),label:ye,labelText:z,lineEnding:K,link:f(pe),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ae,resourceDestinationString:E,resourceTitleString:W,resource:re,setextHeading:f(F),setextHeadingLineSequence:I,setextHeadingText:_,strong:f(),thematicBreak:f()}};Mk(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(ue){let ge={type:"root",children:[]};const Be={stack:[ge],tokenStack:[],config:t,enter:d,exit:p,buffer:l,resume:y,data:n},Pe=[];let ft=-1;for(;++ft<ue.length;)if(ue[ft][1].type==="listOrdered"||ue[ft][1].type==="listUnordered")if(ue[ft][0]==="enter")Pe.push(ft);else{const dt=Pe.pop();ft=a(ue,dt,ft)}for(ft=-1;++ft<ue.length;){const dt=t[ue[ft][0]];Rk.call(dt,ue[ft][1].type)&&dt[ue[ft][1].type].call(Object.assign({sliceSerialize:ue[ft][2].sliceSerialize},Be),ue[ft][1])}if(Be.tokenStack.length>0){const dt=Be.tokenStack[Be.tokenStack.length-1];(dt[1]||uv).call(Be,void 0,dt[0])}for(ge.position={start:Bi(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Bi(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},ft=-1;++ft<t.transforms.length;)ge=t.transforms[ft](ge)||ge;return ge}function a(ue,ge,Be){let Pe=ge-1,ft=-1,dt=!1,Rt,ht,Nt,jt;for(;++Pe<=Be;){const V=ue[Pe];switch(V[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{V[0]==="enter"?ft++:ft--,jt=void 0;break}case"lineEndingBlank":{V[0]==="enter"&&(Rt&&!jt&&!ft&&!Nt&&(Nt=Pe),jt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:jt=void 0}if(!ft&&V[0]==="enter"&&V[1].type==="listItemPrefix"||ft===-1&&V[0]==="exit"&&(V[1].type==="listUnordered"||V[1].type==="listOrdered")){if(Rt){let Me=Pe;for(ht=void 0;Me--;){const ze=ue[Me];if(ze[1].type==="lineEnding"||ze[1].type==="lineEndingBlank"){if(ze[0]==="exit")continue;ht&&(ue[ht][1].type="lineEndingBlank",dt=!0),ze[1].type="lineEnding",ht=Me}else if(!(ze[1].type==="linePrefix"||ze[1].type==="blockQuotePrefix"||ze[1].type==="blockQuotePrefixWhitespace"||ze[1].type==="blockQuoteMarker"||ze[1].type==="listItemIndent"))break}Nt&&(!ht||Nt<ht)&&(Rt._spread=!0),Rt.end=Object.assign({},ht?ue[ht][1].start:V[1].end),ue.splice(ht||Pe,0,["exit",Rt,V[2]]),Pe++,Be++}if(V[1].type==="listItemPrefix"){const Me={type:"listItem",_spread:!1,start:Object.assign({},V[1].start),end:void 0};Rt=Me,ue.splice(Pe,0,["enter",Me,V[2]]),Pe++,Be++,Nt=void 0,jt=!0}}}return ue[ge][1]._spread=dt,Be}function c(ue,ge){return Be;function Be(Pe){d.call(this,ue(Pe),Pe),ge&&ge.call(this,Pe)}}function l(){this.stack.push({type:"fragment",children:[]})}function d(ue,ge,Be){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([ge,Be||void 0]),ue.position={start:Bi(ge.start),end:void 0}}function f(ue){return ge;function ge(Be){ue&&ue.call(this,Be),p.call(this,Be)}}function p(ue,ge){const Be=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==ue.type&&(ge?ge.call(this,ue,Pe[0]):(Pe[1]||uv).call(this,ue,Pe[0]));else throw new Error("Cannot close `"+ue.type+"` ("+ba({start:ue.start,end:ue.end})+"): it’s not open");Be.position.end=Bi(ue.end)}function y(){return rm(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(ue){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function k(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=ue}function S(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=ue}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue.replace(/(\r?\n|\r)$/g,"")}function L(ue){const ge=this.resume(),Be=this.stack[this.stack.length-1];Be.label=ge,Be.identifier=Qr(this.sliceSerialize(ue)).toLowerCase()}function M(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ue}function O(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ue}function q(ue){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Be=this.sliceSerialize(ue).length;ge.depth=Be}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function I(ue){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function D(ue){const Be=this.stack[this.stack.length-1].children;let Pe=Be[Be.length-1];(!Pe||Pe.type!=="text")&&(Pe=Dt(),Pe.position={start:Bi(ue.start),end:void 0},Be.push(Pe)),this.stack.push(Pe)}function P(ue){const ge=this.stack.pop();ge.value+=this.sliceSerialize(ue),ge.position.end=Bi(ue.end)}function K(ue){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Be=ge.children[ge.children.length-1];Be.position.end=Bi(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(D.call(this,ue),P.call(this,ue))}function X(){this.data.atHardBreak=!0}function $(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue}function ee(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue}function te(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue}function pe(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ge,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function ne(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ge,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function z(ue){const ge=this.sliceSerialize(ue),Be=this.stack[this.stack.length-2];Be.label=mA(ge),Be.identifier=Qr(ge).toLowerCase()}function ye(){const ue=this.stack[this.stack.length-1],ge=this.resume(),Be=this.stack[this.stack.length-1];if(this.data.inReference=!0,Be.type==="link"){const Pe=ue.children;Be.children=Pe}else Be.alt=ge}function E(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ue}function W(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ue}function re(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ae(ue){const ge=this.resume(),Be=this.stack[this.stack.length-1];Be.label=ge,Be.identifier=Qr(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function Le(ue){this.data.characterReferenceType=ue.type}function je(ue){const ge=this.sliceSerialize(ue),Be=this.data.characterReferenceType;let Pe;Be?(Pe=bk(ge,Be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=im(ge);const ft=this.stack[this.stack.length-1];ft.value+=Pe}function He(ue){const ge=this.stack.pop();ge.position.end=Bi(ue.end)}function qe(ue){P.call(this,ue);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(ue)}function et(ue){P.call(this,ue);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(ue)}function ot(){return{type:"blockquote",children:[]}}function bt(){return{type:"code",lang:null,meta:null,value:""}}function Ct(){return{type:"inlineCode",value:""}}function lt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function kt(){return{type:"emphasis",children:[]}}function Ve(){return{type:"heading",depth:0,children:[]}}function Tt(){return{type:"break"}}function Ot(){return{type:"html",value:""}}function St(){return{type:"image",title:null,url:"",alt:null}}function Mt(){return{type:"link",title:null,url:"",children:[]}}function Ht(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function At(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function vt(){return{type:"paragraph",children:[]}}function $t(){return{type:"strong",children:[]}}function Dt(){return{type:"text",value:""}}function Lt(){return{type:"thematicBreak"}}}function Bi(e){return{line:e.line,column:e.column,offset:e.offset}}function Mk(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?Mk(e,s):vA(e,s)}}function vA(e,t){let n;for(n in t)if(Rk.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function uv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ba({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ba({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ba({start:t.start,end:t.end})+") is still open")}function wA(e){const t=this;t.parser=n;function n(s){return gA(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function bA(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function xA(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
73
+ `}]}function kA(e,t){const n=t.value?t.value+`
74
+ `:"",s={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(s.className=["language-"+a[0]]);let c={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(c.data={meta:t.meta}),e.patch(t,c),c=e.applyData(t,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(t,c),c}function SA(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CA(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jA(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),a=mo(s.toLowerCase()),c=e.footnoteOrder.indexOf(s);let l,d=e.footnoteCounts.get(s);d===void 0?(d=0,e.footnoteOrder.push(s),l=e.footnoteOrder.length):l=c+1,d+=1,e.footnoteCounts.set(s,d);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const p={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,p),e.applyData(t,p)}function NA(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ak(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const a=e.all(t),c=a[0];c&&c.type==="text"?c.value="["+c.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=s:a.push({type:"text",value:s}),a}function TA(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return Ak(e,t);const a={src:mo(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(a.title=s.title);const c={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,c),e.applyData(t,c)}function EA(e,t){const n={src:mo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function RA(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function MA(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return Ak(e,t);const a={href:mo(s.url||"")};s.title!==null&&s.title!==void 0&&(a.title=s.title);const c={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function AA(e,t){const n={href:mo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function LA(e,t,n){const s=e.all(t),a=n?IA(n):Lk(t),c={},l=[];if(typeof t.checked=="boolean"){const y=s[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},s.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let d=-1;for(;++d<s.length;){const y=s[d];(a||d!==0||y.type!=="element"||y.tagName!=="p")&&l.push({type:"text",value:`
75
+ `}),y.type==="element"&&y.tagName==="p"&&!a?l.push(...y.children):l.push(y)}const f=s[s.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
76
+ `});const p={type:"element",tagName:"li",properties:c,children:l};return e.patch(t,p),e.applyData(t,p)}function IA(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let s=-1;for(;!t&&++s<n.length;)t=Lk(n[s])}return t}function Lk(e){const t=e.spread;return t??e.children.length>1}function DA(e,t){const n={},s=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<s.length;){const l=s[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const c={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)}function _A(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FA(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function OA(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BA(e,t){const n=e.all(t),s=n.shift(),a=[];if(s){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=Zf(t.children[1]),f=hk(t.children[t.children.length-1]);d&&f&&(l.position={start:d,end:f}),a.push(l)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,c),e.applyData(t,c)}function UA(e,t,n){const s=n?n.children:void 0,c=(s?s.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,d=l?l.length:t.children.length;let f=-1;const p=[];for(;++f<d;){const g=t.children[f],b={},k=l?l[f]:void 0;k&&(b.align=k);let S={type:"element",tagName:c,properties:b,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),p.push(S)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(t,y),e.applyData(t,y)}function WA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const dv=9,hv=32;function zA(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),a=0;const c=[];for(;s;)c.push(fv(t.slice(a,s.index),a>0,!0),s[0]),a=s.index+s[0].length,s=n.exec(t);return c.push(fv(t.slice(a),a>0,!1)),c.join("")}function fv(e,t,n){let s=0,a=e.length;if(t){let c=e.codePointAt(s);for(;c===dv||c===hv;)s++,c=e.codePointAt(s)}if(n){let c=e.codePointAt(a-1);for(;c===dv||c===hv;)a--,c=e.codePointAt(a-1)}return a>s?e.slice(s,a):""}function HA(e,t){const n={type:"text",value:zA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function qA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const $A={blockquote:bA,break:xA,code:kA,delete:SA,emphasis:CA,footnoteReference:jA,heading:NA,html:PA,imageReference:TA,image:EA,inlineCode:RA,linkReference:MA,link:AA,listItem:LA,list:DA,paragraph:_A,root:FA,strong:OA,table:BA,tableCell:WA,tableRow:UA,text:HA,thematicBreak:qA,toml:ec,yaml:ec,definition:ec,footnoteDefinition:ec};function ec(){}const Ik=-1,ou=0,ka=1,$c=2,om=3,am=4,lm=5,cm=6,Dk=7,_k=8,mv=typeof self=="object"?self:globalThis,VA=(e,t)=>{const n=(a,c)=>(e.set(c,a),a),s=a=>{if(e.has(a))return e.get(a);const[c,l]=t[a];switch(c){case ou:case Ik:return n(l,a);case ka:{const d=n([],a);for(const f of l)d.push(s(f));return d}case $c:{const d=n({},a);for(const[f,p]of l)d[s(f)]=s(p);return d}case om:return n(new Date(l),a);case am:{const{source:d,flags:f}=l;return n(new RegExp(d,f),a)}case lm:{const d=n(new Map,a);for(const[f,p]of l)d.set(s(f),s(p));return d}case cm:{const d=n(new Set,a);for(const f of l)d.add(s(f));return d}case Dk:{const{name:d,message:f}=l;return n(new mv[d](f),a)}case _k:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:d}=new Uint8Array(l);return n(new DataView(d),l)}}return n(new mv[c](l),a)};return s},pv=e=>VA(new Map,e)(0),Js="",{toString:GA}={},{keys:KA}=Object,da=e=>{const t=typeof e;if(t!=="object"||!e)return[ou,t];const n=GA.call(e).slice(8,-1);switch(n){case"Array":return[ka,Js];case"Object":return[$c,Js];case"Date":return[om,Js];case"RegExp":return[am,Js];case"Map":return[lm,Js];case"Set":return[cm,Js];case"DataView":return[ka,n]}return n.includes("Array")?[ka,n]:n.includes("Error")?[Dk,n]:[$c,n]},tc=([e,t])=>e===ou&&(t==="function"||t==="symbol"),QA=(e,t,n,s)=>{const a=(l,d)=>{const f=s.push(l)-1;return n.set(d,f),f},c=l=>{if(n.has(l))return n.get(l);let[d,f]=da(l);switch(d){case ou:{let y=l;switch(f){case"bigint":d=_k,y=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);y=null;break;case"undefined":return a([Ik],l)}return a([d,y],l)}case ka:{if(f){let b=l;return f==="DataView"?b=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(b=new Uint8Array(l)),a([f,[...b]],l)}const y=[],g=a([d,y],l);for(const b of l)y.push(c(b));return g}case $c:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return c(l.toJSON());const y=[],g=a([d,y],l);for(const b of KA(l))(e||!tc(da(l[b])))&&y.push([c(b),c(l[b])]);return g}case om:return a([d,l.toISOString()],l);case am:{const{source:y,flags:g}=l;return a([d,{source:y,flags:g}],l)}case lm:{const y=[],g=a([d,y],l);for(const[b,k]of l)(e||!(tc(da(b))||tc(da(k))))&&y.push([c(b),c(k)]);return g}case cm:{const y=[],g=a([d,y],l);for(const b of l)(e||!tc(da(b)))&&y.push(c(b));return g}}const{message:p}=l;return a([d,{name:f,message:p}],l)};return c},gv=(e,{json:t,lossy:n}={})=>{const s=[];return QA(!(t||n),!!t,new Map,s)(e),s},Vc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?pv(gv(e,t)):structuredClone(e):(e,t)=>pv(gv(e,t));function YA(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function XA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function JA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||YA,s=e.options.footnoteBackLabel||XA,a=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let f=-1;for(;++f<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[f]);if(!p)continue;const y=e.all(p),g=String(p.identifier).toUpperCase(),b=mo(g.toLowerCase());let k=0;const S=[],C=e.footnoteCounts.get(g);for(;C!==void 0&&++k<=C;){S.length>0&&S.push({type:"text",value:" "});let L=typeof n=="string"?n:n(f,k);typeof L=="string"&&(L={type:"text",value:L}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(k>1?"-"+k:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(f,k),className:["data-footnote-backref"]},children:Array.isArray(L)?L:[L]})}const j=y[y.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const L=j.children[j.children.length-1];L&&L.type==="text"?L.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...S)}else y.push(...S);const A={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(p,A),d.push(A)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Vc(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
77
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
78
+ `}]}}const au=(function(e){if(e==null)return nL;if(typeof e=="function")return lu(e);if(typeof e=="object")return Array.isArray(e)?ZA(e):eL(e);if(typeof e=="string")return tL(e);throw new Error("Expected function, string, or object as test")});function ZA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=au(e[n]);return lu(s);function s(...a){let c=-1;for(;++c<t.length;)if(t[c].apply(this,a))return!0;return!1}}function eL(e){const t=e;return lu(n);function n(s){const a=s;let c;for(c in e)if(a[c]!==t[c])return!1;return!0}}function tL(e){return lu(t);function t(n){return n&&n.type===e}}function lu(e){return t;function t(n,s,a){return!!(rL(n)&&e.call(this,n,typeof s=="number"?s:void 0,a||void 0))}}function nL(){return!0}function rL(e){return e!==null&&typeof e=="object"&&"type"in e}const Fk=[],iL=!0,pf=!1,sL="skip";function Ok(e,t,n,s){let a;typeof t=="function"&&typeof n!="function"?(s=n,n=t):a=t;const c=au(a),l=s?-1:1;d(e,void 0,[])();function d(f,p,y){const g=f&&typeof f=="object"?f:{};if(typeof g.type=="string"){const k=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(f.type+(k?"<"+k+">":""))+")"})}return b;function b(){let k=Fk,S,C,j;if((!t||c(f,p,y[y.length-1]||void 0))&&(k=oL(n(f,y)),k[0]===pf))return k;if("children"in f&&f.children){const A=f;if(A.children&&k[0]!==sL)for(C=(s?A.children.length:-1)+l,j=y.concat(A);C>-1&&C<A.children.length;){const L=A.children[C];if(S=d(L,C,j)(),S[0]===pf)return S;C=typeof S[1]=="number"?S[1]:C+l}}return k}}}function oL(e){return Array.isArray(e)?e:typeof e=="number"?[iL,e]:e==null?Fk:[e]}function um(e,t,n,s){let a,c,l;typeof t=="function"&&typeof n!="function"?(c=void 0,l=t,a=n):(c=t,l=n,a=s),Ok(e,c,d,a);function d(f,p){const y=p[p.length-1],g=y?y.children.indexOf(f):void 0;return l(f,g,y)}}const gf={}.hasOwnProperty,aL={};function lL(e,t){const n=t||aL,s=new Map,a=new Map,c=new Map,l={...$A,...n.handlers},d={all:p,applyData:uL,definitionById:s,footnoteById:a,footnoteCounts:c,footnoteOrder:[],handlers:l,one:f,options:n,patch:cL,wrap:hL};return um(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?s:a,b=String(y.identifier).toUpperCase();g.has(b)||g.set(b,y)}}),d;function f(y,g){const b=y.type,k=d.handlers[b];if(gf.call(d.handlers,b)&&k)return k(d,y,g);if(d.options.passThrough&&d.options.passThrough.includes(b)){if("children"in y){const{children:C,...j}=y,A=Vc(j);return A.children=d.all(y),A}return Vc(y)}return(d.options.unknownHandler||dL)(d,y,g)}function p(y){const g=[];if("children"in y){const b=y.children;let k=-1;for(;++k<b.length;){const S=d.one(b[k],y);if(S){if(k&&b[k-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=yv(S.value)),!Array.isArray(S)&&S.type==="element")){const C=S.children[0];C&&C.type==="text"&&(C.value=yv(C.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function cL(e,t){e.position&&(t.position=XE(e))}function uL(e,t){let n=t;if(e&&e.data){const s=e.data.hName,a=e.data.hChildren,c=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const l="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:l}}n.type==="element"&&c&&Object.assign(n.properties,Vc(c)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function dL(e,t){const n=t.data||{},s="value"in t&&!(gf.call(n,"hProperties")||gf.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function hL(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
79
+ `});++s<e.length;)s&&n.push({type:"text",value:`
80
+ `}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
81
+ `}),n}function yv(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function vv(e,t){const n=lL(e,t),s=n.one(e,void 0),a=JA(n),c=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return a&&c.children.push({type:"text",value:`
82
+ `},a),c}function fL(e,t){return e&&"run"in e?async function(n,s){const a=vv(n,{file:s,...t});await e.run(a,s)}:function(n,s){return vv(n,{file:s,...e||t})}}function wv(e){if(e)throw e}var oh,bv;function mL(){if(bv)return oh;bv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},c=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var y=e.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!g)return!1;var b;for(b in p);return typeof b>"u"||e.call(p,b)},l=function(p,y){n&&y.name==="__proto__"?n(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},d=function(p,y){if(y==="__proto__")if(e.call(p,y)){if(s)return s(p,y).value}else return;return p[y]};return oh=function f(){var p,y,g,b,k,S,C=arguments[0],j=1,A=arguments.length,L=!1;for(typeof C=="boolean"&&(L=C,C=arguments[1]||{},j=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});j<A;++j)if(p=arguments[j],p!=null)for(y in p)g=d(C,y),b=d(p,y),C!==b&&(L&&b&&(c(b)||(k=a(b)))?(k?(k=!1,S=g&&a(g)?g:[]):S=g&&c(g)?g:{},l(C,{name:y,newValue:f(L,S,b)})):typeof b<"u"&&l(C,{name:y,newValue:b}));return C},oh}var pL=mL();const ah=Fa(pL);function yf(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function gL(){const e=[],t={run:n,use:s};return t;function n(...a){let c=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);d(null,...a);function d(f,...p){const y=e[++c];let g=-1;if(f){l(f);return}for(;++g<a.length;)(p[g]===null||p[g]===void 0)&&(p[g]=a[g]);a=p,y?yL(y,d)(...p):l(null,...p)}}function s(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function yL(e,t){let n;return s;function s(...l){const d=e.length>l.length;let f;d&&l.push(a);try{f=e.apply(this,l)}catch(p){const y=p;if(d&&n)throw y;return a(y)}d||(f&&f.then&&typeof f.then=="function"?f.then(c,a):f instanceof Error?a(f):c(f))}function a(l,...d){n||(n=!0,t(l,...d))}function c(l){a(null,l)}}const ii={basename:vL,dirname:wL,extname:bL,join:xL,sep:"/"};function vL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Va(e);let n=0,s=-1,a=e.length,c;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(c){n=a+1;break}}else s<0&&(c=!0,s=a+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let l=-1,d=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(c){n=a+1;break}}else l<0&&(c=!0,l=a+1),d>-1&&(e.codePointAt(a)===t.codePointAt(d--)?d<0&&(s=a):(d=-1,s=l));return n===s?s=l:s<0&&(s=e.length),e.slice(n,s)}function wL(e){if(Va(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function bL(e){Va(e);let t=e.length,n=-1,s=0,a=-1,c=0,l;for(;t--;){const d=e.codePointAt(t);if(d===47){if(l){s=t+1;break}continue}n<0&&(l=!0,n=t+1),d===46?a<0?a=t:c!==1&&(c=1):a>-1&&(c=-1)}return a<0||n<0||c===0||c===1&&a===n-1&&a===s+1?"":e.slice(a,n)}function xL(...e){let t=-1,n;for(;++t<e.length;)Va(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":kL(n)}function kL(e){Va(e);const t=e.codePointAt(0)===47;let n=SL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function SL(e,t){let n="",s=0,a=-1,c=0,l=-1,d,f;for(;++l<=e.length;){if(l<e.length)d=e.codePointAt(l);else{if(d===47)break;d=47}if(d===47){if(!(a===l-1||c===1))if(a!==l-1&&c===2){if(n.length<2||s!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",s=0):(n=n.slice(0,f),s=n.length-1-n.lastIndexOf("/")),a=l,c=0;continue}}else if(n.length>0){n="",s=0,a=l,c=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),s=l-a-1;a=l,c=0}else d===46&&c>-1?c++:c=-1}return n}function Va(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const CL={cwd:jL};function jL(){return"/"}function vf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function NL(e){if(typeof e=="string")e=new URL(e);else if(!vf(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return PL(e)}function PL(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const s=t.codePointAt(n+2);if(s===70||s===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const lh=["history","path","basename","stem","extname","dirname"];class Bk{constructor(t){let n;t?vf(t)?n={path:t}:typeof t=="string"||TL(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":CL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<lh.length;){const c=lh[s];c in n&&n[c]!==void 0&&n[c]!==null&&(this[c]=c==="history"?[...n[c]]:n[c])}let a;for(a in n)lh.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ii.basename(this.path):void 0}set basename(t){uh(t,"basename"),ch(t,"basename"),this.path=ii.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ii.dirname(this.path):void 0}set dirname(t){xv(this.basename,"dirname"),this.path=ii.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ii.extname(this.path):void 0}set extname(t){if(ch(t,"extname"),xv(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ii.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){vf(t)&&(t=NL(t)),uh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ii.basename(this.path,this.extname):void 0}set stem(t){uh(t,"stem"),ch(t,"stem"),this.path=ii.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const a=this.message(t,n,s);throw a.fatal=!0,a}info(t,n,s){const a=this.message(t,n,s);return a.fatal=void 0,a}message(t,n,s){const a=new Qn(t,n,s);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ch(e,t){if(e&&e.includes(ii.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ii.sep+"`")}function uh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function xv(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function TL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const EL=(function(e){const s=this.constructor.prototype,a=s[e],c=function(){return a.apply(c,arguments)};return Object.setPrototypeOf(c,s),c}),RL={}.hasOwnProperty;class dm extends EL{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=gL()}copy(){const t=new dm;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(ah(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fh("data",this.frozen),this.namespace[t]=n,this):RL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const a=n.call(t,...s);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=nc(t),s=this.parser||this.Parser;return dh("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),dh("process",this.parser||this.Parser),hh("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(c,l){const d=nc(t),f=s.parse(d);s.run(f,d,function(y,g,b){if(y||!g||!b)return p(y);const k=g,S=s.stringify(k,b);LL(S)?b.value=S:b.result=S,p(y,b)});function p(y,g){y||!g?l(y):c?c(g):n(void 0,g)}}}processSync(t){let n=!1,s;return this.freeze(),dh("processSync",this.parser||this.Parser),hh("processSync",this.compiler||this.Compiler),this.process(t,a),Sv("processSync","process",n),s;function a(c,l){n=!0,wv(c),s=l}}run(t,n,s){kv(t),this.freeze();const a=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?c(void 0,s):new Promise(c);function c(l,d){const f=nc(n);a.run(t,f,p);function p(y,g,b){const k=g||t;y?d(y):l?l(k):s(void 0,k,b)}}}runSync(t,n){let s=!1,a;return this.run(t,n,c),Sv("runSync","run",s),a;function c(l,d){wv(l),a=d,s=!0}}stringify(t,n){this.freeze();const s=nc(n),a=this.compiler||this.Compiler;return hh("stringify",a),kv(t),a(t,s)}use(t,...n){const s=this.attachers,a=this.namespace;if(fh("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function c(p){if(typeof p=="function")f(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[y,...g]=p;f(y,g)}else l(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function l(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(p.plugins),p.settings&&(a.settings=ah(!0,a.settings,p.settings))}function d(p){let y=-1;if(p!=null)if(Array.isArray(p))for(;++y<p.length;){const g=p[y];c(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function f(p,y){let g=-1,b=-1;for(;++g<s.length;)if(s[g][0]===p){b=g;break}if(b===-1)s.push([p,...y]);else if(y.length>0){let[k,...S]=y;const C=s[b][1];yf(C)&&yf(k)&&(k=ah(!0,C,k)),s[b]=[p,k,...S]}}}}const ML=new dm().freeze();function dh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function kv(e){if(!yf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Sv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function nc(e){return AL(e)?e:new Bk(e)}function AL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function LL(e){return typeof e=="string"||IL(e)}function IL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const DL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cv=[],jv={allowDangerousHtml:!0},_L=/^(https?|ircs?|mailto|xmpp)$/i,FL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function hm(e){const t=OL(e),n=BL(e);return UL(t.runSync(t.parse(n),n),e)}function OL(e){const t=e.rehypePlugins||Cv,n=e.remarkPlugins||Cv,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...jv}:jv;return ML().use(wA).use(n).use(fL,s).use(t)}function BL(e){const t=e.children||"",n=new Bk;return typeof t=="string"&&(n.value=t),n}function UL(e,t){const n=t.allowedElements,s=t.allowElement,a=t.components,c=t.disallowedElements,l=t.skipHtml,d=t.unwrapDisallowed,f=t.urlTransform||WL;for(const y of FL)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+DL+y.id,void 0);return um(e,p),nR(e,{Fragment:i.Fragment,components:a,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function p(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return l?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let k;for(k in rh)if(Object.hasOwn(rh,k)&&Object.hasOwn(y.properties,k)){const S=y.properties[k],C=rh[k];(C===null||C.includes(y.tagName))&&(y.properties[k]=f(String(S||""),k,y))}}if(y.type==="element"){let k=n?!n.includes(y.tagName):c?c.includes(y.tagName):!1;if(!k&&s&&typeof g=="number"&&(k=!s(y,g,b)),k&&b&&typeof g=="number")return d&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function WL(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||s!==-1&&t>s||_L.test(e.slice(0,t))?e:""}function Nv(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,a=n.indexOf(t);for(;a!==-1;)s++,a=n.indexOf(t,a+t.length);return s}function zL(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function HL(e,t,n){const a=au((n||{}).ignore||[]),c=qL(t);let l=-1;for(;++l<c.length;)Ok(e,"text",d);function d(p,y){let g=-1,b;for(;++g<y.length;){const k=y[g],S=b?b.children:void 0;if(a(k,S?S.indexOf(k):void 0,b))return;b=k}if(b)return f(p,y)}function f(p,y){const g=y[y.length-1],b=c[l][0],k=c[l][1];let S=0;const j=g.children.indexOf(p);let A=!1,L=[];b.lastIndex=0;let M=b.exec(p.value);for(;M;){const O=M.index,q={index:M.index,input:M.input,stack:[...y,p]};let _=k(...M,q);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?b.lastIndex=O+1:(S!==O&&L.push({type:"text",value:p.value.slice(S,O)}),Array.isArray(_)?L.push(..._):_&&L.push(_),S=O+M[0].length,A=!0),!b.global)break;M=b.exec(p.value)}return A?(S<p.value.length&&L.push({type:"text",value:p.value.slice(S)}),g.children.splice(j,1,...L)):L=[p],j+L.length}}function qL(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<n.length;){const a=n[s];t.push([$L(a[0]),VL(a[1])])}return t}function $L(e){return typeof e=="string"?new RegExp(zL(e),"g"):e}function VL(e){return typeof e=="function"?e:function(){return e}}const mh="phrasing",ph=["autolink","link","image","label"];function GL(){return{transforms:[eI],enter:{literalAutolink:QL,literalAutolinkEmail:gh,literalAutolinkHttp:gh,literalAutolinkWww:gh},exit:{literalAutolink:ZL,literalAutolinkEmail:JL,literalAutolinkHttp:YL,literalAutolinkWww:XL}}}function KL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mh,notInConstruct:ph},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mh,notInConstruct:ph},{character:":",before:"[ps]",after:"\\/",inConstruct:mh,notInConstruct:ph}]}}function QL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gh(e){this.config.enter.autolinkProtocol.call(this,e)}function YL(e){this.config.exit.autolinkProtocol.call(this,e)}function XL(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function JL(e){this.config.exit.autolinkEmail.call(this,e)}function ZL(e){this.exit(e)}function eI(e){HL(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,tI],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),nI]],{ignore:["link","linkReference"]})}function tI(e,t,n,s,a){let c="";if(!Uk(a)||(/^w/i.test(t)&&(n=t+n,t="",c="http://"),!rI(n)))return!1;const l=iI(n+s);if(!l[0])return!1;const d={type:"link",title:null,url:c+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[d,{type:"text",value:l[1]}]:d}function nI(e,t,n,s){return!Uk(s,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rI(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function iI(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],s=n.indexOf(")");const a=Nv(e,"(");let c=Nv(e,")");for(;s!==-1&&a>c;)e+=n.slice(0,s+1),n=n.slice(s+1),s=n.indexOf(")"),c++;return[e,n]}function Uk(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ks(n)||iu(n))&&(!t||n!==47)}Wk.peek=fI;function sI(){this.buffer()}function oI(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function aI(){this.buffer()}function lI(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function cI(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uI(e){this.exit(e)}function dI(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hI(e){this.exit(e)}function fI(){return"["}function Wk(e,t,n,s){const a=n.createTracker(s);let c=a.move("[^");const l=n.enter("footnoteReference"),d=n.enter("reference");return c+=a.move(n.safe(n.associationId(e),{after:"]",before:c})),d(),l(),c+=a.move("]"),c}function mI(){return{enter:{gfmFootnoteCallString:sI,gfmFootnoteCall:oI,gfmFootnoteDefinitionLabelString:aI,gfmFootnoteDefinition:lI},exit:{gfmFootnoteCallString:cI,gfmFootnoteCall:uI,gfmFootnoteDefinitionLabelString:dI,gfmFootnoteDefinition:hI}}}function pI(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Wk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(s,a,c,l){const d=c.createTracker(l);let f=d.move("[^");const p=c.enter("footnoteDefinition"),y=c.enter("label");return f+=d.move(c.safe(c.associationId(s),{before:f,after:"]"})),y(),f+=d.move("]:"),s.children&&s.children.length>0&&(d.shift(4),f+=d.move((t?`
83
+ `:" ")+c.indentLines(c.containerFlow(s,d.current()),t?zk:gI))),p(),f}}function gI(e,t,n){return t===0?e:zk(e,t,n)}function zk(e,t,n){return(n?"":" ")+e}const yI=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Hk.peek=kI;function vI(){return{canContainEols:["delete"],enter:{strikethrough:bI},exit:{strikethrough:xI}}}function wI(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:yI}],handlers:{delete:Hk}}}function bI(e){this.enter({type:"delete",children:[]},e)}function xI(e){this.exit(e)}function Hk(e,t,n,s){const a=n.createTracker(s),c=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),c(),l}function kI(){return"~"}function SI(e){return e.length}function CI(e,t){const n=t||{},s=(n.align||[]).concat(),a=n.stringLength||SI,c=[],l=[],d=[],f=[];let p=0,y=-1;for(;++y<e.length;){const C=[],j=[];let A=-1;for(e[y].length>p&&(p=e[y].length);++A<e[y].length;){const L=jI(e[y][A]);if(n.alignDelimiters!==!1){const M=a(L);j[A]=M,(f[A]===void 0||M>f[A])&&(f[A]=M)}C.push(L)}l[y]=C,d[y]=j}let g=-1;if(typeof s=="object"&&"length"in s)for(;++g<p;)c[g]=Pv(s[g]);else{const C=Pv(s);for(;++g<p;)c[g]=C}g=-1;const b=[],k=[];for(;++g<p;){const C=c[g];let j="",A="";C===99?(j=":",A=":"):C===108?j=":":C===114&&(A=":");let L=n.alignDelimiters===!1?1:Math.max(1,f[g]-j.length-A.length);const M=j+"-".repeat(L)+A;n.alignDelimiters!==!1&&(L=j.length+L+A.length,L>f[g]&&(f[g]=L),k[g]=L),b[g]=M}l.splice(1,0,b),d.splice(1,0,k),y=-1;const S=[];for(;++y<l.length;){const C=l[y],j=d[y];g=-1;const A=[];for(;++g<p;){const L=C[g]||"";let M="",O="";if(n.alignDelimiters!==!1){const q=f[g]-(j[g]||0),_=c[g];_===114?M=" ".repeat(q):_===99?q%2?(M=" ".repeat(q/2+.5),O=" ".repeat(q/2-.5)):(M=" ".repeat(q/2),O=M):O=" ".repeat(q)}n.delimiterStart!==!1&&!g&&A.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&L==="")&&(n.delimiterStart!==!1||g)&&A.push(" "),n.alignDelimiters!==!1&&A.push(M),A.push(L),n.alignDelimiters!==!1&&A.push(O),n.padding!==!1&&A.push(" "),(n.delimiterEnd!==!1||g!==p-1)&&A.push("|")}S.push(n.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return S.join(`
84
+ `)}function jI(e){return e==null?"":String(e)}function Pv(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function NI(e,t,n,s){const a=n.enter("blockquote"),c=n.createTracker(s);c.move("> "),c.shift(2);const l=n.indentLines(n.containerFlow(e,c.current()),PI);return a(),l}function PI(e,t,n){return">"+(n?"":" ")+e}function TI(e,t){return Tv(e,t.inConstruct,!0)&&!Tv(e,t.notInConstruct,!1)}function Tv(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function Ev(e,t,n,s){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
85
+ `&&TI(n.stack,n.unsafe[a]))return/[ \t]/.test(s.before)?"":" ";return`\\
86
+ `}function EI(e,t){const n=String(e);let s=n.indexOf(t),a=s,c=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===a?++c>l&&(l=c):c=1,a=s+t.length,s=n.indexOf(t,a);return l}function RI(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function MI(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function AI(e,t,n,s){const a=MI(n),c=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(RI(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(c,LI);return g(),b}const d=n.createTracker(s),f=a.repeat(Math.max(EI(c,a)+1,3)),p=n.enter("codeFenced");let y=d.move(f);if(e.lang){const g=n.enter(`codeFencedLang${l}`);y+=d.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...d.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${l}`);y+=d.move(" "),y+=d.move(n.safe(e.meta,{before:y,after:`
87
+ `,encode:["`"],...d.current()})),g()}return y+=d.move(`
88
+ `),c&&(y+=d.move(c+`
89
+ `)),y+=d.move(f),p(),y}function LI(e,t,n){return(n?"":" ")+e}function fm(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function II(e,t,n,s){const a=fm(n),c=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let d=n.enter("label");const f=n.createTracker(s);let p=f.move("[");return p+=f.move(n.safe(n.associationId(e),{before:p,after:"]",...f.current()})),p+=f.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),p+=f.move("<"),p+=f.move(n.safe(e.url,{before:p,after:">",...f.current()})),p+=f.move(">")):(d=n.enter("destinationRaw"),p+=f.move(n.safe(e.url,{before:p,after:e.title?" ":`
90
+ `,...f.current()}))),d(),e.title&&(d=n.enter(`title${c}`),p+=f.move(" "+a),p+=f.move(n.safe(e.title,{before:p,after:a,...f.current()})),p+=f.move(a),d()),l(),p}function DI(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ma(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Gc(e,t,n){const s=lo(e),a=lo(t);return s===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}qk.peek=_I;function qk(e,t,n,s){const a=DI(n),c=n.enter("emphasis"),l=n.createTracker(s),d=l.move(a);let f=l.move(n.containerPhrasing(e,{after:a,before:d,...l.current()}));const p=f.charCodeAt(0),y=Gc(s.before.charCodeAt(s.before.length-1),p,a);y.inside&&(f=Ma(p)+f.slice(1));const g=f.charCodeAt(f.length-1),b=Gc(s.after.charCodeAt(0),g,a);b.inside&&(f=f.slice(0,-1)+Ma(g));const k=l.move(a);return c(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},d+f+k}function _I(e,t,n){return n.options.emphasis||"*"}function FI(e,t){let n=!1;return um(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return n=!0,pf}),!!((!e.depth||e.depth<3)&&rm(e)&&(t.options.setext||n))}function OI(e,t,n,s){const a=Math.max(Math.min(6,e.depth||1),1),c=n.createTracker(s);if(FI(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...c.current(),before:`
91
+ `,after:`
92
+ `});return g(),y(),b+`
93
+ `+(a===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
94
+ `))+1))}const l="#".repeat(a),d=n.enter("headingAtx"),f=n.enter("phrasing");c.move(l+" ");let p=n.containerPhrasing(e,{before:"# ",after:`
95
+ `,...c.current()});return/^[\t ]/.test(p)&&(p=Ma(p.charCodeAt(0))+p.slice(1)),p=p?l+" "+p:l,n.options.closeAtx&&(p+=" "+l),f(),d(),p}$k.peek=BI;function $k(e){return e.value||""}function BI(){return"<"}Vk.peek=UI;function Vk(e,t,n,s){const a=fm(n),c=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let d=n.enter("label");const f=n.createTracker(s);let p=f.move("![");return p+=f.move(n.safe(e.alt,{before:p,after:"]",...f.current()})),p+=f.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),p+=f.move("<"),p+=f.move(n.safe(e.url,{before:p,after:">",...f.current()})),p+=f.move(">")):(d=n.enter("destinationRaw"),p+=f.move(n.safe(e.url,{before:p,after:e.title?" ":")",...f.current()}))),d(),e.title&&(d=n.enter(`title${c}`),p+=f.move(" "+a),p+=f.move(n.safe(e.title,{before:p,after:a,...f.current()})),p+=f.move(a),d()),p+=f.move(")"),l(),p}function UI(){return"!"}Gk.peek=WI;function Gk(e,t,n,s){const a=e.referenceType,c=n.enter("imageReference");let l=n.enter("label");const d=n.createTracker(s);let f=d.move("![");const p=n.safe(e.alt,{before:f,after:"]",...d.current()});f+=d.move(p+"]["),l();const y=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...d.current()});return l(),n.stack=y,c(),a==="full"||!p||p!==g?f+=d.move(g+"]"):a==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function WI(){return"!"}Kk.peek=zI;function Kk(e,t,n){let s=e.value||"",a="`",c=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(s);)a+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++c<n.unsafe.length;){const l=n.unsafe[c],d=n.compilePattern(l);let f;if(l.atBreak)for(;f=d.exec(s);){let p=f.index;s.charCodeAt(p)===10&&s.charCodeAt(p-1)===13&&p--,s=s.slice(0,p)+" "+s.slice(f.index+1)}}return a+s+a}function zI(){return"`"}function Qk(e,t){const n=rm(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Yk.peek=HI;function Yk(e,t,n,s){const a=fm(n),c=a==='"'?"Quote":"Apostrophe",l=n.createTracker(s);let d,f;if(Qk(e,n)){const y=n.stack;n.stack=[],d=n.enter("autolink");let g=l.move("<");return g+=l.move(n.containerPhrasing(e,{before:g,after:">",...l.current()})),g+=l.move(">"),d(),n.stack=y,g}d=n.enter("link"),f=n.enter("label");let p=l.move("[");return p+=l.move(n.containerPhrasing(e,{before:p,after:"](",...l.current()})),p+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),p+=l.move("<"),p+=l.move(n.safe(e.url,{before:p,after:">",...l.current()})),p+=l.move(">")):(f=n.enter("destinationRaw"),p+=l.move(n.safe(e.url,{before:p,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${c}`),p+=l.move(" "+a),p+=l.move(n.safe(e.title,{before:p,after:a,...l.current()})),p+=l.move(a),f()),p+=l.move(")"),d(),p}function HI(e,t,n){return Qk(e,n)?"<":"["}Xk.peek=qI;function Xk(e,t,n,s){const a=e.referenceType,c=n.enter("linkReference");let l=n.enter("label");const d=n.createTracker(s);let f=d.move("[");const p=n.containerPhrasing(e,{before:f,after:"]",...d.current()});f+=d.move(p+"]["),l();const y=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...d.current()});return l(),n.stack=y,c(),a==="full"||!p||p!==g?f+=d.move(g+"]"):a==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function qI(){return"["}function mm(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function $I(e){const t=mm(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function VI(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Jk(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function GI(e,t,n,s){const a=n.enter("list"),c=n.bulletCurrent;let l=e.ordered?VI(n):mm(n);const d=e.ordered?l==="."?")":".":$I(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&y&&(!y.children||!y.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),Jk(n)===l&&y){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=d),n.bulletCurrent=l;const p=n.containerFlow(e,s);return n.bulletLastUsed=l,n.bulletCurrent=c,a(),p}function KI(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function QI(e,t,n,s){const a=KI(n);let c=n.bulletCurrent||mm(n);t&&t.type==="list"&&t.ordered&&(c=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+c);let l=c.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const d=n.createTracker(s);d.move(c+" ".repeat(l-c.length)),d.shift(l);const f=n.enter("listItem"),p=n.indentLines(n.containerFlow(e,d.current()),y);return f(),p;function y(g,b,k){return b?(k?"":" ".repeat(l))+g:(k?c:c+" ".repeat(l-c.length))+g}}function YI(e,t,n,s){const a=n.enter("paragraph"),c=n.enter("phrasing"),l=n.containerPhrasing(e,s);return c(),a(),l}const XI=au(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function JI(e,t,n,s){return(e.children.some(function(l){return XI(l)})?n.containerPhrasing:n.containerFlow).call(n,e,s)}function ZI(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Zk.peek=eD;function Zk(e,t,n,s){const a=ZI(n),c=n.enter("strong"),l=n.createTracker(s),d=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:d,...l.current()}));const p=f.charCodeAt(0),y=Gc(s.before.charCodeAt(s.before.length-1),p,a);y.inside&&(f=Ma(p)+f.slice(1));const g=f.charCodeAt(f.length-1),b=Gc(s.after.charCodeAt(0),g,a);b.inside&&(f=f.slice(0,-1)+Ma(g));const k=l.move(a+a);return c(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},d+f+k}function eD(e,t,n){return n.options.strong||"*"}function tD(e,t,n,s){return n.safe(e.value,s)}function nD(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function rD(e,t,n){const s=(Jk(n)+(n.options.ruleSpaces?" ":"")).repeat(nD(n));return n.options.ruleSpaces?s.slice(0,-1):s}const eS={blockquote:NI,break:Ev,code:AI,definition:II,emphasis:qk,hardBreak:Ev,heading:OI,html:$k,image:Vk,imageReference:Gk,inlineCode:Kk,link:Yk,linkReference:Xk,list:GI,listItem:QI,paragraph:YI,root:JI,strong:Zk,text:tD,thematicBreak:rD};function iD(){return{enter:{table:sD,tableData:Rv,tableHeader:Rv,tableRow:aD},exit:{codeText:lD,table:oD,tableData:yh,tableHeader:yh,tableRow:yh}}}function sD(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function oD(e){this.exit(e),this.data.inTable=void 0}function aD(e){this.enter({type:"tableRow",children:[]},e)}function yh(e){this.exit(e)}function Rv(e){this.enter({type:"tableCell",children:[]},e)}function lD(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,cD));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function cD(e,t){return t==="|"?t:e}function uD(e){const t=e||{},n=t.tableCellPadding,s=t.tablePipeAlign,a=t.stringLength,c=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
96
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:f,tableRow:d}};function l(k,S,C,j){return p(y(k,C,j),k.align)}function d(k,S,C,j){const A=g(k,C,j),L=p([A]);return L.slice(0,L.indexOf(`
97
+ `))}function f(k,S,C,j){const A=C.enter("tableCell"),L=C.enter("phrasing"),M=C.containerPhrasing(k,{...j,before:c,after:c});return L(),A(),M}function p(k,S){return CI(k,{align:S,alignDelimiters:s,padding:n,stringLength:a})}function y(k,S,C){const j=k.children;let A=-1;const L=[],M=S.enter("table");for(;++A<j.length;)L[A]=g(j[A],S,C);return M(),L}function g(k,S,C){const j=k.children;let A=-1;const L=[],M=S.enter("tableRow");for(;++A<j.length;)L[A]=f(j[A],k,S,C);return M(),L}function b(k,S,C){let j=eS.inlineCode(k,S,C);return C.stack.includes("tableCell")&&(j=j.replace(/\|/g,"\\$&")),j}}function dD(){return{exit:{taskListCheckValueChecked:Mv,taskListCheckValueUnchecked:Mv,paragraph:fD}}}function hD(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:mD}}}function Mv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function fD(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const s=n.children[0];if(s&&s.type==="text"){const a=t.children;let c=-1,l;for(;++c<a.length;){const d=a[c];if(d.type==="paragraph"){l=d;break}}l===n&&(s.value=s.value.slice(1),s.value.length===0?n.children.shift():n.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,n.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function mD(e,t,n,s){const a=e.children[0],c=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",d=n.createTracker(s);c&&d.move(l);let f=eS.listItem(e,t,n,{...s,...d.current()});return c&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),f;function p(y){return y+l}}function pD(){return[GL(),mI(),vI(),iD(),dD()]}function gD(e){return{extensions:[KL(),pI(e),wI(),uD(e),hD()]}}const yD={tokenize:SD,partial:!0},tS={tokenize:CD,partial:!0},nS={tokenize:jD,partial:!0},rS={tokenize:ND,partial:!0},vD={tokenize:PD,partial:!0},iS={name:"wwwAutolink",tokenize:xD,previous:oS},sS={name:"protocolAutolink",tokenize:kD,previous:aS},ki={name:"emailAutolink",tokenize:bD,previous:lS},li={};function wD(){return{text:li}}let ds=48;for(;ds<123;)li[ds]=ki,ds++,ds===58?ds=65:ds===91&&(ds=97);li[43]=ki;li[45]=ki;li[46]=ki;li[95]=ki;li[72]=[ki,sS];li[104]=[ki,sS];li[87]=[ki,iS];li[119]=[ki,iS];function bD(e,t,n){const s=this;let a,c;return l;function l(g){return!wf(g)||!lS.call(s,s.previous)||pm(s.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(g))}function d(g){return wf(g)?(e.consume(g),d):g===64?(e.consume(g),f):n(g)}function f(g){return g===46?e.check(vD,y,p)(g):g===45||g===95||Vn(g)?(c=!0,e.consume(g),f):y(g)}function p(g){return e.consume(g),a=!0,f}function y(g){return c&&a&&Zn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function xD(e,t,n){const s=this;return a;function a(l){return l!==87&&l!==119||!oS.call(s,s.previous)||pm(s.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(yD,e.attempt(tS,e.attempt(nS,c),n),n)(l))}function c(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function kD(e,t,n){const s=this;let a="",c=!1;return l;function l(g){return(g===72||g===104)&&aS.call(s,s.previous)&&!pm(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(g),e.consume(g),d):n(g)}function d(g){if(Zn(g)&&a.length<5)return a+=String.fromCodePoint(g),e.consume(g),d;if(g===58){const b=a.toLowerCase();if(b==="http"||b==="https")return e.consume(g),f}return n(g)}function f(g){return g===47?(e.consume(g),c?p:(c=!0,f)):n(g)}function p(g){return g===null||qc(g)||tn(g)||ks(g)||iu(g)?n(g):e.attempt(tS,e.attempt(nS,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function SD(e,t,n){let s=0;return a;function a(l){return(l===87||l===119)&&s<3?(s++,e.consume(l),a):l===46&&s===3?(e.consume(l),c):n(l)}function c(l){return l===null?n(l):t(l)}}function CD(e,t,n){let s,a,c;return l;function l(p){return p===46||p===95?e.check(rS,f,d)(p):p===null||tn(p)||ks(p)||p!==45&&iu(p)?f(p):(c=!0,e.consume(p),l)}function d(p){return p===95?s=!0:(a=s,s=void 0),e.consume(p),l}function f(p){return a||s||!c?n(p):t(p)}}function jD(e,t){let n=0,s=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&s<n?c(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(rS,t,c)(l):l===null||tn(l)||ks(l)?t(l):(e.consume(l),a)}function c(l){return l===41&&s++,e.consume(l),a}}function ND(e,t,n){return s;function s(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),s):d===38?(e.consume(d),c):d===93?(e.consume(d),a):d===60||d===null||tn(d)||ks(d)?t(d):n(d)}function a(d){return d===null||d===40||d===91||tn(d)||ks(d)?t(d):s(d)}function c(d){return Zn(d)?l(d):n(d)}function l(d){return d===59?(e.consume(d),s):Zn(d)?(e.consume(d),l):n(d)}}function PD(e,t,n){return s;function s(c){return e.consume(c),a}function a(c){return Vn(c)?n(c):t(c)}}function oS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||tn(e)}function aS(e){return!Zn(e)}function lS(e){return!(e===47||wf(e))}function wf(e){return e===43||e===45||e===46||e===95||Vn(e)}function pm(e){let t=e.length,n=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){n=!0;break}if(s._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const TD={tokenize:_D,partial:!0};function ED(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:LD,continuation:{tokenize:ID},exit:DD}},text:{91:{name:"gfmFootnoteCall",tokenize:AD},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:RD,resolveTo:MD}}}}function RD(e,t,n){const s=this;let a=s.events.length;const c=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let l;for(;a--;){const f=s.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return d;function d(f){if(!l||!l._balanced)return n(f);const p=Qr(s.sliceSerialize({start:l.end,end:s.now()}));return p.codePointAt(0)!==94||!c.includes(p.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function MD(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},d=[e[n+1],e[n+2],["enter",s,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",c,t],["enter",l,t],["exit",l,t],["exit",c,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(n,e.length-n+1,...d),e}function AD(e,t,n){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c=0,l;return d;function d(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),f}function f(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(g){if(c>999||g===93&&!l||g===null||g===91||tn(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return a.includes(Qr(s.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return tn(g)||(l=!0),c++,e.consume(g),g===92?y:p}function y(g){return g===91||g===92||g===93?(e.consume(g),c++,p):p(g)}}function LD(e,t,n){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c,l=0,d;return f;function f(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):n(S)}function y(S){if(l>999||S===93&&!d||S===null||S===91||tn(S))return n(S);if(S===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return c=Qr(s.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return tn(S)||(d=!0),l++,e.consume(S),S===92?g:y}function g(S){return S===91||S===92||S===93?(e.consume(S),l++,y):y(S)}function b(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),a.includes(c)||a.push(c),qt(e,k,"gfmFootnoteDefinitionWhitespace")):n(S)}function k(S){return t(S)}}function ID(e,t,n){return e.check($a,t,e.attempt(TD,t,n))}function DD(e){e.exit("gfmFootnoteDefinition")}function _D(e,t,n){const s=this;return qt(e,a,"gfmFootnoteDefinitionIndent",5);function a(c){const l=s.events[s.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(c):n(c)}}function FD(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:c,resolveAll:a};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function a(l,d){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let p=f;for(;p--;)if(l[p][0]==="exit"&&l[p][1].type==="strikethroughSequenceTemporary"&&l[p][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[p][1].end.offset-l[p][1].start.offset){l[f][1].type="strikethroughSequence",l[p][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},l[p][1].start),end:Object.assign({},l[f][1].end)},g={type:"strikethroughText",start:Object.assign({},l[p][1].end),end:Object.assign({},l[f][1].start)},b=[["enter",y,d],["enter",l[p][1],d],["exit",l[p][1],d],["enter",g,d]],k=d.parser.constructs.insideSpan.null;k&&Nr(b,b.length,0,su(k,l.slice(p+1,f),d)),Nr(b,b.length,0,[["exit",g,d],["enter",l[f][1],d],["exit",l[f][1],d],["exit",y,d]]),Nr(l,p-1,f-p+3,b),f=p+b.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function c(l,d,f){const p=this.previous,y=this.events;let g=0;return b;function b(S){return p===126&&y[y.length-1][1].type!=="characterEscape"?f(S):(l.enter("strikethroughSequenceTemporary"),k(S))}function k(S){const C=lo(p);if(S===126)return g>1?f(S):(l.consume(S),g++,k);if(g<2&&!n)return f(S);const j=l.exit("strikethroughSequenceTemporary"),A=lo(S);return j._open=!A||A===2&&!!C,j._close=!C||C===2&&!!A,d(S)}}}class OD{constructor(){this.map=[]}add(t,n,s){BD(this,t,n,s)}consume(t){if(this.map.sort(function(c,l){return c[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let a=s.pop();for(;a;){for(const c of a)t.push(c);a=s.pop()}this.map.length=0}}function BD(e,t,n,s){let a=0;if(!(n===0&&s.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...s);return}a+=1}e.map.push([t,n,s])}}function UD(e,t){let n=!1;const s=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const c=s.length-1;s[c]=s[c]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return s}function WD(){return{flow:{null:{name:"table",tokenize:zD,resolveAll:HD}}}}function zD(e,t,n){const s=this;let a=0,c=0,l;return d;function d(P){let K=s.events.length-1;for(;K>-1;){const ee=s.events[K][1].type;if(ee==="lineEnding"||ee==="linePrefix")K--;else break}const X=K>-1?s.events[K][1].type:null,$=X==="tableHead"||X==="tableRow"?_:f;return $===_&&s.parser.lazy[s.now().line]?n(P):$(P)}function f(P){return e.enter("tableHead"),e.enter("tableRow"),p(P)}function p(P){return P===124||(l=!0,c+=1),y(P)}function y(P){return P===null?n(P):yt(P)?c>1?(c=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),k):n(P):Ft(P)?qt(e,y,"whitespace")(P):(c+=1,l&&(l=!1,a+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),l=!0,y):(e.enter("data"),g(P)))}function g(P){return P===null||P===124||tn(P)?(e.exit("data"),y(P)):(e.consume(P),P===92?b:g)}function b(P){return P===92||P===124?(e.consume(P),g):g(P)}function k(P){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(P):(e.enter("tableDelimiterRow"),l=!1,Ft(P)?qt(e,S,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):S(P))}function S(P){return P===45||P===58?j(P):P===124?(l=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),C):q(P)}function C(P){return Ft(P)?qt(e,j,"whitespace")(P):j(P)}function j(P){return P===58?(c+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),A):P===45?(c+=1,A(P)):P===null||yt(P)?O(P):q(P)}function A(P){return P===45?(e.enter("tableDelimiterFiller"),L(P)):q(P)}function L(P){return P===45?(e.consume(P),L):P===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),M):(e.exit("tableDelimiterFiller"),M(P))}function M(P){return Ft(P)?qt(e,O,"whitespace")(P):O(P)}function O(P){return P===124?S(P):P===null||yt(P)?!l||a!==c?q(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):q(P)}function q(P){return n(P)}function _(P){return e.enter("tableRow"),I(P)}function I(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),I):P===null||yt(P)?(e.exit("tableRow"),t(P)):Ft(P)?qt(e,I,"whitespace")(P):(e.enter("data"),F(P))}function F(P){return P===null||P===124||tn(P)?(e.exit("data"),I(P)):(e.consume(P),P===92?D:F)}function D(P){return P===92||P===124?(e.consume(P),F):F(P)}}function HD(e,t){let n=-1,s=!0,a=0,c=[0,0,0,0],l=[0,0,0,0],d=!1,f=0,p,y,g;const b=new OD;for(;++n<e.length;){const k=e[n],S=k[1];k[0]==="enter"?S.type==="tableHead"?(d=!1,f!==0&&(Av(b,t,f,p,y),y=void 0,f=0),p={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},b.add(n,0,[["enter",p,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(s=!0,g=void 0,c=[0,0,0,0],l=[0,n+1,0,0],d&&(d=!1,y={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},b.add(n,0,[["enter",y,t]])),a=S.type==="tableDelimiterRow"?2:y?3:1):a&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(s=!1,l[2]===0&&(c[1]!==0&&(l[0]=l[1],g=rc(b,t,c,a,void 0,g),c=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(s?s=!1:(c[1]!==0&&(l[0]=l[1],g=rc(b,t,c,a,void 0,g)),c=l,l=[c[1],n,0,0])):S.type==="tableHead"?(d=!0,f=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(f=n,c[1]!==0?(l[0]=l[1],g=rc(b,t,c,a,n,g)):l[1]!==0&&(g=rc(b,t,l,a,n,g)),a=0):a&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Av(b,t,f,p,y),b.consume(t.events),n=-1;++n<t.events.length;){const k=t.events[n];k[0]==="enter"&&k[1].type==="table"&&(k[1]._align=UD(t.events,n))}return e}function rc(e,t,n,s,a,c){const l=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(c.end=Object.assign({},no(t.events,n[0])),e.add(n[0],0,[["exit",c,t]]));const f=no(t.events,n[1]);if(c={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",c,t]]),n[2]!==0){const p=no(t.events,n[2]),y=no(t.events,n[3]),g={type:d,start:Object.assign({},p),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),s!==2){const b=t.events[n[2]],k=t.events[n[3]];if(b[1].end=Object.assign({},k[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,C=n[3]-n[2]-1;e.add(S,C,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return a!==void 0&&(c.end=Object.assign({},no(t.events,a)),e.add(a,0,[["exit",c,t]]),c=void 0),c}function Av(e,t,n,s,a){const c=[],l=no(t.events,n);a&&(a.end=Object.assign({},l),c.push(["exit",a,t])),s.end=Object.assign({},l),c.push(["exit",s,t]),e.add(n+1,0,c)}function no(e,t){const n=e[t],s=n[0]==="enter"?"start":"end";return n[1][s]}const qD={name:"tasklistCheck",tokenize:VD};function $D(){return{text:{91:qD}}}function VD(e,t,n){const s=this;return a;function a(f){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),c)}function c(f){return tn(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(f)}function d(f){return yt(f)?t(f):Ft(f)?e.check({tokenize:GD},t,n)(f):n(f)}}function GD(e,t,n){return qt(e,s,"whitespace");function s(a){return a===null?n(a):t(a)}}function KD(e){return wk([wD(),ED(),FD(e),WD(),$D()])}const QD={};function gm(e){const t=this,n=e||QD,s=t.data(),a=s.micromarkExtensions||(s.micromarkExtensions=[]),c=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),l=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);a.push(KD(n)),c.push(pD()),l.push(gD(n))}const Lv="*** Begin Patch",Iv="*** End Patch";function YD(e){const t=e.replace(/\r\n/g,`
98
+ `);if(!t.includes(Lv)||!t.includes(Iv))return null;const n=t.split(`
99
+ `),s=[];let a=null,c=null;for(const l of n){if(l===Lv||l===Iv)continue;if(l.startsWith("*** Update File: ")){a=vh("update",l.slice(17)),s.push(a),c=null;continue}if(l.startsWith("*** Add File: ")){a=vh("add",l.slice(14)),s.push(a),c={oldLineNumber:0,newLineNumber:1};continue}if(l.startsWith("*** Delete File: ")){a=vh("delete",l.slice(17)),s.push(a),c=null;continue}if(!a)continue;if(l.startsWith("*** Move to: ")){a.nextPath=l.slice(13),a.lines.push({kind:"meta",text:l,oldLineNumber:null,newLineNumber:null});continue}if(l.startsWith("@@")){c=JD(l)??{oldLineNumber:0,newLineNumber:0},a.lines.push({kind:"hunk",text:l,oldLineNumber:null,newLineNumber:null});continue}if(l==="*** End of File"){a.lines.push({kind:"meta",text:l,oldLineNumber:null,newLineNumber:null});continue}if(a.action==="add"&&l.startsWith("+")){a.additions+=1,a.lines.push({kind:"add",text:l,oldLineNumber:null,newLineNumber:(c==null?void 0:c.newLineNumber)??a.additions}),c&&(c.newLineNumber+=1);continue}if(!c){a.lines.push({kind:"meta",text:l,oldLineNumber:null,newLineNumber:null});continue}if(l.startsWith("+")){a.additions+=1,a.lines.push({kind:"add",text:l,oldLineNumber:null,newLineNumber:c.newLineNumber}),c.newLineNumber+=1;continue}if(l.startsWith("-")){a.deletions+=1,a.lines.push({kind:"remove",text:l,oldLineNumber:c.oldLineNumber,newLineNumber:null}),c.oldLineNumber+=1;continue}if(l.startsWith(" ")||l.length===0){a.lines.push({kind:"context",text:l,oldLineNumber:c.oldLineNumber,newLineNumber:c.newLineNumber}),c.oldLineNumber+=1,c.newLineNumber+=1;continue}a.lines.push({kind:"meta",text:l,oldLineNumber:null,newLineNumber:null})}return s.length===0?null:{files:s,totalAdditions:s.reduce((l,d)=>l+d.additions,0),totalDeletions:s.reduce((l,d)=>l+d.deletions,0)}}function XD(e){return e.replace(/\\/g,"/").split("/").at(-1)||e}function vh(e,t){return{path:t,nextPath:null,action:e,additions:0,deletions:0,lines:[]}}function JD(e){const t=e.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);return t?{oldLineNumber:Number(t[1]),newLineNumber:Number(t[2])}:null}const ZD=/data:image\/([a-zA-Z0-9.+-]+);base64,([A-Za-z0-9+/=]+)/g,e2=/!\[([^\]]*)\]\((data:image\/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/=]+)\)/g,t2=/<img\b[^>]*src=["'](data:image\/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/=]+)["'][^>]*>/gi,n2=/<image\b([^>]*)>([\s\S]*?)<\/image>/gi;function Aa(e){const t=r2(e);return t||cS(e)}function r2(e){const t=e.trim();if(!i2(t))return null;try{const n=JSON.parse(t),s=s2(n);return s.text||s.inlineImages.length>0?s:null}catch{return null}}function i2(e){return e.length<2?!1:e.startsWith("[")&&e.endsWith("]")||e.startsWith("{")&&e.endsWith("}")}function s2(e){const t=[],n=[];return Sc(e,t,n),{text:dS(t.join(`
100
+
101
+ `)),inlineImages:uS(n)}}function Sc(e,t,n){if(typeof e=="string"){const l=cS(e);l.text&&t.push(l.text),n.push(...l.inlineImages);return}if(e==null)return;if(Array.isArray(e)){e.forEach(l=>Sc(l,t,n));return}if(typeof e!="object")return;const s=e,a=new Set,c=o2(s);c&&(n.push(c),["type","source","media_type","mime_type","mimeType","data","image_url","imageUrl","url","src","alt","name"].forEach(l=>{l in s&&a.add(l)}));for(const l of["image_url","url","src","source"]){const d=s[l];typeof d!="string"||!hS(d)||(n.push(bs(d,Ir(s.alt))),a.add(l))}for(const l of["text","message","content","output","result","summary","caption"])l in s&&(a.add(l),Sc(s[l],t,n));a.size>0||Object.values(s).forEach(l=>{Sc(l,t,n)})}function cS(e){const t=[];let n=e;return n=n.replace(n2,(s,a,c)=>{const l=d2(a,"name"),d=u2(c);return d!=null&&d.url&&t.push(bs(d.url,d.altText||l)),""}),n=n.replace(e2,(s,a,c)=>(t.push(bs(c,a)),"")),n=n.replace(t2,(s,a)=>(t.push(bs(a,null)),"")),n=n.replace(ZD,(s,a,c)=>(t.push(bs(s,null,`image/${a}`,Kc(c))),"")),{text:dS(n),inlineImages:uS(t)}}function bs(e,t,n,s){const a=n??a2(e)??"image/png";return{url:e,mimeType:a,altText:La(t),estimatedBytes:s??l2(e)}}function o2(e){const t=c2(e.source);if(t){const a=Ir(t.type).trim().toLowerCase(),c=_v(t.media_type??t.mime_type??t.mimeType),l=Dv(t.data);if(a==="base64"&&c&&l)return bs(`data:${c};base64,${l}`,La(Ir(t.alt)||Ir(t.name)||Ir(e.alt)||Ir(e.name)),c,Kc(l))}const n=_v(e.media_type??e.mime_type??e.mimeType),s=Dv(e.data);return n&&s?bs(`data:${n};base64,${s}`,La(Ir(e.alt)||Ir(e.name)),n,Kc(s)):null}function uS(e){const t=new Map;return e.forEach(n=>{t.has(n.url)||t.set(n.url,n)}),[...t.values()]}function dS(e){return e.replace(/\r\n/g,`
102
+ `).replace(/[ \t]{2,}/g," ").replace(/[ \t]+\n/g,`
103
+ `).replace(/\n{3,}/g,`
104
+
105
+ `).trim()}function hS(e){return/^data:image\/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/=]+$/.test(e.trim())}function a2(e){var n;const t=e.match(/^data:(image\/[a-zA-Z0-9.+-]+);base64,/i);return((n=t==null?void 0:t[1])==null?void 0:n.toLowerCase())??null}function l2(e){const t=e.match(/^data:image\/[a-zA-Z0-9.+-]+;base64,([A-Za-z0-9+/=]+)$/i);return t?Kc(t[1]):null}function Kc(e){const t=e.trim(),n=t.endsWith("==")?2:t.endsWith("=")?1:0;return Math.max(0,Math.floor(t.length*3/4)-n)}function La(e){const t=Ir(e).trim();return t.length>0?t:null}function Dv(e){if(typeof e!="string")return null;const t=e.replace(/\s+/g,"").trim();return/^[A-Za-z0-9+/=]+$/.test(t)?t:null}function _v(e){if(typeof e!="string")return null;const t=e.trim().toLowerCase();return t.startsWith("image/")?t:null}function Ir(e){return typeof e=="string"?e:""}function c2(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function u2(e){const t=e.trim();if(t.length===0)return null;try{const n=JSON.parse(t),s=Ir(n.image_url??n.imageUrl).trim(),a=La(Ir(n.name)||Ir(n.alt));return{url:hS(s)?s:null,altText:a}}catch{const n=t.match(/(data:image\/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/=]+)/i);return n?{url:n[1],altText:null}:null}}function d2(e,t){const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=e.match(new RegExp(`${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|\\[([^\\]]*)\\]|([^\\s>]+))`,"i"));return La((s==null?void 0:s[1])??(s==null?void 0:s[2])??(s==null?void 0:s[3])??(s==null?void 0:s[4])??"")}function Gr(){return"/workspaces"}function oi(e){return`/workspaces/${encodeURIComponent(e)}`}function Ga(e){return`${oi(e)}/sessions`}function er(e,t){return`${Ga(e)}/${encodeURIComponent(t)}`}function po(e,t){const n=`${oi(e)}/tools`;if(!t)return n;const s=new URLSearchParams({tab:t});return`${n}?${s.toString()}`}function fS(e){return`${oi(e)}/tools/files`}function mS(e){return`${oi(e)}/tools/git`}function cu(e){return`${oi(e)}/tools/processes`}function io(e){return`${oi(e)}/terminals`}function ym(e){return e.flatMap(t=>t.sessions.map(n=>({session:n,workspace:t.workspace}))).sort((t,n)=>(n.session.lastMessageAt??n.session.updatedAt).localeCompare(t.session.lastMessageAt??t.session.updatedAt))}function h2(e){const t=new Map(e.map(a=>[a.session.sessionId,a])),n=new Map,s=[];for(const a of e){const c=m2(a,t);if(c===a.session.sessionId){s.push(a);continue}const l=n.get(c)??[];n.set(c,[...l,a])}return[...s].sort(Fv).map(a=>({entry:a,children:[...n.get(a.session.sessionId)??[]].sort(Fv)}))}function pS(e,t){const n=f2(),s=new URLSearchParams({provider:t});return`${er(e,n)}?${s.toString()}`}function f2(){const e=globalThis.crypto;return e&&typeof e.randomUUID=="function"?`draft-${e.randomUUID()}`:`draft-${Date.now()}-${Math.random().toString(16).slice(2)}`}function Fv(e,t){return(t.session.lastMessageAt??t.session.updatedAt).localeCompare(e.session.lastMessageAt??e.session.updatedAt)}function m2(e,t){var a;let n=e;const s=new Set([e.session.sessionId]);for(;;){const c=((a=n.session.parentSessionId)==null?void 0:a.trim())||null;if(!c)return n.session.sessionId;const l=t.get(c);if(!l)return n.session.sessionId;if(s.has(l.session.sessionId))return e.session.sessionId;s.add(l.session.sessionId),n=l}}const p2="mobile.tools.last-primary-tool";function gS(){if(typeof window>"u")return"files";try{return window.localStorage.getItem(p2)==="git"?"git":"files"}catch{return"files"}}function vm(e){var s;const t=[{pattern:"/workspaces/:workspaceId/tools/processes",routeKind:"processes"},{pattern:"/workspaces/:workspaceId/tools/files",routeKind:"files"},{pattern:"/workspaces/:workspaceId/tools/git",routeKind:"git"},{pattern:"/workspaces/:workspaceId/tools",routeKind:"home"}];for(const a of t){const c=En(a.pattern,e),l=((s=c==null?void 0:c.params.workspaceId)==null?void 0:s.trim())??null;if(l)return{workspaceId:l,routeKind:a.routeKind,legacy:!1}}const n=[{pattern:"/tools/processes",routeKind:"processes"},{pattern:"/tools/files",routeKind:"files"},{pattern:"/tools/git",routeKind:"git"},{pattern:"/tools",routeKind:"home"}];for(const a of n)if(En(a.pattern,e))return{workspaceId:null,routeKind:a.routeKind,legacy:!0};return null}function g2(e,t){const n=vm(e);if((n==null?void 0:n.routeKind)==="git")return"git";if((n==null?void 0:n.routeKind)==="files")return"files";const s=new URLSearchParams(t).get("tab");return s==="git"?"git":s==="files"?"files":gS()}function wm(e,t){const n=vm(e);return n!=null&&n.workspaceId?po(n.workspaceId,g2(e,t)):n!=null&&n.legacy?gS()==="git"?"/tools?tab=git":"/tools?tab=files":null}function bm({activeEntry:e,presentation:t,pathname:n,search:s,moreButtonLabel:a}){if(t==="conversation-focus"||e!=="tools")return null;const c=vm(n);return c?c.routeKind==="processes"?{title:h("shell.terminalManagerEntry"),showBackButton:!0,showMoreButton:!1,moreButtonLabel:a}:(c.routeKind==="home"||c.routeKind==="files"||c.routeKind==="git",null):null}const yS=v.createContext({composerPortalTarget:null});function xm({composerPortalTarget:e,children:t}){return i.jsx(yS.Provider,{value:{composerPortalTarget:e},children:t})}function vS(){return v.useContext(yS)}function km(e,t,n){const[s,a]=v.useState(void 0);return v.useEffect(()=>{const c=e.current,l=t.current;if(!n||!c||!l){a(void 0),c&&c.style.removeProperty("--mobile-conversation-tabbar-height");return}const d=c,f=l;function p(){if(!e.current||!f.isConnected)return;const g=`${Math.round(f.getBoundingClientRect().height)}px`;d.style.setProperty("--mobile-conversation-tabbar-height",g),a(g)}p();const y=typeof ResizeObserver<"u"?new ResizeObserver(p):null;return y==null||y.observe(f),window.addEventListener("resize",p),()=>{y==null||y.disconnect(),window.removeEventListener("resize",p),d.style.removeProperty("--mobile-conversation-tabbar-height")}},[n,e,t]),s}const y2=3e3,ic=10,Ov=84,Bv=.36;function Sm({enabled:e,rootRef:t,suspended:n=!1,resetKey:s}){const a=v.useRef(null),c=v.useRef(null),l=v.useRef("visible"),d=v.useRef(1),[f,p]=v.useState("visible"),[y,g]=v.useState(1);v.useEffect(()=>{l.current=f},[f]),v.useEffect(()=>{d.current=y},[y]);function b(){hs(a),a.current=window.setTimeout(()=>{k()},y2)}function k(){p("hidden"),g(0)}function S(){p("visible"),g(1),b()}v.useEffect(()=>{if(hs(a),!e){hs(a),p("visible"),g(1);return}if(n){p("hidden"),g(0);return}return S(),()=>{hs(a)}},[e,s,n]),v.useEffect(()=>()=>{hs(a)},[]),v.useEffect(()=>{if(!e||n){c.current=null;return}const j=t.current;if(!j)return;function A(F){if(F.touches.length!==1){c.current=null;return}const D=F.touches[0],P=zv(F.target);if(!D||!P){c.current=null;return}c.current={surface:P,startX:D.clientX,startY:D.clientY,pointerType:"touch",initialState:l.current==="visible"?"visible":"hidden",touchId:D.identifier,dragging:!1,latestProgress:d.current},l.current==="visible"&&hs(a)}function L(F){const D=c.current;if(!D||D.pointerType!=="touch")return;const P=wh(F.touches,D.touchId);if(!P)return;const K=P.clientX-D.startX,X=P.clientY-D.startY;if(D.surface==="conversation"){if(Math.abs(X)<=ic||Math.abs(X)<=Math.abs(K))return;c.current=null,D.initialState==="visible"&&k();return}const $=D.initialState==="hidden"?-X:X;$<=ic&&!D.dragging||(qv(F),D.dragging=!0,D.latestProgress=Uv(D.initialState,$),p("dragging"),g(D.latestProgress))}function M(F){const D=c.current;if(!(!D||D.pointerType!=="touch"||!wh(F.changedTouches,D.touchId))){if(c.current=null,!D.dragging){D.initialState==="visible"&&b();return}Wv(D.initialState,D.latestProgress,S,p,g)}}function O(F){const D=c.current;if(!(!D||D.pointerType!=="touch"||!wh(F.changedTouches,D.touchId))){if(c.current=null,!D.dragging){D.initialState==="visible"&&b();return}if(D.initialState==="visible"){S();return}p("hidden"),g(0)}}function q(F){if(F.pointerType!=="touch")return;const D=zv(F.target);if(!D){c.current=null;return}if(c.current={surface:D,startX:F.clientX,startY:F.clientY,pointerType:"pointer",initialState:l.current==="visible"?"visible":"hidden",pointerId:F.pointerId,captureTarget:F.target instanceof Element?F.target:null,dragging:!1,latestProgress:d.current},F.target instanceof Element)try{F.target.setPointerCapture(F.pointerId)}catch{}l.current==="visible"&&hs(a)}function _(F){const D=c.current;if(!D||D.pointerType!=="pointer")return;const P=F.clientX-D.startX,K=F.clientY-D.startY;if(D.surface==="conversation"){if(Math.abs(K)<=ic||Math.abs(K)<=Math.abs(P))return;c.current=null,D.initialState==="visible"&&k();return}const X=D.initialState==="hidden"?-K:K;X<=ic&&!D.dragging||(qv(F),D.dragging=!0,D.latestProgress=Uv(D.initialState,X),p("dragging"),g(D.latestProgress))}function I(F){const D=c.current;if(!(!D||D.pointerType!=="pointer"||D.pointerId!==F.pointerId)){if(c.current=null,v2(D),!D.dragging){D.initialState==="visible"&&b();return}Wv(D.initialState,D.latestProgress,S,p,g)}}return j.addEventListener("touchstart",A,{passive:!0}),j.addEventListener("pointerdown",q,{passive:!0}),window.addEventListener("touchmove",L,{passive:!1}),window.addEventListener("touchend",M),window.addEventListener("touchcancel",O),window.addEventListener("pointermove",_,{passive:!1}),window.addEventListener("pointerup",I),window.addEventListener("pointercancel",I),()=>{j.removeEventListener("touchstart",A),j.removeEventListener("pointerdown",q),window.removeEventListener("touchmove",L),window.removeEventListener("touchend",M),window.removeEventListener("touchcancel",O),window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",I),window.removeEventListener("pointercancel",I)}},[e,t,n]);const C=e&&!n?y:e?0:1;return{state:n&&e?"hidden":f,progress:C,isOpen:C>.01}}function hs(e){e.current!==null&&(window.clearTimeout(e.current),e.current=null)}function Uv(e,t){return Hv(e==="hidden"?t/Ov:1-t/Ov,0,1)}function Wv(e,t,n,s,a){if(e==="hidden"){if(t>=Bv){n();return}s("hidden"),a(0);return}if(t<=1-Bv){s("hidden"),a(0);return}n()}function v2(e){if(!(e.pointerType!=="pointer"||typeof e.pointerId!="number"||!(e.captureTarget instanceof Element)))try{e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId)}catch{}}function wh(e,t){if(typeof t!="number")return e[0]??null;for(let n=0;n<e.length;n+=1){const s=e[n];if((s==null?void 0:s.identifier)===t)return s}return null}function zv(e){return e instanceof Element?e.closest(".composer-panel")?"composer":e.closest(".message-list, .message-timeline, .mobile-conversation-main, .conversation-page-shell")?"conversation":null:null}function Hv(e,t,n){return Math.min(Math.max(e,t),n)}function qv(e){e.cancelable&&e.preventDefault()}function Ka({viewportClass:e,activeEntry:t,hasNavigationPanel:n,hasAuxiliaryPanel:s}){return e==="compact"?"compact":e==="expanded"&&n&&s?"expanded":t==="tools"&&s?"medium-auxiliary":n?"medium-navigation":s?"medium-auxiliary":"compact"}function wS(e){return e==="medium-navigation"||e==="expanded"}function bS(e){return e==="medium-auxiliary"||e==="expanded"}function Cm({viewportClass:e,activeEntry:t,hasNavigationPanel:n,hasAuxiliaryPanel:s,children:a,navigationPanel:c,auxiliaryPanel:l}){const d=Ka({viewportClass:e,activeEntry:t,hasNavigationPanel:n,hasAuxiliaryPanel:s}),f=wS(d)&&c,p=bS(d)&&l;return i.jsxs("div",{className:"mobile-adaptive-pane-layout","data-pane-layout":d,children:[f?i.jsx("aside",{className:"workbench-nav surface-card mobile-adaptive-pane-panel mobile-adaptive-pane-panel-navigation",children:c}):null,i.jsx("div",{className:"mobile-adaptive-pane-main",children:a}),p?i.jsx("aside",{className:"workbench-auxiliary surface-card mobile-adaptive-pane-panel mobile-adaptive-pane-panel-auxiliary",children:l}):null]})}function w2({activeEntry:e,presentation:t="default",children:n,navigationPanel:s,auxiliaryPanel:a,onNavigateWorkspaces:c,onNavigateTerminals:l,onNavigateSessions:d,onNavigateTools:f,onNavigateToolFiles:p,onNavigateToolGit:y,onNavigateToolProcesses:g,onNavigateSettings:b}){const k=An(),S=_r(),C=Xr(),j=Wn(),A=v.useRef(null),L=v.useRef(null),[M,O]=v.useState(null),q=t==="conversation-focus",_=Sm({enabled:q,rootRef:A,resetKey:`${C.pathname}${C.search}`}),I=Ka({viewportClass:k.viewportClass,activeEntry:e,hasNavigationPanel:!!s,hasAuxiliaryPanel:!!a}),F=bm({activeEntry:e,presentation:t,pathname:C.pathname,search:C.search,moreButtonLabel:h("shell.androidMoreAction")}),D=[{key:"workspaces",label:h("shell.mobileWorkspacesEntry"),icon:i.jsx(k2,{}),onClick:c},{key:"sessions",label:h("shell.mobileSessionsEntry"),icon:i.jsx(S2,{}),onClick:d},{key:"terminals",label:h("shell.mobileTerminalsEntry"),icon:i.jsx(C2,{}),onClick:l},{key:"tools",label:h("shell.mobileToolsEntry"),icon:i.jsx(j2,{}),onClick:f},{key:"settings",label:h("shell.mobileSettingsEntry"),icon:i.jsx(N2,{}),onClick:b}],P=q?{"--mobile-conversation-tabbar-progress":_.progress.toFixed(4)}:void 0;km(A,L,q);function K(){const $=wm(C.pathname,C.search);if(!$){f();return}j($,{replace:!0})}const X=i.jsx("nav",{ref:L,className:"android-workbench-bottom-nav","aria-label":h("shell.title"),children:D.map($=>i.jsxs("button",{type:"button",className:"android-workbench-bottom-nav-item","data-active":$.key===e,"aria-current":$.key===e?"page":void 0,onClick:()=>{$.key!==e&&S.trigger("selection"),$.onClick()},children:[i.jsx("span",{className:"android-workbench-bottom-nav-icon","aria-hidden":"true",children:$.icon}),i.jsx("span",{className:"android-workbench-bottom-nav-label",children:$.label})]},$.key))});return i.jsx(xm,{composerPortalTarget:q?M:null,children:i.jsxs("div",{ref:A,className:"android-workbench-shell","data-active-entry":e,"data-mobile-presentation":t,"data-pane-layout":I,"data-tabbar-open":q?_.isOpen:!0,"data-conversation-tabbar-state":q?_.state:"default",style:P,children:[F?i.jsxs("header",{className:"android-workbench-topbar","data-header-kind":"tools",children:[i.jsxs("div",{className:"android-workbench-topbar-leading",children:[F.showBackButton?i.jsx("button",{type:"button",className:"android-workbench-icon-button","aria-label":h("common.back"),onClick:K,children:i.jsx(b2,{})}):null,i.jsx("div",{className:"android-workbench-topbar-copy",children:i.jsx("h1",{children:F.title})})]}),i.jsx("div",{className:"android-workbench-topbar-actions",children:F.showMoreButton?i.jsx("button",{type:"button",className:"android-workbench-icon-button","aria-label":F.moreButtonLabel,onClick:g,children:i.jsx(x2,{})}):null})]}):null,i.jsx("div",{className:"android-workbench-content",children:i.jsx(Cm,{viewportClass:k.viewportClass,activeEntry:e,hasNavigationPanel:!!s,hasAuxiliaryPanel:!!a,navigationPanel:s,auxiliaryPanel:a,children:n})}),q?i.jsxs("div",{className:"mobile-conversation-bottom-layer",children:[i.jsx("div",{ref:O,className:"mobile-conversation-bottom-layer-composer-slot"}),i.jsx("div",{className:"mobile-conversation-bottom-layer-tabbar-shell",children:X})]}):X]})})}function b2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("path",{d:"m15 18-6-6 6-6"}),i.jsx("path",{d:"M21 12H9"})]})}function x2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"12",cy:"5",r:"1.8"}),i.jsx("circle",{cx:"12",cy:"12",r:"1.8"}),i.jsx("circle",{cx:"12",cy:"19",r:"1.8"})]})}function k2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"}),i.jsx("path",{d:"M8 13h8"})]})}function S2(){return i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function C2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2.5"}),i.jsx("path",{d:"m7.5 9 3 3-3 3"}),i.jsx("path",{d:"M12.5 15H17"})]})}function j2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("path",{d:"M8 6V4.8A1.8 1.8 0 0 1 9.8 3h4.4A1.8 1.8 0 0 1 16 4.8V6"}),i.jsx("rect",{x:"3",y:"6",width:"18",height:"13",rx:"2"}),i.jsx("path",{d:"M3 12h18"}),i.jsx("path",{d:"M10 11.5h4"})]})}function N2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.6 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82L4.21 7.1a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 8.92 4a1.65 1.65 0 0 0 1-1.51V2.4a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9c0 .66.39 1.25 1 1.51h.09a2 2 0 0 1 0 4h-.09c-.61.26-1 .85-1 1.49z"})]})}const P2=120,ga={viewportHeight:null,keyboardInset:0,keyboardOpen:!1};function bf(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function T2(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable||e.closest("[contenteditable='true']"))return!0;if(e instanceof HTMLTextAreaElement)return!e.readOnly&&!e.disabled;if(e instanceof HTMLInputElement){if(e.readOnly||e.disabled)return!1;const t=(e.type||"text").toLowerCase();return!["button","checkbox","color","file","hidden","image","radio","range","reset","submit"].includes(t)}return!1}function E2(){var t;if(typeof window>"u")return 0;const e=[window.innerHeight,typeof document<"u"?(t=document.documentElement)==null?void 0:t.clientHeight:0].filter(bf);return e.length>0?Math.max(...e):0}function $v(){if(typeof window>"u")return ga;const e=window.visualViewport,t=E2(),n=(e==null?void 0:e.height)??t,s=bf(n)?Math.round(n):null,a=bf(e==null?void 0:e.offsetTop)?(e==null?void 0:e.offsetTop)??0:0,c=s===null?0:Math.max(0,Math.round(t-s-a));return{viewportHeight:s,keyboardInset:c,keyboardOpen:T2(typeof document<"u"?document.activeElement:null)&&c>=P2}}function bh(e,t){if(typeof document>"u")return;[document.documentElement,document.body].filter(s=>s instanceof HTMLElement).forEach(s=>{if(!e){delete s.dataset.mobileKeyboardOpen,delete s.dataset.mobileViewportBound,s.style.removeProperty("--mobile-shell-viewport-height"),s.style.removeProperty("--mobile-shell-keyboard-inset");return}s.dataset.mobileKeyboardOpen=String(t.keyboardOpen),s.dataset.mobileViewportBound="true",t.viewportHeight===null?s.style.removeProperty("--mobile-shell-viewport-height"):s.style.setProperty("--mobile-shell-viewport-height",`${t.viewportHeight}px`),s.style.setProperty("--mobile-shell-keyboard-inset",`${t.keyboardInset}px`)})}function R2(e){const[t,n]=v.useState(()=>e?$v():ga),s=v.useRef(null);return v.useEffect(()=>{if(!e){n(ga),bh(!1,ga);return}function a(){n($v())}function c(){s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{s.current=null,a()},0)}a();const l=window.visualViewport;return window.addEventListener("resize",a),window.addEventListener("orientationchange",a),l==null||l.addEventListener("resize",a),l==null||l.addEventListener("scroll",a),document.addEventListener("focusin",a),document.addEventListener("focusout",c),()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",a),l==null||l.removeEventListener("resize",a),l==null||l.removeEventListener("scroll",a),document.removeEventListener("focusin",a),document.removeEventListener("focusout",c),bh(!1,ga)}},[e]),v.useEffect(()=>{bh(e,t)},[e,t]),t}function M2({activeEntry:e,presentation:t="default",children:n,navigationPanel:s,auxiliaryPanel:a,onNavigateWorkspaces:c,onNavigateTerminals:l,onNavigateSessions:d,onNavigateTools:f,onNavigateToolFiles:p,onNavigateToolGit:y,onNavigateToolProcesses:g,onNavigateSettings:b}){const k=An(),S=_r(),C=Xr(),j=Wn(),A=v.useRef(null),L=v.useRef(null),[M,O]=v.useState(null),q=t==="conversation-focus",_=Sm({enabled:q,rootRef:A,resetKey:`${C.pathname}${C.search}`}),I=Ka({viewportClass:k.viewportClass,activeEntry:e,hasNavigationPanel:!!s,hasAuxiliaryPanel:!!a}),F=bm({activeEntry:e,presentation:t,pathname:C.pathname,search:C.search,moreButtonLabel:h("shell.iosMoreAction")}),D=[{key:"workspaces",label:h("shell.mobileWorkspacesEntry"),icon:i.jsx(I2,{}),onClick:c},{key:"sessions",label:h("shell.mobileSessionsEntry"),icon:i.jsx(D2,{}),onClick:d},{key:"terminals",label:h("shell.mobileTerminalsEntry"),icon:i.jsx(_2,{}),onClick:l},{key:"tools",label:h("shell.mobileToolsEntry"),icon:i.jsx(F2,{}),onClick:f},{key:"settings",label:h("shell.mobileSettingsEntry"),icon:i.jsx(O2,{}),onClick:b}],P=q?{"--mobile-conversation-tabbar-progress":_.progress.toFixed(4)}:void 0;km(A,L,q);function K(){const $=wm(C.pathname,C.search);if(!$){f();return}j($,{replace:!0})}const X=i.jsx("nav",{ref:L,className:"ios-workbench-tabbar","aria-label":h("shell.title"),children:D.map($=>i.jsxs("button",{type:"button",className:"ios-workbench-tabbar-item","data-active":$.key===e,"aria-current":$.key===e?"page":void 0,onClick:()=>{$.key!==e&&S.trigger("selection"),$.onClick()},children:[i.jsx("span",{className:"ios-workbench-tabbar-icon","aria-hidden":"true",children:$.icon}),i.jsx("span",{className:"ios-workbench-tabbar-label",children:$.label})]},$.key))});return i.jsx(xm,{composerPortalTarget:q?M:null,children:i.jsxs("div",{ref:A,className:"ios-workbench-shell","data-active-entry":e,"data-mobile-presentation":t,"data-pane-layout":I,"data-tabbar-open":q?_.isOpen:!0,"data-conversation-tabbar-state":q?_.state:"default",style:P,children:[F?i.jsxs("header",{className:"ios-workbench-nav","data-header-kind":"tools",children:[i.jsx("div",{className:"ios-workbench-nav-leading",children:F.showBackButton?i.jsxs("button",{type:"button",className:"ios-workbench-back-button","aria-label":h("common.back"),onClick:K,children:[i.jsx(A2,{}),i.jsx("span",{children:h("common.back")})]}):null}),i.jsx("div",{className:"ios-workbench-nav-copy",children:i.jsx("h1",{children:F.title})}),i.jsx("div",{className:"ios-workbench-nav-actions",children:F.showMoreButton?i.jsx("button",{type:"button",className:"ios-workbench-icon-button","aria-label":F.moreButtonLabel,onClick:g,children:i.jsx(L2,{})}):null})]}):null,i.jsx("div",{className:"ios-workbench-content",children:i.jsx(Cm,{viewportClass:k.viewportClass,activeEntry:e,hasNavigationPanel:!!s,hasAuxiliaryPanel:!!a,navigationPanel:s,auxiliaryPanel:a,children:n})}),q?i.jsxs("div",{className:"mobile-conversation-bottom-layer",children:[i.jsx("div",{ref:O,className:"mobile-conversation-bottom-layer-composer-slot"}),i.jsx("div",{className:"mobile-conversation-bottom-layer-tabbar-shell",children:X})]}):X]})})}function A2(){return i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.85",children:i.jsx("path",{d:"m15 18-6-6 6-6"})})}function L2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"12",cy:"5",r:"1.8"}),i.jsx("circle",{cx:"12",cy:"12",r:"1.8"}),i.jsx("circle",{cx:"12",cy:"19",r:"1.8"})]})}function I2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.85",children:[i.jsx("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"}),i.jsx("path",{d:"M8 13h8"})]})}function D2(){return i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.85",children:i.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function _2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.85",children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2.5"}),i.jsx("path",{d:"m7.5 9 3 3-3 3"}),i.jsx("path",{d:"M12.5 15H17"})]})}function F2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.85",children:[i.jsx("path",{d:"M8 6V4.8A1.8 1.8 0 0 1 9.8 3h4.4A1.8 1.8 0 0 1 16 4.8V6"}),i.jsx("rect",{x:"3",y:"6",width:"18",height:"13",rx:"2"}),i.jsx("path",{d:"M3 12h18"}),i.jsx("path",{d:"M10 11.5h4"})]})}function O2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.6 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82L4.21 7.1a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 8.92 4a1.65 1.65 0 0 0 1-1.51V2.4a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9c0 .66.39 1.25 1 1.51h.09a2 2 0 0 1 0 4h-.09c-.61.26-1 .85-1 1.49z"})]})}function B2(e){const t=An();return t.platform==="ios"?i.jsx(M2,{...e}):t.platform==="android"?i.jsx(w2,{...e}):i.jsx(U2,{...e})}function U2({activeEntry:e,presentation:t="default",children:n,navigationPanel:s,auxiliaryPanel:a,onNavigateWorkspaces:c,onNavigateTerminals:l,onNavigateSessions:d,onNavigateTools:f,onNavigateToolFiles:p,onNavigateToolGit:y,onNavigateToolProcesses:g,onNavigateSettings:b}){const k=An(),S=_r(),C=Xr(),j=Wn(),A=v.useRef(null),L=v.useRef(null),[M,O]=v.useState(null),q=R2(k.platform==="web"),_=k.platform==="web"&&q.keyboardOpen,I=t==="conversation-focus",F=Sm({enabled:I,rootRef:A,suspended:_,resetKey:`${C.pathname}${C.search}`}),D=Ka({viewportClass:k.viewportClass,activeEntry:e,hasNavigationPanel:!!s,hasAuxiliaryPanel:!!a}),P=bm({activeEntry:e,presentation:t,pathname:C.pathname,search:C.search,moreButtonLabel:h("shell.iosMoreAction")}),K=[{key:"workspaces",label:h("shell.mobileWorkspacesEntry"),icon:i.jsx(H2,{}),onClick:c},{key:"sessions",label:h("shell.mobileSessionsEntry"),icon:i.jsx(q2,{}),onClick:d},{key:"terminals",label:h("shell.mobileTerminalsEntry"),icon:i.jsx($2,{}),onClick:l},{key:"tools",label:h("shell.mobileToolsEntry"),icon:i.jsx(V2,{}),onClick:f},{key:"settings",label:h("shell.mobileSettingsEntry"),icon:i.jsx(G2,{}),onClick:b}],X=I?{"--mobile-conversation-tabbar-progress":F.progress.toFixed(4)}:void 0;km(A,L,I);function $(){const te=wm(C.pathname,C.search);if(!te){f();return}j(te,{replace:!0})}const ee=i.jsx("nav",{ref:L,className:"mobile-workbench-tabbar","aria-label":h("shell.title"),hidden:_,children:K.map(te=>i.jsxs("button",{type:"button",className:"mobile-workbench-tabbar-item","data-active":te.key===e,"aria-current":te.key===e?"page":void 0,onClick:()=>{te.key!==e&&S.trigger("selection"),te.onClick()},children:[i.jsx("span",{className:"mobile-workbench-tabbar-icon","aria-hidden":"true",children:te.icon}),i.jsx("span",{className:"mobile-workbench-tabbar-label",children:te.label})]},te.key))});return i.jsx(xm,{composerPortalTarget:I?M:null,children:i.jsxs("div",{ref:A,className:"mobile-workbench-shell","data-active-entry":e,"data-mobile-presentation":t,"data-mobile-runtime":k.platform,"data-mobile-keyboard-open":_,"data-pane-layout":D,"data-tabbar-open":_?!1:I?F.isOpen:!0,"data-conversation-tabbar-state":I?F.state:"default",style:X,children:[P?i.jsxs("header",{className:"mobile-workbench-header","data-header-kind":"tools",children:[i.jsxs("div",{className:"mobile-workbench-header-leading",children:[P.showBackButton?i.jsx("button",{type:"button",className:"mobile-workbench-header-button","aria-label":h("common.back"),onClick:$,children:i.jsx(W2,{})}):null,i.jsx("div",{className:"mobile-workbench-header-copy",children:i.jsx("h1",{children:P.title})})]}),i.jsx("div",{className:"mobile-workbench-header-actions",children:P.showMoreButton?i.jsx("button",{type:"button",className:"mobile-workbench-header-button mobile-tools-more-button","aria-label":P.moreButtonLabel,onClick:g,children:i.jsx(z2,{})}):null})]}):null,i.jsx("div",{className:"mobile-workbench-content",children:i.jsx(Cm,{viewportClass:k.viewportClass,activeEntry:e,hasNavigationPanel:!!s,hasAuxiliaryPanel:!!a,navigationPanel:s,auxiliaryPanel:a,children:n})}),I?i.jsxs("div",{className:"mobile-conversation-bottom-layer",children:[i.jsx("div",{ref:O,className:"mobile-conversation-bottom-layer-composer-slot"}),i.jsx("div",{className:"mobile-conversation-bottom-layer-tabbar-shell",children:ee})]}):ee]})})}function W2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",children:[i.jsx("path",{d:"m15 18-6-6 6-6"}),i.jsx("path",{d:"M21 12H9"})]})}function z2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"12",cy:"5",r:"1.8"}),i.jsx("circle",{cx:"12",cy:"12",r:"1.8"}),i.jsx("circle",{cx:"12",cy:"19",r:"1.8"})]})}function H2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",children:[i.jsx("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"}),i.jsx("path",{d:"M8 13h8"})]})}function q2(){return i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",children:i.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function $2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2.5"}),i.jsx("path",{d:"m7.5 9 3 3-3 3"}),i.jsx("path",{d:"M12.5 15H17"})]})}function V2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",children:[i.jsx("path",{d:"M8 6V4.8A1.8 1.8 0 0 1 9.8 3h4.4A1.8 1.8 0 0 1 16 4.8V6"}),i.jsx("rect",{x:"3",y:"6",width:"18",height:"13",rx:"2"}),i.jsx("path",{d:"M3 12h18"}),i.jsx("path",{d:"M10 11.5h4"})]})}function G2(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.6 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82L4.21 7.1a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 8.92 4a1.65 1.65 0 0 0 1-1.51V2.4a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9c0 .66.39 1.25 1 1.51h.09a2 2 0 0 1 0 4h-.09c-.61.26-1 .85-1 1.49z"})]})}class xS{constructor(t){Ke(this,"maxAttempts");Ke(this,"baseDelayMs");Ke(this,"reconnectAttempts",0);Ke(this,"reconnectTimer",null);Ke(this,"disposed",!1);this.options=t,this.maxAttempts=t.maxAttempts??4,this.baseDelayMs=t.baseDelayMs??300}start(){this.options.onReconnect(!1)}markConnected(){this.reconnectAttempts=0,this.options.onStateChange("connected")}markTransientFailure(){this.disposed||this.reconnectAttempts>0||this.options.onStateChange("reconnecting")}markDisconnected(){if(this.disposed)return;if(!Rn.getState().autoReconnect){this.options.onStateChange("reconnect_failed");return}if(this.reconnectAttempts+=1,this.reconnectAttempts>this.maxAttempts){this.options.onStateChange("reconnect_failed");return}this.options.onStateChange("reconnecting");const t=this.baseDelayMs*this.reconnectAttempts;this.reconnectTimer=window.setTimeout(()=>{this.options.onReconnect(!0)},t)}reconnectNow(){this.reconnectAttempts=0,this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.options.onReconnect(!0)}close(){this.disposed=!0,this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.options.onStateChange("closed")}}class K2{constructor(t){Ke(this,"socket",null);Ke(this,"disposed",!1);Ke(this,"authRecoveryInFlight",!1);Ke(this,"pendingRefresh",!1);Ke(this,"fileTreeSubscription",null);Ke(this,"gitWorkspaceId",null);Ke(this,"terminalManagerWorkspaceId",null);Ke(this,"workspaceManagementWorkspaceId",null);Ke(this,"pendingFileTreeRefresh",null);Ke(this,"pendingGitRefreshWorkspaceId",null);Ke(this,"pendingTerminalManagerRefreshWorkspaceId",null);Ke(this,"pendingWorkspaceManagementRefreshWorkspaceId",null);Ke(this,"fileTreeListeners",new Set);Ke(this,"gitListeners",new Set);Ke(this,"terminalManagerListeners",new Set);Ke(this,"workspaceManagementListeners",new Set);Ke(this,"connectionManager");this.options=t,this.connectionManager=new xS({onReconnect:n=>{this.connect(n)},onStateChange:t.onConnectionChange})}start(){this.connectionManager.start()}requestRefresh(){const t=this.socket;if(!Vv(t)){this.pendingRefresh=!0;return}t.send(JSON.stringify({type:"workbench.refresh"})),this.pendingRefresh=!1}subscribeFileTree(t,n){this.fileTreeSubscription={workspaceId:t,paths:Gv(n)},this.sendWhenReady({type:"fileTree.subscribe",workspaceId:t,paths:this.fileTreeSubscription.paths})}requestFileTreeRefresh(t,n){const s=Gv(n),a={type:"fileTree.refresh",workspaceId:t,paths:s};this.sendWhenReady(a)?this.pendingFileTreeRefresh=null:this.pendingFileTreeRefresh={workspaceId:t,paths:s}}subscribeGit(t){this.gitWorkspaceId=t,this.sendWhenReady({type:"git.subscribe",workspaceId:t})}requestGitRefresh(t){this.sendWhenReady({type:"git.refresh",workspaceId:t})?this.pendingGitRefreshWorkspaceId=null:this.pendingGitRefreshWorkspaceId=t}subscribeTerminalManager(t){this.terminalManagerWorkspaceId=t,this.sendWhenReady({type:"terminalManager.subscribe",workspaceId:t})}requestTerminalManagerRefresh(t){this.sendWhenReady({type:"terminalManager.refresh",workspaceId:t})?this.pendingTerminalManagerRefreshWorkspaceId=null:this.pendingTerminalManagerRefreshWorkspaceId=t}subscribeWorkspaceManagement(t){this.workspaceManagementWorkspaceId=t,this.sendWhenReady({type:"workspaceManagement.subscribe",workspaceId:t})}requestWorkspaceManagementRefresh(t){this.sendWhenReady({type:"workspaceManagement.refresh",workspaceId:t})?this.pendingWorkspaceManagementRefreshWorkspaceId=null:this.pendingWorkspaceManagementRefreshWorkspaceId=t}addFileTreeSnapshotListener(t){return this.fileTreeListeners.add(t),()=>{this.fileTreeListeners.delete(t)}}addGitSnapshotListener(t){return this.gitListeners.add(t),()=>{this.gitListeners.delete(t)}}addTerminalManagerSnapshotListener(t){return this.terminalManagerListeners.add(t),()=>{this.terminalManagerListeners.delete(t)}}addWorkspaceManagementSnapshotListener(t){return this.workspaceManagementListeners.add(t),()=>{this.workspaceManagementListeners.delete(t)}}close(){var t;this.disposed=!0,this.connectionManager.close(),(t=this.socket)==null||t.close(),this.socket=null}connect(t){var c;if(this.disposed)return;t&&this.socket&&(this.socket.close(),this.socket=null);const n=(c=gn.getState().session)==null?void 0:c.accessToken;if(!n){this.options.onUnauthorized();return}const s=`${ox("/ws")}?access_token=${encodeURIComponent(n)}`,a=new WebSocket(s);this.socket=a,a.addEventListener("open",()=>{a.send(JSON.stringify({type:"workbench.subscribe"})),this.pendingRefresh&&this.requestRefresh(),this.fileTreeSubscription&&a.send(JSON.stringify({type:"fileTree.subscribe",workspaceId:this.fileTreeSubscription.workspaceId,paths:this.fileTreeSubscription.paths})),this.pendingFileTreeRefresh&&this.requestFileTreeRefresh(this.pendingFileTreeRefresh.workspaceId,this.pendingFileTreeRefresh.paths),this.gitWorkspaceId&&a.send(JSON.stringify({type:"git.subscribe",workspaceId:this.gitWorkspaceId})),this.pendingGitRefreshWorkspaceId&&this.requestGitRefresh(this.pendingGitRefreshWorkspaceId),this.terminalManagerWorkspaceId&&a.send(JSON.stringify({type:"terminalManager.subscribe",workspaceId:this.terminalManagerWorkspaceId})),this.pendingTerminalManagerRefreshWorkspaceId&&this.requestTerminalManagerRefresh(this.pendingTerminalManagerRefreshWorkspaceId),this.workspaceManagementWorkspaceId&&a.send(JSON.stringify({type:"workspaceManagement.subscribe",workspaceId:this.workspaceManagementWorkspaceId})),this.pendingWorkspaceManagementRefreshWorkspaceId&&this.requestWorkspaceManagementRefresh(this.pendingWorkspaceManagementRefreshWorkspaceId)}),a.addEventListener("message",l=>{var f,p,y,g,b,k,S,C;const d=JSON.parse(l.data);if(d.type==="system.connected"){this.connectionManager.markConnected();return}if(d.type==="session.error"){d.error_code==="UNAUTHORIZED"&&this.handleUnauthorized();return}if(d.type==="fileTree.snapshot"){(p=(f=this.options).onFileTreeSnapshot)==null||p.call(f,d.snapshot),this.fileTreeListeners.forEach(j=>j(d.snapshot));return}if(d.type==="git.snapshot"){(g=(y=this.options).onGitSnapshot)==null||g.call(y,d.snapshot),this.gitListeners.forEach(j=>j(d.snapshot));return}if(d.type==="terminalManager.snapshot"){(k=(b=this.options).onTerminalManagerSnapshot)==null||k.call(b,d.snapshot),this.terminalManagerListeners.forEach(j=>j(d.snapshot));return}if(d.type==="workspaceManagement.snapshot"){(C=(S=this.options).onWorkspaceManagementSnapshot)==null||C.call(S,d.snapshot),this.workspaceManagementListeners.forEach(j=>j(d.snapshot));return}d.type==="workbench.snapshot"&&Q2(d.snapshot)&&this.options.onSnapshot(d.snapshot)}),a.addEventListener("close",()=>{this.disposed||this.socket!==a||this.connectionManager.markDisconnected()}),a.addEventListener("error",()=>{this.disposed||this.socket!==a||this.connectionManager.markTransientFailure()})}handleUnauthorized(){if(this.authRecoveryInFlight||this.disposed)return;this.authRecoveryInFlight=!0;const t=this.socket;this.socket=null,t==null||t.close(),gn.refresh().then(n=>{if(this.authRecoveryInFlight=!1,!this.disposed){if(n.status==="refreshed"){this.connectionManager.reconnectNow();return}if(n.status==="deferred"){this.connectionManager.markDisconnected();return}this.options.onUnauthorized()}})}sendWhenReady(t){const n=this.socket;return Vv(n)?(n.send(JSON.stringify(t)),!0):!1}}function Vv(e){const t=typeof WebSocket.OPEN=="number"?WebSocket.OPEN:1;return e!==null&&e.readyState===t}function Q2(e){return typeof e!="object"||e===null?!1:Array.isArray(e.items)}function Gv(e){const t=new Set;for(const n of e??[""])t.add(n.trim().replace(/\\/g,"/").replace(/^\/+|\/+$/g,""));return[...t]}function Tn(e,t,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)}function qi(e,t,n,s,a){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var fs,Lr,Zs,sc,Cc;const hr="__TAURI_TO_IPC_KEY__";function kS(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}class SS{constructor(t){fs.set(this,void 0),Lr.set(this,0),Zs.set(this,[]),sc.set(this,void 0),qi(this,fs,t||(()=>{})),this.id=kS(n=>{const s=n.index;if("end"in n){s==Tn(this,Lr,"f")?this.cleanupCallback():qi(this,sc,s);return}const a=n.message;if(s==Tn(this,Lr,"f")){for(Tn(this,fs,"f").call(this,a),qi(this,Lr,Tn(this,Lr,"f")+1);Tn(this,Lr,"f")in Tn(this,Zs,"f");){const c=Tn(this,Zs,"f")[Tn(this,Lr,"f")];Tn(this,fs,"f").call(this,c),delete Tn(this,Zs,"f")[Tn(this,Lr,"f")],qi(this,Lr,Tn(this,Lr,"f")+1)}Tn(this,Lr,"f")===Tn(this,sc,"f")&&this.cleanupCallback()}else Tn(this,Zs,"f")[s]=a})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(t){qi(this,fs,t)}get onmessage(){return Tn(this,fs,"f")}[(fs=new WeakMap,Lr=new WeakMap,Zs=new WeakMap,sc=new WeakMap,hr)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[hr]()}}async function be(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}class CS{get rid(){return Tn(this,Cc,"f")}constructor(t){Cc.set(this,void 0),qi(this,Cc,t)}async close(){return be("plugin:resources|close",{rid:this.rid})}}Cc=new WeakMap;class Sa extends CS{constructor(t){super(t)}static async new(t,n,s){return be("plugin:image|new",{rgba:si(t),width:n,height:s}).then(a=>new Sa(a))}static async fromBytes(t){return be("plugin:image|from_bytes",{bytes:si(t)}).then(n=>new Sa(n))}static async fromPath(t){return be("plugin:image|from_path",{path:t}).then(n=>new Sa(n))}async rgba(){return be("plugin:image|rgba",{rid:this.rid}).then(t=>new Uint8Array(t))}async size(){return be("plugin:image|size",{rid:this.rid})}}function si(e){return e==null?null:typeof e=="string"?e:e instanceof Sa?e.rid:e}var jc,Nc;function jS(e){var t;if("items"in e)e.items=(t=e.items)===null||t===void 0?void 0:t.map(n=>"rid"in n?n:jS(n));else if("action"in e&&e.action){const n=new SS;return n.onmessage=e.action,delete e.action,{...e,handler:n}}return e}async function go(e,t){const n=new SS;if(t&&typeof t=="object"&&("action"in t&&t.action&&(n.onmessage=t.action,delete t.action),"item"in t&&t.item&&typeof t.item=="object"&&"About"in t.item&&t.item.About&&typeof t.item.About=="object"&&"icon"in t.item.About&&t.item.About.icon&&(t.item.About.icon=si(t.item.About.icon)),"icon"in t&&t.icon&&(t.icon=si(t.icon)),"items"in t&&t.items)){let s=function(a){var c;return"rid"in a?[a.rid,a.kind]:("item"in a&&typeof a.item=="object"&&(!((c=a.item.About)===null||c===void 0)&&c.icon)&&(a.item.About.icon=si(a.item.About.icon)),"icon"in a&&a.icon&&(a.icon=si(a.icon)),"items"in a&&a.items&&(a.items=a.items.map(s)),jS(a))};t.items=t.items.map(s)}return be("plugin:menu|new",{kind:e,options:t,handler:n})}class yo extends CS{get id(){return Tn(this,jc,"f")}get kind(){return Tn(this,Nc,"f")}constructor(t,n,s){super(t),jc.set(this,void 0),Nc.set(this,void 0),qi(this,jc,n),qi(this,Nc,s)}}jc=new WeakMap,Nc=new WeakMap;class jm extends yo{constructor(t,n){super(t,n,"MenuItem")}static async new(t){return go("MenuItem",t).then(([n,s])=>new jm(n,s))}async text(){return be("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(t){return be("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:t})}async isEnabled(){return be("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(t){return be("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:t})}async setAccelerator(t){return be("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:t})}}class Nm extends yo{constructor(t,n){super(t,n,"Check")}static async new(t){return go("Check",t).then(([n,s])=>new Nm(n,s))}async text(){return be("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(t){return be("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:t})}async isEnabled(){return be("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(t){return be("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:t})}async setAccelerator(t){return be("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:t})}async isChecked(){return be("plugin:menu|is_checked",{rid:this.rid})}async setChecked(t){return be("plugin:menu|set_checked",{rid:this.rid,checked:t})}}var Kv;(function(e){e.Add="Add",e.Advanced="Advanced",e.Bluetooth="Bluetooth",e.Bookmarks="Bookmarks",e.Caution="Caution",e.ColorPanel="ColorPanel",e.ColumnView="ColumnView",e.Computer="Computer",e.EnterFullScreen="EnterFullScreen",e.Everyone="Everyone",e.ExitFullScreen="ExitFullScreen",e.FlowView="FlowView",e.Folder="Folder",e.FolderBurnable="FolderBurnable",e.FolderSmart="FolderSmart",e.FollowLinkFreestanding="FollowLinkFreestanding",e.FontPanel="FontPanel",e.GoLeft="GoLeft",e.GoRight="GoRight",e.Home="Home",e.IChatTheater="IChatTheater",e.IconView="IconView",e.Info="Info",e.InvalidDataFreestanding="InvalidDataFreestanding",e.LeftFacingTriangle="LeftFacingTriangle",e.ListView="ListView",e.LockLocked="LockLocked",e.LockUnlocked="LockUnlocked",e.MenuMixedState="MenuMixedState",e.MenuOnState="MenuOnState",e.MobileMe="MobileMe",e.MultipleDocuments="MultipleDocuments",e.Network="Network",e.Path="Path",e.PreferencesGeneral="PreferencesGeneral",e.QuickLook="QuickLook",e.RefreshFreestanding="RefreshFreestanding",e.Refresh="Refresh",e.Remove="Remove",e.RevealFreestanding="RevealFreestanding",e.RightFacingTriangle="RightFacingTriangle",e.Share="Share",e.Slideshow="Slideshow",e.SmartBadge="SmartBadge",e.StatusAvailable="StatusAvailable",e.StatusNone="StatusNone",e.StatusPartiallyAvailable="StatusPartiallyAvailable",e.StatusUnavailable="StatusUnavailable",e.StopProgressFreestanding="StopProgressFreestanding",e.StopProgress="StopProgress",e.TrashEmpty="TrashEmpty",e.TrashFull="TrashFull",e.User="User",e.UserAccounts="UserAccounts",e.UserGroup="UserGroup",e.UserGuest="UserGuest"})(Kv||(Kv={}));class Pm extends yo{constructor(t,n){super(t,n,"Icon")}static async new(t){return go("Icon",t).then(([n,s])=>new Pm(n,s))}async text(){return be("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(t){return be("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:t})}async isEnabled(){return be("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(t){return be("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:t})}async setAccelerator(t){return be("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:t})}async setIcon(t){return be("plugin:menu|set_icon",{rid:this.rid,kind:this.kind,icon:si(t)})}}class Tm extends yo{constructor(t,n){super(t,n,"Predefined")}static async new(t){return go("Predefined",t).then(([n,s])=>new Tm(n,s))}async text(){return be("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(t){return be("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:t})}}class NS{constructor(...t){this.type="Logical",t.length===1?"Logical"in t[0]?(this.width=t[0].Logical.width,this.height=t[0].Logical.height):(this.width=t[0].width,this.height=t[0].height):(this.width=t[0],this.height=t[1])}toPhysical(t){return new Ca(this.width*t,this.height*t)}[hr](){return{width:this.width,height:this.height}}toJSON(){return this[hr]()}}class Ca{constructor(...t){this.type="Physical",t.length===1?"Physical"in t[0]?(this.width=t[0].Physical.width,this.height=t[0].Physical.height):(this.width=t[0].width,this.height=t[0].height):(this.width=t[0],this.height=t[1])}toLogical(t){return new NS(this.width/t,this.height/t)}[hr](){return{width:this.width,height:this.height}}toJSON(){return this[hr]()}}class eo{constructor(t){this.size=t}toLogical(t){return this.size instanceof NS?this.size:this.size.toLogical(t)}toPhysical(t){return this.size instanceof Ca?this.size:this.size.toPhysical(t)}[hr](){return{[`${this.size.type}`]:{width:this.size.width,height:this.size.height}}}toJSON(){return this[hr]()}}class PS{constructor(...t){this.type="Logical",t.length===1?"Logical"in t[0]?(this.x=t[0].Logical.x,this.y=t[0].Logical.y):(this.x=t[0].x,this.y=t[0].y):(this.x=t[0],this.y=t[1])}toPhysical(t){return new Hi(this.x*t,this.y*t)}[hr](){return{x:this.x,y:this.y}}toJSON(){return this[hr]()}}class Hi{constructor(...t){this.type="Physical",t.length===1?"Physical"in t[0]?(this.x=t[0].Physical.x,this.y=t[0].Physical.y):(this.x=t[0].x,this.y=t[0].y):(this.x=t[0],this.y=t[1])}toLogical(t){return new PS(this.x/t,this.y/t)}[hr](){return{x:this.x,y:this.y}}toJSON(){return this[hr]()}}class Vi{constructor(t){this.position=t}toLogical(t){return this.position instanceof PS?this.position:this.position.toLogical(t)}toPhysical(t){return this.position instanceof Hi?this.position:this.position.toPhysical(t)}[hr](){return{[`${this.position.type}`]:{x:this.position.x,y:this.position.y}}}toJSON(){return this[hr]()}}function ao([e,t,n]){switch(n){case"Submenu":return new Em(e,t);case"Predefined":return new Tm(e,t);case"Check":return new Nm(e,t);case"Icon":return new Pm(e,t);case"MenuItem":default:return new jm(e,t)}}class Em extends yo{constructor(t,n){super(t,n,"Submenu")}static async new(t){return go("Submenu",t).then(([n,s])=>new Em(n,s))}async text(){return be("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(t){return be("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:t})}async isEnabled(){return be("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(t){return be("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:t})}async append(t){return be("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(t)?t:[t]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(t){return be("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(t)?t:[t]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(t,n){return be("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(t)?t:[t]).map(s=>"rid"in s?[s.rid,s.kind]:s),position:n})}async remove(t){return be("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[t.rid,t.kind]})}async removeAt(t){return be("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:t}).then(ao)}async items(){return be("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(t=>t.map(ao))}async get(t){return be("plugin:menu|get",{rid:this.rid,kind:this.kind,id:t}).then(n=>n?ao(n):null)}async popup(t,n){var s;return be("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(s=n==null?void 0:n.label)!==null&&s!==void 0?s:null,at:t instanceof Vi?t:t?new Vi(t):null})}async setAsWindowsMenuForNSApp(){return be("plugin:menu|set_as_windows_menu_for_nsapp",{rid:this.rid})}async setAsHelpMenuForNSApp(){return be("plugin:menu|set_as_help_menu_for_nsapp",{rid:this.rid})}async setIcon(t){return be("plugin:menu|set_icon",{rid:this.rid,kind:this.kind,icon:si(t)})}}class so extends yo{constructor(t,n){super(t,n,"Menu")}static async new(t){return go("Menu",t).then(([n,s])=>new so(n,s))}static async default(){return be("plugin:menu|create_default").then(([t,n])=>new so(t,n))}async append(t){return be("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(t)?t:[t]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(t){return be("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(t)?t:[t]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(t,n){return be("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(t)?t:[t]).map(s=>"rid"in s?[s.rid,s.kind]:s),position:n})}async remove(t){return be("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[t.rid,t.kind]})}async removeAt(t){return be("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:t}).then(ao)}async items(){return be("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(t=>t.map(ao))}async get(t){return be("plugin:menu|get",{rid:this.rid,kind:this.kind,id:t}).then(n=>n?ao(n):null)}async popup(t,n){var s;return be("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(s=n==null?void 0:n.label)!==null&&s!==void 0?s:null,at:t instanceof Vi?t:t?new Vi(t):null})}async setAsAppMenu(){return be("plugin:menu|set_as_app_menu",{rid:this.rid}).then(t=>t?new so(t[0],t[1]):null)}async setAsWindowMenu(t){var n;return be("plugin:menu|set_as_window_menu",{rid:this.rid,window:(n=t==null?void 0:t.label)!==null&&n!==void 0?n:null}).then(s=>s?new so(s[0],s[1]):null)}}var xr;(function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"})(xr||(xr={}));async function TS(e,t){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e,t),await be("plugin:event|unlisten",{event:e,eventId:t})}async function ES(e,t,n){var s;const a=typeof(n==null?void 0:n.target)=="string"?{kind:"AnyLabel",label:n.target}:(s=n==null?void 0:n.target)!==null&&s!==void 0?s:{kind:"Any"};return be("plugin:event|listen",{event:e,target:a,handler:kS(t)}).then(c=>async()=>TS(e,c))}async function Y2(e,t,n){return ES(e,s=>{TS(e,s.id),t(s)},n)}async function X2(e,t){await be("plugin:event|emit",{event:e,payload:t})}async function J2(e,t,n){await be("plugin:event|emit_to",{target:typeof e=="string"?{kind:"AnyLabel",label:e}:e,event:t,payload:n})}var xf;(function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"})(xf||(xf={}));class Z2{constructor(t){this._preventDefault=!1,this.event=t.event,this.id=t.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var Qv;(function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"})(Qv||(Qv={}));function Rm(){return new RS(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function xh(){return be("plugin:window|get_all_windows").then(e=>e.map(t=>new RS(t,{skip:!0})))}const kh=["tauri://created","tauri://error"];class RS{constructor(t,n={}){var s;this.label=t,this.listeners=Object.create(null),n!=null&&n.skip||be("plugin:window|create",{options:{...n,parent:typeof n.parent=="string"?n.parent:(s=n.parent)===null||s===void 0?void 0:s.label,label:t}}).then(async()=>this.emit("tauri://created")).catch(async a=>this.emit("tauri://error",a))}static async getByLabel(t){var n;return(n=(await xh()).find(s=>s.label===t))!==null&&n!==void 0?n:null}static getCurrent(){return Rm()}static async getAll(){return xh()}static async getFocusedWindow(){for(const t of await xh())if(await t.isFocused())return t;return null}async listen(t,n){return this._handleTauriEvent(t,n)?()=>{const s=this.listeners[t];s.splice(s.indexOf(n),1)}:ES(t,n,{target:{kind:"Window",label:this.label}})}async once(t,n){return this._handleTauriEvent(t,n)?()=>{const s=this.listeners[t];s.splice(s.indexOf(n),1)}:Y2(t,n,{target:{kind:"Window",label:this.label}})}async emit(t,n){if(kh.includes(t)){for(const s of this.listeners[t]||[])s({event:t,id:-1,payload:n});return}return X2(t,n)}async emitTo(t,n,s){if(kh.includes(n)){for(const a of this.listeners[n]||[])a({event:n,id:-1,payload:s});return}return J2(t,n,s)}_handleTauriEvent(t,n){return kh.includes(t)?(t in this.listeners?this.listeners[t].push(n):this.listeners[t]=[n],!0):!1}async scaleFactor(){return be("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return be("plugin:window|inner_position",{label:this.label}).then(t=>new Hi(t))}async outerPosition(){return be("plugin:window|outer_position",{label:this.label}).then(t=>new Hi(t))}async innerSize(){return be("plugin:window|inner_size",{label:this.label}).then(t=>new Ca(t))}async outerSize(){return be("plugin:window|outer_size",{label:this.label}).then(t=>new Ca(t))}async isFullscreen(){return be("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return be("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return be("plugin:window|is_maximized",{label:this.label})}async isFocused(){return be("plugin:window|is_focused",{label:this.label})}async isDecorated(){return be("plugin:window|is_decorated",{label:this.label})}async isResizable(){return be("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return be("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return be("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return be("plugin:window|is_closable",{label:this.label})}async isVisible(){return be("plugin:window|is_visible",{label:this.label})}async title(){return be("plugin:window|title",{label:this.label})}async theme(){return be("plugin:window|theme",{label:this.label})}async isAlwaysOnTop(){return be("plugin:window|is_always_on_top",{label:this.label})}async center(){return be("plugin:window|center",{label:this.label})}async requestUserAttention(t){let n=null;return t&&(t===xf.Critical?n={type:"Critical"}:n={type:"Informational"}),be("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(t){return be("plugin:window|set_resizable",{label:this.label,value:t})}async setEnabled(t){return be("plugin:window|set_enabled",{label:this.label,value:t})}async isEnabled(){return be("plugin:window|is_enabled",{label:this.label})}async setMaximizable(t){return be("plugin:window|set_maximizable",{label:this.label,value:t})}async setMinimizable(t){return be("plugin:window|set_minimizable",{label:this.label,value:t})}async setClosable(t){return be("plugin:window|set_closable",{label:this.label,value:t})}async setTitle(t){return be("plugin:window|set_title",{label:this.label,value:t})}async maximize(){return be("plugin:window|maximize",{label:this.label})}async unmaximize(){return be("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return be("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return be("plugin:window|minimize",{label:this.label})}async unminimize(){return be("plugin:window|unminimize",{label:this.label})}async show(){return be("plugin:window|show",{label:this.label})}async hide(){return be("plugin:window|hide",{label:this.label})}async close(){return be("plugin:window|close",{label:this.label})}async destroy(){return be("plugin:window|destroy",{label:this.label})}async setDecorations(t){return be("plugin:window|set_decorations",{label:this.label,value:t})}async setShadow(t){return be("plugin:window|set_shadow",{label:this.label,value:t})}async setEffects(t){return be("plugin:window|set_effects",{label:this.label,value:t})}async clearEffects(){return be("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(t){return be("plugin:window|set_always_on_top",{label:this.label,value:t})}async setAlwaysOnBottom(t){return be("plugin:window|set_always_on_bottom",{label:this.label,value:t})}async setContentProtected(t){return be("plugin:window|set_content_protected",{label:this.label,value:t})}async setSize(t){return be("plugin:window|set_size",{label:this.label,value:t instanceof eo?t:new eo(t)})}async setMinSize(t){return be("plugin:window|set_min_size",{label:this.label,value:t instanceof eo?t:t?new eo(t):null})}async setMaxSize(t){return be("plugin:window|set_max_size",{label:this.label,value:t instanceof eo?t:t?new eo(t):null})}async setSizeConstraints(t){function n(s){return s?{Logical:s}:null}return be("plugin:window|set_size_constraints",{label:this.label,value:{minWidth:n(t==null?void 0:t.minWidth),minHeight:n(t==null?void 0:t.minHeight),maxWidth:n(t==null?void 0:t.maxWidth),maxHeight:n(t==null?void 0:t.maxHeight)}})}async setPosition(t){return be("plugin:window|set_position",{label:this.label,value:t instanceof Vi?t:new Vi(t)})}async setFullscreen(t){return be("plugin:window|set_fullscreen",{label:this.label,value:t})}async setSimpleFullscreen(t){return be("plugin:window|set_simple_fullscreen",{label:this.label,value:t})}async setFocus(){return be("plugin:window|set_focus",{label:this.label})}async setFocusable(t){return be("plugin:window|set_focusable",{label:this.label,value:t})}async setIcon(t){return be("plugin:window|set_icon",{label:this.label,value:si(t)})}async setSkipTaskbar(t){return be("plugin:window|set_skip_taskbar",{label:this.label,value:t})}async setCursorGrab(t){return be("plugin:window|set_cursor_grab",{label:this.label,value:t})}async setCursorVisible(t){return be("plugin:window|set_cursor_visible",{label:this.label,value:t})}async setCursorIcon(t){return be("plugin:window|set_cursor_icon",{label:this.label,value:t})}async setBackgroundColor(t){return be("plugin:window|set_background_color",{color:t})}async setCursorPosition(t){return be("plugin:window|set_cursor_position",{label:this.label,value:t instanceof Vi?t:new Vi(t)})}async setIgnoreCursorEvents(t){return be("plugin:window|set_ignore_cursor_events",{label:this.label,value:t})}async startDragging(){return be("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(t){return be("plugin:window|start_resize_dragging",{label:this.label,value:t})}async setBadgeCount(t){return be("plugin:window|set_badge_count",{label:this.label,value:t})}async setBadgeLabel(t){return be("plugin:window|set_badge_label",{label:this.label,value:t})}async setOverlayIcon(t){return be("plugin:window|set_overlay_icon",{label:this.label,value:t?si(t):void 0})}async setProgressBar(t){return be("plugin:window|set_progress_bar",{label:this.label,value:t})}async setVisibleOnAllWorkspaces(t){return be("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:t})}async setTitleBarStyle(t){return be("plugin:window|set_title_bar_style",{label:this.label,value:t})}async setTheme(t){return be("plugin:window|set_theme",{label:this.label,value:t})}async onResized(t){return this.listen(xr.WINDOW_RESIZED,n=>{n.payload=new Ca(n.payload),t(n)})}async onMoved(t){return this.listen(xr.WINDOW_MOVED,n=>{n.payload=new Hi(n.payload),t(n)})}async onCloseRequested(t){return this.listen(xr.WINDOW_CLOSE_REQUESTED,async n=>{const s=new Z2(n);await t(s),s.isPreventDefault()||await this.destroy()})}async onDragDropEvent(t){const n=await this.listen(xr.DRAG_ENTER,l=>{t({...l,payload:{type:"enter",paths:l.payload.paths,position:new Hi(l.payload.position)}})}),s=await this.listen(xr.DRAG_OVER,l=>{t({...l,payload:{type:"over",position:new Hi(l.payload.position)}})}),a=await this.listen(xr.DRAG_DROP,l=>{t({...l,payload:{type:"drop",paths:l.payload.paths,position:new Hi(l.payload.position)}})}),c=await this.listen(xr.DRAG_LEAVE,l=>{t({...l,payload:{type:"leave"}})});return()=>{n(),a(),s(),c()}}async onFocusChanged(t){const n=await this.listen(xr.WINDOW_FOCUS,a=>{t({...a,payload:!0})}),s=await this.listen(xr.WINDOW_BLUR,a=>{t({...a,payload:!1})});return()=>{n(),s()}}async onScaleChanged(t){return this.listen(xr.WINDOW_SCALE_FACTOR_CHANGED,t)}async onThemeChanged(t){return this.listen(xr.WINDOW_THEME_CHANGED,t)}}var Yv;(function(e){e.Disabled="disabled",e.Throttle="throttle",e.Suspend="suspend"})(Yv||(Yv={}));var Xv;(function(e){e.Default="default",e.FluentOverlay="fluentOverlay"})(Xv||(Xv={}));var Jv;(function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"})(Jv||(Jv={}));var Zv;(function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"})(Zv||(Zv={}));async function e_(e){if(e.length===0)return;await(await so.new({items:e.map(n=>({id:n.id,text:n.label,enabled:!n.disabled,accelerator:n.accelerator,action:()=>{n.onSelect()}}))})).popup(void 0,Rm())}const t_=["button","a","input","textarea","select","summary","[role='button']","[role='link']","[role='tab']","[role='menuitem']","[contenteditable='true']","[data-window-drag='ignore']"].join(", ");function Mm(e){return e instanceof HTMLElement?!e.closest(t_):!0}async function Am(){typeof window>"u"||typeof window.__TAURI_INTERNALS__>"u"||await Rm().startDragging()}const ya=new Map;function MS(){return typeof window<"u"&&typeof window.sessionStorage<"u"}function ew(e,t){return!Number.isFinite(e)||Date.now()-e>t}function Mn(e,t){const n=ya.get(e);if(n&&!ew(n.savedAt,t))return n.value;if(!MS())return null;const s=window.sessionStorage.getItem(e);if(!s)return null;try{const a=JSON.parse(s);return!a||ew(a.savedAt,t)?(window.sessionStorage.removeItem(e),ya.delete(e),null):(ya.set(e,a),a.value)}catch{return window.sessionStorage.removeItem(e),ya.delete(e),null}}function jr(e,t){const n={savedAt:Date.now(),value:t};if(ya.set(e,n),!!MS())try{window.sessionStorage.setItem(e,JSON.stringify(n))}catch{}}const n_="codingns.debug.perf";function r_(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(n_)==="1"}catch{return!1}}function _t(e,t){if(!r_()||typeof performance>"u")return;const n=Math.round(performance.now());if(t&&Object.keys(t).length>0){console.info(`[perf-ui] ${e} ${n}ms`,t);return}console.info(`[perf-ui] ${e} ${n}ms`)}function i_(e,t,n,s){return Je.request("/api/files/content",{method:"PUT",body:JSON.stringify({workspaceId:e,path:t,content:n,expectedVersion:s??void 0})})}function s_(e){return Je.request("/api/files/ops",{method:"POST",body:JSON.stringify(e)})}function o_(e){return Je.request("/api/files/upload",{method:"POST",body:JSON.stringify(e)})}function a_(e,t){const n=new URLSearchParams({workspaceId:e,path:t});return Je.request(`/api/files/download?${n.toString()}`)}function kf(e,t,n=1,s=20){const a=new URLSearchParams({workspaceId:e,keyword:t,page:String(n),pageSize:String(s)});return Je.request(`/api/files/search?${a.toString()}`)}function tw(e,t){const n=new URLSearchParams({workspaceId:e,path:t});return Je.request(`/api/files/preview?${n.toString()}`)}function Qa(e){var t,n;return e.runningState==="failed"||!!((t=e.lastErrorCode)!=null&&t.trim())||!!((n=e.lastErrorDetail)!=null&&n.trim())}function Lm(e,t,n){const s=l_(t);return s==="running_inferred"?`${e} is-running-inferred`:`${e} is-${s.replace("_","-")}`}function Qc(e){return e.runningState==="stale"?h("conversation.runtimeStale"):e.runningState==="unknown"?h("conversation.runtimeUnknown"):null}function AS(e,t){return t.runningState==="stale"?`${e} is-stale`:t.runningState==="unknown"?`${e} is-unknown`:null}function l_(e){return Qa(e)?"error":e.runningState==="stale"?"stale":e.runningState==="unknown"?"unknown":e.activityState==="running"?c_(e)?"running_inferred":"running":e.activityState==="completed_unread"?"unread":"idle"}function c_(e){return e.activityResolutionSource==="inferred_log"||e.activitySource==="inferred"}const nw=48;function u_(e){return typeof e=="string"?e.replace(/\s+/g," ").trim():""}function Yi(e,t){const n=u_(e)||t,s=n.length>nw?n.slice(0,nw).trimEnd():n;return{fullTitle:n,displayTitle:s}}const Sh=5,Ch=["#2563eb","#0891b2","#16a34a","#d97706","#dc2626","#64748b"];function LS(e){const t=Math.round(e.ratio*1e3)/10;return`${t.toFixed(t%1===0?0:1)}%`}function IS(e,t){const n=e.reduce((d,f)=>d+f.count,0);if(n<=0)return[];const a=e.slice(0,Sh).map((d,f)=>({...d,key:d.type,ratio:d.count/n,color:Ch[f]??Ch[0]})),c=e.slice(Sh);if(c.length===0)return a;const l=c.reduce((d,f)=>d+f.count,0);return a.push({key:"other",type:t,count:l,ratio:l/n,color:Ch[Sh]}),a}function d_(e){if(e.length===0)return"conic-gradient(color-mix(in srgb, var(--border-primary) 78%, transparent) 0% 100%)";let t=0;return`conic-gradient(${e.map((s,a)=>{const c=t,l=a===e.length-1?1:Math.min(1,t+s.ratio);return t=l,`${s.color} ${rw(c)} ${rw(l)}`}).join(", ")})`}function DS(e){return{"--workbench-manage-chart-background":d_(e)}}function rw(e){const t=Math.round(e*1e3)/10;return`${t.toFixed(t%1===0?0:1)}%`}const _S="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAbGSURBVHgBzZo/bBtVHMd/ZzuJA0gYCYlsOFO7xRFDy1R3olucqd0SJtiSjiCknBckpjZjBxRn7BR3owOqs5Wp7tZKoDgSQysh4UqUOCG2eZ/3/Oznv/fObqJ+pfPZd+/ufn++vz/vnQN5FwjbGZFGQSRYUb+yIu2c2tSxIOOMqpktqKpzz9X3ioSLNZkRgUwLhA4aW9KWvPqVl6mgldmVGZSJr0BX8Pb2gIVnRUltxbiKxFOgeLJzAYL3I5BQdhaL/sN9EJ5k1dADw+1LQU1tN328kYgaIMWzDSX4s0sUHmSVwZ5JeFqIGjhZgeKpokyzdKGUGQuyWOtA03YCxlNIC98K5X3AhLgYrYB2ndLeE5l0IFvXklK4mpRsxvyuvmqrrSX71aZUjlsyM4LkpuzM7w8dHhqoAxbO+9Fm63pSwhspLTSo1dt6n830bl1SStx9fK6/Z9LmWL3B1hZ/BHUl1+pgYI9S4Eh0EEVjJ5/SwiPI7m9Nuf+02SfUZi4pO+o8ynDcKmlRqRkPlZ43xQ+q8IXpVfdIsu88vJd2ZOSD/OcJKRXmtMW//PlMyi9a0jjvH5NZCDStEDydCjSlfvm9pa/hd24poc+zf/zH8PUjsCT57wOp/FjpqtQ9pakjR+KJo60Fbdnl3dMubSw4vrc2J/msSXLlF4ZCg+M4zzjGEzM39888aAWVFpYlZN+fRnfEE1iMh8JtVygsDWWefTOvhYMiCLX+8L8h4QHnVx+cas/klgLZvpb0eDrp9d/trjr609P6brbhgesPDXXA5kpS7t0ywYwVi4fERD8noJ1WfIDzBDYeRRw8GscL1gP5iCv0g7FsqAIX4UH9pHeegEb44uG5EuKsT3iuPbg9J08252VPxQ3CoowFGYlgRhEMEY2eFzp3CbbEQ3j28BnXjwI0CSvnXQu6lMJrnOd67qOV6fAf2HuuLPn2l4kbRgGT9yf2OU825o11lXDw+bgenb8LV5JdjwE8s/rAxMPXj0xMkGbxBkpWX8epCRp5WvuERNAHl9qADQ+j8xz0QuGDOz3rIizXW8/wHa7bzISSKAveNCQGGoVElPU3coaTcDQKhmoL3QxEkLMna2FplzKAOCFLGf6b4x+nJQbauURnHjsWWJQg8+1nsChCsZGh2LuUwTvb11J94zfVeVtPGOOej4CuNNlJI2xa9BUeQQaD3FKG83iAdItHClcSQ4rzLJvRohGsRCowqoexyCxKbNiUqVPrnf5MhBL0VKRTv6IWZCJnZJR4bujm7eprY+GD2/M6g/hZyypgKENGspThHha2fqxdjZ4sUg8iRz16aYLXBrN5SLPLa5tBMrGCT3T7wD0GgYcM1XwU0IWsXZ80wPY7WMpVguM2g0ABvMDmZhkXZox4w3dswvQV44FFSIe4vqT46rrbzSAEru1pXF6j1L2vTND6Us10p15Zr5Ywq2OTQRwUO0UMyiCM27PYDDKYLomRoy2VNq+n9HGfbGbvyzM9FWgd+4zMfWY4iaV1v6+assHCZNOl7XcKnUC0bUQ9osrq3qnTevgUTtZYUz4ecGEDDwtjaTYER8jsx0YAO5Gxc2EfyyP83lqq27b4Fc6gqhRolEXSe1FDrRBUZioslrYpkD3WthzHSyg0WNCIkVFeoNWw3S7UsQsAHqiobvQTgrgSNbL80gizdmU4EyEswsNzPMQxV3hqiO1oR3kDoyD87tOm57QStKusUNiUcigRXSlZQRchZW2qpc0Sdg5AbQDuw3XboDIQcwGAUm7uh3LWEPvPx88zRiNgWd5OaBr3o+oBrmeaCJhdDeZ7BB83kbETdjZ3bmzryii6eaDCR8c0PzUk/wOdTX7SFU//bEmg5EYoUiOCvv5H5NXbnuDffpHUGYoxLJN892uvarsgXXIPa/14SJTU+pBepXOWVf5W88yFI58VOWqBW9DAYNM3KQMRE0x4gO2JYmLZrtD1ItLTC3ooK2rKasdvzAIVwNp2PfTqpwmdWZY+CswMKzDeYZp579acNgDjodSLv+IK31JvcT4o218jlhYbM78LcJcUR8EG8xSWrynLL7sHZl7cnQQUoYKvLJn0eVwnHTenCVgxSSbwWNwF4cmm+owsbpeLxLqEC+WhoyPHhosl4Y3hewN4Pyw8mNzfhiehxFgzvRgg/IfhuLPRDXr4ljfwe5f/nkxz/m6HDWMR4zWrPBHPFx+zQ7/BX/d5zRrvRfeFU0pbfVcJHvpeMcVfDfAGby8TG/LO0BFc0vftiwtfzPBnD02rvFnZnrrwVUR3wvEFt5heARddZVDE/uXGjRdt4bru4UWODcfT5WmFdvE/Jeqz44iuBr4AAAAASUVORK5CYII=",FS="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAF+0lEQVRYha2XbXBUZxXHf+e5u4SkCZjg0NIWnQLJLgRF5UWnL75MP9gMjqPT2eyC0qlMiYxOUAR206LOyhiSTVscp52O0xamWgu7WTp0qLUz6kht6Qed1L7M5GUTsAoDTRSIJJos2b33+GFfWMJuNqmcT/c595z/+d3nOc+9zxXKWE9Li7tm0fjyqmT6H0t/Fp8sFz9XM+UCauouH8Rx+ifmWWdP7Q0sLRbT98g3lySC/mcSQd+GGwrQt2vzx1G2ZEa6KJ3S1mJxlpOKIDyEmEM3FGCk5vw5YCw3FmFbb9hXfV2gcm/26vINBfhS+LU0qgcKXB9xT1hbr6kdDhtgcYaDxHSNwVBg92Ao0DMY8n97zgAAZnK8U2AoX1D0++rzWfkC44k6wAVghP7C3EQo8Iiijyq61oEDiV2bPjojwKk234pEsPnh/lDgzpyv/olXrwi6qyDsjsQy2ZQXmJdefPWWvp0v3uZ/CLQ9NxZINpxJj84IYDvmOUT2G/T1DD0CUB/pflnhd1eT5Mcnwl90Adi23JzPl9TbAEN7fF9AeapQW5AOicftGQFEOJ+9tEDbB9v8x99r21wLYBlnJ5AGUKhfklz8QEbY3J71nVnZceziUPAbtzvGxAB3wdPH6yPRx6cXvw4gbbm/B5zIO5SvVKjdMxAMrKvviPcpHMyLqvyoN+ybh7AUwIi+M9TaVOGI/SJwc4Fsf6rS2SqgxQBkukPDYTM40RdCZB/Z5gKmEGmzjStq2alBoDqbvF2hEWgF9oEuAvlugdx/Deaz9ZEjvcWKFwXIWaLNv14cDqmwugDvFRVOi8qOrOMdhT6BzQhvoNxzjbjItxo6o8+VqjEjAMBQa1OFXbXwh4KGuLqmDleXToHzwG1FpLs9kah/uvf98IPz08nkSuZbp+vDL4zNCJAHaQt82lH9JfCJ2cQrTFjq8hiZGrfVtQGcDQhrFNYAywELuFw15SwRgN6dvrrahcnkreGXJ0pCtDZVOFULwsCerEBJExhVGAY8FH/Z2cBvPJHY1ySx13cbaXMaqACSwCVRLqlhVNBRVTOm4lxCOSdqPkB0FdA2m5kosGGEHpC3UP2z6uRJb9fx8SwsJEL+nwBNwEKgWqBSoXaORQqtH+VNhDdErJMNnYf/ViqwbBNO3lRbVZFSS9yyIG1jucRuVuGnM6TZZL4d/wS9KEgawIH/gF5EzAWBvzecto9KPG7PqgkBTu0NLHVs7VBlcxnwS8ALgtyp6Kco3S9/OF850lQWYCD41RpMZUiUH5BZmgkRDqmyVaCqeJYeS1dqwJq4UoG56S5w7hb4PMp6YH426LJR1+qSAOrzWYPLZCvIPuAWAIHXxGGXY3geWAV6DOTrJRR+r5q8P9dskNtJ1etBVl4R19FPdh4eLQowEPR5RKxfgebOeGMqGvLMX/V0YrK/W+B+4ATCYZRnEJ5E+Q5gFM4AFwQ+I8hbLks2Ltt/ZKTUg163Rwfamrcj5q/54spvLZes9nZ2/yIx0b8jW/wCLmeLOLoCAEdeAjmYnaWPGXga9Jiia1O28+bAbt8dswJQEFF5IrO2chGVBzxdsY0r2qNnBx5uvkuELkAFedDTHj+nIl4AIzJsjL2XTAOisB+XtqryKLBcLHNyKLSpsSyAgKrKJoRtbksaPV3R5yFz7BaHOOBGOdAQib6SRV4L4KQZqe+I/wvYmZWqE1ue8nbFggjbgDoH/VOxY3vZXdDT0uKuqR37I+jdIH9JV9r3NIbjU717fLe4jPkASDVEYhW5730i2PwqIvdlZkK3eCPdv06E/GuAbmCBJxJbUnIGill13b8fyxRnRG070BiOTwG4MeuyszBSeNiw3KZFYDTzdPLzU7u3LPZEYu+qTq5Tlev+K2YESAQD94rKjqzgl72Pxd/P3VNLsgAyXJizoj161kG3Z4d1aZP6HIC36/i4tyt6dE4AasQNDIhxNnoisXevvZndJcLw9DxvpLsb5XGE9yzD2ZlqzPpVPN0SIf854FaUZz1dsW0fVqdsD5Q05Qhgg7z+oTX+Xyv2pzNX+x+eTlGviPgh3AAAAABJRU5ErkJggg==",OS="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAABzUlEQVR4AeycQQrCQBAEF1+g6J/0o5LPCXmCnnNx0E2nNqGEPciw024VffV0PZ/fHo7BqflBCSgAxd+aAhQAE4DjbYACYAJwvA1QAEwAjrcBCgAIDBRpA2AZClAATACOtwEKgAnA8TZAATABOD7egNc8tz2ftJ+4gPQD9r5fAbDBDQXALx00XgGwGAUoACYAx9sABcAE4HgboACYABxvAxSwJHC7XFryLNP4bzYg7KBar4CKUHiugDDgar0CKkLhuQLCgKv1CqgIhecKCAOu1iugIhSeKyAMuFqvgIpQeK6AMOBq/XAC7o9H6z5fdlRAtp4PJ2BrAHSeAmADClAATACOtwEKgAnA8TZAATABON4GKAAmAMev2AD4JTuNVwAsTgEKgAnA8TZAATABON4GKAAmAMfbAAXABOB4G9ApoPe6AnoJdt5XQCfA3uvDCXhOU0ueXmBr3x9OwNoPHH2fAmBDClAATACOtwEKgAnA8TZAAX8QONAVGwDLVIACYAJwfLwByf/+2WJ32k9cQPoBe9+vANigAhQAE4DjbYACYAJw/A8NgH/pQeMVAItVgAJgAnC8DVAATACOtwEKgAnA8TZAATABON4GFALS4w8AAAD//x7wkLQAAAAGSURBVAMAKj5LkLSa6SQAAAAASUVORK5CYII=",h_=[{provider:"codex"},{provider:"claude-code"},{provider:"opencode"}];function BS({disabled:e=!1,pendingProvider:t=null,onSelect:n}){const s=_r();return i.jsx("div",{className:"session-provider-grid",children:h_.map(a=>{const c=f_(a.provider),l=t===a.provider;return i.jsxs("button",{type:"button",className:"session-provider-card","data-provider":a.provider,"data-pending":l?"true":"false","aria-label":c,disabled:e,onClick:()=>{s.trigger("action"),n(a.provider)},children:[i.jsx("span",{className:"session-provider-card-icon","aria-hidden":"true",children:i.jsx("img",{src:m_(a.provider),alt:"",loading:"lazy"})}),i.jsxs("span",{className:"session-provider-card-copy",children:[i.jsx("strong",{children:c}),l?i.jsx("span",{className:"session-provider-card-status",children:h("shell.startingSession")}):null]})]},a.provider)})})}function f_(e){return h(e==="codex"?"conversation.providerCodex":e==="claude-code"?"shell.providerClaudeCode":"conversation.providerOpenCode")}function m_(e){return e==="codex"?_S:e==="claude-code"?FS:OS}const oc={repositoryUrl:"",parentPath:"",directoryName:"",name:"",authMode:"none",username:"",password:"",token:""};function US({open:e,onClose:t,onCloned:n}){const{showToast:s}=Kn(),[a,c]=v.useState(!1),[l,d]=v.useState(oc),[f,p]=v.useState(!1),[y,g]=v.useState(!1),[b,k]=v.useState(null),[S,C]=v.useState(""),[j,A]=v.useState(""),[L,M]=v.useState(null),[O,q]=v.useState([]),[_,I]=v.useState([]),F=a||y;v.useEffect(()=>{!e&&!a&&(d(oc),p(!1),k(null))},[a,e]);const D=v.useCallback(async pe=>{g(!0),k(null);try{const ne=await Jx(pe);C(ne.currentPath),A(ne.currentPath),M(ne.parentPath),q(ne.roots),I(ne.items),d(z=>({...z,parentPath:ne.currentPath}))}catch(ne){C(""),M(null),I([]),k(ne instanceof Error?ne.message:h("shell.importBrowserBrowseFailed"))}finally{g(!1)}},[]);function P(){a||(p(!1),k(null),d(oc),t())}function K(){p(!0),D(l.parentPath||void 0)}function X(){a||(p(!1),k(null))}async function $(pe){pe.preventDefault(),await D(j)}function ee(){d(pe=>({...pe,parentPath:S})),p(!1),k(null)}async function te(pe){pe.preventDefault();const ne=l.repositoryUrl.trim(),z=l.parentPath.trim();if(!ne){s({title:h("shell.cloneRepoRequired"),tone:"error"});return}if(!z){s({title:h("shell.clonePathRequired"),tone:"error"});return}c(!0);try{const ye=await pT({repositoryUrl:ne,parentPath:z,directoryName:l.directoryName.trim()||void 0,name:l.name.trim()||void 0,auth:l.authMode==="none"?{mode:"none"}:l.authMode==="basic"?{mode:"basic",username:l.username.trim(),password:l.password}:{mode:"token",username:l.username.trim()||void 0,token:l.token}});await(n==null?void 0:n(ye)),d(oc),p(!1),s({title:h("shell.cloneSuccess"),description:ye.path,tone:"success"}),t()}catch(ye){s({title:ye instanceof Error?ye.message:h("shell.cloneFailed"),tone:"error"})}finally{c(!1)}}return i.jsxs(i.Fragment,{children:[i.jsx(Cr,{open:e,title:h("shell.cloneWorkspaceTitle"),description:h("shell.cloneWorkspaceHint"),onClose:P,children:i.jsxs("form",{className:"workbench-clone-form",onSubmit:pe=>void te(pe),children:[i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.cloneRepositoryLabel")}),i.jsx("input",{type:"text",value:l.repositoryUrl,placeholder:h("shell.cloneRepositoryPlaceholder"),onChange:pe=>d(ne=>({...ne,repositoryUrl:pe.target.value}))})]}),i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.cloneParentPathLabel")}),i.jsxs("div",{className:"workbench-modal-inline-field",children:[i.jsx("input",{type:"text",value:l.parentPath,placeholder:h("shell.cloneParentPathPlaceholder"),onChange:pe=>d(ne=>({...ne,parentPath:pe.target.value}))}),i.jsx("button",{type:"button",className:"secondary-button",disabled:a,onClick:K,children:h("shell.clonePickDirectory")})]})]}),i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.cloneDirectoryNameLabel")}),i.jsx("input",{type:"text",value:l.directoryName,placeholder:h("shell.cloneDirectoryNamePlaceholder"),onChange:pe=>d(ne=>({...ne,directoryName:pe.target.value}))})]}),i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.importNameLabel")}),i.jsx("input",{type:"text",value:l.name,placeholder:h("shell.importNamePlaceholder"),onChange:pe=>d(ne=>({...ne,name:pe.target.value}))})]}),i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.cloneAuthModeLabel")}),i.jsxs("select",{value:l.authMode,onChange:pe=>d(ne=>({...ne,authMode:pe.target.value})),children:[i.jsx("option",{value:"none",children:h("shell.cloneAuthModeNone")}),i.jsx("option",{value:"basic",children:h("shell.cloneAuthModeBasic")}),i.jsx("option",{value:"token",children:h("shell.cloneAuthModeToken")})]})]}),l.authMode==="basic"?i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.cloneUsernameLabel")}),i.jsx("input",{type:"text",value:l.username,placeholder:h("shell.cloneUsernamePlaceholder"),autoComplete:"username",onChange:pe=>d(ne=>({...ne,username:pe.target.value}))})]}),i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.clonePasswordLabel")}),i.jsx("input",{type:"password",value:l.password,placeholder:h("shell.clonePasswordPlaceholder"),autoComplete:"current-password",onChange:pe=>d(ne=>({...ne,password:pe.target.value}))})]})]}):null,l.authMode==="token"?i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.cloneUsernameLabel")}),i.jsx("input",{type:"text",value:l.username,placeholder:h("shell.cloneTokenUsernamePlaceholder"),onChange:pe=>d(ne=>({...ne,username:pe.target.value}))})]}),i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.cloneTokenLabel")}),i.jsx("input",{type:"password",value:l.token,placeholder:h("shell.cloneTokenPlaceholder"),onChange:pe=>d(ne=>({...ne,token:pe.target.value}))})]})]}):null,i.jsx("p",{className:"workbench-import-hint",children:h("shell.cloneHint")}),i.jsxs("div",{className:"workbench-modal-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:a,onClick:P,children:h("common.cancel")}),i.jsx("button",{type:"submit",className:"primary-button",disabled:a,children:h(a?"shell.cloneSubmitting":"shell.cloneSubmit")})]})]})}),i.jsxs(Cr,{open:e&&f,title:h("shell.cloneBrowserTitle"),description:h("shell.cloneBrowserDescription"),onClose:X,children:[i.jsxs("form",{className:"workbench-directory-browser-form",onSubmit:$,children:[i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.importBrowserCurrentPath")}),i.jsx("input",{type:"text",value:j,placeholder:h("shell.importPathPlaceholder"),onChange:pe=>A(pe.target.value)})]}),i.jsxs("div",{className:"workbench-directory-browser-toolbar",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:F||!L,onClick:()=>{L&&D(L)},children:h("shell.importBrowserOpenParent")}),i.jsx("button",{type:"submit",className:"secondary-button",disabled:F,children:h("shell.importBrowserOpenPath")})]})]}),i.jsxs("section",{className:"workbench-directory-browser-panel",children:[i.jsxs("div",{className:"workbench-directory-browser-section",children:[i.jsx("span",{className:"workbench-directory-browser-section-title",children:h("shell.importBrowserRoots")}),i.jsx("div",{className:"workbench-directory-browser-root-list",children:O.map(pe=>i.jsx("button",{type:"button",className:"workbench-directory-browser-chip",disabled:F,onClick:()=>{D(pe.path)},children:pe.name},pe.path))})]}),i.jsx("div",{className:"workbench-directory-browser-current-path",children:S}),b?i.jsx("p",{className:"workbench-directory-browser-status status-text","data-tone":"error",children:b}):null,y?i.jsx("p",{className:"workbench-directory-browser-status status-text",children:h("common.loading")}):_.length>0?i.jsx("div",{className:"workbench-directory-browser-list",children:_.map(pe=>i.jsxs("button",{type:"button",className:"workbench-directory-browser-item",disabled:F,onClick:()=>{D(pe.path)},children:[i.jsx("span",{className:"workbench-directory-browser-item-name",children:pe.name}),i.jsx("span",{className:"workbench-directory-browser-item-path",children:pe.path})]},pe.path))}):i.jsx("p",{className:"workbench-directory-browser-status status-text",children:h("shell.importBrowserEmpty")})]}),i.jsxs("div",{className:"workbench-modal-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:a,onClick:X,children:h("common.cancel")}),i.jsx("button",{type:"button",className:"primary-button",disabled:F||!S,onClick:ee,children:h("shell.cloneBrowserSubmit")})]})]})]})}function WS({open:e,onClose:t,onImported:n}){const{showToast:s}=Kn(),[a,c]=v.useState(!1),[l,d]=v.useState(!1),[f,p]=v.useState(!1),[y,g]=v.useState(null),[b,k]=v.useState(""),[S,C]=v.useState(""),[j,A]=v.useState(null),[L,M]=v.useState([]),[O,q]=v.useState([]),[_,I]=v.useState(!1),[F,D]=v.useState(""),P=a||l||f,K=v.useCallback(async z=>{c(!0),g(null);try{const ye=await Jx(z);k(ye.currentPath),C(ye.currentPath),A(ye.parentPath),M(ye.roots),q(ye.items)}catch(ye){k(""),A(null),q([]),g(ye instanceof Error?ye.message:h("shell.importBrowserBrowseFailed"))}finally{c(!1)}},[]);v.useEffect(()=>{if(!e){I(!1),D(""),g(null);return}K(b||void 0)},[K,e]);function X(){P||(I(!1),D(""),t())}async function $(z){z.preventDefault(),await K(S)}function ee(){!b||P||(D(""),I(!0))}function te(){l||(I(!1),D(""))}async function pe(z){z==null||z.preventDefault();const ye=F.trim();if(!(!b||!ye||P)){d(!0),g(null);try{const E=await gT({parentPath:b,directoryName:ye});s({title:h("shell.importBrowserCreateDirectorySuccess"),description:E.path,tone:"success"}),I(!1),D(""),await K(E.path)}catch(E){const W=E instanceof Error?E.message:h("shell.importBrowserCreateDirectoryFailed");g(W),s({title:W,tone:"error"})}finally{d(!1)}}}async function ne(){const z=b.trim();if(!(!z||P)){p(!0),g(null);try{const ye=await mT({path:z});s({title:h("shell.importSuccess"),description:ye.path,tone:"success"}),t(),Promise.resolve().then(()=>n==null?void 0:n(ye)).catch(E=>{s({title:E instanceof Error?E.message:h("shell.navigationLoadFailed"),tone:"error"})})}catch(ye){s({title:ye instanceof Error?ye.message:h("shell.importFailed"),tone:"error"})}finally{p(!1)}}}return i.jsxs(i.Fragment,{children:[i.jsxs(Cr,{open:e,title:h("shell.importBrowserTitle"),description:h("shell.importBrowserDescription"),onClose:X,children:[i.jsxs("form",{className:"workbench-directory-browser-form",onSubmit:$,children:[i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.importBrowserCurrentPath")}),i.jsx("input",{type:"text",value:S,placeholder:h("shell.importPathPlaceholder"),onChange:z=>C(z.target.value)})]}),i.jsxs("div",{className:"workbench-directory-browser-toolbar",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:P||!j,onClick:()=>{j&&K(j)},children:h("shell.importBrowserOpenParent")}),i.jsx("button",{type:"submit",className:"secondary-button",disabled:P,children:h("shell.importBrowserOpenPath")}),i.jsx("button",{type:"button",className:"secondary-button",disabled:P||!b,onClick:ee,children:h("shell.importBrowserCreateDirectory")})]})]}),i.jsxs("section",{className:"workbench-directory-browser-panel",children:[i.jsxs("div",{className:"workbench-directory-browser-section",children:[i.jsx("span",{className:"workbench-directory-browser-section-title",children:h("shell.importBrowserRoots")}),i.jsx("div",{className:"workbench-directory-browser-root-list",children:L.map(z=>i.jsx("button",{type:"button",className:"workbench-directory-browser-chip",disabled:P,onClick:()=>{K(z.path)},children:z.name},z.path))})]}),i.jsx("div",{className:"workbench-directory-browser-current-path",children:b}),y?i.jsx("p",{className:"workbench-directory-browser-status status-text","data-tone":"error",children:y}):null,a?i.jsx("p",{className:"workbench-directory-browser-status status-text",children:h("common.loading")}):O.length>0?i.jsx("div",{className:"workbench-directory-browser-list",children:O.map(z=>i.jsxs("button",{type:"button",className:"workbench-directory-browser-item",disabled:P,onClick:()=>{K(z.path)},children:[i.jsx("span",{className:"workbench-directory-browser-item-name",children:z.name}),i.jsx("span",{className:"workbench-directory-browser-item-path",children:z.path})]},z.path))}):i.jsx("p",{className:"workbench-directory-browser-status status-text",children:h("shell.importBrowserEmpty")})]}),i.jsxs("div",{className:"workbench-modal-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:P,onClick:X,children:h("common.cancel")}),i.jsx("button",{type:"button",className:"primary-button",disabled:P||!b,onClick:()=>{ne()},children:h(f?"shell.importSubmitting":"shell.importBrowserSubmit")})]})]}),i.jsx(Cr,{open:e&&_,title:h("shell.importBrowserCreateDirectoryTitle"),description:h("shell.importBrowserCreateDirectoryDescription"),onClose:te,children:i.jsxs("form",{className:"workbench-rename-form",onSubmit:z=>void pe(z),children:[i.jsx("div",{className:"workbench-directory-browser-current-path",children:b}),i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.importBrowserCreateDirectoryLabel")}),i.jsx("input",{type:"text",value:F,placeholder:h("shell.importBrowserCreateDirectoryPlaceholder"),autoFocus:!0,onChange:z=>D(z.target.value)})]}),i.jsxs("div",{className:"workbench-modal-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:l,onClick:te,children:h("common.cancel")}),i.jsx("button",{type:"submit",className:"primary-button",disabled:l||!F.trim(),children:h(l?"shell.importBrowserCreatingDirectory":"shell.importBrowserCreateDirectorySubmit")})]})]})})]})}const iw="workbench.left.width",sw="workbench.right.width",ow="workbench.left.collapsed",aw="workbench.right.collapsed",jh="workbench.last.session.path",lw="workbench.workspace.collapsed.ids",Nh="workbench.workspace.selected.id",zS="workbench.navigation.snapshot",p_=280,g_=320,ac=208,cw=520,uw=560,y_=200,Ph=20,lc=40,cc=5,v_=1800*1e3,dw=60*1e3,w_="workbench:focus-composer";function hw(e,t){var l,d;const n=["/workspaces/:workspaceId","/workspaces/:workspaceId/sessions","/workspaces/:workspaceId/sessions/:sessionId","/workspaces/:workspaceId/tools","/workspaces/:workspaceId/tools/files","/workspaces/:workspaceId/tools/git","/workspaces/:workspaceId/tools/processes","/workspaces/:workspaceId/terminals"];for(const f of n){const p=En(f,e),y=(l=p==null?void 0:p.params.workspaceId)==null?void 0:l.trim();if(y)return y}const s=ja(e),a=(s==null?void 0:s.sessionId)??null;return!a||!tC(a)?null:((d=new URLSearchParams(t).get("workspaceId"))==null?void 0:d.trim())||null}function b_(e){return e.startsWith("/sessions")||e.startsWith("/terminals")||e.startsWith("/tools")}function x_(e){return e==="mobile"?Gr():"/landing"}function ja(e){var c,l,d;const t=En("/workspaces/:workspaceId/sessions/:sessionId",e),n=(c=t==null?void 0:t.params.sessionId)==null?void 0:c.trim();if(n)return{sessionId:n,workspaceId:((l=t==null?void 0:t.params.workspaceId)==null?void 0:l.trim())??null};const s=En("/sessions/:sessionId",e),a=(d=s==null?void 0:s.params.sessionId)==null?void 0:d.trim();return a?{sessionId:a,workspaceId:null}:null}function k_(e){return!!(En("/sessions",e)||En("/workspaces/:workspaceId/sessions",e))}function fw(e){return!!ja(e)}function S_(e){return!!(En("/tools",e)||En("/tools/files",e)||En("/tools/git",e)||En("/tools/processes",e)||En("/workspaces/:workspaceId/tools",e)||En("/workspaces/:workspaceId/tools/files",e)||En("/workspaces/:workspaceId/tools/git",e)||En("/workspaces/:workspaceId/tools/processes",e))}function mw(e){return!!(En("/terminals",e)||En("/workspaces/:workspaceId/terminals",e))}function C_(e){return e.trim().replace(/\\/g,"/").replace(/^(?:\.\/)+/,"").replace(/^\/+/,"")}const j_=v.lazy(async()=>({default:(await ru(()=>Promise.resolve().then(()=>YU),void 0)).FileContextPanel})),N_=v.lazy(async()=>({default:(await ru(()=>Promise.resolve().then(()=>r4),void 0)).GitSidebar})),P_=v.lazy(async()=>({default:(await ru(()=>Promise.resolve().then(()=>jB),void 0)).TerminalManagerPanel}));function T_(e){return!!(e!=null&&e.session)}function vs(e){return Array.isArray(e==null?void 0:e.children)?e.children:[]}function ha(e){return Array.isArray(e==null?void 0:e.visibleSessionTree)?e.visibleSessionTree.filter(T_):[]}const HS=v.createContext(null);function Yc(e,t){return(t.lastMessageAt??t.updatedAt).localeCompare(e.lastMessageAt??e.updatedAt)}function Sf(e){return e.isSubagent===!0}function fa(e){return e.isArchived===!0}function Cf(e){var t;return((t=e.parentSessionId)==null?void 0:t.trim())||null}function E_(e,t){let n=e;const s=new Set([e.sessionId]);for(;;){const a=Cf(n);if(!a)return n.sessionId;const c=t.get(a);if(!c)return n.sessionId;if(s.has(c.sessionId))return e.sessionId;s.add(c.sessionId),n=c}}function qS(e){const t=new Map(e.map(a=>[a.sessionId,a])),n=new Map,s=[];for(const a of e){const c=E_(a,t);if(c===a.sessionId){s.push(a);continue}const l=n.get(c)??[];n.set(c,[...l,a])}return[...s].sort(Yc).map(a=>({session:a,children:[...n.get(a.sessionId)??[]].sort(Yc)}))}function R_(e){return e.flatMap(t=>[t.session,...vs(t)])}function Th(e,t,n,s=-1){if(e<=0)return 0;const a=s>=0?Math.max(t,s+1):t;return Math.min(e,Math.max(n??0,a))}function pw(e,t){const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every(a=>e[a]===t[a])}function M_(e){const t=e.lastMessageAt??e.updatedAt;return t?new Date(t).toLocaleDateString():""}function A_(e){return Qa(e)||e.syncStatus==="error"}function L_(e){var s,a;if(!A_(e))return null;const t=((s=e.lastErrorCode)==null?void 0:s.trim())??"",n=((a=e.lastErrorDetail)==null?void 0:a.replace(/\s+/g," ").trim())??"";return t&&n&&!n.includes(t)?`${t} · ${n}`:n||t||(e.syncStatus==="error"&&!Qa(e)?h("conversation.syncStatusError"):h("conversation.runtimeErrorTitle"))}function I_(e,t=110){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1)).trimEnd()}…`}function uu(e,t="compact"){return h(e==="codex"?"conversation.providerCodex":e==="claude-code"?t==="full"?"shell.providerClaudeCode":"conversation.providerClaude":e==="opencode"?"conversation.providerOpenCode":t==="full"?"shell.providerClaudeCode":"conversation.providerClaude")}const D_={position:"relative",zIndex:0},__={zIndex:1};function $S(e,t,n){const s=[];n&&s.push(t.name);const a=M_(e);return a&&s.push(a),s.join(" · ")||t.name}function gw(e,t){return Lm("session-state-indicator",e)}function yw(e,t){try{const n=window.localStorage.getItem(e),s=n?Number(n):Number.NaN;return Number.isFinite(s)?s:t}catch{return t}}function vw(e,t){try{const n=window.localStorage.getItem(e);return n===null?t:n==="true"}catch{return t}}function F_(e){try{const t=window.localStorage.getItem(e);if(!t)return[];const n=JSON.parse(t);if(!Array.isArray(n))return[];const s=[];for(const a of n)typeof a=="string"&&!s.includes(a)&&s.push(a);return s}catch{return[]}}function O_(e){var t;try{const n=(t=window.localStorage.getItem(e))==null?void 0:t.trim();return n||null}catch{return null}}function ms(e,t){try{window.localStorage.setItem(e,t)}catch{}}function B_(e){try{window.localStorage.removeItem(e)}catch{}}function uc(e,t,n){return Math.max(t,Math.min(n,e))}function U_(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||!!e.closest("[contenteditable='true']"):!1}function W_(){typeof window>"u"||window.dispatchEvent(new CustomEvent(w_))}function ww(e){return!e||!Array.isArray(e.items)?[]:e.items.map(t=>({workspace:t.workspace,sessions:[...t.sessions].sort(Yc)}))}function z_(){return Mn(zS,v_)}function H_(e,t){let n=!1;const s=e.map(a=>{if(a.workspace.id!==t.workspaceId)return a;const c=a.sessions.findIndex(d=>d.sessionId===t.sessionId),l=c>=0?a.sessions.map((d,f)=>f===c?t:d):[t,...a.sessions];return n=!0,{...a,sessions:[...l].sort(Yc)}});return n?s:e}function q_(e,t,n){let s=!1;const a=e.map(c=>{let l=!1;const d=c.sessions.map(f=>f.sessionId!==t?f:(s=!0,l=!0,{...f,lastSeenAt:f.lastSeenAt&&f.lastSeenAt>n?f.lastSeenAt:n,activityState:f.activityState==="completed_unread"?"idle":f.activityState}));return l?{...c,sessions:d}:c});return s?a:e}function bw(e,t,n){let s=!1;const a=e.map(c=>{let l=!1;const d=c.sessions.map(f=>f.sessionId!==t||f.isArchived===n?f:(s=!0,l=!0,{...f,isArchived:n}));return l?{...c,sessions:d}:c});return s?a:e}function xw(e,t,n){let s=!1;const a=e.map(c=>{let l=!1;const d=c.sessions.map(f=>f.sessionId!==t||f.isFavorite===!0===n?f:(s=!0,l=!0,{...f,isFavorite:n}));return l?{...c,sessions:d}:c});return s?a:e}function jf(e,t){return e.includes(t)?e.filter(n=>n!==t):[...e,t]}function VS(e,t){const n=e.filter(s=>t.has(s));return n.length===e.length?e:n}function Nf(e){return`workspace-management.summary.${e}`}function GS(e){return`git-sidebar.snapshot.${e}`}function KS(e,t){const n=e.repoRoot??null;return{workspaceId:e.id,name:e.name,path:e.path,git:{isRepository:!!n,repoRoot:n,currentBranch:null,commitCount:null,remotes:[],error:null},codeComposition:{scannedFileCount:0,truncated:!1,items:[],error:null}}}function QS(e,t){const n=e.git.repoRoot??t.repoRoot??null;return{...e,workspaceId:t.id,name:t.name,path:t.path,git:{...e.git,isRepository:e.git.isRepository||!!n,repoRoot:n}}}function YS(e,t){var a,c,l;const n=((a=t.status)==null?void 0:a.snapshot.repoRoot)??e.git.repoRoot,s=((c=t.status)==null?void 0:c.snapshot.branch)??((l=t.branches)==null?void 0:l.currentBranch)??e.git.currentBranch??null;return{...e,git:{...e.git,isRepository:e.git.isRepository||!!n,repoRoot:n,currentBranch:s,error:null}}}function XS({count:e,className:t="workbench-skeleton-lines"}){return i.jsx("div",{className:t,"aria-hidden":"true",children:Array.from({length:e},(n,s)=>i.jsx("span",{className:"skeleton-line"},s))})}function $_(){return i.jsx("div",{className:"workbench-nav-loading","aria-hidden":"true",children:Array.from({length:3},(e,t)=>i.jsxs("section",{className:"workbench-skeleton-card",children:[i.jsxs("div",{className:"workbench-skeleton-heading",children:[i.jsx("span",{className:"skeleton-line short"}),i.jsx("span",{className:"skeleton-line tiny"})]}),i.jsx("div",{className:"workbench-skeleton-list",children:Array.from({length:3},(n,s)=>i.jsxs("div",{className:"workbench-skeleton-session",children:[i.jsx("span",{className:"workbench-skeleton-dot"}),i.jsx(XS,{count:2,className:"workbench-skeleton-lines compact"})]},s))})]},t))})}function dc(){return i.jsx("section",{className:"workbench-info-skeleton","aria-hidden":"true",children:Array.from({length:4},(e,t)=>i.jsxs("article",{className:"workbench-info-skeleton-card",children:[i.jsx("span",{className:"skeleton-line short"}),i.jsx(XS,{count:3})]},t))})}function V_({side:e,collapsed:t}){const n=e==="left"?8.5:15.5,s=e==="left"?t?"12 9 15 12 12 15":"15 9 12 12 15 15":t?"12 9 9 12 12 15":"9 9 12 12 9 15";return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),i.jsx("line",{x1:n,y1:"4",x2:n,y2:"20"}),i.jsx("polyline",{points:s})]})}function kw({ariaLabel:e,side:t,collapsed:n,className:s="panel-icon-button",onClick:a}){return i.jsx("button",{className:s,type:"button","aria-label":e,title:e,onClick:a,children:i.jsx(V_,{side:t,collapsed:n})})}function Sw({expanded:e}){return i.jsx("svg",{className:e?"workbench-chevron":"workbench-chevron collapsed",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("polyline",{points:"6 9 12 15 18 9"})})}function G_(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),i.jsx("polyline",{points:"7 10 12 15 17 10"}),i.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function K_(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"}),i.jsx("line",{x1:"8",y1:"10",x2:"16",y2:"10"}),i.jsx("line",{x1:"8",y1:"14",x2:"12",y2:"14"}),i.jsx("circle",{cx:"17.5",cy:"15.5",r:"2.5"})]})}function Q_(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),i.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function Y_(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("circle",{cx:"11",cy:"11",r:"7"}),i.jsx("line",{x1:"20",y1:"20",x2:"16.65",y2:"16.65"})]})}function X_(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",children:i.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function J_(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),i.jsx("path",{d:"M7 9l3 3-3 3"}),i.jsx("path",{d:"M13 15h4"})]})}function JS(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Im(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("polyline",{points:"9 18 15 12 9 6"})})}function ZS(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),i.jsx("line",{x1:"9",y1:"4",x2:"9",y2:"20"}),i.jsx("polyline",{points:"14 9 11 12 14 15"})]})}function Z_(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("circle",{cx:"18",cy:"6",r:"3"}),i.jsx("circle",{cx:"6",cy:"6",r:"3"}),i.jsx("circle",{cx:"18",cy:"18",r:"3"}),i.jsx("path",{d:"M6 9v6a3 3 0 0 0 3 3h3"}),i.jsx("line",{x1:"18",y1:"9",x2:"18",y2:"15"})]})}function eF(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.6 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82L4.21 7.1a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 8.92 4a1.65 1.65 0 0 0 1-1.51V2.4a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9c0 .66.39 1.25 1 1.51h.09a2 2 0 0 1 0 4h-.09c-.61.26-1 .85-1 1.49z"})]})}function tF(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("rect",{x:"4",y:"5",width:"6",height:"6",rx:"1.5"}),i.jsx("rect",{x:"14",y:"5",width:"6",height:"6",rx:"1.5"}),i.jsx("rect",{x:"4",y:"13",width:"6",height:"6",rx:"1.5"}),i.jsx("path",{d:"M14 16l2 2 4-4"})]})}function nF(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("rect",{x:"4",y:"6",width:"10",height:"12",rx:"2"}),i.jsx("path",{d:"M10 12h8"}),i.jsx("path",{d:"M15 8l4 4-4 4"})]})}function rF({selected:e}){return e?i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"4"}),i.jsx("path",{d:"M8 12.5l2.8 2.8L16.5 9.5"})]}):i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"4"})})}function eC({active:e}){return e?i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("polygon",{points:"12 3 15 9 22 10 17 15 18 22 12 18 6 22 7 15 2 10 9 9"})}):i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:i.jsx("polygon",{points:"12 3 15 9 22 10 17 15 18 22 12 18 6 22 7 15 2 10 9 9"})})}function iF(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("path",{d:"M3 7h18"}),i.jsx("path",{d:"M5 7l1 12h12l1-12"}),i.jsx("path",{d:"M9 11h6"}),i.jsx("path",{d:"M8 4h8l1 3H7l1-3z"})]})}function sF(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("path",{d:"M12 20h9"}),i.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 1 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})]})}function oF(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"}),i.jsx("path",{d:"M9 13h6"})]})}function aF(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]})}function lF(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[i.jsx("circle",{cx:"5",cy:"12",r:"1.8"}),i.jsx("circle",{cx:"12",cy:"12",r:"1.8"}),i.jsx("circle",{cx:"19",cy:"12",r:"1.8"})]})}function cF({open:e,mode:t,keyword:n,codeWorkspaceId:s,codeResults:a,codeLoading:c,codeError:l,workspaceOptions:d,sessionResults:f,onClose:p,onModeChange:y,onKeywordChange:g,onCodeWorkspaceChange:b,onCodeSearch:k,onOpenSession:S}){const C=n.trim().length>0&&s.trim().length>0;return i.jsx(Cr,{open:e,title:h("shell.searchModalTitle"),description:h("shell.searchModalDescription"),onClose:p,children:i.jsxs("div",{className:"workbench-search-modal",children:[i.jsxs("div",{className:"workbench-search-mode-switch",role:"tablist","aria-label":h("shell.searchModeLabel"),children:[i.jsx("button",{type:"button",className:t==="sessions"?"workbench-search-mode-button active":"workbench-search-mode-button",role:"tab","aria-selected":t==="sessions",onClick:()=>y("sessions"),children:h("shell.searchModeSessions")}),i.jsx("button",{type:"button",className:t==="code"?"workbench-search-mode-button active":"workbench-search-mode-button",role:"tab","aria-selected":t==="code",onClick:()=>y("code"),children:h("shell.searchModeCode")})]}),t==="sessions"?i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.searchKeywordLabel")}),i.jsx("input",{type:"text",value:n,placeholder:h("shell.searchSessionPlaceholder"),autoFocus:!0,onChange:j=>g(j.target.value)})]}),i.jsx("div",{className:"workbench-search-results",children:n.trim().length===0?i.jsx("p",{className:"workbench-search-empty",children:h("shell.searchSessionHint")}):f.length>0?f.map(j=>{const A=Yi(j.session.title,h("common.unknown"));return i.jsxs("button",{type:"button",className:"workbench-search-result-item",onClick:()=>S(j.session.sessionId),children:[i.jsx("span",{className:"workbench-search-result-title",title:A.fullTitle,children:A.displayTitle}),i.jsxs("span",{className:"workbench-search-result-meta",children:[j.workspace.name," · ",uu(j.session.provider,"full")]})]},j.session.sessionId)}):i.jsx("p",{className:"workbench-search-empty",children:h("shell.searchSessionEmpty")})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.searchWorkspaceLabel")}),i.jsx("select",{value:s,onChange:j=>b(j.target.value),children:d.map(j=>i.jsx("option",{value:j.id,children:j.name},j.id))})]}),i.jsxs("form",{className:"workbench-search-code-form",onSubmit:j=>{j.preventDefault(),k()},children:[i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.searchKeywordLabel")}),i.jsx("input",{type:"text",value:n,placeholder:h("shell.searchCodePlaceholder"),autoFocus:!0,onChange:j=>g(j.target.value)})]}),i.jsx("button",{type:"submit",className:"primary-button",disabled:!C||c,children:h(c?"common.loading":"shell.searchSubmit")})]}),i.jsxs("div",{className:"workbench-search-results",children:[l?i.jsx("p",{className:"status-text","data-tone":"error",children:l}):null,!l&&n.trim().length===0?i.jsx("p",{className:"workbench-search-empty",children:h("shell.searchCodeHint")}):null,!l&&n.trim().length>0&&!c&&a.length===0?i.jsx("p",{className:"workbench-search-empty",children:h("shell.searchCodeEmpty")}):null,a.map(j=>i.jsxs("div",{className:"workbench-search-result-item static",children:[i.jsx("span",{className:"workbench-search-result-title",children:j.name}),i.jsx("span",{className:"workbench-search-result-meta",children:j.path})]},`${j.path}-${j.kind}`))]})]})]})})}function hc({menuKey:e,session:t,workspace:n,isActive:s,isFavorite:a,menuOpen:c,showWorkspaceName:l,depth:d=0,showActions:f=!0,hasSubagents:p=!1,subagentListExpanded:y=!1,selectionMode:g=!1,selected:b=!1,onToggleSelect:k,onToggleSubagents:S,onOpen:C,onRename:j,onToggleMenu:A,onToggleFavorite:L,onArchive:M,onCloseMenu:O,onContextMenu:q}){var pe;const _=((pe=t.subagentLabel)==null?void 0:pe.trim())||(Sf(t)?h("shell.subagentBadge"):null),I=Yi(t.title,h("common.unknown")),F=L_(t),D=F?I_(F):null,P=Qc(t),K=P?AS("session-activity-badge",t):null,X=v.useRef(null),[$,ee]=v.useState(null);v.useLayoutEffect(()=>{if(!c){ee(null);return}const ne=()=>{const z=X.current;if(!z)return;const ye=z.getBoundingClientRect();ee({top:`${ye.bottom}px`,left:`${ye.right}px`})};return ne(),window.addEventListener("resize",ne),window.addEventListener("scroll",ne,!0),()=>{window.removeEventListener("resize",ne),window.removeEventListener("scroll",ne,!0)}},[c]);const te=c&&typeof document<"u"&&$?On.createPortal(i.jsxs("div",{className:"workbench-session-menu","data-menu-key":e,onClick:ne=>ne.stopPropagation(),style:$,children:[i.jsxs("button",{type:"button",className:"workbench-session-menu-item",onClick:()=>{j(),O()},children:[i.jsx(sF,{}),i.jsx("span",{children:h("shell.renameAction")})]}),i.jsxs("button",{type:"button",className:"workbench-session-menu-item",onClick:()=>{L(),O()},children:[i.jsx(eC,{active:a}),i.jsx("span",{children:h(a?"shell.unfavoriteAction":"shell.favoriteAction")})]}),i.jsxs("button",{type:"button",className:"workbench-session-menu-item",onClick:()=>{M(),O()},children:[i.jsx(iF,{}),i.jsx("span",{children:h("shell.archiveAction")})]})]}),document.body):null;return i.jsxs("article",{className:"workbench-session-card","data-active":s,"data-depth":d,"data-subagent":Sf(t),"data-has-subagents":p,"data-selecting":g,"data-selected":b,onContextMenu:ne=>{g||!q||(ne.preventDefault(),q())},children:[i.jsxs("div",{className:"workbench-session-main",children:[g?i.jsx("span",{className:"workbench-session-selection-indicator","data-selected":b,"aria-hidden":"true",children:i.jsx(rF,{selected:b})}):p?i.jsxs("button",{type:"button",className:"workbench-session-subagent-toggle",style:__,"aria-label":h(y?"shell.subagentCollapse":"shell.subagentExpand"),title:h(y?"shell.subagentCollapse":"shell.subagentExpand"),"aria-expanded":y,onClick:ne=>{ne.stopPropagation(),S==null||S()},children:[i.jsx("span",{className:gw(t),"data-activity-source":t.activitySource,"aria-hidden":"true"}),i.jsx("span",{className:"workbench-session-subagent-toggle-icon","aria-hidden":"true",children:y?i.jsx(aF,{}):i.jsx(Im,{})})]}):i.jsx("span",{className:gw(t),"data-activity-source":t.activitySource,"aria-hidden":"true"}),i.jsx("button",{type:"button",className:"workbench-session-link",style:p?D_:void 0,"data-active":s,"aria-pressed":g?b:void 0,onClick:g?k:C,children:i.jsxs("div",{className:"workbench-session-link-copy",children:[i.jsxs("div",{className:"session-title-row",children:[i.jsx("span",{className:"session-title",title:I.fullTitle,children:I.displayTitle}),_?i.jsx("span",{className:"session-subagent-badge",children:_}):null]}),i.jsxs("div",{className:"session-meta-row",children:[i.jsx("span",{className:"session-meta",children:$S(t,n,l)}),P&&K?i.jsx("span",{className:K,children:P}):null,i.jsx("span",{className:`session-provider-badge ${t.provider}`,children:uu(t.provider)})]}),D?i.jsx("div",{className:"session-error-row",title:F??void 0,children:i.jsx("span",{className:"session-error-text",children:D})}):null]})})]}),f&&!g?i.jsx("div",{className:"workbench-session-actions","data-open":c,children:i.jsx("button",{ref:X,type:"button",className:"workbench-session-menu-trigger","data-open":c,"aria-label":h("shell.sessionMoreAction"),title:h("shell.sessionMoreAction"),"aria-expanded":c,onClick:ne=>{ne.stopPropagation(),A()},children:i.jsx(lF,{})})}):null,te]})}function Cw({workspaceGroups:e,favoriteSessions:t,favoriteSessionIds:n,activeWorkspaceId:s,isConversationActive:a,isTerminalActive:c,isSearchOpen:l,navigationLoading:d,navigationError:f,activeSessionId:p,onRefreshNavigation:y,onSessionUpdated:g,onNavigateConversation:b,onNavigateTerminals:k,onOpenSearch:S,onOpenSettings:C,onSelectWorkspace:j,onToggleWorkspaceCollapse:A,subscribeGitSnapshot:L,requestGitRefresh:M,subscribeWorkspaceManagementSnapshot:O,requestWorkspaceManagementRefresh:q,onToggleFavoriteSession:_,onArchiveSession:I,onUnarchiveSession:F,workspaceManagementStateById:D,setWorkspaceManagementStateById:P,onClose:K,onToggleCollapse:X}){var Ln;const $=Wn(),ee=An(),{showToast:te}=Kn(),pe=v.useCallback(Y=>{!ee.isDesktop||ee.ui.osFamily!=="macos"||Y.button!==0||Mm(Y.target)&&Am()},[ee.isDesktop,ee.ui.osFamily]),[ne,z]=v.useState(!1),[ye,E]=v.useState(!1),[W,re]=v.useState(!1),[T,ae]=v.useState([]),[Le,je]=v.useState(null),[He,qe]=v.useState(null),[et,ot]=v.useState(null),[bt,Ct]=v.useState(null),[lt,kt]=v.useState(null),[Ve,Tt]=v.useState(null),[Ot,St]=v.useState(null),[Mt,Ht]=v.useState(Ph),[At,vt]=v.useState({}),[$t,Dt]=v.useState({}),[Lt,ue]=v.useState([]),[ge,Be]=v.useState(null),[Pe,ft]=v.useState(""),[dt,Rt]=v.useState(null),[ht,Nt]=v.useState(null),[jt,V]=v.useState([]),[Me,ze]=v.useState(!1),wt=((Ln=e.find(Y=>Y.workspace.id===lt))==null?void 0:Ln.workspace)??null,Bt=e.find(Y=>Y.workspace.id===Ve)??null,Zt=e.find(Y=>Y.workspace.id===ht)??null,Vt=v.useMemo(()=>Zt?R_(ha(Zt)):[],[Zt]),ke=v.useMemo(()=>Vt.map(Y=>Y.sessionId),[Vt]),Qe=v.useMemo(()=>new Set(ke),[ke]),cn=v.useMemo(()=>new Set(jt),[jt]),yn=ke.length>0&&jt.length===ke.length;v.useEffect(()=>{P(Y=>{const xe=new Set(e.map(ve=>ve.workspace.id)),R={};Object.entries(Y).forEach(([ve,it])=>{xe.has(ve)&&(R[ve]=it)}),e.forEach(ve=>{const it=Mn(Nf(ve.workspace.id),dw),ut=Mn(GS(ve.workspace.id),dw),zt=R[ve.workspace.id];let Xt=QS((zt==null?void 0:zt.detail)??it??KS(ve.workspace),ve.workspace);(ut!=null&&ut.status||ut!=null&&ut.branches)&&(Xt=YS(Xt,{workspaceId:ve.workspace.id,status:ut.status??null,branches:ut.branches??null})),R[ve.workspace.id]={detail:Xt,loading:!1,error:null}});const de=Object.keys(Y),he=Object.keys(R);return de.length===he.length&&he.every(ve=>Y[ve]===R[ve])?Y:R})},[e]);const un=v.useCallback(async Y=>{await y(),await ee.bridge.showNotification(h("shell.importSuccess"),Y.path)},[y,ee.bridge]),on=v.useCallback(async Y=>{await y(),await ee.bridge.showNotification(h("shell.cloneSuccess"),Y.path)},[y,ee.bridge]);function wn(Y){if(T.includes(Y)){ae(R=>R.filter(de=>de!==Y));return}ae(R=>[...R,Y]),L(Y),M(Y),O(Y),q(Y)}async function xn(){if(!(!Le||He)){qe(Le.id);try{await Xx(Le.id),ae(Y=>Y.filter(xe=>xe!==Le.id)),P(Y=>{const xe={...Y};return delete xe[Le.id],xe}),je(null),await y(),te({title:h("shell.manageWorkspaceRemoveSuccess"),tone:"success"})}catch(Y){te({title:Y instanceof Error?Y.message:h("shell.manageWorkspaceRemoveFailed"),tone:"error"})}finally{qe(null)}}}v.useEffect(()=>{if(!Ot)return;function Y(xe){const R=xe.target;R instanceof HTMLElement&&(R.closest(".workbench-session-actions")||R.closest(".workbench-session-menu"))||St(null)}return window.addEventListener("pointerdown",Y),()=>{window.removeEventListener("pointerdown",Y)}},[Ot]),v.useEffect(()=>{if(!ht){jt.length>0&&V([]);return}if(!Zt){Nt(null),V([]);return}V(Y=>VS(Y,Qe))},[Zt,Qe,ht,jt.length]),v.useEffect(()=>{ht&&ke.length===0&&(Nt(null),V([]))},[ke.length,ht]),v.useEffect(()=>{const Y=new Set(e.map(xe=>xe.workspace.id));ae(xe=>xe.filter(R=>Y.has(R))),je(xe=>xe&&Y.has(xe.id)?xe:null)},[e]),v.useEffect(()=>{const Y=t.findIndex(xe=>xe.session.sessionId===p);Ht(xe=>{const R=Th(t.length,Ph,xe,Y);return R===xe?xe:R})},[p,t]),v.useEffect(()=>{vt(Y=>{const xe={};for(const R of e){const de=ha(R),he=de.findIndex(ve=>ve.session.sessionId===p||vs(ve).some(it=>it.sessionId===p));xe[R.workspace.id]=Th(de.length,lc,Y[R.workspace.id],he)}return pw(Y,xe)?Y:xe})},[p,e]),v.useEffect(()=>{Dt(Y=>{const xe={};for(const R of e)for(const de of ha(R)){const he=vs(de);if(he.length===0)continue;const ve=he.findIndex(it=>it.sessionId===p);xe[de.session.sessionId]=Th(he.length,cc,Y[de.session.sessionId],ve)}return pw(Y,xe)?Y:xe})},[p,e]),v.useEffect(()=>{if(!p)return;const Y=e.flatMap(xe=>ha(xe).filter(R=>vs(R).some(de=>de.sessionId===p)).map(R=>R.session.sessionId));Y.length!==0&&ue(xe=>{const R=new Set(xe);let de=!1;for(const he of Y)R.has(he)||(R.add(he),de=!0);return de?Array.from(R):xe})},[p,e]);function H(){z(!0)}function Z(){E(!0)}function ie(Y){return $t[Y]??cc}function we(Y){return Lt.includes(Y)}function Te(Y){return At[Y]??lc}function Ae(){Ht(Y=>Math.min(t.length,Y+Ph))}function $e(Y,xe){vt(R=>({...R,[Y]:Math.min(xe,(R[Y]??lc)+lc)}))}function Ie(Y){Dt(xe=>({...xe,[Y]:(xe[Y]??cc)+cc}))}function Ue(Y){ue(xe=>xe.includes(Y)?xe.filter(R=>R!==Y):[...xe,Y])}function Fe(Y){for(const xe of e){const R=qS(xe.visibleSessions).find(de=>de.session.sessionId===Y);if(R)return vs(R)}return[]}function Oe(Y){St(null),Nt(Y),V([])}function ct(){Nt(null),V([])}function rt(Y){V(xe=>jf(xe,Y))}function Ut(){V(Y=>Y.length===ke.length?[]:ke)}async function Pt(Y,xe){ot(Y),Ct(xe);try{kt(null),$(pS(Y,xe)),K==null||K()}catch(R){te({title:R instanceof Error?R.message:h("shell.startSessionFailed"),tone:"error"})}finally{ot(null),Ct(null)}}async function We(Y){const xe=n.has(Y);St(null);try{await _(Y),te({title:h(xe?"shell.favoriteRemoved":"shell.favoriteAdded"),tone:"success"})}catch(R){te({title:R instanceof Error?R.message:h("shell.favoriteToggleFailed"),tone:"error"})}}async function se(Y){St(null);try{await I(Y),te({title:h("shell.archiveAdded"),tone:"success"})}catch(xe){te({title:xe instanceof Error?xe.message:h("shell.navigationLoadFailed"),tone:"error"})}}async function Ce(){if(!(jt.length===0||Me)){St(null),ze(!0);try{const Y=[...jt],xe=await Promise.allSettled(Y.map(async he=>({sessionId:he,session:await ek(he,!0)}))),R=[];let de=0;for(const he of xe){if(he.status==="fulfilled"){R.push(he.value.sessionId),g(he.value.session);continue}de+=1}R.length>0&&(await y(),V(he=>he.filter(ve=>!R.includes(ve)))),de>0?te({title:R.length>0?h("shell.batchArchivePartialFailed"):h("shell.batchArchiveFailed"),tone:"error"}):te({title:h("shell.batchArchiveSuccess"),tone:"success"})}catch(Y){te({title:Y instanceof Error?Y.message:h("shell.batchArchiveFailed"),tone:"error"})}finally{ze(!1)}}}async function B(Y){St(null);try{await F(Y),te({title:h("shell.archiveRestored"),tone:"success"})}catch(xe){te({title:xe instanceof Error?xe.message:h("shell.navigationLoadFailed"),tone:"error"})}}function le(Y,xe){St(null),Be({session:Y,workspace:xe}),ft(Y.title)}async function Se(Y){if(Y.preventDefault(),!ge)return;const xe=Pe.trim();if(xe){Rt(ge.session.sessionId);try{const R=await Zx(ge.session.sessionId,xe);g(R),Be(null),ft(""),te({title:h("shell.renameSuccess"),tone:"success"})}catch(R){te({title:R instanceof Error?R.message:h("shell.renameFailed"),tone:"error"})}finally{Rt(null)}}}async function Ye(Y){if(!ee.isDesktop)return;const xe=n.has(Y.session.sessionId);await e_([{id:`open-${Y.session.sessionId}`,label:h("shell.contextOpenSession"),onSelect:()=>{$(er(Y.workspace.id,Y.session.sessionId)),K==null||K()}},{id:`rename-${Y.session.sessionId}`,label:h("shell.renameAction"),onSelect:()=>le(Y.session,Y.workspace)},{id:`favorite-${Y.session.sessionId}`,label:h(xe?"shell.unfavoriteAction":"shell.favoriteAction"),onSelect:()=>We(Y.session.sessionId)},{id:`archive-${Y.session.sessionId}`,label:h("shell.archiveAction"),onSelect:()=>{se(Y.session.sessionId)}}])}const tt=t.slice(0,Mt),nn=tt.length<t.length;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"workbench-nav-header","data-window-drag-handle":"workbench-nav-header",onMouseDownCapture:pe,children:i.jsxs("div",{className:"workbench-nav-toolbar",children:[X?i.jsx("button",{type:"button",className:"workbench-nav-toolbar-button","aria-label":h("shell.hideSessionSidebar"),title:h("shell.hideSessionSidebar"),onClick:X,children:i.jsx(ZS,{})}):null,i.jsx("button",{type:"button",className:"workbench-nav-toolbar-button","aria-label":h("shell.goBack"),title:h("shell.goBack"),onClick:()=>$(-1),children:i.jsx(JS,{})}),i.jsx("button",{type:"button",className:"workbench-nav-toolbar-button","aria-label":h("shell.goForward"),title:h("shell.goForward"),onClick:()=>$(1),children:i.jsx(Im,{})})]})}),i.jsxs("div",{className:"workbench-nav-body",children:[i.jsxs("div",{className:"workbench-nav-segment",role:"tablist","aria-label":h("shell.centerTabsLabel"),children:[i.jsxs("button",{type:"button",className:a?"workbench-nav-segment-button active":"workbench-nav-segment-button",role:"tab","aria-selected":a,onClick:b,children:[i.jsx(X_,{}),h("shell.conversationEntry")]}),i.jsxs("button",{type:"button",className:c?"workbench-nav-segment-button active":"workbench-nav-segment-button",role:"tab","aria-selected":c,onClick:k,children:[i.jsx(J_,{}),h("shell.terminalsEntry")]}),i.jsxs("button",{type:"button",className:"workbench-nav-segment-button","data-open":l,"aria-haspopup":"dialog","aria-expanded":l,onClick:S,children:[i.jsx(Y_,{}),i.jsx("span",{children:h("shell.searchEntry")})]})]}),f?i.jsx("div",{className:"workbench-status-row",children:i.jsx("p",{className:"status-text","data-tone":"error",children:f})}):null,t.length>0?i.jsxs("section",{className:"workbench-section-block",children:[i.jsxs("div",{className:"workbench-section-heading",children:[i.jsxs("div",{className:"workbench-section-heading-main",children:[i.jsx(eC,{active:!0}),i.jsx("span",{children:h("shell.favoriteSectionTitle")})]}),i.jsx("span",{className:"workbench-section-counter",children:t.length})]}),i.jsxs("div",{className:"workbench-session-list",children:[tt.map(Y=>{const xe=Fe(Y.session.sessionId),R=we(Y.session.sessionId),de=R?xe.slice(0,ie(Y.session.sessionId)):[],he=R&&de.length<xe.length;return i.jsxs("div",{className:"workbench-session-tree-node",children:[i.jsx(hc,{menuKey:`favorite:${Y.session.sessionId}`,session:Y.session,workspace:Y.workspace,isActive:Y.session.sessionId===p,isFavorite:n.has(Y.session.sessionId),menuOpen:Ot===`favorite:${Y.session.sessionId}`,showWorkspaceName:!0,hasSubagents:xe.length>0,subagentListExpanded:R,onToggleSubagents:()=>Ue(Y.session.sessionId),onOpen:()=>{$(er(Y.workspace.id,Y.session.sessionId)),K==null||K()},onRename:()=>le(Y.session,Y.workspace),onToggleMenu:()=>St(ve=>ve===`favorite:${Y.session.sessionId}`?null:`favorite:${Y.session.sessionId}`),onToggleFavorite:()=>We(Y.session.sessionId),onArchive:()=>se(Y.session.sessionId),onCloseMenu:()=>St(null),onContextMenu:ee.isDesktop?()=>{Ye(Y)}:void 0}),xe.length>0&&R?i.jsxs("div",{className:"workbench-subsession-list",children:[de.map(ve=>i.jsx(hc,{menuKey:`favorite:${ve.sessionId}`,session:ve,workspace:Y.workspace,isActive:ve.sessionId===p,isFavorite:!1,menuOpen:!1,showWorkspaceName:!0,depth:1,showActions:!1,onOpen:()=>{$(er(Y.workspace.id,ve.sessionId)),K==null||K()},onRename:()=>{},onToggleMenu:()=>{},onToggleFavorite:()=>{},onArchive:()=>{},onCloseMenu:()=>{},onContextMenu:ee.isDesktop?()=>{Ye({session:ve,workspace:Y.workspace})}:void 0},ve.sessionId)),he?i.jsx("button",{type:"button",className:"workbench-subsession-expand ghost-button",onClick:()=>Ie(Y.session.sessionId),children:h("shell.subagentExpandMore")}):null]}):null]},Y.session.sessionId)}),nn?i.jsx("button",{type:"button",className:"workbench-subsession-expand ghost-button",onClick:Ae,children:h("shell.favoriteExpandMore")}):null]})]}):null,d&&e.length===0?i.jsx($_,{}):null,!d&&!f&&e.length===0?i.jsx("div",{className:"workbench-empty-state minimal",children:i.jsx("p",{children:h("shell.emptyNavigationBody")})}):null,i.jsxs("section",{className:"workbench-section-block workbench-workspace-section",children:[i.jsxs("div",{className:"workbench-section-heading",children:[i.jsx("div",{className:"workbench-section-heading-main",children:i.jsx("span",{children:h("shell.workspaceSectionTitle")})}),i.jsxs("div",{className:"workbench-section-actions",children:[i.jsx("button",{type:"button",className:"workbench-workspace-icon-button","aria-label":h("shell.manageWorkspaceAction"),title:h("shell.manageWorkspaceAction"),onClick:()=>re(!0),children:i.jsx(K_,{})}),i.jsx("button",{type:"button",className:"workbench-workspace-icon-button","aria-label":h("shell.importWorkspaceTitle"),title:h("shell.importWorkspaceTitle"),onClick:H,children:i.jsx(G_,{})}),i.jsx("button",{type:"button",className:"workbench-workspace-icon-button","aria-label":h("shell.cloneWorkspaceTitle"),title:h("shell.cloneWorkspaceTitle"),onClick:Z,children:i.jsx(Z_,{})})]})]}),e.map(Y=>{const xe=ha(Y);return i.jsxs("section",{className:"workbench-workspace-group","data-batch-active":ht===Y.workspace.id,children:[i.jsxs("div",{className:"workbench-workspace-header minimal",children:[i.jsxs("button",{type:"button",className:"workbench-workspace-toggle","aria-label":Y.isCollapsed?h("shell.workspaceExpand"):h("shell.workspaceCollapse"),onClick:()=>A(Y.workspace.id),children:[i.jsx(Sw,{expanded:!Y.isCollapsed}),i.jsx("strong",{children:Y.workspace.name})]}),ht===Y.workspace.id?i.jsxs("div",{className:"workbench-workspace-batch-toolbar",children:[i.jsx("span",{className:"workbench-workspace-batch-label",children:h("shell.batchSelectionMode")}),i.jsxs("span",{className:"workbench-workspace-batch-counter",children:[jt.length,"/",ke.length]}),i.jsx("button",{type:"button",className:"workbench-workspace-batch-action",onClick:Ut,children:h(yn?"shell.clearSelectedSessions":"shell.selectAllSessions")}),i.jsx("button",{type:"button",className:"workbench-workspace-batch-action primary",disabled:jt.length===0||Me,onClick:()=>{Ce()},children:h(Me?"shell.batchArchiving":"shell.batchArchiveAction")}),i.jsx("button",{type:"button",className:"workbench-workspace-batch-action",onClick:ct,children:h("common.cancel")})]}):i.jsxs("div",{className:"workbench-workspace-actions",children:[i.jsx("button",{type:"button",className:"workbench-workspace-icon-button","aria-label":h("shell.switchWorkspace"),title:h("shell.switchWorkspace"),"aria-pressed":s===Y.workspace.id,onClick:()=>{j(Y.workspace.id),K==null||K()},children:i.jsx(nF,{})}),i.jsx("button",{type:"button",className:"workbench-workspace-icon-button","aria-label":h("shell.batchSelectSessions"),title:h("shell.batchSelectSessions"),onClick:()=>Oe(Y.workspace.id),children:i.jsx(tF,{})}),i.jsx("button",{type:"button",className:"workbench-workspace-icon-button workbench-workspace-create","aria-label":h("shell.createSession"),title:h("shell.createSession"),onClick:()=>kt(Y.workspace.id),children:i.jsx(Q_,{})})]})]}),Y.isCollapsed?null:i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"workbench-session-list",children:[xe.length===0?i.jsx("p",{className:"workbench-session-empty",children:h("shell.emptyWorkspaceSessions")}):xe.slice(0,Te(Y.workspace.id)).map(R=>{const de=vs(R),he=we(R.session.sessionId),ve=he?de.slice(0,ie(R.session.sessionId)):[],it=he&&ve.length<de.length;return i.jsxs("div",{className:"workbench-session-tree-node",children:[i.jsx(hc,{menuKey:`workspace:${Y.workspace.id}:${R.session.sessionId}`,session:R.session,workspace:Y.workspace,isActive:R.session.sessionId===p,isFavorite:n.has(R.session.sessionId),menuOpen:Ot===`workspace:${Y.workspace.id}:${R.session.sessionId}`,showWorkspaceName:!1,hasSubagents:de.length>0,subagentListExpanded:he,selectionMode:ht===Y.workspace.id,selected:cn.has(R.session.sessionId),onToggleSelect:()=>rt(R.session.sessionId),onToggleSubagents:()=>Ue(R.session.sessionId),onOpen:()=>{$(er(Y.workspace.id,R.session.sessionId)),K==null||K()},onRename:()=>le(R.session,Y.workspace),onToggleMenu:()=>St(ut=>ut===`workspace:${Y.workspace.id}:${R.session.sessionId}`?null:`workspace:${Y.workspace.id}:${R.session.sessionId}`),onToggleFavorite:()=>We(R.session.sessionId),onArchive:()=>se(R.session.sessionId),onCloseMenu:()=>St(null),onContextMenu:ee.isDesktop?()=>{Ye({session:R.session,workspace:Y.workspace})}:void 0}),de.length>0&&he?i.jsxs("div",{className:"workbench-subsession-list",children:[ve.map(ut=>i.jsx(hc,{menuKey:`workspace:${Y.workspace.id}:${ut.sessionId}`,session:ut,workspace:Y.workspace,isActive:ut.sessionId===p,isFavorite:!1,menuOpen:!1,showWorkspaceName:!1,depth:1,showActions:!1,selectionMode:ht===Y.workspace.id,selected:cn.has(ut.sessionId),onToggleSelect:()=>rt(ut.sessionId),onOpen:()=>{$(er(Y.workspace.id,ut.sessionId)),K==null||K()},onRename:()=>{},onToggleMenu:()=>{},onToggleFavorite:()=>{},onArchive:()=>{},onCloseMenu:()=>{},onContextMenu:ee.isDesktop?()=>{Ye({session:ut,workspace:Y.workspace})}:void 0},ut.sessionId)),it?i.jsx("button",{type:"button",className:"workbench-subsession-expand ghost-button",onClick:()=>Ie(R.session.sessionId),children:h("shell.subagentExpandMore")}):null]}):null]},R.session.sessionId)}),xe.length>Te(Y.workspace.id)?i.jsx("button",{type:"button",className:"workbench-subsession-expand ghost-button",onClick:()=>$e(Y.workspace.id,xe.length),children:h("shell.sessionExpandMore")}):null]}),i.jsxs("button",{type:"button",className:"workbench-archive-folder",onClick:()=>Tt(Y.workspace.id),children:[i.jsxs("span",{className:"workbench-archive-folder-main",children:[i.jsx(oF,{}),i.jsx("span",{children:h("shell.archiveFolderLabel")})]}),i.jsx("span",{className:"workbench-section-counter",children:Y.archivedSessions.length})]})]})]},Y.workspace.id)})]})]}),i.jsx("div",{className:"workbench-nav-footer minimal",children:i.jsxs("button",{className:"settings-entry-button workbench-nav-settings-button",type:"button",onClick:C,title:h("settings.title"),children:[i.jsx(eF,{}),i.jsx("span",{className:"settings-entry-label",children:h("settings.title")})]})}),i.jsx(Cr,{open:W,title:h("shell.manageWorkspaceTitle"),description:h("shell.manageWorkspaceDescription"),onClose:()=>{He||re(!1)},children:e.length>0?i.jsx("div",{className:"workbench-manage-list",children:e.map(Y=>{var zt;const xe=T.includes(Y.workspace.id),R=D[Y.workspace.id]??{detail:null,loading:!1,error:null},de=He===Y.workspace.id,he=(zt=R.detail)!=null&&zt.git.remotes.length?R.detail.git.remotes.map(Xt=>`${Xt.name}: ${Xt.url}`).join(" · "):h("shell.manageWorkspaceNoRemote"),ve=Y.visibleSessions.length+Y.archivedSessions.length,it=R.detail?IS(R.detail.codeComposition.items,h("shell.manageWorkspaceCodeCompositionOther")):[],ut=it.length>0?DS(it):void 0;return i.jsxs("article",{className:"workbench-manage-item",children:[i.jsxs("button",{type:"button",className:"workbench-manage-item-toggle","aria-expanded":xe,onClick:()=>wn(Y.workspace.id),children:[i.jsxs("span",{className:"workbench-manage-item-heading",children:[i.jsx(Sw,{expanded:xe}),i.jsx("strong",{children:Y.workspace.name})]}),i.jsx("span",{className:"workbench-section-counter",children:ve})]}),xe?i.jsxs("div",{className:"workbench-manage-item-body",children:[i.jsxs("div",{className:"workbench-manage-detail-block",children:[i.jsx("span",{className:"workbench-manage-detail-label",children:h("shell.manageWorkspacePathLabel")}),i.jsx("p",{className:"workbench-manage-detail-value",children:Y.workspace.path})]}),R.loading&&R.detail===null?i.jsx("p",{className:"workbench-manage-status status-text",children:h("shell.manageWorkspaceLoading")}):null,R.error?i.jsx("p",{className:"workbench-manage-status status-text","data-tone":"error",children:R.error}):null,R.detail?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"workbench-manage-detail-block",children:i.jsxs("div",{className:"workbench-manage-detail-header",children:[i.jsx("span",{className:"workbench-manage-detail-label",children:h("shell.manageWorkspaceGitCommitCount")}),i.jsx("strong",{className:"workbench-manage-detail-accent",children:R.detail.git.commitCount??"--"})]})}),i.jsxs("div",{className:"workbench-manage-detail-block",children:[i.jsx("span",{className:"workbench-manage-detail-label",children:h("shell.manageWorkspaceGitInfoLabel")}),R.detail.git.isRepository?i.jsxs("div",{className:"workbench-manage-kv-list",children:[i.jsxs("div",{className:"workbench-manage-kv-item",children:[i.jsx("span",{children:h("shell.manageWorkspaceRepoRoot")}),i.jsx("span",{children:R.detail.git.repoRoot??"--"})]}),i.jsxs("div",{className:"workbench-manage-kv-item",children:[i.jsx("span",{children:h("shell.manageWorkspaceCurrentBranch")}),i.jsx("span",{children:R.detail.git.currentBranch??"--"})]}),i.jsxs("div",{className:"workbench-manage-kv-item",children:[i.jsx("span",{children:h("shell.manageWorkspaceRemoteLabel")}),i.jsx("span",{children:he})]})]}):i.jsx("p",{className:"workbench-section-empty",children:R.detail.git.error??h("shell.manageWorkspaceNotGit")})]}),i.jsxs("div",{className:"workbench-manage-detail-block",children:[i.jsx("span",{className:"workbench-manage-detail-label",children:h("shell.manageWorkspaceCodeCompositionLabel")}),it.length>0?i.jsxs("div",{className:"workbench-manage-type-chart",children:[i.jsxs("div",{className:"workbench-manage-type-chart-ring",style:ut,"aria-hidden":"true",children:[i.jsx("strong",{className:"workbench-manage-type-chart-total",children:R.detail.codeComposition.scannedFileCount}),i.jsx("span",{className:"workbench-manage-type-chart-caption",children:h("shell.manageWorkspaceCodeCompositionFiles")})]}),i.jsx("div",{className:"workbench-manage-type-list",children:it.map(Xt=>i.jsxs("div",{className:"workbench-manage-type-item",children:[i.jsxs("span",{className:"workbench-manage-type-meta",children:[i.jsx("span",{className:"workbench-manage-type-swatch",style:{backgroundColor:Xt.color},"aria-hidden":"true"}),i.jsx("span",{className:"workbench-manage-type-name",children:Xt.type})]}),i.jsxs("span",{children:[Xt.count," · ",LS(Xt)]})]},Xt.key))})]}):i.jsx("p",{className:"workbench-section-empty",children:R.detail.codeComposition.error??h("shell.manageWorkspaceNoCodeComposition")}),R.detail.codeComposition.truncated?i.jsx("p",{className:"workbench-manage-hint",children:h("shell.manageWorkspaceCodeTruncated",{count:R.detail.codeComposition.scannedFileCount})}):null]})]}):null,i.jsx("div",{className:"workbench-modal-actions",children:i.jsx("button",{type:"button",className:"secondary-button workbench-danger-button",disabled:!!He,onClick:()=>je(Y.workspace),children:h(de?"shell.manageWorkspaceRemoving":"shell.manageWorkspaceRemoveAction")})})]}):null]},Y.workspace.id)})}):i.jsx("p",{className:"workbench-section-empty",children:h("shell.manageWorkspaceEmpty")})}),i.jsxs(Cr,{open:Le!==null,title:h("shell.manageWorkspaceRemoveConfirmTitle"),description:h("shell.manageWorkspaceRemoveConfirmDescription"),onClose:()=>{He||je(null)},children:[i.jsx("p",{className:"workbench-section-empty",children:Le?h("shell.manageWorkspaceRemoveConfirmTarget",{name:Le.name}):""}),i.jsxs("div",{className:"workbench-modal-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:!!He,onClick:()=>je(null),children:h("common.cancel")}),i.jsx("button",{type:"button",className:"secondary-button workbench-danger-button",disabled:!!He,onClick:()=>{xn()},children:h(He?"shell.manageWorkspaceRemoving":"shell.manageWorkspaceRemoveConfirmAction")})]})]}),i.jsx(US,{open:ye,onClose:()=>E(!1),onCloned:on}),i.jsx(WS,{open:ne,onClose:()=>z(!1),onImported:un}),i.jsx(Cr,{open:wt!==null,title:h("shell.createSessionModalTitle"),className:"workbench-create-session-modal",description:wt?`${h("shell.createSessionTarget")} · ${wt.name}`:h("shell.createSessionModalDescription"),onClose:()=>kt(null),children:i.jsx(BS,{disabled:!!et,pendingProvider:et===(wt==null?void 0:wt.id)?bt??null:null,onSelect:Y=>{wt&&Pt(wt.id,Y)}})}),i.jsx(Cr,{open:Bt!==null,title:h("shell.archiveModalTitle"),description:Bt?`${Bt.workspace.name} · ${h("shell.archiveModalDescription")}`:h("shell.archiveModalDescription"),onClose:()=>Tt(null),children:Bt&&Bt.archivedSessions.length>0?i.jsx("div",{className:"workbench-archive-list",children:Bt.archivedSessions.map(Y=>{const xe=Yi(Y.title,h("common.unknown"));return i.jsxs("article",{className:"workbench-archive-item",children:[i.jsxs("div",{className:"workbench-archive-item-main",children:[i.jsx("strong",{title:xe.fullTitle,children:xe.displayTitle}),i.jsxs("p",{children:[$S(Y,Bt.workspace,!1)," ·"," ",uu(Y.provider)]})]}),i.jsx("button",{type:"button",className:"secondary-button",onClick:()=>B(Y.sessionId),children:h("shell.unarchiveAction")})]},Y.sessionId)})}):i.jsx("p",{className:"workbench-section-empty",children:h("shell.archiveEmpty")})}),i.jsx(Cr,{open:ge!==null,title:h("shell.renameModalTitle"),description:h("shell.renameModalDescription"),onClose:()=>{dt||(Be(null),ft(""))},children:i.jsxs("form",{className:"workbench-rename-form",onSubmit:Se,children:[i.jsxs("label",{className:"workbench-modal-field",children:[i.jsx("span",{children:h("shell.renameInputLabel")}),i.jsx("input",{type:"text",value:Pe,placeholder:h("shell.renameInputPlaceholder"),maxLength:120,autoFocus:!0,onChange:Y=>ft(Y.target.value)})]}),i.jsxs("div",{className:"workbench-modal-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:!!dt,onClick:()=>{Be(null),ft("")},children:h("common.cancel")}),i.jsx("button",{type:"submit",className:"primary-button",disabled:!Pe.trim()||dt===(ge==null?void 0:ge.session.sessionId),children:dt===(ge==null?void 0:ge.session.sessionId)?h("shell.renamingSession"):h("common.save")})]})]})})]})}function jw({panelReady:e,activeTab:t,fileRevealRequest:n,onTabChange:s,onToggleCollapse:a,currentSessionId:c,activeWorkspaceId:l,navigationGroups:d}){var g;const f=l??((g=d[0])==null?void 0:g.workspace.id)??null,p=An(),y=v.useCallback(b=>{!p.isDesktop||p.ui.osFamily!=="macos"||b.button!==0||Mm(b.target)&&Am()},[p.isDesktop,p.ui.osFamily]);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"workbench-auxiliary-header","data-window-drag-handle":"workbench-auxiliary-header",onMouseDownCapture:y,children:[a?i.jsx("button",{type:"button",className:"workbench-nav-toolbar-button","aria-label":h("shell.hideInfoSidebar"),title:h("shell.hideInfoSidebar"),onClick:a,children:i.jsx(ZS,{})}):null,i.jsxs("div",{className:"workbench-info-tabs",role:"tablist","aria-label":h("shell.infoTabsLabel"),children:[i.jsx("button",{className:t==="files"?"workbench-info-tab active":"workbench-info-tab",type:"button",role:"tab","aria-selected":t==="files",onClick:()=>s("files"),children:h("shell.filesEntry")}),i.jsx("button",{className:t==="git"?"workbench-info-tab active":"workbench-info-tab",type:"button",role:"tab","aria-selected":t==="git",onClick:()=>s("git"),children:h("shell.gitEntry")}),i.jsx("button",{className:t==="terminals"?"workbench-info-tab active":"workbench-info-tab",type:"button",role:"tab","aria-selected":t==="terminals",onClick:()=>s("terminals"),children:h("shell.terminalManagerEntry")})]})]}),i.jsxs("div",{className:"workbench-auxiliary-body",children:[e?null:i.jsx(dc,{}),e&&t==="files"?l?i.jsx(v.Suspense,{fallback:i.jsx(dc,{}),children:i.jsx(j_,{sessionId:c,workspaceId:l,externalRevealRequest:n})}):i.jsx("section",{className:"workbench-empty-state minimal",children:i.jsx("p",{children:h("shell.filesPanelEmpty")})}):null,e&&t==="git"?f?i.jsx(v.Suspense,{fallback:i.jsx(dc,{}),children:i.jsx(N_,{workspaceId:f})}):i.jsx("section",{className:"workbench-empty-state minimal",children:i.jsx("p",{children:h("shell.gitPanelEmpty")})}):null,e&&t==="terminals"?i.jsx(v.Suspense,{fallback:i.jsx(dc,{}),children:i.jsx(P_,{currentWorkspaceId:l,navigationGroups:d})}):null]})]})}function uF({shellMode:e="desktop"}){var Ns,jo,No;const t=Xr(),n=Wn(),s=An(),{showToast:a}=Kn(),c=v.useRef(z_()),l=v.useRef(0),d=v.useRef((((jo=(Ns=c.current)==null?void 0:Ns.items)==null?void 0:jo.length)??0)>0),f=v.useRef(!1),p=v.useRef(null),y=v.useRef(0),g=v.useRef(null),b=v.useRef(null),k=v.useRef(new Set),S=v.useRef(new Set),C=v.useRef(new Set),j=v.useRef(new Set),A=v.useRef(null),L=v.useRef(null),M=v.useRef(null),O=v.useRef(null),q=v.useRef(null),_=v.useRef(null),I=v.useRef(null),F=v.useRef(null),D=v.useRef(a),[P,K]=v.useState(()=>ww(c.current)),[X,$]=v.useState(()=>{var Q,me;return(((me=(Q=c.current)==null?void 0:Q.items)==null?void 0:me.length)??0)===0}),[ee,te]=v.useState(null),[pe,ne]=v.useState(()=>uc(yw(iw,p_),ac,cw)),[z,ye]=v.useState(()=>uc(yw(sw,g_),ac,uw)),[E,W]=v.useState(()=>vw(ow,!1)),[re,T]=v.useState(()=>vw(aw,!1)),[ae,Le]=v.useState(()=>F_(lw)),[je,He]=v.useState(()=>O_(Nh)),[qe,et]=v.useState(!1),[ot,bt]=v.useState("files"),[Ct,lt]=v.useState(!1),[kt,Ve]=v.useState(!1),[Tt,Ot]=v.useState({}),[St,Mt]=v.useState(!1),[Ht,At]=v.useState("sessions"),[vt,$t]=v.useState(""),[Dt,Lt]=v.useState(""),[ue,ge]=v.useState(!1),[Be,Pe]=v.useState(null),[ft,dt]=v.useState([]),[Rt,ht]=v.useState(null),[Nt,jt]=v.useState({});v.useEffect(()=>{D.current=a},[a]),v.useEffect(()=>{_t("workbench.layout_mounted",{path:t.pathname,search:t.search})},[t.pathname,t.search]),v.useEffect(()=>{var Q,me;_t("workbench.cached_snapshot_loaded",{cached:!!c.current,workspaceCount:((Q=c.current)==null?void 0:Q.items.length)??0,sessionCount:((me=c.current)==null?void 0:me.items.reduce((Xe,mt)=>Xe+mt.sessions.length,0))??0})},[]);function V(Q){var me;!Q||!Array.isArray(Q.items)||(_t("workbench.apply_snapshot",{workspaceCount:Q.items.length,sessionCount:Q.items.reduce((Xe,mt)=>Xe+mt.sessions.length,0),currentSessionId:((me=ja(t.pathname))==null?void 0:me.sessionId)??null}),jr(zS,Q),K(ww(Q)),te(null))}const Me=v.useCallback(async()=>{const Q=l.current+1;l.current=Q,$(me=>me||!d.current),_t("workbench.refresh_navigation.start",{requestId:Q,hasNavigationData:d.current});try{const me=await fT();if(Q!==l.current){_t("workbench.refresh_navigation.stale",{requestId:Q});return}V(me)}catch(me){if(Q!==l.current)return;te(me instanceof Error?me.message:h("shell.navigationLoadFailed")),D.current({title:me instanceof Error?me.message:h("shell.navigationLoadFailed"),tone:"error"})}finally{_t("workbench.refresh_navigation.end",{requestId:Q,success:Q===l.current}),Q===l.current&&$(!1)}},[]),ze=v.useCallback(Q=>{K(me=>H_(me,Q))},[]),wt=v.useCallback(()=>{var Q;(Q=b.current)==null||Q.requestRefresh()},[]),Bt=v.useCallback((Q,me)=>{var Xe;A.current={workspaceId:Q,paths:me},(Xe=b.current)==null||Xe.subscribeFileTree(Q,me)},[]),Zt=v.useCallback((Q,me)=>{var Xe;L.current={workspaceId:Q,paths:me},(Xe=b.current)==null||Xe.requestFileTreeRefresh(Q,me)},[]),Vt=v.useCallback(Q=>(k.current.add(Q),()=>{k.current.delete(Q)}),[]),ke=v.useCallback(Q=>{var me;M.current=Q,(me=b.current)==null||me.subscribeGit(Q)},[]),Qe=v.useCallback(Q=>{var me;O.current=Q,(me=b.current)==null||me.requestGitRefresh(Q)},[]),cn=v.useCallback(Q=>(S.current.add(Q),()=>{S.current.delete(Q)}),[]),yn=v.useCallback(Q=>{var me;q.current=Q,(me=b.current)==null||me.subscribeWorkspaceManagement(Q)},[]),un=v.useCallback(Q=>{var me;_.current=Q,jt(Xe=>{var mt;return{...Xe,[Q]:{detail:((mt=Xe[Q])==null?void 0:mt.detail)??null,loading:!0,error:null}}}),(me=b.current)==null||me.requestWorkspaceManagementRefresh(Q)},[]),on=v.useCallback(Q=>(C.current.add(Q),()=>{C.current.delete(Q)}),[]),wn=v.useCallback(Q=>{var me;I.current=Q,(me=b.current)==null||me.subscribeTerminalManager(Q)},[]),xn=v.useCallback(Q=>{var me;F.current=Q,(me=b.current)==null||me.requestTerminalManagerRefresh(Q)},[]),H=v.useCallback(Q=>(j.current.add(Q),()=>{j.current.delete(Q)}),[]),Z=v.useCallback((Q,me)=>{K(Xe=>q_(Xe,Q,me??new Date().toISOString()))},[]),ie=v.useCallback(async(Q,me)=>{K(Xe=>bw(Xe,Q,me));try{const Xe=await ek(Q,me);ze(Xe),wt()}catch(Xe){throw K(mt=>bw(mt,Q,!me)),Xe}},[wt,ze]),we=v.useCallback((Q,me)=>{_t("workbench.set_session_workspace",{sessionId:Q,workspaceId:me}),Ot(Xe=>{if(!me){if(!(Q in Xe))return Xe;const mt={...Xe};return delete mt[Q],mt}return Xe[Q]===me?Xe:{...Xe,[Q]:me}})},[]);v.useEffect(()=>{d.current=P.length>0},[P]),v.useEffect(()=>{_t("workbench.navigation_state",{navigationLoading:X,workspaceCount:P.length,sessionCount:P.reduce((Q,me)=>Q+me.sessions.length,0)})},[P,X]),v.useEffect(()=>{g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{var Kt;g.current=null,!(f.current||d.current)&&(_t("workbench.refresh_navigation.ws_fallback_triggered"),(Kt=b.current)==null||Kt.requestRefresh())},1200);const Q=new K2({onConnectionChange:Kt=>{Kt==="reconnect_failed"&&!d.current&&(te(h("shell.navigationLoadFailed")),D.current({id:"workbench-navigation-connection",title:h("shell.navigationLoadFailed"),tone:"warning",durationMs:3600}))},onSnapshot:Kt=>{f.current=!0,_t("workbench.ws_snapshot_received",{workspaceCount:Kt.items.length,sessionCount:Kt.items.reduce((In,Or)=>In+Or.sessions.length,0)}),g.current!==null&&(window.clearTimeout(g.current),g.current=null),V(Kt),$(!1)},onFileTreeSnapshot:Kt=>{k.current.forEach(In=>In(Kt))},onGitSnapshot:Kt=>{jr(GS(Kt.workspaceId),{status:Kt.status,history:Kt.history,historyTotalCount:Kt.historyTotalCount,historyNextCursor:Kt.historyNextCursor,branches:Kt.branches}),jt(In=>{var Ji;const Or=((Ji=P.find(Za=>Za.workspace.id===Kt.workspaceId))==null?void 0:Ji.workspace)??null;if(!Or)return In;const Po=In[Kt.workspaceId],To=YS(QS((Po==null?void 0:Po.detail)??KS(Or),Or),Kt);return jr(Nf(Kt.workspaceId),To),{...In,[Kt.workspaceId]:{detail:To,loading:!1,error:null}}}),S.current.forEach(In=>In(Kt))},onWorkspaceManagementSnapshot:Kt=>{jr(Nf(Kt.workspaceId),Kt),jt(In=>({...In,[Kt.workspaceId]:{detail:Kt,loading:!1,error:null}})),C.current.forEach(In=>In(Kt))},onTerminalManagerSnapshot:Kt=>{j.current.forEach(In=>In(Kt))},onUnauthorized:()=>{gn.clear(),n("/login",{replace:!0})}});b.current=Q;const me=A.current,Xe=L.current,mt=M.current,Gt=O.current,kn=q.current,mr=_.current,ci=I.current,pr=F.current;return me&&Q.subscribeFileTree(me.workspaceId,me.paths),mt&&Q.subscribeGit(mt),kn&&Q.subscribeWorkspaceManagement(kn),ci&&Q.subscribeTerminalManager(ci),Xe&&Q.requestFileTreeRefresh(Xe.workspaceId,Xe.paths),Gt&&Q.requestGitRefresh(Gt),mr&&Q.requestWorkspaceManagementRefresh(mr),pr&&Q.requestTerminalManagerRefresh(pr),Q.start(),()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null),b.current===Q&&(b.current=null),Q.close()}},[n]),v.useEffect(()=>{ms(iw,String(pe))},[pe]),v.useEffect(()=>{ms(sw,String(z))},[z]),v.useEffect(()=>{ms(ow,String(E))},[E]),v.useEffect(()=>{ms(aw,String(re))},[re]),v.useEffect(()=>{ms(lw,JSON.stringify(ae))},[ae]),v.useEffect(()=>{if(!je){B_(Nh);return}ms(Nh,je)},[je]),v.useEffect(()=>{if(qe||re)return;const Q=window.setTimeout(()=>{et(!0)},y_);return()=>{window.clearTimeout(Q)}},[qe,re]);const Te=ja(t.pathname),Ae=(Te==null?void 0:Te.sessionId)??null,$e=Ae?tC(Ae):!1,Ie=v.useMemo(()=>ym(P),[P]),Ue=v.useMemo(()=>new Set(ae),[ae]),Fe=v.useMemo(()=>Ie.filter(Q=>Q.session.isFavorite===!0).map(Q=>Q.session.sessionId),[Ie]),Oe=v.useMemo(()=>new Set(Fe),[Fe]);v.useEffect(()=>{if(X&&P.length===0)return;const Q=new Set(P.map(me=>me.workspace.id));Le(me=>VS(me,Q)),He(me=>me&&Q.has(me)?me:null)},[P,X]);const ct=Ie.find(Q=>Q.session.sessionId===Ae)??null,rt=(ct==null?void 0:ct.workspace.id)??(Ae?Tt[Ae]??null:null),Ut=hw(t.pathname,t.search),Pt=rt??Ut??je??null,We=Pt??((No=P[0])==null?void 0:No.workspace.id)??null;v.useEffect(()=>{rt&&He(Q=>Q===rt?Q:rt)},[rt]),v.useEffect(()=>{_t("workbench.current_workspace_resolved",{currentSessionId:Ae,sessionWorkspaceId:rt,routeWorkspaceId:Ut,currentWorkspaceId:We,source:rt?ct?"navigation":"sessionWorkspaceMap":Ut?"route":je?"workspaceSelection":"navigationFallback"})},[ct,Ae,We,Ut,je,rt]),v.useEffect(()=>{_t("workbench.info_panel_state",{infoPanelReady:qe,rightCollapsed:re,currentWorkspaceId:We,sessionWorkspaceId:rt,currentSessionId:Ae})},[Ae,We,qe,re,rt]);const se=mw(t.pathname)?"terminals":"conversation",Ce=e==="mobile",B=x_(e),le=v.useMemo(()=>P.map(Q=>({workspace:Q.workspace,visibleSessions:Q.sessions.filter(me=>!fa(me)),archivedSessions:Q.sessions.filter(me=>fa(me)&&!Cf(me)),visibleSessionTree:qS(Q.sessions.filter(me=>{if(fa(me))return!1;const Xe=Cf(me);if(!Xe)return!0;const mt=Q.sessions.find(Gt=>Gt.sessionId===Xe);return!mt||!fa(mt)})).filter(me=>!Oe.has(me.session.sessionId)&&!vs(me).some(Xe=>Oe.has(Xe.sessionId))),isCollapsed:Ue.has(Q.workspace.id)})),[Ue,Oe,P]),Se=v.useMemo(()=>Ie.filter(Q=>Oe.has(Q.session.sessionId)&&!fa(Q.session)&&!Sf(Q.session)),[Oe,Ie]),Ye=t.pathname.startsWith("/settings")?"settings":mw(t.pathname)?"terminals":S_(t.pathname)?"tools":k_(t.pathname)||fw(t.pathname)?"sessions":"workspaces",tt=Ce&&Ye==="sessions"&&fw(t.pathname),nn=Ka({viewportClass:s.viewportClass,activeEntry:Ye,hasNavigationPanel:Ce,hasAuxiliaryPanel:Ce}),Ln=Ce&&wS(nn),Y=Ce&&bS(nn),xe=v.useMemo(()=>P.map(Q=>Q.workspace),[P]),R=v.useMemo(()=>{const Q=vt.trim().toLowerCase();return Q?Ie.filter(me=>{const Xe=(me.session.title||"").toLowerCase(),mt=me.workspace.name.toLowerCase(),Gt=uu(me.session.provider,"full").toLowerCase();return Xe.includes(Q)||mt.includes(Q)||Gt.includes(Q)}):[]},[Ie,vt]);v.useEffect(()=>{var me;const Q=We??((me=P[0])==null?void 0:me.workspace.id)??"";Q&&Lt(Xe=>Xe&&P.some(Gt=>Gt.workspace.id===Xe)?Xe:Q)},[We,P]),v.useEffect(()=>{Ae&&!$e&&ms(jh,`${t.pathname}${t.search}`)},[Ae,$e,t.pathname,t.search]),v.useEffect(()=>{if(Ae&&$e){p.current=`${t.pathname}${t.search}`;return}Ae&&!$e&&(p.current=null)},[Ae,$e,t.pathname,t.search]),v.useEffect(()=>{Ce||(lt(!1),Ve(!1))},[Ce]),v.useEffect(()=>{!Ce||X||!b_(t.pathname)||Pt||(lt(!1),Ve(!1),n(B,{replace:!0}))},[Pt,Ce,t.pathname,n,X,B]);function de(){if(Ce){lt(!0);return}W(!1)}function he(){if(ut(),Ce){Ve(!0);return}T(!1)}function ve(){if(Ce){lt(Q=>!Q);return}W(Q=>!Q)}function it(){if(ut(),Ce){Ve(Q=>!Q);return}T(Q=>!Q)}function ut(){et(!0)}function zt(Q){He(Q),ut(),Ae&&rt!==Q&&n(B)}const Xt=v.useCallback(async Q=>{var mt;const me=((mt=Ie.find(Gt=>Gt.session.sessionId===Q))==null?void 0:mt.session)??null,Xe=(me==null?void 0:me.isFavorite)!==!0;K(Gt=>xw(Gt,Q,Xe));try{const Gt=await xT(Q,Xe);ze(Gt),wt()}catch(Gt){throw K(kn=>xw(kn,Q,!Xe)),Gt}},[Ie,wt,ze]),Fr=v.useCallback((Q,me)=>{n(pS(Q,me))},[n]),nr=v.useCallback(Q=>{var mt;const me=((mt=Q.workspaceId)==null?void 0:mt.trim())||We,Xe=C_(Q.filePath);return!me||!Xe?!1:(ut(),bt("files"),Ce?(lt(!1),Ve(!0)):T(!1),ht({requestId:y.current+1,workspaceId:me,filePath:Xe,openViewer:Q.openViewer===!0}),y.current+=1,!0)},[We,Ce]),Jr=v.useCallback(async(Q,me)=>{const Xe=await Zx(Q,me.trim());return ze(Xe),Xe},[ze]);function wo(Q){Mt(!0)}function Xa(){Mt(!1),At("sessions"),$t(""),Pe(null),dt([]),ge(!1)}async function bo(){const Q=vt.trim();if(!Q||!Dt.trim()){dt([]),Pe(null);return}ge(!0),Pe(null);try{const me=await kf(Dt,Q);dt(me.items)}catch(me){dt([]),Pe(me instanceof Error?me.message:h("shell.searchCodeFailed"))}finally{ge(!1)}}function xo(Q,me){const Xe=Q==="left"?pe:z;function mt(kn){const mr=kn.clientX-me;if(Q==="left"){ne(uc(Xe+mr,ac,cw));return}ye(uc(Xe-mr,ac,uw))}function Gt(){document.removeEventListener("mousemove",mt),document.removeEventListener("mouseup",Gt)}document.addEventListener("mousemove",mt),document.addEventListener("mouseup",Gt)}function Si(){if(Ja())return;if(Ie.length===0){n(B);return}const Q=er(Ie[0].workspace.id,Ie[0].session.sessionId);n(Q)}function Xi(){if(!Ja(We)){if(We){n(Ga(We));return}n(B)}}function Ja(Q){if(Ae)return Q&&rt&&rt!==Q?!1:(n(`${t.pathname}${t.search}`),!0);if(p.current){if(Q){const[Xe,mt=""]=p.current.split("?"),Gt=hw(Xe??p.current,mt?`?${mt}`:"");if(Gt&&Gt!==Q)return!1}return n(p.current),!0}const me=typeof window>"u"?null:window.localStorage.getItem(jh);if(me){const Xe=me.split("?")[0]??me,mt=ja(Xe);if(mt){const Gt=mt.sessionId,kn=Ie.find(pr=>pr.session.sessionId===Gt)??null,mr=mt.workspaceId??(kn==null?void 0:kn.workspace.id)??null;if(kn!==null&&(!Q||mr===Q))return n(me),!0}window.localStorage.removeItem(jh)}return!1}v.useEffect(()=>{if(typeof window>"u")return;function Q(me){if(!(me.metaKey||me.ctrlKey)){me.key==="Escape"&&(lt(!1),Ve(!1));return}if(U_(me.target))return;const mt=me.key.toLowerCase();if(!me.shiftKey&&mt==="b"){me.preventDefault(),ve();return}if(me.shiftKey&&mt==="i"){me.preventDefault(),it();return}if(!me.shiftKey&&mt===","){me.preventDefault(),n("/settings");return}if(!me.shiftKey&&mt==="1"){me.preventDefault(),Si();return}if(!me.shiftKey&&mt==="2"){me.preventDefault(),n(We?io(We):Gr());return}if(!me.shiftKey&&mt==="k"){me.preventDefault(),W_();return}me.shiftKey&&mt==="r"&&(me.preventDefault(),Me())}return window.addEventListener("keydown",Q),()=>{window.removeEventListener("keydown",Q)}},[n,Me,Ce,Si]);const ko=v.useMemo(()=>({shellMode:e,navigationGroups:P,navigationLoading:X,navigationError:ee,currentWorkspaceId:We,currentSessionId:Ae,favoriteSessionIds:Fe,favoriteSessions:Se,refreshNavigation:Me,requestNavigationRefresh:wt,subscribeFileTree:Bt,requestFileTreeRefresh:Zt,addFileTreeSnapshotListener:Vt,subscribeGitSnapshot:ke,requestGitRefresh:Qe,addGitSnapshotListener:cn,subscribeWorkspaceManagementSnapshot:yn,requestWorkspaceManagementRefresh:un,addWorkspaceManagementSnapshotListener:on,workspaceManagementStateById:Nt,subscribeTerminalManagerSnapshot:wn,requestTerminalManagerRefresh:xn,addTerminalManagerSnapshotListener:H,selectWorkspace:zt,toggleFavoriteSession:Xt,archiveSession:Q=>ie(Q,!0),unarchiveSession:Q=>ie(Q,!1),renameSession:Jr,startDraftSession:Fr,markNavigationSessionSeen:Z,upsertNavigationSession:ze,setSessionWorkspace:we,revealWorkspaceFile:nr}),[Vt,cn,on,H,ie,Ae,We,Fe,Se,zt,Z,ee,P,X,Zt,Qe,un,Me,wt,xn,Jr,Nt,e,Fr,we,Bt,ke,yn,wn,Xt,ze,nr]),Jt={"--workbench-left-width":`${pe}px`,"--workbench-left-current-width":E?"0px":`${pe}px`,"--workbench-right-width":`${z}px`,"--workbench-right-current-width":re?"0px":`${z}px`},So=Ce?i.jsx(Cw,{workspaceGroups:le,favoriteSessions:Se,favoriteSessionIds:Oe,activeWorkspaceId:We,isConversationActive:se==="conversation",isTerminalActive:se==="terminals",isSearchOpen:St,navigationLoading:X,navigationError:ee,activeSessionId:Ae,onRefreshNavigation:Me,onSessionUpdated:ze,onNavigateConversation:Si,onNavigateTerminals:()=>{lt(!1),n(We?io(We):Gr())},onOpenSearch:()=>{lt(!1),wo()},onOpenSettings:()=>{lt(!1),n("/settings")},onSelectWorkspace:zt,onToggleWorkspaceCollapse:Q=>Le(me=>jf(me,Q)),subscribeGitSnapshot:ke,requestGitRefresh:Qe,subscribeWorkspaceManagementSnapshot:yn,requestWorkspaceManagementRefresh:un,onToggleFavoriteSession:Xt,onArchiveSession:Q=>ie(Q,!0),onUnarchiveSession:Q=>ie(Q,!1),workspaceManagementStateById:Nt,setWorkspaceManagementStateById:jt,onClose:()=>lt(!1)}):null,Co=Ce?i.jsx(jw,{panelReady:qe,activeTab:ot,fileRevealRequest:Rt,onTabChange:Q=>{ut(),bt(Q)},currentSessionId:$e?null:Ae,activeWorkspaceId:We,navigationGroups:P}):null;return i.jsxs(HS.Provider,{value:ko,children:[Ce?i.jsx(i.Fragment,{children:i.jsx(B2,{activeEntry:Ye,presentation:tt?"conversation-focus":"default",navigationPanel:So,auxiliaryPanel:Co,onOpenNavigation:()=>{Ve(!1),lt(!0)},onOpenSearch:()=>{lt(!1),Ve(!1),wo()},onOpenAuxiliary:()=>{ut(),lt(!1),Ve(!0)},onNavigateWorkspaces:()=>{lt(!1),Ve(!1),n(Gr())},onNavigateTerminals:()=>{lt(!1),Ve(!1),n(We?io(We):Gr())},onNavigateSessions:()=>{lt(!1),Ve(!1),Xi()},onNavigateTools:()=>{lt(!1),Ve(!1),n(We?po(We):Gr())},onNavigateToolFiles:()=>{lt(!1),Ve(!1),n(We?fS(We):Gr())},onNavigateToolGit:()=>{lt(!1),Ve(!1),n(We?mS(We):Gr())},onNavigateToolProcesses:()=>{lt(!1),Ve(!1),n(We?cu(We):Gr())},onNavigateSettings:()=>{lt(!1),Ve(!1),n("/settings")},children:i.jsx(af,{})})}):i.jsx("div",{className:"workbench-shell",style:Jt,"data-nav-loading":X,"data-left-collapsed":E,"data-right-collapsed":re,"data-info-ready":qe,"data-runtime-platform":s.platform,"data-os-family":s.ui.osFamily,"data-overlay-titlebar":s.ui.prefersOverlayTitlebar,children:i.jsxs("div",{className:"workbench-body-shell",children:[i.jsx("aside",{className:"workbench-nav surface-card","data-collapsed":E,children:i.jsx(Cw,{workspaceGroups:le,favoriteSessions:Se,favoriteSessionIds:Oe,activeWorkspaceId:We,isConversationActive:se==="conversation",isTerminalActive:se==="terminals",isSearchOpen:St,navigationLoading:X,navigationError:ee,activeSessionId:Ae,onRefreshNavigation:Me,onSessionUpdated:ze,onNavigateConversation:Si,onNavigateTerminals:()=>n(We?io(We):Gr()),onOpenSearch:()=>wo(),onOpenSettings:()=>n("/settings"),onSelectWorkspace:zt,onToggleWorkspaceCollapse:Q=>Le(me=>jf(me,Q)),subscribeGitSnapshot:ke,requestGitRefresh:Qe,subscribeWorkspaceManagementSnapshot:yn,requestWorkspaceManagementRefresh:un,onToggleFavoriteSession:Xt,onArchiveSession:Q=>ie(Q,!0),onUnarchiveSession:Q=>ie(Q,!1),workspaceManagementStateById:Nt,setWorkspaceManagementStateById:jt,onToggleCollapse:()=>W(!0)})}),i.jsx("div",{className:"workbench-side-resizer","data-side":"left","data-collapsed":E,role:"separator","aria-label":h("shell.leftResizerLabel"),onMouseDown:E?void 0:Q=>xo("left",Q.clientX)}),i.jsxs("div",{className:"workbench-main-shell",children:[i.jsxs("div",{className:"workbench-collapsed-rail","aria-hidden":!E&&!re,children:[i.jsxs("div",{className:"workbench-collapsed-controls left","data-visible":E,children:[i.jsx(kw,{className:"workbench-nav-toolbar-button workbench-collapsed-button",ariaLabel:h("shell.showSessionSidebar"),side:"left",collapsed:!0,onClick:de}),i.jsx("button",{type:"button",className:"workbench-nav-toolbar-button workbench-collapsed-button","aria-label":h("shell.goBack"),title:h("shell.goBack"),onClick:()=>n(-1),children:i.jsx(JS,{})}),i.jsx("button",{type:"button",className:"workbench-nav-toolbar-button workbench-collapsed-button","aria-label":h("shell.goForward"),title:h("shell.goForward"),onClick:()=>n(1),children:i.jsx(Im,{})})]}),i.jsx("div",{className:"workbench-collapsed-controls right","data-visible":re,children:i.jsx(kw,{className:"workbench-nav-toolbar-button workbench-collapsed-button",ariaLabel:h("shell.showInfoSidebar"),side:"right",collapsed:!0,onClick:he})})]}),i.jsx(af,{})]}),i.jsx("div",{className:"workbench-side-resizer","data-side":"right","data-collapsed":re,role:"separator","aria-label":h("shell.rightResizerLabel"),onMouseDown:re?void 0:Q=>xo("right",Q.clientX)}),i.jsx("aside",{className:"workbench-auxiliary surface-card","data-collapsed":re,children:i.jsx(jw,{panelReady:qe,activeTab:ot,fileRevealRequest:Rt,onTabChange:Q=>{ut(),bt(Q)},onToggleCollapse:()=>T(!0),currentSessionId:$e?null:Ae,activeWorkspaceId:We,navigationGroups:P})})]})}),i.jsx(cF,{open:St,mode:Ht,keyword:vt,codeWorkspaceId:Dt,codeResults:ft,codeLoading:ue,codeError:Be,workspaceOptions:xe,sessionResults:R,onClose:Xa,onModeChange:Q=>{At(Q),Pe(null),dt([])},onKeywordChange:Q=>{$t(Q),Ht==="code"&&!Q.trim()&&(dt([]),Pe(null))},onCodeWorkspaceChange:Q=>Lt(Q),onCodeSearch:()=>{bo()},onOpenSession:Q=>{Xa();const me=Ie.find(Xe=>Xe.session.sessionId===Q)??null;n(me?er(me.workspace.id,Q):Gr())}}),Ce?i.jsxs(i.Fragment,{children:[Ln?null:i.jsx(Nw,{isOpen:Ct,side:"left",onClose:()=>lt(!1),children:So}),Y?null:i.jsx(Nw,{isOpen:kt,side:"right",onClose:()=>Ve(!1),children:Co})]}):null]})}function Nw({isOpen:e,side:t,onClose:n,children:s,className:a,overlayClassName:c}){if(!e)return null;const l=i.jsxs(i.Fragment,{children:[i.jsx("div",{className:["mobile-nav-overlay","open",c].filter(Boolean).join(" "),onClick:n,role:"button",tabIndex:0,"aria-label":h("common.back"),onKeyDown:d=>{d.key==="Escape"&&n()}}),i.jsx("div",{className:["mobile-nav-drawer",t,"open",a].filter(Boolean).join(" "),children:s})]});return typeof document>"u"?l:On.createPortal(l,document.body)}function tr(){return v.useContext(HS)??{navigationGroups:[],navigationLoading:!1,navigationError:null,shellMode:"desktop",currentWorkspaceId:null,currentSessionId:null,favoriteSessionIds:[],favoriteSessions:[],refreshNavigation:async()=>{},requestNavigationRefresh:()=>{},subscribeFileTree:()=>{},requestFileTreeRefresh:()=>{},addFileTreeSnapshotListener:()=>()=>{},subscribeGitSnapshot:()=>{},requestGitRefresh:()=>{},addGitSnapshotListener:()=>()=>{},subscribeWorkspaceManagementSnapshot:()=>{},requestWorkspaceManagementRefresh:()=>{},addWorkspaceManagementSnapshotListener:()=>()=>{},workspaceManagementStateById:{},subscribeTerminalManagerSnapshot:()=>{},requestTerminalManagerRefresh:()=>{},addTerminalManagerSnapshotListener:()=>()=>{},selectWorkspace:()=>{},toggleFavoriteSession:async()=>{},archiveSession:async()=>{},unarchiveSession:async()=>{},renameSession:async()=>{throw new Error("workbench shell unavailable")},startDraftSession:()=>{},setSessionWorkspace:()=>{},upsertNavigationSession:()=>{},markNavigationSessionSeen:()=>{},revealWorkspaceFile:()=>!1}}function tC(e){return e.startsWith("draft-")}const dF=480,nC=v.createContext(!1);function Pf(e){return e.replace(/\\/g,"/")}function Xc(e){return/^[a-zA-Z]:\//.test(e)}function hF(e){return e.startsWith("/")||e.startsWith("//")||Xc(e)}function fF(e){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(e)&&!Xc(e)}function Pw(e){return e.replace(/\/+$/,"")}function mF(e){const t=e.indexOf("#"),n=t>=0?e.slice(0,t):e,s=n.indexOf("?");return(s>=0?n.slice(0,s):n).replace(/:(\d+)(?::(\d+))?$/,"")}function pF(e){const t=[];for(const n of Pf(e).split("/"))if(!(!n||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n)}return t.join("/")}function Dm(e){try{return decodeURIComponent(e)}catch{return e}}function gF(e,t){const n=Dm(e).trim();if(!n||n.startsWith("#"))return null;let s=n;if(/^file:\/\//i.test(s))try{s=decodeURIComponent(new URL(s).pathname),/^\/[a-zA-Z]:\//.test(s)&&(s=s.slice(1))}catch{return null}else if(fF(s))return null;if(s=Pf(mF(s.trim())),!s)return null;const a=Pw(Pf(t.trim()));if(!a)return null;if(hF(s)){const c=Pw(s),l=Xc(a)?a.toLowerCase():a,d=Xc(c)?c.toLowerCase():c;if(d===l)return null;const f=`${l}/`;return d.startsWith(f)?c.slice(a.length+1):null}return pF(s)}function Tf(e){return e.kind==="tool_call"||e.kind==="tool_result"}function rC(e){return e.toolCall?e.toolCall:Tf(e)?{callId:e.rawRef||e.id,name:"tool",input:e.kind==="tool_call"?e.content:"",output:e.kind==="tool_result"&&e.content?e.content:null,error:null,status:e.kind==="tool_call"?"running":"completed"}:null}function yF(e){return e==="shell_command"||e==="tool"?h("conversation.roleTool"):e}function iC(e){if(!e.trim())return null;try{const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?null:t}catch{return null}}function ps(e,t){const n=e[t];return typeof n=="string"?n:""}function vF(e){if(e.name==="apply_patch")return YD(e.input);if(e.name!=="Write"&&e.name!=="Edit"&&e.name!=="MultiEdit")return null;const t=iC(e.input);if(!t)return null;const n=ps(t,"file_path")||ps(t,"path");if(!n)return null;if(e.name==="Write"){const c=ps(t,"content"),l=c.length>0?c.split(/\r?\n/):[];return{files:[{path:n,nextPath:null,action:"add",additions:l.length,deletions:0,lines:l.map((d,f)=>({kind:"add",text:`+${d}`,oldLineNumber:null,newLineNumber:f+1}))}],totalAdditions:l.length,totalDeletions:0}}if(e.name==="Edit"){const c=ps(t,"old_string").split(/\r?\n/),l=ps(t,"new_string").split(/\r?\n/);return Tw(n,[{oldLines:c,newLines:l}])}const a=(Array.isArray(t.edits)?t.edits:[]).map(c=>{if(!c||typeof c!="object"||Array.isArray(c))return null;const l=c;return{oldLines:ps(l,"old_string").split(/\r?\n/),newLines:ps(l,"new_string").split(/\r?\n/)}}).filter(c=>!!c);return a.length>0?Tw(n,a):null}function Tw(e,t){const n=[];let s=0,a=0;return t.forEach((c,l)=>{n.push({kind:"hunk",text:`@@ -1,${c.oldLines.length} +1,${c.newLines.length} @@`,oldLineNumber:null,newLineNumber:null}),c.oldLines.forEach((d,f)=>{d.length===0&&c.oldLines.length===1&&c.newLines.length>0||(a+=1,n.push({kind:"remove",text:`-${d}`,oldLineNumber:f+1,newLineNumber:null}))}),c.newLines.forEach((d,f)=>{d.length===0&&c.newLines.length===1&&c.oldLines.length>0||(s+=1,n.push({kind:"add",text:`+${d}`,oldLineNumber:null,newLineNumber:f+1}))}),l<t.length-1&&n.push({kind:"meta",text:"***",oldLineNumber:null,newLineNumber:null})}),{files:[{path:e,nextPath:null,action:"update",additions:s,deletions:a,lines:n}],totalAdditions:s,totalDeletions:a}}function wF(e){const t=iC(e.input),n=t&&typeof t.command=="string"?t.command.trim():"";if(n)return`${h("conversation.toolPreviewCommand")}:${n}`;if(e.name==="read_thread_terminal")return h("conversation.toolPreviewTerminal");const s=e.input||e.error||e.output||h("conversation.toolResultEmpty");return s.length>60?`${s.slice(0,60)}...`:s}function bF(e){const t=e.map(c=>({message:c,tool:rC(c)})).filter(c=>!!c.tool);if(t.length===0)return null;const n={...t[0].tool};let s=!1,a=!1;for(const{message:c,tool:l}of t)c.kind==="tool_call"&&(s=!0,!n.input&&l.input&&(n.input=l.input)),c.kind==="tool_result"&&(a=!0,n.output=l.output,n.error=l.error,n.status=l.status,!n.input&&l.input&&(n.input=l.input)),!n.name&&l.name&&(n.name=l.name);return{key:t.map(({message:c})=>c.id).join(":"),tool:n,hasRequest:s,hasResult:a}}function xF(e){const t=new Map;for(const n of e){const s=rC(n);if(!s)continue;const a=t.get(s.callId);if(a){a.messages.push(n);continue}t.set(s.callId,{messages:[n],firstSequence:n.sequence})}return Array.from(t.values()).sort((n,s)=>n.firstSequence-s.firstSequence).map(n=>bF(n.messages)).filter(n=>!!n)}function kF(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e[n];if(!Tf(s)){t.push({type:"message",key:s.id,message:s});continue}const a=[s];let c=n+1;for(;c<e.length;){const d=e[c];if(!Tf(d))break;a.push(d),c+=1}const l=xF(a);if(l.length===0){t.push({type:"message",key:s.id,message:s}),n=c-1;continue}l.forEach(d=>{t.push({type:"tool_group",key:d.key,group:d})}),n=c-1}return t}function SF(e,t){if(!QT(null,e))return!1;const n=t.trim();return/AGENTS\.md instructions for/i.test(n)&&/<INSTRUCTIONS>/i.test(n)&&/<\/INSTRUCTIONS>/i.test(n)}function CF(e){const t=e.split(/\r?\n/).map(n=>n.trim()).find(Boolean);return t?t.replace(/^#+\s*/,""):h("conversation.rulesMessageTitle")}function Ia(e){var t;return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(n=>Ia(n)).join(""):e&&typeof e=="object"&&"props"in e?Ia(((t=e.props)==null?void 0:t.children)??""):""}function jF(e){const t=Array.isArray(e)?e[0]:e;if(!v.isValidElement(t))return null;const n=t.props,s=typeof n.className=="string"?n.className:"",a=/language-([^\s]+)/.exec(s);return{content:Ia(n.children).replace(/\n$/,""),codeClassName:s||void 0,language:(a==null?void 0:a[1])??null}}function NF(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly","true"),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t)}}async function sC(e,t){var n;if(!(t.isDesktop&&(await t.bridge.writeClipboardText(e)).ok)){if(typeof navigator<"u"&&((n=navigator.clipboard)!=null&&n.writeText))try{await navigator.clipboard.writeText(e);return}catch{}if(!NF(e))throw new Error(h("conversation.copyContentFailed"))}}function PF({className:e,children:t,onCopy:n}){const s=v.useContext(nC),a=Ia(t).trim();if(s||!a)return i.jsx("code",{className:e||void 0,children:t});function c(l){l.key!=="Enter"&&l.key!==" "||(l.preventDefault(),n(a))}return i.jsx("code",{className:[e,"markdown-inline-copy"].filter(Boolean).join(" "),role:"button",tabIndex:0,"aria-label":h("conversation.copyAction"),onClick:()=>n(a),onKeyDown:c,children:t})}function TF({href:e,children:t,className:n,onInteract:s}){const a=Ia(t).trim()||(e?Dm(e).trim():"");return i.jsx(nC.Provider,{value:!0,children:i.jsx("a",{href:e,className:[n,"markdown-interactive-link"].filter(Boolean).join(" "),onClick:c=>{c.preventDefault(),s(e,a)},children:t})})}function oC({language:e,codeClassName:t,content:n}){const{showToast:s}=Kn(),a=An(),c=(e==null?void 0:e.trim().toLowerCase())??null,l=c==="text",d=c||"code";async function f(){try{await sC(n,a),s({title:h("conversation.copyContentSuccess"),tone:"success"})}catch(p){s({title:p instanceof Error?p.message:h("conversation.copyContentFailed"),tone:"error"})}}return i.jsxs("div",{className:`code-block${l?" text-code-block":""}`,children:[i.jsxs("div",{className:"code-header",children:[i.jsx("span",{className:"code-header-label",children:d}),i.jsx("button",{className:"code-copy-button",type:"button",onClick:()=>void f(),children:h("conversation.copyAction")})]}),i.jsx("pre",{className:t,children:i.jsx("code",{children:n})})]})}function Pc({content:e,className:t}){const{showToast:n}=Kn(),s=An(),{navigationGroups:a,currentWorkspaceId:c,revealWorkspaceFile:l}=tr(),d=v.useMemo(()=>{var y;return((y=a.find(g=>g.workspace.id===c))==null?void 0:y.workspace)??null},[c,a]);async function f(y){if(y.trim())try{await sC(y,s),n({title:h("conversation.copyContentSuccess"),tone:"success"})}catch(g){n({title:g instanceof Error?g.message:h("conversation.copyContentFailed"),tone:"error"})}}function p(y,g){const b=y&&(d!=null&&d.path)?gF(y,d.path):null;b&&l({workspaceId:(d==null?void 0:d.id)??c,filePath:b,openViewer:!1})||f(g||(y?Dm(y).trim():""))}return i.jsx("div",{className:t,children:i.jsx(hm,{remarkPlugins:[gm],components:{p:({node:y,...g})=>i.jsx("p",{...g}),a(y){return i.jsx(TF,{href:typeof y.href=="string"?y.href:void 0,className:typeof y.className=="string"?y.className:void 0,onInteract:p,children:y.children})},pre(y){const g=jF(y.children);return g?i.jsx(oC,{language:g.language,codeClassName:g.codeClassName,content:g.content}):i.jsx("pre",{children:y.children})},code(y){const g=typeof y.className=="string"?y.className:"";return i.jsx(PF,{className:g||void 0,onCopy:b=>{f(b)},children:y.children})}},children:e})})}function Ew(e,t){return!(t!=null&&t.contentBase64)||t.mimeType!==e.mimeType?null:`data:${t.mimeType};base64,${t.contentBase64}`}function fc({sessionId:e,attachmentPayloads:t=[],attachments:n=[],inlineImages:s=[]}){return i.jsx(EF,{sessionId:e,attachments:n,attachmentPayloads:t,inlineImages:s})}function EF({sessionId:e,attachmentPayloads:t=[],attachments:n=[],inlineImages:s=[]}){const[a,c]=v.useState({}),[l,d]=v.useState(null),f=v.useMemo(()=>n.map((b,k)=>{const S=Ew(b,t==null?void 0:t[k]);if(S)return{id:b.id,fileName:b.fileName,fileSize:b.fileSize,url:S,status:"ready"};const C=a[b.id];return{id:b.id,fileName:b.fileName,fileSize:b.fileSize,url:(C==null?void 0:C.url)??null,status:(C==null?void 0:C.status)??(e?"loading":"error")}}),[t,n,a,e]),p=v.useMemo(()=>s.map((b,k)=>({id:`inline-image-${k}`,fileName:b.altText||`${h("conversation.imageAttachmentLabel")} ${k+1}`,fileSize:b.estimatedBytes,url:b.url,status:"ready"})),[s]),y=v.useMemo(()=>[...p,...f],[f,p]),g=y.find(b=>b.id===l)??null;return v.useEffect(()=>{if(!l)return;function b(k){k.key==="Escape"&&d(null)}return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[l]),v.useEffect(()=>{const b=n.filter((C,j)=>!Ew(C,t==null?void 0:t[j]));if(!e||b.length===0){c({});return}let k=!1;const S=[];return c(Object.fromEntries(b.map(C=>[C.id,{id:C.id,fileName:C.fileName,fileSize:C.fileSize,url:null,status:"loading"}]))),Promise.all(b.map(async C=>{try{const j=await PT(e,C.id),A=URL.createObjectURL(j);return S.push(A),{id:C.id,fileName:C.fileName,fileSize:C.fileSize,url:A,status:"ready"}}catch{return{id:C.id,fileName:C.fileName,fileSize:C.fileSize,url:null,status:"error"}}})).then(C=>{if(k){S.forEach(j=>URL.revokeObjectURL(j));return}c(Object.fromEntries(C.map(j=>[j.id,j])))}),()=>{k=!0,S.forEach(C=>URL.revokeObjectURL(C))}},[t,n,e]),y.length===0?null:i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"message-attachments",children:y.map(b=>{const k=b.status==="loading"?h("conversation.attachmentPreviewLoading"):b.status==="error"?h("conversation.attachmentPreviewUnavailable"):h("conversation.attachmentPreviewOpen");return i.jsx("button",{type:"button",className:"message-attachment-button",onClick:()=>b.url&&d(b.id),disabled:!b.url,"aria-label":`${b.fileName} - ${k}`,title:k,children:i.jsx("div",{className:"message-attachment-card",children:b.url?i.jsx("img",{className:"message-attachment-thumbnail",src:b.url,alt:b.fileName||h("conversation.attachmentPreviewAlt"),loading:"lazy"}):i.jsx("div",{className:"message-attachment-placeholder","aria-hidden":"true",children:b.status==="loading"?h("conversation.attachmentPreviewLoading"):h("conversation.attachmentPreviewUnavailable")})})},b.id)})}),g!=null&&g.url?i.jsxs("div",{className:"workbench-modal-layer message-image-modal",role:"dialog","aria-modal":"true",children:[i.jsx("button",{type:"button",className:"workbench-modal-backdrop","aria-label":h("conversation.attachmentPreviewClose"),onClick:()=>d(null)}),i.jsxs("div",{className:"workbench-modal-card surface-card message-image-modal-card",children:[i.jsxs("div",{className:"workbench-modal-header message-image-modal-header",children:[i.jsxs("div",{className:"workbench-modal-title-wrap",children:[i.jsx("h2",{children:h("conversation.imagePreviewTitle")}),i.jsx("p",{children:g.fileName})]}),i.jsx("button",{type:"button",className:"workbench-modal-close","aria-label":h("conversation.attachmentPreviewClose"),onClick:()=>d(null),children:"x"})]}),i.jsxs("div",{className:"message-image-modal-body",children:[i.jsx("div",{className:"message-image-modal-stage",children:i.jsx("img",{className:"message-image-modal-image",src:g.url,alt:g.fileName||h("conversation.attachmentPreviewAlt")})}),i.jsx("p",{className:"message-image-modal-hint",children:h("conversation.imagePreviewHint")})]})]})]}):null]})}function RF(){return i.jsx("div",{className:"timeline-skeleton","aria-hidden":"true",children:Array.from({length:5},(e,t)=>i.jsxs("article",{className:`timeline-skeleton-item ${t%2===0?"assistant":"user"}`,children:[i.jsx("div",{className:"timeline-skeleton-avatar"}),i.jsxs("div",{className:"timeline-skeleton-bubble",children:[i.jsx("span",{className:"timeline-skeleton-line long"}),i.jsx("span",{className:"timeline-skeleton-line medium"}),i.jsx("span",{className:"timeline-skeleton-line short"})]})]},t))})}function MF({tool:e,preview:t}){const[n,s]=v.useState(null);return v.useEffect(()=>{if(n===null)return;function a(c){c.key==="Escape"&&s(null)}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"tool-call-item apply-patch-item",children:t.files.map((a,c)=>i.jsxs("button",{type:"button",className:"apply-patch-summary-row",onClick:()=>s(c),children:[i.jsx("span",{className:"apply-patch-summary-label",children:Rw(a.action)}),i.jsx("span",{className:"apply-patch-summary-file",title:Eh(a),children:XD(a.nextPath??a.path)}),i.jsxs("span",{className:"apply-patch-summary-stats",children:[i.jsxs("span",{className:"apply-patch-summary-added",children:["+",a.additions]}),i.jsxs("span",{className:"apply-patch-summary-removed",children:["-",a.deletions]})]})]},Mw(a,c)))}),n!==null&&typeof document<"u"?On.createPortal(i.jsxs("div",{className:"workbench-modal-layer apply-patch-modal",role:"dialog","aria-modal":"true",children:[i.jsx("button",{type:"button",className:"workbench-modal-backdrop","aria-label":h("common.close"),onClick:()=>s(null)}),i.jsxs("div",{className:"workbench-modal-card surface-card apply-patch-modal-card",children:[i.jsxs("div",{className:"workbench-modal-header",children:[i.jsxs("div",{className:"workbench-modal-title-wrap",children:[i.jsx("h2",{children:h("conversation.applyPatchDialogTitle")}),i.jsx("p",{children:h("conversation.applyPatchDialogDescription")})]}),i.jsx("button",{type:"button",className:"workbench-modal-close","aria-label":h("common.close"),onClick:()=>s(null),children:"x"})]}),(()=>{const a=t.files[n];return a?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"apply-patch-modal-totals",children:[i.jsxs("span",{className:"apply-patch-stat-pill positive",children:[h("conversation.applyPatchAddedStat")," +",a.additions]}),i.jsxs("span",{className:"apply-patch-stat-pill negative",children:[h("conversation.applyPatchRemovedStat")," -",a.deletions]})]}),i.jsxs("div",{className:"apply-patch-modal-body",children:[i.jsxs("section",{className:"apply-patch-file-panel",children:[i.jsxs("div",{className:"apply-patch-file-panel-header",children:[i.jsxs("div",{className:"apply-patch-file-panel-title",children:[i.jsx("span",{className:"apply-patch-summary-label",children:Rw(a.action)}),i.jsx("strong",{children:Eh(a)})]}),i.jsxs("div",{className:"apply-patch-summary-stats",children:[i.jsxs("span",{className:"apply-patch-summary-added",children:["+",a.additions]}),i.jsxs("span",{className:"apply-patch-summary-removed",children:["-",a.deletions]})]})]}),i.jsx("div",{className:"apply-patch-diff-view",children:i.jsx("div",{className:"apply-patch-diff-scroll",children:a.lines.map((c,l)=>i.jsxs("div",{className:`apply-patch-diff-line ${LF(c.kind)}`,children:[i.jsx("span",{className:"apply-patch-line-number",children:Aw(c.oldLineNumber)}),i.jsx("span",{className:"apply-patch-line-number",children:Aw(c.newLineNumber)}),i.jsx("span",{className:"apply-patch-line-content",children:c.text||" "})]},`${Eh(a)}:${l}`))})})]},Mw(a,n)),e.error?i.jsxs("section",{className:"apply-patch-error-panel",children:[i.jsx("div",{className:"tool-call-section-label",children:h("conversation.toolResultLabel")}),i.jsx("pre",{className:"tool-call-error",children:e.error})]}):null]})]}):null})()]})]}),document.body):null]})}function AF({group:e}){const[t,n]=v.useState(!1),{tool:s,hasRequest:a,hasResult:c}=e,l=yF(s.name),d=v.useMemo(()=>vF(s),[s.input,s.name]);if(d)return i.jsx(MF,{tool:s,preview:d});const f=wF(s),p=!!(s.input||s.output||s.error);return i.jsxs("div",{className:`tool-call-item ${c?"tool-result":""}`,children:[i.jsxs("button",{type:"button",className:"tool-call-header",onClick:()=>p&&n(y=>!y),children:[i.jsxs("div",{className:"tool-call-info",children:[i.jsx("span",{className:"tool-call-name",children:l}),i.jsx("span",{className:"tool-call-input-preview",children:f})]}),i.jsx("div",{className:"tool-call-meta",children:p&&i.jsx("span",{className:`tool-call-toggle ${t?"expanded":""}`,children:i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("polyline",{points:"6 9 12 15 18 9"})})})})]}),t&&p&&i.jsxs("div",{className:"tool-call-output",children:[a&&s.input&&i.jsxs("div",{className:"tool-call-section",children:[i.jsx("div",{className:"tool-call-section-label",children:h("conversation.toolInputLabel")}),i.jsx("pre",{children:s.input})]}),(c||s.error||s.output)&&i.jsxs("div",{className:"tool-call-section",children:[i.jsx("div",{className:"tool-call-section-label",children:h("conversation.toolResultLabel")}),i.jsx("pre",{className:s.error?"tool-call-error":void 0,children:s.error||s.output||h("conversation.toolResultEmpty")})]})]})]})}function Rw(e){return h(e==="add"?"conversation.applyPatchAddedLabel":e==="delete"?"conversation.applyPatchDeletedLabel":"conversation.applyPatchEditedLabel")}function Eh(e){return e.nextPath&&e.nextPath!==e.path?`${e.path} -> ${e.nextPath}`:e.nextPath??e.path}function Mw(e,t){return`${e.path}:${e.nextPath??""}:${t}`}function LF(e){return e==="add"?"is-added":e==="remove"?"is-removed":e==="hunk"?"is-hunk":e==="meta"?"is-meta":"is-context"}function Aw(e){return e===null||e<=0?"":String(e)}function IF({message:e,tone:t,onRetry:n}){const[s,a]=v.useState(!1),c=CF(e.content),l=t==="user-message";return i.jsxs("article",{className:`message-item ${t} rules-message-row`,children:[i.jsxs("div",{className:"message-content-wrapper",children:[i.jsxs("div",{className:"rules-message-card",children:[i.jsxs("button",{type:"button",className:"rules-message-toggle","aria-expanded":s,onClick:()=>a(d=>!d),children:[i.jsxs("div",{className:"rules-message-heading",children:[i.jsx("span",{className:"rules-message-badge",children:h("conversation.rulesMessageTitle")}),i.jsx("span",{className:"rules-message-summary",children:c})]}),i.jsx("span",{className:"rules-message-action",children:h(s?"conversation.rulesMessageCollapse":"conversation.rulesMessageExpand")})]}),i.jsx("p",{className:"rules-message-hint",children:h("conversation.rulesMessageHint")}),s&&i.jsx("div",{className:"rules-message-body",children:i.jsx(Pc,{content:e.content,className:"message-text message-content markdown-content"})})]}),e.deliveryState==="failed"&&e.clientRequestId&&i.jsx("button",{className:"retry-button",type:"button",onClick:()=>n(e.clientRequestId),children:h("conversation.resendButton")})]}),l&&i.jsx("time",{className:"message-time",dateTime:e.timestamp,children:new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})}function DF({message:e,provider:t,onRetry:n}){const s=e.role==="user",a=e.kind==="thinking",c=e.role==="assistant"&&e.kind==="text",l=SF(t,e.content),d=v.useMemo(()=>Aa(e.content),[e.content]),f=d.text,p=d.inlineImages;if(l){const y=e.role==="user"?"user-message":e.role==="assistant"?"assistant-message":"system-message";return i.jsx(IF,{message:e,tone:y,onRetry:n})}return s?i.jsxs("article",{className:"message-item user-message",children:[i.jsxs("div",{className:"message-content-wrapper",children:[i.jsx(fc,{sessionId:e.sessionId,attachments:e.attachments,attachmentPayloads:e.attachmentPayloads,inlineImages:p}),f?i.jsx(Pc,{content:f,className:"message-text message-content markdown-content"}):null,e.deliveryState==="failed"&&e.clientRequestId&&i.jsx("button",{className:"retry-button",type:"button",onClick:()=>n(e.clientRequestId),children:h("conversation.resendButton")})]}),i.jsx("time",{className:"message-time",dateTime:e.timestamp,children:new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}):a?i.jsxs("article",{className:"message-item assistant-message thinking-message-row",children:[i.jsx("div",{className:"message-avatar",children:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("path",{d:"M12 16v-4M12 8h.01"})]})}),i.jsxs("div",{className:"message-content-wrapper thinking-message-wrapper",children:[i.jsx("div",{className:"thinking-message-label",children:h("conversation.thinkingLabel")}),i.jsx(fc,{sessionId:e.sessionId,attachments:e.attachments,attachmentPayloads:e.attachmentPayloads,inlineImages:p}),f&&i.jsx(Pc,{content:f,className:"message-text message-content markdown-content thinking-message-text"})]})]}):c?i.jsxs("article",{className:"message-item assistant-message",children:[i.jsx("div",{className:"message-avatar",children:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("path",{d:"M12 16v-4M12 8h.01"})]})}),i.jsxs("div",{className:"message-content-wrapper",children:[i.jsx(fc,{sessionId:e.sessionId,attachments:e.attachments,attachmentPayloads:e.attachmentPayloads,inlineImages:p}),f&&i.jsx(Pc,{content:f,className:"message-text message-content markdown-content"})]})]}):i.jsx("article",{className:"message-item system-message",children:i.jsxs("div",{className:"message-content-wrapper",children:[i.jsx(fc,{sessionId:e.sessionId,attachments:e.attachments,attachmentPayloads:e.attachmentPayloads,inlineImages:p}),f?i.jsx("div",{className:"message-text message-content",children:i.jsx(oC,{language:"text",content:f})}):null]})})}function aC({sessionId:e="session",messages:t,historyState:n,loadingOlderMessages:s=!1,hasOlderMessages:a=!1,onLoadOlderMessages:c=()=>{},onRetryMessage:l,provider:d}){const{showToast:f}=Kn(),p=v.useRef(null),y=v.useRef(e),g=v.useRef(t.length),b=v.useRef(Rh(t.at(-1)??null)),k=v.useRef(!0),S=v.useRef(null),C=v.useRef(!1),j=kF(t),A=n==="loading"&&t.length===0;function L(O){return C.current||!a||s||n!=="ready"||O.scrollTop>dF?!1:(C.current=!0,S.current=O.scrollHeight-O.scrollTop,c(),!0)}v.useEffect(()=>{n==="error"&&f({title:h("conversation.historyLoadFailed"),tone:"error"})},[n,f]),v.useEffect(()=>{y.current!==e&&(y.current=e,g.current=0,b.current=null,k.current=!0,S.current=null)},[e]),v.useLayoutEffect(()=>{const O=p.current;if(!O){g.current=t.length,b.current=Rh(t.at(-1)??null);return}const q=g.current,_=b.current,I=Rh(t.at(-1)??null);S.current!==null&&t.length>=q?(O.scrollTop=Math.max(0,O.scrollHeight-S.current),S.current=null):k.current&&(q===0||t.length!==q||I!==_)&&(O.scrollTop=O.scrollHeight),g.current=t.length,b.current=I},[t,e]),v.useEffect(()=>{if(!a){C.current=!1;return}!s&&S.current===null&&(C.current=!1)},[a,s,t.length]);function M(){const O=p.current;if(!O)return;const q=O.scrollHeight-O.clientHeight-O.scrollTop;k.current=q<=80,L(O)}return v.useEffect(()=>{const O=p.current;O&&L(O)},[a,n,s,t.length,c]),i.jsxs("section",{className:"message-timeline",children:[n==="loading"&&i.jsx("div",{className:"timeline-status",children:i.jsx("span",{className:"status-text",children:h("conversation.historyLoading")})}),i.jsxs("div",{ref:p,className:"message-list",onScroll:M,children:[A?i.jsx(RF,{}):null,s?i.jsx("div",{className:"timeline-status timeline-status-inline",children:i.jsx("span",{className:"status-text",children:h("conversation.historyLoadingOlder")})}):null,j.length===0&&n==="ready"&&i.jsx("div",{className:"timeline-empty",children:i.jsx("p",{className:"status-text",children:h("conversation.timelineEmpty")})}),j.map(O=>O.type==="tool_group"?i.jsx("article",{className:"message-item tool-message-row",children:i.jsx(AF,{group:O.group})},O.key):i.jsx(DF,{message:O.message,provider:d,onRetry:l},O.key))]})]})}function Rh(e){return e?JSON.stringify({id:e.id,content:e.content,attachments:e.attachments,timestamp:e.timestamp,deliveryState:e.deliveryState,toolCall:e.toolCall?{status:e.toolCall.status,output:e.toolCall.output,error:e.toolCall.error}:null}):null}function _F({requests:e,replyingRequestId:t,onReply:n}){const[s,a]=v.useState({}),c=v.useMemo(()=>e.filter(l=>l.status==="pending"),[e]);return c.length===0?null:i.jsxs("section",{className:"permission-request-list",children:[i.jsxs("div",{className:"permission-request-list-header",children:[i.jsx("div",{children:i.jsx("strong",{children:h("conversation.permissionRequestSectionTitle")})}),i.jsx("span",{className:"permission-request-count",children:c.length})]}),i.jsx("div",{className:"permission-request-stack",children:c.map(l=>{var b,k;const d=s[l.id]??{},f=l.paths.filter(Boolean),p=l.kind==="command"&&!!((b=l.command)!=null&&b.trim()),y=l.questions.length===0&&f.length===0&&!p&&!!((k=l.summary)!=null&&k.trim()),g=l.kind==="user_input"&&l.questions.some(S=>{var C;return(((C=d[S.id])==null?void 0:C.filter(Boolean).length)??0)===0});return i.jsxs("article",{className:"permission-request-card",children:[i.jsxs("header",{className:"permission-request-card-header",children:[i.jsxs("div",{className:"permission-request-provider",children:[i.jsx("span",{className:"permission-request-provider-icon","aria-hidden":"true",children:i.jsx("img",{src:OF(l.provider),alt:"",loading:"lazy"})}),i.jsxs("div",{className:"permission-request-provider-copy",children:[i.jsx("strong",{children:l.title}),i.jsx("span",{children:FF(l.provider)})]})]}),i.jsx("span",{className:"permission-request-kind",children:BF(l.kind)})]}),i.jsxs("div",{className:"permission-request-card-body",children:[f.length>0?i.jsx("div",{className:"permission-request-block",children:i.jsx("ul",{className:"permission-request-target-list",children:f.map(S=>i.jsxs("li",{className:"permission-request-target-item",children:[i.jsx("strong",{children:UF(S)}),i.jsx("span",{children:S})]},`${l.id}:${S}`))})}):null,p?i.jsxs("div",{className:"permission-request-block",children:[i.jsx("div",{className:"permission-request-block-label",children:h("conversation.permissionRequestCommandLabel")}),i.jsx("pre",{children:l.command})]}):null,y?i.jsx("p",{className:"permission-request-summary",children:l.summary}):null,l.questions.length>0?i.jsxs("div",{className:"permission-request-block",children:[i.jsx("div",{className:"permission-request-block-label",children:h("conversation.permissionRequestQuestionsLabel")}),i.jsx("div",{className:"permission-request-question-list",children:l.questions.map(S=>i.jsxs("div",{className:"permission-request-question",children:[i.jsx("div",{className:"permission-request-question-header",children:S.header}),i.jsx("p",{children:S.question}),i.jsx("div",{className:"permission-request-question-options",children:S.options.map(C=>{var A;const j=((A=d[S.id])==null?void 0:A.includes(C.label))??!1;return i.jsxs("label",{className:"permission-request-question-option",children:[i.jsx("input",{type:"radio",name:`${l.id}:${S.id}`,checked:j,onChange:()=>{a(L=>({...L,[l.id]:{...L[l.id]??{},[S.id]:[C.label]}}))}}),i.jsxs("span",{children:[i.jsx("strong",{children:C.label}),C.description?i.jsx("small",{children:C.description}):null]})]},`${S.id}:${C.label}`)})})]},S.id))})]}):null]}),i.jsx("footer",{className:"permission-request-card-footer",children:l.actions.map(S=>i.jsx("button",{type:"button",className:`permission-request-action permission-request-action-${S.tone}`,disabled:t===l.id||S.value==="submit"&&g,onClick:()=>void n(l.id,{action:S.value,answers:l.kind==="user_input"?d:void 0}),children:t===l.id?h("conversation.permissionRequestSubmitting"):S.label},`${l.id}:${S.value}`))})]},l.id)})})]})}function FF(e){return h(e==="codex"?"conversation.providerCodex":e==="claude-code"?"shell.providerClaudeCode":"conversation.providerOpenCode")}function OF(e){return e==="codex"?_S:e==="claude-code"?FS:OS}function BF(e){return h(e==="command"?"conversation.permissionRequestKindCommand":e==="file_change"?"conversation.permissionRequestKindFileChange":e==="permissions"?"conversation.permissionRequestKindPermissions":e==="user_input"?"conversation.permissionRequestKindUserInput":"conversation.permissionRequestKindToolCall")}function UF(e){return e.split(/[/\\]+/).filter(Boolean).at(-1)??e}function WF({items:e,deletingQueueItemId:t=null,steeringQueueItemId:n=null,canSteer:s=!1,onDelete:a,onSteer:c}){return e.length===0?null:i.jsxs("section",{className:"queued-message-list","aria-label":h("conversation.queueTitle"),children:[i.jsx("div",{className:"queued-message-list__header",children:i.jsx("h2",{children:`${h("conversation.queueTitle")} · ${e.length}`})}),i.jsx("div",{className:"queued-message-list__items",children:e.map((l,d)=>{const f=l.status==="queued"||l.status==="failed",p=s&&typeof c=="function"&&l.status==="queued";return i.jsxs("article",{className:"queued-message-item",children:[i.jsxs("div",{className:"queued-message-item__main",children:[i.jsx("span",{className:"queued-message-item__order","aria-hidden":"true",children:d+1}),i.jsx("p",{className:"queued-message-item__content",title:l.content||h("conversation.queueImageOnly"),children:l.content||h("conversation.queueImageOnly")}),i.jsx("span",{className:`queued-message-item__status queued-message-item__status--${l.status}`,children:l.status==="failed"?h("conversation.queueStatusFailed"):h("conversation.queueStatusQueued")}),i.jsxs("div",{className:"queued-message-item__actions",children:[p?i.jsx("button",{type:"button",className:"queued-message-item__action queued-message-item__action--steer",onClick:()=>void c(l.id),disabled:n===l.id,"aria-label":h("conversation.queueSteer"),title:h("conversation.queueSteer"),children:n===l.id?h("conversation.queueSteering"):h("conversation.queueSteer")}):null,f?i.jsx("button",{type:"button",className:"queued-message-item__action queued-message-item__action--delete",onClick:()=>void a(l.id),disabled:t===l.id,"aria-label":h("conversation.queueDelete"),title:h("conversation.queueDelete"),children:t===l.id?"…":"×"}):null]})]}),l.errorDetail?i.jsx("p",{className:"queued-message-item__error",children:l.errorDetail}):null]},l.id)})})]})}function zF(e){const t=e.trim().length;return t<=16?"xl":t<=26?"lg":t<=38?"md":"sm"}function lC({session:e}){const t=An(),n=v.useCallback(c=>{!t.isDesktop||t.ui.osFamily!=="macos"||c.button!==0||Mm(c.target)&&Am()},[t.isDesktop,t.ui.osFamily]);if(!e)return i.jsx("header",{className:"conversation-header conversation-header-skeleton","aria-hidden":"true","data-window-drag-handle":"conversation-header",onMouseDownCapture:n,children:i.jsxs("div",{className:"conversation-header-main",children:[i.jsx("span",{className:"skeleton-line short"}),i.jsx("span",{className:"skeleton-line long"})]})});const s=Yi(e.title,h("conversation.titleFallback")),a=zF(s.displayTitle);return i.jsx("header",{className:"conversation-header","data-window-drag-handle":"conversation-header",onMouseDownCapture:n,children:i.jsx("div",{className:"conversation-header-main",children:i.jsx("h1",{className:`conversation-title is-${a}`,title:s.fullTitle,children:s.displayTitle})})})}class HF{constructor(t){Ke(this,"socket",null);Ke(this,"disposed",!1);Ke(this,"authRecoveryInFlight",!1);Ke(this,"latestCursor");Ke(this,"connectionManager");this.options=t,this.latestCursor=t.cursor,this.connectionManager=new xS({onReconnect:n=>{this.connect(n)},onStateChange:t.onConnectionChange})}start(){this.connectionManager.start()}updateCursor(t){this.latestCursor=t}reconnectNow(){this.connectionManager.reconnectNow()}requestOlderMessages(t,n){return!this.socket||this.socket.readyState!==WebSocket.OPEN?!1:(this.socket.send(JSON.stringify({type:"session.load_older",sessionId:this.options.sessionId,cursor:t,limit:n})),!0)}close(){var t;this.disposed=!0,this.connectionManager.close(),(t=this.socket)==null||t.close(),this.socket=null}connect(t){var c;if(this.disposed)return;t&&this.socket&&(this.socket.close(),this.socket=null);const n=(c=gn.getState().session)==null?void 0:c.accessToken;if(!n){this.options.onUnauthorized();return}const s=`${ox("/ws")}?access_token=${encodeURIComponent(n)}`,a=new WebSocket(s);this.socket=a,a.addEventListener("open",()=>{a.send(JSON.stringify({type:"session.subscribe",sessionId:this.options.sessionId,cursor:this.latestCursor,limit:this.options.limit}))}),a.addEventListener("message",l=>{const d=JSON.parse(l.data);if(d.type==="system.connected"){this.connectionManager.markConnected();return}if(d.type==="session.subscribed"){this.options.onSubscribed();return}if(d.type==="session.error"){if(d.error_code==="UNAUTHORIZED"){this.handleUnauthorized();return}this.options.onError(d);return}if(d.type==="session.runtime_status"){this.options.onRuntimeStatus(d);return}if(d.type==="session.activity"){this.options.onActivity(d);return}if(d.type==="session.history_older"){this.options.onOlderHistory(d);return}if(d.type==="session.runtime_message"){this.options.onRuntimeMessage(d);return}if(d.type==="session.runtime_error"){this.options.onRuntimeError(d);return}if(d.type==="session.interrupted"){this.options.onInterrupted(d);return}if(d.type==="session.permission_request"){this.options.onPermissionRequest(d);return}if(d.type==="session.permission_request_resolved"){this.options.onPermissionRequestResolved(d);return}this.latestCursor=d.cursor,this.options.onEnvelope(d)}),a.addEventListener("close",()=>{this.disposed||this.socket!==a||this.connectionManager.markDisconnected()}),a.addEventListener("error",()=>{this.disposed||this.socket!==a||this.connectionManager.markTransientFailure()})}handleUnauthorized(){if(this.authRecoveryInFlight||this.disposed)return;this.authRecoveryInFlight=!0;const t=this.socket;this.socket=null,t==null||t.close(),gn.refresh().then(n=>{if(this.authRecoveryInFlight=!1,!this.disposed){if(n.status==="refreshed"){this.connectionManager.reconnectNow();return}if(n.status==="deferred"){this.connectionManager.markDisconnected();return}this.options.onUnauthorized()}})}}function Lw(e){return{session:(e==null?void 0:e.session)??null,capabilities:(e==null?void 0:e.capabilities)??null,runtimeHasActiveRun:(e==null?void 0:e.runtimeHasActiveRun)??null,runtimeCanInterrupt:(e==null?void 0:e.runtimeCanInterrupt)??null,contextUsage:(e==null?void 0:e.contextUsage)??null,messages:(e==null?void 0:e.messages)??[],permissionRequests:(e==null?void 0:e.permissionRequests)??[],queuedMessages:(e==null?void 0:e.queuedMessages)??[],historyState:"idle",loadingOlderMessages:!1,olderCursor:null,hasOlderMessages:!1,connectionState:"closed",lastCursor:null,pagesLoaded:0,errorCode:null,errorDetail:null}}function cC(e,t,n="sent",s=null){const a=t.kind??(t.role==="tool"?"tool_result":"text"),c=t.toolCall??(a==="tool_call"||a==="tool_result"?{callId:t.rawRef||t.messageId,name:"tool",input:a==="tool_call"?t.content:"",output:a==="tool_result"&&t.content?t.content:null,error:null,status:a==="tool_call"?"running":"completed"}:null);return{id:t.messageId,sessionId:e,role:t.role,kind:a,content:t.content,toolCall:c,attachments:t.attachments??[],attachmentPayloads:null,timestamp:t.timestamp,sequence:t.sequence,rawRef:t.rawRef,deliveryState:n,clientRequestId:s}}function uC(e,t,n,s=[],a=[],c=Number.MAX_SAFE_INTEGER){return{id:`pending-${n}`,sessionId:e,role:"user",kind:"text",content:t,toolCall:null,attachments:s,attachmentPayloads:a,timestamp:new Date().toISOString(),sequence:c,rawRef:`pending://${n}`,deliveryState:"sending",clientRequestId:n}}function ma(e,t,n){const s=new Map;for(const a of e)s.set(a.id,a);for(const a of n){const c=cC(t,a),l=aO(s,c);if(l&&l!==c.id)continue;const d=oO(s,c);d&&d!==c.id&&s.delete(d);const f=s.get(a.messageId)??null;s.set(a.messageId,f?QF(f,c):c)}return dC(Array.from(s.values()))}function Iw(e,t,n,s){const a=s===null?null:e.find(f=>f.clientRequestId===s)??null,c=e.filter(f=>f.clientRequestId!==s),l=cC(t,n,"sent",s),d=KF(l,a);return dC([...c.filter(f=>f.id!==d.id),d])}function Ef(e,t){return e.map(n=>n.clientRequestId===t?{...n,deliveryState:"failed"}:n)}function qF(e){const t=[];for(const n of e){const s=t.at(-1);if(!s||!XF(s,n)){t.push(n);continue}t[t.length-1]=eO(s,n)}return t}function $F(e){const t=[];let n=null,s=!1;for(const a of e)if(!JF(n,a,s)){if(t.push(a),Da(a)){n=a,s=!1;continue}n&&Rf(a)&&(s=!0)}return t}function VF(e){const t=[];for(const n of e){const s=t.at(-1);if(!s||!hC(s,n)){t.push(n);continue}t[t.length-1]=fC(s,n)}return t}function GF(e){const t=[];for(const n of e){if(t.push(n),t.length<4)continue;const s=t[t.length-4],a=t[t.length-3],c=t[t.length-2],l=t[t.length-1];ZF(s,a,c,l)&&t.splice(t.length-3,3,fC(a,l))}return t}function dC(e){const t=[...e].sort((n,s)=>n.sequence!==s.sequence?n.sequence-s.sequence:n.timestamp.localeCompare(s.timestamp));return $F(GF(VF(qF(t))))}function KF(e,t){if(!t||!YF(t,e))return e;const n=e.attachments??[];return{...e,sequence:t.sequence,timestamp:t.timestamp,attachments:n.length>0?n:t.attachments??[],attachmentPayloads:t.attachmentPayloads??null}}function QF(e,t){if(e.id!==t.id)return t;if(e.role!==t.role||e.kind!==t.kind||e.rawRef!==t.rawRef)return Mf(e,t);const n=tO(e.toolCall,t.toolCall),s=rO(e.content,t.content,e.timestamp,t.timestamp),a=iO(e.attachments,t.attachments);return{...Mf(e,t),content:s,toolCall:n,attachments:a,attachmentPayloads:e.attachmentPayloads??t.attachmentPayloads??null,timestamp:e.timestamp.localeCompare(t.timestamp)>=0?e.timestamp:t.timestamp,sequence:Math.max(e.sequence,t.sequence)}}function YF(e,t){return du(e)&&t.role==="user"&&t.kind==="text"&&e.sequence>t.sequence}function XF(e,t){if(e.deliveryState!=="sent"||t.deliveryState!=="sent"||!e.rawRef.startsWith("codex://")||!t.rawRef.startsWith("codex://")||e.role!==t.role||e.kind!==t.kind||e.toolCall!==null||t.toolCall!==null||e.kind!=="text"&&e.kind!=="thinking")return!1;const n=Aa(e.content),s=Aa(t.content);return cO(e.timestamp,t.timestamp)&&Gn(n.text)===Gn(s.text)&&sO(n.inlineImages,s.inlineImages)}function JF(e,t,n){return!e||n||!Da(e)||!Da(t)?!1:_m(e.timestamp,t.timestamp,120*1e3)&&Gn(e.content)===Gn(t.content)}function Da(e){return e.deliveryState==="sent"&&e.rawRef.startsWith("opencode://")&&e.role==="user"&&e.kind==="text"}function Rf(e){return e.deliveryState==="sent"&&e.rawRef.startsWith("opencode://")&&e.role==="assistant"&&e.kind==="text"}function hC(e,t){return Rf(e)&&Rf(t)&&_m(e.timestamp,t.timestamp,120*1e3)&&Gn(e.content)===Gn(t.content)}function ZF(e,t,n,s){return!e||!t||!n||!s||!Da(e)||!Da(n)?!1:hC(t,s)&&_m(e.timestamp,n.timestamp,120*1e3)&&Gn(e.content)===Gn(n.content)}function fC(e,t){var l,d;const n=((l=e.attachments)==null?void 0:l.length)??0,s=((d=t.attachments)==null?void 0:d.length)??0;if(n!==s)return n>s?e:t;const a=Gn(e.content).length,c=Gn(t.content).length;return a!==c?a>c?e:t:Mf(e,t)}function eO(e,t){var f,p;const n=((f=e.attachments)==null?void 0:f.length)??0,s=((p=t.attachments)==null?void 0:p.length)??0;if(n!==s)return n>s?e:t;const a=Aa(e.content).inlineImages.length,c=Aa(t.content).inlineImages.length;if(a!==c)return a>c?e:t;const l=e.content!==Gn(e.content),d=t.content!==Gn(t.content);return l!==d?l?t:e:t}function tO(e,t){return e?t?{...nO(e,t),input:mC(e.input,t.input),output:_w(e.output,t.output),error:_w(e.error,t.error)}:e:t}function nO(e,t){const n=Dw(e.status),s=Dw(t.status);return s!==n?s>n?t:e:t}function Dw(e){return e==="running"?0:1}function rO(e,t,n,s){const a=Gn(e),c=Gn(t);return a===c?e.length>=t.length?e:t:a.length>c.length&&a.includes(c)?e:c.length>a.length&&c.includes(a)||s.localeCompare(n)>=0?t:e}function iO(e,t){const n=(e==null?void 0:e.length)??0,s=(t==null?void 0:t.length)??0;return s!==n?s>n?t:e:t??e}function mC(e,t){return t.length>e.length?t:e}function _w(e,t){return e===null?t:t===null?e:mC(e,t)}function Mf(e,t){return t.timestamp!==e.timestamp?t.timestamp.localeCompare(e.timestamp)>=0?t:e:t.sequence!==e.sequence?t.sequence>=e.sequence?t:e:t}function Gn(e){return e.replace(/\r\n/g,`
106
+ `).trimEnd()}function sO(e,t){return e.length===0||t.length===0?!0:e.length!==t.length?!1:e.every((n,s)=>{var a;return n.url===((a=t[s])==null?void 0:a.url)})}function oO(e,t){return gC(t)?pC(e,t,"optimistic"):null}function aO(e,t){return du(t)?pC(e,t,"authoritative"):null}function pC(e,t,n){const s=co(t.timestamp),a=Gn(t.content);let c=null,l=Number.POSITIVE_INFINITY;for(const[d,f]of e.entries()){if(!(n==="optimistic"?du(f):gC(f))||Gn(f.content)!==a)continue;const y=co(f.timestamp),g=Math.abs(y-s);g>300*1e3||g<l&&(c=d,l=g)}return c}function du(e){return e.role!=="user"||e.kind!=="text"||e.deliveryState==="failed"?!1:e.rawRef.startsWith("pending://")||e.rawRef.startsWith("synthetic://")||e.rawRef.includes("#synthetic")}function gC(e){return e.role==="user"&&e.kind==="text"&&!du(e)}function co(e){const t=Date.parse(e);return Number.isFinite(t)?t:0}function lO(e){return e.reduce((n,s)=>Number.isFinite(s.sequence)&&s.sequence>n?s.sequence:n,0)+1}function cO(e,t){return Math.abs(co(e)-co(t))<=1e3}function _m(e,t,n){return Math.abs(co(e)-co(t))<=n}const yC=30,vC=40,Fw=300*1e3,uO=600,dO=5e3,hO=1e4;function Mh(){const e=Yr.getState().profile.defaultPermissionMode;return e==="default"?null:e}class fO{constructor(t,n={}){Ke(this,"state");Ke(this,"listeners",new Set);Ke(this,"realtimeClient",null);Ke(this,"historyBootstrapReadyTimer",null);Ke(this,"markSeenTimer",null);Ke(this,"markSeenInFlight",!1);Ke(this,"lastMarkSeenRequestAt",0);Ke(this,"seenWatermark",null);Ke(this,"runtimeRefreshTimer",null);Ke(this,"runtimeRefreshMode",null);Ke(this,"replaceSnapshotSeedOnBackfill",!1);Ke(this,"hasAuthoritativeBootstrapMessages");Ke(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Ke(this,"getState",()=>this.state);var l;this.sessionId=t,this.options=n;const s=Mn(Dh(t),Fw);this.hasAuthoritativeBootstrapMessages=(((l=n.bootstrapMessages)==null?void 0:l.length)??0)>0;const a=mc(n.initialSession??null,(s==null?void 0:s.session)??null),c=ma((s==null?void 0:s.messages)??[],this.sessionId,n.bootstrapMessages??[]);this.replaceSnapshotSeedOnBackfill=!this.hasAuthoritativeBootstrapMessages&&((s==null?void 0:s.messages.length)??0)>0,this.state=Lw({session:a,capabilities:(s==null?void 0:s.capabilities)??null,runtimeHasActiveRun:(s==null?void 0:s.runtimeHasActiveRun)??null,runtimeCanInterrupt:(s==null?void 0:s.runtimeCanInterrupt)??null,contextUsage:(s==null?void 0:s.contextUsage)??null,messages:c,permissionRequests:(s==null?void 0:s.permissionRequests)??[],queuedMessages:(s==null?void 0:s.queuedMessages)??[]}),this.seenWatermark=(a==null?void 0:a.lastSeenAt)??null}async initialize(){const t=this.options.bootstrapMessages??[],n=ma(this.state.messages,this.sessionId,t),s=this.hasAuthoritativeBootstrapMessages;this.patch({messages:n,historyState:mO(this.state.session,s?n.length:0),loadingOlderMessages:!1,olderCursor:null,hasOlderMessages:to(this.state.session,n.length),pagesLoaded:s?Math.max(this.state.pagesLoaded,1):0,errorCode:null,errorDetail:null}),this.shouldRefreshSessionDetail()&&this.refreshSessionMetadata(),this.shouldRefreshRuntimeSnapshot()&&this.refreshRuntimeSnapshot("bootstrap"),this.refreshPermissionRequests(),this.refreshQueue();try{this.startRealtime(),s?this.scheduleMarkSeen():this.state.historyState==="loading"&&this.scheduleHistoryBootstrapReady()}catch(a){this.handleError(a)}}async reload(){var n,s;this.clearHistoryBootstrapReadyTimer(),(n=this.realtimeClient)==null||n.close(),this.realtimeClient=null;const t=Mn(Dh(this.sessionId),Fw);this.state=Lw({session:mc(this.options.initialSession??null,(t==null?void 0:t.session)??null),capabilities:(t==null?void 0:t.capabilities)??null,runtimeHasActiveRun:(t==null?void 0:t.runtimeHasActiveRun)??null,runtimeCanInterrupt:(t==null?void 0:t.runtimeCanInterrupt)??null,contextUsage:(t==null?void 0:t.contextUsage)??null,messages:ma((t==null?void 0:t.messages)??[],this.sessionId,this.options.bootstrapMessages??[]),permissionRequests:(t==null?void 0:t.permissionRequests)??[],queuedMessages:(t==null?void 0:t.queuedMessages)??[]}),this.seenWatermark=((s=this.state.session)==null?void 0:s.lastSeenAt)??null,this.replaceSnapshotSeedOnBackfill=!this.hasAuthoritativeBootstrapMessages&&((t==null?void 0:t.messages.length)??0)>0,this.emit(),await this.initialize()}applyNavigationSession(t){if(!t||t.sessionId!==this.sessionId)return;const n=mc(this.state.session,t);n!==this.state.session&&this.patch({session:n,hasOlderMessages:to(n,this.state.messages.length)})}async sendMessage(t,n){const s=zw(),a=uC(this.sessionId,t,s,(n==null?void 0:n.attachmentMeta)??[],(n==null?void 0:n.attachments)??[],lO(this.state.messages));this.patch({messages:[...this.state.messages,a],session:ri(this.state.session,"running"),runtimeHasActiveRun:Hw(this.state.session,this.state.capabilities)?!0:this.state.runtimeHasActiveRun,runtimeCanInterrupt:qw(this.state.session,this.state.capabilities)?!0:this.state.runtimeCanInterrupt});try{const c=await this.sendMessageWithFallback(t,s,n);this.patch({messages:Iw(this.state.messages,this.sessionId,c.message,s)})}catch(c){throw this.patch({messages:Ef(this.state.messages,s),session:ri(this.state.session,"failed"),runtimeHasActiveRun:!1,runtimeCanInterrupt:!1}),c}}async retryMessage(t){const n=this.state.messages.find(s=>s.clientRequestId===t);if(n){this.patch({messages:this.state.messages.map(s=>s.clientRequestId===t?{...s,deliveryState:"sending"}:s),runtimeHasActiveRun:Hw(this.state.session,this.state.capabilities)?!0:this.state.runtimeHasActiveRun,runtimeCanInterrupt:qw(this.state.session,this.state.capabilities)?!0:this.state.runtimeCanInterrupt});try{const s=await this.sendMessageWithFallback(n.content,t,{attachments:n.attachmentPayloads??[],attachmentMeta:n.attachments});this.patch({messages:Iw(this.state.messages,this.sessionId,s.message,t)})}catch(s){throw this.patch({messages:Ef(this.state.messages,t),session:ri(this.state.session,"failed")}),s}}}async enqueueMessage(t,n){const s=zw();try{const a=await AT(this.sessionId,{content:t,clientRequestId:s,model:(n==null?void 0:n.model)??null,reasoningLevel:(n==null?void 0:n.reasoningLevel)??null,permissionMode:Mh(),attachments:(n==null?void 0:n.attachments)??[]});this.patch({queuedMessages:vO(this.state.queuedMessages,a)}),await this.refreshQueue()}catch(a){throw a}}async deleteQueuedMessage(t){await LT(this.sessionId,t),await this.refreshQueue()}async steerQueuedMessage(t){await IT(this.sessionId,t),await this.refreshRuntimeSnapshot("queue_steer")}async interrupt(){await DT(this.sessionId),this.patch({session:ri(this.state.session,"interrupted"),runtimeHasActiveRun:!1,runtimeCanInterrupt:!1,errorCode:null,errorDetail:null})}async replyPermissionRequest(t,n){if(!(this.state.permissionRequests.find(c=>c.id===t)??null))return;const a=await _T(this.sessionId,t,n);this.patch({permissionRequests:_h(this.state.permissionRequests,a)})}reconnect(){var t;(t=this.realtimeClient)==null||t.reconnectNow()}async loadOlderMessages(){var t;if(!(this.state.historyState!=="ready"||this.state.loadingOlderMessages||!this.state.olderCursor)){this.patch({loadingOlderMessages:!0,errorCode:null,errorDetail:null});try{if(!((t=this.realtimeClient)==null?void 0:t.requestOlderMessages(this.state.olderCursor,yC)))throw new Error("REALTIME_NOT_CONNECTED")}catch(n){const s=n instanceof Error?n.message:"unknown";this.patch({loadingOlderMessages:!1,errorCode:"HISTORY_LOAD_MORE_FAILED",errorDetail:s})}}}destroy(){var t;this.clearHistoryBootstrapReadyTimer(),(t=this.realtimeClient)==null||t.close(),this.realtimeClient=null,this.markSeenTimer!==null&&(window.clearTimeout(this.markSeenTimer),this.markSeenTimer=null),this.runtimeRefreshTimer!==null&&(window.clearTimeout(this.runtimeRefreshTimer),this.runtimeRefreshTimer=null),this.runtimeRefreshMode=null}startRealtime(){var n;if(!((n=gn.getState().session)==null?void 0:n.accessToken)){gn.clear();return}this.realtimeClient=new HF({sessionId:this.sessionId,cursor:this.state.lastCursor,limit:vC,onSubscribed:()=>{this.patch({connectionState:"connected",historyState:this.state.historyState==="loading"&&Fm(this.state.session)===0?"ready":this.state.historyState,hasOlderMessages:to(this.state.session,this.state.messages.length)}),this.scheduleHistoryBootstrapReady()},onConnectionChange:s=>{var c;const a=this.state.connectionState;if(this.patch({connectionState:s,session:s==="reconnecting"&&vi((c=this.state.session)==null?void 0:c.runningState)?ri(this.state.session,"reconnecting"):this.state.session}),s==="connected"){this.clearRuntimeRefreshTimer("poll"),a!=="closed"&&a!=="connected"&&this.patch({errorCode:null,errorDetail:null});return}this.scheduleRuntimeRefresh("poll","connection_state_change")},onEnvelope:s=>{var c,l;this.clearHistoryBootstrapReadyTimer();const a=this.mergeHistoryMessages(s.messages,s.type==="session.backfill");this.patch({messages:a,lastCursor:s.cursor,historyState:"ready",olderCursor:s.olderCursor??this.state.olderCursor,hasOlderMessages:s.type==="session.backfill"?!!s.olderCursor:to(this.state.session,a.length),pagesLoaded:s.type==="session.backfill"?Math.max(this.state.pagesLoaded,a.length>0?1:0):this.state.pagesLoaded,session:ri(this.state.session,Ww(s.type,(c=this.state.session)==null?void 0:c.runningState))}),(l=this.realtimeClient)==null||l.updateCursor(s.cursor),this.scheduleMarkSeen(),this.state.queuedMessages.length>0&&this.refreshQueue()},onOlderHistory:s=>{const a=this.mergeHistoryMessages(s.messages,!1);this.patch({messages:a,historyState:"ready",loadingOlderMessages:!1,olderCursor:s.olderCursor,hasOlderMessages:!!s.olderCursor,pagesLoaded:this.state.pagesLoaded+1,errorCode:null,errorDetail:null})},onRuntimeMessage:s=>{this.handleRuntimeMessage(s)},onActivity:s=>{this.handleActivity(s)},onRuntimeStatus:s=>{this.handleRuntimeStatus(s)},onRuntimeError:s=>{this.handleRuntimeError(s)},onInterrupted:s=>{this.handleInterrupted(s)},onPermissionRequest:s=>{this.handlePermissionRequest(s)},onPermissionRequestResolved:s=>{this.handlePermissionRequestResolved(s)},onError:s=>{this.patch({loadingOlderMessages:!1,errorCode:s.error_code,errorDetail:s.detail})},onUnauthorized:()=>{gn.clear()}}),this.realtimeClient.start()}patch(t){let n=t;Object.prototype.hasOwnProperty.call(t,"session")&&(this.syncSeenWatermark(t.session??null),n={...t,session:this.applySeenWatermark(t.session??null)}),this.state={...this.state,...n},(Object.prototype.hasOwnProperty.call(n,"session")||Object.prototype.hasOwnProperty.call(n,"capabilities")||Object.prototype.hasOwnProperty.call(n,"contextUsage")||Object.prototype.hasOwnProperty.call(n,"messages")||Object.prototype.hasOwnProperty.call(n,"permissionRequests")||Object.prototype.hasOwnProperty.call(n,"queuedMessages"))&&this.persistSnapshot(),this.emit()}mergeHistoryMessages(t,n){const s=n&&this.replaceSnapshotSeedOnBackfill?this.state.messages.filter(c=>c.deliveryState!=="sent"):this.state.messages,a=ma(s,this.sessionId,t);return n&&(this.replaceSnapshotSeedOnBackfill=!1),a}handleError(t){this.clearHistoryBootstrapReadyTimer();const n=t instanceof Error?t.message:"unknown";this.patch({historyState:"error",errorCode:"RUNTIME_INIT_FAILED",errorDetail:n})}scheduleMarkSeen(){if(this.markSeenTimer!==null)return;const t=this.getTargetSeenAt();if(this.markSeenInFlight||t===null)return;const n=this.getMarkSeenThrottleDelayMs(),s=Math.max(uO,n);this.markSeenTimer=window.setTimeout(()=>{this.markSeenTimer=null;const a=this.getTargetSeenAt();a!==null&&(_t("session_seen.start",{sessionId:this.sessionId,targetSeenAt:a,seenWatermark:this.seenWatermark}),this.markSeenInFlight=!0,this.lastMarkSeenRequestAt=Date.now(),bT(this.sessionId).then(()=>{var c,l;this.bumpSeenWatermark(a),this.patch({session:Ow(this.state.session,a)}),(l=(c=this.options).onSeen)==null||l.call(c,this.sessionId,a),_t("session_seen.end",{sessionId:this.sessionId,seenWatermark:this.seenWatermark})}).catch(()=>{_t("session_seen.error",{sessionId:this.sessionId,targetSeenAt:a})}).finally(()=>{this.markSeenInFlight=!1,this.shouldMarkSeen()&&this.scheduleMarkSeen()}))},s)}clearRuntimeRefreshTimer(t){this.runtimeRefreshTimer!==null&&(t&&this.runtimeRefreshMode!==t||(window.clearTimeout(this.runtimeRefreshTimer),this.runtimeRefreshTimer=null,this.runtimeRefreshMode=null))}scheduleHistoryBootstrapReady(){if(this.state.historyState!=="loading"){this.clearHistoryBootstrapReadyTimer();return}this.historyBootstrapReadyTimer===null&&(this.historyBootstrapReadyTimer=window.setTimeout(()=>{this.historyBootstrapReadyTimer=null,this.state.historyState==="loading"&&this.patch({historyState:"ready",hasOlderMessages:to(this.state.session,this.state.messages.length),pagesLoaded:this.state.messages.length>0?Math.max(this.state.pagesLoaded,1):0})},500))}clearHistoryBootstrapReadyTimer(){this.historyBootstrapReadyTimer!==null&&(window.clearTimeout(this.historyBootstrapReadyTimer),this.historyBootstrapReadyTimer=null)}scheduleRuntimeRefresh(t,n){var s,a;if(!vi((s=this.state.session)==null?void 0:s.runningState)){this.clearRuntimeRefreshTimer();return}t==="poll"&&this.state.connectionState==="connected"||(this.clearRuntimeRefreshTimer(),this.runtimeRefreshMode=t,_t("session_runtime.refresh.schedule",{sessionId:this.sessionId,mode:t,reason:n,connectionState:this.state.connectionState,runningState:((a=this.state.session)==null?void 0:a.runningState)??null}),this.runtimeRefreshTimer=window.setTimeout(()=>{const c=this.runtimeRefreshMode??t;this.runtimeRefreshTimer=null,this.runtimeRefreshMode=null,this.refreshRuntimeState(c,n)},t==="poll"?hO:1200))}async refreshRuntimeState(t,n){var s,a,c,l,d;_t("session_runtime.refresh.start",{sessionId:this.sessionId,mode:t,reason:n,connectionState:this.state.connectionState,runningState:((s=this.state.session)==null?void 0:s.runningState)??null});try{const f=await By(this.sessionId);this.patch({session:Bw(this.state.session,f),runtimeHasActiveRun:f.hasActiveRun,runtimeCanInterrupt:f.canInterrupt,contextUsage:f.contextUsage,...Lh(f)}),await this.refreshQueue();const p=t==="poll"&&this.state.connectionState!=="connected"&&vi((a=this.state.session)==null?void 0:a.runningState);_t("session_runtime.refresh.end",{sessionId:this.sessionId,mode:t,reason:n,connectionState:this.state.connectionState,runningState:((c=this.state.session)==null?void 0:c.runningState)??null,continuePolling:p}),p&&this.scheduleRuntimeRefresh("poll","connection_poll")}catch(f){_t("session_runtime.refresh.error",{sessionId:this.sessionId,mode:t,reason:n,connectionState:this.state.connectionState,runningState:((l=this.state.session)==null?void 0:l.runningState)??null,message:f instanceof Error?f.message:"unknown"}),t==="poll"&&this.state.connectionState!=="connected"&&vi((d=this.state.session)==null?void 0:d.runningState)&&this.scheduleRuntimeRefresh("poll","connection_poll_retry")}}async refreshSessionMetadata(){const t=[];this.state.session===null&&t.push(vT(this.sessionId).then(n=>{this.patch({session:mc(n,this.state.session)})}).catch(()=>{})),Uw(this.state.capabilities)&&t.push(kT(this.sessionId).then(n=>{this.patch({capabilities:n})}).catch(()=>{})),t.length!==0&&await Promise.allSettled(t)}async refreshPermissionRequests(){try{const t=await ST(this.sessionId);this.patch({permissionRequests:t.items})}catch{return}}shouldRefreshSessionDetail(){return this.state.session===null||Uw(this.state.capabilities)||this.state.session.runningState===null}shouldRefreshRuntimeSnapshot(){return this.state.contextUsage===null}async refreshRuntimeSnapshot(t){_t("session_runtime.snapshot.start",{sessionId:this.sessionId,reason:t});try{const n=await By(this.sessionId);this.patch({session:Bw(this.state.session,n),runtimeHasActiveRun:n.hasActiveRun,runtimeCanInterrupt:n.canInterrupt,contextUsage:n.contextUsage,...Lh(n)}),await this.refreshQueue(),_t("session_runtime.snapshot.end",{sessionId:this.sessionId,reason:t,hasContextUsage:n.contextUsage!==null})}catch(n){_t("session_runtime.snapshot.error",{sessionId:this.sessionId,reason:t,message:n instanceof Error?n.message:"unknown"})}}async refreshQueue(){try{const t=await MT(this.sessionId);this.patch({queuedMessages:t.items})}catch{return}}async sendMessageWithFallback(t,n,s){var a;try{return await RT(this.sessionId,{content:t,clientRequestId:n,model:(s==null?void 0:s.model)??null,reasoningLevel:(s==null?void 0:s.reasoningLevel)??null,permissionMode:Mh(),attachments:(s==null?void 0:s.attachments)??[]})}catch(c){if(!(c instanceof Jn)||c.status!==404&&c.status!==405||(((a=s==null?void 0:s.attachments)==null?void 0:a.length)??0)>0)throw c;return TT(this.sessionId,{content:t,clientRequestId:n,permissionMode:Mh()})}}handleRuntimeStatus(t){var s;const n=Ah((s=this.state.session)==null?void 0:s.runningState,t.status);this.patch({session:ri(this.state.session,n),runtimeHasActiveRun:vi(n)?this.state.runtimeHasActiveRun??!0:!1,runtimeCanInterrupt:vi(n)?this.state.runtimeCanInterrupt:!1,errorCode:null,errorDetail:n===t.status?t.detail:this.state.errorDetail}),Jc(n)&&(this.clearRuntimeRefreshTimer(),this.refreshQueue(),this.refreshRuntimeSnapshot("runtime_terminal"))}handleActivity(t){if(this.patch({session:pO(this.state.session,t),runtimeHasActiveRun:t.hasActiveRun,runtimeCanInterrupt:t.canInterrupt,...Lh(t)}),Jc(t.runningState)){this.clearRuntimeRefreshTimer(),this.refreshQueue();return}(t.runningState==="stale"||t.runningState==="unknown")&&this.scheduleRuntimeRefresh("tail","activity_watchdog")}handleRuntimeMessage(t){var s;this.clearHistoryBootstrapReadyTimer();const n=ma(this.state.messages,this.sessionId,[t.message]);this.patch({messages:n,historyState:"ready",hasOlderMessages:to(this.state.session,n.length),session:ri(this.state.session,Ww("session.delta",(s=this.state.session)==null?void 0:s.runningState))}),this.scheduleMarkSeen(),this.state.queuedMessages.length>0&&this.refreshQueue()}handleRuntimeError(t){var s;const n=Ah((s=this.state.session)==null?void 0:s.runningState,"failed");this.clearRuntimeRefreshTimer(),this.patch({session:ri(this.state.session,n),runtimeHasActiveRun:!1,runtimeCanInterrupt:!1,errorCode:n==="failed"?t.error_code:this.state.errorCode,errorDetail:n==="failed"?t.detail:this.state.errorDetail}),this.refreshQueue()}handleInterrupted(t){var s;const n=Ah((s=this.state.session)==null?void 0:s.runningState,"interrupted");this.clearRuntimeRefreshTimer(),this.patch({session:ri(this.state.session,n),runtimeHasActiveRun:!1,runtimeCanInterrupt:!1,errorCode:n==="interrupted"?null:this.state.errorCode,errorDetail:n==="interrupted"?t.detail:this.state.errorDetail}),this.refreshQueue()}handlePermissionRequest(t){this.patch({permissionRequests:_h(this.state.permissionRequests,t.request)})}handlePermissionRequestResolved(t){this.patch({permissionRequests:_h(this.state.permissionRequests,t.request)})}shouldMarkSeen(){return this.getTargetSeenAt()!==null}getTargetSeenAt(){const t=[...this.state.messages].reverse().find(s=>s.role!=="user");if(!t)return null;const n=this.seenWatermark;return n?t.timestamp>n?t.timestamp:null:t.timestamp}syncSeenWatermark(t){t!=null&&t.lastSeenAt&&this.bumpSeenWatermark(t.lastSeenAt)}bumpSeenWatermark(t){this.seenWatermark&&this.seenWatermark>=t||(this.seenWatermark=t)}getMarkSeenThrottleDelayMs(){return this.lastMarkSeenRequestAt<=0?0:Math.max(0,dO-(Date.now()-this.lastMarkSeenRequestAt))}applySeenWatermark(t){return!t||!this.seenWatermark?t:Ow(t,this.seenWatermark)}emit(){for(const t of this.listeners)t()}persistSnapshot(){jr(Dh(this.sessionId),{session:this.state.session,capabilities:this.state.capabilities,runtimeHasActiveRun:this.state.runtimeHasActiveRun,runtimeCanInterrupt:this.state.runtimeCanInterrupt,contextUsage:this.state.contextUsage,messages:yO(this.state.messages),permissionRequests:this.state.permissionRequests,queuedMessages:this.state.queuedMessages})}}function cr(e,t){const[n,s]=v.useState(()=>t(e.getState()));return v.useEffect(()=>e.subscribe(()=>{s(t(e.getState()))}),[t,e]),n}function Fm(e){const t=e==null?void 0:e.messageCount;return typeof t=="number"&&Number.isFinite(t)?t:null}function mO(e,t){return t>0||Fm(e)===0?"ready":"loading"}function to(e,t){const n=Fm(e);return n!==null?n>t:t>=vC}function ri(e,t){return e&&{...e,runningState:t,activityState:bC(e,t,e.completedAt??null,vi(t))}}function Ow(e,t){return!e||e.lastSeenAt&&e.lastSeenAt>=t?e:{...e,lastSeenAt:t,activityState:e.activityState==="completed_unread"?"idle":e.activityState}}function Bw(e,t){return wC(e,{runningState:t.runningState,activityResolutionSource:t.activityResolutionSource,activityConfidence:t.activityConfidence,runId:t.runId,detail:t.detail,errorCode:t.errorCode,errorDetail:t.errorDetail,hasActiveRun:t.hasActiveRun,updatedAt:t.updatedAt,watchdogTriggeredAt:t.watchdogTriggeredAt})}function pO(e,t){return wC(e,t)}function wC(e,t){if(!e)return e;const n=gO(t.activityResolutionSource),s=Jc(t.runningState)?Ih(e.completedAt,t.updatedAt):null,a=t.runningState==="completed"||t.runningState==="interrupted"||t.runningState==="failed"?Ih(e.lastEventAt,t.updatedAt):t.updatedAt;return{...e,runningState:t.runningState,activitySource:n,activityResolutionSource:t.activityResolutionSource,activityConfidence:t.activityConfidence,runId:t.runId,lastEventAt:a,completedAt:s,lastErrorCode:t.runningState==="failed"?t.errorCode??e.lastErrorCode:null,lastErrorDetail:t.runningState==="failed"?t.errorDetail??t.detail??e.lastErrorDetail:null,watchdogTriggeredAt:t.watchdogTriggeredAt,updatedAt:Ih(e.updatedAt,t.updatedAt)??t.updatedAt,activityState:bC(e,t.runningState,s,t.hasActiveRun)}}function bC(e,t,n,s){return s||vi(t)?"running":n&&(!e.lastSeenAt||n>e.lastSeenAt)?"completed_unread":e.activityState==="running"||e.activityState==="completed_unread"?"idle":e.activityState??"idle"}function vi(e){return e==="starting"||e==="running"||e==="reconnecting"}function Jc(e){return e==="completed"||e==="interrupted"||e==="failed"}function Uw(e){if(e===null)return!0;const t=e.modelOptions??[];return t.length===0?!0:t.every(n=>n.usesProviderDefault===!0)}function Ww(e,t){return e==="session.backfill"?t??"idle":t==="completed"||t==="interrupted"||t==="failed"?t:"running"}function Ah(e,t){return Jc(e)?e:t}function Lh(e){return e.runningState==="failed"?{errorCode:e.errorCode,errorDetail:e.errorDetail??e.detail}:e.runningState==="interrupted"?{errorCode:null,errorDetail:e.detail}:e.runningState==="completed"?{errorCode:null,errorDetail:e.detail}:{errorCode:null,errorDetail:null}}function gO(e){return e==="authoritative_runtime"||e==="authoritative_provider_event"?"runtime":e==="inferred_log"?"inferred":"none"}function Ih(e,t){return e?t?e>=t?e:t:e:t??null}function zw(){var e,t;if(typeof((e=globalThis.crypto)==null?void 0:e.randomUUID)=="function")return globalThis.crypto.randomUUID();if(typeof((t=globalThis.crypto)==null?void 0:t.getRandomValues)=="function"){const n=new Uint8Array(16);globalThis.crypto.getRandomValues(n),n[6]=n[6]&15|64,n[8]=n[8]&63|128;const s=Array.from(n,a=>a.toString(16).padStart(2,"0")).join("");return`${s.slice(0,8)}-${s.slice(8,12)}-${s.slice(12,16)}-${s.slice(16,20)}-${s.slice(20)}`}return`fallback-${Date.now()}-${Math.random().toString(16).slice(2,10)}`}function Hw(e,t){return e?t&&e.provider===t.provider?!!t.canSendMessage:e.provider==="codex"||e.provider==="claude-code"||e.provider==="opencode":!1}function qw(e,t){return e?t&&e.provider===t.provider?!(!t.supportsInterrupt||e.provider==="claude-code"&&e.activitySource==="inferred"):e.provider==="codex"||e.provider==="opencode"?!0:e.provider==="claude-code"&&e.activitySource!=="inferred":!1}function Dh(e){return`session-runtime.snapshot.${e}`}function yO(e){return e.filter(t=>t.deliveryState==="sent").slice(-yC)}function vO(e,t){const n=e.filter(s=>s.id!==t.id);return n.push(t),n.sort((s,a)=>s.orderIndex-a.orderIndex),n}function _h(e,t){const n=e.filter(s=>s.id!==t.id);return n.push(t),n.sort((s,a)=>s.status!==a.status?s.status==="pending"?-1:1:a.createdAt.localeCompare(s.createdAt)),n}function mc(e,t){if(!e)return t;if(!t||$w(e,t))return e;if($w(t,e))return t;const n=Date.parse(e.updatedAt||e.lastMessageAt||e.createdAt),s=Date.parse(t.updatedAt||t.lastMessageAt||t.createdAt);return!Number.isFinite(n)||!Number.isFinite(s)?t:n>=s?e:t}function $w(e,t){return Vw(e)&&!Vw(t)&&e.lastEventAt===t.lastEventAt&&e.lastMessageAt===t.lastMessageAt&&e.completedAt===t.completedAt}function Vw(e){return e.activityState==="running"||vi(e.runningState)}function xC({children:e,className:t,frameRef:n,...s}){return i.jsx("div",{ref:n,className:["mobile-top-header-frame",t].filter(Boolean).join(" "),...s,children:e})}function vo({currentWorkspace:e,workspaces:t,onSelectWorkspace:n,className:s,containerRef:a,heading:c,content:l,sheetContent:d,triggerLabel:f,triggerAriaLabel:p,onTriggerClick:y,trailing:g,gestureHandlers:b}){const[k,S]=v.useState(!1),C=_r();return e?i.jsxs(i.Fragment,{children:[i.jsx(xC,{className:s,frameRef:a,...b,children:i.jsxs("section",{className:"mobile-workspace-home-header",children:[i.jsx("h1",{className:"mobile-workspace-switcher-heading",children:c??e.name}),i.jsxs("div",{className:"mobile-workspace-home-toolbar-top",children:[i.jsxs("button",{type:"button",className:"mobile-workspace-home-switcher","aria-label":p??h("shell.workspaceHomeSwitcherLabel"),onClick:()=>{if(y){y();return}C.trigger("selection"),S(!0)},children:[i.jsx("span",{className:"mobile-workspace-home-switcher-label",children:f??e.name}),i.jsx(xO,{})]}),i.jsx("div",{className:"mobile-workspace-home-toolbar-actions",children:g})]}),i.jsx("p",{className:"mobile-workspace-home-path",children:e.path}),l]})}),k&&!y?wO(i.jsxs(bO,{title:h("shell.workspaceHomeSwitcherTitle"),onClose:()=>S(!1),children:[i.jsx("div",{className:"mobile-workspace-home-group mobile-workspace-home-sheet-group",children:t.map(j=>i.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-sheet-row",onClick:()=>{j.id!==e.id&&C.trigger("selection"),n==null||n(j.id),S(!1)},children:[i.jsxs("div",{className:"mobile-workspace-home-session-main",children:[i.jsx("span",{className:"mobile-workspace-home-session-title",children:j.name}),i.jsx("span",{className:"mobile-workspace-home-session-meta",children:j.path})]}),i.jsx("span",{className:"mobile-workspace-home-row-trailing",children:j.id===e.id?i.jsx(SO,{}):i.jsx(kO,{})})]},j.id))}),d?d(()=>S(!1)):null]})):null]}):null}function wO(e){return typeof document>"u"?null:On.createPortal(e,document.body)}function bO({title:e,onClose:t,children:n}){return i.jsx("div",{className:"ios-action-sheet-overlay",role:"presentation",onClick:t,children:i.jsxs("div",{className:"mobile-workspace-home-sheet",role:"dialog","aria-modal":"true","aria-label":e,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:"mobile-workspace-home-sheet-card",children:[i.jsx("div",{className:"mobile-workspace-home-sheet-header",children:i.jsx("strong",{children:e})}),n]}),i.jsx("button",{type:"button",className:"ios-action-sheet-cancel",onClick:t,children:h("common.cancel")})]})})}function xO(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M4 6.5L8 10l4-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})})}function kO(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5L10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})})}function SO(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 5.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8"})})}function Ya({open:e,workspaces:t,initialWorkspaceId:n,onClose:s,onSelect:a}){const[c,l]=v.useState(""),[d,f]=v.useState(!1),p=_r();if(v.useEffect(()=>{e&&(l(CO(t,n)),f(!1))},[n,e,t]),!e||typeof document>"u")return null;const y=t.find(g=>g.id===c)??t[0]??null;return On.createPortal(i.jsx("div",{className:"ios-action-sheet-overlay",role:"presentation",onClick:s,children:i.jsxs("div",{className:"mobile-workspace-home-sheet",role:"dialog","aria-modal":"true","aria-label":h("shell.createSessionModalTitle"),onClick:g=>g.stopPropagation(),children:[i.jsxs("div",{className:"mobile-workspace-home-sheet-card",children:[i.jsx("div",{className:"mobile-workspace-home-sheet-header",children:i.jsx("strong",{children:h("shell.createSessionModalTitle")})}),i.jsxs("div",{className:"mobile-feature-form mobile-workspace-home-form mobile-create-session-form",children:[i.jsx("p",{className:"mobile-create-session-description",children:h("shell.createSessionModalDescription")}),i.jsxs("div",{className:"mobile-feature-field",children:[i.jsx("span",{children:h("shell.createSessionWorkspaceLabel")}),i.jsxs("button",{type:"button",className:"mobile-create-session-workspace-trigger","aria-label":`${h("shell.createSessionWorkspaceLabel")} ${(y==null?void 0:y.name)??""}`.trim(),"aria-expanded":d?"true":"false",disabled:t.length===0,onClick:()=>{p.trigger("selection"),f(g=>!g)},children:[i.jsxs("span",{className:"mobile-create-session-workspace-copy",children:[i.jsx("strong",{children:(y==null?void 0:y.name)??h("common.unknown")}),i.jsx("span",{children:(y==null?void 0:y.path)??h("common.unknown")})]}),i.jsx(jO,{expanded:d})]}),d?i.jsx("div",{className:"mobile-workspace-home-group mobile-create-session-workspace-list",role:"list",children:t.map(g=>i.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-create-session-workspace-row",onClick:()=>{g.id!==c&&p.trigger("selection"),l(g.id),f(!1)},children:[i.jsxs("span",{className:"mobile-create-session-workspace-option-copy",children:[i.jsx("strong",{children:g.name}),i.jsx("span",{children:g.path})]}),i.jsx("span",{className:"mobile-workspace-home-row-trailing",children:g.id===c?i.jsx(PO,{}):i.jsx(NO,{})})]},g.id))}):null]}),i.jsxs("div",{className:"mobile-create-session-provider-block",children:[i.jsxs("div",{className:"mobile-create-session-provider-header",children:[i.jsx("span",{className:"mobile-create-session-provider-label",children:h("shell.createSessionProviderLabel")}),i.jsx("span",{className:"mobile-create-session-provider-hint",children:h("shell.providerOptionHint")})]}),i.jsx(BS,{disabled:!c,onSelect:g=>{c&&a(c,g)}})]})]})]}),i.jsx("button",{type:"button",className:"ios-action-sheet-cancel",onClick:s,children:h("common.cancel")})]})}),document.body)}function CO(e,t){var n;return t&&e.some(s=>s.id===t)?t:((n=e[0])==null?void 0:n.id)??""}function jO({expanded:e}){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",className:"mobile-create-session-workspace-chevron","data-expanded":e?"true":"false",children:i.jsx("path",{d:"M4 6.5L8 10l4-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})})}function NO(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5L10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})})}function PO(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 5.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8"})})}const kC="mobile.conversation.preview.mode";function Fh(){if(typeof window>"u")return"preview";try{return window.localStorage.getItem(kC)==="immersive"?"immersive":"preview"}catch{return"preview"}}function wi(e){if(!(typeof window>"u"))try{window.localStorage.setItem(kC,e)}catch{}}const TO=15e3,Gw=.6,Oh=.6,Kw=8,EO=36,RO=48,MO=96;function AO(){const{sessionId:e="",workspaceId:t}=Kf(),n=Xr(),s=Wn(),a=v.useMemo(()=>new URLSearchParams(n.search),[n.search]),c=(t==null?void 0:t.trim())||null,l=v.useMemo(()=>_O(e,c,a),[c,a,e]),d=v.useMemo(()=>GO(e,n.state),[n.state,e]);return l?i.jsx(DO,{draft:l,navigate:s}):i.jsx(LO,{sessionId:e,bootstrapMessages:d})}function LO({sessionId:e,bootstrapMessages:t}){var Vt;const{shellMode:n,navigationGroups:s,requestNavigationRefresh:a,selectWorkspace:c,setSessionWorkspace:l,markNavigationSessionSeen:d,favoriteSessions:f,archiveSession:p,unarchiveSession:y,startDraftSession:g}=tr(),b=Wn(),k=v.useRef(null),S=v.useRef(null),[C,j]=v.useState(!1),[A,L]=v.useState(null),[M,O]=v.useState(!1),[q,_]=v.useState(!1),[I,F]=v.useState(null),[D,P]=v.useState(!1),[K,X]=v.useState(!1),$=v.useMemo(()=>s.flatMap(ke=>ke.sessions).find(ke=>ke.sessionId===e)??null,[s,e]);(!k.current||S.current!==e)&&((Vt=k.current)==null||Vt.destroy(),k.current=new fO(e,{initialSession:$,bootstrapMessages:t,onSeen:(ke,Qe)=>{d(ke,Qe)}}),S.current=e);const ee=k.current,{showToast:te,dismissToast:pe}=Kn(),ne=An(),z=_r(),ye=v.useRef(null),E=v.useRef(null),W=v.useRef(null),re=v.useRef(($==null?void 0:$.runningState)??null),T=v.useRef(new Set),ae=cr(ee,ke=>ke.session),Le=cr(ee,ke=>ke.capabilities),je=cr(ee,ke=>ke.runtimeHasActiveRun),He=cr(ee,ke=>ke.runtimeCanInterrupt),qe=cr(ee,ke=>ke.messages),et=cr(ee,ke=>ke.permissionRequests),ot=cr(ee,ke=>ke.queuedMessages),bt=cr(ee,ke=>ke.contextUsage),Ct=cr(ee,ke=>ke.historyState),lt=cr(ee,ke=>ke.errorCode),kt=cr(ee,ke=>ke.errorDetail),Ve=cr(ee,ke=>ke.loadingOlderMessages),Tt=cr(ee,ke=>ke.hasOlderMessages),Ot=cr(ee,ke=>ke.connectionState),[St,Mt]=v.useState(null),[Ht,At]=v.useState(null),vt=$O(ae),$t=vt&&nk(Le)&&(ae==null?void 0:ae.provider)===(Le==null?void 0:Le.provider),Dt=ot.some(ke=>ke.status==="queued"||ke.status==="dispatching"),Lt=n!=="mobile",ue=PC(!Lt),ge=(ae==null?void 0:ae.workspaceId)??($==null?void 0:$.workspaceId)??null,Be=v.useMemo(()=>new Set(f.map(ke=>ke.session.sessionId)),[f]),Pe=v.useMemo(()=>s.map(ke=>ke.workspace),[s]),ft=v.useMemo(()=>OO(s,ge,e),[ge,s,e]),dt=v.useMemo(()=>SC(s,(ae==null?void 0:ae.workspaceId)??($==null?void 0:$.workspaceId)??null,Be),[Be,s,$==null?void 0:$.workspaceId,ae==null?void 0:ae.workspaceId]),Rt=v.useMemo(()=>CC(f),[f]),ht=v.useMemo(()=>ge?s.find(ke=>ke.workspace.id===ge)??null:null,[ge,s]);(ae==null?void 0:ae.provider)??($==null||$.provider);const Nt=v.useMemo(()=>{var ke;return Yi(((ke=ae??$)==null?void 0:ke.title)??null,h("conversation.titleFallback"))},[$,ae]),jt=v.useMemo(()=>(ht==null?void 0:ht.sessions.filter(ke=>ke.isArchived===!0&&ke.isSubagent!==!0))??[],[ht]),V=v.useRef(null),Me=v.useRef(null),ze=v.useRef(null),[wt,Bt]=v.useState(null),{composerPortalTarget:Zt}=vS();return v.useEffect(()=>{ee.applyNavigationSession($)},[$,ee]),v.useEffect(()=>(ee.initialize(),()=>{ee.destroy()}),[ee]),v.useEffect(()=>(l(e,(ae==null?void 0:ae.workspaceId)??null),()=>{l(e,null)}),[ae==null?void 0:ae.workspaceId,e,l]),v.useEffect(()=>()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),v.useEffect(()=>{if(!lt||!kt){W.current!==null&&(window.clearTimeout(W.current),W.current=null),E.current=null,ye.current=null,pe("conversation-runtime-error");return}const ke=`${lt}:${kt}`;if(!(ye.current===ke||E.current===ke)){if(W.current!==null&&(window.clearTimeout(W.current),W.current=null),IO((ae==null?void 0:ae.provider)??null,lt,kt)){E.current=ke,W.current=window.setTimeout(()=>{E.current=null,W.current=null,ye.current=ke,te({id:"conversation-runtime-error",title:h("conversation.runtimeErrorTitle"),description:kt,tone:"error",durationMs:null})},TO);return}E.current=null,ye.current=ke,te({id:"conversation-runtime-error",title:h("conversation.runtimeErrorTitle"),description:kt,tone:"error",durationMs:null})}},[pe,lt,kt,ae==null?void 0:ae.provider,te]),v.useEffect(()=>{const ke=re.current,Qe=(ae==null?void 0:ae.runningState)??null;(ke==="starting"||ke==="running"||ke==="reconnecting")&&Qe==="completed"&&z.trigger("success"),re.current=Qe},[z,ae==null?void 0:ae.runningState]),v.useEffect(()=>{const ke=et.filter(Qe=>Qe.status==="pending");for(const Qe of ke)T.current.has(Qe.id)||(T.current.add(Qe.id),te({id:`permission-request-${Qe.id}`,title:h("conversation.permissionRequestToastTitle"),description:Qe.title,tone:"warning",durationMs:8e3}),ne.bridge.showNotification(h("conversation.permissionRequestToastTitle"),Qe.title))},[et,ne.bridge,te]),jC(Me,wt,!Lt,e),NC(Me,ze,!Lt,e),i.jsxs(i.Fragment,{children:[i.jsxs("main",{ref:Me,className:"workbench-page conversation-page-shell mobile-page-fixed-root mobile-conversation-page","data-mobile-shell":!Lt,"data-preview-mode":Lt?void 0:ue.displayMode,"data-preview-dragging":Lt?void 0:ue.isDragging,style:Lt?void 0:ue.pageStyle,children:[Lt?i.jsx(lC,{session:ae??$}):null,Lt?null:i.jsx(vo,{containerRef:ze,className:"mobile-conversation-page-header",gestureHandlers:ue.mainGestureHandlers,currentWorkspace:(ht==null?void 0:ht.workspace)??Pe[0]??null,workspaces:Pe,heading:Nt.fullTitle,triggerAriaLabel:ue.displayMode==="preview"?h("shell.hideSessionSidebar"):h("shell.showSessionSidebar"),onTriggerClick:()=>{ue.togglePreview()},trailing:i.jsx("span",{className:"mobile-conversation-toolbar-title",title:Nt.fullTitle,children:Nt.displayTitle})}),Lt?null:i.jsx(TC,{visible:ue.isVisible,widthPx:ue.previewWidthPx,isDragging:ue.isDragging,gestureHandlers:ue.railGestureHandlers,activeSessionId:ft,createSessionActionLabel:h("shell.createSession"),favoriteItems:Rt,items:dt,workspaceSectionLabel:h("shell.mobileConversationCurrentWorkspaceSection"),onCreateSession:()=>{X(!0)},archiveCurrentActionLabel:h("shell.archiveCurrentSessionAction"),archiveFolderActionLabel:h("shell.archiveFolderAction"),onArchiveActiveSession:()=>{O(!0)},onOpenArchiveFolder:()=>{_(!0)},onActivate:ke=>{wi("preview"),b(er(ke.workspace.id,ke.session.sessionId))}}),i.jsx("div",{className:"mobile-conversation-stage",...Lt?{}:ue.mainGestureHandlers,children:i.jsxs("div",{ref:V,className:"mobile-conversation-main",children:[i.jsx(tk,{connectionState:Ot,onReconnect:()=>ee.reconnect()}),i.jsx(_F,{requests:et,replyingRequestId:A,onReply:async(ke,Qe)=>{L(ke);try{await ee.replyPermissionRequest(ke,Qe)}catch(cn){te({title:h("conversation.permissionRequestReplyFailed"),description:cn instanceof Error?cn.message:void 0,tone:"error"})}finally{L(null)}}}),i.jsx(aC,{sessionId:e,messages:qe,historyState:Ct,loadingOlderMessages:Ve,hasOlderMessages:Tt,provider:(ae==null?void 0:ae.provider)??null,onLoadOlderMessages:()=>{ee.loadOlderMessages()},onRetryMessage:ke=>{ee.retryMessage(ke)}}),i.jsx(WF,{items:ot,deletingQueueItemId:St,steeringQueueItemId:Ht,canSteer:$t,onDelete:async ke=>{Mt(ke);try{await ee.deleteQueuedMessage(ke)}finally{Mt(null)}},onSteer:async ke=>{At(ke);try{await ee.steerQueuedMessage(ke),a()}finally{At(null)}}}),i.jsx(ik,{capabilities:Le,draftStorageId:e,panelRef:Lt?void 0:Bt,portalContainer:Lt?null:Zt,hasActiveRun:je,contextUsage:bt,hasPendingQueuedMessages:Dt,canInterrupt:He,isSubmitting:C,isRunning:vt,onInterrupt:async()=>{await ee.interrupt(),a()},onSend:async(ke,Qe)=>{j(!0);try{await ee.sendMessage(ke,{model:Qe==null?void 0:Qe.model,reasoningLevel:Qe==null?void 0:Qe.reasoningLevel,attachments:Qe==null?void 0:Qe.attachments,attachmentMeta:Qe==null?void 0:Qe.attachmentMeta}),a()}finally{j(!1)}},onQueueSend:async(ke,Qe)=>{j(!0);try{await ee.enqueueMessage(ke,{model:Qe==null?void 0:Qe.model,reasoningLevel:Qe==null?void 0:Qe.reasoningLevel,attachments:Qe==null?void 0:Qe.attachments,attachmentMeta:Qe==null?void 0:Qe.attachmentMeta})}finally{j(!1)}}})]})})]}),i.jsx(HO,{open:M,busy:D,onClose:()=>{D||O(!1)},onConfirm:async()=>{if(!D){P(!0);try{if(await p(e),O(!1),te({title:h("shell.archiveAdded"),tone:"success"}),ge){c(ge),wi("preview"),b(Ga(ge));return}b("/workspaces")}catch(ke){te({title:ke instanceof Error?ke.message:h("shell.navigationLoadFailed"),tone:"error"})}finally{P(!1)}}}}),i.jsx(qO,{open:q,workspaceName:(ht==null?void 0:ht.workspace.name)??null,sessions:jt,restoringSessionId:I,onClose:()=>{I||_(!1)},onRestore:async ke=>{F(ke);try{await y(ke),te({title:h("shell.archiveRestored"),tone:"success"})}catch(Qe){te({title:Qe instanceof Error?Qe.message:h("shell.navigationLoadFailed"),tone:"error"})}finally{F(null)}}}),i.jsx(Ya,{open:K,workspaces:Pe,initialWorkspaceId:ge,onClose:()=>X(!1),onSelect:(ke,Qe)=>{X(!1),wi("immersive"),g(ke,Qe)}})]})}function IO(e,t,n){return e!=="opencode"?!1:t==="OPENCODE_REQUEST_TIMEOUT"||t==="PROVIDER_RUNTIME_TIMEOUT"||/\bSERVER_TIMEOUT\b/i.test(n)||/timeout/i.test(n)||/超时/.test(n)}function DO({draft:e,navigate:t}){const{shellMode:n,navigationGroups:s,requestNavigationRefresh:a,selectWorkspace:c,setSessionWorkspace:l,upsertNavigationSession:d,favoriteSessions:f,startDraftSession:p}=tr(),[y,g]=v.useState(!1),[b,k]=v.useState([]),[S,C]=v.useState(!1),j=v.useMemo(()=>HT(e.provider),[e.provider]),[A,L]=v.useState(j),M=n!=="mobile",O=PC(!M),q=v.useMemo(()=>FO(e),[e]),_=v.useMemo(()=>new Set(f.map(ne=>ne.session.sessionId)),[f]),I=v.useMemo(()=>s.map(ne=>ne.workspace),[s]),F=v.useMemo(()=>Yi(q.title??null,h("conversation.titleFallback")),[q]),D=v.useMemo(()=>SC(s,e.workspaceId,_),[e.workspaceId,_,s]),P=v.useMemo(()=>CC(f),[f]),K=v.useRef(null),X=v.useRef(null),$=v.useRef(null),[ee,te]=v.useState(null),{composerPortalTarget:pe}=vS();return v.useEffect(()=>(l(e.sessionId,e.workspaceId),()=>{l(e.sessionId,null)}),[e.sessionId,e.workspaceId,l]),v.useEffect(()=>{let ne=!1;return L(j),NT(e.provider,e.workspaceId).then(z=>{ne||L(z)}).catch(()=>{}),()=>{ne=!0}},[e.provider,e.workspaceId,j]),jC(X,ee,!M,e.sessionId),NC(X,$,!M,e.sessionId),i.jsxs(i.Fragment,{children:[i.jsxs("main",{ref:X,className:"workbench-page conversation-page-shell mobile-page-fixed-root mobile-conversation-page","data-mobile-shell":!M,"data-preview-mode":M?void 0:O.displayMode,"data-preview-dragging":M?void 0:O.isDragging,style:M?void 0:O.pageStyle,children:[M?i.jsx(lC,{session:q}):null,M?null:i.jsx(vo,{containerRef:$,className:"mobile-conversation-page-header",gestureHandlers:O.mainGestureHandlers,currentWorkspace:I.find(ne=>ne.id===e.workspaceId)??I[0]??null,workspaces:I,heading:F.fullTitle,triggerAriaLabel:O.displayMode==="preview"?h("shell.hideSessionSidebar"):h("shell.showSessionSidebar"),onTriggerClick:()=>{O.togglePreview()},trailing:i.jsx("span",{className:"mobile-conversation-toolbar-title",title:F.fullTitle,children:F.displayTitle})}),M?null:i.jsx(TC,{visible:O.isVisible,widthPx:O.previewWidthPx,isDragging:O.isDragging,gestureHandlers:O.railGestureHandlers,activeSessionId:e.sessionId,createSessionActionLabel:h("shell.createSession"),favoriteItems:P,items:D,workspaceSectionLabel:h("shell.mobileConversationCurrentWorkspaceSection"),onCreateSession:()=>{C(!0)},onActivate:ne=>{wi("preview"),t(er(ne.workspace.id,ne.session.sessionId))}}),i.jsx("div",{className:"mobile-conversation-stage",...M?{}:O.mainGestureHandlers,children:i.jsxs("div",{ref:K,className:"mobile-conversation-main",children:[i.jsx(tk,{connectionState:"closed",onReconnect:()=>{}}),i.jsx(aC,{sessionId:e.sessionId,messages:b,historyState:"ready",loadingOlderMessages:!1,hasOlderMessages:!1,provider:e.provider,onLoadOlderMessages:()=>{},onRetryMessage:()=>{}}),i.jsx(ik,{capabilities:A,draftStorageId:e.sessionId,panelRef:M?void 0:te,portalContainer:M?null:pe,contextUsage:null,isSubmitting:y,isRunning:!1,onSend:async(ne,z)=>{var E,W;const ye=QO();k(re=>[...re,uC(e.sessionId,ne,ye,(z==null?void 0:z.attachmentMeta)??[],(z==null?void 0:z.attachments)??[])]),g(!0);try{const re=Yr.getState().profile.defaultPermissionMode,T=await ET({workspaceId:e.workspaceId,provider:e.provider,content:ne,clientRequestId:ye,model:(z==null?void 0:z.model)??null,reasoningLevel:(z==null?void 0:z.reasoningLevel)??null,permissionMode:re==="default"?null:re,attachments:(z==null?void 0:z.attachments)??[]});T.session&&d(T.session);const ae=((W=(E=T.session)==null?void 0:E.workspaceId)==null?void 0:W.trim())||e.workspaceId;l(T.sessionId,ae),wi("preview"),t(er(ae,T.sessionId),{replace:!0,state:T.message?{bootstrap:{sessionId:T.sessionId,messages:[T.message]}}:null}),a()}catch(re){throw k(T=>Ef(T,ye)),re}finally{g(!1)}}})]})})]}),i.jsx(Ya,{open:S,workspaces:I,initialWorkspaceId:e.workspaceId,onClose:()=>C(!1),onSelect:(ne,z)=>{C(!1),wi("immersive"),p(ne,z)}})]})}function _O(e,t,n,s=null){var l,d;if(!VO(e))return null;const a=t??((l=n.get("workspaceId"))==null?void 0:l.trim())??null,c=((d=n.get("provider"))==null?void 0:d.trim())??s??null;return!a||!WT(c)?null:{sessionId:e,workspaceId:a,provider:c}}function FO(e){const t=new Date().toISOString();return{sessionId:e.sessionId,workspaceId:e.workspaceId,provider:e.provider,providerSessionId:`draft://${e.sessionId}`,rawStoreRef:`draft://${e.sessionId}`,parentSessionId:null,isSubagent:!1,subagentLabel:null,isArchived:!1,title:zT(e.provider),messageCount:0,lastMessageAt:null,createdAt:t,updatedAt:t,syncStatus:"idle",syncCursor:null,lastSyncAt:null,lastErrorCode:null,lastErrorDetail:null,resumedAt:null,runningState:"idle",activitySource:"none",lastEventAt:null,completedAt:null,lastSeenAt:null,activityState:"idle"}}function SC(e,t,n){if(!t)return[];const s=e.find(a=>a.workspace.id===t);return s?ym([s]).filter(a=>!a.session.isArchived&&a.session.isSubagent!==!0&&!n.has(a.session.sessionId)).map(a=>({entry:a,depth:0})):[]}function CC(e){return e.filter(t=>t.session.isSubagent!==!0).map(t=>({entry:t,depth:0}))}function OO(e,t,n){var d;if(!t)return n;const s=e.find(f=>f.workspace.id===t);if(!s)return n;const a=new Map(s.sessions.map(f=>[f.sessionId,f]));let c=a.get(n);if(!c)return n;const l=new Set([c.sessionId]);for(;;){const f=((d=c.parentSessionId)==null?void 0:d.trim())||null;if(!f)return c.sessionId;const p=a.get(f);if(!p||l.has(p.sessionId))return c.sessionId;l.add(p.sessionId),c=p}}function jC(e,t,n,s){v.useEffect(()=>{const a=e.current;if(!n||!a){a&&a.style.removeProperty("--mobile-conversation-composer-height");return}if(!t){a.style.removeProperty("--mobile-conversation-composer-height");return}const c=a,l=t;function d(){!e.current||!l.isConnected||c.style.setProperty("--mobile-conversation-composer-height",`${l.offsetHeight}px`)}d();const f=typeof ResizeObserver<"u"?new ResizeObserver(d):null;return f==null||f.observe(l),window.addEventListener("resize",d),()=>{f==null||f.disconnect(),window.removeEventListener("resize",d),a.style.removeProperty("--mobile-conversation-composer-height")}},[t,n,s,e])}function NC(e,t,n,s){v.useEffect(()=>{const a=e.current,c=t.current;if(!n||!a){a&&a.style.removeProperty("--mobile-conversation-page-header-height");return}if(!c){a.style.removeProperty("--mobile-conversation-page-header-height");return}const l=a,d=c;function f(){!e.current||!d.isConnected||l.style.setProperty("--mobile-conversation-page-header-height",`${d.offsetHeight}px`)}f();const p=typeof ResizeObserver<"u"?new ResizeObserver(f):null;return p==null||p.observe(d),window.addEventListener("resize",f),()=>{p==null||p.disconnect(),window.removeEventListener("resize",f),a.style.removeProperty("--mobile-conversation-page-header-height")}},[n,t,s,e])}function PC(e){const t=_r(),[n,s]=v.useState(()=>e?Fh():"immersive"),[a,c]=v.useState(()=>Yw()),[l,d]=v.useState(()=>e&&Fh()==="preview"?"default":"closed"),f=v.useRef(l),p=v.useRef(null);v.useEffect(()=>{f.current=l},[l]),v.useEffect(()=>{if(!e){p.current=null,f.current="closed",d("closed"),s("immersive");return}const F=Fh();s(F),d(F==="preview"?"default":"closed")},[e]),v.useEffect(()=>{e&&wi(n)},[e,n]),v.useEffect(()=>{if(typeof window>"u")return;function F(){c(Yw())}return F(),window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[]);function y(F){f.current=F,d(F)}function g(F="default"){y(F),s("preview")}function b(){y("closed"),s("immersive")}function k(){y("expanded"),s("preview")}function S(){if(f.current!=="closed"){t.trigger("gesture"),b();return}t.trigger("gesture"),g()}function C(F,D){if(!e||D.touches.length!==1){p.current=null;return}if(BO(D.target)){p.current=null;return}const P=D.touches[0];if(!P){p.current=null;return}if(F==="main"){if(f.current==="closed"&&P.clientX>MO){p.current=null;return}}else if(f.current==="closed"){p.current=null;return}p.current={source:F,intent:F==="rail"?"rail":f.current==="closed"?"open":"close",startX:P.clientX,startY:P.clientY,lastX:P.clientX,lastY:P.clientY,horizontalLocked:!1}}function j(F){const D=p.current,P=F.touches[0];if(!e||!D||!P)return;const K=P.clientX-D.startX,X=P.clientY-D.startY;if(D.lastX=P.clientX,D.lastY=P.clientY,!D.horizontalLocked){if(Math.abs(K)<Kw&&Math.abs(X)<Kw)return;if(Math.abs(K)<=Math.abs(X)){p.current=null;return}if(D.intent==="open"&&K<=0){p.current=null;return}if(D.intent==="close"&&K>=0){p.current=null;return}D.horizontalLocked=!0}}function A(F){var X;const D=p.current;if(p.current=null,!(D!=null&&D.horizontalLocked))return;const P=(X=F==null?void 0:F.changedTouches)==null?void 0:X[0];P&&(D.lastX=P.clientX,D.lastY=P.clientY);const K=D.lastX-D.startX;if(D.intent==="open"){K>=EO&&(t.trigger("gesture"),g("default"));return}if(D.intent==="close"){K<=-34&&(t.trigger("gesture"),b());return}if(K<=-34){t.trigger("gesture"),b();return}K>=RO&&f.current==="default"&&(t.trigger("gesture"),k())}const L=l==="expanded"?Oh:l==="default"?Gw:0,M=Math.round(a*L*100)/100,O=L===0?0:L/Oh,q={"--mobile-conversation-preview-default-width":`${Math.round(a*Gw*100)/100}px`,"--mobile-conversation-preview-max-width":`${Math.round(a*Oh*100)/100}px`,"--mobile-conversation-preview-width":`${M}px`,"--mobile-conversation-preview-progress":O.toFixed(4)};return{closePreview:b,displayMode:l==="closed"?"immersive":"preview",isDragging:!1,isVisible:l!=="closed",mainGestureHandlers:{onTouchStart:F=>C("main",F),onTouchMove:j,onTouchEnd:A,onTouchCancel:A},pageStyle:q,previewWidthPx:M,railGestureHandlers:{onTouchStart:F=>C("rail",F),onTouchMove:j,onTouchEnd:A,onTouchCancel:A},togglePreview:S}}function TC({visible:e,widthPx:t,isDragging:n,gestureHandlers:s,activeSessionId:a,createSessionActionLabel:c,favoriteItems:l,items:d,workspaceSectionLabel:f,onCreateSession:p,archiveCurrentActionLabel:y,archiveFolderActionLabel:g,onArchiveActiveSession:b,onOpenArchiveFolder:k,onActivate:S}){return e?i.jsxs("aside",{className:"mobile-conversation-preview-rail terminal-mobile-list-rail surface-card","data-dragging":n,style:{width:`${t}px`,maxWidth:`${t}px`},...s,children:[c&&p?i.jsx("div",{className:"mobile-conversation-preview-topbar terminal-mobile-list-footer",children:i.jsxs("button",{type:"button",className:"mobile-conversation-preview-create-button workbench-import-toggle terminal-mobile-list-create",onClick:p,children:[i.jsx("span",{className:"workbench-import-toggle-symbol","aria-hidden":"true",children:"+"}),i.jsx("span",{className:"workbench-import-toggle-label",children:c})]})}):null,i.jsxs("div",{className:"mobile-conversation-preview-body terminal-mobile-list-body",children:[l.length>0?i.jsxs("section",{className:"mobile-conversation-preview-group mobile-conversation-preview-list-favorites terminal-mobile-list-group terminal-mobile-list-group-pinned",children:[i.jsxs("div",{className:"mobile-conversation-preview-group-heading terminal-mobile-list-group-heading",children:[i.jsx("span",{children:h("shell.favoriteSectionTitle")}),i.jsx("span",{className:"workbench-section-counter",children:l.length})]}),i.jsx("div",{className:"mobile-conversation-preview-list mobile-conversation-preview-list-static terminal-mobile-session-list",children:l.map(C=>i.jsx(Qw,{entry:C.entry,depth:C.depth,activeSessionId:a,onActivate:S,workspaceName:C.entry.workspace.name},`favorite:${C.entry.workspace.id}:${C.entry.session.sessionId}`))})]}):null,i.jsxs("section",{className:"mobile-conversation-preview-group mobile-conversation-preview-group-workspace terminal-mobile-list-group terminal-mobile-list-group-workspace",children:[i.jsxs("div",{className:"mobile-conversation-preview-group-heading terminal-mobile-list-group-heading",children:[i.jsx("span",{children:f}),i.jsx("span",{className:"workbench-section-counter",children:d.length})]}),d.length===0?i.jsx("div",{className:"workbench-session-empty",children:h("shell.emptyWorkspaceSessions")}):i.jsx("div",{className:"mobile-conversation-preview-list terminal-mobile-session-list","data-preview-gesture":"ignore",children:d.map(C=>i.jsx(Qw,{entry:C.entry,depth:C.depth,activeSessionId:a,onActivate:S},`${C.entry.workspace.id}:${C.entry.session.sessionId}`))})]})]}),y&&b||g&&k?i.jsxs("div",{className:"mobile-conversation-preview-actions terminal-mobile-list-footer",children:[y&&b?i.jsx("button",{type:"button",className:"mobile-conversation-preview-archive-button workbench-import-toggle",onClick:()=>{b()},children:y}):null,g&&k?i.jsx("button",{type:"button",className:"mobile-conversation-preview-archive-button workbench-import-toggle",onClick:k,children:g}):null]}):null]}):null}function Qw({entry:e,depth:t,activeSessionId:n,onActivate:s,workspaceName:a}){const c=e.session.sessionId===n;return i.jsx("article",{className:"mobile-conversation-preview-entry terminal-mobile-session-card","data-active":c,children:i.jsxs("button",{type:"button",className:"mobile-conversation-preview-item terminal-mobile-session-primary","data-active":c,"data-depth":t,onClick:()=>s(e),children:[i.jsx("span",{className:UO(e.session,c),"aria-hidden":"true"}),i.jsxs("div",{className:"mobile-conversation-preview-item-body",children:[i.jsx("span",{className:"mobile-conversation-preview-item-title",children:e.session.title||h("common.unknown")}),i.jsx("span",{className:"mobile-conversation-preview-item-meta",children:EC(e.session,a)})]})]})})}function Yw(){return typeof window>"u"?390:Math.max(window.innerWidth||390,320)}function BO(e){return e instanceof Element?!!e.closest("input, textarea, select, option, label, [contenteditable='true'], [data-preview-gesture='ignore']"):!1}function UO(e,t){const n=Lm("mobile-conversation-preview-indicator",e);return n.endsWith(" is-idle")&&t?"mobile-conversation-preview-indicator is-active":n}function EC(e,t){const n=Qc(e);return[t??null,WO(e.provider),zO(e.lastMessageAt??e.updatedAt),n].filter(Boolean).join(" · ")}function WO(e){return h(e==="codex"?"conversation.providerCodex":e==="opencode"?"conversation.providerOpenCode":"conversation.providerClaude")}function zO(e){return e?new Date(e).toLocaleString(void 0,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}):h("common.unknown")}function HO({open:e,busy:t,onClose:n,onConfirm:s}){return v.useEffect(()=>{if(!e)return;function a(c){c.key==="Escape"&&!t&&n()}return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[t,n,e]),!e||typeof document>"u"?null:On.createPortal(i.jsxs("div",{className:"workbench-modal-layer",children:[i.jsx("button",{type:"button",className:"workbench-modal-backdrop","aria-label":h("common.close"),disabled:t,onClick:n}),i.jsxs("section",{className:"workbench-modal-card surface-card",role:"dialog","aria-modal":"true","aria-label":h("shell.archiveConfirmTitle"),children:[i.jsx("div",{className:"workbench-modal-header",children:i.jsxs("div",{className:"workbench-modal-title-wrap",children:[i.jsx("h2",{children:h("shell.archiveConfirmTitle")}),i.jsx("p",{children:h("shell.archiveConfirmDescription")})]})}),i.jsx("div",{className:"workbench-modal-body",children:i.jsxs("div",{className:"workbench-modal-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:t,onClick:n,children:h("common.cancel")}),i.jsx("button",{type:"button",className:"secondary-button workbench-danger-button",disabled:t,onClick:()=>{s()},children:h("shell.archiveAction")})]})})]})]}),document.body)}function qO({open:e,workspaceName:t,sessions:n,restoringSessionId:s,onClose:a,onRestore:c}){return v.useEffect(()=>{if(!e)return;function l(d){d.key==="Escape"&&!s&&a()}return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[a,e,s]),!e||typeof document>"u"?null:On.createPortal(i.jsxs("div",{className:"workbench-modal-layer",children:[i.jsx("button",{type:"button",className:"workbench-modal-backdrop","aria-label":h("common.close"),disabled:!!s,onClick:a}),i.jsxs("section",{className:"workbench-modal-card surface-card",role:"dialog","aria-modal":"true","aria-label":h("shell.archiveModalTitle"),children:[i.jsx("div",{className:"workbench-modal-header",children:i.jsxs("div",{className:"workbench-modal-title-wrap",children:[i.jsx("h2",{children:h("shell.archiveModalTitle")}),i.jsx("p",{children:t?`${t} · ${h("shell.archiveModalDescription")}`:h("shell.archiveModalDescription")})]})}),i.jsx("div",{className:"workbench-modal-body",children:n.length>0?i.jsx("div",{className:"workbench-archive-list",children:n.map(l=>{const d=Yi(l.title,h("common.unknown"));return i.jsxs("article",{className:"workbench-archive-item",children:[i.jsxs("div",{className:"workbench-archive-item-main",children:[i.jsx("strong",{title:d.fullTitle,children:d.displayTitle}),i.jsx("p",{children:EC(l)})]}),i.jsx("button",{type:"button",className:"secondary-button",disabled:s===l.sessionId,onClick:()=>{c(l.sessionId)},children:h("shell.unarchiveAction")})]},l.sessionId)})}):i.jsx("p",{className:"workbench-section-empty",children:h("shell.archiveEmpty")})})]})]}),document.body)}function $O(e){return e?e.activityState==="running"?!0:e.runningState==="starting"||e.runningState==="running"||e.runningState==="reconnecting":!1}function VO(e){return e.startsWith("draft-")}function GO(e,t){if(!t||typeof t!="object")return[];const n=t.bootstrap;if(!n||typeof n!="object")return[];const s=n.sessionId,a=n.messages;return s!==e||!Array.isArray(a)?[]:a.filter(KO)}function KO(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.messageId=="string"&&typeof t.provider=="string"&&typeof t.providerSessionId=="string"&&typeof t.role=="string"&&typeof t.content=="string"&&typeof t.timestamp=="string"&&typeof t.sequence=="number"&&typeof t.rawRef=="string"}function QO(){const e=globalThis.crypto;return e&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`}const YO=420;function Xw({entry:e,isFavorite:t,isActive:n=!1,depth:s=0,variant:a="default",hasSubsessions:c=!1,showActions:l=!0,onActivate:d,onToggleSubsessions:f,onToggleFavorite:p,onArchive:y,onUnarchive:g,onRename:b}){const[k,S]=v.useState(!1),C=v.useRef(null),j=v.useRef(!1),A=_r(),{session:L,workspace:M}=e,O=L.title??L.sessionId,q=L.provider==="codex"?h("conversation.providerCodex"):L.provider==="opencode"?h("conversation.providerOpenCode"):h("conversation.providerClaude"),_=[q,JO(L.lastMessageAt??L.updatedAt??null),Qc(L)].filter(Boolean).join(" · "),I=eB(L),F=I?tB(I):null,D=a==="mobile"?null:Qc(L),P=D?AS("session-list-activity-badge",L):null;v.useEffect(()=>()=>{K()},[]);function K(){C.current!==null&&(window.clearTimeout(C.current),C.current=null)}function X(z){!c||z.pointerType==="mouse"||(K(),C.current=window.setTimeout(()=>{j.current=!0,A.trigger("gesture"),f==null||f()},YO))}function $(){K()}function ee(){if(j.current){j.current=!1;return}A.trigger("selection"),d(L.sessionId)}const te=async()=>{const z=window.prompt(h("shell.renameModalDescription"),O);z&&(await b(L.sessionId,z.trim()),S(!1))},pe=async()=>{if(L.isArchived){await g(L.sessionId),S(!1);return}await y(L.sessionId),S(!1)},ne=()=>{p(L.sessionId),S(!1)};return i.jsxs("article",{className:"session-list-item","data-depth":s,"data-active":n,"data-has-subsessions":c,"data-variant":a,children:[i.jsxs("button",{type:"button",className:"session-list-link",onClick:ee,onPointerDown:X,onPointerUp:$,onPointerCancel:$,onPointerLeave:$,children:[i.jsx("span",{className:XO(L),"aria-hidden":"true"}),i.jsxs("div",{className:"session-list-copy",children:[i.jsx("div",{className:"session-list-title",children:O||h("shell.searchEntry")}),i.jsx("div",{className:"session-list-meta",children:a==="mobile"?i.jsx("span",{children:_}):i.jsxs(i.Fragment,{children:[i.jsx("span",{children:M.name}),D&&P?i.jsxs(i.Fragment,{children:[i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsx("span",{className:P,children:D})]}):null,i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsx("span",{children:q})]})}),F?i.jsx("div",{className:"session-list-error",title:I??void 0,children:F}):null]})]}),l?i.jsxs("div",{className:"session-list-actions",children:[i.jsx("button",{type:"button",className:"ghost-button","aria-expanded":k,onClick:()=>{A.trigger("selection"),S(z=>!z)},children:h("shell.sessionMoreAction")}),k?i.jsxs("div",{className:"session-action-menu surface-card",role:"menu","aria-label":h("shell.sessionMoreAction"),children:[i.jsx("button",{type:"button",className:"session-action-menu-item",role:"menuitem",onClick:ne,children:h(t?"shell.unfavoriteAction":"shell.favoriteAction")}),i.jsx("button",{type:"button",className:"session-action-menu-item",role:"menuitem",onClick:()=>void pe(),children:L.isArchived?h("shell.unarchiveAction"):h("shell.archiveAction")}),i.jsx("button",{type:"button",className:"session-action-menu-item",role:"menuitem",onClick:()=>void te(),children:h("shell.renameAction")})]}):null]}):null]})}function XO(e,t){return Lm("session-list-indicator",e)}function JO(e){return e?new Date(e).toLocaleString(void 0,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}):h("common.unknown")}function ZO(e){return Qa(e)||e.syncStatus==="error"}function eB(e){var s,a;if(!ZO(e))return null;const t=((s=e.lastErrorCode)==null?void 0:s.trim())??"",n=((a=e.lastErrorDetail)==null?void 0:a.replace(/\s+/g," ").trim())??"";return t&&n&&!n.includes(t)?`${t} · ${n}`:n||t||(e.syncStatus==="error"&&!Qa(e)?h("conversation.syncStatusError"):h("conversation.runtimeErrorTitle"))}function tB(e,t=96){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1)).trimEnd()}…`}function nB(){const e=Wn(),{navigationGroups:t,favoriteSessionIds:n,currentWorkspaceId:s,currentSessionId:a,navigationLoading:c,selectWorkspace:l,toggleFavoriteSession:d,archiveSession:f,unarchiveSession:p,renameSession:y,startDraftSession:g}=tr(),b=t.find(D=>D.workspace.id===s)??t[0]??null,k=v.useMemo(()=>new Set(n),[n]),S=v.useMemo(()=>b?ym([b]).filter(D=>!D.session.isArchived&&!D.session.isSubagent):[],[b]),C=v.useMemo(()=>h2(S),[S]),j=(b==null?void 0:b.workspace.id)??"",A=!!j,[L,M]=v.useState([]),[O,q]=v.useState(!1);v.useEffect(()=>{if(!a)return;const D=C.filter(P=>P.children.some(K=>K.session.sessionId===a)).map(P=>P.entry.session.sessionId);D.length!==0&&M(P=>{const K=new Set(P);let X=!1;for(const $ of D)K.has($)||(K.add($),X=!0);return X?Array.from(K):P})},[a,C]);function _(D){M(P=>P.includes(D)?P.filter(K=>K!==D):[...P,D])}function I(D,P){wi("immersive"),e(er(D,P))}function F(D,P){q(!1),wi("immersive"),g(D,P)}return i.jsxs("main",{className:"session-index-page mobile-feature-page mobile-page-scroll-root mobile-page-with-top-header",children:[i.jsx(vo,{currentWorkspace:(b==null?void 0:b.workspace)??null,workspaces:t.map(D=>D.workspace),onSelectWorkspace:D=>{l(D),e(Ga(D))},content:i.jsx("button",{type:"button",className:"primary-button mobile-session-index-create-button",disabled:c||!A,onClick:()=>q(!0),children:h("shell.createSession")})}),i.jsx("div",{className:"mobile-page-top-body",children:i.jsxs("section",{className:"session-section session-section-sheet",children:[i.jsxs("header",{className:"session-section-heading",children:[i.jsx("div",{children:i.jsx("h2",{children:h("shell.mobileConversationCurrentWorkspaceSection")})}),i.jsx("span",{className:"session-section-count",children:C.length})]}),C.length===0?i.jsx("p",{className:"session-section-empty",children:h(c?"shell.searchSessionHint":"shell.emptyWorkspaceSessions")}):i.jsx("div",{className:"session-current-workspace-list",children:C.map(D=>{const P=D.entry.session.sessionId,K=L.includes(P);return i.jsxs("div",{className:"session-list-tree-node",children:[i.jsx(Xw,{entry:D.entry,isFavorite:k.has(P),isActive:a===P,variant:"mobile",hasSubsessions:D.children.length>0,onActivate:X=>I(D.entry.workspace.id,X),onToggleSubsessions:()=>_(P),onToggleFavorite:X=>{d(X)},onArchive:X=>f(X),onUnarchive:X=>p(X),onRename:(X,$)=>y(X,$)}),K&&D.children.length>0?i.jsx("div",{className:"session-list-children",children:D.children.map(X=>i.jsx(Xw,{entry:X,isFavorite:k.has(X.session.sessionId),isActive:a===X.session.sessionId,depth:1,variant:"mobile",onActivate:$=>I(X.workspace.id,$),onToggleFavorite:$=>{d($)},onArchive:$=>f($),onUnarchive:$=>p($),onRename:($,ee)=>y($,ee)},`${X.workspace.id}:${X.session.sessionId}`))}):null]},`${D.entry.workspace.id}:${P}`)})})]})}),i.jsx(Ya,{open:O,workspaces:t.map(D=>D.workspace),initialWorkspaceId:s??j,onClose:()=>q(!1),onSelect:F})]})}function rB(){const{currentWorkspaceId:e}=tr();return e?i.jsx(Ha,{to:po(e,"files"),replace:!0}):i.jsx("main",{className:"mobile-feature-page mobile-page-scroll-root",children:i.jsxs("article",{className:"mobile-feature-empty surface-card",children:[i.jsx("h1",{children:h("shell.filesEntry")}),i.jsx("p",{children:h("shell.toolsWorkspaceRequiredBody")})]})})}function iB(){const{currentWorkspaceId:e}=tr();return e?i.jsx(Ha,{to:po(e,"git"),replace:!0}):i.jsx("main",{className:"mobile-feature-page mobile-page-scroll-root",children:i.jsxs("article",{className:"mobile-feature-empty surface-card",children:[i.jsx("h1",{children:h("shell.gitEntry")}),i.jsx("p",{children:h("shell.toolsWorkspaceRequiredBody")})]})})}function Y4(){return Je.request("/api/terminals/shells")}function X4(e){return Je.request(`/api/terminals?workspaceId=${encodeURIComponent(e)}`)}function sB(e){return Je.request(`/api/terminals/templates/${encodeURIComponent(e)}/stop`,{method:"POST"})}function J4(e){return Je.request("/api/terminals",{method:"POST",body:JSON.stringify(e)})}function Z4(e){return Je.request(`/api/terminals/${encodeURIComponent(e)}`,{method:"DELETE"})}function eW(e){return Je.request(`/api/terminals/${encodeURIComponent(e)}/record`,{method:"DELETE"})}function tW(e,t={}){const n=new URLSearchParams;typeof t.beforeSeq=="number"&&n.set("beforeSeq",String(t.beforeSeq)),typeof t.limit=="number"&&n.set("limit",String(t.limit));const s=n.toString();return Je.request(`/api/terminals/${encodeURIComponent(e)}/history${s?`?${s}`:""}`)}function oB(e){return Je.request("/api/terminals/templates",{method:"POST",body:JSON.stringify(e)})}function aB(e,t){return Je.request(`/api/terminals/templates/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function lB(e){return Je.request(`/api/terminals/templates/${encodeURIComponent(e)}`,{method:"DELETE"})}function Jw(e,t){return Je.request(`/api/terminals/templates/${encodeURIComponent(e)}/run`,{method:"POST",body:JSON.stringify(t)})}function cB(e){return[{value:"",label:h("terminal.runtimeAutoOption"),description:h("terminal.runtimeAutoDescription")},{value:"tmux",label:e==="windows"?h("terminal.runtimePersistentLabel"):"tmux",description:h(e==="windows"?"terminal.runtimeWindowsPersistentDescription":"terminal.runtimeTmuxDescription")},{value:"embedded-pty",label:"embedded-pty",description:h("terminal.runtimeEmbeddedDescription")}]}function Zw(e,t){return e?e==="conpty-powershell"?h("terminal.runtimeConptyPowerShellLabel"):e==="conpty-cmd"?h("terminal.runtimeConptyCmdLabel"):e==="conpty-git-bash"?h("terminal.runtimeConptyGitBashLabel"):e==="tmux"&&t==="windows"?h("terminal.runtimePersistentLabel"):e:h("terminal.runtimeAutoOption")}function nW(e,t){return e?e==="embedded-pty"?"pty":e==="conpty-powershell"||e==="conpty-cmd"||e==="conpty-git-bash"||e==="tmux"&&t==="windows"?h("terminal.runtimePersistentShortLabel"):e:h("terminal.runtimeAutoShortLabel")}function uB(e){return e instanceof Jn?e.errorCode==="RUNTIME_DEPENDENCY_MISSING"||e.message.includes("当前系统未安装 tmux"):!1}function dB({open:e,busy:t=!1,onClose:n,onConfirmFallback:s}){return v.useEffect(()=>{if(!e)return;function a(c){c.key==="Escape"&&!t&&n()}return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[t,n,e]),!e||typeof document>"u"?null:On.createPortal(i.jsxs("div",{className:"workbench-modal-layer",children:[i.jsx("button",{type:"button",className:"workbench-modal-backdrop","aria-label":h("common.close"),onClick:()=>{t||n()}}),i.jsxs("section",{className:"workbench-modal-card surface-card terminal-runtime-fallback-modal",role:"dialog","aria-modal":"true","aria-label":h("terminal.runtimeMissingDialogTitle"),children:[i.jsxs("div",{className:"workbench-modal-header",children:[i.jsxs("div",{className:"workbench-modal-title-wrap",children:[i.jsx("h2",{children:h("terminal.runtimeMissingDialogTitle")}),i.jsx("p",{children:h("terminal.runtimeMissingDialogDescription")})]}),i.jsx("button",{type:"button",className:"workbench-modal-close","aria-label":h("common.close"),onClick:()=>{t||n()},children:"x"})]}),i.jsxs("div",{className:"workbench-modal-body terminal-runtime-fallback-body",children:[i.jsxs("section",{className:"terminal-runtime-fallback-section",children:[i.jsx("span",{className:"badge","data-tone":"error",children:"tmux"}),i.jsx("p",{className:"status-text",children:h("terminal.runtimeMissingInstallDescription")}),i.jsxs("ul",{className:"terminal-runtime-fallback-list",children:[i.jsx("li",{children:h("terminal.runtimeMissingInstallMacArm")}),i.jsx("li",{children:h("terminal.runtimeMissingInstallMacIntel")}),i.jsx("li",{children:h("terminal.runtimeMissingInstallDebian")}),i.jsx("li",{children:h("terminal.runtimeMissingInstallFedora")})]})]}),i.jsxs("section",{className:"terminal-runtime-fallback-section",children:[i.jsx("span",{className:"badge",children:"embedded-pty"}),i.jsx("p",{className:"status-text",children:h("terminal.runtimeMissingFallbackDescription")})]}),i.jsxs("div",{className:"workbench-modal-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:t,onClick:n,children:h("terminal.runtimeMissingKeepAction")}),i.jsx("button",{type:"button",className:"primary-button",disabled:t,onClick:s,children:h(t?"terminal.runtimeMissingFallbackPending":"terminal.runtimeMissingFallbackAction")})]})]})]})]}),document.body)}const pc={mode:"command",name:"",cwd:"",target:"",args:"",port:""},eb=60*1e3;function hB(e){return e?new Date(e).toLocaleString():h("common.unknown")}function fB(e){return e.split(" ").map(t=>t.trim()).filter(Boolean)}function mB(e){var t,n,s;return((t=e.find(a=>a.id==="cmd"&&a.available))==null?void 0:t.id)??((n=e.find(a=>a.available))==null?void 0:n.id)??((s=e[0])==null?void 0:s.id)??""}function pB(e){const t=e.name.trim();if(t)return t;const n=e.target.trim(),s=e.args.trim();return n?s?`${n} ${s}`:n:e.mode==="script"?h("terminalManager.defaultScriptName"):h("terminalManager.defaultCommandName")}function gB(e){const t=e.args.join(" ");return t?`${e.command} ${t}`:e.command}function yB(e){return{mode:RC(e),name:e.name,cwd:e.cwd,target:e.command,args:e.args.join(" "),port:e.port===null?"":String(e.port)}}function RC(e){const t=e.command.toLowerCase();return t.endsWith(".ps1")||t.endsWith(".bat")||t.endsWith(".cmd")||t.endsWith(".sh")?"script":"command"}function vB(e){const t=e.trim();if(!t)return null;const n=Number(t);return Number.isInteger(n)?n:Number.NaN}function tb(e,t){return e.get(t)??null}function wB(e,t){return e.port===null?{tone:"untracked",title:h("terminalManager.portUnset"),summary:h("terminalManager.portUnsetDescription"),badgeLabel:h("terminalManager.portUnset")}:t!=null&&t.occupied?{tone:"running",title:h("terminalManager.portOccupied"),summary:t.processName||h("terminalManager.processCommandFallback"),badgeLabel:t.processId?`PID ${t.processId}`:h("terminalManager.statusRunning"),badgeTone:"success"}:{tone:"idle",title:h("terminalManager.portAvailable"),summary:h("terminalManager.portAvailableDescription"),badgeLabel:h("terminalManager.statusStopped")}}function bB({open:e,title:t,description:n,onClose:s,children:a,className:c}){return v.useEffect(()=>{if(!e)return;function l(d){d.key==="Escape"&&s()}return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[s,e]),!e||typeof document>"u"?null:On.createPortal(i.jsxs("div",{className:"workbench-modal-layer",children:[i.jsx("button",{type:"button",className:"workbench-modal-backdrop","aria-label":h("common.close"),onClick:s}),i.jsxs("section",{className:["workbench-modal-card","surface-card","terminal-manager-modal-card",c].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":t,children:[i.jsxs("div",{className:"workbench-modal-header",children:[i.jsxs("div",{className:"workbench-modal-title-wrap",children:[i.jsx("h2",{children:t}),i.jsx("p",{children:n})]}),i.jsx("button",{type:"button",className:"workbench-modal-close","aria-label":h("common.close"),onClick:s,children:"x"})]}),i.jsx("div",{className:"workbench-modal-body",children:a})]})]}),document.body)}function xB({open:e,busy:t,title:n,description:s,confirmLabel:a,onClose:c,onConfirm:l,className:d}){return v.useEffect(()=>{if(!e)return;function f(p){p.key==="Escape"&&!t&&c()}return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[t,c,e]),!e||typeof document>"u"?null:On.createPortal(i.jsxs("div",{className:"workbench-modal-layer",children:[i.jsx("button",{type:"button",className:"workbench-modal-backdrop","aria-label":h("common.close"),disabled:t,onClick:c}),i.jsxs("section",{className:["workbench-modal-card","surface-card",d].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":n,children:[i.jsx("div",{className:"workbench-modal-header",children:i.jsxs("div",{className:"workbench-modal-title-wrap",children:[i.jsx("h2",{children:n}),i.jsx("p",{children:s})]})}),i.jsx("div",{className:"workbench-modal-body",children:i.jsxs("div",{className:"workbench-modal-actions terminal-manager-confirm-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:t,onClick:c,children:h("common.cancel")}),i.jsx("button",{type:"button",className:"secondary-button workbench-danger-button",disabled:t,onClick:()=>{l()},children:t?h("terminalManager.templateRemoving"):a})]})})]})]}),document.body)}function nb({label:e,value:t,options:n,open:s,onToggle:a,onChange:c}){const l=n.find(d=>d.value===t)??n[0]??null;return i.jsxs("div",{className:"field-group terminal-manager-mobile-picker",children:[i.jsx("span",{children:e}),i.jsxs("button",{type:"button",className:"terminal-manager-mobile-picker-trigger","aria-label":`${e} ${(l==null?void 0:l.label)??""}`.trim(),"aria-expanded":s?"true":"false",onClick:a,children:[i.jsxs("span",{className:"terminal-manager-mobile-picker-copy",children:[i.jsx("strong",{children:(l==null?void 0:l.label)??h("common.unknown")}),l!=null&&l.description?i.jsx("span",{children:l.description}):null]}),i.jsx(kB,{expanded:s})]}),s?i.jsx("div",{className:"terminal-manager-mobile-picker-list",role:"listbox","aria-label":e,children:n.map(d=>{const f=d.value===t;return i.jsxs("button",{type:"button",role:"option",className:"terminal-manager-mobile-picker-option","aria-selected":f,disabled:d.disabled,onClick:()=>{c(d.value)},children:[i.jsxs("span",{className:"terminal-manager-mobile-picker-option-copy",children:[i.jsx("strong",{children:d.label}),d.description?i.jsx("span",{children:d.description}):null]}),i.jsx("span",{className:"terminal-manager-mobile-picker-option-indicator","aria-hidden":"true",children:f?i.jsx(CB,{}):i.jsx(SB,{})})]},d.value||"__empty__")})}):null]})}function kB({expanded:e}){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",className:"terminal-manager-mobile-picker-chevron","data-expanded":e?"true":"false",children:i.jsx("path",{d:"M4 6.5L8 10l4-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.7"})})}function SB(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5L10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})})}function CB(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 5.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8"})})}function MC({className:e,currentWorkspaceId:t,navigationGroups:n}){var Rt,ht,Nt,jt;const s=An(),{subscribeTerminalManagerSnapshot:a,requestTerminalManagerRefresh:c,addTerminalManagerSnapshotListener:l}=tr(),d=(t==null?void 0:t.trim())||null,[f,p]=v.useState([]),[y,g]=v.useState([]),[b,k]=v.useState([]),[S,C]=v.useState([]),[j,A]=v.useState(""),[L,M]=v.useState(""),[O,q]=v.useState(pc),[_,I]=v.useState(null),[F,D]=v.useState(null),[P,K]=v.useState([]),[X,$]=v.useState(!1),[ee,te]=v.useState(!1),[pe,ne]=v.useState(null),[z,ye]=v.useState(null),[E,W]=v.useState(null),[re,T]=v.useState(null),[ae,Le]=v.useState(null),[je,He]=v.useState(!1),[qe,et]=v.useState(null),{showToast:ot}=Kn(),bt=(e==null?void 0:e.includes("mobile-tool-process-panel"))??!1,Ct=_!==null,lt=_==="edit"?y.find(V=>V.id===F)??null:null,kt=_==="edit";v.useEffect(()=>{_t("terminal_manager.props",{currentWorkspaceId:t,workspaceCount:n.length})},[t,n.length]);const Ve=v.useMemo(()=>S.find(V=>V.id===j)??null,[j,S]),Tt=v.useMemo(()=>cB(s.ui.osFamily),[s.ui.osFamily]),Ot=v.useMemo(()=>new Map(b.map(V=>[V.templateId,V])),[b]),St=v.useMemo(()=>b.filter(V=>V.occupied).length,[b]),Mt=v.useMemo(()=>y.filter(V=>V.port!==null).length,[y]),Ht=(Ve==null?void 0:Ve.available)===!1&&S.length>0;v.useEffect(()=>{A(V=>S.length?V&&S.some(Me=>Me.id===V)?V:mB(S):"")},[S]),v.useEffect(()=>{!Ct||!d||S.length>0||vt(d)},[d,S.length,Ct]),v.useEffect(()=>{Ct||et(null)},[Ct]),v.useEffect(()=>{_==="edit"&&F&&!lt&&(I(null),D(null),q(pc),M(""),et(null))},[lt,F,_]),v.useEffect(()=>{!re||E===re.templateId||y.some(V=>V.id===re.templateId)||T(null)},[re,E,y]),v.useEffect(()=>{if(!d){p([]),g([]),k([]),$(!1);return}const V=Mn(Bh(d),eb);_t("terminal_manager.snapshot",{workspaceId:d,cached:!!V,cachedTemplateCount:(V==null?void 0:V.templates.length)??0,cachedStatusCount:(V==null?void 0:V.templateStatuses.length)??0}),V?(p(V.terminals),g(V.templates),k(V.templateStatuses),C(V.shellOptions??[]),$(!1)):(p([]),g([]),k([]),C([]),$(!0))},[d]),v.useEffect(()=>{if(d)return l(V=>{V.workspaceId===d&&(_t("terminal_manager.snapshot_received",{workspaceId:V.workspaceId,terminalCount:V.terminals.length,templateCount:V.templates.length,statusCount:V.templateStatuses.length}),At(V),$(!1))})},[d,l]),v.useEffect(()=>{if(!d)return;const V=Mn(Bh(d),eb)!==null;if(a(d),V){const Me=window.setTimeout(()=>{vt(d)},1500);return()=>{window.clearTimeout(Me)}}vt(d)},[d,c,a]),v.useEffect(()=>{d&&jr(Bh(d),{terminals:f,templates:y,templateStatuses:b,shellOptions:S})},[d,S,b,y,f]);function At(V){p(V.terminals),g(V.templates),k(V.templateStatuses),C(V.shellOptions??[])}function vt(V){_t("terminal_manager.refresh_requested",{workspaceId:V}),c(V)}function $t(){I(null),D(null),q(pc),M(""),et(null)}function Dt(){D(null),q(pc),M(""),I("create")}function Lt(V){D(V.id),q(yB(V)),M(V.runtimeType??""),I("edit")}async function ue(V){if(d){ye(V);try{await sB(V),vt(d),ot({title:h("terminalManager.stopProcessSuccess"),tone:"success"})}catch(Me){ot({title:Me instanceof Error?Me.message:h("terminalManager.stopProcessFailed"),tone:"error"})}finally{ye(null)}}}async function ge(){if(!d||!O.target.trim())return;const V=vB(O.port);if(Number.isNaN(V)){ot({title:h("terminalManager.invalidPort"),tone:"error"});return}te(!0);try{const Me={workspaceId:d,name:pB(O),cwd:O.cwd.trim()||void 0,command:O.target.trim(),args:fB(O.args),port:V,runtimeType:L||null};if(kt&&F){const ze=await aB(F,Me);g(wt=>wt.map(Bt=>Bt.id===ze.id?ze:Bt))}else await oB(Me);$t(),vt(d),ot({title:h(kt?"terminalManager.templateUpdateSuccess":"terminalManager.templateSaveSuccess"),tone:"success"})}catch(Me){ot({title:Me instanceof Error?Me.message:h(kt?"terminalManager.templateUpdateFailed":"terminalManager.templateSaveFailed"),tone:"error"})}finally{te(!1)}}async function Be(V,Me){if(d){W(V.id);try{await lB(V.id),g(ze=>ze.filter(wt=>wt.id!==V.id)),k(ze=>ze.filter(wt=>wt.templateId!==V.id)),K(ze=>ze.filter(wt=>wt!==V.id)),T(ze=>(ze==null?void 0:ze.templateId)===V.id?null:ze),F===V.id&&$t(),vt(d),ot({title:h("terminalManager.templateDeleteSuccess"),tone:"success"})}catch(ze){ot({title:ze instanceof Error?ze.message:h("terminalManager.templateDeleteFailed"),tone:"error"})}finally{W(null)}}}async function Pe(V){if(!d)return;const Me=Ve!=null&&Ve.available?Ve.shell:void 0;ne(V);try{await Jw(V,{shell:Me}),vt(d),ot({title:h("terminalManager.templateRunSuccess"),tone:"success"})}catch(ze){if(uB(ze)){Le({templateId:V,shell:Me});return}ot({title:ze instanceof Error?ze.message:h("terminalManager.templateRunFailed"),tone:"error"})}finally{ne(null)}}async function ft(){if(!(!d||!ae)){He(!0);try{await Jw(ae.templateId,{shell:ae.shell,runtimeType:"embedded-pty"}),Le(null),vt(d),ot({title:h("terminalManager.templateRunSuccess"),tone:"success"})}catch(V){ot({title:V instanceof Error?V.message:h("terminalManager.templateRunFailed"),tone:"error"})}finally{He(!1)}}}function dt(V){K(Me=>Me.includes(V)?Me.filter(ze=>ze!==V):[...Me,V])}return n.length?d?i.jsxs("section",{className:["conversation-panel","surface-card","terminal-manager-panel",e].filter(Boolean).join(" "),children:[i.jsx(dB,{open:ae!==null,busy:je,onClose:()=>{je||Le(null)},onConfirmFallback:()=>{ft()}}),i.jsxs("div",{className:"terminal-manager-header terminal-manager-desktop-header",children:[i.jsxs("div",{className:"terminal-manager-panel-heading",children:[i.jsx("span",{className:"terminal-manager-panel-eyebrow",children:h("terminalManager.quickLaunchTitle")}),i.jsxs("div",{children:[i.jsx("h2",{children:h("terminalManager.templateSectionTitle")}),i.jsx("p",{className:"status-text",children:h("terminalManager.desktopPanelDescription")})]})]}),i.jsxs("div",{className:"terminal-manager-overview",children:[i.jsxs("article",{className:"terminal-manager-overview-card",children:[i.jsx("span",{children:h("terminalManager.runningCountLabel")}),i.jsx("strong",{children:St})]}),i.jsxs("article",{className:"terminal-manager-overview-card",children:[i.jsx("span",{children:h("terminalManager.portWatchCountLabel")}),i.jsx("strong",{children:Mt})]}),i.jsxs("article",{className:"terminal-manager-overview-card",children:[i.jsx("span",{children:h("terminalManager.terminalCountLabel")}),i.jsx("strong",{children:f.length})]})]}),i.jsxs("div",{className:"terminal-manager-toolbar terminal-manager-toolbar-header",children:[i.jsx("button",{className:"ghost-button",type:"button",disabled:!d||X,onClick:()=>{d&&vt(d)},children:h("terminalManager.refresh")}),i.jsx("button",{className:"primary-button",type:"button",disabled:!d,onClick:()=>{Dt()},children:h("terminalManager.openCreateModalAction")})]})]}),i.jsxs("section",{className:"terminal-manager-section",children:[i.jsxs("div",{className:"terminal-manager-section-header",children:[i.jsxs("div",{children:[i.jsx("h3",{children:h("terminalManager.templateSectionTitle")}),i.jsx("p",{className:"status-text",children:h("terminalManager.templateSectionDescription")})]}),i.jsx("span",{className:"workbench-section-counter",children:y.length})]}),X&&!y.length?i.jsx("p",{className:"status-text",children:h("common.loading")}):null,y.length?i.jsx("div",{className:"terminal-manager-list",children:y.map(V=>{const Me=tb(Ot,V.id),ze=wB(V,Me),wt=P.includes(V.id),Bt=h(wt?"terminalManager.hideDetailsAction":"terminalManager.showDetailsAction");return i.jsxs("article",{className:"terminal-manager-card terminal-manager-desktop-card","data-tone":ze.tone,"data-expanded":wt?"true":"false",children:[i.jsxs("div",{className:"terminal-manager-card-header",children:[i.jsxs("div",{className:"terminal-manager-card-title",children:[i.jsx("span",{className:"terminal-manager-card-indicator","aria-hidden":"true"}),i.jsx("strong",{children:V.name})]}),i.jsxs("div",{className:"terminal-manager-card-tools",children:[i.jsx("span",{className:"badge terminal-runtime-badge",children:Zw(V.runtimeType,s.ui.osFamily)}),i.jsx("span",{className:"badge",children:RC(V)==="script"?h("terminalManager.scriptMode"):h("terminalManager.commandMode")}),i.jsx("button",{className:"terminal-manager-detail-toggle",type:"button","aria-label":Bt,"aria-expanded":wt,onClick:()=>{dt(V.id)},children:"i"})]})]}),i.jsxs("div",{className:"terminal-manager-status-panel",children:[i.jsxs("div",{className:"terminal-manager-status-copy",children:[i.jsx("p",{className:"terminal-manager-status-title",children:ze.title}),i.jsx("p",{className:"status-text",children:ze.summary})]}),i.jsxs("div",{className:"terminal-manager-status-badges",children:[i.jsx("span",{className:"terminal-manager-stat-pill",children:V.port===null?h("terminalManager.portUnset"):`${h("terminalManager.portLabel")} ${V.port}`}),i.jsx("span",{className:"badge","data-tone":ze.badgeTone,children:ze.badgeLabel})]})]}),i.jsxs("div",{className:"terminal-manager-actions",children:[Me!=null&&Me.occupied?i.jsx("button",{className:"secondary-button",type:"button",disabled:z===V.id,onClick:()=>{ue(V.id)},children:z===V.id?h("terminalManager.stoppingProcess"):h("terminalManager.stopProcessAction")}):null,i.jsx("button",{className:"secondary-button",type:"button",disabled:pe===V.id||Ht,onClick:()=>{Pe(V.id)},children:pe===V.id?h("terminalManager.runningTemplate"):h("terminalManager.runTemplateAction")})]}),wt?i.jsxs("section",{className:"terminal-manager-details","aria-label":h("terminalManager.detailsSectionTitle"),children:[i.jsxs("div",{className:"terminal-manager-detail-grid",children:[i.jsxs("div",{className:"terminal-manager-detail-item terminal-manager-detail-item-wide",children:[i.jsx("span",{children:h("terminalManager.commandPreviewLabel")}),i.jsx("strong",{children:gB(V)})]}),i.jsxs("div",{className:"terminal-manager-detail-item",children:[i.jsx("span",{children:h("terminalManager.cwdLabel")}),i.jsx("strong",{children:V.cwd})]}),i.jsxs("div",{className:"terminal-manager-detail-item",children:[i.jsx("span",{children:h("terminal.runtimeField")}),i.jsx("strong",{children:Zw(V.runtimeType,s.ui.osFamily)})]}),i.jsxs("div",{className:"terminal-manager-detail-item",children:[i.jsx("span",{children:h("terminalManager.updatedAt")}),i.jsx("strong",{children:hB(V.updatedAt)})]}),i.jsxs("div",{className:"terminal-manager-detail-item",children:[i.jsx("span",{children:h("terminalManager.portLabel")}),i.jsx("strong",{children:V.port===null?h("terminalManager.portUnset"):V.port})]}),Me!=null&&Me.processId?i.jsxs("div",{className:"terminal-manager-detail-item",children:[i.jsx("span",{children:h("terminalManager.processIdLabel")}),i.jsx("strong",{children:Me.processId})]}):null,Me!=null&&Me.processCommandLine?i.jsxs("div",{className:"terminal-manager-detail-item terminal-manager-detail-item-wide",children:[i.jsx("span",{children:h("terminalManager.processCommandLabel")}),i.jsx("strong",{children:Me.processCommandLine})]}):null]}),i.jsxs("div",{className:"terminal-manager-actions terminal-manager-detail-actions",children:[i.jsx("button",{className:"secondary-button",type:"button",disabled:ee||E===V.id,onClick:()=>{Lt(V)},children:h("terminalManager.editAction")}),i.jsx("button",{className:"secondary-button workbench-danger-button",type:"button",disabled:E===V.id,onClick:()=>{T({templateId:V.id,name:V.name,occupied:!!(Me!=null&&Me.occupied)})},children:E===V.id?h("terminalManager.templateRemoving"):h("terminalManager.removeAction")})]})]}):null]},V.id)})}):i.jsx("section",{className:"workbench-empty-state minimal",children:i.jsx("p",{children:h("terminalManager.emptyTemplateBody")})})]}),i.jsx(bB,{open:Ct,title:h(kt?"terminalManager.editModalTitle":"terminalManager.createModalTitle"),description:h(kt?"terminalManager.editModalDescription":"terminalManager.createModalDescription"),className:bt?"terminal-manager-mobile-modal":void 0,onClose:$t,children:i.jsxs("section",{className:"terminal-manager-modal-form",children:[bt?i.jsxs(i.Fragment,{children:[i.jsx(nb,{label:h("terminalManager.shellField"),value:j,open:qe==="shell",options:S.map(V=>({value:V.id,label:V.label,description:V.available?null:V.unavailableReason??h("terminalManager.shellUnavailable"),disabled:!V.available})),onToggle:()=>{et(V=>V==="shell"?null:"shell")},onChange:V=>{A(V),et(null)}}),(Ve==null?void 0:Ve.available)===!1&&Ve.unavailableReason?i.jsx("p",{className:"status-text",children:Ve.unavailableReason}):null,i.jsx(nb,{label:h("terminal.runtimeField"),value:L,open:qe==="runtime",options:Tt.map(V=>({value:V.value,label:V.label,description:V.description})),onToggle:()=>{et(V=>V==="runtime"?null:"runtime")},onChange:V=>{M(V),et(null)}}),i.jsx("p",{className:"status-text",children:((Rt=Tt.find(V=>V.value===L))==null?void 0:Rt.description)??((ht=Tt[0])==null?void 0:ht.description)})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"field-group",children:[i.jsx("span",{children:h("terminalManager.shellField")}),i.jsx("select",{value:j,onChange:V=>{A(V.target.value)},children:S.map(V=>i.jsx("option",{value:V.id,disabled:!V.available,children:V.available?V.label:`${V.label} - ${h("terminalManager.shellUnavailable")}`},V.id))}),(Ve==null?void 0:Ve.available)===!1&&Ve.unavailableReason?i.jsx("p",{className:"status-text",children:Ve.unavailableReason}):null]}),i.jsxs("div",{className:"field-group",children:[i.jsx("span",{children:h("terminal.runtimeField")}),i.jsx("select",{value:L,onChange:V=>{M(V.target.value)},children:Tt.map(V=>i.jsx("option",{value:V.value,children:V.label},V.value||"auto"))}),i.jsx("p",{className:"status-text",children:((Nt=Tt.find(V=>V.value===L))==null?void 0:Nt.description)??((jt=Tt[0])==null?void 0:jt.description)})]})]}),i.jsxs("div",{className:"terminal-manager-mode-row",role:"tablist","aria-label":h("terminalManager.modeField"),children:[i.jsx("button",{type:"button",className:O.mode==="command"?"workbench-info-tab active":"workbench-info-tab",onClick:()=>{q(V=>({...V,mode:"command"}))},children:h("terminalManager.commandMode")}),i.jsx("button",{type:"button",className:O.mode==="script"?"workbench-info-tab active":"workbench-info-tab",onClick:()=>{q(V=>({...V,mode:"script"}))},children:h("terminalManager.scriptMode")})]}),i.jsxs("div",{className:"terminal-manager-grid",children:[i.jsxs("div",{className:"field-group",children:[i.jsx("span",{children:h("terminalManager.templateNameField")}),i.jsx("input",{value:O.name,placeholder:h("terminalManager.templateNamePlaceholder"),onChange:V=>{q(Me=>({...Me,name:V.target.value}))}})]}),i.jsxs("div",{className:"field-group",children:[i.jsx("span",{children:h("terminalManager.cwdField")}),i.jsx("input",{value:O.cwd,placeholder:h("terminalManager.cwdPlaceholder"),onChange:V=>{q(Me=>({...Me,cwd:V.target.value}))}})]})]}),i.jsxs("div",{className:"terminal-manager-grid",children:[i.jsxs("div",{className:"field-group",children:[i.jsx("span",{children:O.mode==="script"?h("terminalManager.scriptPathField"):h("terminalManager.commandField")}),i.jsx("input",{value:O.target,placeholder:O.mode==="script"?h("terminalManager.scriptPathPlaceholder"):h("terminalManager.commandPlaceholder"),onChange:V=>{q(Me=>({...Me,target:V.target.value}))}})]}),i.jsxs("div",{className:"field-group",children:[i.jsx("span",{children:h("terminalManager.argsField")}),i.jsx("input",{value:O.args,placeholder:h("terminalManager.argsPlaceholder"),onChange:V=>{q(Me=>({...Me,args:V.target.value}))}})]})]}),i.jsx("div",{className:"terminal-manager-grid",children:i.jsxs("div",{className:"field-group",children:[i.jsx("span",{children:h("terminalManager.portField")}),i.jsx("input",{value:O.port,placeholder:h("terminalManager.portPlaceholder"),onChange:V=>{q(Me=>({...Me,port:V.target.value}))}})]})}),i.jsxs("div",{className:"terminal-manager-actions",children:[i.jsx("button",{className:"secondary-button",type:"button",onClick:$t,children:h("common.close")}),i.jsx("button",{className:"primary-button",type:"button",disabled:!d||ee||!O.target.trim(),onClick:()=>{ge()},children:h(ee?kt?"terminalManager.templateUpdating":"terminalManager.templateSaving":kt?"terminalManager.saveTemplateChangesAction":"terminalManager.saveLaunchAction")})]})]})}),i.jsx(xB,{open:re!==null,busy:re!==null&&E===re.templateId,title:h("terminalManager.removeConfirmTitle"),description:re?h(re.occupied?"terminalManager.removeRunningConfirmTarget":"terminalManager.removeConfirmTarget",{name:re.name}):"",confirmLabel:h("terminalManager.removeConfirmAction"),className:bt?"terminal-manager-mobile-modal":"terminal-manager-confirm-modal",onClose:()=>{E||T(null)},onConfirm:()=>{if(!re)return;const V=y.find(Me=>Me.id===re.templateId);if(!V){T(null);return}tb(Ot,V.id),Be(V)}})]}):i.jsx("section",{className:"workbench-empty-state minimal",children:i.jsx("p",{children:h("terminalManager.noCurrentWorkspaceBody")})}):i.jsx("section",{className:"workbench-empty-state minimal",children:i.jsx("p",{children:h("terminalManager.emptyWorkspaceBody")})})}function Bh(e){return`terminal-manager.snapshot.${e}`}const jB=Object.freeze(Object.defineProperty({__proto__:null,TerminalManagerPanel:MC},Symbol.toStringTag,{value:"Module"}));function NB(){const{currentWorkspaceId:e,navigationGroups:t}=tr();return e?i.jsx("main",{className:"mobile-feature-page mobile-page-fixed-root mobile-tool-panel-page mobile-tool-process-page",children:i.jsx(MC,{className:"mobile-panel-scroll-root mobile-tool-native-panel mobile-tool-process-panel",currentWorkspaceId:e,navigationGroups:t})}):i.jsx("main",{className:"mobile-feature-page mobile-page-scroll-root",children:i.jsxs("article",{className:"mobile-feature-empty surface-card",children:[i.jsx("h1",{children:h("shell.terminalManagerEntry")}),i.jsx("p",{children:h("shell.toolsWorkspaceRequiredBody")})]})})}const Tc="codingns.file-panel.show-system-files";function AC(){return typeof window<"u"&&typeof window.localStorage<"u"}function rb(){return AC()?window.localStorage.getItem(Tc)==="1":!1}class PB{constructor(){Ke(this,"state",{showSystemFiles:rb()});Ke(this,"listeners",new Set);Ke(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Ke(this,"getState",()=>this.state);Ke(this,"handleStorage",t=>{if(t.key!==null&&t.key!==Tc)return;const n=rb();this.state.showSystemFiles!==n&&(this.state={showSystemFiles:n},this.emit())});typeof window<"u"&&window.addEventListener("storage",this.handleStorage)}setShowSystemFiles(t){AC()&&(t?window.localStorage.setItem(Tc,"1"):window.localStorage.removeItem(Tc)),this.state.showSystemFiles!==t&&(this.state={showSystemFiles:t},this.emit())}emit(){for(const t of this.listeners)t()}}const Af=new PB;function LC(e){return v.useSyncExternalStore(Af.subscribe,()=>e(Af.getState()))}function IC(e){return Je.request(`/api/git/status?workspaceId=${encodeURIComponent(e)}`)}function DC(e,t,n){const s=new URLSearchParams({workspaceId:e,path:t,staged:String(n)});return Je.request(`/api/git/diff?${s.toString()}`)}function _C(e,t){return Je.request("/api/git/stage",{method:"POST",body:JSON.stringify({workspaceId:e,targets:t})})}function TB(e,t){return Je.request("/api/git/unstage",{method:"POST",body:JSON.stringify({workspaceId:e,targets:t})})}function EB(e,t){return Je.request("/api/git/discard",{method:"POST",body:JSON.stringify({workspaceId:e,targets:t})})}function RB(e,t){return Je.request("/api/git/commit/draft",{method:"POST",body:JSON.stringify({workspaceId:e,mode:t})})}function MB(e,t){return Je.request("/api/git/commit",{method:"POST",body:JSON.stringify({workspaceId:e,draft:t})})}function AB(e){return Je.request("/api/git/commit/undo",{method:"POST",body:JSON.stringify({workspaceId:e})})}function ib(e,t=5,n=null){const s=new URLSearchParams({workspaceId:e,limit:String(t)});return n&&s.set("cursor",n),Je.request(`/api/git/history?${s.toString()}`)}function LB(e){return Je.request(`/api/git/branches?workspaceId=${encodeURIComponent(e)}`)}function IB(e,t,n){return Je.request("/api/git/branches/switch",{method:"POST",body:JSON.stringify({workspaceId:e,branchName:t,create:n})})}function sb(e,t,n){return Je.request("/api/git/remote/sync",{method:"POST",body:JSON.stringify({workspaceId:e,action:t,...n?{remote:n}:{}})})}function DB(e){return Je.request(`/api/git/remotes?workspaceId=${encodeURIComponent(e)}`)}const _B=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","default","delete","do","else","enum","export","extends","false","finally","for","from","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","readonly","return","static","super","switch","this","throw","true","try","type","typeof","undefined","var","void","while","with","yield"]),FB=new Set(["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","False","finally","for","from","global","if","import","in","is","lambda","None","nonlocal","not","or","pass","raise","return","True","try","while","with","yield"]),OB=new Set(["case","do","done","elif","else","esac","export","fi","for","function","if","in","local","readonly","return","then","until","while"]),BB=new Set(["add","alter","and","as","asc","between","by","create","delete","desc","drop","from","group","having","insert","into","join","left","like","limit","not","null","offset","on","or","order","right","select","set","table","union","update","values","where"]),UB=new Set(["add","arg","cmd","copy","entrypoint","env","expose","from","healthcheck","label","maintainer","onbuild","run","shell","stopsignal","user","volume","workdir","as"]),WB=new Set(["trace","debug","info","warn","warning","error","fatal"]);function FC({workspaceId:e,filePath:t,open:n,onClose:s,onSaved:a,diffContent:c}){const[l,d]=v.useState(null),[f,p]=v.useState(""),[y,g]=v.useState(!1),[b,k]=v.useState(!1),[S,C]=v.useState("preview"),{showToast:j}=Kn(),A=v.useRef(s),L=v.useRef(j),M=v.useMemo(()=>UC(t),[t]),O=v.useMemo(()=>aU(c),[c]),q=M==="markdown",_=!!(l!=null&&l.supported&&l.kind==="text");if(v.useEffect(()=>{A.current=s},[s]),v.useEffect(()=>{L.current=j},[j]),v.useEffect(()=>{if(!n){d(null),p(""),g(!1),k(!1),C("preview");return}if(!e||!t)return;const X=e,$=t;let ee=!1;async function te(){g(!0);try{const pe=await tw(X,$);ee||(d(pe),p(pe.content??""),C((iU($),"preview")))}catch(pe){ee||(L.current({title:ob(pe,h("conversation.filePanelOpenFailed")),tone:"error"}),A.current())}finally{ee||g(!1)}}return te(),()=>{ee=!0}},[t,n,e]),v.useEffect(()=>{if(!n)return;function X($){$.key==="Escape"&&s()}return window.addEventListener("keydown",X),()=>{window.removeEventListener("keydown",X)}},[s,n]),!n||!t||typeof document>"u")return null;const I=t,F=e;async function D(){if(!(!F||!(l!=null&&l.version)||!_)){k(!0);try{await i_(F,I,f,l.version);const X=await tw(F,I);d(X),p(X.content??""),await a(I),j({title:h("conversation.filePanelSaveSuccess"),tone:"success"}),C("preview")}catch(X){j({title:ob(X,h("conversation.filePanelSaveFailed")),tone:"error"})}finally{k(!1)}}}const P=(l==null?void 0:l.content)??"",K=_&&f!==P;return On.createPortal(i.jsxs("div",{className:"workbench-modal-layer",children:[i.jsx("button",{type:"button",className:"workbench-modal-backdrop","aria-label":h("common.close"),onClick:s}),i.jsxs("section",{className:"workbench-modal-card surface-card file-viewer-modal",role:"dialog","aria-modal":"true","aria-label":t,children:[i.jsxs("div",{className:"workbench-modal-header",children:[i.jsxs("div",{className:"workbench-modal-title-wrap",children:[i.jsx("h2",{children:t}),i.jsx("p",{children:h("conversation.fileViewerHint").replace("{language}",Lf(M))})]}),i.jsx("button",{type:"button",className:"workbench-modal-close","aria-label":h("common.close"),onClick:s,children:i.jsx(sU,{})})]}),i.jsxs("div",{className:"file-viewer-toolbar",children:[i.jsxs("div",{className:"file-viewer-tabs",role:"tablist","aria-label":h("conversation.fileViewerModeLabel"),children:[i.jsx("button",{type:"button",className:"file-viewer-tab","data-active":S==="preview",role:"tab","aria-selected":S==="preview",onClick:()=>C("preview"),children:h(q?"conversation.fileViewerPreview":"conversation.fileViewerCode")}),i.jsx("button",{type:"button",className:"file-viewer-tab","data-active":S==="edit",role:"tab","aria-selected":S==="edit",onClick:()=>C("edit"),disabled:!_,children:h("conversation.fileViewerEdit")})]}),i.jsxs("div",{className:"file-viewer-actions",children:[i.jsx("span",{className:"file-viewer-language",children:Lf(M)}),i.jsx("button",{type:"button",className:"primary-button",onClick:()=>void D(),disabled:!K||b,children:h(b?"conversation.filePanelSaving":"conversation.filePanelSave")})]})]}),i.jsx("div",{className:"workbench-modal-body file-viewer-body",children:y?i.jsx("p",{className:"status-text",children:h("common.loading")}):(l==null?void 0:l.supported)===!1?i.jsx("p",{className:"status-text",children:l.reason??h("conversation.filePanelUnsupported")}):S==="edit"?i.jsx("textarea",{className:"file-viewer-editor","data-testid":"file-viewer-editor",value:f,onChange:X=>p(X.target.value),spellCheck:!1}):q?i.jsx(zB,{content:f}):i.jsx(OC,{content:f,language:M,overviewMarkers:O})})]})]}),document.body)}function zB({content:e}){return i.jsx("div",{className:"markdown-content file-viewer-markdown",children:i.jsx(hm,{remarkPlugins:[gm],components:{code(t){const n=typeof t.className=="string"?t.className:"",s=/language-([\w-]+)/.exec(n);return s?i.jsx(OC,{content:String(t.children).replace(/\n$/,""),language:Bm(s[1]??"plain")}):i.jsx("code",{className:n||void 0,children:t.children})}},children:e})})}function OC({content:e,language:t,overviewMarkers:n=[]}){const s=e.split(/\r?\n/),a=v.useRef(null),c=v.useMemo(()=>{const l=new Map;for(const d of n)for(let f=0;f<d.span;f++)l.set(d.line+f,d.kind);return l},[n]);return i.jsxs("div",{className:"file-viewer-code-block",children:[i.jsx("div",{className:"file-viewer-code-header",children:Lf(t)}),i.jsxs("div",{className:"file-viewer-scroll-shell",children:[i.jsx("div",{className:"file-viewer-code-body",ref:a,children:s.map((l,d)=>{const f=HB(l,t),p=d+1,y=c.get(p);return i.jsxs("div",{className:`file-viewer-code-line${y?` diff-line-${y}`:""}`,children:[i.jsx("span",{className:"file-viewer-code-gutter",children:p}),i.jsx("code",{className:"file-viewer-code-content",children:f.length?f.map((g,b)=>i.jsx("span",{className:`code-token ${g.kind}`,children:g.text},`${d}-${b}-${g.text}`)):i.jsx("span",{className:"code-token plain",children:" "})})]},`${d}-${l}`)})}),i.jsx(cU,{markers:n,totalLines:s.length,scrollContainerRef:a})]})]})}function HB(e,t){const n=Bm(t);return n==="json"?qB(e):n==="yaml"?KB(e):n==="toml"?QB(e):n==="ini"?BC(e):n==="env"?YB(e):n==="properties"?XB(e):n==="conf"?JB(e):n==="editorconfig"?ZB(e):n==="dockerfile"?eU(e):n==="gitignore"?tU(e):n==="log"?nU(e):n==="python"?Na(e,FB,"#"):n==="shell"?Na(e,OB,"#"):n==="sql"?GB(e):n==="html"||n==="xml"?$B(e):n==="css"?VB(e):n==="markdown"?[{text:e,kind:"plain"}]:Na(e,_B,"//")}function Na(e,t,n){const s=[];let a=0;for(;a<e.length;){const c=e.slice(a);if(c.startsWith(n)){s.push({text:c,kind:"comment"});break}const l=/^(?:'[^'\\]*(?:\\.[^'\\]*)*'|"[^"\\]*(?:\\.[^"\\]*)*"|`[^`\\]*(?:\\.[^`\\]*)*`)/.exec(c);if(l){s.push({text:l[0],kind:"string"}),a+=l[0].length;continue}const d=/^(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/.exec(c);if(d){s.push({text:d[0],kind:"number"}),a+=d[0].length;continue}const f=/^[A-Za-z_][\w$-]*/.exec(c);if(f){const y=f[0],g=y.toLowerCase();y==="true"||y==="false"||g==="true"||g==="false"?s.push({text:y,kind:"boolean"}):y==="null"||y==="None"||g==="none"?s.push({text:y,kind:"null"}):t.has(y)||t.has(g)?s.push({text:y,kind:"keyword"}):s.push({text:y,kind:"plain"}),a+=y.length;continue}const p=/^(?:===|!==|==|!=|<=|>=|=>|&&|\|\||[+\-*/%=<>!?:|&^~]+)/.exec(c);if(p){s.push({text:p[0],kind:"operator"}),a+=p[0].length;continue}s.push({text:c[0]??"",kind:"plain"}),a+=1}return s}function qB(e){const t=[];let n=0;for(;n<e.length;){const s=e.slice(n),a=/^"(?:[^"\\]|\\.)*"/.exec(s);if(a){const f=e.slice(n+a[0].length).trimStart()[0];t.push({text:a[0],kind:f===":"?"attr":"string"}),n+=a[0].length;continue}const c=/^(?:-?\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i.exec(s);if(c){t.push({text:c[0],kind:"number"}),n+=c[0].length;continue}const l=/^(?:true|false|null)\b/.exec(s);if(l){const f=l[0]==="null"?"null":"boolean";t.push({text:l[0],kind:f}),n+=l[0].length;continue}const d=/^(?::|,|\{|\}|\[|\])/.exec(s);if(d){t.push({text:d[0],kind:"operator"}),n+=d[0].length;continue}t.push({text:s[0]??"",kind:"plain"}),n+=1}return t}function $B(e){const t=[];let n=0;for(;n<e.length;){const s=e.slice(n);if(s.startsWith("<!--")){t.push({text:s,kind:"comment"});break}const a=/^(<\/?[\w:-]+)/.exec(s);if(a){t.push({text:a[0],kind:"tag"}),n+=a[0].length;continue}const c=/^([\w:-]+)(=)/.exec(s);if(c){t.push({text:c[1]??"",kind:"attr"}),t.push({text:c[2]??"",kind:"operator"}),n+=c[0].length;continue}const l=/^(?:'[^']*'|"[^"]*")/.exec(s);if(l){t.push({text:l[0],kind:"string"}),n+=l[0].length;continue}const d=/^(?:\/?>)/.exec(s);if(d){t.push({text:d[0],kind:"operator"}),n+=d[0].length;continue}t.push({text:s[0]??"",kind:"plain"}),n+=1}return t}function VB(e){const t=[];let n=0;for(;n<e.length;){const s=e.slice(n);if(s.startsWith("/*")){t.push({text:s,kind:"comment"});break}const a=/^(?:'[^']*'|"[^"]*")/.exec(s);if(a){t.push({text:a[0],kind:"string"}),n+=a[0].length;continue}const c=/^([A-Za-z-]+)(\s*:)/.exec(s);if(c){t.push({text:c[1]??"",kind:"attr"}),t.push({text:c[2]??"",kind:"operator"}),n+=c[0].length;continue}const l=/^(?:#(?:[\da-fA-F]{3,8})|\d+(?:\.\d+)?(?:px|rem|em|vh|vw|%)?)/.exec(s);if(l){t.push({text:l[0],kind:"number"}),n+=l[0].length;continue}const d=/^(?:@media|@supports|@import|@keyframes)\b/.exec(s);if(d){t.push({text:d[0],kind:"keyword"}),n+=d[0].length;continue}const f=/^(?:[{}:;(),.>])/.exec(s);if(f){t.push({text:f[0],kind:"operator"}),n+=f[0].length;continue}t.push({text:s[0]??"",kind:"plain"}),n+=1}return t}function GB(e){return Na(e,BB,"--")}function KB(e){const t=[];let n=0;for(;n<e.length;){const s=e.slice(n);if(s.startsWith("#")){t.push({text:s,kind:"comment"});break}const a=/^([A-Za-z0-9_.-]+)(\s*:)/.exec(s);if(a){t.push({text:a[1]??"",kind:"attr"}),t.push({text:a[2]??"",kind:"operator"}),n+=a[0].length;continue}const c=/^(?:'[^']*'|"[^"]*")/.exec(s);if(c){t.push({text:c[0],kind:"string"}),n+=c[0].length;continue}const l=/^(?:-?\d+(?:\.\d+)?)/.exec(s);if(l){t.push({text:l[0],kind:"number"}),n+=l[0].length;continue}const d=/^(?:true|false|yes|no|null|~)\b/i.exec(s);if(d){const p=d[0].toLowerCase(),y=p==="null"||p==="~"?"null":"boolean";t.push({text:d[0],kind:y}),n+=d[0].length;continue}const f=/^(?:[-?:,[\]{}|>])/.exec(s);if(f){t.push({text:f[0],kind:"operator"}),n+=f[0].length;continue}t.push({text:s[0]??"",kind:"plain"}),n+=1}return t}function QB(e){const t=[];let n=0;for(;n<e.length;){const s=e.slice(n);if(s.startsWith("#")){t.push({text:s,kind:"comment"});break}const a=/^(\[\[?[^\]]+\]?\])/.exec(s);if(a){t.push({text:a[0],kind:"tag"}),n+=a[0].length;continue}const c=/^([A-Za-z0-9_.-]+)(\s*=)/.exec(s);if(c){t.push({text:c[1]??"",kind:"attr"}),t.push({text:c[2]??"",kind:"operator"}),n+=c[0].length;continue}const l=hu(s,{trueValues:["true"],falseValues:["false"],nullValues:[]});if(l){t.push(...l.tokens),n+=l.length;continue}const d=/^(?:[,[\]{}])/.exec(s);if(d){t.push({text:d[0],kind:"operator"}),n+=d[0].length;continue}t.push({text:s[0]??"",kind:"plain"}),n+=1}return t}function BC(e){const t=[];let n=0;for(;n<e.length;){const s=e.slice(n),a=s.trimStart();if(a.startsWith(";")||a.startsWith("#")){t.push({text:s,kind:"comment"});break}const c=/^(\[[^\]]+\])/.exec(s);if(c){t.push({text:c[0],kind:"tag"}),n+=c[0].length;continue}const l=/^([A-Za-z0-9_.-]+)(\s*[=:])/.exec(s);if(l){t.push({text:l[1]??"",kind:"attr"}),t.push({text:l[2]??"",kind:"operator"}),n+=l[0].length;continue}const d=hu(s,{trueValues:["true","yes","on"],falseValues:["false","no","off"],nullValues:["null"]});if(d){t.push(...d.tokens),n+=d.length;continue}t.push({text:s[0]??"",kind:"plain"}),n+=1}return t}function YB(e){if(e.trimStart().startsWith("#"))return[{text:e,kind:"comment"}];const n=/^(\s*)(export)(\s+)/.exec(e),s=n?n[0].length:0,a=[];n&&(a.push({text:n[1]??"",kind:"plain"}),a.push({text:n[2]??"",kind:"keyword"}),a.push({text:n[3]??"",kind:"plain"}));const c=e.slice(s),l=/^([A-Za-z_][A-Za-z0-9_]*)(=)/.exec(c);if(!l)return BC(e);a.push({text:l[1]??"",kind:"attr"}),a.push({text:l[2]??"",kind:"operator"});const d=c.slice(l[0].length),f=hu(d,{trueValues:["true"],falseValues:["false"],nullValues:["null"]});return f?(a.push(...f.tokens),a):(a.push({text:d,kind:"plain"}),a)}function XB(e){return Om(e,{commentPrefixes:["#","!"],allowSection:!1,delimiters:["=",":"]})}function JB(e){return Om(e,{commentPrefixes:["#",";"],allowSection:!0,delimiters:["=",":"]})}function ZB(e){return Om(e,{commentPrefixes:["#",";"],allowSection:!0,delimiters:["="]})}function eU(e){return Na(e,UB,"#")}function tU(e){const t=e.trimStart();if(!t)return[];if(t.startsWith("#"))return[{text:e,kind:"comment"}];if(t.startsWith("!")){const n=e.length-t.length,s=e.slice(0,n),a=t.slice(1);return[{text:s,kind:"plain"},{text:"!",kind:"operator"},{text:a,kind:"string"}]}return[{text:e,kind:"string"}]}function nU(e){const t=[];let n=0;for(;n<e.length;){const s=e.slice(n);if(s.startsWith("#")){t.push({text:s,kind:"comment"});break}const a=/^(?:\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:[.,]\d{3,6})?(?:Z|[+-]\d{2}:\d{2})?)/.exec(s);if(a){t.push({text:a[0],kind:"tag"}),n+=a[0].length;continue}const c=/^(?:\[(TRACE|DEBUG|INFO|WARN|WARNING|ERROR|FATAL)\])/.exec(s);if(c){t.push({text:s.slice(0,c[0].length),kind:"keyword"}),n+=c[0].length;continue}const l=/^[A-Za-z_][\w-]*/.exec(s);if(l){const f=l[0];WB.has(f.toLowerCase())?t.push({text:f,kind:"keyword"}):t.push({text:f,kind:"plain"}),n+=f.length;continue}const d=/^(?:\d+(?:\.\d+)?)/.exec(s);if(d){t.push({text:d[0],kind:"number"}),n+=d[0].length;continue}t.push({text:s[0]??"",kind:"plain"}),n+=1}return t}function Om(e,t){const n=e.trimStart();if(t.commentPrefixes.some(f=>n.startsWith(f)))return[{text:e,kind:"comment"}];if(t.allowSection){const f=/^(\[[^\]]+\])/.exec(e);if(f)return[{text:f[0],kind:"tag"}]}const s=/^([A-Za-z0-9_.\-*?]+)(\s*(?:=|:))/.exec(e);if(!s)return[{text:e,kind:"plain"}];const a=(s[2]??"").trim();if(!t.delimiters.includes(a))return[{text:e,kind:"plain"}];const c=[{text:s[1]??"",kind:"attr"},{text:s[2]??"",kind:"operator"}],l=e.slice(s[0].length),d=rU(l);return d.length&&c.push(...d),c}function rU(e){if(!e)return[];const t=[];let n=0;for(;n<e.length;){const s=e.slice(n),a=hu(s,{trueValues:["true","yes","on"],falseValues:["false","no","off"],nullValues:["null"]});if(a){t.push(...a.tokens),n+=a.length;continue}if(s.startsWith("#")||s.startsWith(";")){t.push({text:s,kind:"comment"});break}t.push({text:s[0]??"",kind:"plain"}),n+=1}return t}function hu(e,t){const n=/^(?:'[^']*'|"[^"]*")/.exec(e);if(n)return{tokens:[{text:n[0],kind:"string"}],length:n[0].length};const s=/^(?:-?\d+(?:\.\d+)?)/.exec(e);if(s)return{tokens:[{text:s[0],kind:"number"}],length:s[0].length};const a=/^[A-Za-z0-9_.:+/-]+/.exec(e);if(!a)return null;const c=a[0],l=c.toLowerCase();return t.trueValues.includes(l)?{tokens:[{text:c,kind:"boolean"}],length:c.length}:t.falseValues.includes(l)?{tokens:[{text:c,kind:"boolean"}],length:c.length}:t.nullValues.includes(l)?{tokens:[{text:c,kind:"null"}],length:c.length}:{tokens:[{text:c,kind:"plain"}],length:c.length}}function UC(e){var s,a;if(!e)return"plain";const t=((s=e.split(/[\\/]/).pop())==null?void 0:s.toLowerCase())??"";if(t===".env"||t.startsWith(".env."))return"env";if(t===".editorconfig")return"editorconfig";if(t==="dockerfile"||t.endsWith(".dockerfile"))return"dockerfile";if(t===".gitignore")return"gitignore";switch(((a=e.split(".").pop())==null?void 0:a.toLowerCase())??""){case"md":case"markdown":return"markdown";case"ts":case"tsx":return"typescript";case"js":case"jsx":case"mjs":case"cjs":return"javascript";case"json":return"json";case"log":return"log";case"properties":return"properties";case"toml":return"toml";case"ini":return"ini";case"conf":return"conf";case"dockerfile":return"dockerfile";case"css":case"scss":case"less":return"css";case"html":case"htm":return"html";case"xml":case"svg":return"xml";case"py":return"python";case"sh":case"bash":case"zsh":return"shell";case"sql":return"sql";case"yml":case"yaml":return"yaml";case"rs":return"rust";case"go":return"go";case"java":return"java";case"c":case"h":case"cpp":case"cc":case"hpp":return"cpp";default:return"plain"}}function Bm(e){const t=e.toLowerCase();switch(t){case"ts":case"tsx":case"typescript":return"typescript";case"js":case"jsx":case"javascript":return"javascript";case"bash":case"shell":case"sh":case"zsh":return"shell";case"md":case"markdown":return"markdown";case"properties":return"properties";case"toml":return"toml";case"ini":return"ini";case"env":return"env";case"conf":return"conf";case"editorconfig":return"editorconfig";case"dockerfile":return"dockerfile";case"gitignore":return"gitignore";case"log":return"log";default:return t}}function Lf(e){switch(Bm(e)){case"typescript":return"TypeScript";case"javascript":return"JavaScript";case"markdown":return"Markdown";case"json":return"JSON";case"properties":return"Properties";case"toml":return"TOML";case"ini":return"INI";case"env":return"ENV";case"conf":return"CONF";case"editorconfig":return"EditorConfig";case"dockerfile":return"Dockerfile";case"gitignore":return"GitIgnore";case"log":return"Log";case"css":return"CSS";case"html":return"HTML";case"xml":return"XML";case"python":return"Python";case"shell":return"Shell";case"sql":return"SQL";case"yaml":return"YAML";case"rust":return"Rust";case"go":return"Go";case"java":return"Java";case"cpp":return"C/C++";default:return h("conversation.fileViewerPlainText")}}function iU(e){return UC(e)==="markdown"}function ob(e,t){return e instanceof Jn?e.message:t}function sU(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function oU(e){const t=[],n=e.replace(/\r\n/g,`
107
+ `).split(`
108
+ `);let s=0,a=0;for(const c of n){if(c.startsWith("diff --git")||c.startsWith("index ")||c.startsWith("--- ")||c.startsWith("+++ ")){t.push({kind:"meta",text:c,oldLineNo:null,newLineNo:null});continue}const l=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(c);if(l){s=parseInt(l[1],10),a=parseInt(l[2],10),t.push({kind:"hunk",text:c,oldLineNo:null,newLineNo:null});continue}if(c.startsWith(" ")||c===""){t.push({kind:"context",text:c.slice(1),oldLineNo:s,newLineNo:a}),s++,a++;continue}if(c.startsWith("+")){t.push({kind:"add",text:c.slice(1),oldLineNo:null,newLineNo:a}),a++;continue}if(c.startsWith("-")){t.push({kind:"remove",text:c.slice(1),oldLineNo:s,newLineNo:null}),s++;continue}t.push({kind:"meta",text:c,oldLineNo:null,newLineNo:null})}return t}function aU(e){if(!(e!=null&&e.trim()))return[];const t=oU(e),n=[];let s=0,a=[];function c(){if(a.length===0){s=0;return}const l=s>0?"modify":"add";lU(n,a,l),s=0,a=[]}for(const l of t){if(l.kind==="remove"){s+=1;continue}if(l.kind==="add"){l.newLineNo!==null&&a.push(l.newLineNo);continue}c()}return c(),n}function lU(e,t,n){const s=t.filter(l=>l>0);if(s.length===0)return;let a=s[0]??1,c=a;for(let l=1;l<s.length;l+=1){const d=s[l]??c;if(d===c+1){c=d;continue}e.push({line:a,span:c-a+1,kind:n}),a=d,c=d}e.push({line:a,span:c-a+1,kind:n})}function cU({markers:e,totalLines:t,scrollContainerRef:n}){const[s,a]=v.useState({top:0,height:0});if(v.useEffect(()=>{const l=n.current;if(!l){a({top:0,height:0});return}const d=l;function f(){const{clientHeight:p,scrollHeight:y,scrollTop:g}=d;if(y<=0||p<=0||y<=p){a({top:0,height:0});return}const b=p/y,k=Math.min(100,Math.max(12,b*100)),S=y-p,C=Math.max(0,100-k),j=S<=0?0:g/S*C;a({top:j,height:k})}return f(),d.addEventListener("scroll",f,{passive:!0}),window.addEventListener("resize",f),()=>{d.removeEventListener("scroll",f),window.removeEventListener("resize",f)}},[n]),e.length===0&&s.height===0)return null;const c=Math.max(t,1);return i.jsxs("div",{className:"file-overview-ruler","data-testid":"file-overview-ruler","aria-hidden":"true",children:[e.map(l=>{const d=(l.line-1)/c*100,f=Math.max(2,l.span/c*100);return i.jsx("div",{className:`file-overview-marker is-${l.kind}`,"data-kind":l.kind,style:{top:`${d}%`,height:`${f}%`}},`${l.kind}-${l.line}-${l.span}`)}),s.height>0?i.jsx("div",{className:"file-overview-viewport",style:{top:`${s.top}%`,height:`${s.height}%`}}):null]})}function Ss(e){const t=e.toLowerCase();if(t===".env"||t.startsWith(".env."))return"ENV";if(t.endsWith(".d.ts"))return"DTS";switch(t.includes(".")?t.slice(t.lastIndexOf(".")+1):""){case"ts":return"TS";case"tsx":return"TSX";case"js":return"JS";case"jsx":return"JSX";case"json":return"{}";case"md":return"MD";case"css":return"CSS";case"scss":return"SASS";case"html":return"HTML";case"yml":case"yaml":return"YAML";case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return"IMG";case"txt":return"TXT";default:return"FILE"}}function Cs(e){const t=e.toLowerCase();return t===".env"||t.startsWith(".env.")?"env":t.endsWith(".md")?"md":t.endsWith(".css")||t.endsWith(".scss")?"style":t.endsWith(".png")||t.endsWith(".jpg")||t.endsWith(".jpeg")||t.endsWith(".gif")||t.endsWith(".svg")||t.endsWith(".webp")?"image":t.endsWith(".ts")||t.endsWith(".tsx")||t.endsWith(".js")||t.endsWith(".jsx")?"code":t.endsWith(".json")||t.endsWith(".yml")||t.endsWith(".yaml")?"data":"default"}const uU=new Set([".ds_store","thumbs.db","ehthumbs.db","desktop.ini",".spotlight-v100",".trashes",".fseventsd","__macosx","$recycle.bin","system volume information",".apdisk",".appledouble",".temporaryitems"]),dU=["._"];function hU(e){return e.split(/[/\\]/).filter(Boolean).pop()??e}function fU(e){const t=e.trim().toLowerCase();return t?uU.has(t)||dU.some(n=>t.startsWith(n)):!1}function Um(e,t,n){return n?[...e]:e.filter(s=>!fU(t(s)))}function Ec(e,t){return Um(e,n=>n.name,t)}function mU(e,t){return t?e:Object.entries(e).reduce((n,[s,a])=>(n[s]=Ec(a,!1),n),{})}async function Uh(e,t){const[n,s]=await Promise.all([IC(t),wT(e)]);return pU(n.changes,s.items)}function pU(e,t){const n=new Set(t.map(s=>Mc(s.path)));return e.filter(s=>n.has(Mc(s.path))||s.oldPath!==null&&n.has(Mc(s.oldPath)))}function gU(e){const t=ab("","");for(const n of e){const s=Mc(n.path),a=s.split("/").filter(Boolean);let c=t;a.forEach((l,d)=>{const f=a.slice(0,d+1).join("/");if(d===a.length-1){c.children.set(`file:${f}`,{kind:"file",name:l,path:s,change:n});return}const p=`directory:${f}`,y=c.children.get(p);if(y&&y.kind==="directory"){c=y;return}const g=ab(l,f);c.children.set(p,g),c=g})}return HC(zC([...t.children.values()]))}function WC(e,t){const n=e.oldPath?`${e.oldPath} -> ${e.path}`:e.path;return Wm(e)?`${n} ${t}`:n}function Wm(e){return e.status==="D"||e.stagedStatus==="D"||e.worktreeStatus==="D"}function Rc(e){return e.split("/").filter(Boolean).pop()??e}function Mc(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").trim()}function ab(e,t){return{kind:"directory",name:e,path:t,children:new Map}}function zC(e){return[...e].sort((t,n)=>t.kind!==n.kind?t.kind==="directory"?-1:1:t.name.localeCompare(n.name,"zh-CN")).map(t=>t.kind==="directory"?{kind:"directory",name:t.name,path:t.path,children:zC([...t.children.values()])}:t)}function HC(e){return e.map(t=>{var l;if(t.kind!=="directory")return t;const n=HC(t.children);let s=t.name,a=t.path,c=n;for(;c.length===1&&((l=c[0])==null?void 0:l.kind)==="directory";){const d=c[0];s=`${s}/${d.name}`,a=d.path,c=d.children}return{kind:"directory",name:s,path:a,children:c}})}const yU=450,vU=60*1e3,lb=20,cb=16;function wU({sessionId:e,workspaceId:t,showSystemFiles:n,selectedPath:s,refreshVersion:a,onCountChange:c,onSelectFile:l,onOpenFile:d}){const[f,p]=v.useState("tree"),[y,g]=v.useState([]),[b,k]=v.useState(!0),[S,C]=v.useState(!1),[j,A]=v.useState([]),L=v.useRef(null),{showToast:M}=Kn();v.useEffect(()=>{const $=Mn(gc(t,e),vU);p("tree"),g($??[]),k($===null),C(!1),A([]),L.current=null},[e,t]),v.useEffect(()=>{let $=!1;async function ee(){k(!0);try{const te=await Uh(e,t);$||(g(te),jr(gc(t,e),te))}catch(te){$||M({title:Wh(te,h("conversation.filePanelSessionLoadFailed")),tone:"error"})}finally{$||k(!1)}}return ee(),()=>{$=!0}},[a,e,M,t]);async function O(){k(!0);try{const $=await Uh(e,t);g($),jr(gc(t,e),$)}catch($){M({title:Wh($,h("conversation.filePanelSessionLoadFailed")),tone:"error"})}finally{k(!1)}}async function q(){if(P.length!==0){C(!0);try{await _C(t,P.map(ee=>ee.path));const $=await Uh(e,t);g($),jr(gc(t,e),$),M({title:h("conversation.filePanelSessionStageSuccess"),tone:"success"})}catch($){M({title:Wh($,h("git.stageFailed")),tone:"error"})}finally{C(!1)}}}function _($){A(ee=>ee.includes($)?ee.filter(te=>te!==$):[...ee,$])}function I($){const ee=Date.now(),te=L.current;return L.current={filePath:$,timestamp:ee},(te==null?void 0:te.filePath)===$&&ee-te.timestamp<=yU}async function F($,ee){if(ee&&I($)){await d($),L.current=null;return}ee||(L.current=null),await l($)}const D=v.useMemo(()=>Um(y,$=>Rc($.path),n),[y,n]),P=D.filter($=>!$.staged),K=gU(D),X=new Set(j);return v.useEffect(()=>{c==null||c(D.length)},[c,D.length]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"file-panel-session-toolbar",children:[i.jsxs("div",{className:"file-panel-view-modes",role:"tablist","aria-label":h("conversation.filePanelSessionViewLabel"),children:[i.jsx("button",{className:f==="tree"?"file-panel-view-button active":"file-panel-view-button",type:"button",role:"tab","aria-selected":f==="tree",onClick:()=>p("tree"),children:h("conversation.filePanelSessionTreeView")}),i.jsx("button",{className:f==="list"?"file-panel-view-button active":"file-panel-view-button",type:"button",role:"tab","aria-selected":f==="list",onClick:()=>p("list"),children:h("conversation.filePanelSessionListView")})]}),i.jsxs("div",{className:"file-panel-session-actions",children:[i.jsx("button",{className:"secondary-button",type:"button",onClick:()=>void O(),disabled:b||S,children:h("conversation.filePanelRefresh")}),i.jsx("button",{className:"primary-button",type:"button",onClick:()=>void q(),disabled:S||P.length===0,children:h("conversation.filePanelSessionStageAll")})]})]}),i.jsxs("div",{className:"file-panel-session-summary",children:[i.jsx("span",{children:`${h("conversation.filePanelSessionSummary")} ${D.length}`}),i.jsx("span",{children:`${h("conversation.filePanelSessionUnstagedSummary")} ${P.length}`})]}),i.jsx("div",{className:"file-tree",children:b?i.jsx("p",{className:"file-tree-status status-text",children:h("conversation.filePanelSessionLoading")}):D.length===0?i.jsx("p",{className:"file-tree-status status-text",children:h("conversation.filePanelSessionEmpty")}):f==="tree"?qC({nodes:K,depth:0,collapsedPathSet:X,selectedPath:s,onToggleTreePath:_,onFileClick:F}):bU({items:D,selectedPath:s,onFileClick:F})})]})}function qC({nodes:e,depth:t,collapsedPathSet:n,selectedPath:s,onToggleTreePath:a,onFileClick:c}){return e.map(l=>{if(l.kind==="directory"){const d=!n.has(l.path);return i.jsxs("div",{className:"file-tree-node",children:[i.jsxs("button",{className:"file-tree-item",type:"button","data-kind":"directory","aria-expanded":d,style:{paddingInlineStart:`${lb+t*cb}px`},onClick:()=>a(l.path),children:[i.jsx("span",{className:"file-tree-chevron","aria-hidden":"true",children:d?"v":">"}),i.jsx("span",{className:"file-tree-label",children:l.name})]}),d?i.jsx("div",{className:"file-tree-children",children:qC({nodes:l.children,depth:t+1,collapsedPathSet:n,selectedPath:s,onToggleTreePath:a,onFileClick:c})}):null]},`session-directory:${l.path}`)}return i.jsx("div",{className:"file-tree-node",children:i.jsxs("button",{className:"file-tree-item is-session-change",type:"button","data-active":s===l.change.path,"data-kind":"file",style:{paddingInlineStart:`${lb+t*cb}px`},onClick:()=>void c(l.change.path,!Wm(l.change)),children:[i.jsx("span",{className:"file-tree-chevron is-hidden","aria-hidden":"true",children:">"}),i.jsx("span",{className:"git-tree-file-icon","data-kind":Cs(l.name),"aria-hidden":"true",children:Ss(l.name)}),i.jsxs("span",{className:"file-tree-label",children:[i.jsx("span",{className:"file-tree-name",children:l.name}),i.jsx("span",{className:"file-tree-path",children:WC(l.change,h("conversation.filePanelSessionDeleted"))})]}),i.jsxs("span",{className:"file-session-item-meta",children:[i.jsx("span",{className:"file-session-badge","data-status":l.change.status,children:l.change.status}),i.jsx("span",{className:"file-session-badge subtle",children:l.change.staged?h("git.stagedLabel"):h("git.workingTreeLabel")})]})]})},`session-file:${l.path}`)})}function bU({items:e,selectedPath:t,onFileClick:n}){return e.map(s=>i.jsx("div",{className:"file-session-list-item",children:i.jsxs("button",{className:"file-session-list-button",type:"button","data-active":t===s.path,onClick:()=>void n(s.path,!Wm(s)),children:[i.jsx("span",{className:"git-tree-file-icon","data-kind":Cs(Rc(s.path)),"aria-hidden":"true",children:Ss(Rc(s.path))}),i.jsxs("span",{className:"file-tree-label",children:[i.jsx("span",{className:"file-tree-name",children:Rc(s.path)}),i.jsx("span",{className:"file-tree-path",children:WC(s,h("conversation.filePanelSessionDeleted"))})]}),i.jsxs("span",{className:"file-session-item-meta",children:[i.jsx("span",{className:"file-session-badge","data-status":s.status,children:s.status}),i.jsx("span",{className:"file-session-badge subtle",children:s.staged?h("git.stagedLabel"):h("git.workingTreeLabel")})]})]})},`session-list:${s.path}`))}function gc(e,t){return`file-panel.session-changes.${e}.${t}`}function Wh(e,t){return e instanceof Jn?e.message:typeof e=="object"&&e&&"message"in e?String(e.message??t):t}const pn="",xU=450,kU=300*1e3,SU=60*1e3,CU=1600,jU=20,NU=16;function $C({className:e,sessionId:t,workspaceId:n,hideHeading:s=!1,externalRevealRequest:a=null}){var xe;const{navigationGroups:c,subscribeFileTree:l,requestFileTreeRefresh:d,addFileTreeSnapshotListener:f,subscribeGitSnapshot:p,requestGitRefresh:y,addGitSnapshotListener:g}=tr(),[b,k]=v.useState({}),[S,C]=v.useState([]),[j,A]=v.useState([]),[L,M]=v.useState(pn),[O,q]=v.useState(null),[_,I]=v.useState(!1),[F,D]=v.useState(!1),[P,K]=v.useState(!1),[X,$]=v.useState(!1),[ee,te]=v.useState(""),[pe,ne]=v.useState(null),[z,ye]=v.useState(!1),[E,W]=v.useState(null),[re,T]=v.useState("workspace"),[ae,Le]=v.useState(0),[je,He]=v.useState(0),[qe,et]=v.useState(!1),[ot,bt]=v.useState(!1),[Ct,lt]=v.useState([]),[kt,Ve]=v.useState(!1),[Tt,Ot]=v.useState(null),St=v.useRef({}),Mt=v.useRef([]),Ht=v.useRef(pn),At=v.useRef(!1),vt=v.useRef(null),$t=v.useRef(null),Dt=v.useRef(null),Lt=v.useRef(null),ue=v.useRef(null),ge=v.useRef(0),Be=v.useRef(new Map),{showToast:Pe}=Kn(),ft=An(),dt=LC(R=>R.showSystemFiles),Rt=!!(t!=null&&t.trim()),ht=s&&ft.isMobile;v.useEffect(()=>{_t("file_panel.props",{sessionId:t,workspaceId:n})},[t,n]),v.useEffect(()=>{Ht.current=L},[L]);function Nt(R){k(de=>{const he=typeof R=="function"?R(de):R;return St.current=he,he})}function jt(R){C(de=>{const he=typeof R=="function"?R(de):R;return Mt.current=he,he})}v.useEffect(()=>{var it,ut;if(ie(),!n){ie(),At.current=!1,St.current={},Mt.current=[],Ht.current=pn,Nt({}),jt([]),A([]),M(pn),$(!1),te(""),ne(null),ye(!1),I(!1),Ve(!1),Ot(null);return}At.current=!0;const R=Mn(hb(n),kU);_t("file_panel.workspace_snapshot",{workspaceId:n,cached:!!R,cachedRootItems:((ut=(it=R==null?void 0:R.treeCache)==null?void 0:it[pn])==null?void 0:ut.length)??0,cachedDirectoryCount:Object.keys((R==null?void 0:R.treeCache)??{}).length});const de=FU((R==null?void 0:R.activeDirectoryPath)??pn,(R==null?void 0:R.treeCache)??{}),he=db((R==null?void 0:R.expandedDirectories)??[],de),ve=yc((R==null?void 0:R.treeCache)??{},de,he);St.current=ve,Mt.current=he,Ht.current=de,Nt(ve),jt(he),A([]),M(de),I(!1),D(!1),$(!1),te(""),ne(null),ye(!1),queueMicrotask(()=>{At.current=!1})},[n]),v.useEffect(()=>{if(!a||a.workspaceId!==n)return;const R=()=>{if(ue.current===a.requestId)return;ue.current=a.requestId,T("workspace"),(a.openViewer?Ae(a.filePath):Te(a.filePath)).catch(he=>{Pe({title:Ui(he,h("conversation.filePanelOpenFailed")),tone:"error"})})};if(At.current){queueMicrotask(R);return}R()},[a,Ae,Te,Pe,n]),v.useEffect(()=>{if(n)return f(R=>{R.workspaceId===n&&(Nt(de=>({...de,[R.path]:R.items})),R.path===pn&&I(!1),A(de=>de.filter(he=>he!==R.path)),H(R.path,R.items))})},[f,n]),v.useEffect(()=>()=>{ie()},[]),v.useEffect(()=>{n&&l(n,zh(Mt.current,Ht.current))},[L,S,l,n]),v.useEffect(()=>{q(null),W(null),Ot(null),Le(0),et(!1),bt(!1),vt.current=null,ge.current+=1},[t]),v.useEffect(()=>{!Rt&&re==="session"&&T("workspace")},[re,Rt]),v.useEffect(()=>{if(!qe&&!ot)return;function R(he){var ut,zt;if(!(he.target instanceof Node))return;const ve=((ut=$t.current)==null?void 0:ut.contains(he.target))??!1,it=((zt=Dt.current)==null?void 0:zt.contains(he.target))??!1;!ve&&!it&&(et(!1),bt(!1))}function de(he){he.key==="Escape"&&(et(!1),bt(!1))}return document.addEventListener("pointerdown",R),document.addEventListener("keydown",de),()=>{document.removeEventListener("pointerdown",R),document.removeEventListener("keydown",de)}},[qe,ot]),v.useEffect(()=>{if(!n)return;const R=db(S,L),de=yc(b,L,R);jr(hb(n),{treeCache:de,expandedDirectories:R,activeDirectoryPath:L})},[L,S,b,n]),v.useEffect(()=>{if(At.current)return;const R=yc(b,L,S);BU(b,R)||Nt(R)},[L,S,b]),v.useEffect(()=>{let R=!1;const de=(n==null?void 0:n.trim())??null;async function he(it){if(!de)return;const ut=Ec(St.current[pn]??[],dt),zt=(it==null?void 0:it.silent)!==!0&&ut.length===0;zt&&I(!0),_t("file_panel.load_root_tree.start",{sessionId:t,workspaceId:de,silent:(it==null?void 0:it.silent)===!0,cachedRootItems:ut.length});try{const Xt=await wn(pn,{force:!0});R||(_t("file_panel.load_root_tree.end",{sessionId:t,workspaceId:de,itemCount:Xt.length}),Nt(Fr=>({...yc(Fr,Ht.current,Mt.current),[pn]:Xt})))}catch(Xt){!R&&!fb(Xt)&&Pe({title:Ui(Xt,h("conversation.filePanelLoadFailed")),tone:"error"})}finally{!R&&zt&&I(!1)}}if(Ec(St.current[pn]??[],dt).length>0){const it=window.setTimeout(()=>{de&&(l(de,zh(Mt.current,Ht.current)),he({silent:!0}))},1500);return()=>{R=!0,window.clearTimeout(it)}}return he(),()=>{R=!0}},[t,dt,Pe,n]),v.useEffect(()=>{if(!n||!t){He(0);return}const R=Mn(UU(n,t),SU);_t("file_panel.session_change_count.snapshot",{sessionId:t,workspaceId:n,cached:R!==null,cachedCount:R}),He(R??0)},[t,ae,n]),v.useEffect(()=>{if(!n){lt([]);return}const R=n.trim();p(R),y(R)},[n,p,y]),v.useEffect(()=>{if(!n)return;const R=n.trim();return g(de=>{var he;de.workspaceId===R&&lt(((he=de.status)==null?void 0:he.changes)??[])})},[g,n]);const V=v.useMemo(()=>Um(Ct,R=>hU(R.path),dt),[Ct,dt]),Me=v.useMemo(()=>{const R=new Map,de=new Set;for(const he of V){const ve=he.path.replace(/\\/g,"/"),it=he.worktreeStatus??he.stagedStatus??he.status;R.set(ve,it);const ut=ve.split("/");for(let zt=1;zt<ut.length;zt++)de.add(ut.slice(0,zt).join("/"))}return{statusByPath:R,changedDirs:de}},[V]),ze=v.useMemo(()=>mU(b,dt),[dt,b]),wt=v.useMemo(()=>pe===null?null:Ec(pe,dt),[pe,dt]),Bt=ze[pn]??[],Zt=X&&wt!==null,Vt=((xe=c.find(R=>R.workspace.id===n))==null?void 0:xe.workspace)??null,ke=EU(O,L),Qe=!!(Vt!=null&&Vt.path&&ke!==null),cn=!!O,yn=!!((O?va(O):L)&&S.length);async function un(R,de=!1){if(!n)return[];if(!de){const he=St.current[R];if(he)return he}R===pn?I(!0):A(he=>Ac(he,R));try{const he=await wn(R,{force:de});return Nt(ve=>({...ve,[R]:he})),he}catch(he){throw fb(he)||Pe({title:Ui(he,h("conversation.filePanelLoadFailed")),tone:"error"}),he}finally{R===pn?I(!1):A(he=>he.filter(ve=>ve!==R))}}async function on(){if(!n)return;const R=OU(St.current,L,Mt.current);_t("file_panel.refresh_tree_cache.start",{sessionId:t,workspaceId:n,targetDirectories:R});const he=(await Promise.all(R.map(async ve=>{const it=await wn(ve,{force:!0});return[ve,it]}))).reduce((ve,[it,ut])=>(ve[it]=ut,ve),{});_t("file_panel.refresh_tree_cache.end",{sessionId:t,workspaceId:n,targetDirectories:R,directoryCount:Object.keys(he).length}),Nt(he)}async function wn(R,de){if(!n)return[];if(!(de!=null&&de.force)){const ve=St.current[R];if(ve)return ve}const he=zh(Ac(Mt.current,R),R||Ht.current);return l(n,he),d(n,[R]),xn(R)}function xn(R,de=CU){const he=St.current[R];return he?Promise.resolve(he):new Promise((ve,it)=>{const ut=window.setTimeout(()=>{Z(R,ut),it(new Error(`FILE_TREE_SNAPSHOT_TIMEOUT:${R}`))},de),zt=Be.current.get(R)??[];Be.current.set(R,[...zt,{resolve:ve,reject:it,timerId:ut}])})}function H(R,de){const he=Be.current.get(R)??[];he.length!==0&&(Be.current.delete(R),he.forEach(ve=>{window.clearTimeout(ve.timerId),ve.resolve(de)}))}function Z(R,de){const ve=(Be.current.get(R)??[]).filter(it=>it.timerId!==de);if(ve.length===0){Be.current.delete(R);return}Be.current.set(R,ve)}function ie(){for(const[R,de]of Be.current.entries())de.forEach(he=>{window.clearTimeout(he.timerId),he.reject(new Error(`FILE_TREE_ABORTED:${R}`))});Be.current.clear()}async function we(R,de=!1){const he=_a(R,de);if(!he.length){M(pn);return}jt(ve=>QC(ve,he)),M(he[he.length-1]??pn);for(const ve of he)try{await un(ve)}catch{return}}async function Te(R){q(R),M(va(R)),await we(R)}async function Ae(R){W(R),Ot(null),vt.current=null,ge.current+=1,Te(R);const de=ge.current,he=R.replace(/\\/g,"/"),ve=Me.statusByPath.get(he);if(n&&ve&&ve!=="?"&&ve!=="D")try{const it=await DC(n,R,!1);ge.current===de&&Ot(it.content||null)}catch{ge.current===de&&Ot(null)}}function $e(R){const de=Date.now(),he=vt.current;return vt.current={filePath:R,timestamp:de},(he==null?void 0:he.filePath)===R&&de-he.timestamp<=xU}function Ie(){vt.current=null}async function Ue(R){if($e(R)){await Ae(R);return}await Te(R)}function Fe(){$(!1),te(""),ne(null),Ie()}async function Oe(R){if(R.kind==="directory"){Fe(),await ct(R.path);return}if($e(R.path)){Fe(),await Ae(R.path);return}await Te(R.path)}async function ct(R){if(q(null),M(R),!Mt.current.includes(R))try{await un(R),jt(de=>Ac(de,R))}catch{}}async function rt(R){if(q(null),M(R),Mt.current.includes(R)){Ut(R);return}await ct(R)}function Ut(R){jt(de=>de.filter(he=>he!==R&&!he.startsWith(`${R}/`))),M(va(R)),q(null)}async function Pt(){if(!n)return;const R=n;try{if(y(R),await on(),O&&await we(O),Zt&&ee.trim()){const de=await kf(R,ee.trim());ne(de.items)}}catch(de){Pe({title:Ui(de,h("conversation.filePanelLoadFailed")),tone:"error"})}}async function We(R){if(R==null||R.preventDefault(),!n||!ee.trim()){ne(null);return}ye(!0);try{const de=await kf(n,ee.trim());ne(de.items)}catch(de){Pe({title:Ui(de,h("conversation.filePanelSearchFailed")),tone:"error"})}finally{ye(!1)}}function se(){if(X){$(!1),te(""),ne(null);return}$(!0)}function Ce(R){bt(!1),R()}function B(){var R;(R=Lt.current)==null||R.click()}async function le(R){var ut;const de=((ut=R.target.files)==null?void 0:ut[0])??null;if(R.target.value="",!de||!n)return;const he=TU(de.name);if(!he){Pe({title:h("conversation.filePanelUploadFailed"),tone:"error"});return}const ve=ub(L,O),it=PU(ve,he);K(!0);try{const zt=await AU(de);await o_({workspaceId:n,path:it,contentBase64:zt}),await on(),await Te(it),Pe({title:h("conversation.filePanelUploadSuccess",{name:he}),tone:"success"})}catch(zt){Pe({title:Ui(zt,h("conversation.filePanelUploadFailed")),tone:"error"})}finally{K(!1)}}async function Se(){if(!(!n||!O)){K(!0);try{const R=await a_(n,O),de=LU(R.contentBase64);IU(R.fileName,new Blob([de],{type:"application/octet-stream"})),Pe({title:h("conversation.filePanelDownloadSuccess",{name:R.fileName}),tone:"success"})}catch(R){Pe({title:Ui(R,h("conversation.filePanelDownloadFailed")),tone:"error"})}finally{K(!1)}}}function Ye(){const R=O?va(O):L;!R||!Mt.current.includes(R)||Ut(R)}async function tt(R){if(!n)return;const de=ub(L,O),he=de?`${de}/`:"",ve=window.prompt(h(R==="create_file"?"conversation.filePanelCreateFilePrompt":"conversation.filePanelCreateDirectoryPrompt"),he);if(!(ve!=null&&ve.trim()))return;const it=ve.trim();D(!0);try{await s_({workspaceId:n,opType:R,dstPath:it,content:R==="create_file"?"":void 0}),await on(),R==="create_directory"?(await we(it,!0),q(null)):await Te(it)}catch(ut){Pe({title:Ui(ut,h("conversation.filePanelMutateFailed")),tone:"error"})}finally{D(!1)}}async function nn(R){const de=(Vt==null?void 0:Vt.path)??"";if(ke===null||!de){et(!1);return}try{const he=MU(de),ve=R==="absolute"?RU(de,ke,he):VC(ke,he);await DU(ve,ft),Pe({title:h(R==="absolute"?"conversation.filePanelCopyAbsolutePathSuccess":"conversation.filePanelCopyRelativePathSuccess"),tone:"success"})}catch(he){Pe({title:he instanceof Error?he.message:h("conversation.filePanelCopyPathFailed"),tone:"error"})}finally{et(!1)}}function Ln(R,de){return i.jsx(i.Fragment,{children:R.map(he=>{const ve=he.kind==="directory",it=ve&&S.includes(he.path),ut=ve&&j.includes(he.path),zt=ze[he.path]??[],Xt=kt?Hh(zt,ze,Me.statusByPath,Me.changedDirs):zt,Fr=O===he.path||O===null&&ve&&L===he.path,nr=Me.statusByPath.get(he.path.replace(/\\/g,"/")),Jr=ve&&Me.changedDirs.has(he.path.replace(/\\/g,"/"));return i.jsxs("div",{className:"file-tree-node",children:[i.jsxs("button",{className:"file-tree-item",type:"button","data-active":Fr,"data-kind":he.kind,"aria-expanded":ve?it:void 0,style:{paddingInlineStart:`${jU+de*NU}px`},onClick:()=>{if(ve){Ie(),rt(he.path);return}Ue(he.path)},children:[i.jsx("span",{className:`file-tree-chevron${ve?"":" is-hidden"}`,"aria-hidden":"true",children:it?"v":">"}),ve?null:i.jsx("span",{className:"git-tree-file-icon","data-kind":Cs(he.name),"aria-hidden":"true",children:Ss(he.name)}),i.jsx("span",{className:"file-tree-label","data-status":nr??void 0,"data-has-changes":Jr||void 0,children:he.name}),!ve&&nr?i.jsx("span",{className:"git-status-badge","data-status":nr,"aria-label":nr,children:nr}):null,ve&&Jr?i.jsx("span",{className:"file-tree-dir-badge","aria-hidden":"true"}):null,ut?i.jsx("span",{className:"file-tree-meta",children:h("common.loading")}):null]}),ve&&it?i.jsx("div",{className:"file-tree-children",children:ut&&!zt.length?i.jsx("p",{className:"file-tree-empty",children:h("common.loading")}):Xt.length?Ln(Xt,de+1):i.jsx("p",{className:"file-tree-empty",children:h("conversation.filePanelEmptyDirectory")})}):null]},`${he.kind}-${he.path}`)})})}function Y(R){return i.jsx(i.Fragment,{children:R.map(de=>{const he=de.kind==="directory",ve=O===de.path;return i.jsx("div",{className:"file-tree-node",children:i.jsxs("button",{className:"file-tree-item is-search-result",type:"button","data-active":ve,"data-kind":de.kind,onClick:()=>{Oe(de)},children:[i.jsx("span",{className:"file-tree-chevron is-hidden","aria-hidden":"true",children:">"}),he?null:i.jsx("span",{className:"git-tree-file-icon","data-kind":Cs(de.name),"aria-hidden":"true",children:Ss(de.name)}),i.jsxs("span",{className:"file-tree-label",children:[i.jsx("span",{className:"file-tree-name",children:de.name}),i.jsx("span",{className:"file-tree-path",children:de.path})]})]})},`search-${de.kind}-${de.path}`)})})}return i.jsx("section",{className:["conversation-panel","surface-card","file-panel",e].filter(Boolean).join(" "),"data-testid":"file-context-panel",children:n?i.jsxs(i.Fragment,{children:[i.jsx(FC,{workspaceId:n,filePath:E,open:E!==null,onClose:()=>{ge.current+=1,W(null),Ot(null)},onSaved:async R=>{await on(),await Te(R),Le(de=>de+1)},diffContent:Tt}),s?null:i.jsx("div",{className:"file-panel-heading-row",children:i.jsx("h2",{className:"file-panel-heading",children:h("conversation.filePanelTitle")})}),i.jsxs("div",{className:"file-panel-tabs",role:"tablist","aria-label":h("conversation.filePanelTitle"),children:[i.jsx("button",{className:re==="workspace"?"file-panel-tab active":"file-panel-tab",type:"button",role:"tab","aria-selected":re==="workspace",onClick:()=>T("workspace"),children:h("conversation.filePanelWorkspaceTab")}),i.jsxs("button",{className:re==="session"?"file-panel-tab active":"file-panel-tab",type:"button",role:"tab","aria-selected":re==="session",onClick:()=>{Rt&&T("session")},disabled:!Rt,children:[h("conversation.filePanelSessionTab"),i.jsx("span",{className:"file-panel-tab-badge","aria-label":`${h("conversation.filePanelSessionTab")} ${je}`,children:je})]})]}),re==="workspace"?i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:Lt,"data-testid":"file-panel-upload-input",type:"file",hidden:!0,onChange:R=>void le(R)}),ht?i.jsx("div",{className:"file-panel-toolbar file-panel-toolbar-mobile","aria-label":h("conversation.filePanelTitle"),children:i.jsxs("div",{className:"file-mobile-action-shell",ref:Dt,children:[i.jsxs("button",{className:"secondary-button file-mobile-action-trigger",type:"button","aria-label":h("conversation.filePanelActionsMenu"),"aria-haspopup":"menu","aria-expanded":ot,"data-active":ot,onClick:()=>{et(!1),bt(R=>!R)},children:[i.jsx("span",{children:h("conversation.filePanelActionsMenu")}),i.jsx(KU,{})]}),ot?i.jsxs("div",{className:"file-mobile-action-menu",role:"menu","aria-label":h("conversation.filePanelActionsMenu"),children:[i.jsx("button",{className:"file-mobile-action-menu-item",type:"button",role:"menuitem",onClick:()=>{bt(!1),se()},children:h(X?"conversation.filePanelHideSearch":"conversation.filePanelShowSearch")}),i.jsx("button",{className:"file-mobile-action-menu-item",type:"button",role:"menuitem",onClick:()=>{bt(!1),Ve(R=>!R)},disabled:V.length===0,children:h(kt?"conversation.filePanelShowAll":"conversation.filePanelFilterChanges")}),i.jsx("button",{className:"file-mobile-action-menu-item",type:"button",role:"menuitem",onClick:()=>Ce(Pt),disabled:_||F||z,children:h("conversation.filePanelRefresh")}),i.jsx("button",{className:"file-mobile-action-menu-item",type:"button",role:"menuitem",onClick:()=>{bt(!1),Ye()},disabled:!yn,children:h("conversation.filePanelCollapseCurrent")}),i.jsx("button",{className:"file-mobile-action-menu-item",type:"button",role:"menuitem",onClick:()=>{bt(!1),B()},disabled:F||P,children:h("conversation.filePanelUpload")}),i.jsx("button",{className:"file-mobile-action-menu-item",type:"button",role:"menuitem",onClick:()=>Ce(Se),disabled:!cn||P,children:h("conversation.filePanelDownload")}),i.jsx("button",{className:"file-mobile-action-menu-item",type:"button",role:"menuitem",onClick:()=>Ce(()=>tt("create_file")),disabled:F||P,children:h("conversation.filePanelNewFile")}),i.jsx("button",{className:"file-mobile-action-menu-item",type:"button",role:"menuitem",onClick:()=>Ce(()=>tt("create_directory")),disabled:F||P,children:h("conversation.filePanelNewDirectory")}),i.jsx("button",{className:"file-mobile-action-menu-item",type:"button",role:"menuitem",onClick:()=>Ce(()=>nn("absolute")),disabled:!Qe,children:h("conversation.filePanelCopyAbsolutePath")}),i.jsx("button",{className:"file-mobile-action-menu-item",type:"button",role:"menuitem",onClick:()=>Ce(()=>nn("relative")),disabled:!Qe,children:h("conversation.filePanelCopyRelativePath")})]}):null]})}):i.jsxs("div",{className:"file-panel-toolbar","aria-label":h("conversation.filePanelTitle"),children:[i.jsxs("div",{className:"file-toolbar-menu-shell",ref:$t,children:[i.jsx("button",{className:"file-toolbar-button",type:"button",title:h("conversation.filePanelCopyPath"),"aria-label":h("conversation.filePanelCopyPath"),"aria-haspopup":"menu","aria-expanded":qe,"data-active":qe,onClick:()=>{bt(!1),et(R=>!R)},disabled:!Qe,children:i.jsx(HU,{})}),qe?i.jsxs("div",{className:"file-toolbar-menu",role:"menu",children:[i.jsx("button",{className:"file-toolbar-menu-item",type:"button",role:"menuitem",onClick:()=>void nn("absolute"),children:h("conversation.filePanelCopyAbsolutePath")}),i.jsx("button",{className:"file-toolbar-menu-item",type:"button",role:"menuitem",onClick:()=>void nn("relative"),children:h("conversation.filePanelCopyRelativePath")})]}):null]}),i.jsx("button",{className:"file-toolbar-button",type:"button",title:h("conversation.filePanelCollapseCurrent"),"aria-label":h("conversation.filePanelCollapseCurrent"),onClick:Ye,disabled:!yn,children:i.jsx(WU,{})}),i.jsx("button",{className:"file-toolbar-button",type:"button",title:h("conversation.filePanelRefresh"),"aria-label":h("conversation.filePanelRefresh"),onClick:()=>void Pt(),disabled:_||F||z,children:i.jsx(zU,{})}),i.jsx("button",{className:"file-toolbar-button",type:"button",title:h("conversation.filePanelSearchButton"),"aria-label":h("conversation.filePanelSearchButton"),"data-active":X,onClick:se,disabled:_,children:i.jsx(mb,{})}),V.length>0?i.jsx("button",{className:"file-toolbar-button",type:"button",title:h(kt?"conversation.filePanelShowAll":"conversation.filePanelFilterChanges"),"aria-label":h(kt?"conversation.filePanelShowAll":"conversation.filePanelFilterChanges"),"data-active":kt,onClick:()=>Ve(R=>!R),children:i.jsx(QU,{})}):null,i.jsx("button",{className:"file-toolbar-button",type:"button",title:h("conversation.filePanelUpload"),"aria-label":h("conversation.filePanelUpload"),onClick:B,disabled:F||P,children:i.jsx($U,{})}),i.jsx("button",{className:"file-toolbar-button",type:"button",title:h("conversation.filePanelDownload"),"aria-label":h("conversation.filePanelDownload"),onClick:()=>void Se(),disabled:!cn||P,children:i.jsx(VU,{})}),i.jsx("button",{className:"file-toolbar-button",type:"button",title:h("conversation.filePanelNewFile"),"aria-label":h("conversation.filePanelNewFile"),onClick:()=>void tt("create_file"),disabled:F||P,children:i.jsx(qU,{})}),i.jsx("button",{className:"file-toolbar-button",type:"button",title:h("conversation.filePanelNewDirectory"),"aria-label":h("conversation.filePanelNewDirectory"),onClick:()=>void tt("create_directory"),disabled:F||P,children:i.jsx(GU,{})})]}),X?i.jsxs("form",{className:"file-toolbar-search",onSubmit:R=>void We(R),children:[i.jsx("input",{value:ee,onChange:R=>te(R.target.value),placeholder:h("conversation.filePanelSearchPlaceholder")}),ht?i.jsx("button",{className:"secondary-button file-mobile-search-submit",type:"submit","aria-label":h("conversation.filePanelSearchButton"),disabled:z,children:h("conversation.filePanelSearchButton")}):i.jsx("button",{className:"file-toolbar-button",type:"submit",title:h("conversation.filePanelSearchButton"),"aria-label":h("conversation.filePanelSearchButton"),disabled:z,children:i.jsx(mb,{})})]}):null,i.jsx("div",{className:"file-tree","data-search-mode":Zt,children:_&&Bt.length===0?i.jsx("p",{className:"file-tree-status status-text",children:h("common.loading")}):Zt?wt!=null&&wt.length?Y(wt):i.jsx("p",{className:"file-tree-status status-text",children:h("conversation.filePanelSearchEmpty")}):kt?Hh(Bt,ze,Me.statusByPath,Me.changedDirs).length?Ln(Hh(Bt,ze,Me.statusByPath,Me.changedDirs),0):i.jsx("p",{className:"file-tree-status status-text",children:h("conversation.filePanelNoChanges")}):Bt.length?Ln(Bt,0):i.jsx("p",{className:"file-tree-status status-text",children:h("conversation.filePanelEmptyDirectory")})})]}):Rt&&t?i.jsx(wU,{sessionId:t,workspaceId:n,showSystemFiles:dt,selectedPath:O,refreshVersion:ae,onCountChange:He,onSelectFile:Te,onOpenFile:Ae}):i.jsx("section",{className:"file-panel-section",children:i.jsx("p",{className:"status-text",children:h("conversation.filePanelSessionNoSession")})})]}):i.jsx("section",{className:"file-panel-section",children:i.jsx("p",{className:"status-text",children:h("conversation.filePanelNoWorkspace")})})})}function va(e){return e.includes("/")?e.split("/").slice(0,-1).join("/"):pn}function _a(e,t=!1){const n=e.split("/").filter(Boolean),s=t?n.length:n.length-1,a=[];for(let c=0;c<s;c+=1)a.push(n.slice(0,c+1).join("/"));return a}function ub(e,t){return e||(t?va(t):pn)}function PU(e,t){return e?`${e}/${t}`:t}function TU(e){var t;return((t=e.split(/[/\\]/).pop())==null?void 0:t.trim())??""}function EU(e,t){return e||t||null}function VC(e,t="posix"){return e?GC(e,t):"."}function RU(e,t,n){const s=GC(e,n),a=VC(t,n).replace(/^\.[/\\]?/,"");if(!a)return s;const c=KC(n),l=a.replace(/^[/\\]+/,"");return l?s.endsWith("/")||s.endsWith("\\")?`${s}${l}`:`${s}${c}${l}`:s}function MU(e){return/^[a-zA-Z]:[\\/]/.test(e)||e.includes("\\")?"windows":"posix"}function GC(e,t){return e&&(KC(t)==="\\"?e.replace(/\//g,"\\"):e.replace(/\\/g,"/"))}function KC(e){return e==="windows"?"\\":"/"}async function AU(e){const t=await e.arrayBuffer(),n=new Uint8Array(t),s=32768;let a="";for(let c=0;c<n.length;c+=s){const l=n.subarray(c,c+s);a+=String.fromCharCode(...l)}return btoa(a)}function LU(e){const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s+=1)n[s]=t.charCodeAt(s);return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}function IU(e,t){if(typeof document>"u")throw new Error(h("conversation.filePanelDownloadFailed"));const n=window.URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=e,document.body.append(s),s.click(),s.remove(),window.URL.revokeObjectURL(n)}async function DU(e,t){var n;if(!(t.isDesktop&&(await t.bridge.writeClipboardText(e)).ok)){if(typeof navigator<"u"&&((n=navigator.clipboard)!=null&&n.writeText))try{await navigator.clipboard.writeText(e);return}catch{}if(!_U(e))throw new Error(h("conversation.filePanelCopyPathFailed"))}}function _U(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly","true"),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t)}}function FU(e,t){return e&&_a(e,!0).every(a=>a in t)?e:pn}function db(e,t){if(!t)return[];const n=_a(t,!0);return e.filter(s=>n.includes(s))}function yc(e,t,n){const s=zm(t,n);return Object.entries(e).reduce((a,[c,l])=>(s.has(c)&&(a[c]=l),a),{})}function OU(e,t,n){const a=[...zm(t,n)].filter(c=>c===pn||c in e);return a.length?a:[pn]}function zm(e,t){const n=new Set([pn]),s=QC(t,_a(e,!0));for(const a of s){n.add(a);for(const c of _a(a,!0))n.add(c)}return n}function BU(e,t){const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every(a=>e[a]===t[a])}function Ac(e,t){return e.includes(t)?e:[...e,t]}function QC(e,t){return t.reduce((n,s)=>Ac(n,s),e)}function hb(e){return`file-panel.workspace-tree.${e}`}function UU(e,t){return`file-panel.session-change-count.${e}.${t}`}function zh(e,t){return[...zm(t,e)]}function Ui(e,t){return e instanceof Jn?e.message:t}function fb(e){return e instanceof Error&&(e.message.startsWith("FILE_TREE_SNAPSHOT_TIMEOUT:")||e.message.startsWith("FILE_TREE_ABORTED:"))}function WU(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M2.5 4.5h11v2h-11zM2.5 7.5h7v2h-7zM2.5 10.5h4v2h-4z",fill:"currentColor"})})}function zU(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M12.8 5.2A5.5 5.5 0 1 0 13.5 8h-1.8A3.7 3.7 0 1 1 10.6 5l-1.4 1.4h4V2l-1.4 1.4z",fill:"currentColor"})})}function mb(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M11.2 10.1l3 3-1.1 1.1-3-3a5 5 0 1 1 1.1-1.1zM6.8 10.3a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z",fill:"currentColor"})})}function HU(){return i.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[i.jsx("path",{d:"M3.5 4.3h5.2v1.4H4.9v5.4H3.5zm3.8-2.1h5.2v9.5H7.3z",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M5.7 10.8h4.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"})]})}function qU(){return i.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[i.jsx("path",{d:"M4 1.5h5l3 3v10H4z",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M9 1.5v3h3",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M8 6.5v5M5.5 9h5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"})]})}function $U(){return i.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[i.jsx("path",{d:"M3 11.5v2h10v-2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M8 2.5v8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"m5.5 5 2.5-2.5L10.5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function VU(){return i.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[i.jsx("path",{d:"M3 11.5v2h10v-2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M8 2.5v8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"m5.5 8.5 2.5 2.5 2.5-2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function GU(){return i.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[i.jsx("path",{d:"M1.8 4.5h4l1.2 1.3h7.2v6.7H1.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M8.5 7.2v4M6.5 9.2h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"})]})}function KU(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"m4 6 4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function QU(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M1.5 2h13l-5 6v5l-3 1.5V8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function Hh(e,t,n,s){const a=[];for(const c of e){const l=c.path.replace(/\\/g,"/");c.kind==="file"?n.has(l)&&a.push(c):YC(l,t,n,s)&&a.push(c)}return a}function YC(e,t,n,s,a){const c=a??new Set;if(c.has(e))return!1;c.add(e);const l=t[e];if(!l)return s.has(e);for(const d of l){const f=d.path.replace(/\\/g,"/");if(d.kind==="file"){if(n.has(f))return!0}else if(YC(f,t,n,s,c))return!0}return!1}const YU=Object.freeze(Object.defineProperty({__proto__:null,FileContextPanel:$C},Symbol.toStringTag,{value:"Module"})),qh=56,pb=28,$h=72,vc=8,gb=960,yb=60*1e3,vb=20,wb=9,bb=9,Vh=68;function XC({className:e,workspaceId:t}){const{subscribeGitSnapshot:n,requestGitRefresh:s,addGitSnapshotListener:a}=tr(),[c,l]=v.useState(null),[d,f]=v.useState([]),[p,y]=v.useState(0),[g,b]=v.useState(null),[k,S]=v.useState(!1),[C,j]=v.useState(null),[A,L]=v.useState(null),[M,O]=v.useState(""),[q,_]=v.useState(!1),[I,F]=v.useState(!1),[D,P]=v.useState([]),[K,X]=v.useState(!0),[$,ee]=v.useState(!1),[te,pe]=v.useState(()=>typeof window<"u"?window.innerWidth<=gb:!1),[ne,z]=v.useState([]),[ye,E]=v.useState(null),[W,re]=v.useState("unstaged"),[T,ae]=v.useState(null),[Le,je]=v.useState(!1),[He,qe]=v.useState([]),[et,ot]=v.useState(!1),[bt,Ct]=v.useState(new Set),[lt,kt]=v.useState(new Map),[Ve,Tt]=v.useState(null),[Ot,St]=v.useState(qh),[Mt,Ht]=v.useState(!1),[At,vt]=v.useState(null),[$t,Dt]=v.useState(null),Lt=v.useRef(null),ue=v.useRef(null),ge=v.useRef(null),Be=v.useRef(null),{showToast:Pe}=Kn();v.useEffect(()=>{_t("git_sidebar.props",{workspaceId:t})},[t]),v.useEffect(()=>{P([]),X(!0),y(0),b(null),S(!1),L(null),O(""),ee(!1),z([]),E(null),re("unstaged"),ae(null),Tt(null),Ht(!1),St(qh),vt(null),Dt(null)},[t]),v.useEffect(()=>{function B(){pe(window.innerWidth<=gb)}return B(),window.addEventListener("resize",B),()=>{window.removeEventListener("resize",B)}},[]),v.useEffect(()=>{if(!Mt)return;const B=document.body.style.cursor,le=document.body.style.userSelect;document.body.style.cursor="row-resize",document.body.style.userSelect="none";function Se(tt){xn(tt.clientY)}function Ye(){Ht(!1)}return window.addEventListener("pointermove",Se),window.addEventListener("pointerup",Ye),()=>{document.body.style.cursor=B,document.body.style.userSelect=le,window.removeEventListener("pointermove",Se),window.removeEventListener("pointerup",Ye)}},[Mt]),v.useEffect(()=>{var Se,Ye;if(!(t!=null&&t.trim())){l(null),f([]),y(0),b(null),j(null),_(!1);return}const B=t.trim(),le=Mn(Kh(B),yb);if(_t("git_sidebar.snapshot",{workspaceId:B,cached:!!le,cachedHistoryCount:((Se=le==null?void 0:le.history)==null?void 0:Se.length)??0,cachedChangedCount:((Ye=le==null?void 0:le.status)==null?void 0:Ye.changes.length)??0}),le){dt(le),_(!1);return}l(null),f([]),y(0),b(null),j(null),_(!0)},[t]),v.useEffect(()=>{if(t!=null&&t.trim())return a(B=>{var le,Se,Ye;B.workspaceId===t.trim()&&(_t("git_sidebar.snapshot_received",{workspaceId:B.workspaceId,changedCount:((le=B.status)==null?void 0:le.changes.length)??0,historyCount:B.history.length,branchCount:(((Se=B.branches)==null?void 0:Se.local.length)??0)+(((Ye=B.branches)==null?void 0:Ye.remote.length)??0)}),dt(B),_(!1))})},[a,t]),v.useEffect(()=>{if(!(t!=null&&t.trim()))return;const B=t.trim(),le=Mn(Kh(B),yb)!==null;n(B),!le&&Rt()},[s,n,t]),v.useEffect(()=>{t&&jr(Kh(t),{status:c,history:d,historyTotalCount:p,historyNextCursor:g,branches:C})},[C,d,g,p,c,t]),v.useEffect(()=>{if(!c||!A)return;c.changes.find(le=>le.path===A)||L(null)},[A,c]),v.useEffect(()=>{e4(Be.current)},[M]),v.useEffect(()=>{te||(z([]),E(null),ae(null),Tt(null))},[te]),v.useEffect(()=>{if(!c){z([]);return}const B=new Set(c.changes.map(le=>le.path));z(le=>le.filter(Se=>B.has(Se)))},[c]);function ft(){const B=ge.current;if(!B)return;B.querySelectorAll(".git-tree-shell").forEach(Se=>{Se.scrollTop=0})}function dt(B){l(B.status),f(Array.isArray(B.history)?B.history:[]),y(typeof B.historyTotalCount=="number"?B.historyTotalCount:0),b(typeof B.historyNextCursor=="string"?B.historyNextCursor:null),j(B.branches??null)}function Rt(B){t!=null&&t.trim()&&(_(!0),_t("git_sidebar.refresh_requested",{workspaceId:t.trim(),resetTreeScroll:!1}),s(t.trim()))}async function ht(B){if(!(t!=null&&t.trim()))return;const le=t.trim();_(!0);try{const[Se,Ye,tt]=await Promise.all([IC(le),ib(le,vb,null),LB(le)]);dt({status:Se,history:Ye.items,historyTotalCount:Ye.totalCount,historyNextCursor:Ye.nextCursor,branches:tt}),s(le),B!=null&&B.resetTreeScroll&&requestAnimationFrame(()=>{ft()})}catch(Se){Pe({title:Vr(Se,h("git.panelLoadFailed")),tone:"error"})}finally{_(!1)}}async function Nt(){if(!(!t||!g||k)){S(!0);try{const B=await ib(t,vb,g);f(le=>{const Se=new Set(le.map(tt=>tt.commitHash)),Ye=B.items.filter(tt=>!Se.has(tt.commitHash));return[...le,...Ye]}),y(B.totalCount),b(B.nextCursor)}catch(B){Pe({title:Vr(B,h("git.panelLoadFailed")),tone:"error"})}finally{S(!1)}}}function jt(B){if(!K||k||!g)return;const le=B.currentTarget;le.scrollHeight-le.scrollTop-le.clientHeight<=40&&Nt()}async function V(){if(t){F(!0);try{const B=await RB(t,"ai");O(B.validation.normalizedDraft.subject||B.draft.subject)}catch(B){Pe({title:Vr(B,h("git.draftFailed")),tone:"error"})}finally{F(!1)}}}async function Me(B,le){if(t&&B.length){F(!0);try{const Se=le?await TB(t,B):await _C(t,B);l(Se),L(B[B.length-1]??null),z(Ye=>Ye.filter(tt=>!B.includes(tt))),E(null),Rt()}catch(Se){_(!1),Pe({title:Vr(Se,h("git.stageFailed")),tone:"error"})}finally{F(!1)}}}async function ze(B){if(t&&B.length){F(!0);try{const le=await EB(t,B);l(le),B.includes(A??"")&&L(null),z(Se=>Se.filter(Ye=>!B.includes(Ye))),E(null),Rt()}catch(le){_(!1),Pe({title:Vr(le,h("git.discardFailed")),tone:"error"})}finally{F(!1)}}}async function wt(){if(!(!t||!M.trim())){F(!0);try{await MB(t,ZU(M)),Pe({title:h("git.commitSuccess"),tone:"success"}),O(""),L(null),Rt()}catch(B){Pe({title:Vr(B,h("git.commitFailed")),tone:"error"})}finally{F(!1)}}}async function Bt(){if(t){ot(!0);try{const B=await DB(t);if(B.length===0){Pe({title:h("git.noRemotes"),tone:"error"});return}if(B.length===1){Zt([B[0].name]);return}qe(B),Ct(new Set),kt(new Map),je(!0)}catch(B){Pe({title:Vr(B,h("git.remoteFailed")),tone:"error"})}finally{ot(!1)}}}async function Zt(B){if(!t||B.length===0)return;F(!0),kt(new Map);const le=await Promise.allSettled(B.map(async tt=>{const nn=await sb(t,"push",tt);return{name:tt,summary:nn.summary}})),Se=new Map;let Ye=!1;for(const tt of le)if(tt.status==="fulfilled")Se.set(tt.value.name,{ok:!0,summary:tt.value.summary});else{Ye=!0;const nn=B[Se.size];Se.set(nn,{ok:!1,summary:Vr(tt.reason,h("git.remoteFailed"))})}kt(Se),Rt(),F(!1),Ye||(Pe({title:h("git.pushAllSuccess",{count:String(B.length)}),tone:"success"}),je(!1))}async function Vt(B){if(t){if(B==="push"){ee(!1),Bt();return}F(!0);try{const le=await sb(t,B);Pe({title:le.summary,tone:"success"}),ee(!1),Rt()}catch(le){Pe({title:Vr(le,h("git.remoteFailed")),tone:"error"})}finally{F(!1)}}}async function ke(){if(t){F(!0);try{const B=await AB(t);O(B.commitSubject??""),Pe({title:B.summary||h("git.undoLastCommitSuccess"),tone:"success"}),ee(!1),Rt()}catch(B){Pe({title:Vr(B,h("git.undoLastCommitFailed")),tone:"error"})}finally{F(!1)}}}async function Qe(B){if(t){F(!0);try{const le=await IB(t,B,!1);j(le),ee(!1),Rt()}catch(le){Pe({title:Vr(le,h("git.branchFailed")),tone:"error"})}finally{F(!1)}}}function cn(B){P(le=>le.includes(B)?le.filter(Se=>Se!==B):[...le,B])}const yn=450;function un(B){const le=Date.now(),Se=Lt.current;return Lt.current={filePath:B,timestamp:le},(Se==null?void 0:Se.filePath)===B&&le-Se.timestamp<=yn}async function on(B,le){if(le.binary){Pe({title:h("git.binaryDiff"),tone:"info"});return}if(le.status==="A"||le.status==="?")Dt(null),vt(B);else if(t)try{const Se=await DC(t,B,le.staged);Dt(Se.content),vt(B)}catch{Dt(null),vt(B)}}function wn(B){L(B),E(null),z(le=>le.includes(B)?le.filter(Se=>Se!==B):[...le,B])}function xn(B){const le=ue.current;if(!le||!Number.isFinite(B))return;const Se=le.getBoundingClientRect(),Ye=Se.height-vc;if(!Number.isFinite(Se.top)||!Number.isFinite(Se.height)||Ye<=0)return;const tt=(B-Se.top-vc/2)/Ye*100;if(!Number.isFinite(tt))return;const nn=Math.max(pb,Math.min($h,Math.round(tt)));St(nn)}function H(B){B.preventDefault(),xn(B.clientY),Ht(!0)}const Z=(c==null?void 0:c.changes)??[],ie=Z.filter(B=>If(B,"staged")),we=Z.filter(B=>If(B,"unstaged")),Te=jb(ie,"staged"),Ae=jb(we,"unstaged"),$e=new Set(D),Ie=new Set(ne),Ue=Nb(ne,Z,"staged"),Fe=Nb(ne,Z,"unstaged"),Oe=Z.length===0&&((c==null?void 0:c.snapshot.ahead)??0)>0,ct=ie.length>0&&M.trim().length>0,rt=(C==null?void 0:C.currentBranch)??(c==null?void 0:c.snapshot.branch)??h("common.unknown"),Ut=Number.isFinite(Ot)?Ot:qh,Pt=K?`minmax(120px, ${Ut}fr) ${vc}px minmax(140px, ${100-Ut}fr)`:`minmax(120px, 1fr) ${vc}px auto`;v.useEffect(()=>{ye==="staged"&&Ue.length===0&&E(null),ye==="unstaged"&&Fe.length===0&&E(null)},[ye,Ue.length,Fe.length]),v.useEffect(()=>{if(!te)return;const B=we.length>0?"unstaged":ie.length>0?"staged":"history";re(le=>le==="unstaged"&&we.length>0||le==="staged"&&ie.length>0?le:B)},[te,ie.length,we.length]),v.useEffect(()=>{T&&(d.some(B=>B.commitHash===T)||ae(null))},[d,T]),v.useEffect(()=>{te&&W!=="history"&&$&&ee(!1)},[te,$,W]);async function We(B,le){var Se;try{if(typeof navigator>"u"||!((Se=navigator.clipboard)!=null&&Se.writeText))throw new Error("clipboard unavailable");await navigator.clipboard.writeText(B),Pe({title:le,tone:"success"})}catch{Pe({title:h("common.copyContentFailed"),tone:"error"})}}async function se(B,le){typeof window<"u"&&!window.confirm(h("git.discardConfirm",{path:le}))||await ze(B)}function Ce(){return i.jsxs("div",{className:"git-operations-menu",children:[i.jsxs("div",{className:"git-menu-section",children:[i.jsx("span",{className:"git-menu-caption",children:h("git.currentBranch")}),i.jsx("strong",{className:"git-menu-branch",children:rt})]}),i.jsxs("div",{className:"git-menu-section",children:[i.jsx("span",{className:"git-menu-caption",children:h("git.branchTitle")}),i.jsx("div",{className:"git-menu-branch-list",children:C==null?void 0:C.local.map(B=>i.jsx("button",{className:"git-menu-item",type:"button",disabled:I||B.current,onClick:()=>void Qe(B.name),children:i.jsx("span",{children:B.current?`${h("git.switchBranch")} ${B.name}`:`${h("git.switchBranchTo")} ${B.name}`})},B.name))})]}),i.jsxs("div",{className:"git-menu-section",children:[i.jsx("button",{className:"git-menu-item",type:"button",disabled:I,onClick:()=>void Vt("fetch"),children:i.jsx("span",{children:h("git.fetch")})}),i.jsx("button",{className:"git-menu-item",type:"button",disabled:I,onClick:()=>void Vt("pull"),children:i.jsx("span",{children:h("git.pull")})}),i.jsx("button",{className:"git-menu-item",type:"button",disabled:I,onClick:()=>void Vt("push"),children:i.jsx("span",{children:h("git.push")})}),i.jsx("button",{className:"git-menu-item",type:"button",disabled:I,onClick:()=>void ke(),children:i.jsx("span",{children:h("git.undoLastCommit")})}),i.jsx("button",{className:"git-menu-item",type:"button",disabled:I||q,onClick:()=>void ht({resetTreeScroll:!0}),children:i.jsx("span",{children:h("git.refresh")})})]})]})}return i.jsxs("section",{className:["conversation-panel","surface-card","git-sidebar",e].filter(Boolean).join(" "),"data-testid":"git-sidebar",children:[i.jsxs("section",{className:"git-card git-scaffold-section",children:[i.jsxs("div",{className:"git-editor-row",children:[i.jsx("textarea",{ref:Be,rows:1,value:M,onChange:B=>O(n0(B.target.value)),onKeyDown:B=>{B.key==="Enter"&&B.preventDefault()},placeholder:h("git.commitSubjectPlaceholder")}),i.jsx("button",{className:"git-icon-button",type:"button","aria-label":h("git.generateDraft"),title:h("git.generateDraft"),onClick:()=>void V(),disabled:I||q,children:i.jsx(n4,{})})]}),i.jsxs("div",{className:"git-primary-actions",children:[i.jsx("button",{className:"secondary-button",type:"button",onClick:()=>void ht({resetTreeScroll:!0}),disabled:I||q||!t,children:h("git.refreshNow")}),i.jsx("button",{className:"primary-button git-primary-submit",type:"button",onClick:()=>{if(Oe){Bt();return}wt()},disabled:I||!Oe&&!ct,children:h(Oe?"git.pushNow":"git.commitNow")})]})]}),te?i.jsxs("div",{className:"git-mobile-sections",children:[i.jsx(Gh,{title:h("git.stagedChangesTitle"),count:ie.length,expanded:W==="staged",onToggle:()=>re("staged"),children:i.jsx(kb,{title:h("git.stagedChangesTitle"),nodes:Te,collapsedTreePathSet:$e,onToggleTreePath:cn,onToggleMobileSelection:wn,selectedMobilePathSet:Ie,selectedTargets:Ue,actioning:I,variant:"staged",swipeRowState:Ve,onSwipeRowChange:Tt,onStageToggle:Me,onDiscardWithConfirm:se,onClearSelectedTargets:()=>z(B=>B.filter(le=>!Ue.includes(le))),onPreviewFile:on})}),i.jsx(Gh,{title:h("git.changesTitle"),count:we.length,expanded:W==="unstaged",onToggle:()=>re("unstaged"),children:i.jsx(kb,{title:h("git.changesTitle"),nodes:Ae,collapsedTreePathSet:$e,onToggleTreePath:cn,onToggleMobileSelection:wn,selectedMobilePathSet:Ie,selectedTargets:Fe,actioning:I,variant:"unstaged",swipeRowState:Ve,onSwipeRowChange:Tt,onStageToggle:Me,onDiscardWithConfirm:se,onClearSelectedTargets:()=>z(B=>B.filter(le=>!Fe.includes(le))),onPreviewFile:on})}),i.jsxs(Gh,{title:h("git.recentVersionsTitle"),count:p,expanded:W==="history",onToggle:()=>re("history"),trailingContent:i.jsx("span",{className:"badge",children:rt}),headerAction:i.jsx("button",{className:"git-icon-button git-mobile-section-action",type:"button","aria-label":h("git.operationMenu"),title:h("git.operationMenu"),"aria-expanded":$,onClick:()=>{re("history"),ee(B=>!B)},disabled:I,children:i.jsx(Zc,{})}),children:[$?i.jsx("div",{className:"git-mobile-operations-shell",children:Ce()}):null,i.jsx(XU,{history:d,historyLoadingMore:k,hasMore:!!g,actioning:I,openCommitHash:T,onToggleMenu:B=>ae(le=>le===B?null:B),onCopyCommitHash:B=>void We(B,h("git.copyCommitHashSuccess")),onCopyCommitSubject:B=>void We(B,h("git.copyCommitSubjectSuccess")),onUndoLastCommit:()=>void ke(),onLoadMore:()=>void Nt()})]})]}):i.jsxs("div",{ref:ue,className:"git-content-split",style:{gridTemplateRows:Pt},children:[i.jsx("section",{className:"git-card git-tree-panel",children:i.jsxs("div",{ref:ge,className:"git-tree-panel-body",children:[ie.length>0?i.jsx(xb,{title:h("git.stagedChangesTitle"),count:ie.length,nodes:Te,selectedPath:A,collapsedTreePathSet:$e,onToggleTreePath:cn,onSelectFile:L,onPreviewFile:(B,le)=>{un(B)&&on(B,le)},onToggleMobileSelection:wn,onStageToggle:Me,onDiscard:ze,actioning:I,variant:"staged",isMobileViewport:te,selectedMobilePathSet:Ie,selectedTargets:Ue,mobileActionMenuOpen:ye==="staged",onToggleMobileActionMenu:()=>E(B=>B==="staged"?null:"staged"),onClearSelectedTargets:()=>z(B=>B.filter(le=>!Ue.includes(le)))}):null,i.jsx(xb,{title:h("git.changesTitle"),count:we.length,nodes:Ae,selectedPath:A,collapsedTreePathSet:$e,onToggleTreePath:cn,onSelectFile:L,onPreviewFile:(B,le)=>{un(B)&&on(B,le)},onToggleMobileSelection:wn,onStageToggle:Me,onDiscard:ze,actioning:I,variant:"unstaged",isMobileViewport:te,selectedMobilePathSet:Ie,selectedTargets:Fe,mobileActionMenuOpen:ye==="unstaged",onToggleMobileActionMenu:()=>E(B=>B==="unstaged"?null:"unstaged"),onClearSelectedTargets:()=>z(B=>B.filter(le=>!Fe.includes(le)))})]})}),i.jsx("button",{className:"git-panel-divider",type:"button",role:"separator","aria-label":h("git.resizePanels"),"aria-orientation":"horizontal","aria-valuemin":pb,"aria-valuemax":$h,"aria-valuenow":K?Ut:$h,"data-dragging":Mt,onPointerDown:H,children:i.jsx("span",{className:"git-panel-divider-handle","aria-hidden":"true"})}),i.jsxs("section",{className:"git-card git-history-section",children:[i.jsxs("div",{className:"git-history-topbar",children:[i.jsxs("button",{className:"git-section-toggle",type:"button","aria-expanded":K,"aria-label":h(K?"git.collapseRecentVersions":"git.expandRecentVersions"),onClick:()=>X(B=>!B),children:[i.jsxs("span",{className:"git-section-toggle-main",children:[i.jsx(fu,{expanded:K}),i.jsx("span",{children:h("git.recentVersionsTitle")})]}),i.jsx("span",{className:"workbench-section-counter",children:p})]}),i.jsxs("div",{className:"git-history-actions",children:[i.jsx("span",{className:"badge",children:rt}),i.jsx("button",{className:"git-icon-button",type:"button","aria-label":h("git.operationMenu"),title:h("git.operationMenu"),onClick:()=>ee(B=>!B),disabled:I,children:i.jsx(Zc,{})}),$?Ce():null]})]}),K?i.jsx("div",{className:"git-history-list",onScroll:jt,children:d.length?i.jsxs(i.Fragment,{children:[d.map(B=>i.jsxs("article",{className:"git-history-entry","data-kind":B.commitKind,children:[i.jsx("span",{className:"git-history-marker","data-kind":B.commitKind,"aria-hidden":"true"}),i.jsxs("div",{className:"git-history-body",children:[i.jsxs("div",{className:"git-history-title-row",children:[i.jsx("strong",{title:B.subject,children:B.subject}),i.jsx("span",{className:"git-history-kind-badge","data-kind":B.commitKind,children:r0(B.commitKind)})]}),B.refs.length>0?i.jsx("div",{className:"git-history-ref-list",children:B.refs.map(le=>i.jsx("span",{className:"git-history-ref-pill","data-kind":le.kind,"data-remote-index":String(i0(le.remoteName)),children:le.name},`${B.commitHash}:${le.kind}:${le.name}`))}):null,i.jsxs("div",{className:"git-history-meta",children:[i.jsx("span",{className:"git-history-hash",children:B.commitHash.slice(0,8)}),i.jsx("span",{children:B.authorName}),i.jsx("time",{dateTime:B.authoredAt,children:s0(B.authoredAt)})]})]})]},B.commitHash)),k?i.jsxs("p",{className:"git-history-loading",children:[h("git.refreshNow"),"..."]}):null]}):i.jsx("p",{className:"status-text",children:h("git.noHistory")})}):null]})]}),i.jsxs(Cr,{open:Le,title:h("git.selectRemoteTitle"),description:h("git.selectRemoteDesc"),onClose:()=>{I||je(!1)},children:[i.jsx("div",{className:"git-remote-select-list",children:He.map(B=>{const le=bt.has(B.name),Se=lt.get(B.name);return i.jsxs("label",{className:"git-remote-item",children:[i.jsx("input",{type:"checkbox",checked:le,disabled:I,onChange:()=>{Ct(Ye=>{const tt=new Set(Ye);return tt.has(B.name)?tt.delete(B.name):tt.add(B.name),tt})}}),i.jsxs("span",{className:"git-remote-item-body",children:[i.jsx("span",{className:"git-remote-name",children:B.name}),i.jsx("span",{className:"git-remote-url",children:B.pushUrl}),Se&&i.jsx("span",{className:`git-remote-result ${Se.ok?"ok":"err"}`,children:Se.summary})]})]},B.name)})}),i.jsxs("div",{className:"git-remote-actions",children:[i.jsx("button",{className:"secondary-button",type:"button",disabled:I,onClick:()=>je(!1),children:h("common.close")}),i.jsx("button",{className:"primary-button",type:"button",disabled:I||bt.size===0,onClick:()=>void Zt(Array.from(bt)),children:I?h("git.pushing"):h("git.pushSelected",{count:String(bt.size)})})]})]}),i.jsx(FC,{workspaceId:t,filePath:At,open:At!==null,onClose:()=>{vt(null),Dt(null)},onSaved:async()=>{await ht({resetTreeScroll:!0})},diffContent:$t})]})}function xb({title:e,count:t,nodes:n,selectedPath:s,collapsedTreePathSet:a,onToggleTreePath:c,onSelectFile:l,onPreviewFile:d,onToggleMobileSelection:f,onStageToggle:p,onDiscard:y,actioning:g,variant:b,isMobileViewport:k,selectedMobilePathSet:S,selectedTargets:C,mobileActionMenuOpen:j,onToggleMobileActionMenu:A,onClearSelectedTargets:L}){const M=Hm(n),O=h(b==="staged"?"git.unstageAll":"git.stageAll");return i.jsxs("section",{className:"git-tree-group","data-variant":b,children:[i.jsxs("div",{className:"git-section-header git-tree-group-header",children:[i.jsx("h3",{children:e}),i.jsxs("div",{className:"git-tree-group-actions",children:[i.jsx("span",{className:"workbench-section-counter",children:t}),!k&&M.length>0?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"git-icon-button",type:"button","aria-label":O,title:O,onClick:()=>void p(M,b==="staged"),disabled:g,children:i.jsx(Df,{staged:b==="staged"})}),b==="unstaged"?i.jsx("button",{className:"git-icon-button danger",type:"button","aria-label":h("git.discardAll"),title:h("git.discardAll"),onClick:()=>void y(M),disabled:g,children:i.jsx(_f,{})}):null]}):null,k&&C.length>0?i.jsx("button",{className:"git-icon-button",type:"button","aria-label":h("git.operationMenu"),title:h("git.operationMenu"),onClick:A,disabled:g,children:i.jsx(Zc,{})}):null]}),k&&j?i.jsxs("div",{className:"git-selection-menu",children:[i.jsxs("div",{className:"git-menu-section",children:[i.jsx("span",{className:"git-menu-caption",children:h("git.selectedFiles")}),i.jsx("strong",{className:"git-menu-branch",children:C.length})]}),i.jsxs("div",{className:"git-menu-section",children:[i.jsx("button",{className:"git-menu-item",type:"button",disabled:g,onClick:()=>void p(C,b==="staged"),children:i.jsx("span",{children:h(b==="staged"?"git.unstage":"git.stage")})}),b==="unstaged"?i.jsx("button",{className:"git-menu-item",type:"button",disabled:g,onClick:()=>void y(C),children:i.jsx("span",{children:h("git.discard")})}):null,i.jsx("button",{className:"git-menu-item",type:"button",disabled:g,onClick:L,children:i.jsx("span",{children:h("git.clearSelection")})})]})]}):null]}),i.jsx("div",{className:"git-tree-shell",role:"tree","aria-label":e,children:n.length?ZC({nodes:n,depth:0,collapsedTreePathSet:a,selectedPath:s,onToggleTreePath:c,onSelectFile:l,onPreviewFile:d,onToggleMobileSelection:f,onStageToggle:p,onDiscard:y,actioning:g,variant:b,isMobileViewport:k,selectedMobilePathSet:S}):i.jsx("p",{className:"git-tree-status",children:h("git.noChanges")})})]})}function Gh({title:e,count:t,expanded:n,onToggle:s,trailingContent:a,headerAction:c,children:l}){return i.jsxs("section",{className:"git-mobile-section","data-expanded":n,children:[i.jsxs("div",{className:"git-mobile-section-header",children:[i.jsxs("button",{className:"git-mobile-section-toggle",type:"button","aria-expanded":n,onClick:s,children:[i.jsxs("span",{className:"git-mobile-section-toggle-main",children:[i.jsx(fu,{expanded:n}),i.jsx("h3",{children:e})]}),i.jsxs("span",{className:"git-mobile-section-toggle-meta",children:[a,i.jsx("span",{className:"workbench-section-counter",children:t})]})]}),c?i.jsx("div",{className:"git-mobile-section-header-action",children:c}):null]}),n?i.jsx("div",{className:"git-mobile-section-body",children:l}):null]})}function kb({title:e,nodes:t,collapsedTreePathSet:n,onToggleTreePath:s,onToggleMobileSelection:a,selectedMobilePathSet:c,selectedTargets:l,actioning:d,variant:f,swipeRowState:p,onSwipeRowChange:y,onStageToggle:g,onDiscardWithConfirm:b,onClearSelectedTargets:k,onPreviewFile:S}){return i.jsxs("div",{className:"git-mobile-record-shell",children:[l.length>0?i.jsxs("div",{className:"git-mobile-selection-toolbar",children:[i.jsxs("span",{className:"git-mobile-selection-count",children:[h("git.selectedFiles")," ",l.length]}),i.jsxs("div",{className:"git-mobile-selection-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",disabled:d,onClick:()=>void g(l,f==="staged"),children:h(f==="staged"?"git.unstage":"git.stage")}),f==="unstaged"?i.jsx("button",{type:"button",className:"secondary-button workbench-danger-button",disabled:d,onClick:()=>void b(l,`${l.length}`),children:h("git.discard")}):null,i.jsx("button",{type:"button",className:"secondary-button",disabled:d,onClick:k,children:h("git.clearSelection")})]})]}):null,i.jsx("div",{className:"git-mobile-record-list",role:"tree","aria-label":e,children:t.length?JC({nodes:t,depth:0,collapsedTreePathSet:n,onToggleTreePath:s,onToggleMobileSelection:a,selectedMobilePathSet:c,actioning:d,variant:f,swipeRowState:p,onSwipeRowChange:y,onStageToggle:g,onDiscardWithConfirm:b,onPreviewFile:S}):i.jsx("p",{className:"git-tree-status",children:h("git.noChanges")})})]})}function JC({nodes:e,depth:t,collapsedTreePathSet:n,onToggleTreePath:s,onToggleMobileSelection:a,selectedMobilePathSet:c,actioning:l,variant:d,swipeRowState:f,onSwipeRowChange:p,onStageToggle:y,onDiscardWithConfirm:g,onPreviewFile:b}){return e.map(k=>{if(k.kind==="directory"){const j=!n.has(k.path),A=Hm(k.children),L=`directory:${k.path}`;return i.jsxs("div",{className:"git-mobile-record-branch",children:[i.jsx(Sb,{rowKey:L,openState:(f==null?void 0:f.path)===L?f.direction:null,onOpenStateChange:M=>p(M?{path:L,direction:M}:null),trailingActions:A.length>0?[{label:h(d==="staged"?"git.unstage":"git.stage"),tone:"accent",onPress:()=>void y(A,d==="staged")},...d==="unstaged"?[{label:h("git.discard"),tone:"danger",onPress:()=>void g(A,k.path)}]:[]]:null,children:i.jsxs("button",{className:"git-mobile-record git-mobile-record-directory",type:"button",style:{paddingInlineStart:`${wb+t*bb}px`},onClick:()=>s(k.path),children:[i.jsxs("span",{className:"git-mobile-record-leading",children:[i.jsx("span",{className:"git-tree-chevron","data-expanded":j,children:i.jsx(fu,{expanded:j})}),i.jsx("span",{className:"git-mobile-record-title",children:k.name})]}),i.jsx("span",{className:"git-mobile-record-meta",children:A.length})]})}),j?i.jsx("div",{className:"git-mobile-record-children",role:"group",children:JC({nodes:k.children,depth:t+1,collapsedTreePathSet:n,onToggleTreePath:s,onToggleMobileSelection:a,selectedMobilePathSet:c,actioning:l,variant:d,swipeRowState:f,onSwipeRowChange:p,onStageToggle:y,onDiscardWithConfirm:g,onPreviewFile:b})}):null]},L)}const S=`file:${k.path}`,C=c.has(k.path);return i.jsx(Sb,{rowKey:S,openState:(f==null?void 0:f.path)===S?f.direction:null,onOpenStateChange:j=>p(j?{path:S,direction:j}:null),trailingActions:[{label:h("git.preview"),tone:"neutral",onPress:()=>b(k.change.path,k.change)},{label:h(d==="staged"?"git.unstage":"git.stage"),tone:"accent",onPress:()=>void y([k.change.path],d==="staged")},...d==="unstaged"?[{label:h("git.discard"),tone:"danger",onPress:()=>void g([k.change.path],k.path)}]:[]],children:i.jsxs("div",{className:"git-mobile-record git-mobile-record-file","data-active":C,style:{paddingInlineStart:`${wb+t*bb}px`},children:[i.jsx("input",{className:"git-tree-select-checkbox",type:"checkbox",checked:C,"aria-label":`${h("git.selectFile")} ${k.name}`,onChange:()=>a(k.change.path)}),i.jsxs("button",{className:"git-mobile-record-file-main",type:"button",onClick:()=>a(k.change.path),children:[i.jsx("span",{className:"git-tree-file-icon","data-kind":Cs(k.name),"aria-hidden":"true",children:Ss(k.name)}),i.jsxs("span",{className:"git-mobile-record-copy",children:[i.jsx("span",{className:"git-mobile-record-title",children:k.name}),i.jsx("span",{className:"git-mobile-record-path",children:k.path})]}),i.jsx("span",{className:"git-status-badge","data-status":k.status,children:k.status})]})]})},S)})}function Sb({rowKey:e,openState:t,onOpenStateChange:n,trailingActions:s,children:a}){const c=_r(),l=v.useRef(null),[d,f]=v.useState(0),p=((s==null?void 0:s.length)??0)*Vh;v.useEffect(()=>{t||f(0)},[t,e]);const y=d!==0?d:t==="trailing"?-p:0;function g(C){var j,A;C.button===0&&(l.current={pointerId:C.pointerId,startX:C.clientX},(A=(j=C.currentTarget).setPointerCapture)==null||A.call(j,C.pointerId))}function b(C){const j=l.current;if(!j||j.pointerId!==C.pointerId)return;const A=p>0?p+10:0,L=Math.max(-A,Math.min(0,C.clientX-j.startX));f(L)}function k(C){var A,L;const j=l.current;if(!(!j||j.pointerId!==C.pointerId)){if((L=(A=C.currentTarget).releasePointerCapture)==null||L.call(A,C.pointerId),l.current=null,d<=-44&&(s!=null&&s.length)){c.trigger("gesture"),n("trailing"),f(0);return}n(null),f(0)}}function S(C){var A,L;const j=l.current;!j||j.pointerId!==C.pointerId||((L=(A=C.currentTarget).releasePointerCapture)==null||L.call(A,C.pointerId),l.current=null,f(0))}return i.jsxs("div",{className:"git-mobile-swipe-row","data-open-state":t??"closed","data-dragging":d!==0,children:[s==null?void 0:s.map((C,j)=>i.jsx("button",{type:"button",className:"git-mobile-swipe-action trailing","data-tone":C.tone,style:{right:j*Vh,width:Vh},onClick:()=>{c.trigger(C.tone==="danger"?"warning":"action"),n(null),C.onPress()},children:C.label},`trailing-${j}`)),i.jsx("div",{className:"git-mobile-swipe-content",style:{transform:`translateX(${y}px)`},onPointerDown:g,onPointerMove:b,onPointerUp:k,onPointerCancel:S,children:a})]})}function XU({history:e,historyLoadingMore:t,hasMore:n,actioning:s,openCommitHash:a,onToggleMenu:c,onCopyCommitHash:l,onCopyCommitSubject:d,onUndoLastCommit:f,onLoadMore:p}){return e.length?i.jsxs("div",{className:"git-mobile-history-list",children:[e.map((y,g)=>{const b=a===y.commitHash,k=g===0&&y.commitKind==="local";return i.jsxs("article",{className:"git-mobile-history-entry","data-kind":y.commitKind,children:[i.jsxs("div",{className:"git-mobile-history-entry-main",children:[i.jsx("span",{className:"git-history-marker","data-kind":y.commitKind,"aria-hidden":"true"}),i.jsxs("div",{className:"git-mobile-history-copy",children:[i.jsxs("div",{className:"git-history-title-row",children:[i.jsx("strong",{title:y.subject,children:y.subject}),i.jsx("span",{className:"git-history-kind-badge","data-kind":y.commitKind,children:r0(y.commitKind)})]}),y.refs.length>0?i.jsx("div",{className:"git-history-ref-list",children:y.refs.map(S=>i.jsx("span",{className:"git-history-ref-pill","data-kind":S.kind,"data-remote-index":String(i0(S.remoteName)),children:S.name},`${y.commitHash}:${S.kind}:${S.name}`))}):null,i.jsxs("div",{className:"git-history-meta",children:[i.jsx("span",{className:"git-history-hash",children:y.commitHash.slice(0,8)}),i.jsx("span",{children:y.authorName}),i.jsx("time",{dateTime:y.authoredAt,children:s0(y.authoredAt)})]})]}),i.jsx("button",{type:"button",className:"git-icon-button","aria-label":h("git.historyItemMenu"),onClick:()=>c(y.commitHash),children:i.jsx(Zc,{})})]}),b?i.jsxs("div",{className:"git-mobile-history-menu",children:[i.jsx("button",{type:"button",className:"git-menu-item",onClick:()=>l(y.commitHash),children:i.jsx("span",{children:h("git.copyCommitHash")})}),i.jsx("button",{type:"button",className:"git-menu-item",onClick:()=>d(y.subject),children:i.jsx("span",{children:h("git.copyCommitSubject")})}),k?i.jsx("button",{type:"button",className:"git-menu-item",disabled:s,onClick:f,children:i.jsx("span",{children:h("git.undoLastCommit")})}):null]}):null]},y.commitHash)}),n?i.jsx("button",{type:"button",className:"secondary-button git-mobile-history-more",disabled:t,onClick:p,children:t?`${h("git.refreshNow")}...`:h("common.loadMore")}):null]}):i.jsx("p",{className:"git-tree-status",children:h("git.noHistory")})}function ZC({nodes:e,depth:t,collapsedTreePathSet:n,selectedPath:s,onToggleTreePath:a,onSelectFile:c,onPreviewFile:l,onToggleMobileSelection:d,onStageToggle:f,onDiscard:p,actioning:y,variant:g,isMobileViewport:b,selectedMobilePathSet:k}){return e.map(S=>{if(S.kind==="directory"){const A=!n.has(S.path),L=Hm(S.children),M=`${h(g==="staged"?"git.unstage":"git.stage")} ${S.path}`,O=`${h("git.discard")} ${S.path}`;return i.jsxs("div",{className:"git-tree-node",children:[i.jsxs("div",{className:"git-tree-row",role:"treeitem","aria-expanded":A,children:[i.jsxs("button",{className:"git-tree-trigger",type:"button",style:{paddingInlineStart:`${6+t*8}px`},onClick:()=>a(S.path),children:[i.jsx("span",{className:"git-tree-chevron","data-expanded":A,children:i.jsx(fu,{expanded:A})}),i.jsx("span",{className:"git-tree-label git-tree-label-directory",children:S.name})]}),!b&&L.length>0?i.jsxs("div",{className:"git-row-actions",children:[i.jsx("button",{className:"git-icon-button",type:"button","aria-label":M,title:M,onClick:()=>void f(L,g==="staged"),disabled:y,children:i.jsx(Df,{staged:g==="staged"})}),g==="unstaged"?i.jsx("button",{className:"git-icon-button danger",type:"button","aria-label":O,title:O,onClick:()=>void p(L),disabled:y,children:i.jsx(_f,{})}):null]}):null]}),A?i.jsx("div",{className:"git-tree-children",role:"group",children:ZC({nodes:S.children,depth:t+1,collapsedTreePathSet:n,selectedPath:s,onToggleTreePath:a,onSelectFile:c,onPreviewFile:l,onToggleMobileSelection:d,onStageToggle:f,onDiscard:p,actioning:y,variant:g,isMobileViewport:b,selectedMobilePathSet:k})}):null]},`directory:${S.path}`)}const C=k.has(S.path),j=b?C:s===S.path;return b?i.jsxs("div",{className:"git-tree-row",role:"treeitem","data-active":j,"data-mobile":"true",children:[i.jsx("input",{className:"git-tree-select-checkbox",type:"checkbox",checked:C,"aria-label":`${h("git.selectFile")} ${S.name}`,onChange:()=>d(S.change.path)}),i.jsxs("button",{className:"git-tree-file-button",type:"button","data-active":j,"data-mobile":"true",style:{paddingInlineStart:`${18+t*8}px`},onClick:()=>d(S.change.path),children:[i.jsx("span",{className:"git-tree-file-icon","data-kind":Cs(S.name),"aria-hidden":"true",children:Ss(S.name)}),i.jsx("span",{className:"git-tree-label-wrap",children:i.jsx("span",{className:"git-tree-label",children:S.name})}),i.jsx("span",{className:"git-tree-file-meta",children:i.jsx("span",{className:"git-status-badge","data-status":S.status,children:S.status})})]})]},`file:${S.path}`):i.jsxs("div",{className:"git-tree-row",role:"treeitem","data-active":j,children:[i.jsxs("button",{className:"git-tree-file-button",type:"button","data-active":j,style:{paddingInlineStart:`${18+t*8}px`},onClick:()=>{c(S.change.path),l&&l(S.change.path,S.change)},children:[i.jsx("span",{className:"git-tree-file-icon","data-kind":Cs(S.name),"aria-hidden":"true",children:Ss(S.name)}),i.jsx("span",{className:"git-tree-label-wrap",children:i.jsx("span",{className:"git-tree-label",children:S.name})}),i.jsx("span",{className:"git-tree-file-meta",children:i.jsx("span",{className:"git-status-badge","data-status":S.status,children:S.status})})]}),i.jsxs("div",{className:"git-row-actions",children:[i.jsx("button",{className:"git-icon-button",type:"button","aria-label":S.variant==="staged"?h("git.unstage"):h("git.stage"),title:S.variant==="staged"?h("git.unstage"):h("git.stage"),onClick:()=>void f([S.change.path],S.variant==="staged"),disabled:y,children:i.jsx(Df,{staged:S.variant==="staged"})}),g==="unstaged"?i.jsx("button",{className:"git-icon-button danger",type:"button","aria-label":h("git.discard"),title:h("git.discard"),onClick:()=>void p([S.change.path]),disabled:y,children:i.jsx(_f,{})}):null]})]},`file:${S.path}`)})}function Cb(e,t){return{kind:"directory",name:e,path:t,children:new Map}}function jb(e,t){const n=Cb("","");for(const s of e){const a=s.path.replace(/\\/g,"/"),c=a.split("/").filter(Boolean);let l=n;c.forEach((d,f)=>{const p=c.slice(0,f+1).join("/");if(f===c.length-1){l.children.set(`file:${p}`,{kind:"file",name:d,path:a,change:s,status:JU(s,t),variant:t});return}const y=`directory:${p}`,g=l.children.get(y);if(g&&g.kind==="directory"){l=g;return}const b=Cb(d,p);l.children.set(y,b),l=b})}return t0(e0([...n.children.values()]))}function e0(e){return[...e].sort((t,n)=>t.kind!==n.kind?t.kind==="directory"?-1:1:t.name.localeCompare(n.name,"zh-CN")).map(t=>t.kind==="directory"?{kind:"directory",name:t.name,path:t.path,children:e0([...t.children.values()])}:t)}function t0(e){return e.map(t=>{var l;if(t.kind!=="directory")return t;const n=t0(t.children);let s=t.name,a=t.path,c=n;for(;c.length===1&&((l=c[0])==null?void 0:l.kind)==="directory";){const d=c[0];s=`${s}/${d.name}`,a=d.path,c=d.children}return{kind:"directory",name:s,path:a,children:c}})}function Nb(e,t,n){const s=new Set(e);return t.filter(a=>If(a,n)&&s.has(a.path)).map(a=>a.path)}function Hm(e){const t=[],n=new Set;function s(a){if(a.kind==="file"){n.has(a.path)||(n.add(a.path),t.push(a.path));return}a.children.forEach(s)}return e.forEach(s),t}function If(e,t){return t==="staged"?!!e.stagedStatus:!!e.worktreeStatus}function JU(e,t){return t==="staged"?e.stagedStatus??e.status:e.worktreeStatus??e.status}function ZU(e){return{subject:n0(e).trim(),body:null,footer:null,source:"manual"}}function n0(e){return e.replace(/[\r\n]+/g," ")}function e4(e){if(!e)return;e.style.height="0px";const t=Math.min(Math.max(e.scrollHeight,34),120);e.style.height=`${t}px`,e.style.overflowY=e.scrollHeight>120?"auto":"hidden"}function r0(e){switch(e){case"local":return h("git.historyKindLocal");case"remote":return h("git.historyKindRemote");default:return h("git.historyKindShared")}}function i0(e){if(!e)return 0;let t=0;for(const n of e)t=t*33+n.charCodeAt(0)>>>0;return t%6}function Vr(e,t){return e instanceof Jn?t4(e)??e.message:typeof e=="object"&&e&&"message"in e?e.message:t}function Kh(e){return`git-sidebar.snapshot.${e}`}function t4(e){switch(e.errorCode){case"UNAUTHORIZED":return h("git.errors.unauthorized");case"WORKSPACE_NOT_FOUND":return h("git.errors.workspaceNotFound");case"INVALID_WORKSPACE":return h("git.errors.invalidWorkspace");case"NOT_GIT_REPOSITORY":return h("git.errors.notGitRepository");case"GIT_REPO_NOT_FOUND":return h("git.errors.repoNotFound");case"PATH_OUT_OF_WORKSPACE":return h("git.errors.pathOutOfWorkspace");case"INVALID_TARGET":return h("git.errors.invalidTarget");case"NOT_STAGED":return h("git.errors.notStaged");case"EMPTY_STAGED_CHANGES":return h("git.errors.emptyStagedChanges");case"BRANCH_CONFLICT":return h("git.errors.branchConflict");case"BRANCH_NOT_FOUND":return h("git.errors.branchNotFound");case"REMOTE_NOT_FOUND":return h("git.errors.remoteNotFound");case"GIT_REMOTE_AUTH_FAILED":return h("git.errors.remoteAuthFailed");case"GIT_PUSH_FAILED":return h("git.errors.pushFailed");case"GIT_PULL_FAILED":return h("git.errors.pullFailed");case"GIT_REMOTE_FAILED":return h("git.errors.remoteFailed");case"GIT_COMMAND_TIMEOUT":return h("git.errors.commandTimeout");case"GIT_DISCARD_FAILED":return h("git.discardFailed");case"GIT_UNDO_FAILED":return h("git.undoLastCommitFailed");default:return null}}function fu({expanded:e}){return i.jsx("svg",{className:"git-chevron-icon",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:e?"rotate(0deg)":"rotate(-90deg)"},"aria-hidden":"true",children:i.jsx("polyline",{points:"6 9 12 15 18 9"})})}function Df({staged:e}){return e?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:i.jsx("path",{d:"M5 12h14"})}):i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[i.jsx("path",{d:"M12 5v14"}),i.jsx("path",{d:"M5 12h14"})]})}function _f(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[i.jsx("path",{d:"M10 7L6 11l4 4",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M7 11h7c3.87 0 7 3.13 7 7 0 1.9-.76 3.63-2 4.89",strokeLinecap:"round",strokeLinejoin:"round"})]})}function n4(){return i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:i.jsx("path",{d:"M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9L12 3z"})})}function Zc(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"5",cy:"12",r:"1.8"}),i.jsx("circle",{cx:"12",cy:"12",r:"1.8"}),i.jsx("circle",{cx:"19",cy:"12",r:"1.8"})]})}function s0(e){try{return new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return e}}const r4=Object.freeze(Object.defineProperty({__proto__:null,GitSidebar:XC},Symbol.toStringTag,{value:"Module"})),o0="mobile.tools.last-primary-tool",Lc=["files","git"],i4=56,s4=1.2;function Pb(e,t){return e==="git"?"git":e==="files"?"files":t}function o4(e,t,n){if(!t)return e;const s=n.x-t.x,a=n.y-t.y;if(Math.abs(s)<i4||Math.abs(s)<Math.abs(a)*s4)return e;const c=Lc.indexOf(e),l=s<0?Math.min(Lc.length-1,c+1):Math.max(0,c-1);return Lc[l]??e}function a4(){if(typeof window>"u")return"files";try{return window.localStorage.getItem(o0)==="git"?"git":"files"}catch{return"files"}}function l4(){var M,O;const e=Xr(),t=Wn(),n=_r(),{navigationGroups:s,currentWorkspaceId:a,currentSessionId:c,selectWorkspace:l}=tr(),d=((M=s.find(q=>q.workspace.id===a))==null?void 0:M.workspace)??((O=s[0])==null?void 0:O.workspace)??null,f=new URLSearchParams(e.search).get("tab"),p=v.useRef(a4()),y=Pb(f,p.current),[g,b]=v.useState(()=>{const q=Pb(f,p.current);return{files:q==="files",git:q==="git"}}),k=v.useRef(null),S=v.useMemo(()=>[{key:"files",title:h("shell.filesEntry"),render:()=>i.jsx($C,{sessionId:c,workspaceId:a,hideHeading:!0})},{key:"git",title:h("shell.gitEntry"),render:()=>i.jsx(XC,{className:"mobile-tool-native-panel mobile-tool-git-panel",workspaceId:a})}],[c,a]),C=Lc.indexOf(y);v.useEffect(()=>{b(q=>({...q,[y]:!0}))},[y]),v.useEffect(()=>{if(p.current=y,!(typeof window>"u"))try{window.localStorage.setItem(o0,y)}catch{}},[y]),v.useEffect(()=>{if(f===y)return;const q=new URLSearchParams(e.search);q.set("tab",y),t({pathname:e.pathname,search:`?${q.toString()}`},{replace:!0})},[y,e.pathname,e.search,t,f]);function j(q,_="selection"){if(q===y)return;n.trigger(_);const I=new URLSearchParams(e.search);I.set("tab",q),t({pathname:e.pathname,search:`?${I.toString()}`},{replace:!0})}function A(q){if(q.changedTouches.length!==1){k.current=null;return}const _=q.changedTouches[0];k.current={x:_.clientX,y:_.clientY}}function L(q){const _=k.current;if(k.current=null,q.changedTouches.length!==1)return;const I=q.changedTouches[0],F=o4(y,_,{x:I.clientX,y:I.clientY});F!==y&&j(F)}return i.jsx("main",{className:"mobile-feature-page mobile-page-fixed-root mobile-tools-workspace-page",children:d?i.jsxs(i.Fragment,{children:[i.jsx(vo,{currentWorkspace:d,workspaces:s.map(q=>q.workspace),onSelectWorkspace:q=>{l(q),t(po(q,y))},trailing:i.jsx("button",{type:"button",className:"secondary-button mobile-tools-more-button","aria-label":h("shell.toolsMoreAction"),title:h("shell.toolsMoreAction"),onClick:()=>{n.trigger("action"),t(cu(d.id))},children:i.jsx(c4,{})}),content:i.jsx("div",{className:"mobile-tools-switcher","aria-label":h("shell.mobileToolsEntry"),children:i.jsx("div",{className:"mobile-tools-segmented-control",role:"tablist","aria-label":h("shell.mobileToolsEntry"),children:S.map(q=>{const _=q.key===y;return i.jsx("button",{type:"button",role:"tab",className:"mobile-tools-segmented-button","data-active":_,"aria-selected":_,"aria-controls":`mobile-tool-panel-${q.key}`,onClick:()=>j(q.key,"selection"),children:q.title},q.key)})})})}),i.jsx("section",{className:"mobile-tools-stage","data-active-tool":y,"data-testid":"mobile-tools-stage",onTouchStart:A,onTouchEnd:L,onTouchCancel:()=>{k.current=null},children:i.jsx("div",{className:"mobile-tools-stage-viewport",children:i.jsx("div",{className:"mobile-tools-stage-track",style:{transform:`translateX(-${C*100}%)`},children:S.map(q=>i.jsx("article",{id:`mobile-tool-panel-${q.key}`,role:"tabpanel","aria-label":q.title,"aria-hidden":q.key!==y,className:"mobile-tools-stage-panel",children:i.jsx("div",{className:"mobile-tools-stage-panel-shell",children:g[q.key]?q.render():null})},q.key))})})})]}):i.jsx("article",{className:"mobile-feature-empty surface-card",children:i.jsx("p",{children:h("shell.emptyNavigationBody")})})})}function c4(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"12",cy:"5",r:"1.8"}),i.jsx("circle",{cx:"12",cy:"12",r:"1.8"}),i.jsx("circle",{cx:"12",cy:"19",r:"1.8"})]})}function u4(e){return e.isArchived!==!0&&e.isSubagent!==!0}function a0(e){return e.activityState==="running"||e.runningState==="starting"||e.runningState==="running"||e.runningState==="reconnecting"}function d4(e){return e.activityState==="idle"&&a0(e)===!1}function Tb(e){return e==="creating"||e==="running"}function eu(e){return e.lastEventAt??e.lastMessageAt??e.updatedAt??e.createdAt}function h4(e,t){return eu(t).localeCompare(eu(e))}function Eb(e){return h(e==="codex"?"conversation.providerCodex":e==="opencode"?"conversation.providerOpenCode":"shell.providerClaudeCode")}function Rb(e){return e?new Date(e).toLocaleString(void 0,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}):h("common.unknown")}const wc=60*1e3;function f4(){const e=Wn(),{navigationGroups:t,currentWorkspaceId:n,refreshNavigation:s,selectWorkspace:a,startDraftSession:c,subscribeGitSnapshot:l,requestGitRefresh:d,addGitSnapshotListener:f,subscribeTerminalManagerSnapshot:p,requestTerminalManagerRefresh:y,addTerminalManagerSnapshotListener:g}=tr(),[b,k]=v.useState(null),[S,C]=v.useState(!1),[j,A]=v.useState({gitLoading:!1,terminalLoading:!1,branch:null,activeTerminalCount:null,changedFileCount:null,quickLaunchRunning:null}),L=t.find(T=>T.workspace.id===n)??t[0]??null,M=(L==null?void 0:L.workspace)??null,O=[...(L==null?void 0:L.sessions)??[]].filter(u4).sort(h4),q=O.filter(a0),_=O.filter(d4),I=O.filter(T=>T.activityState==="completed_unread"),F=O.filter(T=>T.isFavorite===!0),D=q.slice(0,6),P=F.slice(0,6);v.useEffect(()=>{const T=(M==null?void 0:M.id)??null;if(!T){A({gitLoading:!1,terminalLoading:!1,branch:null,activeTerminalCount:null,changedFileCount:null,quickLaunchRunning:null});return}const ae=Mn(Qh(T),wc);A(Le=>{var je,He;return{...Le,gitLoading:ae===null,branch:((je=ae==null?void 0:ae.status)==null?void 0:je.snapshot.branch)??null,changedFileCount:((He=ae==null?void 0:ae.status)==null?void 0:He.changes.length)??null}})},[M==null?void 0:M.id]),v.useEffect(()=>{const T=(M==null?void 0:M.id)??null;if(T)return f(ae=>{ae.workspaceId===T&&(jr(Qh(T),ae),A(Le=>{var je,He,qe;return{...Le,gitLoading:!1,branch:((je=ae.status)==null?void 0:je.snapshot.branch)??((He=ae.branches)==null?void 0:He.currentBranch)??null,changedFileCount:((qe=ae.status)==null?void 0:qe.changes.length)??null}}))})},[f,M==null?void 0:M.id]),v.useEffect(()=>{const T=(M==null?void 0:M.id)??null;if(!T){A(Le=>({...Le,gitLoading:!1,branch:null,changedFileCount:null}));return}const ae=Mn(Yh(T),wc);A(Le=>({...Le,terminalLoading:ae===null,activeTerminalCount:ae?ae.terminals.filter(je=>Tb(je.status)).length:null,quickLaunchRunning:ae?ae.templateStatuses.some(je=>je.occupied):null}))},[M==null?void 0:M.id]),v.useEffect(()=>{const T=(M==null?void 0:M.id)??null;if(!T){A(ae=>({...ae,terminalLoading:!1,activeTerminalCount:null,quickLaunchRunning:null}));return}return g(ae=>{ae.workspaceId===T&&(jr(Yh(T),{terminals:ae.terminals,templates:ae.templates,templateStatuses:ae.templateStatuses}),A(Le=>({...Le,terminalLoading:!1,activeTerminalCount:ae.terminals.filter(je=>Tb(je.status)).length,quickLaunchRunning:ae.templateStatuses.some(je=>je.occupied)})))})},[g,M==null?void 0:M.id]),v.useEffect(()=>{const T=(M==null?void 0:M.id)??null;if(!T)return;const ae=Mn(Qh(T),wc)!==null;l(T),!ae&&d(T)},[M==null?void 0:M.id,d,l]),v.useEffect(()=>{const T=(M==null?void 0:M.id)??null;if(!T)return;const ae=Mn(Yh(T),wc)!==null;p(T),!ae&&y(T)},[M==null?void 0:M.id,y,p]);async function K(T){await s(),a(T.id),k(null),e(oi(T.id))}async function X(T){await s(),a(T.id),k(null),e(oi(T.id))}function $(){M&&(a(M.id),e(po(M.id,"git")))}function ee(){M&&(a(M.id),e(io(M.id)))}function te(){M&&(a(M.id),e(cu(M.id)))}function pe(){M&&e(Ga(M.id))}function ne(){M&&C(!0)}function z(T,ae){C(!1),c(T,ae)}function ye(){M&&(a(M.id),e(oi(M.id)))}function E(T){a(T)}const W=[{label:h("shell.workspaceHomeMetricActive"),value:q.length,onClick:O.length>0?pe:void 0},{label:h("shell.workspaceHomeMetricUnread"),value:I.length,onClick:O.length>0?pe:void 0},{label:h("shell.workspaceHomeMetricTerminal"),value:j.terminalLoading?"…":j.activeTerminalCount??"—",onClick:M?ee:void 0},{label:h("shell.workspaceHomeMetricChanges"),value:j.gitLoading?"…":j.changedFileCount??"—",onClick:M?$:void 0}],re=[{label:h("shell.workspaceHomeQuickLaunchStatusLabel"),value:j.quickLaunchRunning===null?"…":j.quickLaunchRunning?h("shell.workspaceHomeQuickLaunchRunning"):h("shell.workspaceHomeQuickLaunchStopped"),onClick:M?te:void 0},{label:h("shell.workspaceHomeWaitingInputLabel"),value:_.length,onClick:O.length>0?pe:void 0}];return i.jsxs("main",{className:"mobile-feature-page mobile-page-scroll-root mobile-page-with-top-header mobile-workspace-home-page",children:[M?i.jsxs(i.Fragment,{children:[i.jsx(vo,{currentWorkspace:M,workspaces:t.map(T=>T.workspace),onSelectWorkspace:E,sheetContent:T=>i.jsxs("div",{className:"mobile-workspace-home-group mobile-workspace-home-sheet-group",children:[i.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-sheet-row",onClick:()=>{T(),k("import")},children:[i.jsx("span",{className:"mobile-workspace-home-row-label",children:h("shell.importWorkspaceTitle")}),i.jsx("span",{className:"mobile-workspace-home-row-trailing",children:i.jsx(Wi,{})})]}),i.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-sheet-row",onClick:()=>{T(),k("clone")},children:[i.jsx("span",{className:"mobile-workspace-home-row-label",children:h("shell.cloneWorkspaceTitle")}),i.jsx("span",{className:"mobile-workspace-home-row-trailing",children:i.jsx(Wi,{})})]})]})}),i.jsxs("div",{className:"mobile-page-top-body mobile-workspace-home-body",children:[i.jsx("section",{className:"mobile-workspace-home-section",children:i.jsx("div",{className:"mobile-workspace-home-metrics-card","aria-label":h("shell.workspaceHomeStatusSectionTitle"),children:i.jsx("div",{className:"mobile-workspace-home-toolbar-summary",children:W.map(T=>T.onClick?i.jsxs("button",{type:"button",className:"mobile-workspace-home-toolbar-metric",onClick:T.onClick,children:[i.jsx("strong",{className:"mobile-workspace-home-toolbar-metric-value",children:T.value}),i.jsx("span",{className:"mobile-workspace-home-toolbar-metric-label",children:T.label})]},T.label):i.jsxs("div",{className:"mobile-workspace-home-toolbar-metric",role:"listitem",children:[i.jsx("strong",{className:"mobile-workspace-home-toolbar-metric-value",children:T.value}),i.jsx("span",{className:"mobile-workspace-home-toolbar-metric-label",children:T.label})]},T.label))})})}),i.jsx("section",{className:"mobile-workspace-home-section",children:i.jsxs("div",{className:"mobile-workspace-home-primary-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",onClick:ye,children:h("shell.workspaceDetailTitle")}),i.jsx("button",{type:"button",className:"primary-button",onClick:ne,children:h("shell.createSession")})]})}),i.jsx("section",{className:"mobile-workspace-home-section",children:i.jsx("div",{className:"mobile-workspace-home-group",children:re.map(T=>i.jsxs("button",{type:"button",className:"mobile-workspace-home-row",onClick:T.onClick,children:[i.jsx("span",{className:"mobile-workspace-home-row-label",children:T.label}),i.jsxs("span",{className:"mobile-workspace-home-row-trailing",children:[i.jsx("strong",{children:T.value}),i.jsx(Wi,{})]})]},T.label))})}),i.jsxs("section",{className:"mobile-workspace-home-section",children:[i.jsxs("div",{className:"mobile-workspace-home-section-header",children:[i.jsx("p",{className:"mobile-workspace-home-section-title",children:h("shell.workspaceHomeActiveSessionsSectionTitle")}),M?i.jsx("button",{type:"button",className:"mobile-workspace-home-link-button",onClick:pe,children:h("shell.workspaceHomeViewAllAction")}):null]}),i.jsx("div",{className:"mobile-workspace-home-group",children:D.length===0?i.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-empty-row",onClick:ne,children:[i.jsxs("div",{className:"mobile-workspace-home-session-main",children:[i.jsx("span",{className:"mobile-workspace-home-session-title",children:h("shell.createSession")}),i.jsx("span",{className:"mobile-workspace-home-session-meta",children:M.name})]}),i.jsx("span",{className:"mobile-workspace-home-row-trailing",children:i.jsx(Wi,{})})]}):D.map(T=>i.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-session-row",onClick:()=>e(er(M.id,T.sessionId)),children:[i.jsxs("div",{className:"mobile-workspace-home-session-main",children:[i.jsx("span",{className:"mobile-workspace-home-session-title",children:T.title||h("common.unknown")}),i.jsxs("span",{className:"mobile-workspace-home-session-meta",children:[Eb(T.provider)," · ",Rb(eu(T))]})]}),i.jsx("span",{className:"mobile-workspace-home-row-trailing",children:i.jsx(Wi,{})})]},T.sessionId))})]}),P.length>0?i.jsxs("section",{className:"mobile-workspace-home-section",children:[i.jsx("div",{className:"mobile-workspace-home-section-header",children:i.jsx("p",{className:"mobile-workspace-home-section-title",children:h("shell.favoriteSectionTitle")})}),i.jsx("div",{className:"mobile-workspace-home-group",children:P.map(T=>i.jsxs("button",{type:"button",className:"mobile-workspace-home-row mobile-workspace-home-session-row",onClick:()=>e(er(M.id,T.sessionId)),children:[i.jsxs("div",{className:"mobile-workspace-home-session-main",children:[i.jsx("span",{className:"mobile-workspace-home-session-title",children:T.title||h("common.unknown")}),i.jsxs("span",{className:"mobile-workspace-home-session-meta",children:[Eb(T.provider)," · ",Rb(eu(T))]})]}),i.jsx("span",{className:"mobile-workspace-home-row-trailing",children:i.jsx(Wi,{})})]},T.sessionId))})]}):null]})]}):i.jsx("div",{className:"mobile-page-top-body mobile-workspace-home-body",children:i.jsxs("section",{className:"mobile-workspace-home-section mobile-workspace-home-empty",children:[i.jsx("p",{className:"mobile-workspace-home-section-title",children:h("shell.workspaceHomeSwitcherTitle")}),i.jsxs("div",{className:"mobile-workspace-home-group",children:[i.jsxs("button",{type:"button",className:"mobile-workspace-home-row",onClick:()=>k("import"),children:[i.jsx("span",{className:"mobile-workspace-home-row-label",children:h("shell.importWorkspaceTitle")}),i.jsx("span",{className:"mobile-workspace-home-row-trailing",children:i.jsx(Wi,{})})]}),i.jsxs("button",{type:"button",className:"mobile-workspace-home-row",onClick:()=>k("clone"),children:[i.jsx("span",{className:"mobile-workspace-home-row-label",children:h("shell.cloneWorkspaceTitle")}),i.jsx("span",{className:"mobile-workspace-home-row-trailing",children:i.jsx(Wi,{})})]})]})]})}),i.jsx(WS,{open:b==="import",onClose:()=>k(null),onImported:K}),i.jsx(US,{open:b==="clone",onClose:()=>k(null),onCloned:X}),i.jsx(Ya,{open:S,workspaces:t.map(T=>T.workspace),initialWorkspaceId:(M==null?void 0:M.id)??n??null,onClose:()=>C(!1),onSelect:z})]})}function Qh(e){return`git-sidebar.snapshot.${e}`}function Yh(e){return`terminal-manager.snapshot.${e}`}function Wi(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5L10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})})}function Mb(e){return h(e==="codex"?"conversation.providerCodex":e==="opencode"?"conversation.providerOpenCode":"conversation.providerClaude")}function m4(e){return e.isArchived!==!0&&e.isSubagent!==!0}function p4(e){return e.isArchived===!0&&e.isSubagent!==!0}function Ab(e){return e.lastEventAt??e.lastMessageAt??e.updatedAt??e.createdAt??""}function Lb(e,t){return Ab(t).localeCompare(Ab(e))}const Xh=60*1e3,Jh=10;function g4(){var pe;const{workspaceId:e=""}=Kf(),t=Wn(),{showToast:n}=Kn(),{navigationGroups:s,currentWorkspaceId:a,favoriteSessionIds:c,workspaceManagementStateById:l,selectWorkspace:d,subscribeGitSnapshot:f,requestGitRefresh:p,subscribeWorkspaceManagementSnapshot:y,requestWorkspaceManagementRefresh:g,toggleFavoriteSession:b,archiveSession:k,unarchiveSession:S,startDraftSession:C}=tr(),[j,A]=v.useState(!1),[L,M]=v.useState(!1),[O,q]=v.useState(Jh),_=s.find(ne=>ne.workspace.id===e)??null,I=(_==null?void 0:_.workspace)??null,F=v.useMemo(()=>[...(_==null?void 0:_.sessions)??[]].filter(m4).sort(Lb),[_]),D=v.useMemo(()=>[...(_==null?void 0:_.sessions)??[]].filter(p4).sort(Lb),[_]);v.useEffect(()=>{e&&d(e)},[d,e]),v.useEffect(()=>{if(!e)return;f(e),y(e);const ne=Mn(w4(e),Xh)!==null,z=Mn(Ib(e),Xh)!==null;ne||p(e),z||g(e)},[p,g,f,y,e]),v.useEffect(()=>{q(Jh)},[e]);const P=v.useMemo(()=>{if(!e)return{loading:!1,error:null,hasMeaningfulSummary:!1,summary:null};const ne=Mn(Ib(e),Xh),z=l[e]??null,ye=(z==null?void 0:z.detail)??(I?b4(I,ne):ne??null);return{loading:(z==null?void 0:z.loading)??!1,error:(z==null?void 0:z.error)??null,hasMeaningfulSummary:x4(ye),summary:ye}},[I,e,l]),K=v.useMemo(()=>P.summary?IS(P.summary.codeComposition.items,h("shell.manageWorkspaceCodeCompositionOther")):[],[P.summary]),X=v.useMemo(()=>K.length>0?DS(K):void 0,[K]),$=v.useMemo(()=>D.slice(0,O),[D,O]);async function ee(){if(!(!I||!(typeof window>"u"||window.confirm(h("shell.manageWorkspaceRemoveConfirmTarget",{name:I.name}))))){A(!0);try{await Xx(I.id),n({title:h("shell.manageWorkspaceRemoveSuccess"),tone:"success"}),t("/workspaces",{replace:!0})}catch(z){n({title:z instanceof Error?z.message:h("shell.manageWorkspaceRemoveFailed"),tone:"error"})}finally{A(!1)}}}function te(ne,z){M(!1),C(ne,z)}return I?i.jsxs("main",{className:"mobile-feature-page mobile-page-scroll-root mobile-page-with-top-header mobile-workspace-detail-page",children:[i.jsx(vo,{currentWorkspace:I,workspaces:s.map(ne=>ne.workspace),heading:h("shell.workspaceDetailTitle"),triggerLabel:I.name,onSelectWorkspace:ne=>{d(ne),t(oi(ne))},content:i.jsxs("div",{className:"mobile-workspace-detail-header-actions",children:[i.jsx("button",{type:"button",className:"primary-button",onClick:()=>M(!0),children:h("shell.createSession")}),i.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{d(I.id),t(fS(I.id))},children:h("shell.filesEntry")}),i.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{d(I.id),t(io(I.id))},children:h("shell.terminalsEntry")})]})}),i.jsxs("div",{className:"mobile-page-top-body mobile-workspace-detail-body",children:[i.jsxs("section",{className:"mobile-feature-panel surface-card mobile-workspace-detail-summary-panel",children:[i.jsxs("div",{className:"mobile-feature-section-header",children:[i.jsx("div",{children:i.jsx("h2",{children:h("shell.workspaceDetailSummaryTitle")})}),a!==I.id?i.jsx("button",{type:"button",className:"secondary-button mobile-workspace-detail-switch-button",onClick:()=>d(I.id),children:h("shell.switchWorkspace")}):null]}),P.loading&&P.summary===null?i.jsx("p",{children:h("common.loading")}):null,P.error?i.jsx("p",{className:"status-text","data-tone":"error",children:P.error}):null,P.summary?i.jsxs("div",{className:"mobile-detail-grid mobile-workspace-detail-grid",children:[i.jsxs("div",{className:"mobile-detail-metric mobile-detail-metric-wide",children:[i.jsx("span",{children:h("shell.manageWorkspacePathLabel")}),i.jsx("strong",{title:P.summary.path,children:P.summary.path})]}),i.jsxs("div",{className:"mobile-detail-metric",children:[i.jsx("span",{children:h("shell.manageWorkspaceCurrentBranch")}),i.jsx("strong",{title:P.summary.git.currentBranch??h("common.unknown"),children:P.summary.git.currentBranch??h("common.unknown")})]}),i.jsxs("div",{className:"mobile-detail-metric",children:[i.jsx("span",{children:h("shell.manageWorkspaceGitCommitCount")}),i.jsx("strong",{children:P.hasMeaningfulSummary?P.summary.git.commitCount??0:"—"})]}),i.jsxs("div",{className:"mobile-detail-metric",children:[i.jsx("span",{children:h("shell.manageWorkspaceCodeCompositionFiles")}),i.jsx("strong",{children:P.hasMeaningfulSummary?P.summary.codeComposition.scannedFileCount:"—"})]})]}):null,i.jsxs("div",{className:"mobile-feature-inline-actions mobile-workspace-detail-summary-actions",children:[i.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{d(I.id),t(mS(I.id))},children:h("shell.gitEntry")}),i.jsx("button",{type:"button",className:"secondary-button",onClick:()=>{d(I.id),t(cu(I.id))},children:h("shell.terminalManagerEntry")}),i.jsx("button",{type:"button",className:"secondary-button workbench-danger-button",disabled:j,onClick:()=>{ee()},children:h(j?"shell.manageWorkspaceRemoving":"shell.manageWorkspaceRemoveAction")})]})]}),i.jsxs("section",{className:"mobile-feature-panel surface-card mobile-workspace-composition-panel",children:[i.jsxs("div",{className:"mobile-feature-section-header",children:[i.jsx("div",{children:i.jsx("h2",{children:h("shell.manageWorkspaceCodeCompositionLabel")})}),P.summary?i.jsx("span",{className:"mobile-feature-counter",children:P.summary.codeComposition.scannedFileCount}):null]}),P.loading&&P.summary===null?i.jsx("p",{children:h("common.loading")}):null,P.summary?K.length>0?i.jsxs("div",{className:"workbench-manage-type-chart",children:[i.jsxs("div",{className:"workbench-manage-type-chart-ring",style:X,"aria-hidden":"true",children:[i.jsx("strong",{className:"workbench-manage-type-chart-total",children:P.summary.codeComposition.scannedFileCount}),i.jsx("span",{className:"workbench-manage-type-chart-caption",children:h("shell.manageWorkspaceCodeCompositionFiles")})]}),i.jsx("div",{className:"workbench-manage-type-list",children:K.map(ne=>i.jsxs("div",{className:"workbench-manage-type-item",children:[i.jsxs("span",{className:"workbench-manage-type-meta",children:[i.jsx("span",{className:"workbench-manage-type-swatch",style:{backgroundColor:ne.color},"aria-hidden":"true"}),i.jsx("span",{className:"workbench-manage-type-name",children:ne.type})]}),i.jsxs("span",{children:[ne.count," · ",LS(ne)]})]},ne.key))})]}):i.jsx("p",{children:P.summary.codeComposition.error??h("shell.manageWorkspaceNoCodeComposition")}):null,(pe=P.summary)!=null&&pe.codeComposition.truncated?i.jsx("p",{className:"mobile-workspace-composition-note",children:h("shell.manageWorkspaceCodeTruncated",{count:P.summary.codeComposition.scannedFileCount})}):null]}),i.jsxs("section",{className:"mobile-feature-section",children:[i.jsxs("div",{className:"mobile-feature-section-header",children:[i.jsx("div",{children:i.jsx("h2",{children:h("shell.recentSessionsSectionTitle")})}),i.jsx("span",{className:"mobile-feature-counter",children:F.length})]}),i.jsx("div",{className:"mobile-feature-stack",children:F.length===0?i.jsx("article",{className:"mobile-feature-empty surface-card",children:i.jsx("p",{children:h("shell.emptyWorkspaceSessions")})}):F.map(ne=>{const z=Yi(ne.title,h("common.unknown")),ye=c.includes(ne.sessionId);return i.jsxs("article",{className:"mobile-session-row surface-card",children:[i.jsxs("button",{type:"button",className:"mobile-session-row-primary",onClick:()=>t(er(I.id,ne.sessionId)),children:[i.jsx("span",{className:"mobile-session-row-title",title:z.fullTitle,children:z.displayTitle}),i.jsx("span",{className:"mobile-session-row-provider",children:Mb(ne.provider)})]}),i.jsxs("div",{className:"mobile-session-row-actions",children:[i.jsx("span",{className:"mobile-feature-badge mobile-session-row-count",children:ne.messageCount}),i.jsx("button",{type:"button",className:"mobile-session-row-action","aria-label":h(ye?"shell.unfavoriteAction":"shell.favoriteAction"),title:h(ye?"shell.unfavoriteAction":"shell.favoriteAction"),onClick:()=>{b(ne.sessionId)},children:i.jsx(y4,{active:ye})}),i.jsx("button",{type:"button",className:"mobile-session-row-action","aria-label":h("shell.archiveAction"),title:h("shell.archiveAction"),onClick:()=>{k(ne.sessionId)},children:i.jsx(v4,{})})]})]},ne.sessionId)})})]}),D.length>0?i.jsxs("section",{className:"mobile-feature-section",children:[i.jsxs("div",{className:"mobile-feature-section-header",children:[i.jsx("div",{children:i.jsx("h2",{children:h("shell.archiveModalTitle")})}),i.jsx("span",{className:"mobile-feature-counter",children:D.length})]}),i.jsx("div",{className:"mobile-feature-stack",children:$.map(ne=>i.jsxs("article",{className:"mobile-session-row surface-card",children:[i.jsxs("div",{className:"mobile-session-row-primary mobile-session-row-primary-static",children:[i.jsx("span",{className:"mobile-session-row-title",title:ne.title,children:ne.title}),i.jsx("span",{className:"mobile-session-row-provider",children:Mb(ne.provider)})]}),i.jsx("div",{className:"mobile-session-row-actions",children:i.jsx("button",{type:"button",className:"secondary-button mobile-session-row-restore",onClick:()=>{S(ne.sessionId)},children:h("shell.unarchiveAction")})})]},ne.sessionId))}),$.length<D.length?i.jsx("button",{type:"button",className:"secondary-button mobile-workspace-detail-expand-button",onClick:()=>{q(ne=>ne+Jh)},children:h("shell.archiveExpandMore")}):null]}):null]}),i.jsx(Ya,{open:L,workspaces:s.map(ne=>ne.workspace),initialWorkspaceId:a??I.id,onClose:()=>M(!1),onSelect:te})]}):i.jsx("main",{className:"mobile-feature-page mobile-page-scroll-root",children:i.jsxs("article",{className:"mobile-feature-empty surface-card",children:[i.jsx("h1",{children:h("shell.workspaceDetailMissingTitle")}),i.jsx("p",{children:h("shell.workspaceDetailMissingBody")}),i.jsx("button",{type:"button",className:"secondary-button",onClick:()=>t("/workspaces"),children:h("shell.mobileWorkspacesEntry")})]})})}function y4({active:e}){return i.jsx("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.8",children:i.jsx("path",{d:"m12 3.6 2.6 5.2 5.7.8-4.1 4 1 5.7L12 16.5 6.8 19.3l1-5.7-4.1-4 5.7-.8Z"})})}function v4(){return i.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("path",{d:"M4 7.5h16"}),i.jsx("path",{d:"M6.4 7.5h11.2l-.9 10.2a2 2 0 0 1-2 1.8H9.3a2 2 0 0 1-2-1.8Z"}),i.jsx("path",{d:"M8 4.5h8a1.5 1.5 0 0 1 1.5 1.5v1.5h-11V6A1.5 1.5 0 0 1 8 4.5Z"}),i.jsx("path",{d:"M10 11.5h4"})]})}function Ib(e){return`workspace-management.summary.${e}`}function w4(e){return`git-sidebar.snapshot.${e}`}function b4(e,t){const n=(t==null?void 0:t.git.repoRoot)??e.repoRoot??null;return{workspaceId:e.id,name:e.name,path:e.path,git:{isRepository:(t==null?void 0:t.git.isRepository)??!!n,repoRoot:n,currentBranch:(t==null?void 0:t.git.currentBranch)??null,commitCount:(t==null?void 0:t.git.commitCount)??null,remotes:(t==null?void 0:t.git.remotes)??[],error:(t==null?void 0:t.git.error)??null},codeComposition:(t==null?void 0:t.codeComposition)??{scannedFileCount:0,truncated:!1,items:[],error:null}}}function x4(e){return e?e.git.isRepository||e.git.repoRoot!==null||e.git.currentBranch!==null||e.git.commitCount!==null||e.git.remotes.length>0||e.codeComposition.scannedFileCount>0||e.codeComposition.items.length>0||e.codeComposition.error!==null:!1}function k4({isDesktop:e,isWeb:t,viewportClass:n}){return e||t&&n==="expanded"?"desktop":"mobile"}function S4(){const e=An(),t=k4(e);return i.jsx(uF,{shellMode:t})}const C4=[{titleKey:"workbench.emptyResumeTitle",bodyKey:"workbench.emptyResumeBody"},{titleKey:"workbench.emptyNewTitle",bodyKey:"workbench.emptyNewBody"},{titleKey:"workbench.emptyCompanionTitle",bodyKey:"workbench.emptyCompanionBody"}];function j4(){return i.jsx("main",{className:"workbench-page conversation-page-shell",children:i.jsx("section",{className:"workbench-center-placeholder",children:i.jsxs("div",{className:"workbench-empty-guide surface-card",children:[i.jsx("p",{className:"workbench-empty-eyebrow",children:h("workbench.emptyEyebrow")}),i.jsx("div",{className:"workbench-empty-main",children:i.jsxs("div",{className:"workbench-empty-copy",children:[i.jsx("h1",{children:h("workbench.emptyTitle")}),i.jsx("p",{className:"workbench-empty-body",children:h("workbench.emptyBody")})]})}),i.jsx("ol",{className:"workbench-empty-steps",children:C4.map((e,t)=>i.jsxs("li",{className:"workbench-empty-step",children:[i.jsx("span",{className:"workbench-empty-step-index",children:t+1}),i.jsxs("div",{className:"workbench-empty-step-copy",children:[i.jsx("h2",{children:h(e.titleKey)}),i.jsx("p",{children:h(e.bodyKey)})]})]},e.titleKey))}),i.jsx("p",{className:"workbench-empty-tip",children:h("workbench.emptyTip")})]})})})}function N4(){const{shellMode:e}=tr();return e==="mobile"?i.jsx(Ha,{to:"/workspaces",replace:!0}):i.jsx(j4,{})}async function P4(){const e=ai(),t=Rn.getState(),n=await e.bridge.checkForUpdate(t.releaseChannel);if(!n.ok||!n.value)throw new Error(n.detail??"更新检查失败。");return n.value}async function T4(e){return ai().bridge.installUpdate(e)}async function E4(){return ai().bridge.rollbackToPreviousVersion()}function l0(){const e=ai(),t=e.isDesktop,[n,s]=v.useState(!1),[a,c]=v.useState(!1),[l,d]=v.useState(!1),[f,p]=v.useState(null),[y,g]=v.useState(null),[b,k]=v.useState(null),[S,C]=v.useState(!1);async function j(){var _,I;s(!0),p(null);try{const F=await P4();k(F.manifest),g(F.currentVersion),C(F.hasUpdate),p(R4(F.manifest,F.hasUpdate)),F.hasUpdate&&await e.bridge.showNotification(h("settings.releaseUpdateReady"),((_=F.manifest)==null?void 0:_.tagName)??((I=F.manifest)==null?void 0:I.version)??"-")}catch(F){p(F instanceof Error?F.message:h("settings.releaseCheckFailed"))}finally{s(!1)}}async function A(){if(!(!(b!=null&&b.packageUrl)||!b.signature)){c(!0),p(null);try{const _=await T4(b);if(!_.ok){p(_.detail??h("settings.releaseInstallFailed"));return}p(h("settings.releaseInstallStarted")),await e.bridge.showNotification(h("settings.releaseInstallStarted"),b.version)}catch(_){p(_ instanceof Error?_.message:h("settings.releaseInstallFailed"))}finally{c(!1)}}}async function L(){c(!0),p(null);try{const _=await E4();p(_.ok?h("settings.releaseRollbackStarted"):_.detail??h("settings.releaseRollbackFailed")),_.ok&&await e.bridge.showNotification(h("settings.releaseRollbackStarted"),y??h("settings.releaseUnknownVersion"))}catch(_){p(_ instanceof Error?_.message:h("settings.releaseRollbackFailed"))}finally{c(!1)}}async function M(){if(b!=null&&b.htmlUrl){d(!0);try{const _=await e.bridge.openExternal(b.htmlUrl);_.ok||p(_.detail??h("settings.releasePageOpenFailed"))}catch(_){p(_ instanceof Error?_.message:h("settings.releasePageOpenFailed"))}finally{d(!1)}}}const O=!!(t&&(b!=null&&b.packageUrl)&&b.signature&&S),q=f??(t?null:h("settings.clientUpdateUnsupported"));return i.jsxs("div",{className:"settings-release-card",children:[i.jsxs("div",{className:"settings-release-meta",children:[i.jsxs("span",{children:[h("settings.releaseCurrentVersion"),": ",y??h("settings.releaseUnknownVersion")]}),i.jsxs("span",{children:[h("settings.releaseTargetVersion"),": ",(b==null?void 0:b.version)??"-"]}),i.jsxs("span",{children:[h("settings.releaseTargetTag"),": ",(b==null?void 0:b.tagName)??"-"]}),i.jsxs("span",{children:[h("settings.releasePublishedAt"),": ",M4(b==null?void 0:b.publishedAt)]})]}),b?i.jsxs("div",{className:"settings-release-notes",children:[i.jsx("strong",{children:h("settings.releaseNotes")}),b.title&&b.title!==b.tagName?i.jsx("p",{className:"settings-release-title",children:b.title}):null,b.notes?i.jsx("div",{className:"settings-release-markdown",children:i.jsx(hm,{remarkPlugins:[gm],children:b.notes})}):i.jsx("p",{children:h("settings.releaseNotesEmpty")})]}):null,q?i.jsx("p",{className:"settings-release-status",children:q}):null,i.jsxs("div",{className:"settings-release-actions",children:[i.jsx("button",{className:"secondary-button",type:"button",disabled:!t||n||a,onClick:j,children:h(n?"common.loading":"settings.releaseCheckNow")}),i.jsx("button",{className:"primary-button",type:"button",disabled:!O||a,onClick:A,children:h(a?"common.loading":"settings.releaseInstallNow")}),i.jsx("button",{className:"secondary-button",type:"button",disabled:!(b!=null&&b.htmlUrl)||n||a||l,onClick:M,children:h(l?"common.loading":"settings.releaseOpenPage")}),i.jsx("button",{className:"secondary-button",type:"button",disabled:!t||a,onClick:L,children:h("settings.releaseRollback")})]})]})}function R4(e,t){return t?e!=null&&e.packageUrl?e.signature?h("settings.releaseUpdateReady"):h("settings.releaseSignatureMissing"):h("settings.releaseInstallerMissing"):h("settings.releaseUpToDate")}function M4(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}async function A4(){const e=Rn.getState();return Je.request(`/api/client/service-update?channel=${encodeURIComponent(e.releaseChannel)}`)}function c0(){const e=ai(),[t,n]=v.useState(!1),[s,a]=v.useState(!1),[c,l]=v.useState(null),[d,f]=v.useState(null);async function p(){n(!0),l(null);try{const g=await A4();f(g),l(L4(g)),g.hasUpdate&&await e.bridge.showNotification(h("settings.serverUpdateReady"),`${h("settings.serverTargetVersion")}: ${g.latestVersion??"-"}`)}catch(g){l(g instanceof Error?g.message:h("settings.serverCheckFailed"))}finally{n(!1)}}async function y(){if(d!=null&&d.packagePageUrl){a(!0);try{const g=await e.bridge.openExternal(d.packagePageUrl);g.ok||l(g.detail??h("settings.serverOpenPageFailed"))}catch(g){l(g instanceof Error?g.message:h("settings.serverOpenPageFailed"))}finally{a(!1)}}}return i.jsxs("div",{className:"settings-release-card",children:[i.jsxs("div",{className:"settings-release-meta",children:[i.jsxs("span",{children:[h("settings.serverCurrentVersion"),": ",(d==null?void 0:d.currentVersion)??"-"]}),i.jsxs("span",{children:[h("settings.serverTargetVersion"),": ",(d==null?void 0:d.latestVersion)??h("settings.serverLatestUnknown")]}),i.jsxs("span",{children:[h("settings.serverPackageName"),": ",(d==null?void 0:d.packageName)??"-"]})]}),d?i.jsxs("div",{className:"settings-release-notes",children:[i.jsx("strong",{children:h("settings.serverUpdateCommand")}),i.jsx("p",{className:"settings-release-command",children:d.updateCommand})]}):null,c?i.jsx("p",{className:"settings-release-status",children:c}):null,i.jsxs("div",{className:"settings-release-actions",children:[i.jsx("button",{className:"secondary-button",type:"button",disabled:t,onClick:p,children:h(t?"common.loading":"settings.serverCheckNow")}),i.jsx("button",{className:"secondary-button",type:"button",disabled:!(d!=null&&d.packagePageUrl)||t||s,onClick:y,children:h(s?"common.loading":"settings.serverOpenPage")})]})]})}function L4(e){return e.latestVersion?e.hasUpdate?h("settings.serverUpdateReady"):h("settings.serverUpToDate"):h("settings.serverLatestUnknown")}function Db({title:e,description:t,actions:n,content:s,className:a}){return i.jsx(xC,{className:a,children:i.jsxs("section",{className:"mobile-workspace-home-header mobile-page-header",children:[i.jsx("h1",{className:"mobile-workspace-switcher-heading",children:e}),i.jsxs("div",{className:"mobile-workspace-home-toolbar-top mobile-page-header-main",children:[i.jsx("div",{className:"mobile-page-header-copy",children:i.jsx("div",{className:"mobile-workspace-home-switcher mobile-page-header-static-title",children:i.jsx("span",{className:"mobile-workspace-home-switcher-label",children:e})})}),n?i.jsx("div",{className:"mobile-workspace-home-toolbar-actions mobile-page-header-actions",children:n}):null]}),t?i.jsx("p",{className:"mobile-workspace-home-path mobile-page-header-description",children:t}):null,s?i.jsx("div",{className:"mobile-page-header-content",children:s}):null]})})}function I4(e){return e==="appearance"||e==="server-connection"||e==="security-privacy"||e==="software-update"}function _b(e){return h(e==="en-US"?"locale.enUS":"locale.zhCN")}function Fb(e){return h(e==="beta"?"settings.releaseBeta":"settings.releaseStable")}function Ob(e){switch(e){case"acceptEdits":return h("settings.permissionModeAcceptEdits");case"bypassPermissions":return h("settings.permissionModeBypassPermissions");default:return h("settings.permissionModeDefault")}}function D4(){const e=Wn(),{theme:t,setTheme:n}=Wx(),s=xj(D=>D),a=nf(D=>D.profile.language),c=nf(D=>D.profile.defaultPermissionMode),l=LC(D=>D.showSystemFiles),d={language:a,defaultPermissionMode:c},f=An(),p=Bf(s.platform),y=p,[g,b]=v.useState(s.hostBaseUrl);v.useEffect(()=>{b(s.hostBaseUrl)},[s.hostBaseUrl]);function k(){gn.clear(),Yr.resetToLocalFallback(),e("/login",{replace:!0})}function S(D){n(D)}function C(D){try{return bi(D)}catch{return null}}const j=C(g),A=j!==null&&j!==s.hostBaseUrl;function L(D){D.preventDefault(),j&&Rn.update({hostBaseUrl:j})}const M=[{value:"default",label:h("settings.permissionModeDefault")},{value:"acceptEdits",label:h("settings.permissionModeAcceptEdits")},{value:"bypassPermissions",label:h("settings.permissionModeBypassPermissions")}];function O(D){Rn.update({releaseChannel:D==="beta"?"beta":"stable"})}function q(D){Rn.update({autoReconnect:D})}function _(D){Rn.update({autoCheckUpdate:D})}function I(D){const P=D==="acceptEdits"||D==="bypassPermissions"?D:"default";Yr.updateProfile({defaultPermissionMode:P}).catch(()=>{})}function F(D){Af.setShowSystemFiles(D)}return{platform:f,theme:t,applyTheme:S,runtimeConfig:s,accountPreferences:d,showSystemFiles:l,showServerSettings:y,canConfigureServerAddress:p,hostBaseUrlDraft:g,setHostBaseUrlDraft:b,canSaveHostBaseUrl:A,permissionModeOptions:M,handleHostBaseUrlSubmit:L,handleLogout:k,updateReleaseChannel:O,updateAutoReconnect:q,updateAutoCheckUpdate:_,updateDefaultPermissionMode:I,updateShowSystemFiles:F}}function Bb(){const e=D4(),t=qx();return e.platform.isMobile?i.jsx(F4,{model:e,appVersion:t}):i.jsx(_4,{model:e,appVersion:t})}function _4({model:e,appVersion:t}){const{theme:n,applyTheme:s,runtimeConfig:a,accountPreferences:c,showSystemFiles:l,showServerSettings:d,hostBaseUrlDraft:f,setHostBaseUrlDraft:p,canSaveHostBaseUrl:y,permissionModeOptions:g,platform:b,handleHostBaseUrlSubmit:k,handleLogout:S,updateReleaseChannel:C,updateAutoReconnect:j,updateAutoCheckUpdate:A,updateDefaultPermissionMode:L,updateShowSystemFiles:M}=e;return i.jsx("div",{className:"settings-page",children:i.jsxs("div",{className:"settings-container",children:[i.jsx("h1",{className:"settings-title",children:h("settings.title")}),i.jsxs("section",{className:"settings-section",children:[i.jsx("h2",{className:"settings-section-title",children:h("settings.appearance")}),i.jsxs("div",{className:"settings-card",children:[i.jsxs("div",{className:"settings-row",children:[i.jsxs("div",{className:"settings-row-label",children:[i.jsx("span",{className:"settings-row-title",children:h("settings.language")}),i.jsx("span",{className:"settings-row-description",children:h("settings.languageDescription")})]}),i.jsx("div",{className:"settings-row-control",children:i.jsx(Qf,{})})]}),i.jsxs("div",{className:"settings-row settings-row-theme",children:[i.jsx("div",{className:"settings-row-label",children:i.jsx("span",{className:"settings-row-title",children:h("settings.theme")})}),i.jsx("div",{className:"settings-row-control settings-row-control-stretch",children:i.jsx("div",{className:"theme-selector",children:Bx.map(O=>i.jsxs("button",{type:"button",className:`theme-card ${n===O.id?"active":""}`,"aria-pressed":n===O.id,onClick:()=>s(O.id),children:[i.jsx("span",{className:"theme-preview",style:{background:O.color}}),i.jsx("span",{className:"theme-label",children:Ux(O)}),n===O.id?i.jsx("span",{className:"theme-check",children:"✓"}):null]},O.id))})})]}),i.jsxs("div",{className:"settings-row",children:[i.jsxs("div",{className:"settings-row-label",children:[i.jsx("span",{className:"settings-row-title",children:h("settings.showSystemFiles")}),i.jsx("span",{className:"settings-row-description",children:h("settings.showSystemFilesDescription")})]}),i.jsx("div",{className:"settings-row-control",children:i.jsxs("label",{className:"settings-checkbox",children:[i.jsx("input",{type:"checkbox",checked:l,onChange:O=>M(O.target.checked)}),i.jsx("span",{children:h(l?"settings.enabled":"settings.disabled")})]})})]})]})]}),d?i.jsxs("section",{className:"settings-section",children:[i.jsx("h2",{className:"settings-section-title",children:h("settings.serverConnection")}),i.jsxs("div",{className:"settings-card",children:[i.jsxs("div",{className:"settings-row",children:[i.jsxs("div",{className:"settings-row-label",children:[i.jsx("span",{className:"settings-row-title",children:h("settings.serverAddress")}),i.jsx("span",{className:"settings-row-description",children:h("settings.serverDescription")})]}),i.jsx("div",{className:"settings-row-control settings-row-control-stretch",children:i.jsxs("form",{className:"settings-inline-form",onSubmit:k,children:[i.jsx("input",{"aria-label":h("settings.serverAddress"),className:"settings-text-input",value:f,onChange:O=>p(O.target.value)}),i.jsx("button",{className:"settings-button",disabled:!y,type:"submit",children:h("common.save")})]})})]}),i.jsxs("div",{className:"settings-row",children:[i.jsxs("div",{className:"settings-row-label",children:[i.jsx("span",{className:"settings-row-title",children:h("settings.autoReconnect")}),i.jsx("span",{className:"settings-row-description",children:h("settings.autoReconnectDescription")})]}),i.jsx("div",{className:"settings-row-control",children:i.jsxs("label",{className:"settings-checkbox",children:[i.jsx("input",{type:"checkbox",checked:a.autoReconnect,onChange:O=>j(O.target.checked)}),i.jsx("span",{children:a.autoReconnect?h("settings.enabled"):h("settings.disabled")})]})})]})]})]}):null,i.jsxs("section",{className:"settings-section",children:[i.jsx("h2",{className:"settings-section-title",children:h("settings.securityPrivacy")}),i.jsx("div",{className:"settings-card",children:i.jsxs("div",{className:"settings-row",children:[i.jsxs("div",{className:"settings-row-label",children:[i.jsx("span",{className:"settings-row-title",children:h("settings.defaultPermissionMode")}),i.jsx("span",{className:"settings-row-description",children:h("settings.defaultPermissionModeDescription")})]}),i.jsx("div",{className:"settings-row-control",children:i.jsx("select",{"aria-label":h("settings.defaultPermissionMode"),className:"settings-select",value:c.defaultPermissionMode,onChange:O=>L(O.target.value),children:g.map(O=>i.jsx("option",{value:O.value,children:O.label},O.value))})})]})})]}),i.jsxs("section",{className:"settings-section",children:[i.jsx("h2",{className:"settings-section-title",children:h("settings.softwareUpdate")}),i.jsxs("div",{className:"settings-card",children:[i.jsxs("div",{className:"settings-row",children:[i.jsxs("div",{className:"settings-row-label",children:[i.jsx("span",{className:"settings-row-title",children:h("settings.releaseChannel")}),i.jsx("span",{className:"settings-row-description",children:h("settings.releaseChannelDescription")})]}),i.jsx("div",{className:"settings-row-control",children:i.jsxs("select",{"aria-label":h("settings.releaseChannel"),className:"settings-select",value:a.releaseChannel,onChange:O=>C(O.target.value),children:[i.jsx("option",{value:"stable",children:h("settings.releaseStable")}),i.jsx("option",{value:"beta",children:h("settings.releaseBeta")})]})})]}),i.jsxs("div",{className:"settings-row",children:[i.jsx("div",{className:"settings-row-label",children:i.jsx("span",{className:"settings-row-title",children:h("settings.serverUpdate")})}),i.jsx("div",{className:"settings-row-control settings-row-control-stretch",children:i.jsx(c0,{})})]}),b.isWeb?null:i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"settings-row",children:[i.jsx("div",{className:"settings-row-label",children:i.jsx("span",{className:"settings-row-title",children:h("settings.autoCheckUpdate")})}),i.jsx("div",{className:"settings-row-control",children:i.jsxs("label",{className:"settings-checkbox",children:[i.jsx("input",{type:"checkbox",checked:a.autoCheckUpdate,onChange:O=>A(O.target.checked)}),i.jsx("span",{children:a.autoCheckUpdate?h("settings.enabled"):h("settings.disabled")})]})})]}),i.jsxs("div",{className:"settings-row",children:[i.jsx("div",{className:"settings-row-label",children:i.jsx("span",{className:"settings-row-title",children:h("settings.clientUpdate")})}),i.jsx("div",{className:"settings-row-control settings-row-control-stretch",children:i.jsx(l0,{})})]})]})]})]}),i.jsxs("div",{className:"settings-footer settings-footer-with-logout",children:[i.jsxs("span",{className:"settings-version",children:["CodingNS v",t]}),i.jsx("button",{className:"settings-button settings-button-danger settings-button-sticky",onClick:S,type:"button",children:h("common.logout")})]})]})})}function F4({model:e,appVersion:t}){const n=Wn(),{section:s}=Kf(),a=I4(s)?s:null,c=e.showServerSettings?[{id:"appearance",title:h("settings.appearance"),description:h("settings.appearanceSectionSummary"),value:_b(e.accountPreferences.language),icon:i.jsx(Wb,{})},{id:"server-connection",title:h("settings.serverConnection"),description:h("settings.serverConnectionSectionSummary"),value:e.runtimeConfig.hostBaseUrl,icon:i.jsx(z4,{})},{id:"security-privacy",title:h("settings.securityPrivacy"),description:h("settings.securityPrivacySectionSummary"),value:Ob(e.accountPreferences.defaultPermissionMode),icon:i.jsx(Hb,{})},{id:"software-update",title:h("settings.softwareUpdate"),description:h("settings.softwareUpdateSectionSummary"),value:Fb(e.runtimeConfig.releaseChannel),icon:i.jsx(zb,{})}]:[{id:"appearance",title:h("settings.appearance"),description:h("settings.appearanceSectionSummary"),value:_b(e.accountPreferences.language),icon:i.jsx(Wb,{})},{id:"security-privacy",title:h("settings.securityPrivacy"),description:h("settings.securityPrivacySectionSummary"),value:Ob(e.accountPreferences.defaultPermissionMode),icon:i.jsx(Hb,{})},{id:"software-update",title:h("settings.softwareUpdate"),description:h("settings.softwareUpdateSectionSummary"),value:Fb(e.runtimeConfig.releaseChannel),icon:i.jsx(zb,{})}];return(a?c.find(d=>d.id===a)??null:null)?i.jsxs("div",{className:"settings-page settings-page-mobile mobile-page-scroll-root mobile-page-with-top-header",children:[i.jsx(Db,{title:h("settings.title")}),i.jsxs("div",{className:"settings-mobile-container",children:[a==="appearance"?i.jsx(O4,{model:e}):null,a==="server-connection"&&e.showServerSettings?i.jsx(B4,{model:e}):null,a==="security-privacy"?i.jsx(U4,{model:e}):null,a==="software-update"?i.jsx(W4,{model:e}):null]}),i.jsx(Ub,{onLogout:e.handleLogout})]}):i.jsxs("div",{className:"settings-page settings-page-mobile mobile-page-scroll-root mobile-page-with-top-header",children:[i.jsx(Db,{title:h("settings.title")}),i.jsxs("div",{className:"settings-mobile-container",children:[i.jsx("section",{className:"settings-mobile-group-section",children:i.jsx("div",{className:"settings-mobile-card",children:c.map(d=>i.jsxs("button",{type:"button",className:"settings-mobile-nav-row",onClick:()=>n(`/settings/${d.id}`),children:[i.jsx("span",{className:"settings-mobile-nav-icon",children:d.icon}),i.jsxs("span",{className:"settings-mobile-nav-copy",children:[i.jsx("span",{className:"settings-mobile-nav-title",children:d.title}),i.jsx("span",{className:"settings-mobile-nav-description",children:d.description})]}),i.jsxs("span",{className:"settings-mobile-nav-trailing",children:[d.value?i.jsx("span",{className:"settings-mobile-nav-value",children:d.value}):null,i.jsx(H4,{})]})]},d.id))})}),i.jsx("div",{className:"settings-footer settings-footer-mobile",children:i.jsxs("span",{className:"settings-version",children:["CodingNS v",t]})})]}),i.jsx(Ub,{onLogout:e.handleLogout})]})}function O4({model:e}){return i.jsxs(i.Fragment,{children:[i.jsxs("section",{className:"settings-mobile-group-section",children:[i.jsx("h2",{className:"settings-mobile-group-title",children:h("settings.language")}),i.jsx("p",{className:"settings-mobile-group-note",children:h("settings.languageDescription")}),i.jsx("div",{className:"settings-mobile-card",children:i.jsxs("div",{className:"settings-mobile-form-row",children:[i.jsx("div",{className:"settings-mobile-row-copy",children:i.jsx("span",{className:"settings-mobile-row-title",children:h("settings.language")})}),i.jsx(Qf,{variant:"compact",className:"settings-mobile-language-switcher"})]})})]}),i.jsxs("section",{className:"settings-mobile-group-section",children:[i.jsx("h2",{className:"settings-mobile-group-title",children:h("settings.theme")}),i.jsx("p",{className:"settings-mobile-group-note",children:h("settings.themeDescription")}),i.jsx("div",{className:"settings-mobile-card",children:Bx.map(t=>{const n=e.theme===t.id;return i.jsxs("button",{type:"button",className:`settings-mobile-choice-row${n?" active":""}`,"aria-pressed":n,onClick:()=>e.applyTheme(t.id),children:[i.jsxs("span",{className:"settings-mobile-choice-leading",children:[i.jsx("span",{className:"settings-mobile-choice-dot",style:{background:t.color},"aria-hidden":"true"}),i.jsx("span",{className:"settings-mobile-choice-label",children:Ux(t)})]}),i.jsx("span",{className:"settings-mobile-choice-indicator","aria-hidden":"true",children:n?i.jsx(q4,{}):null})]},t.id)})})]}),i.jsxs("section",{className:"settings-mobile-group-section",children:[i.jsx("h2",{className:"settings-mobile-group-title",children:h("settings.fileManager")}),i.jsx("p",{className:"settings-mobile-group-note",children:h("settings.showSystemFilesDescription")}),i.jsx("div",{className:"settings-mobile-card",children:i.jsxs("div",{className:"settings-mobile-form-row",children:[i.jsxs("div",{className:"settings-mobile-row-copy",children:[i.jsx("span",{className:"settings-mobile-row-title",children:h("settings.showSystemFiles")}),i.jsx("span",{className:"settings-mobile-row-description",children:h("settings.showSystemFilesDescription")})]}),i.jsx(qm,{checked:e.showSystemFiles,label:h("settings.showSystemFiles"),onChange:e.updateShowSystemFiles})]})})]})]})}function B4({model:e}){return i.jsxs(i.Fragment,{children:[e.canConfigureServerAddress?i.jsxs("section",{className:"settings-mobile-group-section",children:[i.jsx("h2",{className:"settings-mobile-group-title",children:h("settings.serverAddress")}),i.jsx("p",{className:"settings-mobile-group-note",children:h("settings.serverDescription")}),i.jsx("div",{className:"settings-mobile-card",children:i.jsxs("form",{className:"settings-mobile-form-stack",onSubmit:e.handleHostBaseUrlSubmit,children:[i.jsx("input",{"aria-label":h("settings.serverAddress"),className:"settings-text-input settings-mobile-input",value:e.hostBaseUrlDraft,onChange:t=>e.setHostBaseUrlDraft(t.target.value)}),i.jsx("button",{className:"settings-mobile-primary-button",disabled:!e.canSaveHostBaseUrl,type:"submit",children:h("common.save")})]})})]}):null,i.jsxs("section",{className:"settings-mobile-group-section",children:[i.jsx("h2",{className:"settings-mobile-group-title",children:h("settings.serverConnection")}),i.jsx("div",{className:"settings-mobile-card",children:i.jsxs("div",{className:"settings-mobile-form-row",children:[i.jsxs("div",{className:"settings-mobile-row-copy",children:[i.jsx("span",{className:"settings-mobile-row-title",children:h("settings.autoReconnect")}),i.jsx("span",{className:"settings-mobile-row-description",children:h("settings.autoReconnectDescription")})]}),i.jsx(qm,{checked:e.runtimeConfig.autoReconnect,label:h("settings.autoReconnect"),onChange:e.updateAutoReconnect})]})})]})]})}function U4({model:e}){return i.jsxs("section",{className:"settings-mobile-group-section",children:[i.jsx("h2",{className:"settings-mobile-group-title",children:h("settings.securityPrivacy")}),i.jsx("p",{className:"settings-mobile-group-note",children:h("settings.securityPrivacySectionSummary")}),i.jsx("div",{className:"settings-mobile-card",children:i.jsxs("div",{className:"settings-mobile-form-row",children:[i.jsxs("div",{className:"settings-mobile-row-copy",children:[i.jsx("span",{className:"settings-mobile-row-title",children:h("settings.defaultPermissionMode")}),i.jsx("span",{className:"settings-mobile-row-description",children:h("settings.defaultPermissionModeDescription")})]}),i.jsx("select",{"aria-label":h("settings.defaultPermissionMode"),className:"settings-select settings-mobile-select",value:e.accountPreferences.defaultPermissionMode,onChange:t=>e.updateDefaultPermissionMode(t.target.value),children:e.permissionModeOptions.map(t=>i.jsx("option",{value:t.value,children:t.label},t.value))})]})})]})}function W4({model:e}){return i.jsxs(i.Fragment,{children:[i.jsxs("section",{className:"settings-mobile-group-section",children:[i.jsx("h2",{className:"settings-mobile-group-title",children:h("settings.softwareUpdate")}),i.jsx("p",{className:"settings-mobile-group-note",children:h("settings.softwareUpdateSectionSummary")}),i.jsx("div",{className:"settings-mobile-card",children:i.jsxs("div",{className:"settings-mobile-form-row",children:[i.jsxs("div",{className:"settings-mobile-row-copy",children:[i.jsx("span",{className:"settings-mobile-row-title",children:h("settings.releaseChannel")}),i.jsx("span",{className:"settings-mobile-row-description",children:h("settings.releaseChannelDescription")})]}),i.jsxs("select",{"aria-label":h("settings.releaseChannel"),className:"settings-select settings-mobile-select",value:e.runtimeConfig.releaseChannel,onChange:t=>e.updateReleaseChannel(t.target.value),children:[i.jsx("option",{value:"stable",children:h("settings.releaseStable")}),i.jsx("option",{value:"beta",children:h("settings.releaseBeta")})]})]})})]}),i.jsxs("section",{className:"settings-mobile-group-section",children:[i.jsx("h2",{className:"settings-mobile-group-title",children:h("settings.serverUpdate")}),i.jsx("div",{className:"settings-mobile-card settings-mobile-release-card",children:i.jsx(c0,{})})]}),e.platform.isWeb?null:i.jsxs("section",{className:"settings-mobile-group-section",children:[i.jsx("h2",{className:"settings-mobile-group-title",children:h("settings.clientUpdate")}),i.jsx("div",{className:"settings-mobile-card",children:i.jsxs("div",{className:"settings-mobile-form-row",children:[i.jsx("div",{className:"settings-mobile-row-copy",children:i.jsx("span",{className:"settings-mobile-row-title",children:h("settings.autoCheckUpdate")})}),i.jsx(qm,{checked:e.runtimeConfig.autoCheckUpdate,label:h("settings.autoCheckUpdate"),onChange:e.updateAutoCheckUpdate})]})}),i.jsx("div",{className:"settings-mobile-card settings-mobile-release-card",children:i.jsx(l0,{})})]})]})}function Ub({onLogout:e}){return i.jsx("div",{className:"settings-mobile-sticky-footer",children:i.jsx("button",{type:"button",className:"settings-mobile-danger-button settings-mobile-danger-button-sticky",onClick:e,children:h("common.logout")})})}function qm({checked:e,label:t,onChange:n}){return i.jsxs("label",{className:"settings-mobile-switch","aria-label":t,children:[i.jsx("input",{type:"checkbox",checked:e,onChange:s=>n(s.target.checked)}),i.jsx("span",{className:"settings-mobile-switch-track","aria-hidden":"true",children:i.jsx("span",{className:"settings-mobile-switch-thumb"})})]})}function Wb(){return i.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:[i.jsx("path",{d:"M10 3.5a6.5 6.5 0 1 0 6.5 6.5c0-.8-.6-1.4-1.4-1.4h-1.6A1.5 1.5 0 0 1 12 7.1V5.5c0-1.1-.9-2-2-2Z"}),i.jsx("circle",{cx:"6.6",cy:"9.2",r:".8",fill:"currentColor",stroke:"none"}),i.jsx("circle",{cx:"8.8",cy:"6.8",r:".8",fill:"currentColor",stroke:"none"}),i.jsx("circle",{cx:"12.1",cy:"6.6",r:".8",fill:"currentColor",stroke:"none"})]})}function z4(){return i.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:[i.jsx("path",{d:"M4 7.5 10 4l6 3.5v5L10 16l-6-3.5v-5Z"}),i.jsx("path",{d:"M10 9.5V16"}),i.jsx("path",{d:"M4 7.5 10 11l6-3.5"})]})}function zb(){return i.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:[i.jsx("rect",{x:"3.5",y:"4",width:"13",height:"9.5",rx:"2.2"}),i.jsx("path",{d:"M7 16h6"}),i.jsx("path",{d:"M10 13.5V16"}),i.jsx("path",{d:"m8 8 2 2 3-3"})]})}function Hb(){return i.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:[i.jsx("path",{d:"M10 3.2 15 5v4.4c0 3-1.9 5.8-5 7.4-3.1-1.6-5-4.4-5-7.4V5l5-1.8Z"}),i.jsx("path",{d:"m8.3 9.8 1.2 1.2 2.4-2.5"})]})}function H4(){return i.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:i.jsx("path",{d:"m4 2 4 4-4 4"})})}function q4(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:i.jsx("path",{d:"m3.5 8.2 2.6 2.6 6-6"})})}function $4(){const e=lx(n=>n.session),t=Xr();if(!e){const n=`${t.pathname}${t.search}`;return i.jsx(Ha,{to:`/login?returnTo=${encodeURIComponent(n)}`,replace:!0})}return i.jsx(af,{})}function qb(){const{shellMode:e}=tr();return i.jsx(Ha,{to:e==="mobile"?"/workspaces":"/landing",replace:!0})}const V4=[{path:"/bootstrap",element:i.jsx(iT,{})},{path:"/login",element:i.jsx(dT,{})},{path:"/",element:i.jsx($4,{}),children:[{element:i.jsx(S4,{}),children:[{index:!0,element:i.jsx(qb,{})},{path:"landing",element:i.jsx(N4,{})},{path:"workspaces",element:i.jsx(f4,{})},{path:"workspaces/:workspaceId",element:i.jsx(g4,{})},{path:"workspaces/:workspaceId/sessions",element:i.jsx(nB,{})},{path:"workspaces/:workspaceId/sessions/:sessionId",element:i.jsx(AO,{})},{path:"workspaces/:workspaceId/tools",element:i.jsx(l4,{})},{path:"workspaces/:workspaceId/tools/files",element:i.jsx(rB,{})},{path:"workspaces/:workspaceId/tools/git",element:i.jsx(iB,{})},{path:"workspaces/:workspaceId/tools/processes",element:i.jsx(NB,{})},{path:"workspaces/:workspaceId/terminals",lazy:async()=>({Component:(await ru(()=>import("./TerminalPage-Dr7knYq2.js"),__vite__mapDeps([0,1]))).TerminalPage})},{path:"settings",element:i.jsx(Bb,{})},{path:"settings/:section",element:i.jsx(Bb,{})},{path:"*",element:i.jsx(qb,{})}]}]}];function G4(){return mP(V4)}function K4(){const e=uo(n=>n.profile.language),t=v.useMemo(()=>G4(),[]);return i.jsx(EP,{children:i.jsx(GP,{children:i.jsx(_P,{language:e,children:i.jsx(zP,{children:i.jsx(VP,{children:i.jsx(SP,{router:t})})})})})})}Kj().finally(()=>{Y1.createRoot(document.getElementById("root")).render(i.jsx(K4,{}))});export{xS as C,vo as M,dB as T,gn as a,_r as b,Mm as c,Wn as d,Kf as e,tr as f,ox as g,Kn as h,X4 as i,Mn as j,i as k,cB as l,nW as m,Zw as n,Z4 as o,tW as p,On as q,v as r,Am as s,h as t,An as u,J4 as v,jr as w,uB as x,eW as y,Y4 as z};